c9c172794e
• This removes a direct dependency on dynamic property groups and data from the document system. • Added support for names, descriptions, and nesting to dynamic property groups. • Moved property related functions from base document classes into material editor document classes because dynamic property groups are an implementation detail of the material editor document to support material type flexible data format. • Change material document to use a table of dynamic property groups instead of a map of properties. • Added functions to traverse groups and properties. • This keeps groups and properties organized consistently with the material type file as well as what’s expected in the UI. • Document data can now be maps directly to the inspector reflective property editors instead of copying one property at a time out of the document and keeping those synchronized. Signed-off-by: Guthrie Adams <guthadam@amazon.com>
67 lines
2.7 KiB
C++
67 lines
2.7 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
|
|
|
|
#include <Atom/RPI.Edit/Shader/ShaderVariantListSourceData.h>
|
|
#include <Atom/RPI.Reflect/Shader/ShaderAsset.h>
|
|
#include <AtomToolsFramework/Document/AtomToolsDocument.h>
|
|
#include <AzCore/Asset/AssetCommon.h>
|
|
#include <AzCore/RTTI/RTTI.h>
|
|
#include <Document/ShaderManagementConsoleDocumentRequestBus.h>
|
|
|
|
namespace ShaderManagementConsole
|
|
{
|
|
/**
|
|
* ShaderManagementConsoleDocument provides an API for modifying and saving document properties.
|
|
*/
|
|
class ShaderManagementConsoleDocument
|
|
: public AtomToolsFramework::AtomToolsDocument
|
|
, public ShaderManagementConsoleDocumentRequestBus::Handler
|
|
{
|
|
public:
|
|
AZ_RTTI(ShaderManagementConsoleDocument, "{DBA269AE-892B-415C-8FA1-166B94B0E045}");
|
|
AZ_CLASS_ALLOCATOR(ShaderManagementConsoleDocument, AZ::SystemAllocator, 0);
|
|
AZ_DISABLE_COPY(ShaderManagementConsoleDocument);
|
|
|
|
ShaderManagementConsoleDocument();
|
|
~ShaderManagementConsoleDocument();
|
|
|
|
// AtomToolsFramework::AtomToolsDocument overrides...
|
|
AZStd::vector<AtomToolsFramework::DocumentObjectInfo> GetObjectInfo() const override;
|
|
bool Open(AZStd::string_view loadPath) override;
|
|
bool Save() override;
|
|
bool SaveAsCopy(AZStd::string_view savePath) override;
|
|
bool SaveAsChild(AZStd::string_view savePath) override;
|
|
bool IsOpen() const override;
|
|
bool IsModified() const override;
|
|
bool IsSavable() const override;
|
|
|
|
// ShaderManagementConsoleDocumentRequestBus::Handler overridfes...
|
|
void SetShaderVariantListSourceData(const AZ::RPI::ShaderVariantListSourceData& sourceData) override;
|
|
const AZ::RPI::ShaderVariantListSourceData& GetShaderVariantListSourceData() const override;
|
|
size_t GetShaderVariantCount() const override;
|
|
const AZ::RPI::ShaderVariantListSourceData::VariantInfo& GetShaderVariantInfo(size_t index) const override;
|
|
size_t GetShaderOptionCount() const override;
|
|
const AZ::RPI::ShaderOptionDescriptor& GetShaderOptionDescriptor(size_t index) const override;
|
|
|
|
private:
|
|
// AtomToolsFramework::AtomToolsDocument overrides...
|
|
void Clear() override;
|
|
|
|
bool SaveSourceData();
|
|
|
|
// Source data for shader variant list
|
|
AZ::RPI::ShaderVariantListSourceData m_shaderVariantListSourceData;
|
|
|
|
// Shader asset for the corresponding shader variant list
|
|
AZ::Data::Asset<AZ::RPI::ShaderAsset> m_shaderAsset;
|
|
|
|
AZ::RPI::ShaderOptionDescriptor m_invalidDescriptor;
|
|
};
|
|
} // namespace ShaderManagementConsole
|