Giter Site home page Giter Site logo

Comments (5)

TylerDuncan avatar TylerDuncan commented on June 28, 2024

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.

TylerDuncan avatar TylerDuncan commented on June 28, 2024

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.

TylerDuncan avatar TylerDuncan commented on June 28, 2024

@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.

TylerDuncan avatar TylerDuncan commented on June 28, 2024

@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.

TylerDuncan avatar TylerDuncan commented on June 28, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.