Distributing individual files
 
 
 

If your Maya add-on consists of a single file, such as a single plug-in, a single script file or a single icon, then it generally makes sense to simply distribute the file itself, possibly in compressed format, and have the end user copy it into the appropriate directory.

For example, if a user wishes to install a plug-in, written in either C++ or Python, they can do so simply by copying the plug-in file to one of the directories in their MAYA_PLUG_IN_PATH environment variable.

At sites where multiple users may need to use the same plug-in, it is often preferable to install it in a common directory to which all users have access, such as a directory on a network drive, rather than have each user install it separately. This makes it much easier for the site administrator to apply any new versions of the file which might later be released.

For a common directory to work for all users, it must appear in the MAYA_PLUG_IN_PATH for all users. By default, MAYA_PLUG_IN_PATH contains both user-specific and system-wide directories. The system-wide directories can be further subdivided into those whose paths are fixed and those whose paths are relative to the location where Maya is installed. For example, Maya 2010 on Linux has the following system-wide directories in its MAYA_PLUG_IN_PATH:

The first two paths are the same regardless of where Maya is installed, but the third path contains /usr/autodesk/maya/2010-x64 which is the top of the directory tree where Maya is installed. Had Maya been installed in /opt/maya2010 then the first two paths would still be the same as shown above but the third would become:

This suggests two approaches to making the plug-in available to all users:

  1. Install Maya into a common directory to which all users have access, such as a network drive, then install the plug-in into the MAYA_PLUG_IN_PATH directory which is relative to where Maya is installed (for example, the third path in the list given above).
  2. On each user's system, map one of the fixed system-wide paths from MAYA_PLUG_IN_PATH (for example, either of the first two paths in the list given above) to a common directory to which all users have access, such as a network drive, then install the plug-in to that directory.

For this approach, it does not matter whether Maya is installed in a common location or separately on each user's machine.

A third approach, which may prove simpler at many sites, is to ignore the default directories provided in MAYA_PLUG_IN_PATH and instead add the common directory to all user definitions of MAYA_PLUG_IN_PATH:

Install the plug-in into a common directory to which all users have access, then add that directory to the MAYA_PLUG_IN_PATH for all users. This can be done either by modifying each user's Maya.env file or by using system-specific tools to ensure that the MAYA_PLUG_IN_PATH for all users contain the common directory before Maya is run.

These same approaches will also work with MEL or Python script files, except that instead of using MAYA_PLUG_IN_PATH, scripts must be installed into a directory in the user's MAYA_SCRIPT_PATH environment variable. Similarly, icons must be installed into a directory in the user's XBMLANGPATH environment variable and presets must be installed into a directory in the user's MAYA_PRESET_PATH.