connect_pins
Links an output pin to an input pin in Blueprint, material, or other graph assets, enabling node connections after adding or listing nodes.
Instructions
Link one node's output pin to another node's input pin, in a Blueprint graph (Animation and Widget Blueprints included) or in the graph of a material, material function, sound cue, MetaSound Source, PCG graph or Control Rig.
Use it after add_graph_node, or on nodes that get_graph_nodes lists: both give the node ids and pin names. Not for: testing a pair without linking it (validate_pin_connection), unlinking (disconnect_pin), or creating and linking several Blueprint nodes in one undo step (build_blueprint_graph). Refused during Play-in-Editor (see force).
Example: {"asset_path": "/Game/Blueprints/BP_Door", "source_node_id": "<a Branch's node_id>", "source_pin": "then", "target_node_id": "<a PrintString's node_id>", "target_pin": "execute"}. @input and @output stand for the graph's own input and output: target_node_id "@output" with target_pin "BaseColor" feeds a material's main input. On a sound cue, @output makes the source the cue's first node, and target_pin is the parent's input slot index (empty: its first free slot); on a MetaSound they are its graph inputs and outputs, named by the pin; on a PCG graph its input and output nodes.
In a Blueprint the graph's schema type-checks the pair, so AnimGraph pose links work too and an incompatible pair is an error, never a silent no-op. An exec output and a data input hold one link each, so linking one that is already linked replaces its old link; each call is one undo step, and undo puts the old link back. A node with a wildcard pin is reconstructed afterwards, so array, ForEach and Select pins take the linked type. A Blueprint is not compiled or saved: compile_blueprint, then save_asset. The other assets are saved by their editor, and a Control Rig is compiled.
Returns: { connected, source_node_id, target_node_id, graph_kind? } -- a failed link is an error, so connected is true in every Blueprint reply; another asset answers with its editor's own reply, saved included.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| force | No | Optional. This command is REFUSED while a Play-in-Editor session is running: it either compiles a Blueprint (the reinstancer can retain a world, and CheckForWorldGCLeaks is Fatal -- it KILLS the editor) or writes to disk (Editor.AllowSavingAssetsDuringPIE=0 makes the engine refuse the write, so it would report success without writing a byte). Stop PIE and retry instead; force=true runs it anyway, at your own risk. | |
| asset_path | No | The graph asset: a Blueprint by name or path, or the path of a material, material function, sound cue, MetaSound Source, PCG graph or Control Rig. | |
| graph_name | No | Blueprint only: the graph, default the event graph ("AnimGraph" for an Animation Blueprint's anim graph). BOTH nodes must live in this same graph. The other assets have one graph: leave it out. | |
| source_pin | Yes | Output pin name on the source node (e.g. "then", "ReturnValue"; a material output name, empty for the first). In a Blueprint an output pin of that name is preferred and any pin with the name is accepted as a fallback. | |
| target_pin | Yes | Input pin name on the target node (e.g. "execute", "Condition"; a material input name without spaces; a sound cue slot index). | |
| blueprint_name | No | Older name of asset_path, still accepted. | |
| blueprint_path | No | Alias of `blueprint_name` (same value, same meaning). Accepted because sibling tools spell this parameter differently; prefer `blueprint_name`. | |
| source_node_id | Yes | node_id of the source node, or @input (from add_graph_node / get_graph_nodes). | |
| target_node_id | Yes | node_id of the target node, or @output. |