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-11-06 15:27:28 +0300
committerCampbell Barton <ideasman42@gmail.com>2009-11-06 15:27:28 +0300
commitaa7374e471bfb89242cfac855505269d0e728ea5 (patch)
treeaa5eaf8d8092df7ab31698b68d6826b38045be97 /source/blender/editors/physics
parent5a12b7d159371709580cf8fb07fd10d3c3bfdff3 (diff)
- removing the last particle system now exits particle edit mode.
- py UI script used an undeclared variable
Diffstat (limited to 'source/blender/editors/physics')
-rw-r--r--source/blender/editors/physics/particle_object.c11
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 d227591739b..d763c0500d2 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;