add_material_expression
Add a material expression node to a material without clearing existing nodes, then wire connections.
Instructions
Add a single expression node without clearing other nodes.
Returns the new node_index. Wire it up with connect_material_expressions.
node is a JSON object: {"type": "ScalarParameter", "pos_x": -1200, "pos_y": -400, "properties": {"parameter_name": "Speed", "default_value": 0.5}}
For Custom HLSL nodes, include top-level "code", "description", "output_type", "inputs", and "outputs" fields.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| node | Yes | ||
| material_path | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |