Maya for 3D Printing - Rapid Prototyping
In this course we're going to look at something a little different, creating technically accurate 3D printed parts.
# 1 12-04-2010 , 08:39 PM
Registered User
Join Date: Mar 2010
Posts: 9

Troubleshooting with mel Please help!

Perhaps the version of Maya which I am using is to old or new. This script is a copy and paste, so there are no typing errors.

I am doing the cartoon character rigging tutorial by digital tutorials.

At the very beginning ( part 3) they ask you to execute the following mel script:
(which then gives me a syntax error)

//checks for our Window and Deletes it

if (`window -exists Node_Generate`)
{
deleteUI -window Node_Generate;
}

// Window for our Node Generator

string $Node_Generator = `window
-title “Node Generator”
– wh 128 256
Node_Generate`;

//Define our row and column layouts

rowColumnLayout -numberOfColumns 2 -cw 2 50;

// Column 1: buttons, column 2: button descriptions

separator; separator;

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

separator; separator;

button -label “Mult Div” -c “multDiv()”; text -label “Mult Div Maker”;

//shows our window
showWindow $Node_Generator;

# 2 12-04-2010 , 09:20 PM
Registered User
Join Date: Mar 2010
Posts: 9
btw I am using autodesk maya 2008

# 3 12-04-2010 , 09:23 PM
NitroLiq's Avatar
Moderator
Join Date: Nov 2002
Location: New York
Posts: 2,133
What's the syntax error? Since you didn't use a code block when you pasted it above it shows single and double quotes as "smart" quotes....were they like that from the code you cut from?

For example, you pasted:

if (`window -exists Node_Generate`)

but the single quotes should be like this:

Code:
if ('window -exists Node_Generate')
Have you tried asking on DT's forums?


"Terminat Bora Diem, Terminal Auctor opus."
# 4 12-04-2010 , 09:28 PM
Registered User
Join Date: Mar 2010
Posts: 9
I don't have access to the forum unfortunatly

# 5 12-04-2010 , 09:35 PM
NitroLiq's Avatar
Moderator
Join Date: Nov 2002
Location: New York
Posts: 2,133
See if this works:

Code:
//checks for our Window and Deletes it
if ('window -exists Node_Generate')
{
deleteUI -window Node_Generate;
}

// Window for our Node Generator
string $Node_Generator = 'window
-title "Node Generator"
– wh 128 256
Node_Generate';

//Define our row and column layouts
rowColumnLayout -numberOfColumns 2 -cw 2 50;

// Column 1: buttons, column 2: button descriptions
separator; separator;

button -label "arcLen Maker" -c "CurveInfo()"; text -label "CurveInfo";

separator; separator;

button -label "Mult Div" -c "multDiv()"; text -label "Mult Div Maker";

//shows our window
showWindow $Node_Generator;


"Terminat Bora Diem, Terminal Auctor opus."
# 6 12-04-2010 , 09:40 PM
Registered User
Join Date: Mar 2010
Posts: 9
Thank you, but it still gave me a syntax error.

# 7 12-04-2010 , 09:46 PM
NitroLiq's Avatar
Moderator
Join Date: Nov 2002
Location: New York
Posts: 2,133
Try putting this into google:

"digital tutors cartoon character rigging mel script"

lots of results.


"Terminat Bora Diem, Terminal Auctor opus."
# 8 12-04-2010 , 09:58 PM
Registered User
Join Date: Mar 2010
Posts: 9
:attn: :attn:


Thank you soo much.

The link you gave me worked.

You've been an excellent help. I was about to tear my hair out.

Will you be friend?

:bow:

# 9 12-04-2010 , 10:07 PM
ctbram's Avatar
Moderator
Join Date: Jan 2004
Location: Michigan, USA
Posts: 2,998
Code looks fine but the double quotes are incorrect. When I copied and pasted your code it was throwing errors for all the lines that had double quoted items. I simply retyped those lines using the " instead of whatever you had and it worked fine.

