How Do I change 1 attribute in common for several objects

Become a member of the CGSociety

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

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 05 May 2003   #1
How Do I change 1 attribute in common for several objects

Id like to select all polySmoothFace* nodes, and change the divisions attribute for all of them, so I could assign a hot key to swith resolutions. Im new on MEL, and need some help!

This is what I tried:

select "polySmoothFace*";
$foo = `ls -sl`; // (how can I make this a string array?)
$Size = size ($foo+1);

for ($Index = 0; $Index < $Size; $Index++)
$nelson = "polySmoothFace"+$Size + ".divisions";
setAttr $nelson 2;
__________________
Nelson Teixeira
e-mail & MSN: nelson3d@gmail.com

Site: http://www.nelson3d.com

Anim Short



 
Old 05 May 2003   #2
string $foo[] = `ls -sl`;

for ($each in $foo)
setAttr ($each+".divisions") 2;



should work
__________________
heimwerker never die
 
Old 05 May 2003   #3
Here is one way.
I hope this helps you out.

-james

string $sels[] = `ls -typ "polySmoothFace"`;
for($sel in $sels){
setAttr ($sel + ".divisions") 2;
}
__________________
`, ,`,
James Jacobs
 
Old 05 May 2003   #4
You also dont have to actually select the nodes to modify them (doing it this way for me is a bit cleaner):

string $foo[] = `ls -type polySmoothFace`;

for ($f in $foo)
setAttr ($f + ".divisions") 2;


David
 
Old 01 January 2006   #5
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.
 
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
CGSociety
Society of Digital Artists
www.cgsociety.org

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

All times are GMT. The time now is 08:52 PM.


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