Jump to content
  • Advertisement
Sign in to follow this  

2 probs in Managed DirectX

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

Less important: With shader debugging enabled in the DirectX properties window, I got the following error from in AnimationSet.Finalize. An unhandled exception of type 'System.NullReferenceException' occurred in microsoft.directx.direct3dx.dll Without shader debugging enabled, I got no error. MORE important: Calling AnimationController.GetAnimationSet(Int32 index) in the following code causes .AdvanceTime, or if the same anim set is accessed again .GetAnimationSet, to throw a NullReferenceException. Of course I made sure that my animation controller was not null in all these cases. Direct3D.AnimationController animController = m_Renderer.AnimationInstance.AnimationController; for (int i = 0; i < animController.NumberAnimationSets; i++) { //Get the animation set's name Direct3D.AnimationSet animSet = animController.GetAnimationSet(i); //animController != null System.Diagnostics.Debug.Assert(animSet != null, string.Format("Animation set {0} is null.", i)); string animSetName = animSet.Name; //Get the animations' indices if (string.Compare(animSetName, "Neutral", true) == 0) m_NeutralAnimationSetIndex = i; //...just more comparisons... } Ignoring the exception (DirectXException.IsExceptionIgnored) did not stop the NullReferenceException. I don't think there is anything wrong with that code (I'm sure lots of people say that!) - it would seem to me that GetAnimationSet is setting something to null. Thanks a lot

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!