MEL : What I can do with it ?


#1

Hello,

I’m a student in “programmation” and 3d interest me. My brother use MAYA and I discovered the MEL. I don’t know what it is possible to do whit it ?
With MEL is possible write script for what ? Modeling ? Animation ? Rendering ? etc.
Its powerfull ?
How to learn MEL ?
What you can tell me about it ?

Thanks !

PS : sorry for my poor English, I’ll make more efforts the next time


#2

with every button you press inside maya, a MEL script is executed. You can see the exact command in the script editor and copy paste it below and run it again.
this gives you the freedom to do whatever using programming, including everything you mentioned.

case 1: you can use a MEL script as a Batch command to do a specific sequence of commands to multiple objects. ( say you have 1000 objects and you want to add or edit an attribute to all of them. You can use a for loop for that. Or a common senario is to randomize something to many objects)

case 2: you can write your own tool with a proper UI so to extend the functionality of the program.

case 3: you can use scripts in the form of an expression, which run on every frame (or every time maya queries that value) so to make procedural animation.

MEL is really powerfull cause you can do stuff that the software itself doesnt offer, but is not the most efficient language as it is just a scripting one.


#3

MEL it’s the only language (script) for write plug for maya ?
Thanks


#4

It’s MEL and C++ what you’d usually use to write custom Maya extensions. From what I hear, functionality is equal except that you can’t write shaders in MEL (and if you could, you wouldn’t want to for performance reasons).


#5

How to write plug for MAYA with C++ … how to integrate the script in the software ?
With MEL, is possible to create new button etc. Well, is easy to execute a MEL script when you press a button.
But if i write a script in C++, can I create or podify the gui of MAYA to integrate and execute my plug ?

Thanks.


#6

MEL is the built-in scripting language for Maya. Take a look at the script editor (turn on ‘echo all commands’) and watch what is generated for each action you perform. It’s a good way to become acquainted with how Maya uses it.


#7

for most things you’ll want to use MEL, unless you need:

  1. speed [compiled plug-ins generally run much faster]
  2. custom nodes that interact with existing Maya nodes
  3. real-time updating when modifying items in your scene

you can also mix the two: MEL can call commands that have been added by an API plugin and plugins can call MEL commands


#8

MEL is very amazing…
I found a book call “MEL Scripting for Maya Animators”…
I reading it …it’s very fun for me, let me konw much things in Maya I don’t kown before…maybe you can read a book to understand what is
MEL…:slight_smile: .


#9

yeah i have this book. its pretty good.

sunshine: MEL is just a scripting language. u cannot write plugins (plugs) using MEL. everything that you do in maya is a result of some MEL command so u have practically everything on your disposal through MEL. primarily:

  • MEL is used for batch purposes (like somebody else mentioned), i.e. when u have to keep repeating a single (or a set of) command over and over e.g. if u want to create 1000 cones and then scale them randomly between 1 and 5, u can write a simple for loop running for 1000 times - every time creating a cone and then scaling it to a random value between 1 & 5.

MEL can be used for almost everything in Maya theoretically but practically it’s very uselss when you’re manipulating or traversing the inner structures of maya. e.g. if u wanna write a script that traverses all the UVs of all the faces of a complex model (for some reason like scattering on surface), u just cant use MEL cuz its too slow for obvious reasons. 10-15 times faster performance will be achieved if u write a simple plugin in C++ using Maya API to access the faces and UV sets of the model and then do the same.

Bottomline: use MEL for interfaces, repeating simple processes etc. etc. but when u want to create a Maya Node (Shaders, Fields etc.), always use Maya Plug-ins (plugs) using C++.

cheers


#10

Scripting languages, like MEL (or Python, in the particular package I use), are essential for handling workflow issues that crop up naturally in large projects. They enable you to automate processes that would otherwise require dull, error-prone, expensive human work. They also allow you to build labor-saving tools, be they simple or complex, which allow “the computer to be a computer.” Your obedient servant.

The advantage of these automation tools becomes much clearer when you start doing projects rather than simple scenes or single-animations. You have time-pressures, or lots of pieces lying around on the floor waiting to be stitched together, or the product of repetitive work that needs to look consistent. It’s just as simple as when Disney used a Xerox® photocopier to help with 101 Dalmations.


#11

Hi,

If you are interested in MEL and C++ plugins, a must-read book is David Gould’s.
I’s name is “[font=Verdana][size=2]Complete Maya Programming: An Extensive Guide to MEL and the C++ API”. It is the best I know for plugins developers (as I am) as it deals with C++ API and MEL.[/size][/font]
[font=Verdana][size=2]About MEL, there are things you can do only in MEL and others which can be done only in C++ (create a new DG node for example).[/size][/font]
[font=Verdana][size=2]And a lot of things are really easier to do in MEL than in C++ so there are often MEL in C++ code and vice versa…[/size][/font]
[font=Verdana][size=2]Regards,
[/size][/font]


#12

So, is there an analagous book to [font=Verdana][size=2]“Complete Maya Programming: An Extensive Guide to MEL and the C++ API” for Softimage?

Sorry if this is a misdirected question.

Thanks.
[/size][/font]


#13

Functionality isn’t qute equal. the API isn’t capable of generating UI Windows etc. You have to use MEL for that.

P.S. My wife became quite irate after constantly hearing me use the term “functionality”. Apparently it doesn’t exist outside of the computer universe. I said, there are things other than computers??


#14

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.