Notifications
Clear all

[Closed] Unhide $ doLayer:False not working..?

Hello again,

I’m having issues with unhiding a selection that’s in layer thats visibility is off…

I want to unhide the select object(s), but not their layer they are in, just the objects themselves.

But for some reason, I can’t get this to work…

I’ve tried:

$.displayByLayer = false
  $.renderByLayer = false
   unhide  $ doLayer:false
  

None of these do anything… :S

On a side note… I’m also trying to delete lights in a scene, which works if I don’t have the code inside of a rollout, which otherwise ends up in a system exception…

I’m doing, for o in lights do delete o

Any ideas?

Thanks!

9 Replies

Well… I know why it doesn’t work…

I am using SetGroupHead in my script, which I guess breaks the object after that…

I would like to be able to select the Group Helper if possible, and close the group through the script, then get the helpers/groups name if possible.

That will never work, layer properties override object properties. You would have to move the objects to an unhidden layer to do what you want. From the Maxscript Help on “General Node Properties”:

<node>.isHidden Boolean default: false

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.

[u][i][b]A node is hidden in the viewport if:

  1. The node’s hidden flag is set,
  2. The node’s layer hidden flag is set,
  3. The node’s category is hidden via Hide By Category, or
  4. The node is frozen and Hide Frozen Objects is enabled
    [/b][/i][/u]
    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.

Condition 2 can be handled by getting the node’s layer and checking the layer’s isHidden property using theNode.INodeLayerProperties.layer.isHidden

For handling Condition 3, see the hideByCategory structure added in 3ds Max 6.

Condition 4 can be handled by getting the node’s frozen status using theNode.isFrozen and checking the maxOps.hideFrozenObjects property.

<node>.isNodeHidden Boolean default: false
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.

<node>.isHiddenInVpt Boolean default: false
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.
-Eric

Hey,

Ok… cool thanks for the info

I might just leave the stuff hidden, since max does that normally when u merge stuff anyways thats in a hidden layer.

I’ll just leave the stuff that’s hidden selected, so they know it was merged in properly.

I also solved my group issues, but looping through Helpers, and doing if grouphead command, then get those objects and the helpers(groups) name and so on.

Thanks!

Oh…

Anyone got an idea about that light situation I mentioned?

Exception error when I do


for o in lights do delete o

when I have that in a rollout?

Have you tried just “delete lights” ? Anyway, show the rollout so we can answer it better, maybe you’re doing something wrong in the rollout.

Ok, I’ll give that a shot and see and if not I’ll post what I’m doing

I also ran into a issue where if I do something like

Local test = “$” + “group()”
Local test2 = execute test

I get a string stream error… BUT if the group() is just Group insead, it works…

Even If I do select $Group() it fails unless I rename the group to Group.

$Group() != $‘Group()’, () are illegal characters for a name and needs to be ’ or _. Look up “Names” in the Maxscript Help for what is supported in maxscript names. From that page:

THE FOLLOWING NAMES ARE NOT VALID:
[left]1object – First character not an alphabetic character
[/left]
[left]pressed? – ? is not a valid alphanumeric character
[/left]
[left]a big number – spaces not allowed in names
[/left]
[left]seven(7) – ( and ) are not valid alphanumeric characters
Try wrapping the name in single quote marks ’ . Or assign the result of the group command to a variable, then use that to do whatever you want.
[/left]

-Eric

Ok, awesome. I’ll give that a shot. Thanks again!

Thanks alot man, both of those worked perfect