Notifications
Clear all

[Closed] Array of not hidden objects

What is the fastest way to get an array of objects that are NOT hidden.

I wish avoid using “select” as some of the scenes are very large and do not want to step through the whole scene for the same reason.

Thanks.

Keith Morrison

5 Replies

Dang! This is where having Max and the docs would help me out tremendously (I don’t keep some of the little things in my brain:)). Try this:

non_hidden = for obj in Objects where obj.isHidden==false collect obj

or:

non_hidden = for obj in $Objects where obj.isHidden==false collect obj

The idea is, there’s a certain keyword that returns all objects in the scene. Once you’ve got that nailed down you can use the above construct to collect only the non-hidden ones into an array, no selection necessary:)

RH

Yeah, thanks…

That’s recursing the whole scene. Likely the only way to do it!

Thanks Again

Keith

Yep! Unfortunately there’s no other way to do it:thumbsdow

What’s your ultimate goal, though? Perhaps there’s a better way to get there that you’re missing. Probably not, but there’s a chance:shrug:

RH

Just the fastest way to get an array of visible objects to perform an operation on them.

MAX SELECT ALL

is ridiculous slow. So looping through the scene and checking each node is apparently the only option, and still MUCH MUCH MUCH faster…

Thanks…

Keith

there’s a certain keyword that returns all objects in the scene.

$/* will return all objects in a scene (including all hidden).