Edit UserDefinedEnum entries

Hi,

I’ve been trying to find a way to edit my UserDefinedEnum via EditorUtilities or Python, but no luck so far. Is it even possible or does it require C++ magic ?

My need is to reduce the amount of steps a user has to do to create a new game ingredient (imagine adding fruits). The way it is done at the moment, requires the name of the fruit to be listed in an Enum. So, i wanted to create a tool that does a bunch of stuff, including to skip having to add it manually in the Enum list.

Cheers

We can create UserDefinedEnum with UE built-in functions.

    asset_tools = unreal.AssetToolsHelpers.get_asset_tools()
    new_enum = asset_tools.create_asset("IAmAEnum", "/Game/CreatedByPython", unreal.UserDefinedEnum, unreal.EnumFactory())

But, if we want more complex, we need some c++. For example create some BlueprintFunctionLibrary.

Here is a blog about How to manipulate User Defined ENum, Struct, DataTable with Python

1 Like