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>
59 lines
2.1 KiB
C++
59 lines
2.1 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.Public/Material/Material.h>
|
|
#include <Atom/RPI.Reflect/Material/MaterialAsset.h>
|
|
#include <Atom/RPI.Reflect/Material/MaterialPropertyDescriptor.h>
|
|
#include <AzCore/Asset/AssetCommon.h>
|
|
|
|
namespace AZ
|
|
{
|
|
namespace RPI
|
|
{
|
|
class MaterialSourceData;
|
|
class MaterialTypeSourceData;
|
|
} // namespace RPI
|
|
} // namespace AZ
|
|
|
|
namespace MaterialEditor
|
|
{
|
|
//! UVs are processed in a property group but will be handled differently.
|
|
static constexpr const char UvGroupName[] = "uvSets";
|
|
|
|
class MaterialDocumentRequests
|
|
: public AZ::EBusTraits
|
|
{
|
|
public:
|
|
static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Multiple;
|
|
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById;
|
|
typedef AZ::Uuid BusIdType;
|
|
|
|
//! Get material asset created by MaterialDocument
|
|
virtual AZ::Data::Asset<AZ::RPI::MaterialAsset> GetAsset() const = 0;
|
|
|
|
//! Get material instance created from asset loaded by MaterialDocument
|
|
virtual AZ::Data::Instance<AZ::RPI::Material> GetInstance() const = 0;
|
|
|
|
//! Get the internal material source data
|
|
virtual const AZ::RPI::MaterialSourceData* GetMaterialSourceData() const = 0;
|
|
|
|
//! Get the internal material type source data
|
|
virtual const AZ::RPI::MaterialTypeSourceData* GetMaterialTypeSourceData() const = 0;
|
|
|
|
//! Modify property value
|
|
virtual void SetPropertyValue(const AZ::Name& propertyFullName, const AZStd::any& value) = 0;
|
|
|
|
//! Return property value
|
|
//! If the document is not open or the id can't be found, an invalid value is returned instead.
|
|
virtual const AZStd::any& GetPropertyValue(const AZ::Name& propertyFullName) const = 0;
|
|
};
|
|
|
|
using MaterialDocumentRequestBus = AZ::EBus<MaterialDocumentRequests>;
|
|
} // namespace MaterialEditor
|