Ready to use models with animations

Added Mutant model/anim

If possible, including source fbx/blend/collada in repo with import settings documented would be great for being able to import/export to future mdl runtime representations or asset importer improvements.

EDIT: Noting probably not possible due to source of files :slight_smile:

EDIT2: Looks like … els/Mutant needs a LICENSE.TXT

Thanks! Great stuff!

mutant/license.txt added along with a few more anim files.

I’ve added _skeleton.fbx file for each model which can be used to skin your own custom mesh **(acian uses x_bot) .

[quote=“jenge”]If possible, including source fbx/blend/collada in repo with import settings documented would be great for being able to import/export to future mdl runtime representations or asset importer improvements.

EDIT: Noting probably not possible due to source of files :slight_smile:

EDIT2: Looks like … els/Mutant needs a LICENSE.TXT

Thanks! Great stuff![/quote]

That indeed would be great so we could replicate the process ourselves. Lumak either seems to not be interested in telling us how to do that or we are having some miscommunication here since i already asked for same thing in my previous post.

Btw Lumak arent all mixamo models using same skeleton?

That indeed would be great so we could replicate the process ourselves. Lumak either seems to not be interested in telling us how to do that or we are having some miscommunication here since i already asked for same thing in my previous post.
Btw Lumak arent all mixamo models using same skeleton?[/quote]

On the contrary, I have shared my process on how I did it and are described in my reply to you in this post and in I will reiterate it here but in a step-by-step manner for clarity. But before I do, let me clarify/answer a couple of things:

  1. As jenge himself realized, mixamo license prohibits distribution of character/animation file in editable format. And this restriction is the only reason I cannot provide model.fbx or animation.fbx files in the repository.
  2. “Do models use same skeleton?” - They are not the same. While the base joint names are the same, i.e. named as “Hip”, “Neck”, etc., some models have different prefix added to the base, e.g. “mixamorig:Head”, “swat:Head”, “Mutant:Head”, etc.

Mixamo character/animation port process using Maya

As I mentioned numerous times in my posts, I use Maya LT for the porting process. I will describe this process first then will describe what I discovered just using the animation mapping process in

  1. prerequisite: have Maya or Maya LT installed

  2. goto and download your model.fbx (t-pose) and animation set (or single animation) in .fbx format.

  3. open your model.fbx in maya, open HumanIK editor, choose Create Character Definition, map all joints of your model to the character definition until it becomes “green” lit -> save your model file (maya format) -> export as fbx format with animation box unchecked.
    note1 clear any non-zero pivot rotation - the values found “jointOrientation” needs to be elevated to the parent transform, i.e. add it to the transfrom field for the same joing.
    note2 even doing note1 sometimes result in wonky animation. If this happens, you’ll need to reskin the model or replace the rig(skeleton) with a known working rig and re-skin.

  4. for each animation that you want to port, open the animation.fbx file in maya, goto frame -1 (negative 1) and set it to t-pose (frame -1 because animations typically start at frame 0), key all your joints in frame -1, open HumanIK editor, select Create Character Definition, map all joints -> save the file (maya format).

  5. open your saved maya model file,
    from the file explorer drag in your saved animation file into maya,
    in the HumanIK editor- character control panel, select “Character:” as your model’s character, select “Source:” as the animation’s character
    set the key frame range of the animation
    in HumanIK, choose Bake > Bake To Skeleton
    delete the animation rig
    save the file as model_animation or w/e
    export to .fbx file format, w/ the animation box checked

  6. using AssetImporter and arguments:
    for model - AssetImporter model your_model.fbx output_file.mdl
    for animation - AssetImporter anim your_model_animation.fbx output_animation_file.anim
    note output file will contain something like “Take-00” or w/e, remove that and rename it as ouput_animfile.anim
    note2 you may have to use an additional option -t to Generate tangents for models with normal bump map

Porting character/animation right out of

