Bitmask Warning Spam

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

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:

	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:

 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?

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

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

enum class ESomeBitmask : int32

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

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

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

I have effectively that in OP
declaring bitmask:

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

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

#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

	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.

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.

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)

[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

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