10 February 2011

Why using MEL & expressions?

In this blog, you will explore mel scripting and expressions for maya work. It will be focused on maya's particle system using mel script and expression. Also I will analyze number of MEL scripts already exist to get ideas of how it works.

So, what is MEL and expressions?

MEL stands for Maya Embedded Language. MEL is a scripting language which can embody "open architecture" of maya. By using MEL, user can control maya functions directly/indirectly. Even maya's GUI (graphic user interface) can be controlled by MEL. Therefore user can add new functions that maya doesn't have OR  customize GUI as their needs.

Expression controls attribute of object. User can control an animation which cannot be key framed (e,g. particle). Using expression is similar to script MEL.


There are differences between MEL and expression.

MEL is more likely completely independent programme. Expression is a correlation with objects.
MEL needs complete structure of grammar. Expression needs only the least rules.
MEL is executed no matter animation is played or not. Expression is executed only while animation playing.
MEL is saved separately with the scene. Expression is saved as a part of the scene.
MEL access to the attribute indirectly. Expression access to the attribute directly.

What you can do by using MEL and Expression.

MEL : control an attribute of object accurately, create new macro, create new user interface, customize maya GUI.

Expression : control attributes of object apart from key framing by numerical expression, control attributes by conditions, It can use MEL command in expression. However, it can't control the attribute that controlled by existing key, set driven key,  constraint, motion path or other expression. It can occur an error if you run MEL commands such as connection/disconnection of attribute or creation/deletion of object within the expression.


Grammar of MEL is very similar to other programming languages like C, C++. Not only the MEL, most script based languages are descended from C. It is not essential to learn programming language for MEL. Although if you have experience with scripting language, it will be easier to understand the structure.















Reference
  • Kian Bee Ng., 1999. Digital Effects Animation Using Maya. Rockland: Jenifer L.Niles
  • Jo Sang Bum., 2002. programming with MAYA MEL & Expression. Seoul: Ahn Dae Sik
  • Mark R.Wilkins and Chris Kazmier., 2003. MEL Scripting for Maya Animators. SanFrancisco: Diane D. Cerra
  • Autodesk Maya 2011, 2010. Autodesk Maya Online Help : Introduction. [online] Available at : < file:///Applications/Autodesk/maya2011/docs/Maya2011/en_US/index.html?url=./files/GS_Introduction.htm,topicNumber=d0e1838 > [Accessed 25 February 2011].
  • Marc-André Guindon., 2005. Learning Maya 7 : The Special Effects Handbook. Unknown: Sybex
  • Jeon Gye do, 2000. MEL 4 Artists. [online] Available at: <http://gyedo.pe.kr/zbxe/mayaExpression> [Accessed 25 February 2011]

No comments:

Post a Comment