PDA

View Full Version : setAttr of all attributes at once


goosh
01-08-2003, 12:18 AM
Hi all

I was wondering if there was a way to set off (or on) all the attributes of an object with on line instead of doing something like:

setAttr -lock off ($object+".translateX");
setAttr -lock off ($object+".translateY");
setAttr -lock off ($object+".translateZ");
setAttr -lock off ($object+".rotateX");
setAttr -lock off ($object+".rotateY");
setAttr -lock off ($object+".rotateZ");
setAttr -lock off ($object+".scaleX");
setAttr -lock off ($object+".scaleY");
setAttr -lock off ($object+".scaleZ");

Ideally I wanted to do:

setAttr -lock off ($object);

and do all of the above.

yes? no?

Thanks

Goosh

sunit
01-08-2003, 12:46 AM
Originally posted by goosh
Hi all

setAttr -lock off ($object+".translateX");
setAttr -lock off ($object+".translateY");
setAttr -lock off ($object+".translateZ");
setAttr -lock off ($object+".rotateX");
setAttr -lock off ($object+".rotateY");
setAttr -lock off ($object+".rotateZ");
setAttr -lock off ($object+".scaleX");
setAttr -lock off ($object+".scaleY");
setAttr -lock off ($object+".scaleZ");

setAttr -lock off ($object);

Goosh

one of the things you can do is enter your keyable attributes into a string array:

string $attrs[]=`listAttr -k $object`;
or
string $attrs[]={"tx","ty","tz","rx","ry","rz"};

for ($attr in $attrs)
{
setAttr -l on ($object+"."+$attr);
}


-sunit

goosh
01-08-2003, 12:49 AM
I guess that'll have to do..

Works for me.. thanks

Goosh

CGTalk Moderation
01-14-2006, 04: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.