Fixed issues after merging latest main, as well as some edge cases I didn't notice before.

The structure of InspectorWidget::m_groups changed, so I had to update my new code accordingly.
Updated the InspectorWidget::m_groups code a bit to be more readable.
Discovered the initial property group visiblity state wasn't being set correctly when a material was first opened, so groups weren't initially hidden when they should have been. This had to be fixed in different ways for MaterialEditor's inspector and MaterialComponent's inspector.

ATOM-14688 Disable Individual Layers
This commit is contained in:
Chris Santora
2021-05-12 23:28:05 -07:00
parent 37a1b77d50
commit e429c8e06a
5 changed files with 53 additions and 26 deletions
@@ -305,8 +305,11 @@ namespace AZ
{
AZ::RPI::MaterialPropertyGroupDynamicMetadata& metadata = propertyGroupDynamicMetadata[AZ::Name{groupPair.first}];
metadata.m_visibility = IsGroupVisible(groupPair.first) ?
AZ::RPI::MaterialPropertyGroupVisibility::Enabled : AZ::RPI::MaterialPropertyGroupVisibility::Hidden;
// It's significant that we check IsGroupHidden rather than IsGroupVisisble, because it follows the same rules as QWidget::isHidden().
// We don't care whether the widget and all its parents are visible, we only care about whether the group was hidden within the context
// of the material property inspector.
metadata.m_visibility = IsGroupHidden(groupPair.first) ?
AZ::RPI::MaterialPropertyGroupVisibility::Hidden : AZ::RPI::MaterialPropertyGroupVisibility::Enabled;
}
for (AZ::RPI::Ptr<AZ::RPI::MaterialFunctor>& functor : m_editorFunctors)