PDA

View Full Version : Array of not hidden objects


Kramsurfer
06-04-2003, 09:28 PM
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

LFShade
06-04-2003, 10:09 PM
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

Kramsurfer
06-04-2003, 10:13 PM
Yeah, thanks...

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

Thanks Again

Keith

LFShade
06-04-2003, 10:37 PM
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

Kramsurfer
06-04-2003, 10:44 PM
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

Baldrick
06-05-2003, 11:20 AM
there's a certain keyword that returns all objects in the scene.

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

CGTalk Moderation
01-15-2006, 08:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.