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 Tools Search this Thread Display Modes
  05 May 2003
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:


Anim Short

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

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

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


string $sels[] = `ls -typ "polySmoothFace"`;
for($sel in $sels){
setAttr ($sel + ".divisions") 2;
`, ,`,
James Jacobs
  05 May 2003
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;

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 03:50 AM.

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