Re-configured some component properties to account for uniform scaling in PositionModifier tests
Signed-off-by: jckand-amzn <jckand@amazon.com>
This commit is contained in:
+5
-20
@@ -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()}")
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user