Overview of example plug-ins
 
 
 

There are a large number of example plug-ins supplied with the Maya Development Tool Kit. These are described in this chapter to help you find one that demonstrates the operation you are trying to accomplish. The following naming convention is used by the examples so you can tell what kind of plug-in the example is 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.

MEL command plug-ins

blindComplexDataCmd

Command which demonstrates adding more complex blind data, as a user defined data type, to an object. See blindComplexDataCmd.

blindDoubleDataCmd

Command which demonstrates adding blind data, as a user-defined data type, to an object. See blindDoubleDataCmd.

blindShortDataCmd

Command which demonstrates adding blind data to an object. See blindShortDataCmd.

closestPointCmd

command that shows how to use the MMeshIntersector class to find the closest point between a point light and a mesh

closestPointOnCurve

Command that sets the weights of the CVs of a cluster according to a mathematical function. See closestPointOnCurve.

convertBumpCmd

Command that demonstrates the steps necessary to create a non-linear animation clip using the API. See convertBumpCmd.

convertEdgesToContainedFacesCmd

Command that converts a selection of edges into a selection of faces that interconnect. See convertEdgesToContainedFacesCmd.

convertVerticesToContainedEdgesCmd

Command that converts a selection of vertices into a selection of edges that interconnect the original vertices. See convertVerticesToContainedEdgesCmd.

convertVerticesToContainedFacesCmd

Command that converts a selection of vertices into a selection of faces that interconnect the original vertices. See convertVerticesToContainedFacesCmd.

cvExpandCmd

Command that splits NURBS CV selections up into one string per selected CV. See cvExpandCmd.

cvPosCmd

Return the world or local space position of a NURBS CV or a poly vertex. See cvPosCmd.

dagPoseInfoCmd

Command that demonstrates how to extract DAG pose info for a skeleton’s bind pose, or for other poses created using the “dagPose” command. See dagPoseInfoCmd.

deletedMsgCmd

A new example that demonstrates each of the node deletion callbacks available.

deletedMsgCmd

command that demonstrates each of the node deletion callbacks that are available in the API. The command registers callbacks on selected nodes that will trigger messages in the console when the command is run

dynExprFieldTest

A new example that demonstrates the per particle field attributes support that has been added to the class MPxFieldNode.

exportJointClusterDataCmd

command that demonstrates how to find all joint cluster nodes and uses the MFnWeightGeometryFilter function set and MItGeometry iterator to export weights per CV for each geometry deformed by each joint cluster.

exportSkinClusterDataCmd

command that exports smooth skin data to an alternate format

findFileTexturesCmd

locate the file texture nodes in a scene

findTexturesPerPolygonCmd

locate the file texture nodes assigned to each polygon

flipUVCmd

demonstration the use of the MPxPolyTweakUVCommand class to manipulate UVs

helix2Cmd

command which implements undo and redo

helixTool

tool which uses OpenGL to draw out guidelines

helloCmd

trivial command that takes arguments

helloWorldCmd

first simple command

idleTest

display the attribute dependencies within a node

instanceCallbackCmd

A new example that demonstrates listening to instance add and remove messages.

instancerListCmd

demonstrates how to use the MFnInstancer and MItInstancer classes to enumerate all particle instances in a scene.

intersectCmd

an example that demonstrates how to find the intersection points between a mesh and a spotlight. This example demonstrates the accelerated intersection methods of MFnMesh

listLightLinksCmd

command to query light linking information

listPolyHolesCmd

command that produces a list of all the holes in each selected poly mesh

lockEvent

demonstrates the API callbacks for node and plug locking

marqueeTool

command which implements mouse selection

meshOpCmd

demonstrates the use of the high-level polygon API methods that have been added to MFnMesh

meshReorderCmd

command that will re-index a polygon mesh based on a user defined starting face

motionPathCmd

command to animate an object along a motion path

motionTraceCmd

command that evaluates the position of a keyframed object over time and draws a motion path curve

moveCurveCVsCmd

command that moves CVs to the origin

nodeInfoCmd

command which demonstrates walking the dependency graph

nodeMessageCmd

command that adds a callback for all the nodes on the active selection list

particlePathsCmd

command that uses particle ID information from the API to derive a set of NURBS curves from the position of particles over time

particleSystemInfoCmd

demonstrates the use of the new MFnParticleSystem class for retrieving particle information

pfxInfoCmd

an example that demonstrates how to extract the render line information from Maya® Paint Effects

pickCmd

command to pick objects by name

pointOnMeshInfo

both a MEL command and a DG node that computes the worldspace position and normal on a poly mesh

polyMessageCmd

A new example that demonstrates the use of the MPolyMessage class to listen to vertex, edge and face component id changes.

polyPrimitiveCmd

command to create polygons

progressWindowCmd

A new example that demonstrates the use of the MProgressWindow class.

referenceQueryCmd

command to find useful information about the referenced files in a scene

renderViewInteractiveRenderCmd

A new example that demonstrates the immediate feedback setting that has been added to the startRender() methods of the MRenderView class.

scanDagCmd

