Page MenuHome

Batch Rename: Numbering support
Confirmed, LowPublicTO DO


Currently batch renaming relies on Blender to number duplicates.

Numbering could be supported:

Example: a chain of finger bones. These would usually be named Index.01.L, Index.02.L, Index.03.L and so forth.

For numbering to work usefully we would want a way to sort items before they're numbered (by their current alphabetical order, hierarchy, location... possibly others).

This needs some design to think of how to expose this to users usefully, see suggestion: rBa5b1231de790#244815

Event Timeline

I think there should be support for incrementing, decrementing, and re-setting numbers, and using an arbitrary start value. So, for example, a user could rename a chain of bones "foo.004.L" "foo.003.L" "foo.002.L" if they wanted to.
It's also a good idea to think about using nested numbers. A Spider, for example, has eight legs and many segments per leg. The fifth bone on the third leg may be called Leg.002.004.L. Using this naming convention is easy for scripting, in my experience. Perhaps the batch rename operator could have a feature for renaming multiple bone chains at a time? Finally, it should be possible to keep number/left/right as is. Some users may wish for the option to start with 1 instead of 0, some users may wish to use zero padding, others will not ( 002 vs 2).

Additionally, it may be useful to automatically find the other bones in the chain, so that the user doesn't have to select each one. For disconnected bone chains, you could compare the location and direction of each head/tail within the current bone layer. This would fail if bones are in the same layer and location, so some additional testing logic may become necessary here. Bone chains also have to manage branches. The rename script I use just selects the first bone in the branch and keeps going when finding branches in chains of bones- following the behavior of the L key in armature edit mode. Alternatively, it treats branch in a chain as a separate chain altogether. For rigs that are heavily branches, such as rigs for trees, it may be convenient to have an automatic tool for creating names like "trunk.000.branch.003.twig.004.leaf.002". If you choose to have a feature to extend the batch rename feature to bone chains, it may be useful to select bones based on a similar parent structure, too: for example, each bone is parented to another sequence of bones- child.000 is child of parent.000, child.001 of parent.001 etc. In this situation, the rigger probably wants to rename all of the child bones, and needs the tool to select and rename them even if they or their parents are named badly to begin with. Another useful feature would be to automatically rename bones that are symmetrical. The difficulty of this sort of tool is that you have to work from the assumption that things are named badly to begin with if you want an operator that handles the edge cases.

I have a Python Script that handles some of this, which I'd be happy to share if it's helpful. I'm working on it, and the above is essentially my to-do list for the tool. I plan on separating these into a few different operators, and I think implementing all of those behaviors will be a little heavy for a single operator. But this should help identify some of the use cases for renaming bones in particular. And of course, if you'd like me to elaborate about the specific use-case for these ideas, I'd be happy to do so.

Hi with respect to description mentioned in T69478 -
Numbering based on their Z location, I have a few questions : how should the tie be broken if say 2 cubes at the same height (Z direction) ?
This is a stupid one but I still don't get it Numbering should be done on homogeneous objects ( all Cubes, all bones ) or can be done on heterogeneous objects( Cube,sphere,planes etc) ?