horde3d / Horde3D

Horde3D is a small 3D rendering and animation engine. It is written in an effort to create an engine being as lightweight and conceptually clean as possible.
http://horde3d.org/
1.55k stars 308 forks source link

debugging anim resource #241

Closed gwald closed 2 months ago

gwald commented 2 months ago

Sorry never mind... noob mistake.... I was trying to animate a group node :/

I noticed the macro was checking it's a model node, it wasn't.

I found the correct node via:

C binding code:

    int i = 0;
    while( ( i = h3dGetNextResource( H3D_ResTypes_Undefined, i ) ) != 0 )
    {

        printf("h3dGetResName( %d ) %s type: %d ", i, h3dGetResName( i ), h3dGetResType(i)  );
        switch( h3dGetResType(i))
        {
            // H3DNodeTypes;

        case H3D_NodeTypes_Undefined:
            printf(" Type is  H3D_NodeTypes_Undefined ");
            break;

        case H3D_NodeTypes_Group:
            printf(" Type is  H3D_NodeTypes_Group ");
            break;

        case H3D_NodeTypes_Model:
            printf(" Type is H3D_NodeTypes_Model ");
            break;

        case H3D_NodeTypes_Mesh:
            printf(" Type is H3D_NodeTypes_Mesh  ");
            break;

        case H3D_NodeTypes_Joint:
            printf(" Type is H3D_NodeTypes_Joint  ");
            break;

        case H3D_NodeTypes_Light:
            printf(" Type is  ");
            break;

        case H3D_NodeTypes_Camera:
            printf(" Type is H3D_NodeTypes_Camera ");
            break;

        case H3D_NodeTypes_Emitter:
            printf(" Type is H3D_NodeTypes_Emitter ");
            break;

        case H3D_NodeTypes_Compute:
            printf(" Type is H3D_NodeTypes_Compute ");
            break;

        }

      }

I've compared all the converter joints and anim nodes and they all seem to be there.

I've used this code on other model/anim and it worked, so it's in the model or anim files.

// Apply animation // H3DNode g_model = 0, g_cam = 0; h3dSetupModelAnimStage( g_model, 0, g_animRes, 0, "", false );

Invalid node handle in h3dSetupModelAnimStage Invalid node handle in h3dSetModelAnimParams and Invalid node handle in h3dUpdateModel

I step debug the h3dSetupModelAnimStage function, but an assert is thrown (APIFUNC_VALIDATE_NODE_TYPE) and I can't find out why.

H3D_IMPL void h3dSetupModelAnimStage( NodeHandle modelNode, int stage, ResHandle animationRes, int layer, const char startNode, bool additive ) { SceneNode sn = Modules::sceneMan().resolveNodeHandle( modelNode ); APIFUNC_VALIDATE_NODE_TYPE( sn, SceneNodeTypes::Model, "h3dSetupModelAnimStage", APIFUNC_RET_VOID );

I step into Horde3D::SceneNode::getType function but it goes straight into void Modules::setError

0x5639f10 "Invalid node handle in h3dSetupModelAnimStage"

I dont know why

I've have: h3dSetOption(H3D_Options_MaxLogLevel, 10 ); h3dutDumpMessages();

But it's not showing anything that's useful.

Any tips on debugging this? Here is the .dae file, model is from make human, anim is from maximo, imported into akeytus and finally converted with fbxconverter.

gwald commented 2 months ago

Rookie mistake!