Fix T42395: Stored "render data" in particles mismatches the particle
authorLukas Tönne <lukas.toenne@gmail.com>
Wed, 29 Oct 2014 17:47:11 +0000 (18:47 +0100)
committerLukas Tönne <lukas.toenne@gmail.com>
Wed, 29 Oct 2014 17:48:44 +0000 (18:48 +0100)
amount and crashes after Cycles render.

This is a hack to fix this, but at this point the system is hopelessly
broken anyway and no good fix other than total rewriting is possible.

source/blender/makesdna/DNA_particle_types.h
source/blender/makesrna/intern/rna_particle.c

index a2a724b6a32693c0a8d03d8326fb792dd68dcb8a..dd25a49c476f5caea5c978d66758614b836858a4 100644 (file)
@@ -293,7 +293,7 @@ typedef struct ParticleSystem {
        short vgroup[12], vg_neg, rt3;                  /* vertex groups, 0==disable, 1==starting index */
 
        /* temporary storage during render */
-       void *renderdata;
+       struct ParticleRenderData *renderdata;
 
        /* point cache */
        struct PointCache *pointcache;
index 113311383f4dde5459031806112753e20c005450..47d8263d71f502554a40729e7a51c156565919cf 100644 (file)
@@ -589,8 +589,14 @@ static void rna_ParticleSystem_set_resolution(ParticleSystem *particlesystem, Sc
                particle_system_update(scene, object, particlesystem);
        }
        else {
-               if (particlesystem->renderdata)
+               ParticleSystemModifierData *psmd = psys_get_modifier(object, particlesystem);
+               
+               if (particlesystem->renderdata) {
                        psys_render_restore(object, particlesystem);
+               }
+               
+               psmd->flag &= ~eParticleSystemFlag_psys_updated;
+               particle_system_update(scene, object, particlesystem);
        }
 }