From b7cb9fa5e3b8a97ff4156a36866da81de4b4a4cb Mon Sep 17 00:00:00 2001 From: jckand-amzn Date: Tue, 20 Jul 2021 11:46:16 -0500 Subject: [PATCH] Re-configured some component properties to account for uniform scaling in PositionModifier tests Signed-off-by: jckand-amzn --- ...PositionModifier_AutoSnapToSurfaceWorks.py | 25 ++++--------------- .../dyn_veg/test_PositionModifier.py | 4 +-- 2 files changed, 7 insertions(+), 22 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/PositionModifier_AutoSnapToSurfaceWorks.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/PositionModifier_AutoSnapToSurfaceWorks.py index fe33da550a..a55e88488c 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/PositionModifier_AutoSnapToSurfaceWorks.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/PositionModifier_AutoSnapToSurfaceWorks.py @@ -82,22 +82,7 @@ class TestPositionModifierAutoSnapToSurface(EditorTestHelper): # 3) Create a spherical planting surface and a flat surface flat_entity = dynveg.create_surface_entity("Flat Surface", spawner_center_point, 32.0, 32.0, 1.0) - hill_entity = dynveg.create_mesh_surface_entity_with_slopes("Planting Surface", spawner_center_point, 5.0, 5.0, 5.0) - - # Disable/Re-enable Mesh component due to ATOM-14299 - general.idle_wait(1.0) - editor.EditorComponentAPIBus(bus.Broadcast, 'DisableComponents', [hill_entity.components[0]]) - is_enabled = editor.EditorComponentAPIBus(bus.Broadcast, 'IsComponentEnabled', hill_entity.components[0]) - if is_enabled: - print("Mesh component is still enabled") - else: - print("Mesh component was disabled") - editor.EditorComponentAPIBus(bus.Broadcast, 'EnableComponents', [hill_entity.components[0]]) - is_enabled = editor.EditorComponentAPIBus(bus.Broadcast, 'IsComponentEnabled', hill_entity.components[0]) - if is_enabled: - print("Mesh component is now enabled") - else: - print("Mesh component is still disabled") + hill_entity = dynveg.create_mesh_surface_entity_with_slopes("Planting Surface", spawner_center_point, 5.0) # Disable the Flat Surface Box Shape component, and temporarily ignore initial instance counts due to LYN-2245 editor.EditorComponentAPIBus(bus.Broadcast, 'DisableComponents', [flat_entity.components[0]]) @@ -117,14 +102,14 @@ class TestPositionModifierAutoSnapToSurface(EditorTestHelper): # Pin the Constant Gradient to the X axis of the spawner's Position Modifier component spawner_entity.get_set_test(3, 'Configuration|Position X|Gradient|Gradient Entity Id', gradient_entity.id) - # 6) Set the Position Modifier offset to 5 on the x-axis - spawner_entity.get_set_test(3, position_modifier_paths[0], 5) - spawner_entity.get_set_test(3, position_modifier_paths[1], 5) + # 6) Set the Position Modifier offset to 2.5 on the x-axis + spawner_entity.get_set_test(3, position_modifier_paths[0], 2.5) + spawner_entity.get_set_test(3, position_modifier_paths[1], 2.5) # 7) Validate instance count at the top of the sphere mesh and inside the sphere mesh while Auto Snap to Surface # is enabled top_point = math.Vector3(512.0, 512.0, 37.0) - inside_point = math.Vector3(512.0, 512.0, 33.0) + inside_point = math.Vector3(512.0, 512.0, 35.0) radius = 0.5 num_expected = 1 self.log(f"Checking for instances in a {radius * 2}m area at {top_point.ToString()}") diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_PositionModifier.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_PositionModifier.py index 0e211ba311..f990939320 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_PositionModifier.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_PositionModifier.py @@ -58,7 +58,6 @@ class TestPositionModifier(object): @pytest.mark.test_case_id("C4874100") @pytest.mark.SUITE_sandbox @pytest.mark.dynveg_modifier - @pytest.mark.xfail # LYN-3275 def test_PositionModifier_AutoSnapToSurfaceWorks(self, request, editor, level, launcher_platform): expected_lines = [ @@ -75,5 +74,6 @@ class TestPositionModifier(object): editor, "PositionModifier_AutoSnapToSurfaceWorks.py", expected_lines, - cfg_args=[level] + cfg_args=[level], + null_renderer=False )