CGTalk > Software Specific Forums > Autodesk Maya > Maya Programming
To minimize the ads you see on this page create a CGTalk account and log in HERE
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 05-08-2003, 07:24 AM   #1
nelsonteixeira
Know-it-All
 
nelsonteixeira's Avatar
portfolio
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: nelson3d@gmail.com

Site: http://www.nelson3d.com

Anim Short



 
Old 05-08-2003, 08:13 AM   #2
svenip
heimwerker
 
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.

-james

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
dwalden74
Google E. Bear
 
dwalden74's Avatar
David Walden
Rigging, scripting.
NY, USA
 
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;


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


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