Standalone Maya Python InterpreterΒΆ

Maya’s standalone interpreter can be useful for both development and batch processing, as an alternative to maya -batch. To use maya functions in an external python interpreter, maya provides a handy executable called mayapy. You can find it in the maya bin directory. PyMEL ensures that using python outside of Maya is as close as possible to python inside Maya. When PyMEL detects that it is being imported in a standalone interpreter it performs these operations:

  1. initializes maya.standalone
  2. sources Autodesk’s initialization MEL scripts
  3. sources user preferences
  4. sources userSetup.mel

Because of these improvements, working in this standalone environment is nearly identical to working in interactive mode, except of course you can’t create windows. However, there is one caveat that you must be aware of: scriptJobs do not work: use callbacks derived from api.MMessage instead.

In order to use mayapy you must first properly setup your system environment.

Previous topic

Building User Interfaces

Next topic

Advanced Topics

Core

Core Modules

Other Modules

This Page