# Bitmask Warning Spam

**URL:** <https://forums.unrealengine.com/t/bitmask-warning-spam/1194637>\
**Category:** C++\
**Tags:** unreal-engine, question, CPP\
**Created:** [June 10, 2023, 6:04am UTC](https://forums.unrealengine.com/t/bitmask-warning-spam/1194637 "2023-06-10T06:04:02Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![gardian206](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@gardian206](https://forums.unrealengine.com/u/gardian206)\
**Post date:** [June 10, 2023, 6:04am UTC](https://forums.unrealengine.com/t/bitmask-warning-spam/1194637/1 "2023-06-10T06:04:02Z")

</div>

I currently want my struct to hold 2 bitmask enums declared as

```auto
UENUM(BlueprintType, meta = (Bitflags, UseEnumValuesAsMaskValuesInEditor = "true"))
enum class EScaleIncreaseAt : uint8
{
	NONE = 0 UMETA(Hidden),
	At2 = 1 << 0, At3 = 1 << 1, At4 = 1 << 2, At5 = 1 << 3,
	At6 = 1 << 4, At7 = 1 << 5, At8 = 1 << 6, At9 = 1 << 7
};
ENUM_CLASS_FLAGS(EScaleIncreaseAt);

UENUM(BlueprintType, meta = (bitflags, UseEnumValuesAsMaskValuesInEditor = "true"))
enum class EModEffects : uint8
{
	NONE = 0 UMETA(Hidden), TYPE1= 1 << 0, TYPE2 = 1 << 1,
	TYPE3 = 1 << 2, TYPE4 = 1 << 3, TYPE5 = 1 << 4,
};
ENUM_CLASS_FLAGS(EModEffects);

```

(appearently you can’t use int32 as a bitmask type even though the holding variable can be int32… and the other 24 bits could be useful in some situations)  
I include the file for the enums to be defined in the struct, and in the struct I have declared:

```auto
	UPROPERTY(EditDefaultsOnly, meta = (Bitmask, BitmaskEnum = EScaleIncreaseAt))
	int32 ScalingMask;
	UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, meta = (Bitmask, BitmaskEnum = EModEffects))
	int32 ModificationType;

```

this all works as expected, but when I look at the output log I am being blasted with:

```auto
 Warning: Short type name "EScaleIncreaseAt" provided for TryFindType. Please convert it to a path name (suggested: "/Script/[ProjectName].EScaleIncreaseAt"). Callstack:
UnknownFunction [] // X10
// then 
Warning: Short type name "EModEffects" provided for TryFindType. Please convert it to a path name (suggested: "/Script/[ProjectName].EModEffects"). Callstack:
UnknownFunction [] // X10

```

just opening a blueprint that holds one of these structs for a few seconds puts 1,100 instances of “TryFindType” into the log file (that would be 550 for each variable).  
the only information on this is about using a bitmask as an argument (I have the same UMETA arguments just as the variable mark-up) just holding them is flooding the log with warnings. can’t wait to hold 5-30 of these structs, how useful the log will be.

am I missing something for declaring the bitmask enum itself, or declaring the variable that will use it?

---

<div class="post-metadata">

**Author:** ![ugmoe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ugmoe](https://forums.unrealengine.com/u/ugmoe)\
**Post date:** [June 10, 2023, 7:41am UTC](https://forums.unrealengine.com/t/bitmask-warning-spam/1194637/2 "2023-06-10T07:41:43Z")

</div>

your enum is declared to be unsigned 8 bits, but your variable is signed 32 bit. They have to be the same

---

<div class="post-metadata">

**Author:** ![gardian206](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@gardian206](https://forums.unrealengine.com/u/gardian206)\
**Post date:** [June 10, 2023, 7:45am UTC](https://forums.unrealengine.com/t/bitmask-warning-spam/1194637/3 "2023-06-10T07:45:55Z")

</div>

changing both ScalingMask, and Modificationtype to uint8 still produces the same amount of warning spam, all that matters is that they are of an integer Blueprint type (uint8, or int32)  
in some cases I would like to do

```auto
enum class ESomeBitmask : int32

```

but this fails to build. even though in blueprints you can declare an int32 as a bitmask enum

---

<div class="post-metadata">

**Author:** ![ugmoe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ugmoe](https://forums.unrealengine.com/u/ugmoe)\
**Post date:** [June 10, 2023, 7:53am UTC](https://forums.unrealengine.com/t/bitmask-warning-spam/1194637/4 "2023-06-10T07:53:58Z")

</div>

in the engine, they put a macro in between like this :

```auto
UENUM(BlueprintType, meta = (Bitflags, UseEnumValuesAsMaskValuesInEditor = "true"))
enum class ETargetUsageFlags : uint8
{
	USAGE_None = 0x00,
	USAGE_Input = 1<<0,
	USAGE_Transform = 1<<1,
	USAGE_Output = 1<<2,
	USAGE_Persistent = 1<<5,

	// If a pass is tagged 'intermediate' it is still available to the pass immediately 
	// after it. So we ping-pong between intermediate tags, clearing the older one.
	USAGE_Intermediate0 = 1<<3 UMETA(Hidden),
	USAGE_Intermediate1 = 1<<4 UMETA(Hidden),
};

ENUM_CLASS_FLAGS(ETargetUsageFlags);

UPROPERTY(/*BlueprintReadWrite, Category = "Composure",*/ meta = (Bitmask, BitmaskEnum = ETargetUsageFlags))
	int32 FreezeFrameMask = 0x00;

```

i have to go to bed now, wont be able to help more until tomorrow, sorry

---

<div class="post-metadata">

**Author:** ![gardian206](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@gardian206](https://forums.unrealengine.com/u/gardian206)\
**Post date:** [June 10, 2023, 8:55am UTC](https://forums.unrealengine.com/t/bitmask-warning-spam/1194637/5 "2023-06-10T08:55:04Z")

</div>

I have effectively that in OP  
declaring bitmask:

```auto
UENUM(BlueprintType, meta = (Bitflags, UseEnumValuesAsMaskValuesInEditor = "true"))
enum class EScaleIncreaseAt : uint8
{
	NONE = 0 UMETA(Hidden), // same as 0x00 just representation
	At2 = 1 << 0, At3 = 1 << 1, At4 = 1 << 2, At5 = 1 << 3,
	At6 = 1 << 4, At7 = 1 << 5, At8 = 1 << 6, At9 = 1 << 7
};
ENUM_CLASS_FLAGS(EScaleIncreaseAt);

```

declaring variable

```auto
UPROPERTY(EditDefaultsOnly, meta = (Bitmask, BitmaskEnum = EScaleIncreaseAt))
uint8 ScalingMask; 

```

the only notable difference is that they removed the access specifier /_BlueprintReadWrite_/ (it does stop the warning spam), but if I remove the access specifier then I can no longer modify it. the entire reason I wanted to use a bitmask was as a manageable array of booleans.  
the bitmask behaves mostly as intended/expected (have not tested if the offset issue still exists, and I need to accommodate for it) as I can see and modify it in the blueprint, but then floods the log with Warnings making the log almost unusable whenever a blueprint holding it is opened.

example:  
create New C++ Class (inheritance=None, name=GameItem, then remove GameItem.Cpp from solution, and delete GameItem.cpp in explorer)  
GameItem.h

```auto
#pragma once

#include "CoreMinimal.h"
#include "GameItem.generated.h"

UENUM(BlueprintType, meta = (Bitflags, UseEnumValuesAsMaskValuesInEditor = "true"))
enum class EScaleIncreaseAt : uint8
{
	NONE = 0 UMETA(Hidden),
	At2 = 1 << 0, At3 = 1 << 1, At4 = 1 << 2, At5 = 1 << 3,
	At6 = 1 << 4, At7 = 1 << 5, At8 = 1 << 6, At9 = 1 << 7
};
ENUM_CLASS_FLAGS(EScaleIncreaseAt);

USTRUCT(BlueprintType)
struct FGameItem
{
	GENERATED_BODY()
public:
	UPROPERTY(EditDefaultsOnly, meta = (Bitmask, BitmaskEnum = EScaleIncreaseAt))
	uint8 ScalingMask;
};

```

then give the struct to an Actor or ActorComponent with

```auto
	UPROPERTY(EditAnywhere, Category=Things)
	FGameItem GameItem;

```

create blueprint from the class you gave it to  
open that blueprint  
look at the output log.  
hit drop down to expand the Struct in the blueprint for added effect.

---

<div class="post-metadata">

**Author:** ![UnrealEverything](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@UnrealEverything](https://forums.unrealengine.com/u/UnrealEverything)\
**Post date:** [June 10, 2023, 9:37am UTC](https://forums.unrealengine.com/t/bitmask-warning-spam/1194637/6 "2023-06-10T09:37:50Z")

</div>

You probably just need to do what the warning tells you. Instead of  
`UPROPERTY(EditDefaultsOnly, meta = (Bitmask, BitmaskEnum = EScaleIncreaseAt))` it should be `UPROPERTY(EditDefaultsOnly, meta = (Bitmask, BitmaskEnum = "/Script/[ProjectName].EScaleIncreaseAt"))`. I had to update a bunch of places like this during migration from 4.26 to 5.2, metadata like `HasNativeMake`/`HasNativeBreak` was also affected. Are you sure these are 1,100 instances of the same type? I don’t remember having any duplicates during migration.

---

<div class="post-metadata">

**Author:** ![gardian206](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@gardian206](https://forums.unrealengine.com/u/gardian206)\
**Post date:** [June 10, 2023, 5:29pm UTC](https://forums.unrealengine.com/t/bitmask-warning-spam/1194637/7 "2023-06-10T17:29:34Z")

</div>

from just making this one example:  
I will Greatly Trim the log down you can run the example if you want the full spam.  
blueprint held 1 instance of the bitmask, stuct was expanded for a little over 25 seconds, generating 1460 duplicates of the same warning, which is roughly equivalent to half Editor Tick (on my system for an empty project 100-120 Ticks Per second)

```auto
[2023.06.10-08.51.18:093][634]LogClass: Warning: Short type name "EScaleIncreaseAt" provided for TryFindType. Please convert it to a path name (suggested: "/Script/RefCrashTest.EScaleIncreaseAt"). Callstack:

UnknownFunction [] // X10 of these

[2023.06.10-08.51.29:610][899]LogClass: Warning: Short type name "EScaleIncreaseAt" provided for TryFindType. Please convert it to a path name (suggested: "/Script/RefCrashTest.EScaleIncreaseAt"). Callstack:

UnknownFunction [] // X10 of these

[2023.06.10-08.51.29:617][899]LogClass: Warning: Short type name "EScaleIncreaseAt" provided for TryFindType. Please convert it to a path name (suggested: "/Script/RefCrashTest.EScaleIncreaseAt"). Callstack:

UnknownFunction [] // X10 of these

[2023.06.10-08.51.29:628][900]LogClass: Warning: Short type name "EScaleIncreaseAt" provided for TryFindType. Please convert it to a path name (suggested: "/Script/RefCrashTest.EScaleIncreaseAt"). Callstack:

UnknownFunction [] // X10 of these

...
[2023.06.10-08.51.54:006][325]LogClass: Warning: Short type name "EScaleIncreaseAt" provided for TryFindType. Please convert it to a path name (suggested: "/Script/RefCrashTest.EScaleIncreaseAt"). Callstack:

UnknownFunction [] // X10 of these

```

I have matched the official implementation, but added the ability to access the variable in editor/blueprints, and for that Audacity of wanting to be able to hold and edit the variable in the editor my log becomes unusable. that is what the `UMETA=( (Bitmask, BitmaskEnum = EScaleIncreaseAt)` is supposed to do,

“Portability between projects be damned just forcibly reference the reflection system” for the project creating a runtime issue through UMETA string resolution

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [July 10, 2023, 5:30pm UTC](https://forums.unrealengine.com/t/bitmask-warning-spam/1194637/8 "2023-07-10T17:30:00Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
