Terrain Macro Material component improvements (#4930)

* First pass of non-working changes to Terrain Macro Material Component.

Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>

* Reworked Terrain Macro Material to use properties instead of a material.

Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>

* Fixed comments.

Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>

* PR feedback - disable attributes when no normal map selected

Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>

* Fix linux compile error - unused variables.

Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
This commit is contained in:
Mike Balfour
2021-10-25 11:37:32 -05:00
committed by GitHub
parent e970247fc5
commit 91ca986e2a
8 changed files with 141 additions and 282 deletions
@@ -17,36 +17,7 @@ namespace Terrain
{
BaseClassType::ReflectSubClass<EditorTerrainMacroMaterialComponent, BaseClassType>(
context, 1,
&LmbrCentral::EditorWrappedComponentBaseVersionConverter<typename BaseClassType::WrappedComponentType,
typename BaseClassType::WrappedConfigType, 1>
);
AZ::SerializeContext* serializeContext = azrtti_cast<AZ::SerializeContext*>(context);
if (serializeContext)
{
AZ::EditContext* editContext = serializeContext->GetEditContext();
// The edit context for TerrainMacroMaterialConfig is specified here to make it easier to add custom filtering to the
// asset picker for the material asset so that we can eventually only display materials that inherit from the proper
// material type.
if (editContext)
{
editContext
->Class<TerrainMacroMaterialConfig>(
"Terrain Macro Material Component", "Provide a terrain macro material for a region of the world")
->ClassElement(AZ::Edit::ClassElements::EditorData, "")
->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly)
->Attribute(AZ::Edit::Attributes::AutoExpand, true)
->DataElement(
AZ::Edit::UIHandlers::Default, &TerrainMacroMaterialConfig::m_materialAsset, "Macro Material",
"Terrain macro material for use by any terrain inside the bounding box on this entity.")
// This is disabled until ChangeValidate can support the Asset<T> type. :(
//->Attribute(AZ::Edit::Attributes::ChangeValidate, &TerrainMacroMaterialConfig::ValidateMaterialAsset)
;
}
}
&LmbrCentral::EditorWrappedComponentBaseVersionConverter<
typename BaseClassType::WrappedComponentType, typename BaseClassType::WrappedConfigType, 1>);
}
}