Fixed up a few small things to get Material Editor working again.

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
This commit is contained in:
santorac
2022-01-26 13:04:28 -08:00
parent 9b8bebbd70
commit aeb43c4012
4 changed files with 14 additions and 18 deletions
@@ -122,7 +122,7 @@ namespace AZ
AZ::RPI::MaterialPropertyValue propertyValue =
editData.m_materialAsset->GetPropertyValues()[propertyIndex.GetIndex()];
AZ::RPI::MaterialPropertyValue propertyValueDefault = propertyDefinition.m_value;
AZ::RPI::MaterialPropertyValue propertyValueDefault = propertyDefinition->m_value;
if (editData.m_materialParentAsset.IsReady())
{
propertyValueDefault = editData.m_materialParentAsset->GetPropertyValues()[propertyIndex.GetIndex()];
@@ -135,7 +135,7 @@ namespace AZ
propertyValue = AZ::RPI::MaterialPropertyValue::FromAny(propertyOverrideItr->second);
}
if (!AtomToolsFramework::ConvertToExportFormat(path, propertyId, propertyDefinition, propertyValue))
if (!AtomToolsFramework::ConvertToExportFormat(path, propertyId, *propertyDefinition, propertyValue))
{
AZ_Error("AZ::Render::EditorMaterialComponentUtil", false, "Failed to export: %s", path.c_str());
result = false;
@@ -151,7 +151,7 @@ namespace AZ
// TODO: Support populating the Material Editor with nested property sets, not just the top level.
const AZStd::string groupName = propertyId.GetStringView().substr(0, propertyId.GetStringView().size() - propertyDefinition->m_name.size() - 1);
exportData.m_properties[groupName][propertyDefinition.m_name].m_value = propertyValue;
exportData.m_properties[groupName][propertyDefinition->m_name].m_value = propertyValue;
return true;
});