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:
authorBastien Montagne <montagne29@wanadoo.fr>2016-05-15 13:35:01 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2016-05-15 13:35:01 +0300
commit20714889bfda54b9c39744372d2456bc6bf4d3ad (patch)
tree8b121814918e7919bc64217bd0320fc1a531a486 /source/blender/editors/armature
parenta83bc4f59707ab5a09c24f0b04d2d57d03fb2d2b (diff)
Fix T48425: Armature Symmetrize is flipping Custom Shape parameter.
In case not all bones are selected, not all possible mirrors are set in editbone->temp.ebone, so we need to search them...
Diffstat (limited to 'source/blender/editors/armature')
-rw-r--r--source/blender/editors/armature/armature_add.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/source/blender/editors/armature/armature_add.c b/source/blender/editors/armature/armature_add.c
index 218f215a350..6afc5a357c8 100644
--- a/source/blender/editors/armature/armature_add.c
+++ b/source/blender/editors/armature/armature_add.c
@@ -291,12 +291,8 @@ void preEditBoneDuplicate(ListBase *editbones)
/**
* Helper function for #postEditBoneDuplicate,
* return the destination pchan from the original.
- *
- * \param use_orig_fallback: return the input value if no new channel is found.
*/
-static bPoseChannel *pchan_duplicate_map(
- const bPose *pose, GHash *name_map,
- bPoseChannel *pchan_src, bool use_orig_fallback)
+static bPoseChannel *pchan_duplicate_map(const bPose *pose, GHash *name_map, bPoseChannel *pchan_src)
{
bPoseChannel *pchan_dst = NULL;
const char *name_src = pchan_src->name;
@@ -305,7 +301,7 @@ static bPoseChannel *pchan_duplicate_map(
pchan_dst = BKE_pose_channel_find_name(pose, name_dst);
}
- if ((pchan_dst == NULL) && use_orig_fallback) {
+ if (pchan_dst == NULL) {
pchan_dst = pchan_src;
}
@@ -325,6 +321,9 @@ void postEditBoneDuplicate(struct ListBase *editbones, Object *ob)
for (EditBone *ebone_src = editbones->first; ebone_src; ebone_src = ebone_src->next) {
EditBone *ebone_dst = ebone_src->temp.ebone;
+ if (!ebone_dst) {
+ ebone_dst = ED_armature_bone_get_mirrored(editbones, ebone_src);
+ }
if (ebone_dst) {
BLI_ghash_insert(name_map, ebone_src->name, ebone_dst->name);
}
@@ -338,7 +337,7 @@ void postEditBoneDuplicate(struct ListBase *editbones, Object *ob)
bPoseChannel *pchan_dst = BKE_pose_channel_find_name(ob->pose, ebone_dst->name);
if (pchan_dst) {
if (pchan_src->custom_tx) {
- pchan_dst->custom_tx = pchan_duplicate_map(ob->pose, name_map, pchan_src->custom_tx, true);
+ pchan_dst->custom_tx = pchan_duplicate_map(ob->pose, name_map, pchan_src->custom_tx);
}
}
}
@@ -682,7 +681,7 @@ static int armature_symmetrize_exec(bContext *C, wmOperator *op)
}
}
- /* Run though the list and fix the pointers */
+ /* Run through the list and fix the pointers */
for (ebone_iter = arm->edbo->first; ebone_iter && ebone_iter != ebone_first_dupe; ebone_iter = ebone_iter->next) {
if (ebone_iter->temp.ebone) {
/* copy all flags except for ... */