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!!! enter image description here


1 Answer 1


This will replace "Skel123:", etc. with just "Skel:" 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 == "ARMATURE"
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 "Skel:" part, you can use re.sub(r'[0-9]', '', thing.name) instead.

  • $\begingroup$ BRO!!! You're the man-! Goodness gracious, I wasn't expecting this much awesome. The code is beautiful, and works perfectly :) If you don't mind me asking one last thing, what addition to the code would I need to make if I also want it to remove numbers from the name of the armature itself? The bone names were all fixed, but the armature itself was still named "Skel31:Refernce". If possible, I'd like it to just be "Skel:Reference" - If that's too much to ask, I understand, thank you for providing what you have :) $\endgroup$
    – GoodNight
    Sep 2, 2020 at 21:23
  • $\begingroup$ Glad it worked for you :) I've updated it to change the armature/object name too. $\endgroup$
    – scurest
    Sep 2, 2020 at 21:36
  • $\begingroup$ Thank you! It's perfect :) $\endgroup$
    – GoodNight
    Sep 2, 2020 at 22:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .