Zookeeper plugin is a .NET managed assembly which is (usually) installed in 3ds Max's /plugins directory. The assembly is called Ephere.Plugins.Autodesk.Max.Zookeeper.dll
MaxScript provides a mechanism for loading and using .NET assemblies on the fly alongside other MaxScript objects. We will use this mechanism to load Zookeeper assembly and perform operations with it that control Zookeeper and the scene. Zookeeper assembly exposes a subset of its functionality for public use. Most of this functionality is all that is needed to control all of Zookeeper's GUI.
You can browse all exposed methods inside Zookeeper's assembly using the SDK reference help file.
Because Zookeeper is already a managed assembly that is loaded/used by Max.NET and, therefore, loaded into 3dsmax's app domain we do not need to load anything. Zookeeper classes are ready for use after 3ds Max has started!
Examine the following listener entries:
zkPlugin = dotNetObject "Ephere.Plugins.Autodesk.Max.Zookeeper.Plugin"
dotNetObject:Ephere.Plugins.Autodesk.Max.Zookeeper.Plugin
zkInstance = zkPlugin.Instance
dotNetObject:Ephere.Plugins.Autodesk.Max.Zookeeper.Plugin
showProperties zkInstance
.Anchor : <Ephere.Plugins.Autodesk.Max.Zookeeper.Anchor>
.ClassDescManager : <Ephere.Plugins.Autodesk.Max.Zookeeper.ClassDescManager>, read-only
.Configuration : <Ephere.Plugins.Autodesk.Max.Zookeeper.Configuration>
.EntityManager : <Ephere.Plugins.Autodesk.Max.Zookeeper.Entities.EntityManager>, read-only
.Global : <Autodesk.Max.IGlobal>, read-only
.GlobalStringFormat : <System.Drawing.StringFormat>, read-only
.HasRenderPreviewNode : <System.Boolean>, read-only
.Instance : <Ephere.Plugins.Autodesk.Max.Zookeeper.Plugin>, read-only, static
.InvokeRequired : <System.Boolean>, read-only
.NestedLayers : <Ephere.Plugins.Autodesk.Max.Zookeeper.NestedLayers>, read-only
.NodeEvents : <Ephere.Plugins.Autodesk.Max.Zookeeper.Plugin+NodeEventCallback>, read-only
.PreviewRenderNode : <Autodesk.Max.IINode>, read-only
.SceneClosing : <System.Boolean>, read-only
.Sync : <System.ComponentModel.ISynchronizeInvoke>, read-only
.accumCallbacks : <System.Int32[]>
.GWL_STYLE : <System.Int32>, read-only, static
true
We get access to Zookeeper's Plugin class using dotNetObject "Ephere.Plugins.Autodesk.Max.Zookeeper.Plugin". Then we grab an .Instance property of that class and show all available properties. From here we have access to Zookeeper's interface.
For example, now we can launch Zookeeper using following command:
zkInstance.LaunchBlank null
Lets now explore a way to add a new schematic view to Zookeeper through MaxScript, assuming we still have out zkInstance object.
First lets access the Zookeeper's root entity. This is the root of Zookeeper's whole UI tree and from here we can control pretty much everything that it displays.
rootEntity = zkInstance.EntityManager.RootEntity
Now lets create a new View entity and in constructor give it a name and make it a schematic view.
ViewType = dotNetClass "Ephere.Plugins.Autodesk.Max.Zookeeper.ViewType"
schematicView1 = dotNetObject "Ephere.Plugins.Autodesk.Max.Zookeeper.Entities.View" "Schematic1" ViewType.Schematic
Finally lets add our schematic view entity to the root entity and create the schematic view:
rootEntity.AddChild schematicView1 false
Note that we specify false to make sure that the schematic view will be saved and loaded with the scene.