Maya API Scripting With Python

Getting up and running in Python with Maya has been a very fruitful journey so far. Having previously used MEL to build tools, it is fantastic to be able to use a truly object-oriented language to build tools and commands. MEL was originally used to control the command engine, and as such, the main Maya user interface was completely constructed using MEL commands. But the implementation of Python to be able to control the command engine allows Python to map to almost every MEL command, although there are a few exceptions. One of the big advantages I found was the use of inheritance in tool creation. Being able to inherit a template tool, and then to use that as a base for creating more complex tools would be fantastic for an art pipeline that wanted to keep consistency across its tool-set. And it negates the need for boiler-plate code.
ApplicationCore
As well as mapping to the command engine, the other big advantage with Python is control over the API. Having low-level control over Maya, allows us to be able to do some great heavy lifting tasks in Maya scenes, that would otherwise only be possible using C++ derived plug-in development. The OpenMaya module gives us access to the API functionality allowing us to get down and dirty with the software. This includes anything from creating our own custom commands through to creating custom nodes and gaining full control over Maya’s dependency graph.

Check out Maya’s API Command Reference

The fact that we can also use Python to create PyQT user interfaces means that we have a lot of options for building powerful tool-sets for Maya.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s