Example Plug-ins

This section describes the functionality of the example plug-ins distributed with Maya.

A large number of example plug-ins is supplied with the Maya Developer Kit. The Developer Kit is available online at Autodesk Exchange at https://apps.exchange.autodesk.com/MAYA/en/Home/Index.

For information on how to set up your build environment to build the examples, see Setting up your build environment.

Examples can be divided into 4 categories:

In general, the following naming convention is used by the examples so you can identify the kind of plug-in the example based on its file name.

Suffix Description

Cmd

Plug-ins that create new commands.

Tool

Plug-ins that create new interactive tools.

Node

Plug-ins that create new node types.

Translator

Plug-ins that create new file translators.

Shader

Plug-ins that create new shading nodes.

Manip

Plug-ins that create new manipulators.

Field

Plug-ins that create new dynamic fields.

Emitter

Plug-ins that create new dynamic emitters.

Spring

Plug-ins that create new dynamic springs.

Shape

Plug-ins that create new shapes.

Shader

Plug-ins that create shader nodes.

Scripted plug-ins

Scripted plug-ins in the Maya Developer Kit demonstrate the use of the proxy classes of the Maya Python API 1.0 and 2.0. Python API 2.0 example plug-ins begin with py, so for example the 2.0 version of the helloWorldCmd.py plug-in is called pyHelloWorldCmd.py. Not all API 1.0 plug-ins have 2.0 versions, and vice versa.

Shader source code examples

Shader source code examples, such as brickShader, checkerShader, gammaShader, and so forth, are available in the devkit\plug-ins. The examples cover both hardware shaders, which are used when rendering in Maya's scene view, and software shading nodes, which are used when rendering using Maya's Software renderer.

Software shading nodes are, in general, not compatible with third-party renderers. These renderers may pick up, from the shading nodes, specific output values which are constant throughout a frame, but for values which change on a per-object, per-vertex or per-sample basis, they require shaders written in their own APIs.

Standalone applications

Standalone applications are those that contain the main routine for the application and make API calls to access Maya in batch mode. They are compiled in a slightly different manner than plug-ins (as covered in Using a debugger to debug your plug-ins), but utilize the same API as plug-ins, and in the same way.

NOTE:(Linux) It is important to note that in order to run one of these applications it is necessary to set the environment variables MAYA_LOCATION and LD_LIBRARY_PATH. The former should be set to /usr/autodesk/maya (or the alternative location into which Maya was installed), and the later should be set to "$MAYA_LOCATION/lib".

If these variables are not set, you will get errors when you attempt to start a stand-alone application.