Make an attribute paintable
 
 
 

A paintable attribute is a node attribute that has been registered as paintable through the makePaintable command in Maya. When you register an attribute, it is stored in your user preferences and stays paintable between Maya sessions, and between each separate use of the Paint Attributes Tool. You only need to register an attribute as paintable once. After an attribute is made paintable, the Paint Attributes Tool automatically finds it on the selected surface.

Painting attributes should be added to the shape node (pPlaneShape1), not the transform node (pPlane1).

For example:

// Add an attribute to paint
select pPlaneShape1; 
addAttr -ln "paintAttr" -dataType "doubleArray"; 
// Make it paintable 
makePaintable "mesh" "paintAttr"; 

Register a paintable attribute

Use the following command to register an attribute as paintable:

makePaintable [flags] <nodeType> <attrName>
nodeType

The name of the node type containing the attribute to be made paintable.

attrName

The name of the attribute to be made paintable.

flags

-sm/shapeMode string

This flag defines a function which is called when the matching between the paintable node depends on the painted shape. It is used for attributes of type multi where the first multi corresponds to the shape index (for example, cluster nodes). Currently only one function is supported: deformer. By default this flag is empty, which means that there is a direct indexing of the paintable attribute with respect to vertices on the shape.

-aa/altAttribute string

Defines an alternate attribute that receives the same values. You can use this flag more than once.

-ui/uiName string

Defines the name for the new paintable attribute that will appear the Paint Attributes Tool Settings editor and right-click menu. The default is the attribute name.

-at/attrType string

Defines the paintable attribute type. Supported types are: doubleArray, multiVector, multiDblArray.

Examples

  • Make particle.mass paintable.
    makePaintable -attrType "doubleArray" "particle" "mass";
    
  • Make particle.goalPP paintable with a user interface name of myGoalPP. Also make the goalPP0 attribute simultaneously paintable.
    makePaintable -ui "myGoalPP" -altAttribute "goalPP0" -attrType "doubleArray" "particle" "goalPP";
    
  • Make weightGeometryFilter.weights paintable. Define weightGeometryFilter as a deformer node.
    makePaintable -sm "deformer" "weightGeometryFilter" "weights";