Is this just a UBT bug? I’m getting
TEnumAsByte is not intended for use with enum classes - please derive your enum class from uint8 instead.
note: see declaration of 'TEnumAsByte_EnumClass<true>
note: see reference to class template instantiation 'TEnumAsByte<EFNCellularReturnType>' being compiled
However, my code is as follows:
UENUM(BlueprintType)
enum class EFNCellularReturnType : uint8
{
CellValue UMETA(DisplayName="CellValue"),
NoiseLookup UMETA(DisplayName="NoiseLookup"),
Distance UMETA(DisplayName="Distance"),
Distance2 UMETA(DisplayName="Distance2"),
Distance2Add UMETA(DisplayName="Distance2Add"),
Distance2Sub UMETA(DisplayName="Distance2Sub"),
Distance2Mul UMETA(DisplayName="Distance2Mul"),
Distance2Div UMETA(DisplayName="Distance2Div")
};
Functions
UFUNCTION(BlueprintCallable, meta = (DisplayName = "SetCellularReturnType", Keywords = ""), Category = "FastNoise")
void K2_SetCellularReturnType(TEnumAsByte<EFNCellularReturnType> cellularReturnType) { SetCellularReturnType(cellularReturnType); }
UFUNCTION(BlueprintCallable, meta = (DisplayName = "GetCellularReturnType", Keywords = ""), Category = "FastNoise")
TEnumAsByte<EFNCellularReturnType> K2_GetCellularReturnType() const { return GetCellularReturnType(); }
I have 4 other enums in the same format.
UENUM(BlueprintType)
enum class EFNNoiseType : uint8
{
Value UMETA(DisplayName="Value"),
ValueFractal UMETA(DisplayName="ValueFractal"),
Perlin UMETA(DisplayName="Perlin"),
PerlinFractal UMETA(DisplayName="PerlinFractal"),
Simplex UMETA(DisplayName="Simplex"),
SimplexFractal UMETA(DisplayName="SimplexFractal"),
Cellular UMETA(DisplayName="Cellular"),
WhiteNoise UMETA(DisplayName="WhiteNoise"),
Cubic UMETA(DisplayName="Cubic"),
CubicFractal UMETA(DisplayName="CubicFractal")
};
UENUM(BlueprintType)
enum class EFNInterp : uint8
{
Linear UMETA(DisplayName="Linear"),
Hermite UMETA(DisplayName="Hermite"),
Quintic UMETA(DisplayName="Quintic")
};
UENUM(BlueprintType)
enum class EFNFractalType : uint8
{
FBM UMETA(DisplayName="FBM"),
Billow UMETA(DisplayName="Billow"),
RigidMulti UMETA(DisplayName="RigidMulti")
};
UENUM(BlueprintType)
enum class EFNCellularDistanceFunction : uint8
{
Euclidean UMETA(DisplayName="Euclidean"),
Manhattan UMETA(DisplayName="Manhattan"),
Natural UMETA(DisplayName="Natural")
};
The generated header file seems to be where the warning originates. In the generated header of file that include the header that has the enums, it forward declares the enums as follows
enum class EFNCellularReturnType : uint8;
enum class EFNCellularDistanceFunction : uint8;
enum class EFNFractalType : uint8;
enum class EFNNoiseType : uint8;
enum class EFNInterp : uint8;
Here is te generated function calls which are generated in the same way as the rest of the enums
DECLARE_FUNCTION(execK2_GetCellularReturnType) \
{ \
P_FINISH; \
P_NATIVE_BEGIN; \
*(EFNCellularReturnType*)Z_Param__Result=this->K2_GetCellularReturnType(); \
P_NATIVE_END; \
} \
\
DECLARE_FUNCTION(execK2_SetCellularReturnType) \
{ \
P_GET_ENUM(EFNCellularReturnType,Z_Param_cellularReturnType); \
P_FINISH; \
P_NATIVE_BEGIN; \
this->K2_SetCellularReturnType(EFNCellularReturnType(Z_Param_cellularReturnType)); \
P_NATIVE_END; \
} \
The project still builds but this warning is driving me mad. If anyone can see something that I can’t, please let me know. If this is a bug, please let me know. I’ve spent far too long trying to rename it, change it’s values, rename it’s values, made it the first emun, put it in the middle. No matter what I do, it is always this enum mentioned in the warnings. Any help is much appreciated.