PyMEL

Python in Maya Done Right
Download

PyMEL Ranking & Summary

Advertisement

  • Rating:
  • License:
  • BSD License
  • Price:
  • FREE
  • Publisher Name:
  • Chad Dombrova
  • Publisher web site:
  • http://code.google.com/u/chadrik/

PyMEL Tags


PyMEL Description

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 ClassesNode classes for every node typecamTrans, cam = camera() # create a new cameracam.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 places = polySphere()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 directorybasedir = sceneName().parentbackupDir = basedir / "backup" #slash op joins pathsif 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 spaces = polySphere()for face in s.faces: if face.getNormal('world').y > 0.0: select( face, add=1)Manage optionVars as a python dictionaryif 'numbers' not in optionVar: optionVar = optionVar.append(9)numArray = optionVar.pop('numbers')PyMEL provides customized operators for succinct scripting:cam = camera()sphere = polySphere()sphere | cam # parent the camera to the spherecam.tx >> cam.ty # connect operatorcam.tx // cam.ty # disconnect operatorIncludes 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 interpreterNOTE: Pymel is a cross-platform tool available for Linux, Windows and Mac OS X. Requirements: · Python What's New in This Release: Changes: · rolled back ``listConnections()`` change from 1.0.1 · commands wrapped to return PyNodes · - ``container()`` Additions: · added functions for converting strings to PyQt objects: ``toQtObject()``, ``toQtLayout()``, ``toQtControl()``, ``toQtMenuItem()``, ``toQtWindow()`` · added method for converting PyMEL UI objects to PyQt objects: ``UI.asQtObject()`` Bugfixes: · fixed a bug where ``nt.Conditions()`` created a script condition


PyMEL Related Software