I am new to the 3d field , learning maya at present. I am trying to develop a script , one of the module aims at separating smoothed polygonal objects.
i am having problem in separating the smoothed polygons , though i have stored all the polygons in a an array.
Need help with it , plz help me.........:(
Replies
So I guess you can get all objects, then use the listHistory command to find out if there are any polySmooth nodes. If there aren't any found, just call the polySmooth command for that object.
It should be pretty straightforward - here's some example code (not 100% guaranteed to work since I don't have Maya here):
That might work.
the "nodeType $node == polysmooth" is wrong, the correct command is. Well I gotta get in front of the computer as they don't have maya for iPod.
Also you forgot the "$", on found. Other than that, it will work.
Ah, and yeah, it's "polySmoothFace", not just "polySmooth". Fixed that too.
Here's a version that just selects instead of smoothing:
You saved me from getting out of bed MoP !! Too cold!
I kinda figured out the node "polySmoothFace" and the "$found" errors myself, may be what i just needed the most was proper method of using listHistory command.
i missed the listHistory command while running through the HelpDocs , be`coz i did`nt new the proper method.
I completed my script and it works just fine. I used the following code, for separating the previously smoothed objects from the selected objects ,
string $polySel[]=`listRelatives -ad -ni -type "mesh" $objSel`;
int $objFound = 0;
string $history[] = `listHistory $polySel[ 0 ]`;
for ( $node in $history )
{
if ( `nodeType $node` == "polySmoothFace" )
{
$objFound = 1;
$prevSmooth[$i]=$polySel[0];
$i++;
break;
}
}
$objSel, refers to the selected object
$prevSmooth, refers to the objects previously smoothed
i am happy to get something like PolyCount forum,
Thank you once again for replying to both of you, Mop and Lamont.