Minor updates from code review feedback.

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
monroegm-disable-blank-issue-2
santorac 4 years ago
parent 6b047fd89f
commit b67862a133

@ -112,7 +112,7 @@ namespace AZ
//! Returns the name context for the functor.
//! It acts like a namespace for any names that the MaterialFunctorSourceData might reference. The namespace
//! is automatically applied by the other relevant functions of this RuntimeContext class.
//! Not that by default the MaterialNameContext is not saved as part of the final MaterialFunctor class
//! Note that by default the MaterialNameContext is not saved as part of the final MaterialFunctor class
//! (most CreateFunctor() implementations should convert names to indexes anyway) but CreateFunctor() can
//! copy it to the created MaterialFunctor for use at runtime if needed.
const MaterialNameContext* GetNameContext() const { return m_materialNameContext; }
@ -148,7 +148,7 @@ namespace AZ
//! Returns the name context for the functor.
//! It acts like a namespace for any names that the MaterialFunctorSourceData might reference. The namespace
//! is automatically applied by the other relevant functions of this RuntimeContext class.
//! Not that by default the MaterialNameContext is not saved as part of the final MaterialFunctor class
//! Note that by default the MaterialNameContext is not saved as part of the final MaterialFunctor class
//! (most CreateFunctor() implementations should convert names to indexes anyway) but CreateFunctor() can
//! copy it to the created MaterialFunctor for use at runtime if needed.
const MaterialNameContext* GetNameContext() const { return m_materialNameContext; }

@ -331,7 +331,8 @@ namespace AZ
//! Recursively populates a material type asset with properties from the tree of material property groups.
//! @param materialTypeSourceFilePath path to the material type file that is being processed, used to look up relative paths
//! @param propertyIdContext the accumulated prefix that should be applied to any property names encountered in the current @propertyGroup
//! @param materialTypeAssetCreator properties will be added to this creator
//! @param materialNameContext the accumulated name context that should be applied to any property names or connection names encountered in the current @propertyGroup
//! @param propertyGroup the current PropertyGroup that is being processed
//! @return false if errors are detected and processing should abort
bool BuildPropertyList(

@ -198,7 +198,7 @@ namespace AZ
for (const Name& materialProperty : materialPropertyDependencies.GetValue())
{
Name propertyName{materialProperty.GetCStr()};
Name propertyName{materialProperty};
functor->m_materialNameContext.ContextualizeProperty(propertyName);
MaterialPropertyIndex index = propertiesLayout->FindPropertyIndex(propertyName);

@ -273,6 +273,8 @@ namespace UnitTest
using AZ::RPI::MaterialFunctor::Process;
void Process(AZ::RPI::MaterialFunctor::RuntimeContext&) override
{
// Intentionally empty, this is where the functor would do it's normal processing,
// but all this test functor does is store the MaterialNameContext.
}
MaterialNameContext m_nameContext;

@ -567,6 +567,9 @@ namespace MaterialEditor
AZStd::vector<AZStd::string> groupNameVector;
AZStd::vector<AZStd::string> groupDisplayNameVector;
groupNameVector.reserve(propertyGroupStack.size());
groupDisplayNameVector.reserve(propertyGroupStack.size());
for (auto& group : propertyGroupStack)
{
groupNameVector.push_back(group->GetName());

@ -290,6 +290,9 @@ namespace AZ
AZStd::vector<AZStd::string> groupNameVector;
AZStd::vector<AZStd::string> groupDisplayNameVector;
groupNameVector.reserve(propertyGroupStack.size());
groupDisplayNameVector.reserve(propertyGroupStack.size());
for (auto& nextGroup : propertyGroupStack)
{
groupNameVector.push_back(nextGroup->GetName());

Loading…
Cancel
Save