PDA

View Full Version : Stupid attribute loop.


AWAKE
01-05-2004, 10:44 PM
I know I'm doing this wrong. I want to set all of the selected objects attributes to the same value.

It only works one obj act a time.


-------------
string $selected[] = `ls -sl`;
string $currentObj;

for ($currentObj in $selected)
{

$attr = ($currentObj + ".scalex");

setAttr $attr 0;


}
------------------

tell me how dumb I am.

Thanks

mhovland
01-05-2004, 10:47 PM
Try this instead

string $selected[] = `ls -sl`;
string $currentObj;

for ($currentObj in $selected)
{
setAttr ($currentObj +".scaleX") 0;
}

AWAKE
01-06-2004, 12:00 AM
Yes.


That is better. The real issue I was having was trying to set the "miDeriveFromMaya" attr on the objects transform.

Turns out that the attrs are created on the fly when you open the attr editor...

CGTalk Moderation
01-17-2006, 03:00 AM
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.