Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® Maya® / MEL / Splitting Scripts?
  RSS 2.0 ATOM  

Splitting Scripts?
Rate this thread
 
49803
 
Permlink of this thread  
avatar
  • OJ_Rocks
  • Posted: 24 November 2010 01:39 AM
  • Total Posts: 15
  • Joined: 20 November 2010 06:49 AM

Suppose I have a very long script like 2000 lines or so now I want to split the script into 2 files.

1st File will hold all the UI.
2nd File will hold all the commands/procedures.

Now when I execute the command for the UI(Frm 1st File) I want to assign a procedure (frm 2nd File) to a button. Is it possible ?



Replies: 0
avatar
  • THNKR
  • Posted: 24 November 2010 04:48 AM

Yes. You just need to make sure that the proc that you’re going to call is a global proc.



Replies: 0
avatar
  • OJ_Rocks
  • Posted: 24 November 2010 07:58 PM

THNKR 24 November 2010 12:48 PM

Yes. You just need to make sure that the proc that you’re going to call is a global proc.

Thanks, I am learning MEL so getting a bit confused can you plz show me a simple example ?



Replies: 1
/userdata/avatar/avatar_3427.jpg

inside the file uiControls.mel:

source functions.mel;
global proc uiControls(){

//do stuff, call some functions
function1();
function2();
function3();
}

inside the file functions.mel:

global proc function1(){
}

global proc function2(){
}

global proc function3(){
}

For more examples, look in the Maya 2011 docs
http://download.autodesk.com/us/maya/2011help/index.html

Especially the section on MEL procedures.
http://download.autodesk.com/us/...htm,topicNumber=d0e167993

Author: tkaap

Replied: 06 December 2010 06:31 AM