Hi, thx for your nice Live.
Here is my question : I’m using DataSmith plugin to import IFC files.
But, there is a pb on reading metadata by DataSmith. So, I wrote a PythonScript to make my custom ifc file importation.
I’m using DataPrep and BluePrint to modify imported objects by DataSmith and I’d like to call a Python function wrote in my Python Script with Blueprint.
Maybe using C++ Class, but how to call a Python function and get returned objects from this function into BluePrint…
How…hop I’m clear…Sorry for my poor english…
I don’t know if there is a better way, but I haven’t found anything else about sending arguments back from python so this is what I have been doing so far.
I have a blueprint that calls a python script that will extract some data and return the results. On my blueprint that calls my script I have several Array variables set up in the types that will be returned (an array of transforms, and an array of string names) set to instance editable.
When the Blueprint calls the script it sends a reference of itself as an argument. when the script is done it uses that reference to access the variables, set them as the processed values then I use method call to trigger an event in the blueprint to use these updated variables.
Also I suppose as a slight optimization to this approach on the custom event I’m triggering with call method I could probably set that event to take in arguments which would be my returned data instead of having python manipulate the blueprint directly.
Hi,
I hope this thread is still alive…
@Rajule … can you please describe more about the process you are talking about?
How can i return values from python script to another process?
I am trying to do the same process as of the question, but i don’t know how to return values from an executed script to another process.
Hey, did u also consider saving results into csv and export it in other script? I’m using that method now
This video covers blueprints calling python with values and then python returning values back to the blueprint.
This youtube person has at least 2 other unreal Python video
@scottunreal , i am using unreal engine 4, which don’t have the python nodes, so i have to use c++ execute process function (from std), and the value returned by that function is the return state (0 or 1). But i need to send data from python script, other than the state of the execution. How should i do that?
In case someone ends up in this thread, and if none solution works, i suggest using sockets to connect from unreal to python script and send data via the socket.