diff options
author | Janne Karhu <jhkarh@gmail.com> | 2012-03-20 16:59:45 +0400 |
---|---|---|
committer | Janne Karhu <jhkarh@gmail.com> | 2012-03-20 16:59:45 +0400 |
commit | ad1a181316ae4002d5d77fd2fa298c92b6f0c2b5 (patch) | |
tree | 24a680309985b10cf11fef015313cb44f9de7322 | |
parent | 12be17bfa4c1e9f40dd5f723ca78c6ca9331c668 (diff) |
Fix for [#30445] Particle simulation, rekey crashes blender
- Entering particle mode crashed due to missing checks if a particle didn't have any baked keys.
- The rekey functionality is only supported for hair, so replaced the operator poll function with the correct one.
- Also replaced a couple of other "only hair" operator poll functions to the correct ones.
-rw-r--r-- | source/blender/editors/physics/particle_edit.c | 10 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/drawobject.c | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index dad4688a577..57809b2243b 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -1969,7 +1969,7 @@ void PARTICLE_OT_rekey(wmOperatorType *ot) /* api callbacks */ ot->exec= rekey_exec; ot->invoke= WM_operator_props_popup; - ot->poll= PE_poll; + ot->poll= PE_hair_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -2298,7 +2298,7 @@ void PARTICLE_OT_subdivide(wmOperatorType *ot) /* api callbacks */ ot->exec= subdivide_exec; - ot->poll= PE_poll; + ot->poll= PE_hair_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -2386,7 +2386,7 @@ void PARTICLE_OT_remove_doubles(wmOperatorType *ot) /* api callbacks */ ot->exec= remove_doubles_exec; - ot->poll= PE_poll; + ot->poll= PE_hair_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -2436,7 +2436,7 @@ void PARTICLE_OT_weight_set(wmOperatorType *ot) /* api callbacks */ ot->exec= weight_set_exec; - ot->poll= PE_poll; + ot->poll= PE_hair_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -2699,7 +2699,7 @@ void PARTICLE_OT_mirror(wmOperatorType *ot) /* api callbacks */ ot->exec= mirror_exec; - ot->poll= PE_poll; + ot->poll= PE_hair_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index a8f5aff2e1c..f470accae82 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -4911,7 +4911,7 @@ static void draw_ptcache_edit(Scene *scene, View3D *v3d, PTCacheEdit *edit) cd=cdata; pd=pdata; for (i=0, point=edit->points; i<totpoint; i++, point++) { - if (point->flag & PEP_HIDE) + if (point->flag & PEP_HIDE || point->totkey == 0) continue; if (point->keys->flag & PEK_USE_WCO) @@ -4931,7 +4931,7 @@ static void draw_ptcache_edit(Scene *scene, View3D *v3d, PTCacheEdit *edit) } else if (pset->selectmode == SCE_SELECT_END) { for (i=0, point=edit->points; i<totpoint; i++, point++) { - if ((point->flag & PEP_HIDE)==0) { + if ((point->flag & PEP_HIDE)==0 && point->totkey) { key = point->keys + point->totkey - 1; if (key->flag & PEK_SELECT) glColor3fv(sel_col); |