Apply Mixamo Animation to Ready Player Me Avatar Without Passing Character Through Blender/Mixamo

I’ve identified how to do this. The Mixamo and RPM skeletons appear to be equivalent, with the exception that the Mixamo bones are prefixed with “mixamorig:”, thus the following modified code allows the Mixamo animations to be mapped to RPM skeletons without import/export through Blender/Mixamo.com:

BABYLON.SceneLoader.ImportMeshAsync(null, "./resources/models/" + model, null, scene)
      .then((result) => {

        player = result.meshes[0];
        player.name = "Character";

        var modelTransformNodes = player.getChildTransformNodes();
        
        animationsGLB.forEach((animation) => {
          const modelAnimationGroup = animation.clone(model.replace(".glb", "_") + animation.name, (oldTarget) => 
            {   if(animation.name == "mixamo.com")
                {   return modelTransformNodes.find((node) => "mixamorig:" + node.name === oldTarget.name);
                }
                else
                {   return modelTransformNodes.find((node) => node.name === oldTarget.name);
                }
            });
          animation.dispose();
        });
        animationsGLB = [];
4 Likes