[#26848] Keyed Particles seems to be broken
authorJanne Karhu <jhkarh@gmail.com>
Sun, 10 Apr 2011 11:24:29 +0000 (11:24 +0000)
committerJanne Karhu <jhkarh@gmail.com>
Sun, 10 Apr 2011 11:24:29 +0000 (11:24 +0000)
* Explode modifier wasn't updated properly when keyed particles were used.
* Explode modifier didn't get correct locations for grid distributed particles.

source/blender/blenkernel/intern/particle_system.c
source/blender/modifiers/intern/MOD_explode.c

index 13f5d619daab822580979639fa38fc7eb5b4c639..1c05b854ef79357ec497f0fef44956645a3dd4b2 100644 (file)
@@ -4311,6 +4311,9 @@ void particle_system_update(Scene *scene, Object *ob, ParticleSystem *psys)
                                                free_keyed_keys(psys);
                                                distribute_particles(&sim, part->from);
                                                initialize_all_particles(&sim);
+
+                                               /* flag for possible explode modifiers after this system */
+                                               sim.psmd->flag |= eParticleSystemFlag_Pars;
                                        }
 
                                        LOOP_EXISTING_PARTICLES {
index 36e804607cf48b529fa067e31e400e3f0154acdf..924035538da86401dab6ebc1f58803e023bf534f 100644 (file)
@@ -148,7 +148,7 @@ static void createFacepa(ExplodeModifierData *emd,
        /* make tree of emitter locations */
        tree=BLI_kdtree_new(totpart);
        for(p=0,pa=psys->particles; p<totpart; p++,pa++){
-               psys_particle_on_dm(psmd->dm,psys->part->from,pa->num,pa->num_dmcache,pa->fuv,pa->foffset,co,NULL,NULL,NULL,NULL,NULL);
+               psys_particle_on_emitter(psmd,psys->part->from,pa->num,pa->num_dmcache,pa->fuv,pa->foffset,co,NULL,NULL,NULL,NULL,NULL);
                BLI_kdtree_insert(tree, p, co, NULL);
        }
        BLI_kdtree_balance(tree);