diff --git a/Gems/NvCloth/Assets/slices/Cloth/Chicken_Actor.slice b/Gems/NvCloth/Assets/slices/Cloth/Chicken_Actor.slice index e146d46fe2..6f64caf5f2 100644 --- a/Gems/NvCloth/Assets/slices/Cloth/Chicken_Actor.slice +++ b/Gems/NvCloth/Assets/slices/Cloth/Chicken_Actor.slice @@ -154,7 +154,7 @@ - + @@ -379,20 +379,7 @@ - - - - - - - - - - - - - - + @@ -405,7 +392,7 @@ - + @@ -413,6 +400,19 @@ + + + + + + + + + + + + + @@ -437,7 +437,7 @@ - + @@ -449,7 +449,7 @@ - + @@ -461,7 +461,7 @@ - + @@ -477,7 +477,7 @@ - + @@ -489,7 +489,7 @@ - + @@ -501,7 +501,7 @@ - + diff --git a/Gems/NvCloth/Assets/slices/Cloth/cloth_blinds.slice b/Gems/NvCloth/Assets/slices/Cloth/cloth_blinds.slice index 214e6ce3b0..c8709b3a6a 100644 --- a/Gems/NvCloth/Assets/slices/Cloth/cloth_blinds.slice +++ b/Gems/NvCloth/Assets/slices/Cloth/cloth_blinds.slice @@ -200,7 +200,7 @@ - + @@ -228,7 +228,7 @@ - + @@ -260,7 +260,7 @@ - + @@ -276,7 +276,7 @@ - + diff --git a/Gems/NvCloth/Assets/slices/Cloth/cloth_blinds_broken.slice b/Gems/NvCloth/Assets/slices/Cloth/cloth_blinds_broken.slice index 979616f8f3..e3ef330b3e 100644 --- a/Gems/NvCloth/Assets/slices/Cloth/cloth_blinds_broken.slice +++ b/Gems/NvCloth/Assets/slices/Cloth/cloth_blinds_broken.slice @@ -200,7 +200,7 @@ - + @@ -228,7 +228,7 @@ - + @@ -260,7 +260,7 @@ - + @@ -276,7 +276,7 @@ - + diff --git a/Gems/NvCloth/Assets/slices/Cloth/cloth_locked_corners_four.slice b/Gems/NvCloth/Assets/slices/Cloth/cloth_locked_corners_four.slice index b2bcb265fe..0a32a4191a 100644 --- a/Gems/NvCloth/Assets/slices/Cloth/cloth_locked_corners_four.slice +++ b/Gems/NvCloth/Assets/slices/Cloth/cloth_locked_corners_four.slice @@ -200,7 +200,7 @@ - + @@ -228,7 +228,7 @@ - + @@ -260,7 +260,7 @@ - + @@ -276,7 +276,7 @@ - + diff --git a/Gems/NvCloth/Assets/slices/Cloth/cloth_locked_corners_two.slice b/Gems/NvCloth/Assets/slices/Cloth/cloth_locked_corners_two.slice index f93956890c..369cb76841 100644 --- a/Gems/NvCloth/Assets/slices/Cloth/cloth_locked_corners_two.slice +++ b/Gems/NvCloth/Assets/slices/Cloth/cloth_locked_corners_two.slice @@ -200,7 +200,7 @@ - + @@ -228,7 +228,7 @@ - + @@ -260,7 +260,7 @@ - + @@ -276,7 +276,7 @@ - + diff --git a/Gems/NvCloth/Assets/slices/Cloth/cloth_locked_edge.slice b/Gems/NvCloth/Assets/slices/Cloth/cloth_locked_edge.slice index 0d6a7d7f30..b44a440d4d 100644 --- a/Gems/NvCloth/Assets/slices/Cloth/cloth_locked_edge.slice +++ b/Gems/NvCloth/Assets/slices/Cloth/cloth_locked_edge.slice @@ -200,7 +200,7 @@ - + @@ -228,7 +228,7 @@ - + @@ -260,7 +260,7 @@ - + @@ -276,7 +276,7 @@ - + diff --git a/Gems/NvCloth/Code/Source/Components/EditorClothComponent.cpp b/Gems/NvCloth/Code/Source/Components/EditorClothComponent.cpp index 18f86f558b..8d9731c9e6 100644 --- a/Gems/NvCloth/Code/Source/Components/EditorClothComponent.cpp +++ b/Gems/NvCloth/Code/Source/Components/EditorClothComponent.cpp @@ -482,14 +482,14 @@ namespace NvCloth { bool foundNode = AZStd::find(m_meshNodeList.cbegin(), m_meshNodeList.cend(), m_config.m_meshNode) != m_meshNodeList.cend(); - if (!foundNode && !m_previousMeshNode.empty()) + if (!foundNode && !m_lastKnownMeshNode.empty()) { // Check the if the mesh node previously selected is still part of the mesh list // to keep using it and avoid the user to select it again in the combo box. - foundNode = AZStd::find(m_meshNodeList.cbegin(), m_meshNodeList.cend(), m_previousMeshNode) != m_meshNodeList.cend(); + foundNode = AZStd::find(m_meshNodeList.cbegin(), m_meshNodeList.cend(), m_lastKnownMeshNode) != m_meshNodeList.cend(); if (foundNode) { - m_config.m_meshNode = m_previousMeshNode; + m_config.m_meshNode = m_lastKnownMeshNode; } } @@ -502,7 +502,7 @@ namespace NvCloth } } - m_previousMeshNode = ""; + m_lastKnownMeshNode = ""; if (m_simulateInEditor) { @@ -517,7 +517,12 @@ namespace NvCloth void EditorClothComponent::OnModelPreDestroy() { - m_previousMeshNode = m_config.m_meshNode; + if (m_config.m_meshNode != Internal::StatusMessageSelectNode && + m_config.m_meshNode != Internal::StatusMessageNoAsset && + m_config.m_meshNode != Internal::StatusMessageNoClothNodes) + { + m_lastKnownMeshNode = m_config.m_meshNode; + } m_meshNodeList = { {Internal::StatusMessageNoAsset} }; m_config.m_meshNode = Internal::StatusMessageNoAsset; diff --git a/Gems/NvCloth/Code/Source/Components/EditorClothComponent.h b/Gems/NvCloth/Code/Source/Components/EditorClothComponent.h index 1339fe1c6d..9727895a43 100644 --- a/Gems/NvCloth/Code/Source/Components/EditorClothComponent.h +++ b/Gems/NvCloth/Code/Source/Components/EditorClothComponent.h @@ -70,7 +70,7 @@ namespace NvCloth // This list is not serialized, it's compiled when the asset has been received via MeshComponentNotificationBus. MeshNodeList m_meshNodeList; - AZStd::string m_previousMeshNode; + AZStd::string m_lastKnownMeshNode; AZStd::unordered_set m_meshNodesWithBackstopData;