Apply Node Graph Description
apply_graph_descriptionBuild or mutate node graphs in Cinema 4D using a declarative dict syntax. Create nodes, wire connections, and set port values for materials or scene-nodes.
Instructions
Build or mutate a node graph using maxon.GraphDescription's declarative dict syntax. Supports creating nodes ($type), assigning stable ids ($id), wiring connections via 'thisPort -> childPort' keys (the value is the nested upstream node), and setting port values inline. Example: {"$type":"Output","Surface -> outColor":{"$type":"Standard Material","$id":"mat","Base/Color":[1,0,0]}}. Works for material graphs (standard/redshift) and the scene-nodes (neutron) document graph via scope:"document". For scene-nodes, $type must be a node-template asset id from list_graph_node_assets (node_space:"scenenodes"), e.g. "net.maxon.node.invert" — NOT the net.maxon.corenode:* ids; the scene-nodes path supports creation + connections + port values (graph queries/labels are material-only). Creates the graph on demand by default.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scope | No | Target the active document's scene-nodes graph instead of a material. | |
| handle | No | Material handle. Required unless `scope:'document'`. | |
| node_space | No | Alias 'standard' | 'redshift' | 'scenenodes' or a maxon.Id. Default 'standard' for materials, 'scenenodes' for document scope. | |
| description | Yes | maxon.GraphDescription dict (nested; $type / $id / '->' keys). | |
| create_graph | No | Create the graph if missing. Default true. |