add gt callback with python variables #564
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Took longer than expected to get the time to make the pull request, but as per request #181 (comment)
This variant will allow you to pass in a variable such as a python object in the callback. Example use case here
https://github.com/getnamo/tensorflow-ue4/blob/master/Content/Scripts/TensorFlowComponent.py#L164
Note that this particular call uses an alias defined here: https://github.com/getnamo/UnrealEnginePython/blob/b652cbfd759da6045a2f89c4d4080526b33d3c47/Source/UnrealEnginePython/Private/UEPyModule.cpp#L501, alias not required for functionality and it's not included in the pull request. Instead you would write:
For the other route (game thread->run something on background thread) it's probably better to use python's Thread model (see: https://github.com/getnamo/UnrealEnginePython/blob/master/Content/Scripts/upythread.py for an example)