Leffler
02-06-2009, 06:56 PM
Hello, I´m working on a very small script that will make a "clean extract". What I mean with that is that it will remove all history, unparent the separated parts and delete the extra group-node in the outliner.
So this is what I have after 10minutes:
string $temp2[] = `polyChipOff -ch 0 -kft 1 -dup 0 -off 0 pSphere1.f[220:359] pSphere1.f[380:399]`;
print $temp2[1];
//get the chopped parts and printém
string $tempSepareate2[] = `polySeparate -rs 1 -ch 0 pSphere1`;
print $tempSepareate2[0];
print $tempSepareate2[1];
//get the parent group, unparent the extracted parts and delete parent
select -r $tempSepareate2[1];
string $fathern[] = `pickWalk -d up`;
select -r $tempSepareate2[1];
parent -w;
select -r $tempSepareate2[0];
parent -w;
select -r $fathern[0];
doDelete;
So this works just fine so far. But how do I go from here?
What I do know is how to pick up what is selected (ls -sl), but what I don´t know is how to get the other verts on the selected object.
In my example, I grabbed verts 220->359 on pSphere1.
But how do I get the remaining verts on the selected object with MEL?
Any other tips would be good of course!
Regards, Otto
www.ottoleffler.com
So this is what I have after 10minutes:
string $temp2[] = `polyChipOff -ch 0 -kft 1 -dup 0 -off 0 pSphere1.f[220:359] pSphere1.f[380:399]`;
print $temp2[1];
//get the chopped parts and printém
string $tempSepareate2[] = `polySeparate -rs 1 -ch 0 pSphere1`;
print $tempSepareate2[0];
print $tempSepareate2[1];
//get the parent group, unparent the extracted parts and delete parent
select -r $tempSepareate2[1];
string $fathern[] = `pickWalk -d up`;
select -r $tempSepareate2[1];
parent -w;
select -r $tempSepareate2[0];
parent -w;
select -r $fathern[0];
doDelete;
So this works just fine so far. But how do I go from here?
What I do know is how to pick up what is selected (ls -sl), but what I don´t know is how to get the other verts on the selected object.
In my example, I grabbed verts 220->359 on pSphere1.
But how do I get the remaining verts on the selected object with MEL?
Any other tips would be good of course!
Regards, Otto
www.ottoleffler.com
