• Advertisement
Sign in to follow this  

Get ID3DXAnimationController from D3DXLoadMeshHierarchyFromX without D3D Device?

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I am currently expanding my program to a client/server system, and I an looking to see if I can extract the ID3DXAnimationController information from a file without creating a D3D Device?

On the pure client version everything works fine, however on my new server where I disable all D3D rendering, the call fails.

I simply want to access my animation timing data in my .x files for server purposes.

I simply use this line:



hr = ( D3DXLoadMeshHierarchyFromX( VGlobal::CURRWORKDIR + VGlobal::CurrMeshDir + smName, D3DXMESH_MANAGED, g_pd3dDevice,
&Alloc, NULL, &g_pFrameRoot, &g_pAnimController ) );


And when g_pd3dDevice is NULL, the call fails.

This is the function I am trying to call:



ID3DXAnimationSet * animationSet = NULL;

if( g_pAnimController != NULL )
{
if( g_pAnimController->GetAnimationSet( animSetID, &animationSet ) == S_OK )
{
int tAnim = int(animationSet->GetPeriod() * 1000);
SAFE_RELEASE( animationSet );
return tAnim;
}
}


Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Yep that works thanks! That is what I was looking for. I was looking to see if there was a way to avoid the D3D Device allocation, but its not a big deal.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement