Comments (5)
Ah! So you’re passing in the arguments by calling the method with the arguments in the same string? That makes sense now that I think about it.
I did think about using text files or CSV for the output data, but it feels like there has to be a better way to pass data back.
I suppose I could place the code on an actor, and run the execute python string for the input. Then create a blueprint function that takes inputs, and call that function from the python script to pass the data back? I may be creating issues with this process but it’s worth a shot.
from unrealenginepython.
I took another stab at it tonight and got farther! I've successfully been able to call a function in the python script, pass an argument to the function (number as a string), run the function that multiplies the number by itself, then print to console, and print screen, the output of multiplication.
My next tests will be:
- See if I can import a python library and then print to string some output from using the library.
- See if I can create a custom blueprint node that lets me pass back more than just a string or bool. These "execute actor method" functions are written in the plugin so maybe I can replicate them and add more output types.
- If I can't pass back anything but a string, then I'll test passing back multiple arguments as a combined string and separating them in blueprint code, then try using them.
To answer your question: I believe I have seen a way to set the value of a variable from blueprint code. It's either in the examples or the docs on github. Depending on if you're creating the actor from code then referencing it, or getting the actor in python via some find by class method. I haven't successfully done this yet, because I'm still not able to get a reference to the actor properly in python. I just tried for half an hour but didn't get anywhere. I see there are "set python attr int" and other nodes for python character or component. I'm trying from a PyActor but those nodes don't exist there.
from unrealenginepython.
@tempaccountforissue Agreed. If I can figure out how to pass a proper reference, I think that would solve a lot of overall issues.
I believe this is the document I'm referring to. It requires you to use it as a uobject which I'm hoping isn't editor only. Do you have any idea?
https://github.com/20tab/UnrealEnginePython/blob/master/docs/uobject_API.md
from unrealenginepython.
@tempaccountforissue I think you can break the struct up and pass it back and forth as a string if absolutely necessary, it would just be more tedious to have to convert it back and forth. I also don't know if that doc is old and maybe they are supported now?
from unrealenginepython.
@tempaccountforissue Unfortunately, I never figured out how to get this to properly work. I think I lack the understanding of c++ to do so. Instead I’m attempting to pay someone on fiverr to just create me a c++ library that will hopefully do what I wanted to do in Python, natively in c++. If you ever figure it out, let me know!
from unrealenginepython.
Related Issues (20)
- Mac Binaries?
- upgrade python console to IPython or other alternatives?
- Error with module h5py
- 4.26.2 Python 3.7 Crash When call bind_event in uep HOT 2
- How to add force to pyactor HOT 1
- keyboard input HOT 2
- Where are the python modules? HOT 1
- Build Failed: Cannot open include file 'UEPyModule.h'
- seems not work at 4.27?
- How can I redirect a python class so that the engine can recognize him?(请问如何重定向一个python类,然后引擎能够识别他?)
- Spawn a pyactor in begin_play doesn't works fine.
- First demo in docs/Http_API.md cause the editor crashed in 4.27.2
- Great content! It might be possible to create an updated version (ue5) HOT 1
- How to call Python automation code from a UI button? HOT 4
- How do I get text from a UEditableTextBox?
- I am using multithreading to Spawn a Blueprint Actor and Unreal Engine is crashing suddenly when the spawn function gets called.
- consider archiving the repo in github
- how can I change my python env in my own source(python3.8),rather then the give source(python3.6 in UnrealEnginePython/)
- a
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unrealenginepython.