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:
@@ -69,6 +69,7 @@ namespace AtomToolsFramework
|
||||
InspectorGroupHeaderWidget* groupHeader = new InspectorGroupHeaderWidget(m_ui->m_propertyContent);
|
||||
groupHeader->setText(groupDisplayName.c_str());
|
||||
groupHeader->setToolTip(groupDescription.c_str());
|
||||
groupHeader->setObjectName(groupNameId.c_str());
|
||||
m_layout->addWidget(groupHeader);
|
||||
m_headers.push_back(groupHeader);
|
||||
|
||||
@@ -81,6 +82,32 @@ namespace AtomToolsFramework
|
||||
OnHeaderClicked(event, groupHeader, groupWidget);
|
||||
});
|
||||
}
|
||||
|
||||
void InspectorWidget::SetGroupVisible(const AZStd::string& groupNameId, bool visible)
|
||||
{
|
||||
for (size_t i = 0; i < m_groups.size(); ++i)
|
||||
{
|
||||
if (m_groups[i]->objectName() == groupNameId.c_str())
|
||||
{
|
||||
m_headers[i]->setVisible(visible);
|
||||
m_groups[i]->setVisible(visible && m_headers[i]->IsExpanded());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool InspectorWidget::IsGroupVisible(const AZStd::string& groupNameId) const
|
||||
{
|
||||
for (auto& header : m_headers)
|
||||
{
|
||||
if (header->objectName() == groupNameId.c_str())
|
||||
{
|
||||
return header->isVisible();
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void InspectorWidget::RefreshGroup(const AZStd::string& groupNameId)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user