Updated component configuration for new uniform scale in SlopeAlignmentModifier tests

Signed-off-by: jckand-amzn <jckand@amazon.com>
This commit is contained in:
jckand-amzn
2021-07-20 15:39:58 -05:00
parent 2173693462
commit 6fcf9aa9e1
3 changed files with 8 additions and 6 deletions
@@ -53,17 +53,19 @@ class TestSlopeAlignmentModifierOverrides(EditorTestHelper):
use_terrain=False,
)
general.set_current_view_position(512.0, 480.0, 38.0)
# Create a spawner entity setup with all needed components
center_point = math.Vector3(512.0, 512.0, 32.0)
asset_path = os.path.join("Slices", "PinkFlower.dynamicslice")
spawner_entity = dynveg.create_vegetation_area("Instance Spawner", center_point, 16.0, 16.0, 32.0, asset_path)
# Create a sloped mesh surface for the instances to plant on
center_point = math.Vector3(502.0, 512.0, 24.0)
mesh_asset_path = os.path.join("objects", "_primitives", "_box_1x1.azmodel")
mesh_asset = asset.AssetCatalogRequestBus(bus.Broadcast, "GetAssetIdByPath", mesh_asset_path, math.Uuid(),
False)
rotation = math.Vector3(0.0, radians(45.0), 0.0)
scale = math.Vector3(10.0, 10.0, 10.0)
surface_entity = hydra.Entity("Surface Entity")
surface_entity.create_entity(
center_point,
@@ -73,7 +75,7 @@ class TestSlopeAlignmentModifierOverrides(EditorTestHelper):
print(f"'{surface_entity.name}' created")
hydra.get_set_test(surface_entity, 0, "Controller|Configuration|Mesh Asset", mesh_asset)
components.TransformBus(bus.Event, "SetLocalRotation", surface_entity.id, rotation)
components.TransformBus(bus.Event, "SetLocalScale", surface_entity.id, scale)
components.TransformBus(bus.Event, "SetLocalUniformScale", surface_entity.id, 30.0)
# Add a Vegetation Debugger component to allow refreshing instances
hydra.add_level_component("Vegetation Debugger")
@@ -62,11 +62,11 @@ class TestSlopeAlignmentModifier(EditorTestHelper):
spawner_entity = dynveg.create_vegetation_area("Instance Spawner", center_point, 16.0, 16.0, 32.0, asset_path)
# Create a sloped mesh surface for the instances to plant on
center_point = math.Vector3(502.0, 512.0, 24.0)
mesh_asset_path = os.path.join("objects", "_primitives", "_box_1x1.azmodel")
mesh_asset = asset.AssetCatalogRequestBus(bus.Broadcast, "GetAssetIdByPath", mesh_asset_path, math.Uuid(),
False)
rotation = math.Vector3(0.0, radians(45.0), 0.0)
scale = math.Vector3(10.0, 10.0, 10.0)
surface_entity = hydra.Entity("Surface Entity")
surface_entity.create_entity(
center_point,
@@ -76,7 +76,7 @@ class TestSlopeAlignmentModifier(EditorTestHelper):
print(f"'{surface_entity.name}' created")
hydra.get_set_test(surface_entity, 0, "Controller|Configuration|Mesh Asset", mesh_asset)
components.TransformBus(bus.Event, "SetLocalRotation", surface_entity.id, rotation)
components.TransformBus(bus.Event, "SetLocalScale", surface_entity.id, scale)
components.TransformBus(bus.Event, "SetLocalUniformScale", surface_entity.id, 30.0)
# Add a Vegetation Debugger component to allow refreshing instances
hydra.add_level_component("Vegetation Debugger")
@@ -38,7 +38,7 @@ class TestSlopeAlignmentModifier(object):
@pytest.mark.test_case_id("C4896941")
@pytest.mark.SUITE_periodic
@pytest.mark.dynveg_modifier
@pytest.mark.skip # ATOM-14299
@pytest.mark.xfail(reason="https://github.com/o3de/o3de/issues/2303")
def test_SlopeAlignmentModifier_InstanceSurfaceAlignment(self, request, editor, level, launcher_platform):
expected_lines = [
@@ -61,7 +61,7 @@ class TestSlopeAlignmentModifier(object):
@pytest.mark.test_case_id("C4814459")
@pytest.mark.SUITE_periodic
@pytest.mark.dynveg_modifier
@pytest.mark.skip # ATOM-14299
@pytest.mark.xfail(reason="https://github.com/o3de/o3de/issues/2303")
def test_SlopeAlignmentModifierOverrides_InstanceSurfaceAlignment(self, request, editor, level, launcher_platform):
expected_lines = [