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:
Diffstat (limited to 'source/blender/editors/object/object_modifier.c')
-rw-r--r--source/blender/editors/object/object_modifier.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c
index c273b375a06..3d36ed9f45e 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -196,6 +196,11 @@ int ED_object_modifier_remove(ReportList *reports, Main *bmain, Scene *scene, Ob
CustomData_free_layer_active(&me->fdata, CD_MDISPS, me->totface);
}
+ if(ELEM(md->type, eModifierType_Softbody, eModifierType_Cloth) &&
+ ob->particlesystem.first == NULL) {
+ ob->mode &= ~OB_MODE_PARTICLE_EDIT;
+ }
+
BLI_remlink(&ob->modifiers, md);
modifier_free(md);
@@ -658,11 +663,18 @@ static int modifier_remove_exec(bContext *C, wmOperator *op)
Scene *scene= CTX_data_scene(C);
Object *ob = ED_object_active_context(C);
ModifierData *md = edit_modifier_property_get(op, ob, 0);
+ int mode_orig = ob->mode;
if(!ob || !md || !ED_object_modifier_remove(op->reports, bmain, scene, ob, md))
return OPERATOR_CANCELLED;
WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob);
+
+ /* if cloth/softbody was removed, particle mode could be cleared */
+ 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);
return OPERATOR_FINISHED;
}