ap_node_set_value
Set float, color, vector, or button values on a material node's sockets or widgets, then call ap_material_update to apply the batch.
Instructions
Set a value on a node. Four kinds: 'float' (one number on a socket), 'color' (r,g,b,a on a socket), 'vector' (x,y,z on a socket), and 'button' (a node's own widget — dropdown index, checkbox 0/1, or a slider value; see the node reference for each type's button list). Socket-based kinds default to the node's INPUT sockets. Follow a batch of edits with ap_material_update.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Node id from ap_node_list. | |
| kind | Yes | What to set. | |
| color | No | RGBA (or RGB, alpha defaults to 1) in 0..1, for kind 'color'. | |
| value | No | The number, for kind 'float' or 'button'. | |
| button | No | Button index, for kind 'button'. | |
| socket | No | Socket index for float/color/vector kinds. | |
| vector | No | [x, y, z] for kind 'vector'. | |
| is_input | No | Target an input socket (true) or an output socket. |