add_macro_instance_node
Adds a macro instance node from a specified library asset to a Blueprint graph, enabling third-party or project macros. Defaults to the Blueprint's own macros if no library is given.
Instructions
Instantiate a macro from a macro LIBRARY asset ("/Game/Lib/ML_X.ML_X:MyMacro", or the library path plus macro_graph) -- the only way to reach a third-party or project macro library, since add_graph_node's macro aliases (foreach, do_once, gate, is_valid...) only look inside the engine StandardMacros. With no library path it falls back to this Blueprint's own MacroGraphs and then StandardMacros. Does NOT compile. Its pins start WILDCARD and only re-type once something is connected, which connect_pins handles by reconstructing the node.
Returns: { node_id, input_pins:[string], output_pins:[string], blueprint_name, graph_name } -- pin NAMES only, split by direction (no types or defaults); use get_node_pin_info on the node_id when the types matter.
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. | |
| macro | Yes | Macro identifier: "<macro-library-path>:<MacroGraphName>" (e.g. "/Game/Lib/ML_X.ML_X:MyMacro"), OR just the library asset path with the graph name in 'macro_graph', OR a bare graph name to resolve against this Blueprint's own MacroGraphs and then the engine StandardMacros. | |
| graph_name | No | Target graph name; defaults to the Blueprint's event graph when omitted. | |
| position_x | No | Node X position on the graph canvas (ignored when node_position is set) | |
| position_y | No | Node Y position on the graph canvas (ignored when node_position is set) | |
| macro_graph | No | Macro graph name, used when 'macro' is a library path with no ":<GraphName>" suffix. | |
| node_position | No | Node canvas position as [x, y]; takes precedence over position_x/position_y | |
| blueprint_name | No | Name (or full object path) of the Blueprint to add the node to. | |
| blueprint_path | No | Alias of `blueprint_name` (same value, same meaning). Accepted because sibling tools spell this parameter differently; prefer `blueprint_name`. |