Define custom macros containing UE macros(UPROPERTY)

Hi everyone, I’m working on a UClass declaration who has groups of UProperties with the same but very long format. So I want to replace a group of UProperty with a macro like:

#define MY_MACRO(Name)
Uproperty(many settings…)
float Name##SomeSuffix ;
Uproperty(many settings…)
float Name##SomeSuffix2;

But it doesn’t work :sob:
I’m not sure how to do it or is that a good way. Could anyone give me some suggestion

I don’t think that’s possible unfortunatelly, the UPROPERTY macro doesn’t actually do anything with the C++ code, it’s just an empty macro with a variable argument list. The Unreal Header Tool (UHT) parses the code before it is compiled and looks for the exact pattern of UPROPERTY(…), you can’t wrap it in another macro because the UHT won’t recognize it anymore. UHT could provide functionality to solve this issue, but I am not aware of any such feature.

Yes It seems impossible. The UPROPERTY is not designed to be use like that. I changed to USTRUCT instead. Thank you for reply! :sparkling_heart: