Fix for bug #10542: changing particle visualisation type from object to
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 5 May 2008 21:10:32 +0000 (21:10 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 5 May 2008 21:10:32 +0000 (21:10 +0000)
something else didn't work correct.
Fix for bug #10478: particle system point cache problem.

source/blender/blenkernel/intern/particle_system.c
source/blender/src/buttons_object.c

index 9dd21cdda4ea6b9d2f28e3766ad6faebb8d84f29..596c381b8964cdad9b3510ebcc18563af68ec74e 100644 (file)
@@ -4763,6 +4763,9 @@ static void system_step(Object *ob, ParticleSystem *psys, ParticleSystemModifier
                                psys_update_path_cache(ob,psmd,psys,framenr);
                        }
 
+                       cache->simframe= framenr;
+                       cache->flag |= PTCACHE_SIMULATION_VALID;
+
                        return;
                }
                else if(ob->id.lib || (cache->flag & PTCACHE_BAKED)) {
index 37becdc89122f4f005d9345fd3278d573773fa39..0cfc2047aec9b8e7f9138fe3ab7ca17e53c7eb80 100644 (file)
@@ -3010,6 +3010,16 @@ void do_effects_panels(unsigned short event)
        case B_PART_INIT_CHILD:
        case B_PART_RECALC_CHILD:
                if(psys) {
+                       nr=0;
+                       for(psys=ob->particlesystem.first; psys; psys=psys->next){
+                               if(ELEM(psys->part->draw_as,PART_DRAW_OB,PART_DRAW_GR))
+                                       nr++;
+                       }
+                       if(nr)
+                               ob->transflag |= OB_DUPLIPARTS;
+                       else
+                               ob->transflag &= ~OB_DUPLIPARTS;
+
                        DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
                        allqueue(REDRAWVIEW3D, 0);
                        allqueue(REDRAWBUTSOBJECT, 0);