diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2018-10-17 00:41:45 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2018-10-17 00:41:45 +0300 |
commit | 647218af07dab9d3abd9c3a058701ea36c87930d (patch) | |
tree | 94d6c1efbcd4652006b7b1fd172cc7a05c10a46f /source/blender | |
parent | f3153f1c7f57c054ecc7d0f986c6afc1d70ffb7d (diff) |
Multi-Objects: POSE_OT_constraints_clear
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/object/object_constraint.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index 841f59ca191..cfb781fcc28 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -1421,13 +1421,19 @@ void CONSTRAINT_OT_move_up(wmOperatorType *ot) static int pose_constraints_clear_exec(bContext *C, wmOperator *UNUSED(op)) { Main *bmain = CTX_data_main(C); - Object *ob = BKE_object_pose_armature_get(CTX_data_active_object(C)); + Object *prev_ob = NULL; /* free constraints for all selected bones */ - CTX_DATA_BEGIN (C, bPoseChannel *, pchan, selected_pose_bones) + CTX_DATA_BEGIN_WITH_ID (C, bPoseChannel *, pchan, selected_pose_bones, Object *, ob) { BKE_constraints_free(&pchan->constraints); pchan->constflag &= ~(PCHAN_HAS_IK | PCHAN_HAS_SPLINEIK | PCHAN_HAS_CONST); + + if (prev_ob != ob) { + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT | ND_CONSTRAINT | NA_REMOVED, ob); + prev_ob = ob; + } } CTX_DATA_END; @@ -1436,10 +1442,6 @@ static int pose_constraints_clear_exec(bContext *C, wmOperator *UNUSED(op)) /* note, calling BIK_clear_data() isn't needed here */ - /* do updates */ - DEG_id_tag_update(&ob->id, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT | ND_CONSTRAINT | NA_REMOVED, ob); - return OPERATOR_FINISHED; } |