Created
January 19, 2022 22:24
-
-
Save FilipSivak/fbbc3c449e59d1bae1f3e5f361204cff to your computer and use it in GitHub Desktop.
Revisions
-
FilipSivak created this gist
Jan 19, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ # Example by Filip Sivak, written for https://filipsivak.medium.com/ import unreal @unreal.uenum() class MyPythonEnum(unreal.EnumBase): FIRST = unreal.uvalue(0) SECOND = unreal.uvalue(1) FOURTH = unreal.uvalue(3) @unreal.ustruct() class PythonUnrealStruct(unreal.StructBase): some_string = unreal.uproperty(str) some_number = unreal.uproperty(float) array_of_string = unreal.uproperty(unreal.Array(str)) @unreal.uclass() class PythonTestClass(unreal.BlueprintFunctionLibrary): @unreal.ufunction(static = True, params = [int], ret = PythonUnrealStruct) def MyPythonFunction(integer_argument1): struct = PythonUnrealStruct() struct.some_string = "5" struct.some_number = integer_argument1 + 1 struct.array_of_string = ["a", "b", "c"] return struct