mel question


i write some command to set a lot of nurbs surface tessellate to 1.5,but it don not work,can you let me what is wrong

string $list[];
$list=ls -sl;

string $ball;

for ($ball in $list)
$shape=pickWalk -d down $ball;


setAttr ($ball + “.uDivisionsFactor” + " " + 1.5);


You’re syntax on setAttr is slightly off. Try this:

string $selList[] = ls -sl;

for ( $each in $selList )
string $shapes[] = listRelatives -c -s;

    for ( $shape in $shapes )
            if ( `nodeType $shape` == "nurbsSurface" )
                    setAttr ( $shape + ".uDivisionsFactor" ) 1.5;

It uses list relatives rather than pickWalking to find the shape nodes. It will also only try if the object is nurbs.

There should be more checks in there, to find out if anything is driving the channel, or if the channel is locked. But it’s the fourth o July, and I gots Disneyland to get to!

hope this helps


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.