paint_color_attribute
Paint vertex colors on a Blender mesh, creating the color attribute if missing and setting it as the active render color for materials and glTF export.
Instructions
Fill a color attribute (vertex colors) on a mesh, creating it if needed.
The attribute becomes the active and render color. Read it in a material with a ShaderNodeVertexColor node whose layer_name is the attribute name. Game engines and glTF export pick it up as vertex color.
Args: object_name: Mesh object. color: Linear RGB or RGBA, each 0.0 to 1.0. attribute_name: Color attribute; created if it does not exist. domain: CORNER (per face corner, allows hard color edges) or POINT (per vertex). Used only when creating the attribute. data_type: BYTE_COLOR (8-bit) or FLOAT_COLOR. Used only when creating. vertex_indices: Vertices to paint. Omit to paint the whole mesh, or the edit-mode selection with selection="CURRENT". selection: When vertex_indices is omitted: ALL, or CURRENT for the vertices selected in edit mode (use the select_* tools first).
Returns: Dict with the attribute, its domain and type, whether it was created, how many elements were painted, and all color attribute names.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| color | Yes | ||
| domain | No | CORNER | |
| data_type | No | BYTE_COLOR | |
| selection | No | ALL | |
| object_name | Yes | ||
| attribute_name | No | Color | |
| vertex_indices | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||