MaxDotNet document

 
 
 
Posted by:namblue73
Data created:1 November 2010

My knowledge of English is limited. I'm learning programming MaxDotNet, Ephere can give me documents related to library programming MaxDotNet:
- Full help documentation or introduce the properties of the class in MaxDotNet
Thank you.

VanNha.

Hi VanNha,

Please look here: http://www.ephere.com/autodesk/max/docs/ for a start. Other than that you can refer to 3dsmax SDK documentation. Max.NET is almost a 1:1 mapping for that. Hope that you find what you're looking for.

Marsel Khadiyev (Software Developer, EPHERE Inc.)

VanNha has a point the Max.NET documentation is very sparse. Hard to get productive if one is using the restricted version and not buying a license (I assume here that a license is accompanied by adequate facilities for training).

I feel comprehensive documentation would be the best improvement feature for the MAX.Net project as it is.

Other than that an example for SceneExport and SceneImport would be nice.

Max.NET is not meant to be a full SDK, it is a wrapper around 3dsmax C++ SDK. Therefore, you can find nearly all information you need from the original 3dsmax C++ SDK. The docs for this project merely describe how the wrapper differs from the original SDK.

Marsel Khadiyev (Software Developer, EPHERE Inc.)

Thanks.

I got a query. I am trying to make a SceneImporter plugin for 3ds max 2011 using the Max.NET wrapper. Still a stub right now: the actual import hasn't yet been implemented but 3ds max isn't crashing and the supported extensions are appearing in the file import dialog.

When I select a file that fits the import filter and click "open" for some reason a file named "" is created in the same directory as the file I selected. Seems to contain debug information and is about 289 kb in size. Why is this? I made the DoImport function return 1 which indicates import success.

I'd also like to know if the 3ds max SDK #define(s) (such as IMPEXP_FAIL, IMPEXP_SUCCESS and IMPEXP_CANCEL) are located somewhere in the Autodesk.Max namespace. I used the integer equivalents since I searched and found nothing. 

The A~ file that you see is a known issue with 3dsmax. I am not sure exactly why this happens, but I've seen other people complaining about this file appearing here and there on the Max forums. I think it can be safely ignored for now.

Most of the defines aren't part of Max.NET as they weren't translated. You can, however, look up their values either in the SDK docs or C++ headers and substitute those in freely.

Hope this helps.

Marsel Khadiyev (Software Developer, EPHERE Inc.)

hi again Marsel sorry I'm asking such a noob question but really I can't get this done: how to select an existing node in the scene?

This code isn't working.

global.TheHold.Begin();

i.SelectNode(myNode, true);

global.TheHold.Accept("Select");

 

i is an IInterface, global is an instance of IGlobal class and myNode is not a null IINode reference; I verified that I can change properties like WireColor.   I did what was said in the SDK reference more or less.

Perhaps you're just not seeing the update? Don't forget to redraw the viewports:

i.ForceCompleteRedraw( true );

Marsel Khadiyev (Software Developer, EPHERE Inc.)

No still isn't working :(. I am posting the source .cs file. Add references to System.Windows.Forms and System.Drawing for it to compile.


Attached Files:

>Class1.cs (3652 bytes),

Ok I may have figured it out. I have noticed that import plugins that ship with 3ds max automatically deselect any previously selected scene objects when they are used. So maybe it's normal not to be able to select objects from a SceneImporter plugin.

Getting another problem: I'm not able to dynamically unload/load the SceneImporter plugin i'm creating. I have checked the required options in the MaxDotNet utility dialog. Please could you tell me what might be missing?

I read in a forum post that implementation of the IPlugin interface is required for cleanup operations & plugin unloading. If this is so could i get an example of how to do it.

Hello, your plugin should be auto-unloaded/reloaded if you overwite the .dll in the plugins folder and have the 'unload' option on in Max.NET config.

You can create a public class (with any name) somewhere in your project and implement IPlugin interface. Max.NET should automatically detect it and call the Initialize/Cleanup methods appropriately. You can test if it does that properly by placing breakpoints inside them (or just message hooks).

Marsel Khadiyev (Software Developer, EPHERE Inc.)

Thanks, the message hooks worked. However the plugin is still not unloading. What calls must be made in the "Initialize" and "Cleanup" methods of IPlugin for it to unload? (the plugin I'm writing inherits from SceneImport). Strangely the Plane demo plugin available on this website unloads fine even though IPlugin is not implemented.

Ah, this reminds me- I think there is a limitation in 3dsmax SDK that does not allow import/export plugins to be re-loaded. I remember running into a similar issue before. From what I recall only "scene object" plugins can be unloaded, and not import/export (which are handled using a special mechanism by 3dmsax API).

I have also discussed this with 3dsmax devs a while back and submitted a ticket, however, I do not think this is a priority for them.

Marsel Khadiyev (Software Developer, EPHERE Inc.)

Thats a pity but I may have found a workaround. I'll test the plugin as a utility and when I feel its working satisfactorily i'll convert it to SceneImport. utility plugins unload perfectly.