Hi Guys,
I am making quite heavy use of the reflection system in the engine. I am successfully iterating over floats, bools and ints using
for (TFieldIterator<UIntProperty> it(module->GetClass()); it; ++it)
for example. I thought I could achive the same thing for enums using
for (TFieldIterator<UEnum> it(this->GetClass()); it; ++it)
however, this simply does not work for me. The iterator doesnt hit my enum, which is defined like this:
UENUM()
enum class ETestEnum : uint8{
A1,
A2,
A3
};
I declared the property like this
UPROPERTY(EditAnywhere)
ETestEnum TestEnum = ETestEnum::A1;
and this
UPROPERTY(EditAnywhere)
TEnumAsByte<ETestEnum> TestEnum = ETestEnum::A1;
neither worked.
Some Context:
What I want to achive in the end, is to display combo boxes for arbritary enums classes, that are members of arbitrary objects, and modify the enum value in the object based on the combo box.
My Approach right now is to find every enum property of an object, find the names for all enum values of these enums, and display a comboBox with them in it. I can’t really do this in blueprint, since I am working with pointers here.
I am basically trying to copy the functionality of the “ForEach EnumType” Blueprint Node in C++, but with a “EnumType” input instead of hard coded.
I would really appreciate your help!
Simon