30fee96c43
Renamed document related buses and components to have generic names Added a base document class with default implementation from which other application specific documents can be derived to work with the document system Added document factory function registration to the document system request bus so that each application can specify the type of document it creates Updated all comments and messaging to only refer to documents, not materials or material documents Updated material editor and shader management console to conform to the new buses This will provide a first pass of a common interface for a document management system that can be shared by multiple applications Corrected status bar message copy and paste errors Updated all test scripts to use the new buses Signed-off-by: Guthrie Adams <guthadam@amazon.com>
76 lines
2.2 KiB
C++
76 lines
2.2 KiB
C++
/*
|
|
* Copyright (c) Contributors to the Open 3D Engine Project.
|
|
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
|
*
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#if !defined(Q_MOC_RUN)
|
|
#include <AtomToolsFramework/Document/AtomToolsDocumentNotificationBus.h>
|
|
#include <AzCore/Component/TickBus.h>
|
|
#include <AzToolsFramework/AssetBrowser/AssetBrowserBus.h>
|
|
#include <AzToolsFramework/AssetBrowser/Entries/AssetBrowserEntry.h>
|
|
#include <AzToolsFramework/AssetBrowser/Search/Filter.h>
|
|
|
|
AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // disable warnings spawned by QT
|
|
#include <QByteArray>
|
|
#include <QWidget>
|
|
AZ_POP_DISABLE_WARNING
|
|
|
|
#endif
|
|
|
|
namespace AzToolsFramework
|
|
{
|
|
namespace AssetBrowser
|
|
{
|
|
class AssetBrowserFilterModel;
|
|
class CompositeFilter;
|
|
class AssetBrowserEntry;
|
|
class ProductAssetBrowserEntry;
|
|
class SourceAssetBrowserEntry;
|
|
}
|
|
}
|
|
|
|
namespace Ui
|
|
{
|
|
class MaterialBrowserWidget;
|
|
}
|
|
|
|
namespace MaterialEditor
|
|
{
|
|
//! Provides a tree view of all available materials and other assets exposed by the MaterialEditor.
|
|
class MaterialBrowserWidget
|
|
: public QWidget
|
|
, protected AZ::TickBus::Handler
|
|
, protected AtomToolsFramework::AtomToolsDocumentNotificationBus::Handler
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
MaterialBrowserWidget(QWidget* parent = nullptr);
|
|
~MaterialBrowserWidget();
|
|
|
|
private:
|
|
AzToolsFramework::AssetBrowser::FilterConstType CreateFilter() const;
|
|
void OpenSelectedEntries();
|
|
|
|
// AtomToolsDocumentNotificationBus::Handler implementation
|
|
void OnDocumentOpened(const AZ::Uuid& documentId) override;
|
|
|
|
// AZ::TickBus::Handler
|
|
void OnTick(float deltaTime, AZ::ScriptTimePoint time) override;
|
|
|
|
void OpenOptionsMenu();
|
|
|
|
QScopedPointer<Ui::MaterialBrowserWidget> m_ui;
|
|
AzToolsFramework::AssetBrowser::AssetBrowserFilterModel* m_filterModel = nullptr;
|
|
|
|
//! if new asset is being created with this path it will automatically be selected
|
|
AZStd::string m_pathToSelect;
|
|
|
|
QByteArray m_materialBrowserState;
|
|
};
|
|
} // namespace MaterialEditor
|