For example say we have a JSON file:
[{
"enumValue" : 1,
"Name" : "2"
}, {
"enumValue" : 2,
"Name" : "3"
}, {
"enumValue" : 4,
"Name" : "4",
}]
And a C++ Enum
UENUM(BlueprintType)
enum class EMyNiceEnum: uint8
{
Unknown = 0x0,
VeryNiceValue= 0x1,
NiceValue= 0x2,
NotSoNiceValue= 0x4
};
And a struct for dataasset:
USTRUCT(BlueprintType)
struct SOMEPROJECT_API FMyNiceData : public FTableRowBase
{
GENERATED_USTRUCT_BODY()
public:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = PlayerClasses)
EMyNiceEnum EnumValue;
In UE4.17 importing that json worked fine. In UE4.18 during import we’re getting warnings like:
LogEnum: Warning: In asset 'None', there is an enum property of type 'EMyNiceEnum' with an invalid value of '1.0'
, and all values in imported asset are “Unknown”.
If we change values from numbers to strings like “enumValue” : “NiceValue”, everything works fine, but we rely heavily on being able to import enums by values as it was in UE4.17 and backwards.
Please provide a fix, or enlight us on how to import enums by numbers with 4.18, as current situation rises a high disturbance of the Force in our heads.
Thank you.