O'Reilly logo

Practical Maya Programming with Python by Robert Galanakis

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Learning the Maya Python API by example

Something like the Maya API is best explained through demonstration. Once you get the hang of it, the Maya API Reference and its copious examples will be a wonderful source of information. However, it will take some time and effort to become proficient. This section will present several easy-to-tackle problems to help illustrate the Maya Python API.

Converting a name to an MObject node

It's important to remember that when we step into the world of OpenMaya, we leave the Pythonic simplicity of PyMEL behind. The following line of code converts a node name string into a PyMEL PyNode:

>>> pmc.PyNode('mynode')
nt.Transform(u'mynode')

In the wonderful world of the Maya Python API, though, there is much more code involved ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required