Python Script To Rename Bones In Armature I was wondering if there was a python script that I could run in the text editor that would go through all the bones in a selected armature and remove the numbers from their name??
The bone names have to be the same if you want to append animations from other files, but this software I'm using always adds numbers to the bones depending on how many times you've exported a skeleton.
This skeleton contains a 31 before all the bone names. In other files it will be 45, or 129, so on so fourth. If I could run a simple script that would just remove all the numbers in each bone name, it would save me a lot of trouble from having to do it manually.
Thank you for your time!!!
This will replace &quot;Skel123:&quot;, etc. with just &quot;Skel:&quot; in the names of bones (edit: and their armature, and their armature's object). Select the armature you want to do it to and make sure you are in Object mode before running it.
import bpy, re
ob = bpy.context.active_object
assert ob.type == &quot;ARMATURE&quot;
assert bpy.context.mode == 'OBJECT'
for thing in [ob, ob.data, *ob.data.bones]:
    thing.name = re.sub(r'Skel[0-9]+:', 'Skel:', thing.name)

If you want to remove all numbers instead of just the ones from the &quot;Skel:&quot; part, you can use re.sub(r'[0-9]', '', thing.name) instead.