command which demonstrates walking the DAG

scanDagSyntax

command which demonstrates walking the DAG as well as using syntax objects to parse the arguments to the command

spiralAnimCurveCmd

command to move objects in a spiral

splitUVCmd

command to unshare or “split” select UVs on a poly mesh

surfaceCreateCmd

command that creates a NURBS surface from CVs and knots using the MFnNurbsSurface function set

surfaceTwistCmd

command which modifies the CV positions of NURBS surfaces or the vertex positions of polygons in order to twist the surface around the y-axis

threadTestCmd

command that shows how to use the MThreadPool thread class

threadTestWithLocksCmd

command that shows how to use the MThreadPool and MSpinLock threading classes

translateCmd

command to translate objects

undoRedoMsgCmd

A new example that demonstrates the use of the new Undo and Redo events that have been added to the MEventMessage class.

userMsgCmd

A new example that demonstrates the use of the MUserEventMessage class. This example allows the creation, removal and posting of user-defined events identified by strings.

userMsgCmd

command that demonstrates how user-defined messages can be used. The command supports options to register, deregister, and post named events through the API. This example uses callbacks that simply print a message when they are entered.

viewCallbackTest

an example that demonstrates how to listen to the pre render, post render, view destroyed callbacks

volumeLightCmd

demonstrates the use of the MFnVolumeLight class

whatisCmd

command that prints API type information about objects

zoomCameraCmd

command to zoom the view through a camera

Dependency Graph Node Plug-ins

affectsNode

a new example that demonstrates the use of the MPxNode::setDependentsDirty() method. This new method allows for attributeAffects() relationships involving dynamic and non-dynamic (i.e. static) Maya attributes.

animCubeNode

an example of a dependency node that creates a polygonal mesh from scratch and outputs that mesh in a dependency graph attribute.

apiMeshShape

an example of a shape node that registers a new kind of polygonal mesh, as well as geometry data specific for the shape and a node that can create this new shape type

apiSimpleShape

an example of a shape node that demonstrates how to work with components. Uses the MPxComponentShape class.

arcLenNode

a simple example of a node that takes geometry as input

buildRotationNode

a simple node which performs an algebraic computation

circleNode

a more complex procedural animation example

closestPointOnCurve

command that sets the weights of the CVs of a cluster according to a mathematical function

componentScaleManip

a complex example that demonstrates how to use conversion functions with a scale manipulator to control vertex positions.

curveArrowsNode

demonstrates the use of transparency and draw “last” functionality of MPxLocatorNode

customImagePlane

demonstrates how to create a user defined image plane

cvColorNode

an example of a locator dependency node that draws colored points on top of each CV of a NURBS surface.

cvColorShader

allows vertex color (CPV) to be software rendered

exampleMRampAttribute

an example that demonstrates how to implement a ramp attribute on a custom node

footPrintManip

an example of a locator dependency node that has a corresponding manipulator. The Show Manip Tool can be used when the footPrint locator is selected to show the footPrint manipulator.

footPrintNode

an example of a locator dependency node. Locators are actually DAG nodes that have draw methods that the user may override. This particular locator draws a foot print.

fullLoftNode

an example of a real loft dependency node that builds a NURBS surface from an array of NURBS curves.

genericAttributeNode

demonstrates how to create and use generic attributes on a node.

geometrySurfacConstraint

demonstrates how to create a user defined constraint

jitterNode

a simple multi-purpose procedural node

latticeNoise

a complex example of geometry modification in a dependency node, along with a command that does low level dependency graph access to hook up the node

multiCurveNode

an example of a dependency node that uses the MArrayDataBuilder class.

NodeMonitor

class that monitors a given node

offsetNode

an example of a deformer dependency node that offsets vertices according to the CV’s weights.

particleAttrNode

demonstrates how to define a custom node which maps per-particle data to a particle shape

pnTrianglesNode

ATI Radeon specific hardware shader plug-in

pointOnMeshInfo

both a MEL command and a DG node that computes the worldspace position and normal on a poly mesh

pointOnSubdNode

an example of how to query a subdivision surface as an input to a dependency node

polyTrgNode

an example of how to add user defined triangulation for meshes using the poly API class, MPxPolyTrg

quadricShape

an example of a simple shape node that implements a quadric shape using the OpenGL gluQuadric functions.

rockingTransform

an example that demonstrates how to implement a MPxTransform that defines a rocking motion.

rockingTransformCheck

an example that demonstrates how to implement a MPxTransform that defines a rocking motion and performs checks on the user entered values

rotateManip

an example that demonstrates the different settings for the rotate manipulator.

shellNode

a dependency graph node that procedurally generates sea shells and outputs them as meshes.

simpleLoftNode

a node that implements a user-defined loft function on a curve with construction history. Also demonstrates how to pass geometry (a NURBS surface) to an internal dependency node.

sineNode

a simple procedural animation example

stringFormatNode

demonstrates how to use strings as input and output attributes

surfaceBumpManip

this example demonstrates how to use the pointOnSurface manipulator to modify vertices near the manipulator position on the surface

swissArmyManip

