Fix for [#17677] Blender Crash when Baking Boids
authorJanne Karhu <jhkarh@gmail.com>
Thu, 25 Sep 2008 18:31:01 +0000 (18:31 +0000)
committerJanne Karhu <jhkarh@gmail.com>
Thu, 25 Sep 2008 18:31:01 +0000 (18:31 +0000)
- A check for getting the "better" dm was missing from the boids code. I plan on converting the boids code into using the collision modifier one of these days but hopefully this quick fix will do for now.

source/blender/blenkernel/intern/particle_system.c

index 0b5a2b711190149ff60d662cd786abc3a4dae582..e4b8077cd4e76e241d11267763a10021b0a039ba 100644 (file)
@@ -2861,7 +2861,7 @@ int psys_intersect_dm(Object *ob, DerivedMesh *dm, float *vert_cos, float *co1,
 
                dm=mesh_get_derived_final(ob,0);
                if(dm==0)
-                       mesh_get_derived_deform(ob,0);
+                       dm=mesh_get_derived_deform(ob,0);
 
                psys_enable_all(ob);
 
@@ -3319,7 +3319,9 @@ static int boid_see_mesh(ListBase *lb, Object *pob, ParticleSystem *psys, float
                        else{
                                psys_disable_all(ob);
 
-                               dm=mesh_get_derived_deform(ob,0);
+                               dm=mesh_get_derived_final(ob,0);
+                               if(dm==0)
+                                       dm=mesh_get_derived_deform(ob,0);
 
                                psys_enable_all(ob);
                        }