Skip to content

Commit a4c6198

Browse files
author
rdeioris
authored
Update YourFirstAutomatedPipeline.md
1 parent 966c261 commit a4c6198

File tree

1 file changed

+30
-4
lines changed

1 file changed

+30
-4
lines changed

tutorials/YourFirstAutomatedPipeline.md

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -551,22 +551,48 @@ def find_event_node(graph, name):
551551
for node in graph.Nodes:
552552
if node.is_a(K2Node_Event):
553553
if node.EventReference.MemberName == name:
554-
return True
555-
return False
554+
return node
555+
return None
556556

557557
def find_function_node(graph, name):
558558
for node in graph.Nodes:
559559
if node.is_a(K2Node_CallFunction):
560560
if node.FunctionReference.MemberName == name:
561-
return True
562-
return False
561+
return node
562+
return None
563563

564564
update_animation_event = find_event_node(anim_bp.UberGraphPages[0], 'BlueprintUpdateAnimation')
565565
try_get_pawn_owner = find_function_node(anim_bp.UberGraphPages[0], 'TryGetPawnOwner')
566566
```
567567

568568
We can now add the 'GetVelocity' node and the 'VectorLength' one. Its return value will be stored into the Speed variable
569569

570+
```python
571+
node_get_velocity = anim_bp.UberGraphPages[0].graph_add_node_call_function(Actor.GetVelocity, 300, 200)
572+
# note the functions is called VSize albeit the graph editor reports it as VectorLength
573+
node_vector_length = anim_bp.UberGraphPages[0].graph_add_node_call_function(KismetMathLibrary.VSize, 600, 200)
574+
node_speed_set = anim_bp.UberGraphPages[0].graph_add_node_variable_set('Speed', None, 900, 0)
575+
576+
577+
#link nodes
578+
579+
# BlueprintUpdateAnimation to Speed Set
580+
update_animation_event.node_find_pin('then').make_link_to(node_speed_set.node_find_pin('execute'))
581+
582+
# TryGetPawnOwner to GetVelocity
583+
try_get_pawn_owner.node_find_pin('ReturnValue').make_link_to(node_get_velocity.node_find_pin('self'))
584+
585+
# GetVelocity to VectorLength
586+
node_get_velocity.node_find_pin('ReturnValue').make_link_to(node_vector_length.node_find_pin('A'))
587+
588+
# VectorLength to Speed Set
589+
node_vector_length.node_find_pin('ReturnValue').make_link_to(node_speed_set.node_find_pin('Speed'))
590+
```
591+
592+
![The Kaiju Animation Blueprint Event Graph](https://github.com/20tab/UnrealEnginePython/blob/master/tutorials/YourFirstAutomatedPipeline_Assets/slicer_anim_blueprint_event_graph.png)
593+
594+
We have done with the event graph, we can now move to the AnimGraph and define a State Machine
595+
570596
Put it all in a new Blueprint
571597
-
572598

0 commit comments

Comments
 (0)