File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 1+ Add a ForEachLoop Macro node
2+ -
3+
4+ ``` python
5+ import unreal_engine as ue
6+ from unreal_engine.classes import K2Node_MacroInstance, EdGraph
7+ from unreal_engine.structs import GraphReference
8+
9+ # for_each_loop = ue.load_object(EdGraph, '/Engine/EditorBlueprintResources/StandardMacros.StandardMacros:ForEachLoop')
10+ for_each_loop = ue.find_object(' ForEachLoop' )
11+
12+ # get a reference to your blueprint
13+ blueprint = ...
14+
15+ # add the node
16+ node = blueprint.UberGraphPages[0 ].graph_add_node(K2Node_MacroInstance)
17+ # assign the macro graph to the node
18+ node.MacroGraphReference = GraphReference(MacroGraph = for_each_loop)
19+ # allocate pins
20+ node.node_allocate_default_pins()
21+
22+ # update the blueprint
23+ ue.blueprint_mark_as_structurally_modified(bp)
24+ ```
You can’t perform that action at this time.
0 commit comments