Renaming Mixamo rigs with Blender’s Python API

“Wait – why is this 3D armature not mirroring properly in Blender?”

This article is also available on Medium.

If you’re like me and you don’t know how to animate a character, chances are you’ve already heard of Adobe’s Mixamo platform, an online collection of free animations:

And then, you might have tried to import one of their FBX animations in your favourite 3D soft, in my case Blender, and found out that the armature’s bone names were… let’s say: not ideal.

For example, in Blender, some armature tools rely on the bones following a specific naming convention but, with a Mixamo rig, bones do not follow this convention. So you simply lose lots of Blender’s armature features.

That’s a shame – but thankfully we can fix this quite easily with a bit of Python scripting! 🙂

“Mixamo Rig Renamer”: a basic Python plugin to fix Mixamo bone names for Blender

I eventually transformed my Python script into a Blender plugin, so if you’re interested and you want to get it for yourself, it’s available for free on my Github 🙂

You can find it over here 🚀

Note: for now, there isn’t a lot in this repo, but I hope I’ll be able to fill it with other utilities as I stumble across more ideas! Don’t hesitate to send me an email or react to this post if you have ideas of your own you think I could implement 😉

Here is a little demo of the plugin:

To use this plugin, download the Python file somewhere on your computer, then open your Preferences panel, go to the Add-ons section and click on “Install”:

Then, pick the Python file and enable the package:

You’ll then have a new panel in your UI, in the Properties panel (“Misc” tab) to rename all Mixamo rigs in your scene directly:

As you can see, the plugin is easy enough to use: you can (optionally) change the Mixamo prefix that is used at the beginning of all bone names (but it should be mixamorig for the current Mixamo FBX animations) and click “Rename”.

The lib will automatically:

  • rename the bones to follow the .L/.R Blender convention
  • rename the corresponding animation curve data
  • re-assign this animation data to the armature(s) in your scene

Why did I develop this little Blender plugin?

This morning, as I was working on a little game prototype, I thought I’d add a few walk and jump animations to my character just to make it more pleasing to the eye. Since, as I mentioned in another CG article, I’m really not an animation expert… I decided to once again use free animations from Mixamo.

Ok – so I downloaded a “walking” FBX animation and imported it in my scene, all went fine. Then, because my character didn’t fit the skeleton, I thought I’d move the bones a little to have them match.

To do that, I wanted to use a really nice feature from Blender: the “X-Axis mirror” edition. This little toggle allows you to move the bones on one side of the armature and have the matching bones on the other side be moved automatically to get a symmetrical armature:

But the issue is that it works by parsing the bone name and matching it against a specific pattern: Blender’s armature naming convention is to add the .L or .R suffix – then, the rest of the name is identical on both sides.

And, when you first load a Mixamo rig, you’ll get bone names that don’t follow this convention and therefore don’t work with the X-Axis mirroring tool:

So I decided I would code up a little script using Blender’s Python API to fix this and rename the bones properly 😉

Writing the plugin

Note: I’ve already talked about the benefits and basics of using Python in Blender in previous articles. If you’re not too familiar with this process, make sure to check them out 😉

The plugin in itself isn’t too complicated. The idea is to go through the name of all of our bones and animation keys and, if any contain Mixamo’s prefix, replace it with a Blender standard equivalent.

For example, the bone mixamorig:LeftArm will be renamed Arm.L. Then, the script will also update the animations that used this bone, so all animation curves that had keys on the mixamorig:LeftArm bone will now have the exact same keys but for the Arm.L bone.

Something to be careful about though is that, when you modify animation curve data, it should not be linked to any armature; so I decided to store the used animations first, then clear them out temporarily and re-assign them once the data has been updated.

Conclusion

Writing up this little plugin was a nice opportunity to play around with Blender’s Python API once again and to discover more about how to tweak and update rigging/animation data.

Don’t hesitate to check out the plugin on Github if you want to use Mixamo files in Blender and get standardised names 🚀

Also, feel free to tell me if you have ideas of other plugins or features I could make! 🙂

6 thoughts on “Renaming Mixamo rigs with Blender’s Python API”

  1. Hi Mina,

    I installed the named python script into Blender 2.9.1 but I have no success yet.
    I can open the misc button e.g. it’s installed and enabled. But all I can see are two options
    Mixamo>Blender and Blender>Mixamo; no button RENAME???
    Pushing the first option has no result in creating a control rig!
    Do you have any idea?

    Best regards

    Manfred

    1. Hi there!
      Happy to know you’re interested in my plugin 🙂
      So:
      1) there is no button “Rename” because I’ve just published a v2 that replaces it with these 2 “Mixamo > Blender” and “Blender > Mixamo” operators… but I haven’t had the time to update the docs yet, sorry! So, the previous “Rename” is now the “Mixamo > Blender” one 🙂
      2) Hum… I’m not sure what you’re trying to do.
      My plugin’s goal is to rename a Mixamo rig to the Blender convention, or vice-versa. You need to first import a FBX Mixamo file that you downloaded from their website, import it in your Blender scene and select it to rename the bones+animations. It won’t create the rig on its own 😉

      Hope it’s clearer,
      feel free to ask any other question!
      Cheers.

      1. Hi Mina,

        thanks for your quick reply in this matter! You understand I’m not happy with my results.

        1) This point is clear and assumed this modification yet. Pushing the first button I see in a drop-down window “undocumented operator”. No other operation follows… hmmm?

        2)Of course I understand and try to rename an imported Mixamo FBX character (ARMATURE) from Mixamo to Blender standard. It’s not an creation of an new rig, but it doesn’t work with the Maximo-addon!
        –> Type Error: None Type object is not subscriptable (screeshots available)
        –> location: unknown location

        Is there any mistake in my Python file? May you send me a “clean” version?

        Sorry, I’m a beginner in this field and a little frustrated 🙁 Any other idea?

        Regards Manfred

        1. Hi!
          So the version online is the “clean” version, it works on my end and for the other people who have tried as well.

          Just to sum up, here the full process I go through to use the plugin:
          1) open Blender
          2) (download + install + enable the plugin if it’s not already ready)
          3) open the Properties panel (shortcut: )
          4) navigate to the “Misc” tab, you see the “Mixamo Rig Renamer” section
          5) import a Mixamo rig (= import one of my .fbx files)
          6) I select the Armature object
          7) I click the “Mixamo > Blender” button
          8) and the bones + animations have been updated

          I don’t know if that helps? :/
          (Check that you did 6) properly because the plugin is not yet fullproof to handling cases where you didn’t select the Armature ^^)

          By the way, the plugin is technically for Blender 2.93+ (as you can see at the very top of the .py file, below the comments, in the bl_info object) so even though it installed and started in your Blender, perhaps there’s some issue with your version?

          Not sure, sorry, the others who took a look didn’t have any issue so I’m not clear why it’s not working for you.

          Feel free to tell me if you get some progress! 🙂

          1. Hi,

            I followed all your instructions to apply the add-on in Blender, also did I upgrade Blender to vers. 3.0.
            I found now the mistake in the used prefix for the Mixamo-fbx. You have to search for the used prefix under the armature at right side.
            Now it works properly, ok the Mixamo Control Rig processing failed, but it’s another building site. 🙂
            Thank you for your support and have a nice weekend!

            Manfred

Leave a Reply

Your email address will not be published. Required fields are marked *