PDA

View Full Version : Why doesn't this MEL-script work?


megazor
11-15-2010, 08:48 AM
//checks for our Window and Deletes it

if ('window -exists Node_Generate') {
delete -window Node_generate;
}

// Window for our Node Generator

string $Node_Generator = 'window
-title ”NodeGenerator”
-wh 128 256
Node_Generate';
//Define our Row and Column Layout

rowColumnLayout -numberOfColumns 2 – cw 2 50;

// Column1: buttons Column 2: button descriptions

separator; separator;

button -label ”arcLen Maker” -c ”CurveInfo ()”; text – label ”CurveInfo”;

separator; separator;

button -label ”Multi Div” -c ”multiDiv ()”; text – label ”Mult Div Maker”;

//shows our window
showWindow $Node_Generator




---------------------
I tried writing exactly as the Tutor of Digital Tutor's "Cartoon Character Rigging in Maya", but for me it doesn't work.

Can someone see what the error might be with this script?

This is the response the Script Editor gives me:

// Error: if ('window -exists Node_Generate') {
//
// Error: Syntax error //
// Error: }
//
// Error: Syntax error //

TeaLeaf
11-15-2010, 08:58 AM
replace ' with `

Kobes
11-15-2010, 09:52 AM
How about this,
You had a couple of spaces inbetween flags and missing terminator, etc. Just needed to retype a few things and it seems to work fine.

//checks for our Window and Deletes it if (`window -ex Node_Generate`)
deleteUI Node_Generate;
// Window for our Node Generator
string $Node_Generator = ` window
-title "Node Generator"
-wh 128 256
Node_Generate`;
//Define our Row and Column Layout
rowColumnLayout -numberOfColumns 2;
// Column1: buttons Column 2: button descriptions
separator; separator;
button -label "arcLen Maker" -c "shadingNode -asUtility curveInfo"; text -label "CurveInfo Maker";
separator; separator;
button -label "Multi Div" -c "shadingNode -asUtility multiplyDivide"; text -label "MultiDiv Maker";
//shows our window
showWindow $Node_Generator;

megazor
11-15-2010, 10:32 AM
Ah!

It seems to work after deleting:

//checks for our Window and Deletes it

if ('window -exists Node_Generate') {
delete -window Node_generate;
}


This is great!
What exactly did you change from my script? It would be nice to learn from my mistake so that I can make it work when trying to recreate it next time :)


Thanks alot!

megazor
11-16-2010, 09:11 AM
Ah! I didn't see TeaLeaf's response!

Perhaps that's the main problem. :)

CGTalk Moderation
11-16-2010, 09:11 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.