A few problems as I use the wrapper...

 
 
 
Posted by:Dwood
Data created:10 April 2011

There's some redundancy(?) in the wrapper... for example, say I have a mesh called meshy.

If I want the number of verts I should say meshy.NumVerts right? It's not there. It's NumVerts, and then there's NumVerts_


Okay. That's not so bad. But then there's ClassID problems. I want to see if an object can convert, so in the IObject of that instance, I say: CanConvertTo(int i, ClassID type) and then I convert it. However in the Max SDK there are macros for this, most notably triObjectClassID.


The problem I'm having is that there's no where to find this ObjectClassID macro, so what I'm doing (untested) is declaring a null TriObject and then using that triObject to get the class ID.

All classes need constructors... If you want help in this endeavor I'm willing to offer you help for this, free of charge.

IMesh.NumVerts gives you the number of vertices but don't use this to set the number of vertices (because memory isn't allocated). Use IMesh.SetNumVerts(int ct, book keep, bool synchSel) instead.

The ClassID values are in the enums Autodesk.Max.BuiltInClassIDA and Autodesk.Max.BuiltInClassIDB. If something is missing use the numbers quoted in the SDK documentation. I think they are in plugapi.h

Sample ITriObject

ITriObject myTriObject=(ITriObject)myInterface.CreateInstance(SClass_ID.Geomobject,global.Class_ID.Create((uint)BuiltInClassIDA.EDITTRIOBJ_CLASS_ID,0));

Ok so what help were you talking about?

 

You should keep in mind that MaxDotNet is a wrapper, and not a framework. You'll still have to deal with "native'y" like things, and the realities of the Max SDK such as how it deals with references and initialization. There's no reason why you can't build your own mini-framework on top of MaxDotNet though (like MaxSharp is endevouring to do).