Using undocumented sample code classes

Using undocumented sample code classes

Anonymous
Not applicable
589 Views
1 Reply
Message 1 of 2

Using undocumented sample code classes

Anonymous
Not applicable

The Gamebryo exporter that I’m converting to be used in Max2013 relies heavily on sample code from the 3DS Max SDK. And by that, I mean they had an amalgamated file of sample headers from various sample code files (about 29 of them). For example, wm3.h, StdMtl2.cpp, Parray.cpp, Rgbmult.cpp, and ACubic.cpp. I’ve successfully recreated this dependency from the current 3DS Max SDK, so it no longer crashes when exporting, though I have no way to prove that what I’ve done is correct. This pattern of API usage (using sample code as the API for undocumented internal classes) is very unconventional, but it looks like it’s the way things are done in Max.

 

I’d like to get more information on how sample code relates to Max internals. For example, when the Gamebryo exporter sees a Texmap with a ClassID() of ACUBIC_CLASS_ID, it casts it to a ACubic from the sample code. From what I can find online, there is absolutely no documentation on this relationship.

 

Can I assume this to be a correct cast? From inspecting the memory, it doesn’t appear so (lots of garbage looking values). In addition, I have a warning window that comes up from deep inside of BitmapManagerImp::GetImageInfo() which says "no driver to handle given file".

 

Is there documentation on what ClassIDs correspond to sample code classes and proper practices on using them?

 

Thanks,

Sean

0 Likes
590 Views
1 Reply
Reply (1)
Message 2 of 2

Steve_Curley
Mentor
Mentor
Caveat - no Visual Studio so no SDK installed here, but...

A bit of googling for ACUBIC_CLASS_ID points to it being a Reflect/Refract TextureMap. Looking up Reflect_Refract in the Maxscript help shows it to be rather more than a simple bitmap so looking at it in memory may well not show what you might be expecting. Casting an object with an ID of ACUBIC_CLASS_ID to an ACubic doesn't sound unreasonable - the ACubic is probably a Struct containing pointers to filenames (an array of them, probably) amongst many other things, which presumably has to be declared somewhere, so find that and it might all make more sense 😉


Anyone else out there can help with this? It's an important project for a great many "Modders" out there (me included 😉 ).

Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

0 Likes