MaxScript: Using Autodesk.Max.DLL to access Skin modifier
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to export skinned/skeletal animations using MaxScript and have run into the issue that the bind pose data isn't exposed in script, only in the SDK. That is, I need access to the GetBoneInitTM and GetSkinInitTM data to correctly reconstruct the bone/skin transforms when rendering in-game.
I could build a plugin in the SDK to pass back the data, though that seems redundant. But in theory I could load up the Autodesk.Max.DLL and use the wrapper which appears (via Object Viewer) to expose the ISkin functions I need. Loading and accessing this is documented, and works fine. I can use script functions to obtain the modifier base class, e.g trivial example:
mynode = MaxGlobal.COREInterface.RootNode.GetChildNode(0)
mymodifier = mynode.ObjectRef
The problem I am having is how to cast from the OSModifier, which I can get from a node, into an appropriate ISkin object (which I assume is Autodesk.Max.IISkin). I have searched high and low for an example, either specific or just generally casting, but to no avail.
Any help would be much appreciated.
Many thanks
Phil