UENUM() differs form Enumeration created in assets

I have a class setup, which accepts enum type as a property value. Like

UPROPERTY()
class UEnum* EnumClass;

Made this for greater configurability of my class. Metaprogramming can not be enough, lol. And everything worked good, while I was using Enums created in Content Browser. But than I tried to put class of enum, declared in C++. And failed. Unreal Engine does not see these. That is kinda sad, because in everything other both enumerations looks and behave the same. Is there any workaround for this, or maybe epics can fix this situation somehow?

Hello Yata,

Could you please explain in a bit greater detail what you were trying to accomplish, and what the issue was that you were experiencing?

How were you trying to use the Enum that you declared in your code?

78927-untitled.png

Here, this three enums are Enumerations declared in Content Browser, what I wanted is to see there my c++ defined Enums as well. As I understudd all enums a wrapped into UEnum classes at some point of build process.

I suggest making sure that your Enum has the BlueprintReadOnly tag so that you can ensure that it can be read in blueprints.

If this does not change anything, could you please provide the full code class(es) that you are using to set this up?

Eh, Unknown enum specifier ‘BlueprintReadOnly’

My field is declared that way

public:
UPROPERTY(Category = “State Machine”, EditAnywhere, BlueprintReadOnly)
TSubclassOf StateEnumClass;

My enum is declared that way:

UENUM(BlueprintType)
enum class EGameInstanceStatesEnum : uint8
{
GISE_Initilize UMETA(DisplayName = “Initilize”),
GISE_MainMenu UMETA(DisplayName = “MainMenu”),
GISE_Racing UMETA(DisplayName = “Racing”),
GISE_Editor UMETA(DisplayName = “Editor”),
GISE_Shutdown UMETA(DisplayName = “Shutdown”),
};

Field declaration.

public:
	UPROPERTY(Category = "State Machine", EditAnywhere, BlueprintReadOnly)
	TSubclassOf<UEnum> StateEnumClass;

Enum:

UENUM(BlueprintType)
enum class EGameInstanceStatesEnum : uint8
{
	GISE_Initilize              UMETA(DisplayName = "Initilize"),
	GISE_MainMenu               UMETA(DisplayName = "MainMenu"),
	GISE_Racing                 UMETA(DisplayName = "Racing"),
	GISE_Editor                 UMETA(DisplayName = "Editor"),
	GISE_Shutdown               UMETA(DisplayName = "Shutdown"),
};

Added code to an answer of this question, cause all markup was eated.

Sorry, for misleading I am using

class UEnum* StateEnumClass;

not a

TSubclassOf<UEnum> StateEnumClass;

Though I think it is not possible to use TSubclassOf with UEnum

I have reproduced the issue that you are experiencing. After some additional investigation, I will report back with my findings as soon as possible.

Hello,

I have reproduced your issue, and have entered a bug report (UE-27360). I will provide updates on this issue as they become available. Thank you for your report.

Have a great day

Hi, Sean. Is there any progress on that bug?

Here’s the link to the public tracker: Unreal Engine Issues and Bug Tracker (UE-27360)