• 1/2

Loading .NET plug-ins from a location other than bin/assemblies.

Posted by Christopher Diggins, 19 April 2012 8:00 pm

When writing a .NET utility plug-in you normally place your assemblies in the bin/assemblies folder of your 3ds Max installation. These assemblies are supposed to provide a function with either the signature:

    public static void AssemblyLoad()

  public static void AssemblyLoad(AssemblyLoader.Loader loader)

This is documented here.

What is not documented (due to an oversight that I hope to have corrected soon) is that If you want to load additional assemblies from another location you can use a function on AssemblyLoader.Loader class called LoadAssemblies(). Here are the missing docs: 

void AssemblyLoader::Loader::LoadAssemblies ( String directoryPath, String search_pattern, bool call_init_method )

  Load all assemblies in the given path or any of its subdirectories.

Parameters:

  directoryPath     The path under which to look for assemblies.
  search_pattern    The pattern of files to search for
  call_init_method  Pass in true to call the initialization methods on the assemblies that are found, false otherwise. When loading maxscript assemblies for instance, it is necessary to pass in false to this method.

Using this method you can write a very simple .NET utility in a few lines that tells the loader where to look for additional files.

Unfortunately this is currently a bit limited in that it doesn't work for assemblies loaded that contain a CuiActionCommandAdaptor.

I apologize that this documentation hasn't been made available sooner, but you can use the object browser to find the signature. I hope this helps! 

Comments

There are currently no comments for this post. Be the first to comment!

Add Your Comment

You must be logged in to post a comment.

Please only report comments that are spam or abusive.