Jump to content
  • Advertisement
Sign in to follow this  
Misha

[.net] Animation with CLR 2.0 and new version of MDX

This topic is 4400 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 I've ported Tom Miller's example of animation on CLR 2.0 and I'm using 1.0.2902.0 version of DirecX. And program throws the exception Attempted to read or write protected memory. This is often an indication that other memory is corrupt. Stack Trace at Microsoft.DirectX.Direct3D.BaseMesh.DrawSubset(Int32 attributeID) at Chapter13Code.Form1.DrawMeshContainer(MeshContainerDerived mesh, FrameDerived frame) in D:\RunningProjects\3Dprg\Examples\C# Code\Chapter 13\Копия IndexedAnimation\Form1.cs:line 230 at Chapter13Code.Form1.DrawFrame(FrameDerived frame) in D:\RunningProjects\3Dprg\Examples\C# Code\Chapter 13\Копия IndexedAnimation\Form1.cs:line 172 at Chapter13Code.Form1.DrawFrame(FrameDerived frame) in D:\RunningProjects\3Dprg\Examples\C# Code\Chapter 13\Копия IndexedAnimation\Form1.cs:line 184 at Chapter13Code.Form1.DrawFrame(FrameDerived frame) in D:\RunningProjects\3Dprg\Examples\C# Code\Chapter 13\Копия IndexedAnimation\Form1.cs:line 184 at Chapter13Code.Form1.OnPaint(PaintEventArgs e) in D:\RunningProjects\3Dprg\Examples\C# Code\Chapter 13\Копия IndexedAnimation\Form1.cs:line 154 at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs) at System.Windows.Forms.Control.WmPaint(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ScrollableControl.WndProc(Message& m) at System.Windows.Forms.ContainerControl.WndProc(Message& m) at System.Windows.Forms.Form.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.Run(Form mainForm) at Chapter13Code.Form1.Main() in D:\RunningProjects\3Dprg\Examples\C# Code\Chapter 13\Копия IndexedAnimation\Form1.cs:line 420 at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() ----------- Mabye someone has solved this problem... Thanks

Share this post


Link to post
Share on other sites
Advertisement
Thanks, It heplped.
The problem was with

Device.IsUsingEventHandlers = false;

When IsUsingEventHandlers = true, GC disposes mesh
So I swiched it into Device.IsUsingEventHandlers = false, and after I generated Skinned Mesh, swiched it back.
And all works fine

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Thanks for the tip --- I had the same issue and setting "IsUsingEventHandlers" to false fixed the issue for me too. DX Animation implementation seems very buggy, and hard to debug. I'm considering excluding support for it in our game engine, and instead only supporting Axiom/Ogre mesh animations, and shader animators, etc. DX Animations have given me problems since the beginning, and since I don't have source code, I can't debug these dumb issues. At least with Axiom, any issues I run into are "above the covers" (managed code), and with Shaders, although harder to work with, will have code accessible to review. I hate being blind, and guessing at the issue -- which is what DX animations have done to me off and on for quite a while.

The latest defect is that if I render an animated mesh -- it causes all of the other meshes to go haywire. I can render many animated meshes and they work together fine -- but if I mix them inside the same scene -- the non-animated meshes go haywire (look like spagetti). There is too much going on behind the scenes, leaving me to go a random guessing game -- and after several hours of trying many sorts of things, I think I'm throwing in the towel on DX Animations.

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!