Calling BP Graph Functions
How to call a function declared in the Blueprint Editor

For Blueprint functions created in the Blueprint Editor we can use call_method()
to access them via Python:
asset_instance.call_method("function")
For functions with inputs we can use either the args or kwargs parameters:
asset_instance.call_method("function", args=("inputs_as_a_tuple",))
asset_instance.call_method("function", kwargs={"arg": "value"})
It also works with Blueprint functions that have returns:
value = asset_instance.call_method("function_with_return")
call_method also works with custom events:

Note: An asset loaded using unreal.load_asset()
does not have direct access to call methods defined in the Blueprint Graph, we will need to get either its default object or an active instance of the BP:
asset_instance = unreal.new_object(asset.generated_class())
# or
default_object = unreal.get_default_object(asset.generated_class())
Last updated