PyMEL 1.0.2

Python in Maya Done Right
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
cam.setFocalLength(100)
fov = cam.getHorizontalFieldOfView()
cam.dolly( -3 )
cam.track(left=10)
cam.addBookmark('new')


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 )
 s.visibility.lock()
 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:
 backupDir.mkdir()
for file in basedir.files( '*.mb' ):
 print "backing up: ", file.name
 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]
optionVar['numbers'].append(9)
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

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

last updated on:
April 19th, 2010, 7:46 GMT
price:
FREE!
developed by:
Chad Dombrova
homepage:
code.google.com
license type:
BSD License 
category:
ROOT \ Multimedia \ Graphics

FREE!

In a hurry? Add it to your Download Basket!

user rating

UNRATED
0.0/5
 

0/5

What's New in This Release:
  • Changes:
  • rolled back ``listConnections()`` change from 1.0.1
read full changelog

Add your review!

SUBMIT