Can't static variables be defined in the blueprint function library class?

Unrecognized type ‘static’ - type must be a UCLASS, USTRUCT or UENUM

.h
USTRUCT(BlueprintType)
struct FVideoKey
{
	GENERATED_BODY()
public:
	UPROPERTY(BlueprintReadWrite, EditAnywhere)
		TMap<FGuid, FVideoParamSet> MapVideoKey;
};
/**
 * 
 */
UCLASS()
class VIDEOOPERATION_API UVideoOperationBFLibrary : public UBlueprintFunctionLibrary
{
	GENERATED_BODY()
public:
	UPROPERTY(BlueprintReadWrite, EditAnywhere)
	static FVideoKey VideoOperationData;
};

.cpp
FVideoKey UVideoOperationBFLibrary::VideoOperationData;

1 Like

This has nothing to do with Blueprint Function Libraries. You can’t markup static variables with UPROPERTY, anywhere.

You can add static variables to Blueprint Function Libraries (just like any other type) as long as it’s not a UPROPERTY.

2 Likes