a contrived example that attaches all existing user-defined manipulators to a node.

transCircleNode

an example of a dependency node that uses the translate attribute as both an input and output. Demonstrates how to transfer all of X, Y, and Z attributes via a single dependency graph connections. It also contains an example attribute editor template.

weightListNode

an example that demonstrates how to work with multi of multi attributes as is found in the weightList attribute of a deformer

yTwistNode

an example of a deformer dependency node that twists the deformed vertices around the y-axis.

User-defined dependency graph nodes—creating dynamics nodes

These user-defined dependency graph nodes create dynamics nodes derived from MPxEmitterNode, MPxSpringNode, and MPxFieldNode.

ownerEmitter

an example particle emitter node that emits in a direction from multiple points defined by a particle shape.

simpleEmitter

an example particle emitter node that emits in a direction from a single point.

simpleFluidEmitter

an example fluid emitter node that demonstrates how to use the new MPxFluidEmitterNode class to implement most of the functionality of Maya’s standard fluid emitters

simpleSpring

an example spring node that defines the spring law that is used in a simulation.

sweptEmitter

an example particle emitter node that emits in a direction from points on a curve or surface.

torusField

an example field node that implements an attract-repel field between itself and a distance.

Rendering plug-ins

blastCmd

demonstrates how to use the off screen rendering API extension.

blindDataMesh

demonstrates the use of blind data to provide color information to a hardware shading node.

CgFx Shader

a hardware shader plug-in with many advanced possibilities.

renderAccessNode

demonstrates how to work with render callbacks.

renderViewRenderCmd

demonstrates how to render a full image to the Render View window using the MRenderView class.

renderViewRenderRegionCmd

demonstrates how to use the MRenderView class to update the currently selected Render Region in Maya's Render View.

sampleCmd

demonstrates how to sample shading groups or nodes using MRenderUtil::sampleShadingNetwork().

sampleParticles

demonstrates how to sample shading groups or nodes using MRenderUtil::sampleShadingNetwork() to assign colors to a particle object.

ShadingConnection

a class that stores useful information about a shader’s attribute, including what’s connected upstream of it.

ShapeMonitor

a class that watches shape or texture nodes and keeps track of changes since the last export.

shiftNode

demonstrate modifying uvCoord and refPointCamera from within a texture plug-in

hwManagedTextureShader

demonstrates how to manage texture caching efficiently

OpenGLViewportRenderer

demonstrates how to override the Maya scene view drawing

D3DViewportRenderer

demonstrates how Direct3D can be used to render into a Maya scene view (Windows only)

lensDistortionCallback

demonstrates how to enable multiple draw-passes and listen to the pre/post render for each draw-pass.

Miscellaneous plug-ins

The following lists several miscellaneous plug-ins.

conditionTest

display which “conditions” are being changed inside Maya

ddsFloatReader

demonstrates how to define a .dds float file format reader

eventTest

display which “events” are being changed inside Maya

filterAsciiFile

demonstrates how to control the filtering of a Maya ASCII file

hairCollisionSolver

demonstrates how to use MHairSystem to override Maya’s object to hair collision algorithm

helixMotifCmd

create a new Motif window containing a button that creates a helix when pressed. This plug-in is only available on Linux.

idleTest

using both idle messages and UI deleted messages in a plug-in

iffInfoCmd

extracts information from an IFF image file.

iffPixelCmd

extracts a pixel value from an IFF image file.

iffPpmCmd

converts an IFF image file to a PPM image file.

jlcVcrDevice

creates a user defined midi input device for the JL-Cooper midi VCR control box. This plug-in is only available on Linux.

lepTranslator

an example file translator that defines its own magic number and reads MEL commands

maTranslator

an example of a file translator that approximates the MayaAscii file

moveManip

A simple manipulator that demonstrates how the freePointTriad and distance manipulators can be used with an user-defined context.

moveNumericTool

Selection-action tool that performs translations in orthographic views as well as allowing the user to type in precise translation values to while in the move tool.

moveTool

Selection-action tool that performs translations in orthographic views.

pnTrianglesNode

This node is a simple example of how to query a subdivision surface as an input to a dependency node.

simpleImageFile

demonstrates how to define a new image file format

simpleSolverNode

an example of a simple user defined single-bone IK-solver in the x-y plane that is registered through createNode. By registering the plug-in solver through createNode, the registration mechanism is the same as non-default IK solvers such as the ikMCsolver.

tiffFloatReader

demonstrates how to define a .tif float file format reader

viewCaptureCmd

uses OpenGL to capture the current 3D view and write it into a PPM file

Shader source code examples

Shader source code examples are provided in Shader source code examples.

System plug-ins

The following table lists the source for several of the system plug-ins shipped with Maya. Unlike most of the other examples, these are complex samples of real production plug-ins.

Detailed documentation for each of these can be found in the Translators guide as compiled versions of these are shipped as part of the Maya package. The following shows the current list.

animImportExport

A translator that allows you to move animation information between scenes.

objExport

A Wavefront OBJ export translator

ribExport

A Pixer® RenderMan® RIB export translator