You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
o3de/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocumentRequestBus.h

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