PDA

View Full Version : syntax


fbitonti
02-06-2006, 10:26 PM
hey i'm getting a syntax error on this and I don't know why?

any one know whats up i'm sure it's simple I just don't have the syntax down thta well yet.

The error is showing up around the setattr line.

for ($i = 0; $i < 1; $i++) {

float $pos[];
$pos = `getParticleAttr -at worldPosition ("particle1.pt[" + $i + "]")`;

$x = $pos[0];
$y = $pos[1];
$z = $pos[2];
$p = $i+2;


setAttr "curveShape1.controlPoints[" + $i +"].xValue" $x;
setAttr "curveShape1.controlPoints[" + $i +"].yValue" $y;
setAttr "curveShape1.controlPoints[" + $i +"].zValue" $z;

print ($x);
print ("\n");
print ($y);
print ("\n");
print ($z);
print ("\n");
print ("\n");
print ("\n");
}

euph0rian
02-07-2006, 02:04 AM
You need parentheses around the pieces of your string:

setAttr ("curveShape1.controlPoints[" + $i + "].xValue") $x;
setAttr ("curveShape1.controlPoints[" + $i + "].yValue") $y;
setAttr ("curveShape1.controlPoints[" + $i + "].zValue") $z;

fbitonti
02-07-2006, 06:05 PM
thanks for the help!

CGTalk Moderation
02-07-2006, 06:05 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.