I am not sure but the ` character you are using looks fine. It is the key to the left of the 1 key on a standard US keyboard. The ` character instructs the interpreter to execute the command contained between the ` characters.

If you look at what you have posted you have a different kind of " symbol at either end of the double quoted items. They have a tilt to them. I can't even find those quote symbols on my keyboard?

Here is what I typed in. You can see the difference in the double quotes " symbol. It's next the the ; key on my keyboard....

//checks for our Window and Deletes it

if (`window -exists Node_Generator`)
{
deleteUI -window Node_Generate;
}

// Window for our Node Generator

string $Node_Generator = `window
-title "Node Generator"
-wh 128 256
Node_Generator`;


//Define our row and column layouts

rowColumnLayout -numberOfColumns 2 -cw 2 50;

// Column 1: buttons, column 2: button descriptions

separator; separator;

button -label "Arclen maker" -c "CurveInfo()"; text -label "CurveInfo";

separator; separator;

button -label "Mult Div" -c "multDiv()"; text -label "Mult Div Maker";

//shows our window
showWindow $Node_Generator;


"If I have seen further it is by standing on the shoulders of giants." Sir Isaac Newton, 1675

Last edited by ctbram; 12-04-2010 at 10:11 PM.
# 10 12-04-2010 , 10:11 PM
NitroLiq's Avatar
Moderator
Join Date: Nov 2002
Location: New York
Posts: 2,133

Originally posted by kittykate
Thank you soo much. The link you gave me worked. You've been an excellent help. I was about to tear my hair out.

No problem but next time I suggest a little pro-active googling or searching DT's forums if working on one of their product tuts. Just like you wouldn't go to their forums and ask them for help on one of Simplymaya's tutorials. It's just bad form. That being said, there's a good community of helpful folks here so if you have any Maya questions have at it.

Btw, you said you didn't have access to DT's forums but the answers were all in their forums so how did that work out for ya? user added image

Originally posted by ctbram
I am not sure but the ` character you are using looks fine. It is the key to the left of the 1 key on a standard US keyboard. The ` character instructs the interpreter to execute the command contained between the ` characters.

My bad if I was wrong about that...I thought that was supposed to be a single prime/single quote/apostrophe. Didn't know the back quote/grave was actually used.

Originally posted by ctbram
If you look at what you have posted you have a different kind of " symbol at either end of the double quoted items. They have a tilt to them. I can't even find those quote symbols on my keyboard?

That's what threw me off. Those are smart quotes. Sometimes software automatically converts quotes into smart quotes...forums, CMS, etc. so I figured she cut it from something that made a mistake. Since I hadn't actually seen the video she's referencing I couldn't really tell if that was the intent or not. Smart quotes are the proper formatting for actual quotes...the way a keyboard typically types them is as prime and double prime marks which are what should be used for measurement (ala 6'5"), not for real quotes and apostrophes.


"Terminat Bora Diem, Terminal Auctor opus."
# 11 12-04-2010 , 10:27 PM
Registered User
Join Date: Mar 2010
Posts: 9
Hi... yes, I did initially take the code on this link

https://support.digitaltutors.com/ent...cript-lesson-3

That didn't work.

I read the forum, before starting this thread.... the one you sent me, but they weren't experiencing the same problem as me and I could not post a question.

I didn't think to copy paste their code until you sent it to me again

Eventually this was the one that worked

// Checks for our Window and Deletes it

if (`window -exists Node_Generator`) {
delete -window Node_Generator;
}

// Window for our Node Generator

string $Node_Generator = `window
-title "Node Generator"
-wh 128 256
Node_Generator`;
// Define our Row and Column Layout

rowColumnLayout -numberOfColumns 2 - cw 2 50;

// Column1: buttons Column2: button descriptions

separator; separator;

button -label "acrLen Maker" -c "CurveInfo()"; text -label "CurveInfo";

separator; separator;

button -label "Mult Div" -c "multDiv()"; text -label "Mult Div Maker";


// shows our window
showWindow $Node_Generator

# 12 12-04-2010 , 10:29 PM
Registered User
Join Date: Mar 2010
Posts: 9
I'm dyslexic , so I try avoid mel... but now I have to because of rigging.

Great! I just got to the next part... more mel and more syntax errors... yay!

# 13 12-04-2010 , 10:38 PM
NitroLiq's Avatar
Moderator
Join Date: Nov 2002
Location: New York
Posts: 2,133
Yeah, rigging is heavy on the mel/expressions so it's something you'll have to work through. Just take your time and try to write it—don't just cut and paste—you'll learn the syntax better. Also hit F1 for any syntax help. Just take your time and be patient with it.


"Terminat Bora Diem, Terminal Auctor opus."
# 14 12-04-2010 , 11:09 PM
Registered User
Join Date: Mar 2010
Posts: 9
Thank you!

I'm under a bit of time pressure with this project. Afterwards , I promise to do the artist's guide to mel. I've learnt my lesson... (I hope)

Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off

Similar Threads