Sign in to follow this  
DrGUI

2 probs in Managed DirectX

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

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