[Bf-blender-cvs] [bb0b4b008ed] blender2.8: Pseudo-fix for ARMATURE_OT_autoside_names and x-mirror

Dalai Felinto noreply at git.blender.org
Sat Oct 6 00:50:55 CEST 2018


Commit: bb0b4b008edb59dc5ff0902b0f132cbd72cadf56
Author: Dalai Felinto
Date:   Fri Oct 5 19:41:48 2018 -0300
Branches: blender2.8
https://developer.blender.org/rBbb0b4b008edb59dc5ff0902b0f132cbd72cadf56

Pseudo-fix for ARMATURE_OT_autoside_names and x-mirror

It now works like 2.7x. That said this operator is kind of incompatible with
x-mirror (the way it is implemented anyways). But if people were happy with
this in 2.7x they will be multi-object happier.

That said, do turn off x-mirror before using this or select all bones, or just
stop using this operator altogether ;)

Jokes aside, the operator can also be fixed. It shouldn't be hard.

===================================================================

M	source/blender/editors/armature/armature_naming.c

===================================================================

diff --git a/source/blender/editors/armature/armature_naming.c b/source/blender/editors/armature/armature_naming.c
index 0135df646f9..687dad4745e 100644
--- a/source/blender/editors/armature/armature_naming.c
+++ b/source/blender/editors/armature/armature_naming.c
@@ -503,6 +503,20 @@ static int armature_autoside_names_exec(bContext *C, wmOperator *op)
 
 		for (EditBone *ebone = arm->edbo->first; ebone; ebone = ebone->next) {
 			if (EBONE_EDITABLE(ebone)) {
+
+				/* We first need to do the flipped bone, then the original one.
+				 * Otherwise we can't find the flipped one because of the bone name change. */
+				if (arm->flag & ARM_MIRROR_EDIT) {
+					EditBone *flipbone = ED_armature_ebone_get_mirrored(arm->edbo, ebone);
+					if ((flipbone) && !(flipbone->flag & BONE_SELECTED)) {
+						BLI_strncpy(newname, flipbone->name, sizeof(newname));
+						if (bone_autoside_name(newname, 1, axis, flipbone->head[axis], flipbone->tail[axis])) {
+							ED_armature_bone_rename(bmain, arm, flipbone->name, newname);
+							changed = true;
+						}
+					}
+				}
+
 				BLI_strncpy(newname, ebone->name, sizeof(newname));
 				if (bone_autoside_name(newname, 1, axis, ebone->head[axis], ebone->tail[axis])) {
 					ED_armature_bone_rename(bmain, arm, ebone->name, newname);



More information about the Bf-blender-cvs mailing list