Notifications
Clear all

[Closed] Determine if any (3rd party) plugins are being used

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.

3 Replies

Oh, another thing I’ve explored:

I can see plugins listed in the .max file itself after a save. So, to give a real-world example, I have a scene that uses MultiTexture (a free 3rd party plugin), and in the max file I can see a reference to multitexture_max2018_64.dlt.

You can also see this plugin referenced in the summary > Plug-in Info within Max itself. There doesn’t seem to be any programming interface to this window.

So I guess I could try parsing the max file itself for instances of *.dl* – but this seems like a… not great idea.

An update:

I was able to get the UseCount variable to update!

If you open the File > Summary > Plug-in Info window, all of the UseCounts are updated with the current state of the scene. So that window is calling something that refreshes DLL info.

However, a) you have to manually open this window, and b) the values don’t update later. So if I have two instances of VRayFur in the scene and open the Plug-in Info window, I’ll see UseCount=2. However, if I then delete one or both, UseCount is still 2.

So a follow-up question: does anyone know what this window is calling to force an update of DLL information?

I found that you can get a list of plugins via maxscript:

items = fileProperties.getItems "Used Plug-Ins"

This sort-of matches the plugin list shown in the “Plug-in Info” window, and seems to match the values from IClassDirectory. Interestingly, it shows more plugins than the “Plug-in Info” window. It seems to consistently includes these extra plugins:

  • “biped.dlc”
  • “peopleorch.dlc”
  • “reactor.dlc”
  • “parameditor.gup”
  • “bitmapproxies.dlu”
  • “acadblocks.dlu”
  • “sceneeffectloader.dlu”

Hopefully this will be good enough for now! I’d still like to know why the C# results are only updating when the “Plug-in Info” window renders. (I tried running this maxscript function, and it doesn’t update the C# results, just FYI.)