Hi, all
I’ve started playing around with python in Unreal, specifically trying to find the best way of interfacing with EditorUtilityWidgets to provide some UI for tools and scripts.
However, the editor will crash when saving blueprints based on my python classes, so am I misunderstanding how this is supposed to work?
I’m using UE4.24.
import unreal
@unreal.uclass()
class MyPythonWidget(unreal.EditorUtilityWidget):
@unreal.ufunction(ret=int, params=[int], meta=dict(Category="My functions"))
def do_some_work(self, some_int):
return 42 + some_int
Here’s a simple example of a widget I’m able to:
- base a blueprint on
- put that WidgetBlueprint inside a standard Editor Utility Widget
- run that Widget and it’s able to run my python code
My problem is the engine will crash when trying to save the WidgetBlueprint.
Assertion failed: !Export.SuperIndex.IsNull() [File:D:/Build/++UE4/Sync/Engine/Source/Runtime/CoreUObject/Private/UObject/SavePackage.cpp] [Line: 4986] Export Struct (/Game/NewBlueprint.NewBlueprint_C) of type (WidgetBlueprintGeneratedClass) inheriting from (/Engine/PythonTypes.MyPythonWidget) of type (PythonGeneratedClass) has not mapped super struct.
Here’s the error I’m having trouble deciphering.
If I’m going about this the wrong way please let me know, as I definitely haven’t quite grasped the implications of the whole transient/reflection system.
Cheers