diff options
author | Joshua Leung <aligorith@gmail.com> | 2011-07-22 15:53:20 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2011-07-22 15:53:20 +0400 |
commit | 1e19f1cde1ca58c9149faa8ab39539a3c200a01c (patch) | |
tree | 7d0851c3eb28a71ee5c1b7f97283a1aeeef12867 /source/blender/editors/armature/poseobject.c | |
parent | 0adad30e3f5b914d0a101ba6efb07f3fd2d8669e (diff) |
Bugfix [#27959] Error on Paste X-Fliped pose
Paste pose no longer just does a blind "replace all properties" on
bones that it pastes on. Instead:
* when properties exist on the target already - only change the
properties in common
* when properties don't already exist - copy all properties
Diffstat (limited to 'source/blender/editors/armature/poseobject.c')
-rw-r--r-- | source/blender/editors/armature/poseobject.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c index 01c9839220e..20165a67879 100644 --- a/source/blender/editors/armature/poseobject.c +++ b/source/blender/editors/armature/poseobject.c @@ -1107,21 +1107,19 @@ static int pose_paste_exec (bContext *C, wmOperator *op) } } - /* ID properties - * - only free the existing properties if the channel we're copying from has them - * NOTE: this means that if the pose depends on some pchan property, the pose may not be ok, - * but this is better than loosing all the setting you've painstakingly added... - */ + /* ID properties */ if (chan->prop) { - /* free the old properties since we want to replace them now */ if (pchan->prop) { - IDP_FreeProperty(pchan->prop); - MEM_freeN(pchan->prop); - pchan->prop= NULL; + /* if we have existing properties on a bone, just copy over the values of + * matching properties (i.e. ones which will have some impact) on to the + * target instead of just blinding replacing all [ + */ + IDP_SyncGroupValues(pchan->prop, chan->prop); + } + else { + /* no existing properties, so assume that we want copies too? */ + pchan->prop= IDP_CopyProperty(chan->prop); } - - /* now copy over the new copy of the properties */ - pchan->prop= IDP_CopyProperty(chan->prop); } /* keyframing tagging */ |