Check if an asset is of class BP Function Library?

I want to do some name prefix checks on assets and came across this strange behaviour:

When I check a Blueprint Function Library asset it returns Blueprint as class instead of the expected BlueprintFunctionLibrary.
Even though the BP editor and also the browser details show the correct (parent) class…

How can I check if an asset is a BP Function Library?

Edit: Same for BPInterfaces and MacroLibraries.


All blueprint assets are of class UBlueprint, they are containers that contain editor information about Graphs and stuff, and then they also contain the generated class and CDO which are the equivalent of C++'s UClass and GetDefaultObject.

So blueprints are a special type of Asset for which you have to dig further in order to figure out the actual class or parent class of the underlying object. Those can be retrieved using Asset Tags, which is what the browser tooltip shows.

In short, for code classes, the fields ParentClass, NativeParentClass, and BlueprintType that you see are just asset tags slapped on top of the Asset which is always a container of class UBlueprint.

I don’t know where your IsAsset object comes from, but you probably had an Asset Data Structure at some point. You should be able to do what you want with the AssetData structure alone, without having to actually load the assets in memory. From AssetData you can get the asset class (UTexture, UStaticMesh, USoundWave, UBlueprint…), then you can further differentiate blueprints by retrieving their tags.

Try this and see what you can get :

1 Like

Thanks a lot for the detailed answer!

The asset is used in a data validator, so it is loaded anyway :wink: