From cea334dbc40d076b0d4d3fc052f89a660466f662 Mon Sep 17 00:00:00 2001 From: Kyle B Date: Wed, 11 Aug 2021 22:23:06 -0700 Subject: [PATCH] Fixed enum value problems Signed-off-by: Kyle B --- .../Code/Source/Mesh/EditorMeshComponent.cpp | 4 +++- .../Code/Source/Mesh/MeshComponentController.cpp | 13 ++----------- .../Code/Source/Mesh/MeshComponentController.h | 1 - 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/EditorMeshComponent.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/EditorMeshComponent.cpp index ff0741fc31..63b32f6892 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/EditorMeshComponent.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/EditorMeshComponent.cpp @@ -80,7 +80,9 @@ namespace AZ "Renders IBL specular reflections in the forward pass, using only the most influential probe (based on the position of the entity) and the global IBL cubemap. Can reduce rendering costs, but only recommended for static objects that are affected by at most one reflection probe.") ->Attribute(AZ::Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) ->DataElement(AZ::Edit::UIHandlers::ComboBox, &MeshComponentConfig::m_lodType, "Lod Type", "Lod Method.") - ->Attribute(AZ::Edit::Attributes::EnumValues, &MeshComponentConfig::GetLodTypeValues) + ->EnumAttribute(RPI::Cullable::LodType::Default, "Default") + ->EnumAttribute(RPI::Cullable::LodType::ScreenCoverage, "Screen Coverage") + ->EnumAttribute(RPI::Cullable::LodType::SpecificLod, "Specific Lod") ->Attribute(AZ::Edit::Attributes::Visibility, &MeshComponentConfig::IsAssetSet) ->ClassElement(AZ::Edit::ClassElements::Group, "Lod Configuration") ->Attribute(AZ::Edit::Attributes::AutoExpand, false) diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.cpp index 3d049d0f97..9aa3685c34 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.cpp @@ -54,8 +54,7 @@ namespace AZ if (auto* serializeContext = azrtti_cast(context)) { serializeContext->Class() - //->Version(2, &MeshComponentControllerVersionUtility::VersionConverter) - ->Version(1) + ->Version(2, &MeshComponentControllerVersionUtility::VersionConverter) ->Field("ModelAsset", &MeshComponentConfig::m_modelAsset) ->Field("SortKey", &MeshComponentConfig::m_sortKey) ->Field("ExcludeFromReflectionCubeMaps", &MeshComponentConfig::m_excludeFromReflectionCubeMaps) @@ -65,6 +64,7 @@ namespace AZ ->Field("MinimumScreenCoverage", &MeshComponentConfig::m_minimumScreenCoverage) ->Field("QualityDecayRate", &MeshComponentConfig::m_qualityDecayRate); } + } bool MeshComponentConfig::IsAssetSet() @@ -120,15 +120,6 @@ namespace AZ return values; } - AZStd::vector> MeshComponentConfig::GetLodTypeValues() - { - return { - {aznumeric_cast(0), "Default"}, - {aznumeric_cast(1), "Screen Coverage" }, - {aznumeric_cast(2), "Specific Lod" } - }; - } - MeshComponentController::~MeshComponentController() { // Release memory, disconnect from buses in the right order and broadcast events so that other components are aware. diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.h index 5f38088ca3..aba560b6e8 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.h +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.h @@ -48,7 +48,6 @@ namespace AZ bool LodTypeIsSpecificLOD(); bool ShowLodConfig(); AZStd::vector> GetLodOverrideValues(); - AZStd::vector> GetLodTypeValues(); Data::Asset m_modelAsset = { AZ::Data::AssetLoadBehavior::QueueLoad }; RHI::DrawItemSortKey m_sortKey = 0;