#114 MD5 bones not being added to scene nodes

Release 3.0
Assimp lib (91)

When I was importing .md5mesh and .md5anim files that share the same name ( "test2.md5mesh" and "test2.md5anim"), bone nodes weren't being add to Scene graph. Walking through 'scene->mRootNode' childrens yielded following list:
- <MD5_Root>
- <MD5_Mesh>
- <MD5_Hierarchy>
I can assume that bones should be childrens of the '<MD5_Hierarchy>' node ( at least when importing Collada .dae file they were).

I've fixed the problem by adding following lines ( between '//@@@@@@@@@@@@' markers):

// If we didn't build the hierarchy yet (== we didn't load a MD5MESH),
// construct it now from the data given in the MD5ANIM.
if (!pScene->mRootNode) {
pScene->mRootNode = new aiNode();

AttachChilds_Anim(-1,pScene->mRootNode,animParser.mAnimatedBones,(const aiNodeAnim**)anim->mChannels);

// Call SkeletonMeshBuilder to construct a mesh to represent the shape
if (pScene->mRootNode->mNumChildren) {
SkeletonMeshBuilder skeleton_maker(pScene,pScene->mRootNode->mChildren[0]);

// here ends original Assimp code, following lines are my fix:

std::cout << "NODE EXIST !!!!!!! Custom add nodes";

aiNode* root = pScene->mRootNode, *hierarchy = NULL;
for( int i = 0; i < root->mNumChildren ; i++){
std::string name( root->mChildren[i]->mName.data);
if( name.compare("<MD5_Hierarchy>") == 0 ){
hierarchy = root->mChildren[i];
if( hierarchy==NULL){
// not found
hierarchy = new aiNode();
root->mChildren[ root->mNumChildren] = hierarchy;
root->mNumChildren += 1;

AttachChilds_Anim( -1, hierarchy, animParser.mAnimatedBones, (const aiNodeAnim**)anim->mChannels);
std::cout << "NODE EXIST !!!!!!! Custom add nodes EEEENDDDDD";

FILE: MD5Loader.cpp

Probable cause: when loading the mesh, the '<MD5_Root>' node is being created, causing the 'if (!pScene->mRootNode) {' to fail when loading animation.

Compiler: VC++ 10
MD5 Exporter: Blender unofficial plugin ( I've double checked - file was 100% correct)
Assimp version: 3.0.1270
cmake version:


  • Nobody/Anonymous

    I've discovered that one of my bones had ' ' in the name, that caused the problem. When i changed the name, problem was fixed ( with 'default' Assimp library version). I was using scene->mMeshes[i] to get all the meshes loaded from file, so this small inconsistency between scene graph and actual loaded scene was overlooked. Sorry for causing trouble, Mark this 'bug' as closed !

  • Kim Kulling

    Kim Kulling - 2013-09-25
    • status: open --> pending
    • Group: --> Release 3.0
  • Kim Kulling

    Kim Kulling - 2016-02-01

    OK, deprecated issue.

  • Kim Kulling

    Kim Kulling - 2016-02-01
    • status: pending --> closed

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks