To create a custom deformer node in Maya, you would need to derive from MPxDeformerNode, and the documentation says to not override the compute() method unless required since the deform() method is called by the MPxDeformerNode's compute() method.
There is few exception to that recommendation. Exceptions are namely:
- Your node's deformation algorithm depends on the geometry type, which is not available in the deform() method,
- Your node's deformation algorithm requires computing all of the output geometries simultaneously,
So if you node deformation algorithm depends on the input geometry type, which is not available in the deform() method, or your node's deformation algorithm requires computing all of the output geometries simultaneously, you have to implement the compute() method as well.
The devkit splatDeformer sample is a good example as its deformation algorithm requires to know the geometry type.
Note that in case you implement your own compute() method, you will tell Maya not to call deform anymore - so remember to write your node code accordingly.
makePaintable -attrType "multiFloat" -sm "deformer" "fStretch" "paintStretchGrowShrink";
"paintStretchGrowShrink" being the attribute name in that example.
One thing to emphasize is in order to make an attribute paintable, it has to be a multi of multis. The multi attribute has to have a parent which is also a multi. The first level multi attribute is to record per vertex values, and the parent multi attribute is necessary to store values for multiple shapes.