• ### Popular Now

• 15
• 15
• 11
• 9
• 10

This topic is 3373 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I am trying to add animation to my mini-engine by using the code from the DirectX 9.0 SDK example 'MultiAnimation', but I am having a problem when D3DXLoadMeshHierarchyFromX() gets called from within CMultiAnim::Setup(). I am getting a E_FAIL return value from D3DXLoadMeshHierarchyFromX() and the following text in the console (with debug build):
D3DX: Unicode support: 1
D3DX: ID3DXEffect::GetInt: Invalid handle
D3DX: ConvertToIndexedBlendedMesh: Zero Palette size not allowed.

It seems the original cause of the failure has to do with the effect, but I see that effect is being created properly in the code right before this. The code in CMultiAnim is unchanged from the MultiAnimation example, the only different is i am using my own effect file instead of "MultiAnimation.fx". I don't quite understand why this would matter, since the effect is not directly used by D3DXLoadMeshHierarchyFromX(), although there is some comments that say palette info is taken from the effect. Does anyone know what may be happening? Also, and easy to understand tutorials or books on the subject would be appreciated. I've been staying away for 3D for some time because I was afraid of the (unnecessary?) complexity involved, and now I see that my fears were well-founded (: Thanks!

##### Share on other sites
A couple of questions:

1) What version of the SDK are you using? D3DX has changed quite a bit over the past couple of years, I recommend you use the most recent SDK if you're using an older one. Most of the changes in D3DX have been bug fixes.

2) You're linking with the debug D3DX library, right?

##### Share on other sites
legalize, thanks for the quick response!

I am using the latest version of the DirectX 9 SDK, and also using the debug D3DX library.

I tried your suggestion #3 and found the first error is happening error:

        m_pMA->m_pEffect->GetInt( "MATRIX_PALETTE_SIZE", ( INT * ) & iPaletteSize );

The odd thing is can't find this variable set anywhere (even in the original SDK example). The closest thing I found was this:

    D3DXMACRO mac[2] =    {        { "MATRIX_PALETTE_SIZE_DEFAULT", "35" },        { NULL,                          NULL }    };

As this code is identical to the sample code, I'm not sure what is going wrong.