Just needed to make all of my bone names unique so I could manage them easier (had a bunch of duplicate names). Took like four minutes to write a script to do this. It's just amazing to be able to do that.
I don't think I'd ever be able to exhaust the possibilities of AS or lua scripting. Granted there are things scripting can't do, but man, all the things it can do is awesome.
Uh, well it's a menu script, so it could also be used as a button. I didn't post it because I didn't think anyone else would find it useful. It only renames the selected bones by numbering them, nothing fancy.
I'm ok for naming bones with the small amount i use so it's no problem to rename them by hand but your post started me wondering....is it hard to create a script that will create an instant rig with bone names? Just curious.
Even better would be a scrpt that will instantly name the bones in any rig you have created in AS say the root bone, left1, left2, left3, right1, right2, right3 etc ...maybe this script could allow you type in your preferences for bone names too?
Just a seed for an idea that would be very time saving.
That's all beyond my scripting ability right now. I know Genete has a script or two that generates bones, but I have no idea how to do that yet.
It might be possible to modify the add bone tool so that you have some control over the automatic naming. Like checking a left or right checkbox to add 'left' or 'right' to the end of each bone's name as they are created.
That might help with Vern's flip bones script, but it's very low on my priorities.
This script renames bones (with or without originally having names). But it doesn't do this in any specified order. It just cycles through them and names them 1, 2, 3, ...etc. Very simple.
Yes, this could name (by numbering) bones in a newly created rig. Right now it is only a menu script so it has to be run after all the bones are created, although it can be rerun after any additions.
The hard part would be to try to specify what bones get what names (like left and right). It is beyond my scripting ability to tell whether a bone is a left arm or right foot. If I had to guess, I'd say this is probably hard even for the scripting gurus.
Like I said, I only needed this to make all of the names unique after doing a lot of copy/paste bones.
If it were made into a tool then you could have a checkbox for adding a left or right extension to the numbering (like "3 left"). Then since I did this to work on only selected bones you could select all of the bone for one side, rename, and then do the same for the other side.
I guess I could add a dialog to choose the extension though. That wouldn't be too hard.
I would be really interested in using your script just to name bones synthsin75.
Is it hard get the script to identify the root bone?
Maybe the script names the bones in the same way each time staring with the root bone? Assuming it does, you could probably have it create the first bone name as root?
It always names the bones in the order of creation, it seems. So yeah, it'd be pretty easy to tell it to name the first bone that was created on the layer 'root'. Let me see if I can get that done, and I'll post it for you.
Fantastic! Thanks synthsin75 I will use it ALL the time. I do a lot of work with bone contraints and scaling with master and slave bones and it's a bit of a slowdown to have to stop and give the bones identifier names. This will be so cool!!!!
Here it is, but I'm not real sure how much better this is than enabling 'auto-name bones and shapes' in the preferences. Like I said, I only needed this because I had too many bones with duplicate names.
Thanks synthsin75....oops...you know, after all these years of using AS I did'nt know about auto naming bones and shapes
No matter....it still would be an improvement to have the first bone named as "root" . I'll give it a shot and let you know.