PyMEL 1.0.2

Python in Maya Done Right

  Add it to your Download Basket!

 Add it to your Watch List!


Rate it!

What's new in PyMEL 1.0.2:

  • Changes:
  • rolled back ``listConnections()`` change from 1.0.1
Read full changelog
send us
an update
BSD License 
Chad Dombrova
ROOT \ Multimedia \ Graphics
The PyMEL project makes Python scripting with Maya work the way it should. Maya's command module is a direct translation of mel commands into python commands. The result is a very awkward and unpythonic syntax which does not take advantage of python's strengths -- particulary, a flexible, object-oriented design. PyMEL builds on the cmds module by organizing many of its commands into a class hierarchy, and by customizing them to operate in a more succinct and intuitive way.

For those who are already masters of python and who naturally expect more out of a python package, PyMEL is for you, too. It was written in for use in production by experiened programmers with a vision for how to add object-oriented design to Maya.

Powerful Classes

Node classes for every node type

camTrans, cam = camera() # create a new camera
fov = cam.getHorizontalFieldOfView()
cam.dolly( -3 )

An Attribute class organizes all the attribute commands in one place

s = polySphere()[0]
if s.visibility.isKeyable() and not s.visibility.isLocked():
 s.visibility.set( True )
 print s.visibility.type()

Manipulate file paths with ease

#backup all mb files in the current scene's directory
basedir = sceneName().parent
backupDir = basedir / "backup" #slash op joins paths
if not backupDir.exists:
for file in basedir.files( '*.mb' ):
 print "backing up: ",
 file.copy( backupDir / (file.namebase + ".old") )

Work with shape components, perform vector math, and easily set object attributes with the results

#select all faces that point up in world space
s = polySphere()[0]
for face in s.faces:
 if face.getNormal('world').y > 0.0:
 select( face, add=1)

Manage optionVars as a python dictionary

if 'numbers' not in optionVar:
 optionVar['numbers'] = [1,24,47]
numArray = optionVar.pop('numbers')

PyMEL provides customized operators for succinct scripting:

cam = camera()[0]
sphere = polySphere()[0]
sphere | cam # parent the camera to the sphere

cam.tx >> cam.ty # connect operator
cam.tx // cam.ty # disconnect operator

Includes Tools to Ease Your Transition to Python

 * mel-to-python translator for converting mel script into python scripts
 * python-to-mel plugin factory for turning python classes into mel commands
 * ipymel customized python interpreter

Pymel is a cross-platform tool available for Linux, Windows and Mac OS X.

Last updated on April 19th, 2010


#Python scripting #Maya scripting #Maya #Python #scripting #library

Add your review!