diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2014-11-05 16:51:02 +0300 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2014-11-05 16:53:17 +0300 |
commit | 3361be9b6b00ff26977eef4f52172be65ec32032 (patch) | |
tree | 072418a7dc785178c09db93db8df73bb5800d6b5 /source | |
parent | 67ec0ef277d862ff69ff667566502045c1b93493 (diff) |
Fix T42255: "Copy Constraints" operator has to tag the affected object
and pose for depsgraph.
Otherwise the update order can be incorrect until the next sort is
executed.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/object/object_constraint.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index 7c11b3e9879..80d63ccb446 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -1399,6 +1399,8 @@ static int pose_constraint_copy_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); bPoseChannel *pchan = CTX_data_active_pose_bone(C); + ListBase lb; + CollectionPointerLink *link; /* don't do anything if bone doesn't exist or doesn't have any constraints */ if (ELEM(NULL, pchan, pchan->constraints.first)) { @@ -1407,16 +1409,22 @@ static int pose_constraint_copy_exec(bContext *C, wmOperator *op) } /* copy all constraints from active posebone to all selected posebones */ - CTX_DATA_BEGIN (C, bPoseChannel *, chan, selected_pose_bones) - { + CTX_data_selected_pose_bones(C, &lb); + for (link = lb.first; link; link = link->next) { + Object *ob = link->ptr.id.data; + bPoseChannel *chan = link->ptr.data; + /* if we're not handling the object we're copying from, copy all constraints over */ if (pchan != chan) { BKE_constraints_copy(&chan->constraints, &pchan->constraints, true); /* update flags (need to add here, not just copy) */ chan->constflag |= pchan->constflag; + + ob->pose->flag |= POSE_RECALC; + DAG_id_tag_update((ID *)ob, OB_RECALC_DATA); } } - CTX_DATA_END; + BLI_freelistN(&lb); /* force depsgraph to get recalculated since new relationships added */ DAG_relations_tag_update(bmain); |