How to debug an export plug-in program?

How to debug an export plug-in program?

Anonymous
Not applicable
724 Views
2 Replies
Message 1 of 3

How to debug an export plug-in program?

Anonymous
Not applicable
I am a beginner,and I want to write a plug-in to export mesh object information.There is no errors in program,but It dozen't work when I load it in 3Dmax.So I want to debug this program.However I don't know what to do next after I pressed the "Debug" button.
Can you tell me how to debug such a program?Thank you!
0 Likes
725 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
If you are using Visual Studio 2005 then you can press F5 to start Debug Mode (or go to Debug > Start Debugging).

VS will promt you for the path of the executable, point it to your 3dsmax.exe.

Now, depending on your max plugins and all that it might load 3dsmax or not, sometimes it fails to load. If it fails then execute max as you usually do and go to Tools > Attach to Process and from the list select your 3dsmax process.

If the plugin was loaded correctly by max, and the source code in VS is the same one as the one in the Debug database of the plugin then you will be able to place breakpoints. If it is all ok you will see these breakpoints as filled red circles. IF something failed, they will be just red circles (no fill).

Next execute your exporter, it will stop at the breakpoints and you will be able to see what's going on.

I often use also a debug.h and debug.cpp set of files that write text to a file. This method is easier to follow when you have a lot of things to take care of...
0 Likes
Message 3 of 3

Anonymous
Not applicable
Thank you for your advice,ScEngMan!
I have succeed to debug my program!

I did it this way:
first,I change the program configuration form "Debug" to "Hybrid" ,which is declareed in 3D Max SDK Help;
second,I set the path of "Output Directory" as my 3Dmax plugin path,in my computer ,that is D:\Autodesk\3ds Max 2008\stdplugs;
third,I set the path of Debugging "Command" as my 3Dmax.exe path, that is D:\Autodesk\3ds Max 2008\3dsmax.exe;
Forth,I set the path of "Output File" as my 3Dmax plugin path too,that is D:\Autodesk\3ds Max 2008\stdplugs\ExpPlugin02.dle;

and after I pressed the "Debug" button(the green triangle one),it start the 3Dmax.exe.I build a box and change it to mesh type(add the "Edit Mesh" modifyer ),then I go to File > Exporting and select ".mesh"(my plugin),type a name ,press the OK button,then the program turn to the breakpoints!...

YOU have refered another way to debug the program,that is using a debug.h and debug.cpp set of files.I have no idea of it but I will try it if it is more convenience.
0 Likes