PDA

View Full Version : I want to list my root bone and its children


pigbelly
04-02-2003, 08:25 AM
Hi!

Sigh!! I suck att MEL :-)

So if any one could help me with this??

I want to list my root bone and its children that have the “export” attribute, and then I want to change that attribute!!

Any ideas??

/Tommie

alexx
04-02-2003, 09:21 AM
so i guess the "export" attrib is one you created on them?

svenip
04-02-2003, 09:21 AM
i would do it that way.

- name the root bone and just search via mel for it

- then list the childs (listRelatives -c -f -type joint) put the ouput of that command into an array

-now go through the array and delete every entry that has not your attribute

you get the idea ?

alexx
04-02-2003, 09:25 AM
the listRelatives you wrote down only gives back the direct relative.. not all :)

listRelatives -ad -c -f -type joint

cheers

svenip
04-02-2003, 09:43 AM
ok :)

so i have to beat you in HALLENHALMA (mit Windmaschiene)

will be a tough fight

alexx
04-02-2003, 09:43 AM
check this out..

very rough one without error detection.
you have to select your root joint and then run the script:


string $rootJoint[] = `ls -sl`;
string $relativesList[] = `listRelatives -ad -c -f -type joint`;

string $returnJoints[];

$returnJoints[0] = $rootJoint[0];

for ($i=0; $i<size($relativesList); $i++)
{
if (`attributeQuery -n ($relativesList[$i]) -ex "export"`)
{
$returnJoints[size($returnJoints)] = $relativesList[$i];
}
}

print ("\nResults: \n");
print ($returnJoints);


that is the part up to where you get all the relevant joints. (root plus the ones with the export attr.)
now you can throw that result in a loop (like the one above) and change the export attributes there..

cheers

alexx

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