Skip to content

Commit edef1d2

Browse files
author
rdeioris
authored
Create Graph_API.md
1 parent 4b6e6e3 commit edef1d2

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

docs/Graph_API.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
```

0 commit comments

Comments
 (0)