PDA

View Full Version : what`s wrong?


senny2002
03-03-2008, 02:49 PM
i am writing a mel to automatic add rgbPP with expression.but my mel is blocking.

//=====create a new scene before test======
emitter;
particle;
connectDynamic -em emitter1 particle1;
PickWalkDown;
string $selecteParShape[] = `ls -sl -type particle`;
addAttr -longName "rgbPP" -dataType vectorArray $selecteParShape[0];
string $oldCreationExp = `dynExpression -q -creation -string ($selecteParShape[0]+".rgbPP")`;
string $newCreationExp = "rgbPP = <<1,1,1>>;"
string $combCreationExp = ($oldCreationExp+$newCreationExp);
dynExpression -creation -string $combCreationExp $selecteParShape[0];

// Error: string $combCreationExp = ($oldCreationExp+$newCreationExp); //
// Error: Line 10.6: Syntax error //


when i run it line by line,the mel is doable and no error message append.


emitter;
// Result: emitter1 //

particle;
// Result: particle1 particleShape1 //

connectDynamic -em emitter1 particle1;
// Result: particleShape1 //

pickWalkDown;
// Result: particleShape1 //

string $selecteParShape[] = `ls -sl -type particle`;
// Result: particleShape1 //

addAttr -longName "rgbPP" -dataType vectorArray $selecteParShape[0];

string $oldCreationExp = `dynExpression -q -creation -string ($selecteParShape[0]+".rgbPP")`;
// Result: //

string $newCreationExp = "rgbPP = <<1,1,1>>;";
// Result: rgbPP = <<1,1,1>>; //

string $combCreationExp = ($oldCreationExp+$newCreationExp);
// Result: rgbPP = <<1,1,1>>; //

dynExpression -creation -string $combCreationExp $selecteParShape[0];
// Result: particleShape1 //


please tell me how to fix this "Syntax error" ,thanks

Gravedigger
03-03-2008, 03:09 PM
hey senny!


string $newCreationExp = "rgbPP = <<1,1,1>>;"
string $combCreationExp = ($oldCreationExp+$newCreationExp);


Theres a semikolon missing for the $newCreationExp declaration:


string $newCreationExp = "rgbPP = <<1,1,1>>;";
string $combCreationExp = ($oldCreationExp+$newCreationExp);


Well i think this is causing the error. i haven't look over it completely so if there's still an error occuring please tell me.

Hope this helps!
Grs Grave

senny2002
03-03-2008, 03:43 PM
yes,it work.i am blind

CGTalk Moderation
03-03-2008, 03:43 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.