diff options
Diffstat (limited to 'source/blender/editors/physics/particle_object.c')
-rw-r--r-- | source/blender/editors/physics/particle_object.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/editors/physics/particle_object.c b/source/blender/editors/physics/particle_object.c index bd94f7ff5bb..0c24e3fff0a 100644 --- a/source/blender/editors/physics/particle_object.c +++ b/source/blender/editors/physics/particle_object.c @@ -93,11 +93,20 @@ static int particle_system_remove_exec(bContext *C, wmOperator *op) { Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; Scene *scene = CTX_data_scene(C); - + int mode_orig = ob->mode; if(!scene || !ob) return OPERATOR_CANCELLED; object_remove_particle_system(scene, ob); + + /* possible this isn't the active object + * object_remove_particle_system() clears the mode on the last psys + * */ + if(mode_orig & OB_MODE_PARTICLE_EDIT) + if((ob->mode & OB_MODE_PARTICLE_EDIT)==0) + if(scene->basact && scene->basact->object==ob) + WM_event_add_notifier(C, NC_SCENE|ND_MODE|NS_MODE_OBJECT, NULL); + WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); return OPERATOR_FINISHED; |