Maya Training

Introduction to Hard Surface Modeling

Maya Training

Interiors and Furniture Vol 1 & 2 - Modeling & Cloth

Maya Training

Shading, Lighting and Rendering the Bedroom in MR

Maya Training

Robot volume one - Modeling with animation in mind

Maya Training

Spach-Alspaugh House the complete courseware

Maya Training

Burt The Cartoon Dinosaur Vol 01 - Modeling

New Maya Training

Robot Volume 02 - Hybrid Rigging
You are here > Home > SimplyMaya Community Forums
Loading

Welcome to Simply Maya

Please Sign in or Sign up for an account

Member Login

Lost your password?

Not a member yet? Sign Up!

Old 28-02-2005, 01:30 AM   #1
Protheus
Registered User
 
Protheus's Avatar
 
Join Date: Sep 2002
Location: Beyond Oblivion
Posts: 471
Thanks: 0
Thanked 5 Times in 5 Posts
Default Running a MEL script

Oke I am all new to this MEL scripting.

I have the following issue - I created the following script as a test run:

window -rtf true -title "Test" Testwindow;
showWindow Testwindow;

the scripped is called: test.mel

I have placed it in the: C:\Documents and Settings\username\My Documents\maya\6.0\scripts

and then I start Maya.
But when I type: test; in the command line I get the message:

Mel Stack Trace
Cannot find procedure "test".
Start of trace: (command window: line 1).
test (command window: line 1).

Oke I looked up in the forums and you should be able to call up the script by typing its windows name and press enter ??

So what am I doing wrong ?
__________________
The Important Thing is NOT to Stop Questioning.
--- Albert Einstein ---
www.ProtheusWorld.tk
Protheus is offline   Reply With Quote
Old 11-03-2005, 06:55 AM   #2
lori_hunter
Registered User
 
Join Date: Dec 2004
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i think you need to load the script in the script editor first before you can execute it.

another thing is once it is executed Maya retains it in local memory. I had a problem where i had to quit Maya and reopen the scene file to refresh it if i made any changes, otherwise Maya will keep sourcing the first executed script.

hope that helps...

Lori
lori_hunter is offline   Reply With Quote
Old 11-03-2005, 02:50 PM   #3
Alan
Moderator
 
Alan's Avatar
 
Join Date: Oct 2002
Location: London, UK
Posts: 2,800
Thanks: 0
Thanked 5 Times in 5 Posts
Default

if you have a procedure in a file e.g.

global proc alanTest()
{
print("blah\n");
}

you run it with by typing alanTest. However as lori_hunter said you have to source it first. So if I wanted it to pick up my changes each time I ran it I would do this:

source "path to my script";
alanTest;

And then run them togther each time to make sure it's sourced each time. Also the thing lori_hunter said about local memory is true if you declare a variable in the script editor it will stay persistent until you close maya. A good way around this is to encapsulate it in {} brackets. That way it's declared in "scope" and wont affect the global session. Good for testing out stuff.


Alan
__________________
Technical Director - Framestore

Currently working on: Your Highness

IMDB
Alan is offline   Reply With Quote
Old 11-03-2005, 03:00 PM   #4
Protheus
Registered User
 
Protheus's Avatar
 
Join Date: Sep 2002
Location: Beyond Oblivion
Posts: 471
Thanks: 0
Thanked 5 Times in 5 Posts
Default

thanx all - I never knew that MEL scripting could be so easy. :-)
__________________
The Important Thing is NOT to Stop Questioning.
--- Albert Einstein ---
www.ProtheusWorld.tk
Protheus is offline   Reply With Quote
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
MEL headache! happymat27 Members Lounge 5 05-12-2010 09:43 AM
MEL headache!! happymat27 Mel Scripts & Programming 1 03-12-2010 04:41 PM

Thread Tools





A little bit about who we are
Links you might find useful
Catch up with SimplyMaya
SimplyMaya specialises in Maya tutorials. We offer over 1,000 individual Maya training videos, ranging from basic Maya tutorials through to intermediate Maya tutorials. Our tutorials are created by instructors with industry experience and are designed to get you up and running in Maya quickly without making it seem like hard work.

Copyright © 1999-2015 SimplyMaya - vBulletin® Copyright © 2000-2015, Jelsoft Enterprises Ltd.