Python: How to call a blueprint function

Hi all,
Is there a way that I can call a function implemented in blueprints (e.g on an actor) from the python API?

Something tells me you may not be able to call functions from the editor (outside of runtime), but that’s something I need in order to build the functionality I’m looking for.

Thanks in advance,

I’m working on a temporary solution; Using a BlueprintImplementableEvent in C++ as an sort of intermediary.
I’m having some issues though, see this post.

1 Like

Solved. See my answer here.

1 Like

No way. you can use python to interact with the Unreal Editor, the Assets in your Project, and the content in your Levels. Only while editing, not in runtime

That’s exactly what I’m trying to do.
The post has yet to be let through by mods, but I have now solved this issue. Solution will be posted here.

The link shows a 404 to me O.O can you post it here please? Thanks!!!

Hello !

Here is a snippet demonstrating a really simple way to do this, without any C++.
Call functions or modify properties of a Blueprint from Python | Epic Developer Community (epicgames.com)

You need to do this:

  • Wrap a function in another function
  • Expose inputs in args/kwargs.

In my example I wrapped AddMeshSections function in AddMeshSectionsPy function.
After that I called this function from Python:

my_actor.call_method("AddMeshSectionsPy", args=(my_array, ))