Nope, that sounds like a pretty good method. 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…
Thank you MoP. 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…
Sorry, edited while you were replying. Well spotted :) Here's a version that just selects instead of smoothing:string $transforms[] = `ls -tr`;string $result[] = {};for ( $transform in $transforms ){ string $meshes[] = `listRelatives -ad -ni -type "mesh" $transform`; if ( `size $meshes` == 0 ) continue; int $found = 0;…
No, it's only the polysmooth command that is wrong. As it reads, it will smooth everything. The node that is listed in the history isn't polysmooth. It's missing one more word, like polysmoothXXXX. I ran into this before as the command it is looking for isn't in the documentation.
By "smoothed polygons", do you mean polygons that have been physically subdivided using the "Smooth" method (resulting in a polySmooth node in the History), or just polygons sharing soft edges?
Close MoP, 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.
Actually, the script at which i am working aims at selecting a particular set objects in a given scene and apply smooth on them through the "polySmooth" command. I want the script to have functionality of listing objects on which smooth was previously applied and apply smooth on rest of the objects(leaving previously…