Hallo,
for an EditorUrility plugin, I want to show a filtered Assetpicker.
But as soon as I add something to FARFilter.PackagePaths the picker stops showing anything.
When I dont’t touch PackagePaths and only set ClassPaths it’s all working fine. I can even switch or add ClassPaths in Runtime. I have no idea what’s wrong.
Here is my main snippet
TSharedRef<SWidget> UDynamicAssetPickerWidget::RebuildWidget()
{
FAssetPickerConfig AssetPickerConfig;
FARFilter ConfigFilter;
AssetPickerConfig.InitialAssetViewType = EAssetViewType::List;
AssetPickerConfig.bAllowNullSelection = false;
AssetPickerConfig.bFocusSearchBoxWhenOpened = false;
ConfigFilter.Clear(); //DEBUG should not be necessary
ConfigFilter.bRecursivePaths = true;
ConfigFilter.bRecursiveClasses = true;
ConfigFilter.ClassPaths.Empty(); //start fresh
ConfigFilter.ClassPaths.AddUnique(FTopLevelAssetPath(FilterClass->GetPathName()));
AssetPickerConfig.Filter.PackagePaths.Empty(); //reset paths array
ConfigFilter.PackagePaths.AddUnique(FName("/Game")); //"/Game/subfolder" doesn't work either
ParentSBox = SNew(SBox);
FContentBrowserModule& ContentBrowserModule = FModuleManager::LoadModuleChecked<FContentBrowserModule>("ContentBrowser");
ParentSBox->SetContent(ContentBrowserModule.Get().CreateAssetPicker(AssetPickerConfig)); //wrap it
return ParentSBox.ToSharedRef();
}
I’ve tried to use the same filter with the asset registry, to check if the filter is correct, folders are cached and the assets are ready. But this is working fine and prints the correct assets.
AssetRegistryModule.Get().GetAssets(ConfigFilter, AssetData);
for (auto& D : AssetData)
{
UE_LOG(LogTemp, Warning, TEXT("Registry found: %s"), *D.PackageName.ToString());
}
I’m running 5.6.1 from Epic Launcher