PDA

View Full Version : Need a bit O mel help


Norb
02-12-2003, 11:13 AM
Hey guys, this is probably a really easy problem but I'm just jumpin into the mel stuff...


I have :

string $da[]=`ls -sl`;
string $material = `shadingNode -asShader blinn -name godRays`;
string $SG = `sets -renderable true -noSurfaceShader true -empty -name godRaysSG`;
connectAttr -f ( $material + ".outColor" ) ( $SG + ".surfaceShader" );

defaultNavigation -source godRays -destination $da -connectToExisting;


when I run it, it brings up the connection editor asking me what to hook up...
can anyone help me get it so it makes the default connections for all the objects in $da?


thanks



Norb

Norb
02-12-2003, 11:27 AM
also any help on just changing any attribute on a group of objects...

alexx
02-12-2003, 01:35 PM
your $da variable is an array.

you need to walk through it using a loop


for ($item in $da)
{
defaultNavigation -source godRays -destination $item -connectToExisting;
}

is the way to do what you want.

cheers

alexx

playmesumch00ns
02-12-2003, 02:53 PM
Originally posted by Norb
also any help on just changing any attribute on a group of objects...

Assuming you've got the objects in an array , e.g. $objects = `ls -sl`;

for ($obj in $objects)
{
setAttr ($obj+".someAttribute") $someValue;
}

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