PDA

View Full Version : get geometry in selection


kimgar
03-23-2006, 09:34 AM
hi,

i have a selection of geometry and dummies, and i want to create an array of the geometry only, something like this :

arr_g = for o in selection where o == geometry collect o

i'm am new to maxscript, and have searched around but i'm not even sure if i've stumbled upon an answer...

could someone please help me out?

Moosley
03-23-2006, 10:04 AM
You're nearly right... It should be this:

arr_g = for o in selection where superClassOf o == geometryClass collect o

kimgar
03-23-2006, 10:34 AM
aahh, my hero!

thank you ever so much man! you've saved my day!

magicm
03-23-2006, 03:18 PM
You can also collect geometry objects directly using:

arr_g = for o in geometry collect o

Cheers,
Martijn

Bobo
03-23-2006, 03:32 PM
You can also collect geometry objects directly using:

arr_g = for o in geometry collect o

Cheers,
Martijn

Or shorter,

arr_g = geometry as array

Both methods are equally fast.

kimgar
03-27-2006, 06:59 AM
thanks for the suggestions - i've been using 'geometry as array' in various situations, and it works like a charm, but the problem i had in this case was that i did not want all objects in my scene to be collected (which 'geometry as array' seems to do), just the ones in my selection...

CGTalk Moderation
03-27-2006, 06:59 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.