Bugfixes for particle mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Tue, 13 Oct 2009 17:15:12 +0000 (17:15 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Tue, 13 Oct 2009 17:15:12 +0000 (17:15 +0000)
* Fix crash removing all particles.
* Brush added particles did not get correct coordinates.

source/blender/editors/physics/particle_edit.c
source/blender/editors/space_view3d/drawobject.c

index d4a180e242734462b25619272355a6283774dfe7..74ed6451d29a9d0e9cb00ee0212a001f86baa0e8 100644 (file)
@@ -3003,6 +3003,9 @@ static void brush_add(PEData *data, short number)
                        for(k=0, hkey=pa->hair; k<pa->totkey; k++, hkey++, key++) {
                                key->co= hkey->co;
                                key->time= &hkey->time;
+
+                               if(!(psys->flag & PSYS_GLOBAL_HAIR))
+                                       key->flag |= PEK_USE_WCO;
                        }
                        
                        pa->size= 1.0f;
index 096129f6f9ef2e89f165b9510adaab3f996f90c0..78dd53e72713d7ff3ef3452140cf1e437835eb22 100644 (file)
@@ -4237,7 +4237,7 @@ static void draw_ptcache_edit(Scene *scene, View3D *v3d, RegionView3D *rv3d, Obj
                                if(!(point->flag & PEP_HIDE))
                                        totkeys += point->totkey;
 
-                       if(!(edit->points->keys->flag & PEK_USE_WCO))
+                       if(edit->points && !(edit->points->keys->flag & PEK_USE_WCO))
                                pd=pdata=MEM_callocN(totkeys*3*sizeof(float), "particle edit point data");
                        cd=cdata=MEM_callocN(totkeys*(timed?4:3)*sizeof(float), "particle edit color data");