Deselecting objects by specyfied modyfiers

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Display Modes
  11 November 2013
Deselecting objects by specyfied modyfiers

I have huge problem because I get so far but I stuck in this:
how to deselect objects in selection which contain specyfied modyfiers.
For instance:
check if there is objects in my selection with turbosmooth modyfiers, if yes then deselect this object from my selection if no then do nothing

I have such a script:

for o in selection do
for m in o.modifiers where classof m == meshsmooth do
deselect o

but it works only for one object, I need it to unselect all object with specyfied modyfier(s).
I would be v. gratefulfor any help.
  11 November 2013
You have a couple problems in your code.
The first one is that you are looping a list that gets changed during the loop and this causes the script to do funny things. So, instead of looping "selection", you better off first storing the selected objects in an array and then loop this array.
The second one is that you are looking for the wrong modifier type, "meshsmooth" is for the MeshSmooth modifier, you should be looking for "TurboSmooth".

   s = for o in selection collect o
   for o in s do (
   	for m in o.modifiers where classof m == TurboSmooth do deselect o

Last edited by Codi : 11 November 2013 at 02:57 PM.
  11 November 2013

it work, another problem solved. Thankyou
  11 November 2013
You can also check out modifierUtilities here:

Which does this and a lot of other similar operations.

- Neil
  11 November 2013
Thread automatically closed

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.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 09:24 PM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.