Material: MaterialTreeWidget usability enhancements

Improves the MaterialTreeWidget beyond minimum viable product.

- Filters can now be filter lists to allow a variety of filtering
	options.
- User preferences allow the inclusion/exclusion of favorites and
	recents.
- Widget state such as expansion, tree expansions, etc are saved and
	restored.
- show current appearancee material when editing.
- implements a python interface

#fixes 13421: always opens full tree
This commit is contained in:
David Carter
2024-04-16 14:40:24 -04:00
committed by Chris Hennes
parent 9101454c4d
commit 9f43b0ff76
21 changed files with 1051 additions and 165 deletions

View File

@@ -41,6 +41,7 @@ namespace Materials
class Material;
class MaterialManager;
class MaterialFilter;
class MaterialFilterOptions;
class MaterialsExport MaterialLibrary: public LibraryBase,
public std::enable_shared_from_this<MaterialLibrary>
@@ -79,7 +80,8 @@ public:
std::shared_ptr<Material> addMaterial(const std::shared_ptr<Material>& material,
const QString& path);
std::shared_ptr<std::map<QString, std::shared_ptr<MaterialTreeNode>>>
getMaterialTree(const std::shared_ptr<Materials::MaterialFilter>& filter) const;
getMaterialTree(const std::shared_ptr<Materials::MaterialFilter>& filter,
const Materials::MaterialFilterOptions& options) const;
bool isReadOnly() const
{
@@ -99,7 +101,8 @@ protected:
void updatePaths(const QString& oldPath, const QString& newPath);
QString getUUIDFromPath(const QString& path) const;
bool materialInTree(const std::shared_ptr<Material>& material,
const std::shared_ptr<Materials::MaterialFilter>& filter) const;
const std::shared_ptr<Materials::MaterialFilter>& filter,
const Materials::MaterialFilterOptions& options) const;
bool _readOnly;
std::unique_ptr<std::map<QString, std::shared_ptr<Material>>> _materialPathMap;