CGTalk > Software > Autodesk Maya > Maya Programming
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
Thread Tools Search this Thread Display Modes
Old 05-08-2003, 07:24 AM   #1
nelsonteixeira's Avatar
Nelson Teixeira
3D Modeler, Rigger and Animator
Rio de Janeiro, BR
Join Date: Dec 2002
Posts: 350
Send a message via MSN to nelsonteixeira
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

Old 05-08-2003, 08:13 AM   #2
svenip's Avatar
Character Technical Director PDI/Dreamworks
Join Date: Apr 2002
Posts: 1,038
string $foo[] = `ls -sl`;

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

should work
heimwerker never die
Old 05-08-2003, 08:19 AM   #3
James Jacobs
New Member
James Jacobs
New Zealand
Join Date: Feb 2002
Posts: 20
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
Creature TD
Old 05-08-2003, 08:25 AM   #4
Google E. Bear
dwalden74's Avatar
David Walden
Rigging, scripting.
Join Date: Feb 2002
Posts: 818
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;

Old 01-15-2006, 03:00 AM   #5
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
Join Date: Sep 2003
Posts: 1,066,479
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

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 08:05 AM.

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