Sign in to follow this  

2 probs in Managed DirectX

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

This topic is 4691 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this