Page MenuHome

Flip Names removes Bone numbers
Closed, ArchivedPublic

Description

I just wanted to mirror some bones. So i duplicated the armature, deleted anything that shouldn't be mirrored, used Flip Names to have left and right and joined the armatures. But in more recent versions flip names strips of the number of a bone like "bone.L001" and names it "bone.R". "bone.L002" is now "bone.R001" and so on. Obviously this shouldn't be the case, because now both bones that belong together are named "bone.L001" and "bone.R", which are not recognized as mirrored.

My strong guess is that you developers are confused what this method should do, because it lacks an exact definition:

A) Someone thought it would be wise to strip of the numbers. Because duplicating a bone named "bone.L" would give a duplicate named "bone.L001" which should be flipped/renamed to "bone.R". But this isn't wise, because a bone named "bone.L001" might already exist, or it actually was "bone.L001" from the beginning. See #34134 for a typical result. All bones on the right side (.R) are off one number. http://projects.blender.org/tracker/index.php?func=detail&aid=34134&group_id=9&atid=498

B) Someone else thought that it would be wise to not strip of the numbers. This makes mirroring rather complicated (the method mentioned at the beginning), but it always works and does not confuse bone names.

If would luckily choose option C (a method that actually mirrors a bone with it's constraints or can copy constraints mirrored to the other side of the armature), but since i'm realist, i would highly recommend to go back to method B, because it works and doesn't produce bullshit like method A does.

PS: Still did not find it out, but armatures tend to loose all constraints recently if bones are copied to be mirrored or originally mirrored bones get deleted (x-mirror = off). I could not reproduce it right now, but i just tried to help another user which had the exact same problem. All constraints gone.

Details

Type
To Do

Event Timeline

I would think this convention is there since we added mirror edit, where riggers are defaulting to regular names, and the .001 numbering only used by blender duplicate tools.
Your case A therefore I would consider expected and useful.

In the early days of 2.5 recode we opened a mailing list for expert riggers to feedback Joshua on his work, make sure things are usable and still advanced.
Such feedback system we should put back before changing conventions in Blender like this.

No it must have been introduced more recently (maybe by accident). Please consider the following instruction and recreate it yourself in blender to see what happens.

Lets say i create an armature with multiple bones. "Bone" is in the center and "Bone.L"/"Bone.R" are its children (extruded mirrored), which have their own children named "Bone.L001"/"Bone.R001" and so on. Now i often delete "Bone.L" and "Bone.R", because they are useless. A typical example are ears, eyes, shoulders or the hip of characters. Now i have:

Bone
|- Bone.L001
| |- Bone.L002
| | - ...
|- Bone.R001
| |- Bone.R002
| | - ...

Now i added a lot of constraints to the left side (no need to do this in this example) and want to copy/mirror them to the right side. A common way to do this was:
1. Uncheck x-mirror in edit mode of the armature
2. Delete anything that should be replaced by a mirrored duplicate (Bone.R001, Bone.R002, ...)
3. Duplicate the armature and mirror/scale it along x.
4. Remove all bones that shouldn't be mirrored from the copy. (in this case "Bone")
5. Flip the names!!
6. Join the armatures.
7. Make sure that the end of new copied bones is parented correctly to "Bone".
8. (Re)enable x-mirror.
8. Fix the bone roll with an zero edit (for example G 0) while selecting only the left side bones. The right sided bones should adjust automatically.

But there we have a problem. "Bone.L001" will not be renamed to "Bone.R001" by flip names in this case. It will be renamed to "Bone.R" and therefore "Bone.L002" will be renamed to "Bone.R001". Flip names also tries to name it "Bone.R" but can't because it renamed the parent already that way and chooses the next free name which is "Bone.R001". So every bone in the chain is off by one number and the attempt to mirror bones with constraints failed. But this worked perfectly in older versions.

Are you sure you mean
"Bone.L001" and not "Bone.L.001" ?

I couldn't redo the bug with "Bone.L001" naming, But if you mean "Bone.L.001" then this is intentional.

Please always include a simple test file with steps to redo the bug.

Yes i meant Bone.L.001 and so on. My mistake. I appended an example file with multiple layers.

Layer 1: The initial armature
Layer 2: After step 2 in the previous post
Layer 3: After step 3
Layer 4: After step 4
Layer 5: After flip names.

As you should see the right bones (.R) are now renamed, but the first bone has the name "Bone.R", but it should have the name "Bone.R.001", because thats would be the right name to match the left bone, which is obviously still is named "Bone.L.001".

So i now have the pairs:
Bone.R <> Bone.L.001
Bone.R.001 <> Bone.L.002
...

But desired would be:
Bone.R.001 <> Bone.L.001
Bone.R.002 <> Bone.L.002
...

PS: How can that be intentional? This creates a mess if using the traditional method to mirror armatures and it fails regularly if you duplicate in edit mode and then use flip names.

To reproduce the fail in edit mode:
1. Open the appended file
2. Go to layer 2 and enter edit mode.
3. Duplicate the left (.L) bones.
4. Flip the names and mirror them along X (3D-Cursor in center as pivot)

Now you still get "Bone.R" and "Bone.L.001" as a pair.

PPS: To do this stuff right and easy for the user it would really need a method that can directly duplicate and rename (including targets of constraints, an mirroring z-limits from constraints.). Of course this would be a feature request, but currently there is no working method, except that you never try to mirror bones with number suffixes.

I think this could be marked TODO.

Currently if you use rely on bone names being "FooBar.Blah.001" - you can't ensure that the '.001' suffix will be kept across renaming operations since the .001 is treated as a result of duplicate names and stripped.

Agree that ideally this case would work:
Bone.R.001 <> Bone.L.001

But for now its just not supported.

2.49 could handle this. It just didn't strip of the number. A quick hack could be to make the stripping of the number optional for flip names. Then we could at least use the traditional method to mirror bones by duplicating, mirroring and joining the armature, until some better tool is available.

Added to TODO
http://wiki.blender.org/index.php/Dev:2.5/Source/Development/Todo/Animation#Armature