Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2009-09-21 13:17:14 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-09-21 13:17:14 +0400
commit2379af27d10e21c5d471884ee2f78fba62f8534c (patch)
tree543da0c4711f544cb6f1b9a2b560ec5fee347efc /source/blender/editors/space_buttons
parente2e0a864a8c46f4ed836ea7e8fa292276a2137b2 (diff)
tested running the cheat-sheet, found a number of segfaults
pressing escape in the outliner was also crashing (somehow it tried to exit the file selector)
Diffstat (limited to 'source/blender/editors/space_buttons')
-rw-r--r--source/blender/editors/space_buttons/buttons_ops.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/source/blender/editors/space_buttons/buttons_ops.c b/source/blender/editors/space_buttons/buttons_ops.c
index 5466a06550b..4387da19341 100644
--- a/source/blender/editors/space_buttons/buttons_ops.c
+++ b/source/blender/editors/space_buttons/buttons_ops.c
@@ -738,9 +738,9 @@ void PARTICLE_OT_target_move_down(wmOperatorType *ot)
static void disconnect_hair(Scene *scene, Object *ob, ParticleSystem *psys)
{
ParticleSystemModifierData *psmd = psys_get_modifier(ob,psys);
- ParticleData *pa = psys->particles;
- PTCacheEdit *edit = psys->edit;
- PTCacheEditPoint *point = edit ? edit->points : NULL;
+ ParticleData *pa;
+ PTCacheEdit *edit;
+ PTCacheEditPoint *point;
PTCacheEditKey *ekey = NULL;
HairKey *key;
int i, k;
@@ -751,8 +751,11 @@ static void disconnect_hair(Scene *scene, Object *ob, ParticleSystem *psys)
if(!psys->part || psys->part->type != PART_HAIR)
return;
+
+ edit = psys->edit;
+ point= edit ? edit->points : NULL;
- for(i=0; i<psys->totpart; i++,pa++) {
+ for(i=0, pa=psys->particles; i<psys->totpart; i++,pa++) {
if(point) {
ekey = point->keys;
point++;
@@ -820,9 +823,9 @@ void PARTICLE_OT_disconnect_hair(wmOperatorType *ot)
static void connect_hair(Scene *scene, Object *ob, ParticleSystem *psys)
{
ParticleSystemModifierData *psmd = psys_get_modifier(ob,psys);
- ParticleData *pa = psys->particles;
- PTCacheEdit *edit = psys->edit;
- PTCacheEditPoint *point = edit ? edit->points : NULL;
+ ParticleData *pa;
+ PTCacheEdit *edit;
+ PTCacheEditPoint *point;
PTCacheEditKey *ekey;
HairKey *key;
BVHTreeFromMesh bvhtree;
@@ -836,7 +839,10 @@ static void connect_hair(Scene *scene, Object *ob, ParticleSystem *psys)
if(!psys || !psys->part || psys->part->type != PART_HAIR)
return;
-
+
+ edit= psys->edit;
+ point= edit ? edit->points : NULL;
+
if(psmd->dm->deformedOnly)
dm= psmd->dm;
else
@@ -852,7 +858,7 @@ static void connect_hair(Scene *scene, Object *ob, ParticleSystem *psys)
bvhtree_from_mesh_faces(&bvhtree, dm, 0.0, 2, 6);
- for(i=0; i<psys->totpart; i++,pa++) {
+ for(i=0, pa= psys->particles; i<psys->totpart; i++,pa++) {
key = pa->hair;
nearest.index = -1;