Restricting a class picker to only pick Blueprint classes

I have an editable property defined like this:


UPROPERTY(editanywhere, category="Filter")
TArray<TSoftClassPtr<class AActor>> WorldActorClasses;

I want to restrict it so that it would only allow Blueprint classes to be selected (so that the list is not cluttered with a ton of native classes)

I found a metadata specifier “BlueprintBaseOnly” which seems to be intended to do something like I want:
https://docs.unrealengine.com/en-US/…dataspecifiers

But when I tried to use it on my property it didn’t work…


UPROPERTY(editanywhere, category="Filter", meta=(blueprintbaseonly))
TArray<TSoftClassPtr<class AActor>> WorldActorClasses;

I am using UE-4.23

1 Like

Something like this worked for me:



UPROPERTY(Category="Screen", EditAnywhere, BlueprintReadWrite, meta=(DisplayName="Splash", AllowedClasses="FileMediaSource"))
    FSoftObjectPath SplashMovie;


[USER=“434”]BrUnO XaVIeR[/USER]
Will that restrict it only to a subset of a certain class?

My idea was to allow any Actor as long as the class is a Blueprint class, not a native class defined in C++.

The reason for this is the fact that 99% of time the property I am creating will be filled with Blueprint classes, and in 1% of time an empty Blueprint class can be created to put it there :slight_smile:

So I just wanted to remove the ton of engine-defined Actors from the picker.

Besides creating your own picker class and using it as override to display a custom struct with that picker class in Details Panel, I don’t know if that’s possible by default.

[USER=“434”]BrUnO XaVIeR[/USER]

Ok, thanks for the info!