PDA

View Full Version : columns and rows


soupman99
02-02-2011, 12:55 AM
I'm trying to write a script that creates a new render layer and adds the object named the same+"_" but I get a syntax error.


for( $r=1; $r<=10; ++$r )
{
for( $c=1; $c<=6; ++$c )
{
$obj = "r"+$r+"_c"+$c;
select -r $obj+"_" ;

$layer = 'createRenderLayer -name $obj';

layerEditorAddObjects $layer;

}
};

what do I need to do to make it work correctly?

Also, it would be ideal if I could just use this script to duplicate the objects to create the rows and columns as well.

whisperwing
02-02-2011, 02:22 AM
try

for( $r=1; $r<=10; ++$r )
{
for( $c=1; $c<=6; ++$c )
{
$obj = "r"+$r+"_c"+$c;
select -r ($obj+"_");

$layer = `createRenderLayer -name $obj`; // ` not '
layerEditorAddObjects $layer;
}
};

CGTalk Moderation
02-02-2011, 02:22 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.