View Full Version : move attribute
S E D A H 09-25-2002, 04:03 PM when you create attribute in the attribute editor to do some drivrn key or connect a joint to a attribute call move head and l put more than one attribute on the same object.....now l need to move attribute ex\ l want move head under rotate eye how l can do that
|
|
S E D A H
09-25-2002, 04:06 PM
one more thing l want to move them in the channel box the order l get there.............
MDuffy
09-25-2002, 04:47 PM
Unfortunately Maya doesn't have an interface for doing this yet. We requested it of them when they were demoing down here way back when, but I don't know if it got on a to-do list or not.
In the meantime, you can manually re-order things if you have to. Save your file out as a MayaAscii file, load that file in a text editor, search for your attribute name till you find the command that creates that attribute (addAttr), and re-order the order of creation of the attributes there. The order of attributes in the channel box is the order they were created in, so you have to adjust their ordering there.
Hope this helps,
Michael Duffy
mduffy@ionet.net
S E D A H
09-25-2002, 04:54 PM
thz for the tip.........
looksoon
09-29-2002, 01:28 AM
Originally posted by S E D A H
when you create attribute in the attribute editor to do some drivrn key or connect a joint to a attribute call move head and l put more than one attribute on the same object.....now l need to move attribute ex\ l want move head under rotate eye how l can do that
:applause: give you a mel of mine ,maybe it can help you!
dmcgrath
08-19-2003, 03:52 AM
This is such a cool script, it's probably on HighEnd3D, but I found it here. The original is posted as a text file above. Here is my renamed version. It works great! Thanks looksoon, wherever you are.
//You only need to have some control object you have created
//with extra attributes added for this script to work properly.
global proc attrListWin ()
{
if (`window -exists attrListWin`)
{
deleteUI attrListWin;
}
global string $oMN[];
global string $attrL[];
global string $obName[];
$obName =`ls -sl`;
if ( size($obName) != 0 )
{
$attrL = `listAttr -ud $obName[0]`;
window -t "Attr Relist" -wh 300 300 attrListWin;
string $sLN = `scrollLayout -hst 16 -vst 16`;
string $tL = `columnLayout -columnAttach "both" 5 -adj true`;
separator;
text -l ("Selected Object Name " + $obName[0]) -align "center";
separator;
string $rCLN = `rowColumnLayout -numberOfColumns 3`;
text -l "Current Order" -align "center";
text -l "Attribute Name" -align "center";
text -l "Reorder To" -align "center";
separator;
separator;
separator;
for ($i = 0; $i < size($attrL);$i ++)
{
text -l ($i +1) -align "center";
text -l $attrL[$i] -align "center";
$oMN[$i] = `optionMenu -l " "`;
for ($ii = 0; $ii < size($attrL);$ii ++)
{
menuItem -label ($ii + 1) ;
}
optionMenu -e -sl ($i + 1) $oMN[$i];
}
separator -p $tL;
separator -p $tL;
separator -p $tL;
button -l " O k " -p $tL -c command1;
button -l "Close" -p $tL -c command2;
showWindow attrListWin;
}
else
{
warning "Warning!";
}
}
global proc command1()
{
global string $oMN[];
global string $attrL[];
global string $obName[];
int $index[];
$num = 0;
$comp = 0;
for ( $i = 0; $i < size($attrL); $i ++)
{
$index[$i] = `optionMenu -q -sl $oMN[$i]` -1;
}
for ($a = 0 ; $a < size($index); $a ++)
{
$num = $num + $index[$a];
}
for ($b = 0; $b < size($index); $b ++)
{
$comp = $comp + $b;
}
if ($num != $comp)
{
$mess = `confirmDialog -title "Error!!" -message "Error!!"
-button "·µ»Ø"
-dismissString "·µ»Ø"
-cancelButton "·µ»Ø"`;
if ( $mess == "·µ»Ø" )
{
attrListWin;
}
else
{
command2;
}
}
else
{
attrList $index;
attrListWin;
//deleteUI attrListWin;
}
}
global proc command2()
{
deleteUI attrListWin;
}
global proc attrList( int $newList[] )
{
string $attrLO[];
string $obNameP[];
string $attrNT;
$obNameP = `ls -sl`;
$attrLO = `listAttr -ud $obNameP[0]`;
for ( $i = 0; $i < size ($attrLO); $i ++ )
{
$tempName = $attrLO[$i] + "_T";
$attrN = $obNameP[0] + "." + $attrLO[$i];
renameAttr $attrN $tempName;
}
$attrLT = `listAttr -ud $obNameP[0]`;
for ( $i = 0; $i < size($attrLT); $i ++ )
{
$n = 0;
while ( $i != $newList[$n] )
{
$n = $n +1;
}
$attrLL = `size($attrLT[$n])`;
$subL = $attrLL - 2;
$attrNT = $attrLT[$n];
$onName = `substring $attrNT 1 $subL`;
$attrN = $obNameP[0] + "." +$attrLT[$n] ;
renameAttr $attrN $onName;
}
select -r $obNameP[0] ;
}
attrListWin;
CGTalk Moderation
01-13-2006, 05:00 PM
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.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.