2. Installing the package

The Maya Python package consists of two parts, a Maya plugin and a Python package. These two parts have to be installed separately. The following assumes that the plugin and the package is already compiled, if you need to compile them yourself then please refer to the files readme.txt and the developer's manual that you can generate using doxygen in the maya_wrapper directory.

Installing the plugin:

To install the Maya plugin do the following steps:

  1. Copy the plugin file (sourcepy_*.mll on Windows, sourcepy.so on Linux) into one of the Maya plugin directories (e.g. maya/version/plug-ins).
  2. (The following step can be skipped if you are using Windows) Create an empty file sourcepy.sog (it must be the same base name than the actual plug-in) and put it into the same directory than the actual plugin. Without doing this the plugin will run and you can execute Python code, but you won't be able to import any Python extension module.
  3. Run Maya, invoke the plugin manager and check the "auto load" checkbox on the Python plugin.

Installing the Python package:

The Python package maya uses the Python distutils for distribution and can be installed like any other Python module (on Windows just execute the installer, otherwise invoke python setup.py install).

Initializing the package:

By default, the additional menu items related to this package are not available. To add them to Maya during a session you have to invoke a package initialization by executing the following MEL command (the Python plugin must already be loaded):

py "import maya.initmaya";

This will add the following menu items:

Figure 2.1: The new menu item to open a Python Editor window

Figure 2.2: The new menu item to open the Python Plug-in Manager