If Mixamo transformations and bone alignements messed up

Hi

There already is a tutorial covering the “Mixamo” workflow here.

If this does not work for you, read on.

Issues:

  1. The ready Mixamo files have non-normalised transformations, in my case 0.01 scaled armature with 100 scaled child mesh as well as 90° x rotation in Blender.

  2. Upon closer inspection some bones are misaligned (you know what I mean when you see it).

Assumptions:

  1. Blender 3.1.0
  2. Mixamo animations Swat guy and Orange bot (combat animations)
  3. Babylon 5 pre

Fix for 2:

Download Mixamo animation with skin. Dont know why, but this fixed it.

Fix for 1:

Please let me know if this can be fixed within the intial model setup (ie pre Mixamo). Does Mixamo need certain transformations?

Anyway, to normalise Mixamo animations imported into Blender:

  1. Using fbx (binary)
  2. Have a new Blender file where you import all animations and rename them as appropriate.
  3. Have a new Blender file where you import the downloaded fbx of the model without animations.
  4. Make an action for its rest pose.
  5. Append animations from 2 into 3.
  6. Select Armature and go to Dope Sheet → Actor Edtior.
  7. Select each animation from the dropdown list and stash.
  8. Select Armature and go to script,
  9. Run
import bpy
for a in bpy.data.actions:
    for fc in a.fcurves:
        if "location" not in fc.data_path:
            continue       
        if "Hips" in fc.data_path:
            for kf in fc.keyframe_points:
                kf.co[1] = kf.co[1]/100  #BEWARE: read below
        else:
            a.fcurves.remove(fc)
            
ob = bpy.context.object
for pb in ob.pose.bones:
    pb.location = (0,0,0)
    
bpy.ops.object.transform_apply(scale = True)            

(source)

  1. All fbx imports/exports in Blender using default settings.

Script notice

About the line

kf.co[1] = kf.co[1]/100

The “100” is the scale you want to correct. So, in my case, Mixamo scaled the model to 0.01.

I am not sure why it is divided by 100 though.

Disclaimer

I wasted some hours and tried countless other solutions that did not work. So take this solution here as yet another thing that hopefully works. :salt:

Best wishes
Joe

1 Like

Nice tips, @thomlucc could you add it in your mixamo doc ?

Nevermind the text below. As far as I could figure out, applying scale in Blender affects scale (duh) and location keyframes. Mixamo apparently only uses the Hips bone for location keyframes. The others are rotation only. Anyway, since Mixamo uses Hips location keyframes you cannot just delete them but need to update them (by the amount of “Apply”). Update the initial post.


Found a bug! :flushed: It seems that the script breaks animations that change that character’s stance - such as crouching. The model basically crouches “in place” whereas its location should go down a bit (by the amount it crouches…).

I do remember having read about that Mixamo animations are all FK which means bones are only rotated, not scaled or moved - except for the hip bones. (Or so)

Sigh. Back to Blender…