Update - So the above example is trying to access an unreal.Enum type, and this is an enum type that is generated if you create a prototype blueprint enum, then reference that blueprint to establish an enum variable in another blueprint. Looking at the C++ code for this Enum type, there are a number of important member functions that are not exposed to Python as of UE v4.24 (correct me if I’m wrong), so I feel like this is a dead-end for now.
However, I believe that that vast majority, if not all, enums already existing in Unreal’s native blueprints - which are based on C++ classes - are derived from unreal.EnumBase, and that’s much easier to read and set through Python. Since I can’t find much on Google regarding how to access this enums, I’ll post a couple of snippets to help anyone get started who needs to read or set these EnumBase derived variables through Python.
First we’ll get an actor object by selecting a pawn (or pawn derived object) in the content browser and running this.
selected_actor = get_selected_content_browser_items()
bgc_asset = unreal.load_object(None, selected_actor.get_path_name() + '_C')
actor = unreal.get_default_object(bgc_asset)
Get the enum’s set string value
enum = actor.get_editor_property('AutoPossessAI')
enum_sel_str = enum.name
print('Enum string value: %s' % enum_sel_str)
# Enum string value: PLACED_IN_WORLD
To get its selected index you would just use this instead
enum_sel_index = enum.value
And to set the enum value
auto_possess_player = actor.get_editor_property("auto_possess_player")