Made StandardMultilayerPBR hide a layer's property groups when that layer is disabled.

ATOM-14688 Disable Individual Layers

- Added new SetMaterialPropertyGroupVisibility functions to the material functors.
- Updated the MaterialFunctor::EditorContext to include parameters for handling material property group metadata.
- Updated the material inspector(s) to apply the property group visiblity changes from the material functor, to hide or show the property groups.
- Moved some code from MaterialPropertyDescriptor.h/cpp to a new MaterialDynamicMetadata.h/cpp, since these aren't really related to the MaterialPropertyDescriptor code. It's more for material functors to use.
- Also fixed the casing for the "GetMaterialPropertyValue_Image" lua function, since I was already in this code (ATOM-14793 "Fix Inconsistent Casing For LuaMaterialFunctorRuntimeContext")

Tested in MaterialEditor and in in the main Editor's MaterialComponent property override inspector.
This commit is contained in:
Chris Santora
2021-05-12 17:06:57 -07:00
parent 275bb1bfec
commit 53188a12da
34 changed files with 553 additions and 141 deletions
@@ -38,8 +38,8 @@ namespace AtomToolsFramework
Count
};
// Configures the initial state, data type, attributes, and values that describe
// the dynamic property and how it is presented
//! Configures the initial state, data type, attributes, and values that describe
//! the dynamic property and how it is presented
struct DynamicPropertyConfig
{
AZ_TYPE_INFO(DynamicPropertyConfig, "{9CA40E92-7F03-42BE-B6AA-51F30EE5796C}");
@@ -98,7 +98,7 @@ namespace AtomToolsFramework
//! Returns true if the property has a valid value.
bool IsValid() const;
//! Returns the ID of the property.
//! Returns the ID of the property.
const AZ::Name GetId() const;
//! Returns the current property visibility.
@@ -44,6 +44,12 @@ namespace AtomToolsFramework
const AZStd::string& groupDescription,
QWidget* groupWidget) = 0;
//! Sets the visibility of a specific property group. This impacts both the header and the widget.
virtual void SetGroupVisible(const AZStd::string& groupNameId, bool visible) = 0;
//! Returns the visibility of a specific property group.
virtual bool IsGroupVisible(const AZStd::string& groupNameId) const = 0;
//! Calls Refresh for a specific InspectorGroupWidget, allowing for non-destructive UI changes
virtual void RefreshGroup(const AZStd::string& groupNameId) = 0;
@@ -57,6 +57,9 @@ namespace AtomToolsFramework
const AZStd::string& groupDescription,
QWidget* groupWidget) override;
void SetGroupVisible(const AZStd::string& groupNameId, bool visible) override;
bool IsGroupVisible(const AZStd::string& groupNameId) const override;
void RefreshGroup(const AZStd::string& groupNameId) override;
void RebuildGroup(const AZStd::string& groupNameId) override;