# Any automation on UPROPERTY and other UHT-related code?

**URL:** <https://forums.unrealengine.com/t/any-automation-on-uproperty-and-other-uht-related-code/150205>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [September 3, 2020, 11:25pm UTC](https://forums.unrealengine.com/t/any-automation-on-uproperty-and-other-uht-related-code/150205 "2020-09-03T23:25:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![GribUser](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GribUser](https://forums.unrealengine.com/u/GribUser)\
**Post date:** [September 3, 2020, 11:25pm UTC](https://forums.unrealengine.com/t/any-automation-on-uproperty-and-other-uht-related-code/150205/1 "2020-09-03T23:25:15Z")

</div>

At some point (already at two points, in my case) you start to realize you want to create UPROPERTY-s and other UHT-related stuff from macro/template/etc. The problem is UHT happens before C++ preprocessing, so you can’t use the latter. At the same time UHT itself does not seem to provide any functionality, that will allow you (for example) to write

```auto

UPROP(int, ParamName)

```

and get

```auto

UPROPERTY(EditAnywhere, BlueprintSetter = SetParamName, BlueprintGetter = GetParamName)
int ParamName;
UFUNCTION(BlueprintSetter)
void SetParamName(int In);
UFUNCTION(BlueprintGetter)
int GetParamName();

```

(that’s just a basic example of the idea)

This question comes up again and again, I can easilly google  
[ttps://answers.unrealengine.com/que…t-working.html  
https://answers.unrealengine.com/questions/45608/view.html](https://answers.unrealengine.com/questions/600163/wrapping-uproperty-with-macro-not-working.html)  
and the like.

Any solutions are out there, or do I have to write my own WhellInventerHeaderMegatool and integrate it into the build process. I want to make the computer do the boring copy-paste stuff, really.

(And why, oh why C++ preprocessing executed **after** UHT, not **before** , hm…?)

---

<div class="post-metadata">

**Author:** ![Jambax](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jambax/32/904177_2.png) [@Jambax](https://forums.unrealengine.com/u/Jambax)\
**Post date:** [September 4, 2020, 8:06am UTC](https://forums.unrealengine.com/t/any-automation-on-uproperty-and-other-uht-related-code/150205/2 "2020-09-04T08:06:57Z")

</div>

> [@GribUser](#):
>
> (And why, oh why C++ preprocessing executed **after** UHT, not **before** , hm…?)

It has to, UHT generates all the extra code that makes the UE4 macros have any body. If it didn’t run first, nothing would compile. That said, UHT is a code generating tool and not a complex parsing program. It’s not capable of parsing even typedefs, let alone complex macros - and likely never will be.

This question has indeed come up before, but that’s as far as it’s ever got.

---

<div class="post-metadata">

**Author:** ![dzemzmcdonalda](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dzemzmcdonalda/32/1214680_2.png) [@dzemzmcdonalda](https://forums.unrealengine.com/u/dzemzmcdonalda)\
**Post date:** [November 19, 2022, 4:48pm UTC](https://forums.unrealengine.com/t/any-automation-on-uproperty-and-other-uht-related-code/150205/3 "2022-11-19T16:48:52Z")

</div>

Bump to this question.

@GribUser Have You figured out the solution for this topic? Preferably, without editing the Engine’s source.

> [@GribUser](#):
>
> have to write my own WhellInventerHeaderMegatool and integrate it into the build process

(also, relates to: [How to avoid the repetition of UFUNCTION / UPROPERTY declarations ?](https://forums.unrealengine.com/t/how-to-avoid-the-repetition-of-ufunction-uproperty-declarations/675504) )

---

<div class="post-metadata">

**Author:** ![GribUser](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GribUser](https://forums.unrealengine.com/u/GribUser)\
**Post date:** [November 19, 2022, 7:06pm UTC](https://forums.unrealengine.com/t/any-automation-on-uproperty-and-other-uht-related-code/150205/4 "2022-11-19T19:06:13Z")

</div>

Without hacking UE it was 100% impossiblу up untill now, as far as I get it. In the release notes for 5.1 I’ve seen some **very** promising note of the “ **Unreal Header Tool** (UHT) has been rewritten using C# and integrates directly with the Unreal Build Tool.” [Unreal Engine 5.1 Release Notes | Unreal Engine 5.1 Documentation](https://docs.unrealengine.com/5.1/en-US/unreal-engine-5.1-release-notes/)

That should do the trick, but I haven’t looked into this as yet. Hopefully someone had.

---

<div class="post-metadata">

**Author:** ![Fedotich](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Fedotich](https://forums.unrealengine.com/u/Fedotich)\
**Post date:** [April 11, 2025, 12:19pm UTC](https://forums.unrealengine.com/t/any-automation-on-uproperty-and-other-uht-related-code/150205/5 "2025-04-11T12:19:47Z")

</div>

Hey, it’s been a long time since last reply, but has anything changed since then?

---

<div class="post-metadata">

**Author:** ![MagForceSeven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/magforceseven/32/906563_2.png) [@MagForceSeven](https://forums.unrealengine.com/u/MagForceSeven)\
**Post date:** [April 11, 2025, 1:58pm UTC](https://forums.unrealengine.com/t/any-automation-on-uproperty-and-other-uht-related-code/150205/6 "2025-04-11T13:58:06Z")

</div>

Nope.
