[Closed] Improved Outliner for Max
Hi there,
I wrote this outliner to help out with Max’s built in Select-By-Name dialog, mainly in regards to accessing group objects within the outliner, but ended up adding a bunch of features as a kind of.
Also, I have created a library of maxscript functions that I use commonly that can both be downloaded to be used for other’s scripts, or added to. But, it must be downloaded for the outliner to work.
Here is a screenshot of the outliner:
Maxscript function library (with explanation/installation):
http://www.hulser3d.com/maxscripts/CustomLib.zip
Maxscript Object Outliner:
http://www.hulser3d.com/maxscripts/CustomOutliner.zip
I will hopefully be updating my site regularly, I have a few other tools on there at the moment, but more will come soon most likely. www.hulser3d.com
Any comments, suggestions, criticisms would be appreciated. Oh, one problem that there is with the script is that it does not recognize if objects have been hidden by typ (lights, geometry, warps, etc.) If anyone knows how I can check for this in Maxscript, I’ll add that to the functionality. Thanks.
Wahooney – I checked out the Hide By Category like you suggested, but all I got was the max commands to toggle between the hides (max hide camera toggle, max hide helper toggle, etc.) What I need, is something for when the script loads to recognize if any of those are checked, because if they are, the objects in the scene are to all practical purposes not hidden. Ie:
$foo.isHidden -> false
$foo.isFrozen -> false
Even if $foo is a camera and the hide by category for cameras is checked. I could be overlooking something, but I’ve been pulling my hair out tryin to figure out what. Any other suggestions? Thanks for the help =)
Also, got an email this morning, there was a problem with the CustomLib, but it is fixed now, so if anyone downloaded the tool and got trouble with a “CustomXL.ms” link, that bug has been fixed.
From the Help:
[left]<node>.isHidden Boolean default: false
[/left]
[left]Get or set whether the node is flagged as hidden in the viewports. A node may be hidden even if this property is false. If the node is flagged as frozen and Hide Frozen Objects is on in the Hide rollout in the Display panel, the node will be hidden regardless of this property’s value.
[/left]
[left]A node is hidden in the viewport if:
[/left]
[left]1. The node’s hidden flag is set,
[/left]
[left]2. The node’s layer hidden flag is set,
[/left]
[left]3. The node’s category is hidden via Hide By Category, or
[/left]
[left]4. The node is frozen and Hide Frozen Objects is enabled
[/left]
[left]The node’s isHidden property reflects a combination of conditions 1 and 2. The property returns true if either condition 1 or 2 is true. Setting the property to true sets the node’s hidden flag. Setting the property to false clears both the node’s and the node’s layer’s hidden flag.
[/left]
[left]Condition 2 can be handled by getting the node’s layer and checking the layer’s isHidden property using theNode.INodeLayerProperties.layer.isHidden
[/left]
[left]For handling Condition 3, see the hideByCategory structure added in 3ds Max 6.
[/left]
[left]Condition 4 can be handled by getting the node’s frozen status using theNode.isFrozen and checking the maxOps.hideFrozenObjects property.
[/left]
[left]
<node>.isNodeHidden Boolean default: false
[/left]
[left]The node’s isNodeHidden property reflects only condition 1 listed above. The property returns true if the node’s hidden flag is set, false if not. Setting the property sets only the node’s hidden flag.
[/left]
[left]<node>.isHiddenInVpt Boolean default: false
[/left]
[left]This is a read-only property that returns true if any of the 4 conditions is true, that is, the node is hidden in the viewport for some reason.
[/left]
As you can see, .isHidden reflects only the first two conditions but not the 3rd which is the by-category one. If you want to know if a node is REALLY NOT VISIBLE IN THE VIEWPORT, you should use the isHiddenInVpt property which would be true if ANY of the 4 conditions is met. (It does an OR for all 4 conditions).
If you want to reflect ONLY the By Category checkboxes, you would have to check the class of the object against the class being affected by the corresponding checkbox and decide yourself. For example, you could say
theHiddenArray = #()
if hideByCategory.geometry do join theHiddenArray (Geometry as array)
if hideByCategory.cameras do join theHiddenArray (Cameras as array)
if hideByCategory.lights do join theHiddenArray (Lights as array)
--and so on...
Since targets can be part of the Cameras, Lights and Helpers object sets depending on their lookat object, this would correctly collect any objects from those groups.
At the end, you will have an array of any objects that should be hidden because of their category. You can check against this array when you display the hidden state of your objects…
Arggh…that’ll do it. I’ve been programming the tool in 3dsMax5, not 6 or 7, and as far as I could tell, there was no way to do it. Thanks for explaining it Bobo. I didnt need to hide anything by category, I just needed to figure if the objects were in the viewport, and that’ll work only for v.6 and up I guess.
Ok, so thanks to Bobo and Wahooney, the script now handles if objects are hidden by category, so it pretty much does everything I want it to (I also fixed a bug that hid children when it shouldn’t have). So yea, hopefully people find this useful. Same links as before.
Hey there Eric, great script! It’s kind of like an expanded selection floater. I think this has real potential to be an big part of my workflow.
Few sneaky wishes though:
- It’d be great if the dialog was resizable to make the object list wider, just like the selection floater does. There needs to be a horizontal scroll bar in the list as well.
- Double clicking on an object in the list should select it rather that select its children (well, I think).
- The position, rotation and scale values should be spinners for easier manipulation.
Great work once again.
:¬)