PDA

View Full Version : How do I get the polySmoothNode...


nelsonteixeira
01-25-2006, 06:47 PM
How do I get the polySmoothNode in a selected object using mel?? I want to check if thereīs a polySmoothNode associated to the selected object if yes set the subdivisions = 0, and ignore the other smoothNodes in the scene.

john_homer
01-26-2006, 02:34 AM
select all the objects you want to do it to and run the following..
note.. change the value of $divisionInt in teh first line to whatever you want.


int $divisionInt = 0; // divisions will be set to this value
string $sel[] = `ls -sl`; // get the selection
for ($current in $sel) // for each on in the selection
{
string $histList[] = `listHistory $current`; // get all of the objects history
string $smoothNodes[] = `ls -type "polySmoothFace" $histList`; // list the items in history that are smooths
setAttr ($smoothNodes[0] + ".divisions") $divisionInt; // set the divisions
}


.j

nelsonteixeira
01-26-2006, 02:11 PM
Thank you Homer, thatīs just what I needed! And thank you for being so active on this forum!
Iīve learned a lot from your posts at this great forum!! :bowdown:

GennadiyKorol
01-26-2006, 04:30 PM
In case you're writing something similar to the subdivision surface display options but for polygons, this could be interesting for you:
http://forums.cgsociety.org/showpost.php?p=2467974&postcount=208

john_homer
01-27-2006, 12:16 AM
thanks nelson, nice to hear ;)

haha nice one mr.Hawk... I'm sure most these things get done a few times...
I guess writing mel is just more fun than searching ;)

c ya
.j

jdj
01-27-2006, 11:08 AM
Hi,

Just my $0.02: you can oalso set the nodeState to "has no effect" and the mesh will flow through your polySmooth node unaltered - this way you do not need to remember what setting your subdivision parameter had before you turned it off if you want to turn the effect back on again.

Cheers!
/ Daniel

CGTalk Moderation
01-27-2006, 11:08 AM
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.