Jump to content
  • Advertisement
Sign in to follow this  
beetle2001

Managed DirectX (Skeletal animation).

This topic is 4079 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

Hi everyone! I`ve got the following question. I use MDX to make skeletal animation and use Tom Miller`s book "Kick Start". The key problem is to load the mesh of a model. I use function LoadHierarchyFromFile. There`s the code: AnimationRootFrame rootFrame = Mesh.LoadHierarchyFromFile(filename, MeshFlags.Managed , device, alloc, null ); At this line I have an error: "Object reference not set to an instance of an object." The function LoadHierarchyFromFile returns null reference all the time though all the parameters are ok according to debugger. What is the reason of the error and what are the ways to correct it? Thanks to everyone for attention in advance.

Share this post


Link to post
Share on other sites
Advertisement
Have you instanced alloc class?
Try also to debug your implementation of meshcontainer derived, framederived and alloc. Probably some parameter are not initialised correctly

Share this post


Link to post
Share on other sites
Also make sure that 'filename' contains the correct path to the model. Maybe try just opening that file like a regular file (using classes from System.IO) and see it you succeed.

Share this post


Link to post
Share on other sites
I`ve instanced alloc class.
The parameters alloc and device are initialised. At least they are not empty, but how I can know what parameters are initialised wrong ?

filename is ok. But what do you mean "open file like a regular file "? File is ok I`m sure as it works with other programs. I can open file but I must parse it according to format. My problem is that I can`t load hierarchy into mesh object for some reason.

Share this post


Link to post
Share on other sites
I don't see any mention on a Frame class, as it is needed to parse out the Frame Hierarchy of the model. Did you derive you own Frame class? Try looking in your derived AllocateHierarchy class, at the 'CreateFrame' and 'CreateMeshContainer' functions. This is were the problem will be. Good Luck.

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!