PDA

View Full Version : unterminated string


BadG3r
07-09-2007, 12:16 PM
Hey! Right now Im working my way through "MEL scripting for animators". But I've got to a point I don't know what to do.

I wiped out every error the script editor gave me, but now he tells me this:

// Error: "(" + $curveSelected + "particlesShape.scaleOffset * $normvec * //
// Error: Unterminated string. //


the piece of code it is mentioning is this (its down in the last column):

string $exprString = "float $curve_param = "+ $curveSelected + "particlesShape.age *"
+ $curveSelected + "particlesShape.speed;\n" +

"setAttr " +$mainCurveInfoNode +".parameter $curve_param;\n" +
"setAttr " +$guideCurveInfoNode+".parameter $curve_param;\n" +

"float $pos[] = `getAttr " +$mainCurveInfoNode + ".position`;\n" +
"float $tan[] = `getAttr " +$mainCurveInfoNode + ".normalizedTangent`;\n" +
"float $normEnd[] = `getAttr " +$guideCurveInfoNode + ".position`;\n" +

"float $norm[];\n"+
"$norm[0] = $normEnd[0] - $pos[0];\n" +
"$norm[1] = $normEnd[1] - $pos[1];\n" +
"$norm[2] = $normEnd[2] - $pos[2];\n" +

"vector $posvec = <<$pos[0], $pos[1], $pos[2]>>;\n" +
"vector $tanvec = <<$tan[0], $tan[1], $tan[2]>>;\n" +
"vector $normvec = unit(<<$norm[0], $norm[1], $norm[2]>>);\n" +
"vector $norm2vec = cross($tanvec, $normvec);\n" +

$curveSelected + "particlesShape.position = $posvec + \n" +
"(" + $curveSelected + "particlesShape.scaleOffset * $normvec *
cos (" +$curveSelected + "particlesShape.age*20))+\n" +

"(" + $curveSelected + "particlesShape.scaleOffset * $norm2vec *
sin (" +$curveSelected + "particlesShape.age*20))+\n";

any guess anybody????

thx in advance,
badger

rtngkllr
07-09-2007, 09:50 PM
Maya is yelling at you for setting a string between two lines.

The fixed code is below. Try these examples:

string $error = "hell
o"; //error!!


string $fixed = "hell\
o"; //fixed the unterminated string



$curveSelected + "particlesShape.position = $posvec + \n" +
"(" + $curveSelected + "particlesShape.scaleOffset * $normvec *\
cos (" +$curveSelected + "particlesShape.age*20))+\n" +

"(" + $curveSelected + "particlesShape.scaleOffset * $norm2vec *\
sin (" +$curveSelected + "particlesShape.age*20))+\n";

BadG3r
07-13-2007, 06:29 AM
thx

good to know for the future.

badger

CGTalk Moderation
07-13-2007, 06: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.