How To remove Hidden Objects for Selection Set



Im Creating SelectionSet .


etc …

i have hidden objects in my Scene that i want to keep them hidden and out of the selection sets .

so what im trying to do is to collect all the Hidden objects, all the Assets and then remove the hidden objects from the selection sets .

thats what im running , any ideas on how to work it out ?

hidden_objects = for obj in objects where obj.isHidden collect obj
selectionSets[“Hidden”]= hidden_objects

selectionSets[“Geometry”] = Geometry

H =selectionSets[“Hidden”]

maybe there is any other better way to solve it .



maybe there’s a better way of doing it

for ss in selectionsets do
  selectionsets[ ] = for s in ss where not s.isHidden collect s




What exactly it does ?

i did a quick test and seems that it works , can you explain Please .


Edit - Just Tried it with all the Code that im running and its doesn’t work :frowning:


What’s so wrong with “regular” Max UI commands/methods that make’s you want to replace them with Maxscript?
That certainly isn’t maxscript purpose


im working on a project and i try to do as much as possible automatically.

when i collect the assets and Create passes im getting also the hidden objects that i want to keep hidden and not visible.

thats pretty much it , instead of hiding them manually i prefer to keep them hidden automatically


Consider using layers instead of selection sets. This is a more commonly used technique for organizing a scene. The main difference is that the node can optionally inherit the display settings of its layer.


ok , but any way is there a way to that ?

its really messy , no naming convention or any order .