Mac OS X environment
 
 
 

The Maya Development Kit is located in the /Applications/Autodesk/maya2011/devkit/ directory in a standard install of Maya.

Maya Plug-ins

Building with Makefiles

There are two ways of building plug-ins on Mac OS X. You can either use Xcode or the Makefile that we supply with the devkit.

The Maya Development Kit product contains a number of example plug-ins located in /Applications/Autodesk/maya2011/devkit/plug-ins.

Before you can use these plug-ins, you need to build them. You first have to create a working directory, recursively copy the directory and run make. (The Maya install directory is not writable on this platform.) For example,

setenv MAYA_LOCATION /Applications/Autodesk/maya2011/Maya.app/Contents
mkdir -p $HOME/devkit
cd $HOME/devkit
cp -r /Applications/Autodesk/maya2011/devkit/plug-ins .
cd plug-ins
make Clean
make

Also, to attach your plug-in development area to the rest of Maya, you need to set a number of variables. These are:

  • MAYA_LOCATION
  • MAYA_SCRIPT_PATH
  • MAYA_PLUG_IN_PATH
  • XBMLANGPATH

These variables can be defined in a file called Maya.env. Maya lets you define these variables in a file so that you can easily set up the same runtime environment on another system by simply copying the file. You can still use variables in the environment and they will either override the corresponding variable in the Maya.env file or be prepended to the variable for variables which represent search paths.

The environment variable, MAYA_APP_DIR, can be used to help find the Maya.env file. If this variable is not set, Maya looks in your $HOME/maya directory. In addition, if you have multiple versions of Maya installed on your system, you can put your Maya.env file in a subdirectory of either the directory pointed to by the MAYA_APP_DIR environment variable or $HOME/maya.

Name the subdirectory to be the version number of the Maya application that is executed. For example, if you set MAYA_APP_DIR to be /usr/mydir, you can create a version specific Maya.env file in the directory /usr/mydir/2011. that will be used when the 2011 version of Maya is run. If you do not set MAYA_APP_DIR, you can put your version 2011 tailored Maya.env file in $HOME/maya/2011.

The following assumes that Maya is installed in /Applications/Autodesk/maya2011/devkit/plug-ins and that you have set up your plug-in development area in $HOME/devkit/plug-ins. If your installation is different, you will have to modify the lines that set MAYA_LOCATION in the examples below.

Your Maya.env file should contain the following:

MAYA_SCRIPT_PATH = $HOME/devkit/plug-ins
MAYA_PLUG_IN_PATH = $HOME/devkit/plug-ins
XBMLANGPATH = $HOME/devkit/plug-ins/

Either set the following on the command line or add the equivalent for the shell environment you are using. The following can be used placed into your .tcshrc if this is your default shell.

# Location of installed maya
setenv MAYA_LOCATION /Applications/Autodesk/maya2011/Maya.app/Contents

If you now start Maya and open the Plug-in Manager window, you should see a list of all the pre-compiled plug-ins you copied to your

$HOME/devkit/plug-ins directory. 

Building with Xcode 2.4.1 project files

To build one of our example plug-ins using the supplied Xcode 2.4.1 project file, you must use the version of Mac OS X 10.4 that Maya runs with and have the Xcode application installed. Then, do the following:

  1. Browse to the /Applications/Autodesk/maya2011/devkit/plug-ins directory.
  2. Make a copy of this directory and make it current.
  3. Double-click on an Xcode project file such as circleNode.xcodeproj.
  4. Select the Build option from the Build menu.

Maya API applications

For building API applications, we only provide a Makefile solution. To build the supplied stand-alone application examples, you need to do the following:

setenv MAYA_LOCATION /Applications/Autodesk/maya2011/Maya.app/Contents
mkdir $HOME/devkit/applications
cd $HOME/devkit/applications
cp MAYA_LOCATION/Applications/Autodesk/maya2011/devkit/applications/* .
make Clean
make
NoteThe shell script mayald is used to link these applications to isolate you from the exact set of Maya shared libraries necessary for the link.

On Mac OS X, you must set the DYLD_LIBRARY_PATH environment variable before you try to execute one of these applications so the runtime linker can find the Maya shared libraries.

The recommended procedure for preparing to build and run stand-alone applications is to set the following environment variables:

setenv MAYA_LOCATION /Applications/Autodesk/maya2011/Maya.app/Contents
setenv DYLD_LIBRARY_PATH $MAYA_LOCATION/MacOS
setenv DYLD_FRAMEWORK_PATH $MAYA_LOCATION/Frameworks

Configuring Qt for use in Maya plug-ins

Maya uses Nokia's Qt toolkit, version 4.5, for its graphical user interface (GUI).

Qt is provided under both a commercial license and the open source Lesser GNU Public License (LGPL). If you have a commercial license, the package to use with Maya 2011 is: qt-mac-cocoa-commercial-4.5.3.dmg

If you are using the open source license, the package to use with Maya 2011 is: ftp://ftp.qt.nokia.com/qt/source/qt-mac-cocoa-opensource-4.5.3.dmg

Download and install the package. No further setup is required.

You can test out your Qt installation by building the Qt plug-ins in Maya's devkit, as follows.

If you are uncertain as to which licensing best applies to your intended usage of Qt, please refer to the QT licensing page.

Building the devkit Qt plug-ins

  1. Copy the contents of Maya's devkit plug-ins directory into a directory in which you have write permissions, for example, from a Terminal window:

    cp -r /Applications/Autodesk/maya2011/devkit/plug-ins ~/2011-plugins

    If your copy of Maya is not installed in the default location, then you must adjust the above path accordingly.

  2. In a Terminal window, change to the directory where you have copied the plug-ins as follows:

    cd ~/2011-plugins

  3. If your copy of Maya is not installed in the default location, edit the buildconfig file in a text editor and locate the following line near the top of the file:

    # MAYA_LOCATION = /my/path/to/Maya.app/Contents

    Remove the # at the start and change the path to point to the Maya.app/Contents directory of wherever you have Maya installed, for example:

    MAYA_LOCATION = /Volumes/Shared/maya2011/Maya.app/Contents

    Save the file and exit the editor.

  4. Execute the following command:

    make -f Makefile.qt

    The .bundle files for the plug-ins will end up in your current directory.

Cleaning up after a build

To clean up after a build, use the following command:

make -f Makefile.qt clean