Notifications
Clear all

[Closed] 3dsmaxSDK 2012 controller crash

Hello,
I’m new to 3dsmaxSDK and I’m trying to code an animation controller plugin similar to the position constraint. I’ve encountered a very strage problem regarding the loading of the plugin. Here’s what I did:

I created a new controller type plugin using the 3dsmax plugin wizard in VS2010. Then I took the code for the position constraint from the sample files and integrated it into the newly created project(also generated new ClassIDs, changed plugin name and so on). The new plugin compiles nicely and when I put it into the plugin folder 3dsmax starts up and the plugin does nearly exactly what I want it to do. However if I start 3dsmax for a second time it crashes on loading the plugin with no error description given.

Some additional observations:
[ul]
[li]If I compile a new dlc file and put it into the plugin folder 3dsmax starts up again without any problems. Next startup 3dsmax crashes again.
[/li]
[li]If I delete the plugin information from the registry (Path “HKEY_CURRENT_USER\Software\Autodesk\3dsMax\14.0\Plug-ins\pluginname”) 3dsmax starts up again without any problems. Next startup 3dsmax crashes again.
[/li]
[li]If I add the DebugException entry under “HKEY_CURRENT_USER\Software\Autodesk\3dsMax\14.0\MiniDump” to bypass the defaut 3dsmax error handler to be able to do some debugging 3dsmax starts up and shows an option to start an external debugger. Choosing “Yes” 3dsmax doesn’t start an external debugger, but skip the error and everything works fine.
[/li][/ul]

So far I spend two days reading the SDK documentation and searchig for a way to track down this error, but now I’ve ran out of ideas. Maybe there are some maxSDK experts around here who can provide some hints related to the cause of this problem.

Thanks,
DeFi

1 Reply

Problem solved!
Seeing the behaviour described above, I suspected the plugin load order causing the problem somehow. Then I discovered that for plugins defer loading is active by default. My plugin must have exposed some weired stuff to the public SDK if it is loaded at some specific point generating a conflict with other plugins. Implementing the CanAutoDefer function and returning 0 from it solved the problem.