I’m trying to determine if any 3rd party plugins are being referenced by a scene in any way - as IObject types, Map types, or something else entirely. Specifically, I want to know if the scene relies on any plugins, so that if I were to save it to an archive and send it to another developer, it would report missing plugins and essentially be a broken scene until they download and install those plugins.
At this point, I would take any ideas that give me more information about plugin use than I have already - because I can’t even determine if built-in DLLs like prim.dlo (“Standard Primitive Objects (Autodesk)”) are actually in use in a scene or not.
I can get information about whether a plugin has ever been loaded, and this does correspond with usage. For instance, vrayfur2018.dlo isn’t loaded until you create a VRayFur object. However, at that point it remains loaded forever, regardless of whether you delete the fur, reset the scene, load another scene, etc.
I can also iterate through the IObjects, Materials, Maps, etc. and manually check class ids against the master DLL list - but I’m sure there are many potential ways a plugin could be referenced by a scene that I would miss.
Here’s what I’ve tried (in C#):
- Iterating through IClassDirectory (via GlobalInterface.Instance.ClassDirectory.Instance) to get IClassEntry entries
This gives me lots of interesting information about all the classes that have been defined in plugins. For instance, Box (e.g. Create > Standard Primitives > Box) gives the following information:
Subclass 47 of GeomObject
DllNumber: 101
Subclass class number: 0
IsLoaded: True
UseCount: 0
ClassName: Box
Category: Standard Primitives
ClassID: 16.0This text will be hidden
Note that there’s a UseCount variable. Yay! Exactly what I want! Except that UseCount is always 0, for every single class in every single plugin, regardless of use. So it seems to be meaningless.
- Iterating through IDllDir/IDllDesc (via GlobalInterface.Instance.CoreInterface15.DllDir)
This gives me similar information to above: Dll description (name), IsLoaded, etc. I can also get class information this way using IDllDesc.GetClassDesc, which gives me an IClassDesc. Again, similar information to what I got above, none of it really useful here.
I can get path information for the dlls and associate that with whether the Dll is loaded. Might be something there with Maxscript?
In summary: I can tell when a plugin has been used at some point during the current 3DS Max session. I can’t tell if a plugin is currently in use by the current scene. Looking for ideas! C# / C++ / Maxscript - whatever.