I want to check if each Uroperty on a UObject has the Class Default value.
Does anyone know How I can do that?
I do believe you can use GetClass()->GetDefaultObject()
and compare there.
Thanks for your reply. I already knew I could get get the default Object. However I dont know how to compare the value of two UProperties in a generic way.
FProperty has a (pure) virtual Identical
member function to compare values (if you have the addresses of the two corresponding property values). The function is implemented in the concrete property types. There’s also Identical_InContainer
that you can directly pass UObjects to. https://github.com/EpicGames/UnrealEngine/blob/46544fa5e0aa9e6740c19b44b0628b72e7bbd5ce/Engine/Source/Runtime/CoreUObject/Public/UObject/UnrealType.h#L351
1 Like