Tied up some loose ends with nested property group support.

Fixed the MaterialBuilder to report source dependencies on imported JSON files, so the material type will rebuild when you edit an imported file that contains shared property data.
Fixed a spot in LuaMaterialFunctorSourceData where it was only applying the old "prefix" feature and not the new name context.
Updated a couple built-in material functors to take advantage of the name context (they were using RuntimeContext::GetShaderResourceGroupLayout instead of the RuntimeContext::FindShaderInputConstantIndex wrapper utility function).
Fixed an issue with EnumeratePropertyGroups where it wasn't passing the right name context, so Material Editor wasn't able to load some material types.
Reordered the parameters in the MaterialTypeSourceData enumerate callback functions, I felt this order was more natural.

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
This commit is contained in:
santorac
2022-02-01 22:37:47 -08:00
parent 2c59f1b8a4
commit a7bdb05d66
11 changed files with 49 additions and 33 deletions
@@ -114,10 +114,10 @@ namespace AZ
// Copy all of the properties from the material asset to the source data that will be exported
bool result = true;
editData.m_materialTypeSourceData.EnumerateProperties([&](const AZ::RPI::MaterialNameContext& materialNameContext, const AZ::RPI::MaterialTypeSourceData::PropertyDefinition* propertyDefinition)
editData.m_materialTypeSourceData.EnumerateProperties([&](const AZ::RPI::MaterialTypeSourceData::PropertyDefinition* propertyDefinition, const AZ::RPI::MaterialNameContext& nameContext)
{
AZ::Name propertyId{propertyDefinition->GetName()};
materialNameContext.ContextualizeProperty(propertyId);
nameContext.ContextualizeProperty(propertyId);
const AZ::RPI::MaterialPropertyIndex propertyIndex =
editData.m_materialAsset->GetMaterialPropertiesLayout()->FindPropertyIndex(propertyId);