From 23214ecad03bfef75c78b6a812970959da363344 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 12 Feb 2015 07:25:36 +1100 Subject: Outliner: ContextMenus for constraints/modifiers Context menu to toggle render, visibility & delete D996 by @lichtwerk --- source/blender/editors/object/object_constraint.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index 8f793f7f7f9..97d926761b5 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -1182,20 +1182,13 @@ static int constraint_delete_exec(bContext *C, wmOperator *UNUSED(op)) Object *ob = ptr.id.data; bConstraint *con = ptr.data; ListBase *lb = get_constraint_lb(ob, con, NULL); - const bool is_ik = ELEM(con->type, CONSTRAINT_TYPE_KINEMATIC, CONSTRAINT_TYPE_SPLINEIK); /* free the constraint */ - if (BKE_constraint_remove(lb, con)) { + if (BKE_constraint_remove_ex(lb, ob, con, true)) { /* there's no active constraint now, so make sure this is the case */ - BKE_constraints_active_set(lb, NULL); - + BKE_constraints_active_set(&ob->constraints, NULL); ED_object_constraint_update(ob); /* needed to set the flags on posebones correctly */ - /* ITASC needs to be rebuilt once a constraint is removed [#26920] */ - if (is_ik) { - BIK_clear_data(ob->pose); - } - /* notifiers */ WM_event_add_notifier(C, NC_OBJECT | ND_CONSTRAINT | NA_REMOVED, ob); -- cgit v1.2.3