Skip to content

Support for return values and output params #621

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
dfb opened this issue Dec 6, 2018 · 1 comment
Open

Support for return values and output params #621

dfb opened this issue Dec 6, 2018 · 1 comment

Comments

@dfb
Copy link
Contributor

dfb commented Dec 6, 2018

It seems that BP functions don't really have return values per se - anything returned from a BP function is an output param.

In C++, however, you can have both a return value as well as zero or more output params, e.g.

UFUNCTION(BlueprintCallable, BlueprintImplementableEvent) FString MyMethod(int vIn, int& vOut);

Currently this doesn't seem to be fully supported - for example, I don't think multiple output params are supported, and if you have a void C++ method with a single output param, there's no way to support it from Python (you get an error saying the signature doesn't match).

Assuming this is the case, I'd like to implement support for multiple output params, as well as supporting UFUNCTIONS that may or may not have return values even if they have output params. So you'd be able to implement the above in Python like this:

def MyMethod(self, i:vIn) -> (str, int):
    return 'Foo', 5

Before I do this work, though, I wanted to see if you have any objections/concerns, or if you know of someone already working on it. Thanks!

(P.S. Is opening tickets like this the best way to talk to you about questions like this or would you prefer email? This works for me, but I don't want to be abusing the issues list if you'd prefer a different format)

@dfb
Copy link
Contributor Author

dfb commented Dec 7, 2018

Slight tweak from what I said... it looks like the engine puts return params after any out params, so the Python version would instead be:

def MyMethod(self, i:vIn) -> (int, str):
    return 5, 'Foo'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant