Go to: Synopsis. Return value. Keywords.
Related. Flags.
Python examples.
polyColorPerVertex([alpha=float], [clamped=boolean], [colorB=float], [colorDisplayOption=boolean],
[colorG=float], [colorR=float], [colorRGB=[float, float, float]],
[notUndoable=boolean],
[relative=boolean], [remove=boolean], [representation=int])
Note: Strings representing object names and
arguments must be separated by commas. This is not depicted in the
synopsis.
polyColorPerVertex is undoable, queryable, and editable.
Command associates color(rgb and alpha) with vertices on polygonal
objects. When used with the query flag, it returns the color
associated with the specified components.
boolean |
Success or Failure. |
In query mode, return type is based on queried flag.
poly, color, colorPerVertex, vertexColor
polyGeoSampler
alpha, clamped,
colorB, colorDisplayOption, colorG, colorR,
colorRGB, notUndoable, relative, remove,
representation
Long name (short name) |
Argument types |
Properties |
relative(rel) |
boolean |
|
|
When used, the color values specified are added relative to the
current values. |
|
remove(rem) |
boolean |
|
|
When used, the color values are removed from the selected or
specified objects or components. This option only supports meshes
with no construction history, or meshes whose construction history
includes a recent polyColorPerVertexNode. For meshes whose
construction history includes a polgon operation the
polyColorPerVertexNode, consider using the polyColorDel command
instead |
|
colorR(r) |
float |
|
|
Specifies the R channel of color |
|
colorG(g) |
float |
|
|
Specifies the G channel of color |
|
colorB(b) |
float |
|
|
Specifies the B channel of color |
|
colorRGB(rgb) |
[float, float, float] |
|
|
Specifies the RGB channels of color |
|
alpha(a) |
float |
|
|
Specifies the alpha channel of color |
|
notUndoable(nun) |
boolean |
|
|
Execute the command, but without having the command be
undoable. This option will greatly improve performance for large
numbers of object. This will make the command not undoable
regardless of whether undo has been enabled or not. |
|
colorDisplayOption(cdo) |
boolean |
|
|
Change the display options on the mesh to display the vertex
colors. |
|
clamped(cla) |
boolean |
|
|
This flag specifies if the color set will truncate any value
that is outside 0 to 1 range. |
|
representation(rpt) |
int |
|
|
This flag corresponds to the color channels to used, for
example A(alpha only), RGB, and RGBA. |
|
Flag can appear in Create mode of
command |
Flag can appear in Edit mode of command |
Flag can appear in Query mode of command |
Flag can have multiple arguments, passed
either as a tuple or a list. |
import maya.cmds as cmds
# To set the rgb channels of selected vertices:
cmds.polyColorPerVertex( rgb=(0.8, 0.0, 0.4) )
# To set just the "g" channel of selected vertices:
cmds.polyColorPerVertex( g =0.5 )
# To add to the current value of just the "g" channel of selected vertices:
cmds.polyColorPerVertex( rel=True, g =0.2 )
# To query the "g" and "b" channels of color on selected vertices:
cmds.polyColorPerVertex( query=True, g=True, b=True )