This simple scriptlet unlocks and unhides the default transform attributes (translate, rotate, scale)
CODE
global proc msAttrUnlockUnhide_all()
{
string $selectedObj[] =
for($obj in $selectedObj)
{
string $attrList[] =
for($attribute in $attrList)
{
setAttr -k 1 -l 0 ($obj + "." + $attribute); // Unhide and unlock attribute
}
/*
Set Default trans, rot, and scale attribute to unhidden and unlocked
*/
setAttr -k 1 ($obj + ".tx");
setAttr -l 0 ($obj + ".tx");
setAttr -k 1 ($obj + ".ty");
setAttr -l 0 ($obj + ".ty");
setAttr -k 1 ($obj + ".tz");
setAttr -l 0 ($obj + ".tz");
global proc msAttrUnlockUnhide_all()
{
string $selectedObj[] =
ls -sl;for($obj in $selectedObj)
{
string $attrList[] =
listAttr -v -l; // Get attributes that are visibily lockedfor($attribute in $attrList)
{
setAttr -k 1 -l 0 ($obj + "." + $attribute); // Unhide and unlock attribute
}
/*
Set Default trans, rot, and scale attribute to unhidden and unlocked
*/
setAttr -k 1 ($obj + ".tx");
setAttr -l 0 ($obj + ".tx");
setAttr -k 1 ($obj + ".ty");
setAttr -l 0 ($obj + ".ty");
setAttr -k 1 ($obj + ".tz");
setAttr -l 0 ($obj + ".tz");
setAttr -k 1 ($obj + ".sx");
setAttr -l 0 ($obj + ".sx");
setAttr -k 1 ($obj + ".sy");
setAttr -l 0 ($obj + ".sy");
setAttr -k 1 ($obj + ".sz");
setAttr -l 0 ($obj + ".sz");
setAttr -l 0 ($obj + ".sx");
setAttr -k 1 ($obj + ".sy");
setAttr -l 0 ($obj + ".sy");
setAttr -k 1 ($obj + ".sz");
setAttr -l 0 ($obj + ".sz");
setAttr -k 1 ($obj + ".rx");
setAttr -l 0 ($obj + ".rx");
setAttr -k 1 ($obj + ".ry");
setAttr -l 0 ($obj + ".ry");
setAttr -k 1 ($obj + ".rz");
setAttr -l 0 ($obj + ".rz");
setAttr -l 0 ($obj + ".rx");
setAttr -k 1 ($obj + ".ry");
setAttr -l 0 ($obj + ".ry");
setAttr -k 1 ($obj + ".rz");
setAttr -l 0 ($obj + ".rz");
clear $attrList;
$attrList =
for($attribute in $attrList)
{
setAttr -k 1 -l 0 ($obj + "." + $attribute); // Unhide and unlock attribute
}
clear $attrList;
}
listAttr -ud; // Get attributes that are userdefined, hidden or notfor($attribute in $attrList)
{
setAttr -k 1 -l 0 ($obj + "." + $attribute); // Unhide and unlock attribute
}
clear $attrList;
}
clear $selectedObj;
}
}
msAttrUnlockUnhide_all;
Không có nhận xét nào:
Đăng nhận xét