FARFilter Exclusion Set not filtering classes.

Hello,

So I’m having an issue with filtering classes with the asset registry FARFilter.

I want to exclude my object libraries from being included in the filter, but it is still including object libraries. The code compiles, and even prints the object library class to the log successfully, so it is being found.

I have all the includes I believe I need, and the filter is working, i just cannot get the exclude classes filter to work correctly.

My includes.


#include "Engine/ObjectLibrary.h"
#include "AssetRegistryModule.h"
#include "ARFilter.h"
#include "ModuleManager.h"

First I’m creating the FARFilter and setting bRecursiveClasses to true because according to the docs you need to do this for the recursive classes exclusion set to work.


FARFilter AssetRegistryFilter;
AssetRegistryFilter.bRecursiveClasses = true;

Then I add the object library class as a filter. (The object library is passed into this function and is valid).


AssetRegistryFilter.RecursiveClassesExclusionSet.Add(ObjectLibrary->GetClass());

Then I print the object library class to make sure it is finding the correct class.


UE_LOG(LogTemp, Warning, TEXT("class: %s"), *ObjectLibrary->GetClass()->GetFName().ToString());

But when I output all the found assets, the list still contains the object library.


AssetRegistryModule.Get().GetAssets(AssetRegistryFilter, FilteredAssetData);

As you can see the first log is the object library class, then rest is the filtered asset data which still contains object libraries. Any idea on what is going on, why is the object library not getting filtered out?