DEVILSAN
02-07-2009, 01:37 AM
Hi I was trying to figure out how to get what mode i am in using MEL so i found this procedure at this place C:/Program Files/Autodesk/Maya2008/scripts/others/dagMenuProc.mel
i never came to learn either in MEL Books or tutorial about the procedure that is declared this way global proc string[] objectSelectMasks(string $item), though i understand its string type array , does that mean it returns string or something else :hmm:
global proc string[] objectSelectMasks(string $item)
// Returns the component selection masks that apply to this object
{
string $maskList[];
string $shape = $item;
int $i;
// Look at the shape child of this object
//
string $object[] = `listRelatives -path -s $item`;
int $gotVisible = 0;
for ($i = 0; $i < size($object); ++$i) {
if( (0 == getAttr($object[$i] + ".io")) &&
getAttr($object[$i] + ".v") ) {
$shape = $object[$i];
$gotVisible = 1;
break;
}
}
if( !$gotVisible ) {
for ($i = 0; $i < size($object); ++$i)
{
if (getAttr($object[$i] + ".io") == 0)
{
$shape = $object[$i];
break;
}
}
}
and so i am trying to take the value of what is return by the object, but my condition to validate what i want is if its not in any sub mode or if its not any joint , the do some function like doDelete;
i never came to learn either in MEL Books or tutorial about the procedure that is declared this way global proc string[] objectSelectMasks(string $item), though i understand its string type array , does that mean it returns string or something else :hmm:
global proc string[] objectSelectMasks(string $item)
// Returns the component selection masks that apply to this object
{
string $maskList[];
string $shape = $item;
int $i;
// Look at the shape child of this object
//
string $object[] = `listRelatives -path -s $item`;
int $gotVisible = 0;
for ($i = 0; $i < size($object); ++$i) {
if( (0 == getAttr($object[$i] + ".io")) &&
getAttr($object[$i] + ".v") ) {
$shape = $object[$i];
$gotVisible = 1;
break;
}
}
if( !$gotVisible ) {
for ($i = 0; $i < size($object); ++$i)
{
if (getAttr($object[$i] + ".io") == 0)
{
$shape = $object[$i];
break;
}
}
}
and so i am trying to take the value of what is return by the object, but my condition to validate what i want is if its not in any sub mode or if its not any joint , the do some function like doDelete;
