Updated MaterialPropertyId class in preparation for nested material property sets.
Here the class has been generalized for a list of group names and a final property name, rather than assuming a single group containing the property. This included removing the unused GetPropertyName and GetGroupName functions. All that's really need from this class is conversion to a full property ID string. Testing: New unit test. Reprocessed all core material types and StandardPBR test materials used in Atom Sample Viewer's material screenshot test. Atom Sample Viewer material screenshot test script. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
This commit is contained in:
+1
-1
@@ -300,7 +300,7 @@ namespace AZ
|
||||
AtomToolsFramework::DynamicPropertyConfig propertyConfig;
|
||||
|
||||
// Assign id before conversion so it can be used in dynamic description
|
||||
propertyConfig.m_id = AZ::RPI::MaterialPropertyId(groupName, propertyDefinition.m_name).GetFullName();
|
||||
propertyConfig.m_id = AZ::RPI::MaterialPropertyId(groupName, propertyDefinition.m_name);
|
||||
|
||||
AtomToolsFramework::ConvertToPropertyConfig(propertyConfig, propertyDefinition);
|
||||
|
||||
|
||||
+2
-2
@@ -140,7 +140,7 @@ namespace AZ
|
||||
editData.m_materialTypeSourceData.EnumerateProperties([&](const AZStd::string& groupName, const AZStd::string& propertyName, const auto& propertyDefinition) {
|
||||
const AZ::RPI::MaterialPropertyId propertyId(groupName, propertyName);
|
||||
const AZ::RPI::MaterialPropertyIndex propertyIndex =
|
||||
editData.m_materialAsset->GetMaterialPropertiesLayout()->FindPropertyIndex(propertyId.GetFullName());
|
||||
editData.m_materialAsset->GetMaterialPropertiesLayout()->FindPropertyIndex(propertyId);
|
||||
|
||||
AZ::RPI::MaterialPropertyValue propertyValue = editData.m_materialAsset->GetPropertyValues()[propertyIndex.GetIndex()];
|
||||
|
||||
@@ -151,7 +151,7 @@ namespace AZ
|
||||
}
|
||||
|
||||
// Check for and apply any property overrides before saving property values
|
||||
auto propertyOverrideItr = editData.m_materialPropertyOverrideMap.find(propertyId.GetFullName());
|
||||
auto propertyOverrideItr = editData.m_materialPropertyOverrideMap.find(propertyId);
|
||||
if(propertyOverrideItr != editData.m_materialPropertyOverrideMap.end())
|
||||
{
|
||||
propertyValue = AZ::RPI::MaterialPropertyValue::FromAny(propertyOverrideItr->second);
|
||||
|
||||
+2
-2
@@ -96,7 +96,7 @@ namespace AZ
|
||||
const AZStd::string materialUvName = m_materialUvNames[i].m_uvName.GetStringView();
|
||||
|
||||
propertyConfig.m_dataType = AtomToolsFramework::DynamicPropertyType::Enum;
|
||||
propertyConfig.m_id = AZ::RPI::MaterialPropertyId(groupName, shaderInput).GetFullName();
|
||||
propertyConfig.m_id = AZ::RPI::MaterialPropertyId(groupName, shaderInput);
|
||||
propertyConfig.m_name = shaderInput;
|
||||
propertyConfig.m_displayName = materialUvName;
|
||||
propertyConfig.m_description = shaderInput;
|
||||
@@ -248,7 +248,7 @@ namespace AZ
|
||||
const AZStd::string materialUvName = m_materialUvNames[i].m_uvName.GetStringView();
|
||||
|
||||
propertyConfig.m_dataType = AtomToolsFramework::DynamicPropertyType::Enum;
|
||||
propertyConfig.m_id = AZ::RPI::MaterialPropertyId(groupName, shaderInput).GetFullName();
|
||||
propertyConfig.m_id = AZ::RPI::MaterialPropertyId(groupName, shaderInput);
|
||||
propertyConfig.m_name = shaderInput;
|
||||
propertyConfig.m_displayName = materialUvName;
|
||||
propertyConfig.m_description = shaderInput;
|
||||
|
||||
Reference in New Issue
Block a user