PDA

View Full Version : Check if UVWMap modifier is applied


pixel9
08-18-2008, 08:06 AM
Good morning!

I tried several ways, but didn't come up to a solution that lets me select all objects in a scene which have a UVW Map modifier in the stack.
I tried

select (for o in geometry where o.modifiers == Uvwmap collect o)

But all the maxscript listener replies is an "ok" :sad:

Does anyone around already done a script on this?

Thanks in advance for all your help.

floopyb
08-18-2008, 08:52 AM
You can use my script to do it for any modifier:
http://www.scriptspot.com/3ds-max/modifier-modifier-zorb

With your code you are not looping through all the modifers on each object
try this:

MySelection=#()
for obj in objects do (for mod in obj.modifiers do (if classof mod == uvwmap do (append Myselection obj)))
Select MySelection

pixel9
08-18-2008, 09:12 AM
I did come up with combining 2 for-loops as well now, but didn't get the if-clause to work correctly.

Thanks for your short script. It works nice! :)

pixel9
08-18-2008, 09:46 AM
Now, how can I easily invert the selection to get all objects without the specific modifier being selected? - My brain is stuck in some way. Monday morning. I need more coffee :D

decapitator
08-18-2008, 09:49 AM
Not to forget the wonderfull syntax of the for loop (compared to the languages i know max his for is verry flexible)--clearSelection()
for obj in geometry do for modi in obj.modifiers where classof modi == Uvwmap do selectMore obj

Edit:
Well to keep it simple "max select invert", and otherwise you can check up on "findItem" combined with a for loop that collects "classof obj"

pixel9
08-18-2008, 10:06 AM
max select invert

So easy, as it is :D

CGTalk Moderation
08-18-2008, 10:06 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.