UPROPERTY Redefines not working

Hi guys!

Here are the defines I’m trying to use:

#define PROP(CategoryIn)		UPROPERTY(EditAnywhere, Category = CategoryIn)
#define APROP(CategoryIn)		UPROPERTY(EditDefaultsOnly, Category = CategoryIn)
#define IPROP(CategoryIn)		UPROPERTY(EditInstanceOnly, Category = CategoryIn)
#define CPROP(CategoryIn)		UPROPERTY(VisibleAnywhere, Category = CategoryIn)
#define CAPROP(CategoryIn)		UPROPERTY(VisibleDefaultsOnly, Category = CategoryIn)
#define CIPROP(CategoryIn)		UPROPERTY(VisibleInstanceOnly, Category = CategoryIn)
#define BP_PROP(CategoryIn)	UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = CategoryIn)
#define BP_APROP(CategoryIn)	UPROPERTY(BlueprintReadWrite, EditDefaultsOnly, Category = CategoryIn)
#define BP_IPROP(CategoryIn)	UPROPERTY(BlueprintReadWrite, EditInstanceOnly, Category = CategoryIn)
#define BP_CPROP(CategoryIn)	UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = CategoryIn)
#define BP_CAPROP(CategoryIn)	UPROPERTY(BlueprintReadWrite, VisibleDefaultsOnly, Category = CategoryIn)
#define BP_CIPROP(CategoryIn)	UPROPERTY(BlueprintReadWrite, VisibleInstanceOnly, Category = CategoryIn)
#define CBP_PROP(CategoryIn)	UPROPERTY(BlueprintReadOnly, EditAnywhere, Category = CategoryIn)
#define CBP_APROP(CategoryIn)	UPROPERTY(BlueprintReadOnly, EditDefaultsOnly, Category = CategoryIn)
#define CBP_IPROP(CategoryIn)	UPROPERTY(BlueprintReadOnly, EditInstanceOnly, Category = CategoryIn)
#define CBP_CPROP(CategoryIn)	UPROPERTY(BlueprintReadOnly, VisibleAnywhere, Category = CategoryIn)
#define CBP_CAPROP(CategoryIn)	UPROPERTY(BlueprintReadOnly, VisibleDefaultsOnly, Category = CategoryIn)
#define CBP_CIPROP(CategoryIn)	UPROPERTY(BlueprintReadOnly, VisibleInstanceOnly, Category = CategoryIn)

However, when I declare CBP_CPROP(Camera) float BaseTurnRate; in my code, it does not show up under that category. Yet when I enter the UPROPERTY variant, it works just fine.

Any pointers on what could be wrong here? Thanks!

~

I tried this once with constructors. The #defines for UPROPERTY are actually completely ignored by the compiler. They are scanned for by the Unreal Header Tool which just reads the files verbatim with no preprocessing. You cannot do what you’re trying.

Shoot, that really sucks. It does make sense though, given the situation. Is there no way at all to abbreviate the UPROPERTY syntax? I want to be able to write properties on the fly, and having all this tedious extra code to write out is really a pain in the neck. Thanks for your input

I do a lot of copy/paste when writing headers. :confused:

Yeah… I came up with a good idea, though. I need to find a way to hook up some “macro” keys on my keyboard, to type out certain things. That way I can press a button to have it type out, say, “UPROPERTY”, and another button for “BlueprintReadOnly”, and so forth. The trick is finding a program that can do that for me. I’ve heard of one called AutoHotkey that might do the trick. I will look into it. Thanks for your answer!