Generically list Properties of a UObject
Hi, I am looking for a way to generically list the members (UProperties if needed) of a class. I know I can access them by name with FindPropertyByName, which I think is super usefull. Now I am looking for a way to get the names of the members generically.
I would for example have a TArray with instances of a baseclass in it. I would then iterate over the instances and ask for members of the subclasses. I know that I could achive that with a virutal method (and GetNativePropertyValues is kind of that), I just want to know if there already is something I could use. GetNativePropertyValues kind of fits, but it does more then I want and I'd need to implement that for each subclass, which would be nice to avoid. Although of course not a real problem if I have to. Building on that, I would also like to filter the Properties based on a UProperty modifier.
asked Nov 28 '16 at 05:39 PM in C++ Programming
You can grab and even filter UProperties of a class using TFieldIterator. UField is most lowest reflection system class, which included UFunction, UProperty, UClass etc so you can use it not just for properties but also functions
You can use it like this:
You don't need to make array you can do somethng with properties stright away
Follow this question
Once you sign in you will be able to subscribe for any updates here