You can implement a deformer node that acquires the full benefits of Maya's internal deformer functionality by deriving from MPxGeometryFilter
, or one of its child classes.
This has changed in Maya 2016. MPxGeometryFilter
is now the base class for implementing deformers.
Deriving from MPxGeometryFilter
allows you to create a simple deformer node. For an illustration, see the next section that walks through the yTwistNode SDK example. There are three child classes you can derive from depending on the deformer you want to create:
MPxDeformerNode
- similar to MPxGeometryFilter
, with the addition of per-vertex weights.MPxBlendShape
- deformers implemented from this class are treated as Blend Shape deformers in the Maya UI, and users can modify them using tools such as the Blend Shape Editor.MPxSkinCluster
- deformers implemented from this class are treated as skinClusters in the Maya UI and users can modify them using tools such as the Paint Cluster Weights tool.See the API description of MPxGeometryFilter
for additional information.
Deformers often require a helper node such as a locator in order to control the change of deformation. These helper nodes are called Accessories. Accessory nodes are optional and not required for deformers. The input attributes of the MPxGeometryFilter
class are sufficient to perform the deformation. You should implement the accessoryNodeSetup()
and accessoryAttribute()
methods only if you want to deform geometry using an accessory.
As MPxGeometryFilter
derives from MPxNode
, a compute()
method can be implemented in the class. You do not need to implement the compute()
method for simple deformers. Only implement the compute()
method if the deformation isn't a simple per-vertex process. See the API descriptions for an example of compute()
method implementation.