PDA

View Full Version : mel question


minos365
07-04-2003, 04:07 PM
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`;

$ball=$shape[0]

setAttr ($ball + ".uDivisionsFactor" + " " + 1.5);
}

dstripinis
07-04-2003, 04:44 PM
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

CGTalk Moderation
01-15-2006, 01:00 PM
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.