PDA

View Full Version : what am i doing wrong here


DEVILSAN
02-28-2009, 11:01 PM
int $k = 0;
//Start from 0 to total obj in list
while( $k < size($objSel) ) {
//Set inSingle of inShape based on counter
setAttr ($sssName+".i[$k].it `rand 1`");
print "\n";
print $objSel[$k];
print "\n";
//`rand 1` above generates a random number on the fly
$k++;
//Better increment the counter or you'll be stuck in a loop
}

is giving error // Error: Invalid attribute index: gfnsss.i[$k].it `rand 1` // why ?

greatPumpkin
02-28-2009, 11:28 PM
you;re not encapsulating the setAttr properly, though there may be other issues, it's a pretty unusual attribute index you have.. what attribute is it?

setAttr ($sssName + ".i[" + $k + "].it") `rand 1`;

zhenpanda
03-01-2009, 03:29 AM
You are using maya that's what's wrong...
just kidding...i'm just being stupid

int $k = 0;
//Start from 0 to total obj in list
while( $k < size($objSel) ) {
//Set inSingle of inShape based on counter
setAttr ($sssName+".i[$k].it `rand 1`");
print "\n";
print $objSel[$k];
print "\n";
//`rand 1` above generates a random number on the fly
$k++;
//Better increment the counter or you'll be stuck in a loop
}

is giving error // Error: Invalid attribute index: gfnsss.i[$k].it `rand 1` // why ?

CGTalk Moderation
03-01-2009, 03:29 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.