From 5593350f8426880204232e691f50e9a7fe97e624 Mon Sep 17 00:00:00 2001 From: guthadam Date: Tue, 27 Apr 2021 17:12:42 -0500 Subject: [PATCH] ATOM-15372 Restoring material browser filter logic Restoring material browser filter logic to only show folders with content that matches the filter. This change was originally introduced with the functionality to create a new folder within the material browser. Creating a new, empty folder would not display the folder in the browser because it did not have any content that matched the filter. While that makes sense to address the issue with the create folder command, it makes it extremely difficult and navigate the browser to find assets that match the filter because every folder that does not match the filter is also displayed in the tree. We can revisit issues with the create folder action later. https://jira.agscollab.com/browse/ATOM-15372 --- .../Code/Source/Window/MaterialBrowserWidget.cpp | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialBrowserWidget.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialBrowserWidget.cpp index 0dec1c6d23..3c4134b7e0 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialBrowserWidget.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialBrowserWidget.cpp @@ -110,30 +110,19 @@ namespace MaterialEditor { using namespace AzToolsFramework::AssetBrowser; - // Material Browser uses the following filters: - // 1. [All source files (no products) that contain products matching the assetType specified by searchWidget (default is materials and textures)] - // 2. [All folders (including empty folders)] - // 3. [All Sources and folders matching the search text typed in search widget] - // Final filter = ((1 OR 2) AND 3) - QSharedPointer sourceFilter(new EntryTypeFilter); sourceFilter->SetEntryType(AssetBrowserEntry::AssetEntryType::Source); - QSharedPointer assetTypeFilter(new CompositeFilter(CompositeFilter::LogicOperatorType::AND)); - assetTypeFilter->AddFilter(sourceFilter); - assetTypeFilter->AddFilter(m_ui->m_searchWidget->GetTypesFilter()); - QSharedPointer folderFilter(new EntryTypeFilter); folderFilter->SetEntryType(AssetBrowserEntry::AssetEntryType::Folder); QSharedPointer sourceOrFolderFilter(new CompositeFilter(CompositeFilter::LogicOperatorType::OR)); - sourceOrFolderFilter->AddFilter(assetTypeFilter); + sourceOrFolderFilter->AddFilter(sourceFilter); sourceOrFolderFilter->AddFilter(folderFilter); QSharedPointer finalFilter(new CompositeFilter(CompositeFilter::LogicOperatorType::AND)); finalFilter->AddFilter(sourceOrFolderFilter); - finalFilter->AddFilter(m_ui->m_searchWidget->GetStringFilter()); - finalFilter->SetFilterPropagation(AssetBrowserEntryFilter::PropagateDirection::Down); + finalFilter->AddFilter(m_ui->m_searchWidget->GetFilter()); return finalFilter; }