Maya’s programming languages

Categories: Maya, PyMEL, Python
Tags: No Tags
Comments: 2 Comments
Published on: September 27, 2011

It seems like there are more and more posts, queries, and threads about Maya’s different scripting languages. I figure it’ll be nice to have a nice listing of the languages, their benefits and uses.

Here is a quick breakdown:

MEL:

  • Entire application is basically written in MEL
  • Super simple, easy to learn
  • Very limited in data-structures and code complexity
  • Most training material available
  • King of the 3D scripting languages, really

maya.cmds:

  • Python syntax of entire MEL command base
  • Still command-based as opposed to OOP-based
  • Can import any python module
  • Has access to most of Maya API as python syntax
  • Simplest, safest, most robust option for Maya

PyMEL:

  • ‘Pythonic’ wrapper for all of maya.cmds and MEL
  • True OOP
  • Code scales well
  • Tons of utility functions
  • The sweet spot, for sure

MRV:

  • ‘Pythonic’ wrapper for C++ API
  • True API formatted syntax
  • For programmers who’d like to prototype faster

API:

  • C++ language for much of Maya
  • Create custom locators, deformers, nodes, etc.
  • Not intended for scripting procedures
  • The serious-end of things

There are performance issues with each language but in my experience, speed is not an issue in all but a few cases (iterating through lots of verts or polys, etc.)

The great thing is that you can actually use all of these languages together, at the same time, in the same script if you want to.  A python script can import maya.cmds and PyMEL (though they stomp on each other a bit, so you’d have to import into seperate namespaces if you really wanted to use both), PyMEL has a mel call for special mel cases, both have access to most of the API via python; and you can import MRV too, if needed.

For noobs, I’d hop straight into maya.cmds and then expand your knowledge out to the other options as needed.

Ping me for glaring omissions, thanks.

Post to Twitter

2 Comments
  1. siddhi says:

    nyc… pls provide more reference on it… !

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Welcome , today is Friday, November 28, 2014