Wrapping UPROPERTY with macro not working
I'm tired of following type of code in my actors
Makes the header unreadable. So I'm searching the way to define the group of properties using same parameters (better yet to be able to specify additional properties per field, but that's next step). My first step was to wrap UPROPERTY into macro, but I can't see the field in the details panel which kinda breaks the purpose.
What's wrong with UHT in this case?
asked May 14 '17 at 07:41 AM in C++ Programming
UPROPERTY() and other U"macros" are just dummies so they are ignored by C++ compiler, they just markers for UHT for code generation and it's not used in C++ compilation process at all. Because UHT is not C++ compiler by it self it does not follow C++ principles and ignores most content of the C++ files, UHT only has task to read those specific macros and interprate what is below it (name and type of property, function names and there arguments) and base on that generate extra code to register code elements to reflection system (in other word UHT is already saves a lot of work and code file space), which later is compiled when actual C++ compilation happens by the compiler.
Because of that any redefinitions of those macros are not even put in to consideration by UHT, in matter of fact those macros don't need to be defined at all for UHT, because as i said in begining the only reason why they defined in C++ is for compiler to ignore them instead of showing undenefied macro error.
What you trying to do would need to be implemented in UHT (either shortcuts that are you trying to do so UHT can read them or macro definition support) and my guess why no body did implement support for macro definition in UHT because
Follow this question
Once you sign in you will be able to subscribe for any updates here