I have not done this process until just a few minutes ago, and it seemed to work.

  1. goto -> Browse Animation -> select “Creature Pack” as an example
  2. At the right of the window, it shows “19 animation in Creature Pack on X Bot” (for me at least), click on “Change Character” and select the Mutant character.
  3. click on the “Add To My Assets” button, once it completes the button changes to “View/Download” -> click it
  4. on the left side of the window there’s a check box next to the trash can, selecting it will select your animation(s) -> click Queue Download -> pop up confirmation : .fbx, t-pose , and every other option as default
  5. once the progress completes, check your animation, click download.
  6. unzip your (following the creature pack/mutant example got me this file)
  7. using AssetImporter and arguments:
    for model - AssetImporter model Mutant.fbx output_file.mdl
    for animation - AssetImporter anim mutant_idle.fbx Mutant_Idle.anim
    note the output file will contain a string “”, just remove the ""
    note2 you may have to use an additional option -t ->Generate tangents for models with normal bump map

things to do outside of assetImporter

  1. you’ll need to extract the textures using something like Blender. I did this once but I think it was: choose geom > material > output texture (can’t remember exactly)
  2. the model in Urho3D is huge - scaled by 100 from the looks of it - fix this in Blender or scale the node by 0.01f (this works properly)
  3. some animations have root motion - fix it in Blender

I hope this wall of text helps.

Edit: clearing pivot rotation needs to happen in Maya step 2, not 3
Edit: added scaling info in *problems 2)
Edit: added info about additional option -t using the assetImporter for normal bump map

1 Like

No one asked how to spin your model by 180 in code. I guess everyone already knows how to do this, but here is how-to for some who don’t know.

Using 18_CharacterDemo, snippets of relevant sections.

Spinning your model by 180 in code


void CharacterDemo::CreateCharacter()
    ResourceCache* cache = GetSubsystem<ResourceCache>();

    Node* objectNode = scene_->CreateChild("Jack");
    objectNode->SetPosition(Vector3(0.0f, 1.0f, 0.0f));

    // rotate model by 180 ****************************
    Node* adjustNode = objectNode->CreateChild("AdjNode");
    Quaternion qAdjRot(180, Vector3(0,1,0) ); // rotate it by 180 
    adjustNode->SetRotation( qAdjRot );

    // Create the rendering component + animation controller
    AnimatedModel* object = adjustNode->CreateComponent<AnimatedModel>();

    //********************* change the model and material name


      // ******************** rename it to proper head joint name // Set the head bone for manual control
    object->GetSkeleton().GetBone("Bip01_Head")->animated_ = false;

. . .
void CharacterDemo::HandlePostUpdate(StringHash eventType, VariantMap& eventData)
    if (!character_)

    Node* characterNode = character_->GetNode();

    // Get camera lookat dir from character yaw + pitch
    Quaternion rot = characterNode->GetRotation();
    Quaternion dir = rot * Quaternion(character_->controls_.pitch_, Vector3::RIGHT);

    // ************* rename it to proper head joint name // Turn head to camera pitch, but limit to avoid unnatural animation
    Node* headNode = characterNode->GetChild("Bip01_Head", true);
    float limitPitch = Clamp(character_->controls_.pitch_, -45.0f, 45.0f);
    Quaternion headDir = rot * Quaternion(limitPitch, Vector3(1.0f, 0.0f, 0.0f));
    // This could be expanded to look at an arbitrary target, now just look at a point in front
    Vector3 headWorldTarget = headNode->GetWorldPosition() + headDir * Vector3(0.0f, 0.0f, -1.0f); // -z direction ****************************
    headNode->LookAt(headWorldTarget, Vector3(0.0f, 1.0f, 0.0f));
    // Correct head orientation because LookAt assumes Z = forward, but the bone has been authored differently (Y = forward)
//    headNode->Rotate(Quaternion(0.0f, 90.0f, 90.0f)); //************************* dont need this

. . . 


void Character::FixedUpdate(float timeStep)
    /// \todo Could cache the components for faster access instead of finding them each frame
    RigidBody* body = GetComponent<RigidBody>();
    AnimationController* animCtrl = node_->GetComponent<AnimationController>(true); //********** recursive get

. . . 

Edit: changed comment to “recursive get”

Wow, great docs on the model import process! High quality 3D models have always been one of the most challenging assets for projects. This is really awesome. thanks for the models and trailblazing the process :smiley:

You’re welcome.

I was really surprised by how easy it was to download then import character/animations using the Porting character/animation right out of method.
It was my first attempt and didn’t expect to have an animating character in Urho3D following this process**. Can’t get any easier than that!

Edit: **rephrased

Great work Lumark!! This is just what I need

Unfortunately when I import the models into the editor and setup the materials I get an unlit material like shown below

When I edited the material’s technique from “Techniques/DiffNormalSpec.xml” to “Techniques/DiffNormalSpecEmissive.xml” it seemed to correct but I noticed that it flickers on and off based on camera angle.

I honestly have no idea what is going on and I really need to use these models, most importantly their animations :frowning:

i found that the models from that were in the repo, were not compatible with the latest version of github, as they were missing vertex declarations.

to test, don’t supply a material when using, and it will use the default white material.

i had to export the models myself, which given the above process was simple! (GREAT job btw).

Once i got the steps down, it was easy to follow and import.

I now can test a handful of things i have been wanting, but couldn’t because of lack of animation skill.

Current Urho runtime code should load both the old & new models, that means without or with vertex declarations.

Where exactly did you run into trouble?

If you use the “Mutant” model as an example.

The material provided has a technique of DiffNormal.xml, this will render no model, but the shadow is animated.

If you modified the material to be just Diff.xml, the model will render properly (just not with a normal).

If you enable D3D11_CREATE_DEVICE_DEBUG, you get the following output

D3D11 WARNING: ID3D11Device::CreateInputLayout: The provided input signature expects to read an element with SemanticName/Index: 'BLENDINDICES'/0 and component(s) of the type 'int32'. However, the matching entry in the Input Layout declaration, element[6], specifies mismatched format: 'R8G8B8A8_UINT'. This is not an error, since behavior is well defined: The element format determines what data conversion algorithm gets applied before it shows up in a shader register. Independently, the shader input signature defines how the shader will interpret the data that has been placed in its input registers, with no change in the bits stored. It is valid for the application to reinterpret data as a different type once it is in the vertex shader, so this warning is issued just in case reinterpretation was not intended by the author. [ STATE_CREATION WARNING #391: CREATEINPUTLAYOUT_TYPE_MISMATCH] D3D11 WARNING: ID3D11DeviceContext::DrawIndexed: The Pixel Shader expects a Render Target View bound to slot 0, but none is bound. This is OK, as writes of an unbound Render Target View are discarded. It is also possible the developer knows the data will not be used anyway. This is only a problem if the developer actually intended to bind a Render Target View here. [ EXECUTION WARNING #3146081: DEVICE_DRAW_RENDERTARGETVIEW_NOT_SET]

If you run the fbx model provided by mixamo thru the AssetImporter, then the model will just drop right in properly.

Hope this helps

That’s probably from missing tangents in the model, which are required for normal mapping techniques. D3D11 is strict in that sense and fails to create the input layout when shader wants data that isn’t there in the buffer (resulting in failure to render), while D3D9 and OpenGL would just fetch invalid data, probably zeroes.

@ Bluemoon
Is it possible that it’s the same issue Cadaver mentioned with missing tangents? Try using an additional option -t in the assetImporter.

@NiteLordz, the models in my repo didn’t work for you? Hmm, I’m using OpenGL renderer and it works for me, although, I also forgot to generate tangents.

Yea, I am on d3d 11, and they didn’t work.

When I reexport them, using it instructions, I added the -t and they worked.

Ok, good to know. I’ll have to regenerate the .mdl files on the repo with tangents enabled - probably not today but in few days.

@Lumark, I actually used the model in your repo. The issue might probably be with the tangent as noted by cadaver

@Bluemoon, ok I updated the swat and mutant.mdl files in the repo. They should work properly now.

I’ve been working on the AssetImporter to squash “$AssimpFbx$” nodes that’s generated for several Mixamo characters. This method saves me time from manually editing all joints with pivot transforms in Maya.

See the first page,

Is there a reason not to do that automatically?
And instead create an option to disable the feature.