Nebula2 Named Object Hierarchy Viewer
@section NMaxHowtoExposeNOHOverview OverviewThis tutorial demonstrates how to create a Nebula2 Named Object Hierarchy with MaxScript and TreeView ActiveX control. It is a simple demonstration of the Nebula2 3DS Max Expose plugin but you will get to know that it is powerful and can extend it in a various ways for your purpose.
The MaxScript source code of this tutorial nohviewer_demo.ms can be found in '$nebula2/code/contrib/nmax/maxscripts/
directory.
You can open and run the script in Utilities > MAXScript panel of 3DS Max. The following image is the result of the script.

The following is MaxScript code for this tutorial:
rollout NOHTreeViewer "Nebula Object Viewer" width:355 height:540 ( ActiveXControl tv "MSComctlLib.TreeCtrl.2" pos:[5,52] width:343 height:478 function addChild parentTreeNodeIndex parentNodeName objectName = ( cmd = parentNodeName + ".getchildren" children = nebula2.callv cmd for i in children do ( cmd = i + ".getname" objName = nebula2.callv cmd o = tv.nodes.add parentTreeNodeIndex 4 "" objName[1] addChild o.index i objName ) ) on NOHTreeViewer open do ( nebula2.sel "/" root = tv.nodes.add() root.text = "/" r = nebula2.callv ".getchildren" addChild root.index root.text root.text ) ) rollpage = newRolloutFloater "Nebula Object Viewer" 355 540 addRollout NOHTreeViewer rollpage
Next Step by Step section will shows you that how the above script works.
@section NMaxHowtoExposeNOHStepByStep Step By Step
rollout NOHTreeViewer "Nebula Object Viewer" width:355 height:540 (
NOHTreeViewer
will be used later on to create a dialog out of the rollout definition.
ActiveXControl tv "MSComctlLib.TreeCtrl.2" pos:[5,52] width:343 height:478
TreeView ActiveX control
in the rollout.
function addChild parentTreeNodeIndex parentNodeName objectName = (
cmd = parentNodeName + ".getchildren" children = nebula2.callv cmd
for i in children do ( cmd = i + ".getname" objName = nebula2.callv cmd
o = tv.nodes.add parentTreeNodeIndex 4 "" objName[1]
addChild o.index i objName )
on NOHTreeViewer open do (
nebula2.sel "/" root = tv.nodes.add() root.text = "/"
r = nebula2.callv ".getchildren"
addChild root.index root.text root.text )
rollpage = newRolloutFloater "Nebula Object Viewer" 355 540 addRollout NOHTreeViewer rollpage
@section NMaxHowtoExposeNOHSeeAlso See Also
See Nebula2 3DS Max Expose Commands Reference for supported commands.
If you want to know more about MaxScript and supported TreeView ActiveX control, find the followings in a MaxScript Reference. (only available on 3DS Max7)
- ActiveX Controls in MAXScript Rollouts
- TreeView ActiveX Control
- How to - Practical Examples > How To...Develop a Scene Browser using TreeView ActiveX Control