"Create2.mel" line 22.1: Syntax error....:(

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 09 September 2005   #1
Talking "Create2.mel" line 22.1: Syntax error....:(

Hi...its me still messing around with the main menu....
I had this in the main menu without the scripting.I had a simple menu item like first and had it attached to the main menu which is great...now when I put this script in my script folder and userset up as Create2; it first doesnt allow anything else to load and second gives me an error when i source it from inside maya....Somewhere at the end of the script there is a mistake and im thinking it has to do with me not knowing how to make the menu item select and complete the torus part of the script..

Can anyone spot whats going on?




global proc create2;()

{

source Create2;

global string $gMainWindow;

setParent $gMainWindow;

menu -l "Create2"

-p MayaWindow

-to 1

-aob true

create2Menu;

menuItem -l "Create2-Primative"

-ann "PolyTorus"

-echoCommand true

-c "polyTorus"

polyTorusItem;

}

global proc polyTorus;()

{

polyTorus -r 1 -sr 0.5 -tw 225 -sx 4 -sy 4 -ax 0 0 1 -tx 1 -ch 1;

rotate 0 0 45;

makeIdentity -apply true -t 1 -r 1 -s 1 -n 0;

}

__________________
 
Old 09 September 2005   #2
Thumbs up

The syntax for a global proc is:
global proc RETURN_TYPE NAME(ARGS)

In your script you have accidentally added a ";" between the proc name and the arguments.
global proc create2;() //error
global proc create2() //correct

You also try to source the procedure from within the procedure
global proc foo()
{
source foo; //error
}

If you want to source your script, do it before you call the script.
source foo; //read procedure foo into memory
foo; //execute the procedure foo

Paste this modified version into the script editor, it runs correctly:

global proc create2()
{
global string $gMainWindow;
setParent $gMainWindow;
menu -l "Create2"
-p MayaWindow
-to 1
-aob true
create2Menu;
menuItem -l "Create2-Primitive"
-ann "PolyTorus"
-echoCommand true
-c "polyTorus"
polyTorusItem;
}

global proc polyTorus()
{
polyTorus -r 1 -sr 0.5 -tw 225 -sx 4 -sy 4 -ax 0 0 1 -tx 1 -ch 1;
rotate 0 0 45;
makeIdentity -apply true -t 1 -r 1 -s 1 -n 0;
}
create2;

 
Old 09 September 2005   #3
Oh thanks....
__________________
 
Old 09 September 2005   #4
Thread automatically closed

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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 09:00 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.