Merge branch 'development' into Atom/jromnoa/add-waits-to-materialeditor-test

This commit is contained in:
jromnoa
2021-08-30 12:37:58 -07:00
99 changed files with 1089 additions and 3062 deletions
@@ -124,13 +124,14 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_
COMPONENT
LargeWorlds
)
## LandscapeCanvas ##
ly_add_pytest(
NAME AutomatedTesting::LandscapeCanvasTests_Main
TEST_SERIAL
TEST_SUITE main
PATH ${CMAKE_CURRENT_LIST_DIR}/landscape_canvas/test_LandscapeCanvas_Main.py
PATH ${CMAKE_CURRENT_LIST_DIR}/landscape_canvas/TestSuite_Main.py
RUNTIME_DEPENDENCIES
AZ::AssetProcessor
Legacy::Editor
@@ -143,7 +144,20 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_
NAME AutomatedTesting::LandscapeCanvasTests_Periodic
TEST_SERIAL
TEST_SUITE periodic
PATH ${CMAKE_CURRENT_LIST_DIR}/landscape_canvas/test_LandscapeCanvas_Periodic.py
PATH ${CMAKE_CURRENT_LIST_DIR}/landscape_canvas/TestSuite_Periodic.py
RUNTIME_DEPENDENCIES
AZ::AssetProcessor
Legacy::Editor
AutomatedTesting.Assets
COMPONENT
LargeWorlds
)
ly_add_pytest(
NAME AutomatedTesting::LandscapeCanvasTests_Main_Optimized
TEST_SERIAL
TEST_SUITE main
PATH ${CMAKE_CURRENT_LIST_DIR}/landscape_canvas/TestSuite_Main_Optimized.py
RUNTIME_DEPENDENCIES
AZ::AssetProcessor
Legacy::Editor
@@ -153,11 +167,25 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_
)
## GradientSignal ##
ly_add_pytest(
NAME AutomatedTesting::GradientSignalTests_Periodic
TEST_SERIAL
TEST_SUITE periodic
PATH ${CMAKE_CURRENT_LIST_DIR}/gradient_signal/test_GradientSignal_Periodic.py
PATH ${CMAKE_CURRENT_LIST_DIR}/gradient_signal/TestSuite_Periodic.py
RUNTIME_DEPENDENCIES
AZ::AssetProcessor
Legacy::Editor
AutomatedTesting.Assets
COMPONENT
LargeWorlds
)
ly_add_pytest(
NAME AutomatedTesting::GradientSignalTests_Periodic_Optimized
TEST_SERIAL
TEST_SUITE periodic
PATH ${CMAKE_CURRENT_LIST_DIR}/gradient_signal/TestSuite_Periodic_Optimized.py
RUNTIME_DEPENDENCIES
AZ::AssetProcessor
Legacy::Editor
@@ -1,103 +0,0 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
"""
Tests that the Gradient Generator components are incompatible with Vegetation Area components
"""
import os
import pytest
pytest.importorskip('ly_test_tools')
import ly_test_tools.environment.file_system as file_system
import editor_python_test_tools.hydra_test_utils as hydra
test_directory = os.path.join(os.path.dirname(__file__), 'EditorScripts')
gradient_generators = [
'Altitude Gradient',
'Constant Gradient',
'FastNoise Gradient',
'Image Gradient',
'Perlin Noise Gradient',
'Random Noise Gradient',
'Shape Falloff Gradient',
'Slope Gradient',
'Surface Mask Gradient'
]
gradient_modifiers = [
'Dither Gradient Modifier',
'Gradient Mixer',
'Invert Gradient Modifier',
'Levels Gradient Modifier',
'Posterize Gradient Modifier',
'Smooth-Step Gradient Modifier',
'Threshold Gradient Modifier'
]
vegetation_areas = [
'Vegetation Layer Spawner',
'Vegetation Layer Blender',
'Vegetation Layer Blocker',
'Vegetation Layer Blocker (Mesh)'
]
all_gradients = gradient_modifiers + gradient_generators
@pytest.mark.parametrize('project', ['AutomatedTesting'])
@pytest.mark.parametrize('level', ['tmp_level'])
@pytest.mark.usefixtures("automatic_process_killer")
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
class TestGradientIncompatibilities(object):
@pytest.fixture(autouse=True)
def setup_teardown(self, request, workspace, project, level):
def teardown():
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
request.addfinalizer(teardown)
@pytest.mark.test_case_id('C2691648', 'C2691649', 'C2691650', 'C2691651',
'C2691653', 'C2691656', 'C2691657', 'C2691658',
'C2691647', 'C2691655')
@pytest.mark.SUITE_periodic
def test_GradientGenerators_Incompatibilities(self, request, editor, level, launcher_platform):
cfg_args = [level]
expected_lines = []
for gradient_generator in gradient_generators:
for vegetation_area in vegetation_areas:
expected_lines.append(f"{gradient_generator} is disabled before removing {vegetation_area} component")
expected_lines.append(f"{gradient_generator} is enabled after removing {vegetation_area} component")
expected_lines.append("GradientGeneratorIncompatibilities: result=SUCCESS")
hydra.launch_and_validate_results(request, test_directory, editor,
'GradientGenerators_Incompatibilities.py',
expected_lines=expected_lines, cfg_args=cfg_args)
@pytest.mark.test_case_id('C3416464', 'C3416546', 'C3961318', 'C3961319',
'C3961323', 'C3961324', 'C3980656', 'C3980657',
'C3980661', 'C3980662', 'C3980666', 'C3980667',
'C2691652')
@pytest.mark.SUITE_periodic
def test_GradientModifiers_Incompatibilities(self, request, editor, level, launcher_platform):
cfg_args = [level]
expected_lines = []
for gradient_modifier in gradient_modifiers:
for vegetation_area in vegetation_areas:
expected_lines.append(f"{gradient_modifier} is disabled before removing {vegetation_area} component")
expected_lines.append(f"{gradient_modifier} is enabled after removing {vegetation_area} component")
for conflicting_gradient in all_gradients:
expected_lines.append(f"{gradient_modifier} is disabled before removing {conflicting_gradient} component")
expected_lines.append(f"{gradient_modifier} is enabled after removing {conflicting_gradient} component")
expected_lines.append("GradientModifiersIncompatibilities: result=SUCCESS")
hydra.launch_and_validate_results(request, test_directory, editor,
'GradientModifiers_Incompatibilities.py',
expected_lines=expected_lines, cfg_args=cfg_args)
@@ -1,118 +0,0 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
import os
import pytest
# Bail on the test if ly_test_tools doesn't exist.
pytest.importorskip('ly_test_tools')
import ly_test_tools.environment.file_system as file_system
import editor_python_test_tools.hydra_test_utils as hydra
test_directory = os.path.join(os.path.dirname(__file__), 'EditorScripts')
@pytest.mark.parametrize('project', ['AutomatedTesting'])
@pytest.mark.parametrize('level', ['tmp_level'])
@pytest.mark.usefixtures("automatic_process_killer")
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
class TestGradientPreviewSettings(object):
@pytest.fixture(autouse=True)
def setup_teardown(self, request, workspace, project, level):
def teardown():
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
request.addfinalizer(teardown)
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
@pytest.mark.test_case_id('C3980668', 'C2676825', 'C2676828', 'C2676822', 'C3416547', 'C3961320', 'C3961325',
'C3980658', 'C3980663')
@pytest.mark.SUITE_periodic
def test_GradientPreviewSettings_DefaultPinnedEntityIsSelf(self, request, editor, level, launcher_platform):
expected_lines = [
"Perlin Noise Gradient has Preview pinned to own Entity result: SUCCESS",
"Random Noise Gradient has Preview pinned to own Entity result: SUCCESS",
"FastNoise Gradient has Preview pinned to own Entity result: SUCCESS",
"Dither Gradient Modifier has Preview pinned to own Entity result: SUCCESS",
"Invert Gradient Modifier has Preview pinned to own Entity result: SUCCESS",
"Levels Gradient Modifier has Preview pinned to own Entity result: SUCCESS",
"Posterize Gradient Modifier has Preview pinned to own Entity result: SUCCESS",
"Smooth-Step Gradient Modifier has Preview pinned to own Entity result: SUCCESS",
"Threshold Gradient Modifier has Preview pinned to own Entity result: SUCCESS",
"GradientPreviewSettings_DefaultPinnedEntity: result=SUCCESS"
]
hydra.launch_and_validate_results(
request,
test_directory,
editor,
"GradientPreviewSettings_DefaultPinnedEntityIsSelf.py",
expected_lines,
cfg_args=[level]
)
@pytest.mark.test_case_id("C2676829", "C3961326", "C3980659", "C3980664", "C3980669", "C3416548", "C2676823",
"C3961321", "C2676826")
@pytest.mark.SUITE_periodic
def test_GradientPreviewSettings_ClearingPinnedEntitySetsPreviewToOrigin(self, request, editor, level,
launcher_platform):
expected_lines = [
"Random Noise Gradient entity Created",
"Entity has a Random Noise Gradient component",
"Entity has a Gradient Transform Modifier component",
"Entity has a Box Shape component",
"Random Noise Gradient Preview Settings|Pin Preview to Shape: SUCCESS",
"Random Noise Gradient --- Preview Position set to world origin",
"Random Noise Gradient --- Preview Size set to (1, 1, 1)",
"Levels Gradient Modifier entity Created",
"Entity has a Levels Gradient Modifier component",
"Levels Gradient Modifier Preview Settings|Pin Preview to Shape: SUCCESS",
"Levels Gradient Modifier --- Preview Position set to world origin",
"Posterize Gradient Modifier entity Created",
"Entity has a Posterize Gradient Modifier component",
"Posterize Gradient Modifier Preview Settings|Pin Preview to Shape: SUCCESS",
"Posterize Gradient Modifier --- Preview Position set to world origin",
"Smooth-Step Gradient Modifier entity Created",
"Entity has a Smooth-Step Gradient Modifier component",
"Smooth-Step Gradient Modifier Preview Settings|Pin Preview to Shape: SUCCESS",
"Smooth-Step Gradient Modifier --- Preview Position set to world origin",
"Threshold Gradient Modifier entity Created",
"Entity has a Threshold Gradient Modifier component",
"Threshold Gradient Modifier Preview Settings|Pin Preview to Shape: SUCCESS",
"Threshold Gradient Modifier --- Preview Position set to world origin",
"FastNoise Gradient entity Created",
"Entity has a FastNoise Gradient component",
"FastNoise Gradient Preview Settings|Pin Preview to Shape: SUCCESS",
"FastNoise Gradient --- Preview Position set to world origin",
"FastNoise Gradient --- Preview Size set to (1, 1, 1)",
"Dither Gradient Modifier entity Created",
"Entity has a Dither Gradient Modifier component",
"Dither Gradient Modifier Preview Settings|Pin Preview to Shape: SUCCESS",
"Dither Gradient Modifier --- Preview Position set to world origin",
"Dither Gradient Modifier --- Preview Size set to (1, 1, 1)",
"Invert Gradient Modifier entity Created",
"Entity has a Invert Gradient Modifier component",
"Invert Gradient Modifier Preview Settings|Pin Preview to Shape: SUCCESS",
"Invert Gradient Modifier --- Preview Position set to world origin",
"Perlin Noise Gradient entity Created",
"Entity has a Perlin Noise Gradient component",
"Perlin Noise Gradient Preview Settings|Pin Preview to Shape: SUCCESS",
"Perlin Noise Gradient --- Preview Position set to world origin",
"Perlin Noise Gradient --- Preview Size set to (1, 1, 1)",
]
hydra.launch_and_validate_results(
request,
test_directory,
editor,
"GradientPreviewSettings_ClearingPinnedEntitySetsPreviewToOrigin.py",
expected_lines,
cfg_args=[level]
)
@@ -1,86 +0,0 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
import os
import pytest
import logging
# Bail on the test if ly_test_tools doesn't exist.
pytest.importorskip("ly_test_tools")
import ly_test_tools.environment.file_system as file_system
import editor_python_test_tools.hydra_test_utils as hydra
logger = logging.getLogger(__name__)
test_directory = os.path.join(os.path.dirname(__file__), "EditorScripts")
@pytest.mark.parametrize('project', ['AutomatedTesting'])
@pytest.mark.parametrize('level', ['tmp_level'])
@pytest.mark.usefixtures("automatic_process_killer")
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
class TestGradientSampling(object):
@pytest.fixture(autouse=True)
def setup_teardown(self, request, workspace, project, level):
def teardown():
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
request.addfinalizer(teardown)
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
@pytest.mark.test_case_id("C3526311")
@pytest.mark.SUITE_periodic
def test_GradientSampling_GradientReferencesAddRemoveSuccessfully(self, request, editor, level, launcher_platform):
expected_lines = [
"Entity has a Random Noise Gradient component",
"Entity has a Gradient Transform Modifier component",
"Entity has a Box Shape component",
"Entity has a Dither Gradient Modifier component",
"Gradient Generator is pinned to the Dither Gradient Modifier successfully",
"Gradient Generator is cleared from the Dither Gradient Modifier successfully",
"Entity has a Invert Gradient Modifier component",
"Gradient Generator is pinned to the Invert Gradient Modifier successfully",
"Gradient Generator is cleared from the Invert Gradient Modifier successfully",
"Entity has a Levels Gradient Modifier component",
"Gradient Generator is pinned to the Levels Gradient Modifier successfully",
"Gradient Generator is cleared from the Levels Gradient Modifier successfully",
"Entity has a Posterize Gradient Modifier component",
"Gradient Generator is pinned to the Posterize Gradient Modifier successfully",
"Gradient Generator is cleared from the Posterize Gradient Modifier successfully",
"Entity has a Smooth-Step Gradient Modifier component",
"Gradient Generator is pinned to the Smooth-Step Gradient Modifier successfully",
"Gradient Generator is cleared from the Smooth-Step Gradient Modifier successfully",
"Entity has a Threshold Gradient Modifier component",
"Gradient Generator is pinned to the Threshold Gradient Modifier successfully",
"Gradient Generator is cleared from the Threshold Gradient Modifier successfully",
]
unexpected_lines = [
"Failed to pin Gradient Generator to the Dither Gradient Modifier",
"Failed to clear Gradient Generator from the Dither Gradient Modifier",
"Failed to pin Gradient Generator to the Invert Gradient Modifier",
"Failed to clear Gradient Generator from the Invert Gradient Modifier",
"Failed to pin Gradient Generator to the Levels Gradient Modifier",
"Failed to clear Gradient Generator from the Levels Gradient Modifier",
"Failed to pin Gradient Generator to the Posterize Gradient Modifier",
"Failed to clear Gradient Generator from the Posterize Gradient Modifier",
"Failed to pin Gradient Generator to the Smooth-Step Gradient Modifier",
"Failed to clear Gradient Generator from the Smooth-Step Gradient Modifier",
"Failed to pin Gradient Generator to the Threshold Gradient Modifier",
"Failed to clear Gradient Generator from the Threshold Gradient Modifier",
]
hydra.launch_and_validate_results(
request,
test_directory,
editor,
"GradientSampling_GradientReferencesAddRemoveSuccessfully.py",
expected_lines,
unexpected_lines,
cfg_args=[level]
)
@@ -1,116 +0,0 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
import os
import pytest
import logging
# Bail on the test if ly_test_tools doesn't exist.
pytest.importorskip("ly_test_tools")
import ly_test_tools.environment.file_system as file_system
import editor_python_test_tools.hydra_test_utils as hydra
logger = logging.getLogger(__name__)
test_directory = os.path.join(os.path.dirname(__file__), "EditorScripts")
@pytest.mark.parametrize("project", ["AutomatedTesting"])
@pytest.mark.parametrize("level", ["tmp_level"])
@pytest.mark.usefixtures("automatic_process_killer")
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
class TestGradientSurfaceTagEmitter(object):
@pytest.fixture(autouse=True)
def setup_teardown(self, request, workspace, project, level):
# Cleanup temp level before and after test runs
def teardown():
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
request.addfinalizer(teardown)
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
@pytest.mark.test_case_id("C3297302")
@pytest.mark.SUITE_periodic
def test_GradientSurfaceTagEmitter_ComponentDependencies(self, request, editor, level, workspace,
launcher_platform):
cfg_args = [level]
expected_lines = [
"GradientSurfaceTagEmitter_ComponentDependencies: test started",
"GradientSurfaceTagEmitter_ComponentDependencies: Gradient Surface Tag Emitter is Disabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Dither Gradient Modifier and Gradient Surface Tag Emitter are enabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Gradient Mixer and Gradient Surface Tag Emitter are enabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Invert Gradient Modifier and Gradient Surface Tag Emitter are enabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Levels Gradient Modifier and Gradient Surface Tag Emitter are enabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Posterize Gradient Modifier and Gradient Surface Tag Emitter are enabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Smooth-Step Gradient Modifier and Gradient Surface Tag Emitter are enabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Threshold Gradient Modifier and Gradient Surface Tag Emitter are enabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Altitude Gradient and Gradient Surface Tag Emitter are enabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Constant Gradient and Gradient Surface Tag Emitter are enabled",
"GradientSurfaceTagEmitter_ComponentDependencies: FastNoise Gradient and Gradient Surface Tag Emitter are enabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Image Gradient and Gradient Surface Tag Emitter are enabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Perlin Noise Gradient and Gradient Surface Tag Emitter are enabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Random Noise Gradient and Gradient Surface Tag Emitter are enabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Reference Gradient and Gradient Surface Tag Emitter are enabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Shape Falloff Gradient and Gradient Surface Tag Emitter are enabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Slope Gradient and Gradient Surface Tag Emitter are enabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Surface Mask Gradient and Gradient Surface Tag Emitter are enabled",
"GradientSurfaceTagEmitter_ComponentDependencies: result=SUCCESS",
]
unexpected_lines = [
"GradientSurfaceTagEmitter_ComponentDependencies: Gradient Surface Tag Emitter is Enabled, but should be Disabled without dependencies met",
"GradientSurfaceTagEmitter_ComponentDependencies: Dither Gradient Modifier and Gradient Surface Tag Emitter are disabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Gradient Mixer and Gradient Surface Tag Emitter are disabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Invert Gradient Modifier and Gradient Surface Tag Emitter are disabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Levels Gradient Modifier and Gradient Surface Tag Emitter are disabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Posterize Gradient Modifier and Gradient Surface Tag Emitter are disabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Smooth-Step Gradient Modifier and Gradient Surface Tag Emitter are disabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Threshold Gradient Modifier and Gradient Surface Tag Emitter are disabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Altitude Gradient and Gradient Surface Tag Emitter are disabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Constant Gradient and Gradient Surface Tag Emitter are disabled",
"GradientSurfaceTagEmitter_ComponentDependencies: FastNoise Gradient and Gradient Surface Tag Emitter are disabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Image Gradient and Gradient Surface Tag Emitter are disabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Perlin Noise Gradient and Gradient Surface Tag Emitter are disabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Random Noise Gradient and Gradient Surface Tag Emitter are disabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Reference Gradient and Gradient Surface Tag Emitter are disabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Shape Falloff Gradient and Gradient Surface Tag Emitter are disabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Slope Gradient and Gradient Surface Tag Emitter are disabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Surface Mask Gradient and Gradient Surface Tag Emitter are disabled",
]
hydra.launch_and_validate_results(
request,
test_directory,
editor,
"GradientSurfaceTagEmitter_ComponentDependencies.py",
expected_lines=expected_lines,
unexpected_lines=unexpected_lines,
cfg_args=cfg_args
)
@pytest.mark.test_case_id("C3297303")
@pytest.mark.SUITE_periodic
def test_GradientSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully(self, request, editor, level,
launcher_platform):
expected_lines = [
"Entity has a Gradient Surface Tag Emitter component",
"Entity has a Reference Gradient component",
"Added SurfaceTag: container count is 1",
"Removed SurfaceTag: container count is 0",
"GradientSurfaceTagEmitter_SurfaceTagsAddRemoveSucessfully: result=SUCCESS"
]
hydra.launch_and_validate_results(
request,
test_directory,
editor,
"GradientSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully.py",
expected_lines,
cfg_args=[level]
)
@@ -1,157 +0,0 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
"""
Tests that the Gradient Transform Modifier component isn't enabled unless it has a component on
the same Entity that provides the ShapeService (e.g. box shape, or reference shape)
"""
import os
import pytest
# Bail on the test if ly_test_tools doesn't exist.
pytest.importorskip('ly_test_tools')
import ly_test_tools.environment.file_system as file_system
import editor_python_test_tools.hydra_test_utils as hydra
test_directory = os.path.join(os.path.dirname(__file__), 'EditorScripts')
@pytest.mark.parametrize('project', ['AutomatedTesting'])
@pytest.mark.parametrize('level', ['tmp_level'])
@pytest.mark.usefixtures("automatic_process_killer")
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
class TestGradientTransformRequiresShape(object):
@pytest.fixture(autouse=True)
def setup_teardown(self, request, workspace, project, level):
def teardown():
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
request.addfinalizer(teardown)
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
@pytest.mark.test_case_id('C3430289')
@pytest.mark.SUITE_periodic
def test_GradientTransform_RequiresShape(self, request, editor, level, launcher_platform):
expected_lines = [
"Gradient Transform Modifier component was added to entity, but the component is disabled",
"Gradient Transform component is not active without a Shape component on the Entity",
"Box Shape component was added to entity",
"Gradient Transform Modifier component is active now that the Entity has a Shape",
"GradientTransformRequiresShape: result=SUCCESS"
]
hydra.launch_and_validate_results(
request,
test_directory,
editor,
"GradientTransform_RequiresShape.py",
expected_lines,
cfg_args=[level]
)
@pytest.mark.test_case_id("C3430292")
@pytest.mark.SUITE_periodic
def test_GradientTransform_FrequencyZoomCanBeSetBeyondSliderRange(self, request, editor, level, launcher_platform):
expected_lines = [
"Entity Created",
"Entity has a Random Noise Gradient component",
"Entity has a Gradient Transform Modifier component",
"Entity has a Box Shape component",
"Components added to the entity",
"entity Configuration|Frequency Zoom: SUCCESS",
"Frequency Zoom is equal to expected value",
]
unexpected_lines = ["Frequency Zoom is not equal to expected value"]
hydra.launch_and_validate_results(
request,
test_directory,
editor,
"GradientTransform_FrequencyZoomCanBeSetBeyondSliderRange.py",
expected_lines,
unexpected_lines=unexpected_lines,
cfg_args=[level]
)
@pytest.mark.test_case_id("C3430297")
@pytest.mark.SUITE_periodic
def test_GradientTransform_ComponentIncompatibleWithSpawners(self, request, editor, launcher_platform, level):
# C3430297: Component cannot be active on the same Entity as an active Vegetation Layer Spawner
expected_lines = [
"Entity has a Gradient Transform Modifier component",
"Entity has a Box Shape component",
"New Entity Created",
"Gradient Transform Modifier is Enabled",
"Box Shape is Enabled",
"Entity has a Vegetation Layer Spawner component",
"Vegetation Layer Spawner is incompatible and disabled",
"GradientTransform_ComponentIncompatibleWithSpawners: result=SUCCESS"
]
unexpected_lines = [
"Gradient Transform Modifier is Disabled. But It should be Enabled in an Entity",
"Box Shape is Disabled. But It should be Enabled in an Entity",
"Vegetation Layer Spawner is compatible and enabled. But It should be Incompatible and disabled",
]
hydra.launch_and_validate_results(
request,
test_directory,
editor,
"GradientTransform_ComponentIncompatibleWithSpawners.py",
expected_lines,
unexpected_lines,
cfg_args=[level]
)
@pytest.mark.test_case_id("C4753767")
@pytest.mark.SUITE_periodic
def test_GradientTransform_ComponentIncompatibleWithExpectedGradients(self, request, editor, launcher_platform, level):
expected_lines = [
"Entity has a Gradient Transform Modifier component",
"Entity has a Box Shape component",
"New Entity Created",
"Gradient Transform Modifier is Enabled",
"Box Shape is Enabled",
"Entity has a Constant Gradient component",
"Entity has a Altitude Gradient component",
"Entity has a Gradient Mixer component",
"Entity has a Reference Gradient component",
"Entity has a Shape Falloff Gradient component",
"Entity has a Slope Gradient component",
"Entity has a Surface Mask Gradient component",
"All newly added components are incompatible and disabled",
"GradientTransform_ComponentIncompatibleWithExpectedGradients: result=SUCCESS"
]
unexpected_lines = [
"Gradient Transform Modifier is disabled, but it should be enabled",
"Box Shape is disabled, but it should be enabled",
"Constant Gradient is enabled, but should be disabled",
"Altitude Gradient is enabled, but should be disabled",
"Gradient Mixer is enabled, but should be disabled",
"Reference Gradient is enabled, but should be disabled",
"Shape Falloff Gradient is enabled, but should be disabled",
"Slope Gradient is enabled, but should be disabled",
"Surface Mask Gradient component is enabled, but should be disabled",
]
hydra.launch_and_validate_results(
request,
test_directory,
editor,
"GradientTransform_ComponentIncompatibleWithExpectedGradients.py",
expected_lines,
unexpected_lines,
cfg_args=[level]
)
@@ -1,69 +0,0 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
import os
import pytest
# Bail on the test if ly_test_tools doesn't exist.
pytest.importorskip('ly_test_tools')
import ly_test_tools.environment.file_system as file_system
import editor_python_test_tools.hydra_test_utils as hydra
test_directory = os.path.join(os.path.dirname(__file__), 'EditorScripts')
@pytest.mark.parametrize('project', ['AutomatedTesting'])
@pytest.mark.parametrize('level', ['tmp_level'])
@pytest.mark.usefixtures("automatic_process_killer")
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
class TestImageGradientRequiresShape(object):
@pytest.fixture(autouse=True)
def setup_teardown(self, request, workspace, project, level):
def teardown():
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
request.addfinalizer(teardown)
@pytest.mark.test_case_id('C2707570')
@pytest.mark.SUITE_periodic
def test_ImageGradient_RequiresShape(self, request, editor, level, launcher_platform):
cfg_args = [level]
expected_lines = [
"Image Gradient component was added to entity, but the component is disabled",
"Gradient Transform Modifier component was added to entity, but the component is disabled",
"Image Gradient component is not active without a Shape component on the Entity",
"Box Shape component was added to entity",
"Image Gradient component is active now that the Entity has a Shape",
"ImageGradientRequiresShape: result=SUCCESS"
]
hydra.launch_and_validate_results(request, test_directory, editor,
'ImageGradient_RequiresShape.py',
expected_lines=expected_lines, cfg_args=cfg_args)
@pytest.mark.test_case_id("C3829430")
@pytest.mark.SUITE_periodic
def test_ImageGradient_ProcessedImageAssignedSuccessfully(self, request, editor, level, launcher_platform):
expected_lines = [
"Image Gradient Entity created",
"Entity has a Image Gradient component",
"Entity has a Gradient Transform Modifier component",
"Entity has a Box Shape component",
"image_grad_test_gsi.png was found in the workspace",
"Entity Configuration|Image Asset: SUCCESS",
"ImageGradient_ProcessedImageAssignedSucessfully: result=SUCCESS",
]
hydra.launch_and_validate_results(
request,
test_directory,
editor,
"ImageGradient_ProcessedImageAssignedSuccessfully.py",
expected_lines,
cfg_args=[level]
)
@@ -17,6 +17,12 @@ from ly_test_tools.o3de.editor_test import EditorSingleTest, EditorSharedTest, E
@pytest.mark.parametrize("project", ["AutomatedTesting"])
class TestAutomation(EditorTestSuite):
class test_LandscapeCanvas_SlotConnections_UpdateComponentReferences(EditorSharedTest):
from .EditorScripts import SlotConnections_UpdateComponentReferences as test_module
class test_LandscapeCanvas_GradientMixer_NodeConstruction(EditorSharedTest):
from .EditorScripts import GradientMixer_NodeConstruction as test_module
class test_LandscapeCanvas_AreaNodes_DependentComponentsAdded(EditorSharedTest):
from .EditorScripts import AreaNodes_DependentComponentsAdded as test_module
@@ -86,4 +92,4 @@ class TestAutomation(EditorTestSuite):
from .EditorScripts import ShapeNodes_EntityCreatedOnNodeAdd as test_module
class test_LandscapeCanvas_ShapeNodes_EntityRemovedOnNodeDelete(EditorSharedTest):
from .EditorScripts import ShapeNodes_EntityRemovedOnNodeDelete as test_module
from .EditorScripts import ShapeNodes_EntityRemovedOnNodeDelete as test_module
@@ -1,125 +0,0 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
"""
C13815919 - Appropriate component dependencies are automatically added to node entities
C13767844 - All Vegetation Area nodes can be added to a graph
C17605868 - All Vegetation Area nodes can be removed from a graph
C13815873 - All Filters/Modifiers/Selectors can be added to/removed from a Layer node
"""
import os
import pytest
# Bail on the test if ly_test_tools doesn't exist.
pytest.importorskip('ly_test_tools')
import ly_test_tools.environment.file_system as file_system
import editor_python_test_tools.hydra_test_utils as hydra
test_directory = os.path.join(os.path.dirname(__file__), 'EditorScripts')
@pytest.mark.parametrize('project', ['AutomatedTesting'])
@pytest.mark.parametrize('level', ['tmp_level'])
@pytest.mark.usefixtures("automatic_process_killer")
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
class TestAreaNodes(object):
@pytest.fixture(autouse=True)
def setup_teardown(self, request, workspace, project, level):
def teardown():
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
request.addfinalizer(teardown)
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
@pytest.mark.test_case_id('C13815919')
@pytest.mark.SUITE_periodic
def test_LandscapeCanvas_AreaNodes_DependentComponentsAdded(self, request, editor, level, launcher_platform):
cfg_args = [level]
expected_lines = [
"Landscape Canvas pane is open",
"New graph created",
"Graph registered with Landscape Canvas",
"SpawnerAreaNode created new Entity with all required components",
"MeshBlockerAreaNode created new Entity with all required components",
"BlockerAreaNode created new Entity with all required components",
"AreaNodeComponentDependency: result=SUCCESS"
]
hydra.launch_and_validate_results(request, test_directory, editor, 'AreaNodes_DependentComponentsAdded.py',
expected_lines, cfg_args=cfg_args)
@pytest.mark.test_case_id('C13767844')
@pytest.mark.SUITE_periodic
def test_LandscapeCanvas_AreaNodes_EntityCreatedOnNodeAdd(self, request, editor, level, launcher_platform):
"""
Verifies all Area nodes can be successfully added to a Landscape Canvas graph, and the proper entity
creation occurs.
"""
cfg_args = [level]
expected_lines = [
"Landscape Canvas pane is open",
"New graph created",
"Graph registered with Landscape Canvas",
"AreaBlenderNode created new Entity with Vegetation Layer Blender Component",
"BlockerAreaNode created new Entity with Vegetation Layer Blocker Component",
"MeshBlockerAreaNode created new Entity with Vegetation Layer Blocker (Mesh) Component",
"SpawnerAreaNode created new Entity with Vegetation Layer Spawner Component",
"AreaNodeEntityCreate: result=SUCCESS"
]
hydra.launch_and_validate_results(request, test_directory, editor, 'AreaNodes_EntityCreatedOnNodeAdd.py',
expected_lines, cfg_args=cfg_args)
@pytest.mark.test_case_id('C17605868')
@pytest.mark.SUITE_periodic
def test_LandscapeCanvas_AreaNodes_EntityRemovedOnNodeDelete(self, request, editor, level, launcher_platform):
"""
Verifies all Area nodes can be successfully removed from a Landscape Canvas graph, and the proper entity
cleanup occurs.
"""
cfg_args = [level]
expected_lines = [
"Landscape Canvas pane is open",
"New graph created",
"Graph registered with Landscape Canvas",
"AreaBlenderNode corresponding Entity was deleted when node is removed",
"MeshBlockerAreaNode corresponding Entity was deleted when node is removed",
"SpawnerAreaNode corresponding Entity was deleted when node is removed",
"BlockerAreaNode corresponding Entity was deleted when node is removed",
"AreaNodeEntityDelete: result=SUCCESS"
]
hydra.launch_and_validate_results(request, test_directory, editor,
'AreaNodes_EntityRemovedOnNodeDelete.py', expected_lines, cfg_args=cfg_args)
@pytest.mark.test_case_id('C13815873')
@pytest.mark.SUITE_periodic
def test_LandscapeCanvas_LayerExtenderNodes_ComponentEntitySync(self, request, editor, level, launcher_platform):
"""
Verifies all Area Extender nodes can be successfully added to and removed from a Landscape Canvas graph, and the
proper entity creation/cleanup occurs.
"""
cfg_args = [level]
expected_lines = [
"Landscape Canvas pane is open",
"New graph created",
"Graph registered with Landscape Canvas",
"AreaBlenderNode successfully added and removed all filters/modifiers/selectors",
"SpawnerAreaNode successfully added and removed all filters/modifiers/selectors",
"LayerExtenderNodeComponentEntitySync: result=SUCCESS"
]
hydra.launch_and_validate_results(request, test_directory, editor,
'LayerExtenderNodes_ComponentEntitySync.py', expected_lines,
cfg_args=cfg_args)
@@ -1,84 +0,0 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
"""
C29278563 - Disabled nodes can be successfully duplicated
C30813586 - Editor remains stable after Undoing deletion of a node on a slice entity
"""
import os
import pytest
# Bail on the test if ly_test_tools doesn't exist.
pytest.importorskip('ly_test_tools')
import ly_test_tools.environment.file_system as file_system
import editor_python_test_tools.hydra_test_utils as hydra
test_directory = os.path.join(os.path.dirname(__file__), 'EditorScripts')
@pytest.mark.parametrize('project', ['AutomatedTesting'])
@pytest.mark.parametrize('level', ['tmp_level'])
@pytest.mark.usefixtures("automatic_process_killer")
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
class TestEditFunctionality(object):
@pytest.fixture(autouse=True)
def setup_teardown(self, request, workspace, project, level):
def teardown():
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
request.addfinalizer(teardown)
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
@pytest.mark.test_case_id('C29278563')
@pytest.mark.SUITE_periodic
def test_LandscapeCanvas_DuplicateDisabledNodes(self, request, editor, level, launcher_platform):
cfg_args = [level]
expected_lines = [
"Landscape Canvas pane is open",
"New graph created",
"SpawnerAreaNode duplicated with disabled component",
"SpawnerAreaNode duplicated with deleted component",
"MeshBlockerAreaNode duplicated with disabled component",
"MeshBlockerAreaNode duplicated with deleted component",
"BlockerAreaNode duplicated with disabled component",
"BlockerAreaNode duplicated with deleted component",
"FastNoiseGradientNode duplicated with disabled component",
"FastNoiseGradientNode duplicated with deleted component",
"ImageGradientNode duplicated with disabled component",
"ImageGradientNode duplicated with deleted component",
"PerlinNoiseGradientNode duplicated with disabled component",
"PerlinNoiseGradientNode duplicated with deleted component",
"RandomNoiseGradientNode duplicated with disabled component",
"RandomNoiseGradientNode duplicated with deleted component",
"DisabledNodeDuplication: result=SUCCESS"
]
hydra.launch_and_validate_results(request, test_directory, editor, 'Edit_DisabledNodeDuplication.py',
expected_lines, cfg_args=cfg_args)
@pytest.mark.test_case_id('C30813586')
@pytest.mark.SUITE_periodic
def test_LandscapeCanvas_UndoNodeDelete_SliceEntity(self, request, editor, level, launcher_platform):
cfg_args = [level]
expected_lines = [
"Vegetation Layer Spawner node found on graph",
"Vegetation Layer Spawner node was removed",
"Editor is still responsive",
"UndoNodeDeleteSlice: result=SUCCESS"
]
unexpected_lines = [
"Vegetation Layer Spawner node not found",
"Vegetation Layer Spawner node was not removed"
]
hydra.launch_and_validate_results(request, test_directory, editor, 'Edit_UndoNodeDelete_SliceEntity.py',
expected_lines, unexpected_lines=unexpected_lines, cfg_args=cfg_args)
@@ -1,173 +0,0 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
"""
C2735988 - Landscape Canvas tool can be opened/closed
C13815862 - New graph can be created
C13767840 - New root entity is created when a new graph is created through Landscape Canvas
"""
import os
import pytest
# Bail on the test if ly_test_tools doesn't exist.
pytest.importorskip("ly_test_tools")
import ly_test_tools.environment.file_system as file_system
import editor_python_test_tools.hydra_test_utils as hydra
test_directory = os.path.join(os.path.dirname(__file__), "EditorScripts")
@pytest.mark.parametrize("project", ["AutomatedTesting"])
@pytest.mark.parametrize("level", ["tmp_level"])
@pytest.mark.usefixtures("automatic_process_killer")
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
class TestGeneralGraphFunctionality(object):
@pytest.fixture(autouse=True)
def setup_teardown(self, request, workspace, project, level):
def teardown():
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "slices", "TestSlice.slice")], True, True)
request.addfinalizer(teardown)
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "slices", "TestSlice.slice")], True, True)
@pytest.mark.test_case_id("C2735988", "C13815862", "C13767840")
@pytest.mark.SUITE_periodic
def test_LandscapeCanvas_NewGraph_CreatedSuccessfully(self, request, editor, level, launcher_platform):
cfg_args = [level]
expected_lines = [
"Landscape Canvas pane is open",
"New graph created",
"Graph registered with Landscape Canvas",
"Root entity has Landscape Canvas component",
"Landscape Canvas pane is closed",
"CreateNewGraph: result=SUCCESS",
]
hydra.launch_and_validate_results(
request,
test_directory,
editor,
"CreateNewGraph.py",
expected_lines,
cfg_args=cfg_args
)
@pytest.mark.test_case_id("C2735990")
@pytest.mark.SUITE_periodic
def test_LandscapeCanvas_Component_AddedRemoved(self, request, editor, level, launcher_platform):
cfg_args = [level]
expected_lines = [
"Landscape Canvas Component added to Entity",
"Landscape Canvas Component removed from Entity",
"LandscapeCanvasComponentAddedRemoved: result=SUCCESS",
]
hydra.launch_and_validate_results(
request,
test_directory,
editor,
"LandscapeCanvasComponent_AddedRemoved.py",
expected_lines,
cfg_args=cfg_args
)
@pytest.mark.test_case_id("C14212352")
@pytest.mark.SUITE_periodic
def test_LandscapeCanvas_GraphClosed_OnLevelChange(self, request, editor, level, launcher_platform):
cfg_args = [level]
expected_lines = [
"Landscape Canvas pane is open",
"New graph created",
"Graph registered with Landscape Canvas",
"Graph is no longer open in Landscape Canvas",
"GraphClosedOnLevelChange: result=SUCCESS",
]
hydra.launch_and_validate_results(
request,
test_directory,
editor,
"GraphClosed_OnLevelChange.py",
expected_lines,
cfg_args=cfg_args
)
@pytest.mark.test_case_id("C17488412")
@pytest.mark.SUITE_periodic
@pytest.mark.xfail(reason="https://github.com/o3de/o3de/issues/2201")
def test_LandscapeCanvas_GraphClosed_OnEntityDelete(self, request, editor, level, launcher_platform):
cfg_args = [level]
expected_lines = [
"Landscape Canvas pane is open",
"Graph registered with Landscape Canvas",
"The graph is no longer open after deleting the Entity",
"GraphClosedOnEntityDelete: result=SUCCESS",
]
hydra.launch_and_validate_results(
request,
test_directory,
editor,
"GraphClosed_OnEntityDelete.py",
expected_lines,
cfg_args=cfg_args
)
@pytest.mark.test_case_id("C15167461")
@pytest.mark.SUITE_periodic
def test_LandscapeCanvas_GraphClosed_TabbedGraphClosesIndependently(self, request, editor, level,
launcher_platform):
cfg_args = [level]
expected_lines = [
"Landscape Canvas pane is open",
"New graph created",
"2nd new graph created",
"3rd new graph created",
"Graphs registered with Landscape Canvas",
"Graph 2 was successfully closed",
"GraphClosedTabbedGraph: result=SUCCESS",
]
hydra.launch_and_validate_results(
request,
test_directory,
editor,
"GraphClosed_TabbedGraph.py",
expected_lines,
cfg_args=cfg_args
)
@pytest.mark.test_case_id("C22602016")
@pytest.mark.SUITE_periodic
def test_LandscapeCanvas_SliceCreateInstantiate(self, request, editor, level, workspace, launcher_platform):
cfg_args = [level]
expected_lines = [
"LandscapeCanvas_SliceCreateInstantiate: test started",
"landscape_canvas_entity Entity successfully created",
"LandscapeCanvas_SliceCreateInstantiate: Slice has been created successfully: True",
"LandscapeCanvas_SliceCreateInstantiate: Slice instantiated: True",
"LandscapeCanvas_SliceCreateInstantiate: result=SUCCESS",
]
hydra.launch_and_validate_results(
request,
test_directory,
editor,
"LandscapeCanvas_SliceCreateInstantiate.py",
expected_lines=expected_lines,
cfg_args=cfg_args
)
@@ -1,92 +0,0 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
"""
C13767841 - All Gradient Modifier nodes can be added to a graph
C18055051 - All Gradient Modifier nodes can be removed from a graph
"""
import os
import pytest
# Bail on the test if ly_test_tools doesn't exist.
pytest.importorskip('ly_test_tools')
import ly_test_tools.environment.file_system as file_system
import editor_python_test_tools.hydra_test_utils as hydra
test_directory = os.path.join(os.path.dirname(__file__), 'EditorScripts')
@pytest.mark.parametrize('project', ['AutomatedTesting'])
@pytest.mark.parametrize('level', ['tmp_level'])
@pytest.mark.usefixtures("automatic_process_killer")
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
class TestGradientModifierNodes(object):
@pytest.fixture(autouse=True)
def setup_teardown(self, request, workspace, project, level):
def teardown():
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
request.addfinalizer(teardown)
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
@pytest.mark.test_case_id('C13767841')
@pytest.mark.SUITE_periodic
def test_LandscapeCanvas_GradientModifierNodes_EntityCreatedOnNodeAdd(self, request, editor, level,
launcher_platform):
"""
Verifies all Gradient Modifier nodes can be successfully added to a Landscape Canvas graph, and the proper
entity creation occurs.
"""
cfg_args = [level]
expected_lines = [
"Landscape Canvas pane is open",
"New graph created",
"Graph registered with Landscape Canvas",
"DitherGradientModifierNode created new Entity with Dither Gradient Modifier Component",
"GradientMixerNode created new Entity with Gradient Mixer Component",
"InvertGradientModifierNode created new Entity with Invert Gradient Modifier Component",
"LevelsGradientModifierNode created new Entity with Levels Gradient Modifier Component",
"PosterizeGradientModifierNode created new Entity with Posterize Gradient Modifier Component",
"SmoothStepGradientModifierNode created new Entity with Smooth-Step Gradient Modifier Component",
"ThresholdGradientModifierNode created new Entity with Threshold Gradient Modifier Component",
"GradientModifierNodeEntityCreate: result=SUCCESS"
]
hydra.launch_and_validate_results(request, test_directory, editor,
'GradientModifierNodes_EntityCreatedOnNodeAdd.py',
expected_lines, cfg_args=cfg_args)
@pytest.mark.test_case_id('C18055051')
@pytest.mark.SUITE_periodic
def test_LandscapeCanvas_GradientModifierNodes_EntityRemovedOnNodeDelete(self, request, editor, level,
launcher_platform):
"""
Verifies all Gradient Modifier nodes can be successfully removed from a Landscape Canvas graph, and the proper
entity cleanup occurs.
"""
cfg_args = [level]
expected_lines = [
"Landscape Canvas pane is open",
"New graph created",
"Graph registered with Landscape Canvas",
"DitherGradientModifierNode corresponding Entity was deleted when node is removed",
"GradientMixerNode corresponding Entity was deleted when node is removed",
"InvertGradientModifierNode corresponding Entity was deleted when node is removed",
"LevelsGradientModifierNode corresponding Entity was deleted when node is removed",
"PosterizeGradientModifierNode corresponding Entity was deleted when node is removed",
"SmoothStepGradientModifierNode corresponding Entity was deleted when node is removed",
"ThresholdGradientModifierNode corresponding Entity was deleted when node is removed",
"GradientModifierNodeEntityDelete: result=SUCCESS"
]
hydra.launch_and_validate_results(request, test_directory, editor,
'GradientModifierNodes_EntityRemovedOnNodeDelete.py',
expected_lines, cfg_args=cfg_args)
@@ -1,109 +0,0 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
"""
C13815920 - Appropriate component dependencies are automatically added to node entities
C13767842 - All Gradient nodes can be added to a graph
C17461363 - All Gradient nodes can be removed from a graph
"""
import os
import pytest
# Bail on the test if ly_test_tools doesn't exist.
pytest.importorskip('ly_test_tools')
import ly_test_tools.environment.file_system as file_system
import editor_python_test_tools.hydra_test_utils as hydra
test_directory = os.path.join(os.path.dirname(__file__), 'EditorScripts')
@pytest.mark.parametrize('project', ['AutomatedTesting'])
@pytest.mark.parametrize('level', ['tmp_level'])
@pytest.mark.usefixtures("automatic_process_killer")
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
class TestGradientNodes(object):
@pytest.fixture(autouse=True)
def setup_teardown(self, request, workspace, project, level):
def teardown():
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
request.addfinalizer(teardown)
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
@pytest.mark.test_case_id('C13815920')
@pytest.mark.SUITE_periodic
def test_LandscapeCanvas_GradientNodes_DependentComponentsAdded(self, request, editor, level, launcher_platform):
cfg_args = [level]
expected_lines = [
"Landscape Canvas pane is open",
"New graph created",
"Graph registered with Landscape Canvas",
"FastNoiseGradientNode created new Entity with all required components",
"ImageGradientNode created new Entity with all required components",
"PerlinNoiseGradientNode created new Entity with all required components",
"RandomNoiseGradientNode created new Entity with all required components"
]
hydra.launch_and_validate_results(request, test_directory, editor, 'GradientNodes_DependentComponentsAdded.py',
expected_lines, cfg_args=cfg_args)
@pytest.mark.test_case_id('C13767842')
@pytest.mark.SUITE_periodic
def test_LandscapeCanvas_GradientNodes_EntityCreatedOnNodeAdd(self, request, editor, level, launcher_platform):
"""
Verifies all Gradient nodes can be successfully added to a Landscape Canvas graph, and the proper entity
creation occurs.
"""
cfg_args = [level]
expected_lines = [
"Landscape Canvas pane is open",
"New graph created",
"Graph registered with Landscape Canvas",
"AltitudeGradientNode created new Entity with Altitude Gradient Component",
"ConstantGradientNode created new Entity with Constant Gradient Component",
"FastNoiseGradientNode created new Entity with FastNoise Gradient Component",
"ImageGradientNode created new Entity with Image Gradient Component",
"PerlinNoiseGradientNode created new Entity with Perlin Noise Gradient Component",
"RandomNoiseGradientNode created new Entity with Random Noise Gradient Component",
"ShapeAreaFalloffGradientNode created new Entity with Shape Falloff Gradient Component",
"SlopeGradientNode created new Entity with Slope Gradient Component",
"SurfaceMaskGradientNode created new Entity with Surface Mask Gradient Component"
]
hydra.launch_and_validate_results(request, test_directory, editor, 'GradientNodes_EntityCreatedOnNodeAdd.py',
expected_lines, cfg_args=cfg_args)
@pytest.mark.test_case_id('C17461363')
@pytest.mark.SUITE_periodic
def test_LandscapeCanvas_GradientNodes_EntityRemovedOnNodeDelete(self, request, editor, level, launcher_platform):
"""
Verifies all Gradient nodes can be successfully removed from a Landscape Canvas graph, and the proper entity
cleanup occurs.
"""
cfg_args = [level]
expected_lines = [
"Landscape Canvas pane is open",
"New graph created",
"Graph registered with Landscape Canvas",
"FastNoiseGradientNode corresponding Entity was deleted when node is removed",
"AltitudeGradientNode corresponding Entity was deleted when node is removed",
"ConstantGradientNode corresponding Entity was deleted when node is removed",
"RandomNoiseGradientNode corresponding Entity was deleted when node is removed",
"ShapeAreaFalloffGradientNode corresponding Entity was deleted when node is removed",
"SlopeGradientNode corresponding Entity was deleted when node is removed",
"PerlinNoiseGradientNode corresponding Entity was deleted when node is removed",
"ImageGradientNode corresponding Entity was deleted when node is removed",
"SurfaceMaskGradientNode corresponding Entity was deleted when node is removed"
]
hydra.launch_and_validate_results(request, test_directory, editor, 'GradientNodes_EntityRemovedOnNodeDelete.py',
expected_lines, cfg_args=cfg_args)
@@ -1,167 +0,0 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
"""
C4705586 - Altering connections on graph nodes appropriately updates component properties
C22715182 - Components are updated when nodes are added/removed/updated
C22602072 - Graph is updated when underlying components are added/removed
C15987206 - Gradient Mixer Layers are properly setup when constructing in a graph
C21333743 - Vegetation Layer Blenders are properly setup when constructing in a graph
"""
import os
import pytest
# Bail on the test if ly_test_tools doesn't exist.
pytest.importorskip('ly_test_tools')
import ly_test_tools.environment.file_system as file_system
import ly_test_tools._internal.pytest_plugin as internal_plugin
import editor_python_test_tools.hydra_test_utils as hydra
test_directory = os.path.join(os.path.dirname(__file__), 'EditorScripts')
@pytest.mark.parametrize('project', ['AutomatedTesting'])
@pytest.mark.parametrize('level', ['tmp_level'])
@pytest.mark.usefixtures("automatic_process_killer")
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
class TestGraphComponentSync(object):
@pytest.fixture(autouse=True)
def setup_teardown(self, request, workspace, project, level):
def teardown():
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
request.addfinalizer(teardown)
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
@pytest.mark.test_case_id('C4705586')
@pytest.mark.BAT
@pytest.mark.SUITE_main
def test_LandscapeCanvas_SlotConnections_UpdateComponentReferences(self, request, editor, level, launcher_platform):
# Skip test if running against Debug build
if "debug" in internal_plugin.build_directory:
pytest.skip("Does not execute against debug builds.")
cfg_args = [level]
expected_lines = [
"Landscape Canvas pane is open",
"New graph created",
"Graph registered with Landscape Canvas",
"Random Noise Gradient component Preview Entity property set to Box Shape EntityId",
"Dither Gradient Modifier component Inbound Gradient property set to Random Noise Gradient EntityId",
"Gradient Mixer component Inbound Gradient extendable property set to Dither Gradient Modifier EntityId",
"SlotConnectionsUpdateComponents: result=SUCCESS"
]
hydra.launch_and_validate_results(request, test_directory, editor,
'SlotConnections_UpdateComponentReferences.py', expected_lines,
cfg_args=cfg_args)
@pytest.mark.test_case_id('C22715182')
@pytest.mark.SUITE_periodic
def test_LandscapeCanvas_GraphUpdates_UpdateComponents(self, request, editor, level, launcher_platform):
cfg_args = [level]
expected_lines = [
'Rotation Modifier component was removed from entity',
'BushSpawner entity was deleted',
'Gradient Entity Id reference was properly updated',
'GraphUpdatesUpdateComponents: result=SUCCESS'
]
unexpected_lines = [
'Rotation Modifier component is still present on entity',
'Failed to delete BushSpawner entity',
'Gradient Entity Id was not updated properly'
]
hydra.launch_and_validate_results(request, test_directory, editor, 'GraphUpdates_UpdateComponents.py',
expected_lines, unexpected_lines=unexpected_lines,
cfg_args=cfg_args)
@pytest.mark.test_case_id('C22602072')
@pytest.mark.SUITE_periodic
def test_LandscapeCanvas_ComponentUpdates_UpdateGraph(self, request, editor, level, launcher_platform):
cfg_args = [level]
expected_lines = [
"LandscapeCanvas entity found",
"BushSpawner entity found",
"Vegetation Distribution Filter on BushSpawner entity found",
"Graph opened",
"Distribution Filter node found on graph",
"Vegetation Altitude Filter on BushSpawner entity found",
"Altitude Filter node found on graph",
"Vegetation Distribution Filter removed from BushSpawner entity",
"Distribution Filter node was removed from the graph",
"New entity successfully added as a child of the BushSpawner entity",
"Box Shape on Box entity found",
"Box Shape node found on graph",
'ComponentUpdatesUpdateGraph: result=SUCCESS'
]
unexpected_lines = [
"Distribution Filter node not found on graph",
"Distribution Filter node is still present on the graph",
"Altitude Filter node not found on graph",
"New entity added with an unexpected parent",
"Box Shape node not found on graph"
]
hydra.launch_and_validate_results(request, test_directory, editor, 'ComponentUpdates_UpdateGraph.py',
expected_lines, unexpected_lines=unexpected_lines, cfg_args=cfg_args)
@pytest.mark.test_case_id('C15987206')
@pytest.mark.SUITE_main
def test_LandscapeCanvas_GradientMixer_NodeConstruction(self, request, editor, level, launcher_platform):
"""
Verifies a Gradient Mixer can be setup in Landscape Canvas and all references are property set.
"""
# Skip test if running against Debug build
if "debug" in internal_plugin.build_directory:
pytest.skip("Does not execute against debug builds.")
cfg_args = [level]
expected_lines = [
'Landscape Canvas pane is open',
'New graph created',
'Graph registered with Landscape Canvas',
'Perlin Noise Gradient component Preview Entity property set to Box Shape EntityId',
'Gradient Mixer component Inbound Gradient extendable property set to Perlin Noise Gradient EntityId',
'Gradient Mixer component Inbound Gradient extendable property set to FastNoise Gradient EntityId',
'Configuration|Layers|[0]|Operation set to 0',
'Configuration|Layers|[1]|Operation set to 6',
'GradientMixerNodeConstruction: result=SUCCESS'
]
hydra.launch_and_validate_results(request, test_directory, editor, 'GradientMixer_NodeConstruction.py',
expected_lines, cfg_args=cfg_args)
@pytest.mark.test_case_id('C21333743')
@pytest.mark.SUITE_periodic
def test_LandscapeCanvas_LayerBlender_NodeConstruction(self, request, editor, level, launcher_platform):
"""
Verifies a Layer Blender can be setup in Landscape Canvas and all references are property set.
"""
cfg_args = [level]
expected_lines = [
'Landscape Canvas pane is open',
'New graph created',
'Graph registered with Landscape Canvas',
'Vegetation Layer Blender component Vegetation Areas[0] property set to Vegetation Layer Spawner EntityId',
'Vegetation Layer Blender component Vegetation Areas[1] property set to Vegetation Layer Blocker EntityId',
'LayerBlenderNodeConstruction: result=SUCCESS'
]
hydra.launch_and_validate_results(request, test_directory, editor, 'LayerBlender_NodeConstruction.py',
expected_lines, cfg_args=cfg_args)
@@ -1,22 +0,0 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
import pytest
from ly_test_tools.o3de.editor_test import EditorSingleTest, EditorSharedTest, EditorParallelTest, EditorTestSuite
@pytest.mark.SUITE_periodic
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
@pytest.mark.parametrize("project", ["AutomatedTesting"])
class TestAutomation(EditorTestSuite):
class test_LandscapeCanvas_SlotConnections_UpdateComponentReferences(EditorSharedTest):
from .EditorScripts import SlotConnections_UpdateComponentReferences as test_module
class test_LandscapeCanvas_GradientMixer_NodeConstruction(EditorSharedTest):
from .EditorScripts import GradientMixer_NodeConstruction as test_module
@@ -1,82 +0,0 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
"""
C13767843 - All Shape nodes can be added to a graph
C17412059 - All Shape nodes can be removed from a graph
"""
import os
import pytest
# Bail on the test if ly_test_tools doesn't exist.
pytest.importorskip('ly_test_tools')
import ly_test_tools.environment.file_system as file_system
import editor_python_test_tools.hydra_test_utils as hydra
test_directory = os.path.join(os.path.dirname(__file__), 'EditorScripts')
@pytest.mark.parametrize('project', ['AutomatedTesting'])
@pytest.mark.parametrize('level', ['tmp_level'])
@pytest.mark.usefixtures("automatic_process_killer")
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
class TestShapeNodes(object):
@pytest.fixture(autouse=True)
def setup_teardown(self, request, workspace, project, level):
def teardown():
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
request.addfinalizer(teardown)
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
@pytest.mark.test_case_id('C13767843')
@pytest.mark.SUITE_periodic
def test_LandscapeCanvas_ShapeNodes_EntityCreatedOnNodeAdd(self, request, editor, level, launcher_platform):
cfg_args = [level]
expected_lines = [
"Landscape Canvas pane is open",
"New graph created",
"Graph registered with Landscape Canvas",
"BoxShapeNode created new Entity with Box Shape Component",
"CapsuleShapeNode created new Entity with Capsule Shape Component",
"CompoundShapeNode created new Entity with Compound Shape Component",
"CylinderShapeNode created new Entity with Cylinder Shape Component",
"PolygonPrismShapeNode created new Entity with Polygon Prism Shape Component",
"SphereShapeNode created new Entity with Sphere Shape Component",
"TubeShapeNode created new Entity with Tube Shape Component",
"DiskShapeNode created new Entity with Disk Shape Component",
"ShapeNodeEntityCreate: result=SUCCESS"
]
hydra.launch_and_validate_results(request, test_directory, editor, 'ShapeNodes_EntityCreatedOnNodeAdd.py',
expected_lines, cfg_args=cfg_args)
@pytest.mark.test_case_id('C17412059')
@pytest.mark.SUITE_periodic
def test_LandscapeCanvas_ShapeNodes_EntityRemovedOnNodeDelete(self, request, editor, level, launcher_platform):
cfg_args = [level]
expected_lines = [
"Landscape Canvas pane is open",
"New graph created",
"Graph registered with Landscape Canvas",
"BoxShapeNode corresponding Entity was deleted when node is removed",
"CapsuleShapeNode corresponding Entity was deleted when node is removed",
"CompoundShapeNode corresponding Entity was deleted when node is removed",
"CylinderShapeNode corresponding Entity was deleted when node is removed",
"PolygonPrismShapeNode corresponding Entity was deleted when node is removed",
"SphereShapeNode corresponding Entity was deleted when node is removed",
"TubeShapeNode corresponding Entity was deleted when node is removed",
"DiskShapeNode corresponding Entity was deleted when node is removed",
"ShapeNodeEntityDelete: result=SUCCESS"
]
hydra.launch_and_validate_results(request, test_directory, editor, 'ShapeNodes_EntityRemovedOnNodeDelete.py',
expected_lines, cfg_args=cfg_args)
File diff suppressed because it is too large Load Diff
+2 -1
View File
@@ -34,6 +34,7 @@
// AzQtComponents
#include <AzQtComponents/Components/StyledDockWidget.h>
#include <AzQtComponents/Components/Widgets/FileDialog.h>
// CryCommon
#include <CryCommon/Maestro/Bus/EditorSequenceComponentBus.h>
@@ -2324,7 +2325,7 @@ void CTrackViewDialog::SaveCurrentSequenceToFBX()
}
}
QString filename = QFileDialog::getSaveFileName(this, tr("Export Selected Nodes To FBX File"), selectedSequenceFBXStr, szFilters);
QString filename = AzQtComponents::FileDialog::GetSaveFileName(this, tr("Export Selected Nodes To FBX File"), selectedSequenceFBXStr, szFilters);
if (!filename.isEmpty())
{
pExportManager->SetBakedKeysSequenceExport(true);
+2 -1
View File
@@ -30,6 +30,7 @@
// AzQtComponents
#include <AzQtComponents/Components/Widgets/ColorPicker.h>
#include <AzQtComponents/Components/Widgets/FileDialog.h>
// CryCommon
#include <CryCommon/Maestro/Bus/EditorSequenceComponentBus.h>
@@ -1044,7 +1045,7 @@ void CTrackViewNodesCtrl::OnNMRclick(QPoint point)
file = QString::fromUtf8(selectedNodes.GetNode(0)->GetName().c_str()) + QString(".fbx");
}
QString path = QFileDialog::getSaveFileName(this, tr("Export Selected Nodes To FBX File"), QString(), tr("FBX Files (*.fbx)"));
QString path = AzQtComponents::FileDialog::GetSaveFileName(this, tr("Export Selected Nodes To FBX File"), QString(), tr("FBX Files (*.fbx)"));
if (!path.isEmpty())
{
@@ -16,7 +16,7 @@ namespace {{ xml.attrib['Name'] }}
//! @param handler the handler used to handle the received packet
//! @return boolean true on successful dispatch, false if the request was not handled
template <typename HANDLER>
bool DispatchPacket(AzNetworking::IConnection* connection, const AzNetworking::IPacketHeader& packetHeader, AzNetworking::ISerializer& serializer, HANDLER& handler);
AzNetworking::PacketDispatchResult DispatchPacket(AzNetworking::IConnection* connection, const AzNetworking::IPacketHeader& packetHeader, AzNetworking::ISerializer& serializer, HANDLER& handler);
}
{% endfor %}
@@ -2,7 +2,7 @@
namespace {{ xml.attrib['Name'] }}
{
template <typename HANDLER>
inline bool DispatchPacket(AzNetworking::IConnection* connection, const AzNetworking::IPacketHeader& packetHeader, AzNetworking::ISerializer& serializer, HANDLER& handler)
inline AzNetworking::PacketDispatchResult DispatchPacket(AzNetworking::IConnection* connection, const AzNetworking::IPacketHeader& packetHeader, AzNetworking::ISerializer& serializer, HANDLER& handler)
{
switch (aznumeric_cast<int32_t>(packetHeader.GetPacketType()))
{
@@ -10,16 +10,26 @@ namespace {{ xml.attrib['Name'] }}
case aznumeric_cast<int32_t>({{ Packet.attrib['Name'] }}::Type):
{
AZLOG(Debug_DispatchPackets, "Received packet %s", "{{ Packet.attrib['Name'] }}");
{% if ('HandshakePacket' not in Packet.attrib) or (Packet.attrib['HandshakePacket'] == 'false') %}
if (!handler.IsHandshakeComplete())
{
return AzNetworking::PacketDispatchResult::Skipped;
}
{% endif %}
{{ Packet.attrib['Name'] }} packet;
if (!serializer.Serialize(packet, "Packet"))
{
return false;
return AzNetworking::PacketDispatchResult::Failure;
}
if(handler.HandleRequest(connection, packetHeader, packet))
{
return AzNetworking::PacketDispatchResult::Success;
}
return handler.HandleRequest(connection, packetHeader, packet);
}
{% endfor %}
}
return false;
return AzNetworking::PacketDispatchResult::Failure;
}
}
{% endfor %}
@@ -45,8 +45,8 @@ namespace AzNetworking
//! @param connection pointer to the connection instance generating the event
//! @param packetHeader packet header of the associated payload
//! @param serializer serializer instance containing the transmitted payload
//! @return boolean true to signal success, false to disconnect with a transport error
virtual bool OnPacketReceived(IConnection* connection, const IPacketHeader& packetHeader, ISerializer& serializer) = 0;
//! @return PacketDispatchResult result of the packet handling attempt
virtual PacketDispatchResult OnPacketReceived(IConnection* connection, const IPacketHeader& packetHeader, ISerializer& serializer) = 0;
//! Called when a packet is deemed lost by the remote connection.
//! @param connection pointer to the connection instance generating the event
@@ -15,6 +15,12 @@
namespace AzNetworking
{
AZ_ENUM_CLASS(PacketDispatchResult
, Failure
, Skipped
, Success
);
AZ_ENUM_CLASS(PacketFlag
, Compressed
, MAX
@@ -236,14 +236,14 @@ namespace AzNetworking
return true;
}
bool UdpConnection::HandleCorePacket(IConnectionListener& connectionListener, UdpPacketHeader& header, ISerializer& serializer)
PacketDispatchResult UdpConnection::HandleCorePacket(IConnectionListener& connectionListener, UdpPacketHeader& header, ISerializer& serializer)
{
switch (static_cast<CorePackets::PacketType>(header.GetPacketType()))
{
case CorePackets::PacketType::InitiateConnectionPacket:
{
AZLOG(NET_CorePackets, "Received core packet %s", "InitiateConnection");
return true;
return PacketDispatchResult::Success;
}
break;
@@ -253,7 +253,7 @@ namespace AzNetworking
CorePackets::ConnectionHandshakePacket packet;
if (!serializer.Serialize(packet, "Packet"))
{
return false;
return PacketDispatchResult::Failure;
}
if (m_state != ConnectionState::Connected)
@@ -264,7 +264,7 @@ namespace AzNetworking
}
}
return true;
return PacketDispatchResult::Success;
}
break;
@@ -274,10 +274,10 @@ namespace AzNetworking
CorePackets::TerminateConnectionPacket packet;
if (!serializer.Serialize(packet, "Packet"))
{
return false;
return PacketDispatchResult::Failure;
}
Disconnect(packet.GetDisconnectReason(), TerminationEndpoint::Remote);
return true;
return PacketDispatchResult::Success;
}
break;
@@ -287,10 +287,10 @@ namespace AzNetworking
CorePackets::HeartbeatPacket packet;
if (!serializer.Serialize(packet, "Packet"))
{
return false;
return PacketDispatchResult::Failure;
}
// Do nothing, we've already processed our ack packets
return true;
return PacketDispatchResult::Success;
}
break;
@@ -302,6 +302,6 @@ namespace AzNetworking
AZ_Assert(false, "Unhandled core packet type!");
}
return false;
return PacketDispatchResult::Failure;
}
}
@@ -130,8 +130,8 @@ namespace AzNetworking
//! @param listener a connection listener to receive connection related events
//! @param header the packet header received to process
//! @param serializer the output serializer containing the transmitted packet data
//! @return boolean true on successful handling of the received header
bool HandleCorePacket(IConnectionListener& listener, UdpPacketHeader& header, ISerializer& serializer);
//! @return PacketDispatchResult result of processing the core packet
PacketDispatchResult HandleCorePacket(IConnectionListener& listener, UdpPacketHeader& header, ISerializer& serializer);
AZ_DISABLE_COPY_MOVE(UdpConnection);
@@ -37,14 +37,14 @@ namespace AzNetworking
return m_sequenceGenerator.GetNextSequenceId();
}
bool UdpFragmentQueue::ProcessReceivedChunk(UdpConnection* connection, IConnectionListener& connectionListener, UdpPacketHeader& header, ISerializer& serializer)
PacketDispatchResult UdpFragmentQueue::ProcessReceivedChunk(UdpConnection* connection, IConnectionListener& connectionListener, UdpPacketHeader& header, ISerializer& serializer)
{
AZStd::unique_ptr<CorePackets::FragmentedPacket> packet = AZStd::make_unique<CorePackets::FragmentedPacket>();
if (!serializer.Serialize(*packet, "Packet"))
{
AZLOG(NET_FragmentQueue, "Fragment failed serialization");
return false;
return PacketDispatchResult::Failure;
}
const bool isReliable = header.GetIsReliable();
@@ -63,14 +63,14 @@ namespace AzNetworking
{
// Too old to process
AZLOG(NET_FragmentQueue, "Fragment sequence ID is outside our tracked window");
return false;
return PacketDispatchResult::Failure;
}
if (m_deliveredFragments.GetBit(static_cast<uint32_t>(sequenceDelta)))
{
// Received packet is a duplicate of one already forwarded to gameplay
AZLOG(NET_FragmentQueue, "Received duplicate of fragmented packet %u, discarding", static_cast<uint32_t>(fragmentSequence));
return true;
return PacketDispatchResult::Success;
}
const uint32_t chunkCount = packet->GetChunkCount();
@@ -89,7 +89,7 @@ namespace AzNetworking
{
// Either we disagree on the number of chunks, or chunkIndex is bigger than the expected size, bail and disconnect
AZLOG(NET_FragmentQueue, "Malformed chunk metadata in fragmented packet, chunkIndex %u, chunkCount %u, reservedSize %u", chunkIndex, chunkCount, static_cast<uint32_t>(packetFragments.size()));
return false;
return PacketDispatchResult::Failure;
}
packetFragments[chunkIndex] = AZStd::move(packet);
@@ -105,7 +105,7 @@ namespace AzNetworking
}
// We haven't received all chunks required to complete this packet yet
return true;
return PacketDispatchResult::Success;
}
totalPacketSize += static_cast<uint32_t>(packetFragments[index]->GetChunkBuffer().GetSize());
@@ -119,7 +119,7 @@ namespace AzNetworking
if (!buffer.Resize(totalPacketSize))
{
AZLOG_ERROR("Fragmented packet is too large to fit in UdpPacketEncodingBuffer");
return false;
return PacketDispatchResult::Failure;
}
uint8_t* bufferPointer = buffer.GetBuffer();
@@ -141,17 +141,17 @@ namespace AzNetworking
if (!header.SerializePacketFlags(networkSerializer))
{
AZLOG(NET_FragmentQueue, "Reconstructed fragmented packet failed packet flags serialization");
return false;
return PacketDispatchResult::Failure;
}
if (!networkISerializer.Serialize(header, "Header"))
{
AZLOG(NET_FragmentQueue, "Reconstructed fragmented packet failed header serialization");
return false;
return PacketDispatchResult::Failure;
}
}
connection->GetPacketTracker().ProcessReceived(connection, header);
bool handledPacket = false;
PacketDispatchResult handledPacket;
if (header.GetPacketType() < aznumeric_cast<PacketType>(CorePackets::PacketType::MAX))
{
handledPacket = connection->HandleCorePacket(connectionListener, header, networkSerializer);
@@ -9,6 +9,7 @@
#pragma once
#include <AzNetworking/PacketLayer/IPacket.h>
#include <AzNetworking/PacketLayer/IPacketHeader.h>
#include <AzNetworking/AutoGen/CorePackets.AutoPackets.h>
#include <AzNetworking/ConnectionLayer/SequenceGenerator.h>
#include <AzNetworking/DataStructures/RingBufferBitset.h>
@@ -44,8 +45,8 @@ namespace AzNetworking
//! @param connectionListener the connection listener for delivery of completed packets
//! @param header the chunk packet header
//! @param serializer the serializer containing the chunk body
//! @return boolean true if the chunk was processed, false if an error was encountered
bool ProcessReceivedChunk(UdpConnection* connection, IConnectionListener& connectionListener, UdpPacketHeader& header, ISerializer& serializer);
//! @return PacketDispatchResult result of processing the chunk
PacketDispatchResult ProcessReceivedChunk(UdpConnection* connection, IConnectionListener& connectionListener, UdpPacketHeader& header, ISerializer& serializer);
private:
@@ -277,7 +277,7 @@ namespace AzNetworking
timeoutItem->UpdateTimeoutTime(startTimeMs);
bool handledPacket = false;
PacketDispatchResult handledPacket = PacketDispatchResult::Failure;
if (header.GetPacketType() < aznumeric_cast<PacketType>(CorePackets::PacketType::MAX))
{
handledPacket = connection->HandleCorePacket(m_connectionListener, header, packetSerializer);
@@ -287,7 +287,7 @@ namespace AzNetworking
handledPacket = m_connectionListener.OnPacketReceived(connection, header, packetSerializer);
}
if (handledPacket)
if (handledPacket == PacketDispatchResult::Success)
{
connection->UpdateHeartbeat(currentTimeMs);
if (connection->GetConnectionState() == ConnectionState::Connecting && !connection->GetDtlsEndpoint().IsConnecting())
@@ -299,10 +299,16 @@ namespace AzNetworking
else if (m_socket->IsEncrypted() && connection->GetDtlsEndpoint().IsConnecting() &&
!IsHandshakePacket(connection->GetDtlsEndpoint(), header.GetPacketType()))
{
// It's possible for one side to finish its half of the handshake and start sending encrypted data
// It's possible for one side to finish its half of the encryption handshake and start sending encrypted data
// This will appear as a SerializationError due to the incomplete encryption handshake
// If it's not an expected unencrypted type then skip it for now
continue;
}
else if (handledPacket == PacketDispatchResult::Skipped)
{
// If the result is marked as skipped then do so (i.e. if a handshake is not yet complete)
continue;
}
else if (connection->GetConnectionState() != ConnectionState::Disconnecting)
{
connection->Disconnect(DisconnectReason::StreamError, TerminationEndpoint::Local);
@@ -33,11 +33,11 @@ namespace UnitTest
;
}
bool OnPacketReceived([[maybe_unused]] IConnection* connection, const IPacketHeader& packetHeader, [[maybe_unused]] ISerializer& serializer)
PacketDispatchResult OnPacketReceived([[maybe_unused]] IConnection* connection, const IPacketHeader& packetHeader, [[maybe_unused]] ISerializer& serializer)
{
EXPECT_TRUE((packetHeader.GetPacketType() == static_cast<PacketType>(CorePackets::PacketType::InitiateConnectionPacket))
|| (packetHeader.GetPacketType() == static_cast<PacketType>(CorePackets::PacketType::HeartbeatPacket)));
return false;
return PacketDispatchResult::Failure;
}
void OnPacketLost([[maybe_unused]] IConnection* connection, [[maybe_unused]] PacketId packetId)
@@ -36,11 +36,11 @@ namespace UnitTest
;
}
bool OnPacketReceived([[maybe_unused]] IConnection* connection, const IPacketHeader& packetHeader, [[maybe_unused]] ISerializer& serializer)
PacketDispatchResult OnPacketReceived([[maybe_unused]] IConnection* connection, const IPacketHeader& packetHeader, [[maybe_unused]] ISerializer& serializer)
{
EXPECT_TRUE((packetHeader.GetPacketType() == static_cast<PacketType>(CorePackets::PacketType::InitiateConnectionPacket))
|| (packetHeader.GetPacketType() == static_cast<PacketType>(CorePackets::PacketType::HeartbeatPacket)));
return false;
return PacketDispatchResult::Failure;
}
void OnPacketLost([[maybe_unused]] IConnection* connection, [[maybe_unused]] PacketId packetId)
@@ -0,0 +1,54 @@
/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#include <AzQtComponents/Components/Widgets/FileDialog.h>
#include <QMessageBox>
#include <QRegExp>
namespace AzQtComponents
{
QString FileDialog::GetSaveFileName(QWidget* parent, const QString& caption, const QString& dir,
const QString& filter, QString* selectedFilter, QFileDialog::Options options)
{
bool shouldPromptAgain = false;
QString filePath;
do
{
// Trigger Qt's save filename dialog
// If filePath isn't empty, it means we are prompting again because the filename was invalid,
// so pass it instead of the directory so the filename is pre-filled in for the user
filePath = QFileDialog::getSaveFileName(parent, caption, (filePath.isEmpty()) ? dir : filePath, filter, selectedFilter, options);
if (!filePath.isEmpty())
{
QFileInfo fileInfo(filePath);
QString fileName = fileInfo.fileName();
// Check if the filename has any invalid characters
QRegExp validFileNameRegex("^[a-zA-Z0-9_\\-./]*$");
shouldPromptAgain = !validFileNameRegex.exactMatch(fileName);
// If the filename had invalid characters, then show a warning message and then we will re-prompt the save filename dialog
if (shouldPromptAgain)
{
QMessageBox::warning(parent, QObject::tr("Invalid filename"),
QObject::tr("O3DE assets are restricted to alphanumeric characters, hyphens (-), underscores (_), and dots (.)\n\n%1").arg(fileName));
}
}
else
{
// If the filePath is empty, then the user cancelled the dialog so we don't need to prompt again
shouldPromptAgain = false;
}
} while (shouldPromptAgain);
return filePath;
}
} // namespace AzQtComponents
@@ -0,0 +1,29 @@
/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#pragma once
#include <AzQtComponents/AzQtComponentsAPI.h>
#if !defined(Q_MOC_RUN)
#include <QFileDialog>
#endif
namespace AzQtComponents
{
class AZ_QT_COMPONENTS_API FileDialog
{
public:
//! Helper method that extends QFileDialog::getSaveFileName to prevent the user from
//! saving a filename with invalid characters (e.g. AP doesn't allow @ characters because they are used for aliases)
static QString GetSaveFileName(QWidget* parent = nullptr, const QString& caption = QString(),
const QString& dir = QString(), const QString& filter = QString(),
QString* selectedFilter = nullptr, QFileDialog::Options options = QFileDialog::Options());
};
} // namespace AzQtComponents
@@ -146,6 +146,8 @@ set(FILES
Components/Widgets/Eyedropper.h
Components/Widgets/Eyedropper.cpp
Components/Widgets/EyedropperConfig.ini
Components/Widgets/FileDialog.cpp
Components/Widgets/FileDialog.h
Components/Widgets/FilteredSearchWidget.qss
Components/Widgets/FilteredSearchWidgetConfig.ini
Components/Widgets/GradientSlider.cpp
@@ -37,6 +37,10 @@ AZ_POP_DISABLE_WARNING
#include <AzFramework/Asset/GenericAssetHandler.h>
#include <AzFramework/StringFunc/StringFunc.h>
#include <AzQtComponents/Components/Widgets/FileDialog.h>
#include <AzToolsFramework/UI/UICore/WidgetHelpers.h>
#include <SourceControl/SourceControlAPI.h>
#include <UI/PropertyEditor/PropertyRowWidget.hxx>
@@ -46,9 +50,6 @@ AZ_POP_DISABLE_WARNING
#include <QMessageBox>
#include <QMenu>
#include <QMenuBar>
AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option") // 'QFileInfo::d_ptr': class 'QSharedDataPointer<QFileInfoPrivate>' needs to have dll-interface to be used by clients of class 'QFileInfo'
#include <QFileDialog>
AZ_POP_DISABLE_WARNING
#include <QAction>
namespace AzToolsFramework
@@ -414,7 +415,7 @@ namespace AzToolsFramework
filter.append(")");
}
const QString saveAs = QFileDialog::getSaveFileName(nullptr, tr("Save As..."), m_userSettings->m_lastSavePath.c_str(), filter);
const QString saveAs = AzQtComponents::FileDialog::GetSaveFileName(AzToolsFramework::GetActiveWindow(), tr("Save As..."), m_userSettings->m_lastSavePath.c_str(), filter);
return SaveImpl(asset, saveAs);
}
@@ -902,7 +903,7 @@ namespace AzToolsFramework
statusString = QString("%1");
}
statusString = statusString.arg(m_currentAsset).arg(m_queuedAssetStatus);
statusString = statusString.arg(m_currentAsset);
if (!m_queuedAssetStatus.isEmpty())
{
@@ -920,7 +921,7 @@ namespace AzToolsFramework
void AssetEditorWidget::SetupHeader()
{
QString nameString = QString("%1").arg(m_currentAsset).arg(m_queuedAssetStatus);
QString nameString = QString("%1").arg(m_currentAsset);
m_header->setName(nameString);
@@ -48,7 +48,7 @@ ly_add_target(
PLATFORM_INCLUDE_FILES
${pal_source_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}.cmake
${common_source_dir}/${PAL_TRAIT_COMPILER_ID}/imageprocessingatom_editor_static_${PAL_TRAIT_COMPILER_ID_LOWERCASE}.cmake
${platform_tools_files}
${platform_tools_files}
INCLUDE_DIRECTORIES
PUBLIC
Include
@@ -7,6 +7,7 @@
*/
#include <AzCore/PlatformIncl.h>
#include <Compressors/CTSquisher.h>
#include <Compressors/PVRTC.h>
#include <Compressors/ETC2.h>
@@ -7,20 +7,12 @@
*/
#include <ImageProcessing_Traits_Platform.h>
#include <AzCore/PlatformIncl.h>
#include <Atom/ImageProcessing/ImageObject.h>
#include <Processing/ImageFlags.h>
#include <Processing/PixelFormatInfo.h>
#include <Compressors/PVRTC.h>
#if AZ_TRAIT_IMAGEPROCESSING_PVRTEXLIB_USE_WINDLL_IMPORT
//_WINDLL_IMPORT need to be defined before including PVRTexLib header files to avoid linking error on windows.
#define _WINDLL_IMPORT
// NOMINMAX needs to be defined before including PVRTexLib header files (which include Windows.h)
// so that Windows.h doesn't define min/max. Otherwise, a compile error may arise in Uber builds
#ifndef NOMINMAX
#define NOMINMAX
#endif
#endif
#include <PVRTexture.h>
#include <PVRTextureUtilities.h>
@@ -17,6 +17,8 @@
#include <AzCore/Serialization/EditContext.h>
#include <AzCore/std/string/wildcard.h>
#include <AzQtComponents/Components/Widgets/FileDialog.h>
#include <AzToolsFramework/API/EditorAssetSystemAPI.h>
#include <AzToolsFramework/AssetBrowser/EBusFindAssetTypeByName.h>
#include <AzToolsFramework/AssetBrowser/AssetBrowserEntry.h>
@@ -202,7 +204,7 @@ namespace ImageProcessingAtom
AZ::Data::AssetId assetId = product->GetAssetId();
menu->addAction("Save as DDS...", [assetId, this]()
{
QString filePath = QFileDialog::getSaveFileName(nullptr, QString("Save to file"), m_lastSavedPath, QString("DDS file (*.dds)"));
QString filePath = AzQtComponents::FileDialog::GetSaveFileName(nullptr, QString("Save to file"), m_lastSavedPath, QString("DDS file (*.dds)"));
if (filePath.isEmpty())
{
return;
@@ -136,7 +136,3 @@ set(FILES
Source/Thumbnail/ImageThumbnailSystemComponent.cpp
Source/Thumbnail/ImageThumbnailSystemComponent.h
)
set(SKIP_UNITY_BUILD_INCLUSION_FILES
Source/Compressors/PVRTC.cpp
)
@@ -14,6 +14,7 @@
#include <stdio.h>
#include <AzCore/std/parallel/thread.h>
#include <AzCore/std/parallel/atomic.h>
#include <AzCore/PlatformIncl.h>
#include "VectorMacros.h"
#include "CBBoxInt32.h"
@@ -22,11 +23,9 @@
//has routines for saving .rgbe files
#define CG_RGBE_SUPPORT
#ifndef WCHAR
#ifndef WCHAR // For non-windows platforms, for Windows-based platforms it will be defined through PlatformIncl.h
#define WCHAR wchar_t
#endif //WCHAR
#endif // WCHAR
//used to index cube faces
#define CP_FACE_X_POS 0
@@ -14,10 +14,11 @@
#include "VectorMacros.h"
#include <ImageBuilderBaseType.h>
#include <AzCore/PlatformIncl.h>
#ifndef WCHAR
#ifndef WCHAR // For non-windows platforms, for Windows-based platforms it will be defined through PlatformIncl.h
#define WCHAR wchar_t
#endif //WCHAR
#endif // WCHAR
#ifndef SAFE_DELETE
#define SAFE_DELETE(p) { if(p) { delete (p); (p)=NULL; } }
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa
size 41127
-3
View File
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa
size 41127
-3
View File
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa
size 41127
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:bc978169029b8ef4e69ee02abdc7f9bdc970900db90169bbf25d4b201f5c1287
size 37625
@@ -294,6 +294,7 @@ namespace AZ
void CommonSystemComponent::Deactivate()
{
m_loadTemplatesHandler.Disconnect();
AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor<RayTracingFeatureProcessor>();
AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor<DiffuseGlobalIlluminationFeatureProcessor>();
AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor<DiffuseProbeGridFeatureProcessor>();
-3
View File
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa
size 41127
-3
View File
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa
size 41127
@@ -1,31 +0,0 @@
/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#pragma once
#include <AzCore/Name/Name.h>
#include <AzCore/std/containers/vector.h>
namespace AZ
{
class ReflectContext;
namespace RHI
{
class PlatformLimits;
struct RHISystemDescriptor final
{
AZ_TYPE_INFO(RHISystemDescriptor, "{A506DA28-856C-483A-938D-73471D2C5A5B}");
static void Reflect(AZ::ReflectContext* context);
//! The set of globally declared draw list tags, which will be registered with the registry at startup.
AZStd::vector<AZ::Name> m_drawListTags;
};
} // namespace RHI
} // namespace AZ
@@ -14,7 +14,6 @@
#include <Atom/RHI/FrameScheduler.h>
#include <Atom/RHI/PipelineStateCache.h>
#include <Atom/RHI/RHISystemInterface.h>
#include <Atom/RHI.Reflect/RHISystemDescriptor.h>
namespace AZ
{
@@ -33,7 +32,7 @@ namespace AZ
void InitDevice();
//! This function initializes the rest of the RHI/RHI backend.
void Init(const RHISystemDescriptor& descriptor);
void Init();
void Shutdown();
//! An external callback to build the frame graph.
@@ -1,40 +0,0 @@
/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#include <Atom/RHI.Reflect/RHISystemDescriptor.h>
#include <Atom/RHI.Reflect/PlatformLimitsDescriptor.h>
#include <AzCore/Serialization/SerializeContext.h>
#include <AzCore/Serialization/EditContext.h>
namespace AZ
{
namespace RHI
{
void RHISystemDescriptor::Reflect(AZ::ReflectContext* context)
{
if (auto* serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
{
serializeContext->Class<RHISystemDescriptor>()
->Version(4)
->Field("DrawItemTags", &RHISystemDescriptor::m_drawListTags)
;
if (AZ::EditContext* ec = serializeContext->GetEditContext())
{
ec->Class<RHISystemDescriptor>("RHI Settings", "Settings for runtime RHI system")
->ClassElement(AZ::Edit::ClassElements::EditorData, "")
->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("System", 0xc94d118b))
->Attribute(AZ::Edit::Attributes::AutoExpand, true)
->DataElement(AZ::Edit::UIHandlers::Default, &RHISystemDescriptor::m_drawListTags, "Draw List Tags", "The set of globally declared draw list tags, which will be registered with the registry at startup.")
;
}
}
}
} // namespace RPI
} // namespace AZ
@@ -27,7 +27,6 @@
#include <Atom/RHI.Reflect/ReflectSystemComponent.h>
#include <Atom/RHI.Reflect/RenderAttachmentLayout.h>
#include <Atom/RHI.Reflect/ResolveScopeAttachmentDescriptor.h>
#include <Atom/RHI.Reflect/RHISystemDescriptor.h>
#include <Atom/RHI.Reflect/Scissor.h>
#include <Atom/RHI.Reflect/ScopeAttachmentDescriptor.h>
#include <Atom/RHI.Reflect/ShaderDataMappings.h>
@@ -161,7 +160,6 @@ namespace AZ
TransientAttachmentPoolBudgets::Reflect(context);
PlatformLimits::Reflect(context);
PlatformLimitsDescriptor::Reflect(context);
RHISystemDescriptor::Reflect(context);
Origin::Reflect(context);
ReflectVendorIdEnums(context);
PhysicalDeviceDriverValidator::Reflect(context);
+1 -9
View File
@@ -36,7 +36,7 @@ namespace AZ
m_device = InitInternalDevice();
}
void RHISystem::Init(const RHISystemDescriptor& descriptor)
void RHISystem::Init()
{
m_cpuProfiler.Init();
@@ -86,14 +86,6 @@ namespace AZ
frameSchedulerDescriptor.m_platformLimitsDescriptor = platformLimitsDescriptor;
m_frameScheduler.Init(*m_device, frameSchedulerDescriptor);
// Register draw list tags declared from content.
for (const Name& drawListName : descriptor.m_drawListTags)
{
RHI::DrawListTag drawListTag = m_drawListTagRegistry->AcquireTag(drawListName);
AZ_Warning("RHISystem", drawListTag.IsValid(), "Failed to register draw list tag '%s'. Registry at capacity.", drawListName.GetCStr());
}
}
RHI::Ptr<RHI::Device> RHISystem::InitInternalDevice()
@@ -118,9 +118,7 @@ set(FILES
Include/Atom/RHI.Reflect/SwapChainDescriptor.h
Source/RHI.Reflect/SwapChainDescriptor.cpp
Include/Atom/RHI.Reflect/ReflectSystemComponent.h
Include/Atom/RHI.Reflect/RHISystemDescriptor.h
Source/RHI.Reflect/ReflectSystemComponent.cpp
Source/RHI.Reflect/RHISystemDescriptor.cpp
Include/Atom/RHI.Reflect/AliasedHeapEnums.h
Include/Atom/RHI.Reflect/TransientBufferDescriptor.h
Include/Atom/RHI.Reflect/TransientImageDescriptor.h
-3
View File
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa
size 41127
-3
View File
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa
size 41127
-3
View File
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa
size 41127
-3
View File
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa
size 41127
@@ -21,8 +21,16 @@ namespace AZ
AZ_TYPE_INFO(RPI::ImageSystemDescriptor, "{319D14F6-F7F2-487A-AA6B-5800E328C79B}");
static void Reflect(AZ::ReflectContext* context);
//! The maximum size of the image pool used for system streaming images.
//! Check ImageSystemInterface::GetSystemStreamingPool() for detail of this image pool
uint64_t m_systemStreamingImagePoolSize = 128 * 1024 * 1024;
//! The maximum size of the image pool used for system attachments images.
//! Check ImageSystemInterface::GetSystemAttachmentPool() for detail of this image pool
uint64_t m_systemAttachmentImagePoolSize = 512 * 1024 * 1024;
//! The maximum size of the image pool used for streaming images load from assets
//! Check ImageSystemInterface::GetStreamingPool() for detail of this image pool
uint64_t m_assetStreamingImagePoolSize = 2u * 1024u * 1024u * 1024u;
};
} // namespace RPI
@@ -10,7 +10,6 @@
#include <Atom/RPI.Reflect/GpuQuerySystemDescriptor.h>
#include <Atom/RPI.Reflect/Image/ImageSystemDescriptor.h>
#include <Atom/RHI.Reflect/RHISystemDescriptor.h>
namespace AZ
{
@@ -31,8 +30,6 @@ namespace AZ
AZ_TYPE_INFO(RPISystemDescriptor, "{96DAC3DA-40D4-4C03-8D6A-3181E843262A}");
static void Reflect(AZ::ReflectContext* context);
RHI::RHISystemDescriptor m_rhiSystemDescriptor;
//! The asset cache relative path of the only common shader asset for the RPI system that is used
//! as means to load the layout for scene srg and view srg. This is used to create any RPI::Scene.
AZStd::string m_commonSrgsShaderAssetPath = "shader/sceneandviewsrgs.azshader";
@@ -15,9 +15,11 @@
#include <Atom/RHI/Factory.h>
#include <AzCore/Asset/AssetManager.h>
#include <AzCore/IO/IOUtils.h>
#include <AzCore/Serialization/SerializeContext.h>
#include <AzCore/Asset/AssetManager.h>
#include <AzCore/Settings/SettingsRegistry.h>
#ifdef RPI_EDITOR
#include <Atom/RPI.Edit/Material/MaterialFunctorSourceDataRegistration.h>
#endif
@@ -84,8 +86,11 @@ namespace AZ
void RPISystemComponent::Activate()
{
// [GFX TODO] [ATOM-1436] this can be removed when setup and save system component's configure from projectConfigure.exe is fixed.
m_rpiDescriptor.m_rhiSystemDescriptor.m_drawListTags.push_back(AZ::Name("forward"));
auto settingsRegistry = AZ::SettingsRegistry::Get();
if (settingsRegistry)
{
settingsRegistry->GetObject(m_rpiDescriptor, "/O3DE/Atom/RPI/Initialization");
}
m_rpiSystem.Initialize(m_rpiDescriptor);
AZ::SystemTickBus::Handler::BusConnect();
@@ -372,7 +372,7 @@ namespace AZ
return;
}
m_rhiSystem.Init(m_descriptor.m_rhiSystemDescriptor);
m_rhiSystem.Init();
m_imageSystem.Init(m_descriptor.m_imageSystemDescriptor);
m_bufferSystem.Init();
m_dynamicDraw.Init(m_descriptor.m_dynamicDrawSystemDescriptor);
@@ -396,7 +396,7 @@ namespace AZ
}
//Init rhi/image/buffer systems to match InitializeSystemAssets
m_rhiSystem.Init(m_descriptor.m_rhiSystemDescriptor);
m_rhiSystem.Init();
m_imageSystem.Init(m_descriptor.m_imageSystemDescriptor);
m_bufferSystem.Init();
@@ -25,21 +25,6 @@ namespace AZ
->Field("SystemStreamingImagePoolSize", &ImageSystemDescriptor::m_systemStreamingImagePoolSize)
->Field("SystemAttachmentImagePoolSize", &ImageSystemDescriptor::m_systemAttachmentImagePoolSize)
;
if (AZ::EditContext* ec = serializeContext->GetEditContext())
{
ec->Class<ImageSystemDescriptor>("Image System Config", "Settings for RPI Image System")
->ClassElement(AZ::Edit::ClassElements::EditorData, "")
->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("System", 0xc94d118b))
->Attribute(AZ::Edit::Attributes::AutoExpand, true)
->DataElement(AZ::Edit::UIHandlers::Default, &ImageSystemDescriptor::m_assetStreamingImagePoolSize,
"Streaming image pool size for assets", "Streaming image pool size in bytes for streaming images created from assets")
->DataElement(AZ::Edit::UIHandlers::Default, &ImageSystemDescriptor::m_systemStreamingImagePoolSize,
"System streaming image pool size", "Streaming image pool size in bytes for streaming images created in memory")
->DataElement(AZ::Edit::UIHandlers::Default, &ImageSystemDescriptor::m_systemAttachmentImagePoolSize,
"System attachment image pool size", "Default attachment image pool size in bytes")
;
}
}
}
} // namespace RPI
@@ -25,35 +25,12 @@ namespace AZ
;
serializeContext->Class<RPISystemDescriptor>()
->Version(6) // ATOM-15472
->Field("RHISystemDescriptor", &RPISystemDescriptor::m_rhiSystemDescriptor)
->Version(7) // ATOM-16237
->Field("CommonSrgsShaderAssetPath", &RPISystemDescriptor::m_commonSrgsShaderAssetPath)
->Field("ImageSystemDescriptor", &RPISystemDescriptor::m_imageSystemDescriptor)
->Field("GpuQuerySystemDescriptor", &RPISystemDescriptor::m_gpuQuerySystemDescriptor)
->Field("DynamicDrawSystemDescriptor", &RPISystemDescriptor::m_dynamicDrawSystemDescriptor)
;
if (AZ::EditContext* ec = serializeContext->GetEditContext())
{
ec->Class<DynamicDrawSystemDescriptor>("Dynamic Draw System Settings", "Settings for the Dynamic Draw System")
->ClassElement(AZ::Edit::ClassElements::EditorData, "")
->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("System", 0xc94d118b))
->Attribute(AZ::Edit::Attributes::AutoExpand, true)
->DataElement(AZ::Edit::UIHandlers::Default, &DynamicDrawSystemDescriptor::m_dynamicBufferPoolSize, "Dynamic Buffer Pool Size", "The maxinum size of pool which is used to allocate dynamic buffers")
;
ec->Class<RPISystemDescriptor>("RPI Settings", "Settings for runtime RPI system")
->ClassElement(AZ::Edit::ClassElements::EditorData, "")
->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("System", 0xc94d118b))
->Attribute(AZ::Edit::Attributes::AutoExpand, true)
->DataElement(AZ::Edit::UIHandlers::Default, &RPISystemDescriptor::m_commonSrgsShaderAssetPath, "Common Shader Asset Path For Scene & View SRGs",
"Shader asset path used to get the Scene and View SRGs for all RPI scenes and views respectively")
->DataElement(AZ::Edit::UIHandlers::Default, &RPISystemDescriptor::m_rhiSystemDescriptor, "RHI System Config", "Configuration of Render Hardware Interface")
->DataElement(AZ::Edit::UIHandlers::Default, &RPISystemDescriptor::m_imageSystemDescriptor, "Image System Config", "Configuration of Image System")
->DataElement(AZ::Edit::UIHandlers::Default, &RPISystemDescriptor::m_gpuQuerySystemDescriptor, "Gpu Query System Config", "Configuration of Gpu Query System")
->DataElement(AZ::Edit::UIHandlers::Default, &RPISystemDescriptor::m_dynamicDrawSystemDescriptor, "Dynamic Draw System Config", "Configuration of Dynamic Draw System")
;
}
}
}
} // namespace RPI
+24
View File
@@ -0,0 +1,24 @@
{
"O3DE": {
"Atom": {
"RPI": {
"Initialization": {
"CommonSrgsShaderAssetPath": "shader/sceneandviewsrgs.azshader",
"ImageSystemDescriptor": {
"AssetStreamingImagePoolSize": 2147483648, // 2 * 1024 * 1024 * 1024
"SystemStreamingImagePoolSize": 134217728, // 128 * 1024 * 1024
"SystemAttachmentImagePoolSize": 536870912 // 512 * 1024 * 1024
},
"GpuQuerySystemDescriptor": {
"OcclusionQueryCount": 128,
"StatisticsQueryCount": 256,
"TimestampQueryCount": 256
},
"DynamicDrawSystemDescriptor": {
"DynamicBufferPoolSize": 50331648 // 3 * 16 * 1024 * 1024 (for 3 frames)
}
}
}
}
}
}
-3
View File
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa
size 41127
@@ -11,13 +11,13 @@
#include <AzCore/StringFunc/StringFunc.h>
#include <AzCore/Utils/Utils.h>
#include <AzFramework/API/ApplicationAPI.h>
#include <AzQtComponents/Components/Widgets/FileDialog.h>
#include <AzToolsFramework/AssetBrowser/AssetBrowserEntry.h>
#include <AzToolsFramework/AssetBrowser/AssetSelectionModel.h>
#include <AzToolsFramework/AssetBrowser/AssetBrowserBus.h>
AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // disable warnings spawned by QT
#include <QApplication>
#include <QFileDialog>
#include <QMessageBox>
#include <QProcess>
AZ_POP_DISABLE_WARNING
@@ -29,7 +29,7 @@ namespace AtomToolsFramework
const QFileInfo initialFileInfo(initialPath);
const QString initialExt(initialFileInfo.completeSuffix());
const QFileInfo selectedFileInfo(QFileDialog::getSaveFileName(
const QFileInfo selectedFileInfo(AzQtComponents::FileDialog::GetSaveFileName(
QApplication::activeWindow(),
"Save File",
initialFileInfo.absolutePath() +
@@ -104,7 +104,7 @@ namespace AtomToolsFramework
const QFileInfo initialFileInfo(initialPath);
const QString initialExt(initialFileInfo.completeSuffix());
const QFileInfo duplicateFileInfo(QFileDialog::getSaveFileName(
const QFileInfo duplicateFileInfo(AzQtComponents::FileDialog::GetSaveFileName(
QApplication::activeWindow(),
"Duplicate File",
GetUniqueFileInfo(initialPath).absoluteFilePath(),
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa
size 41127
@@ -11,6 +11,8 @@
#include <AzFramework/Application/Application.h>
#include <AzFramework/StringFunc/StringFunc.h>
#include <AzQtComponents/Components/Widgets/FileDialog.h>
#include <AtomToolsFramework/Util/Util.h>
#include <Atom/RPI.Edit/Common/AssetUtils.h>
@@ -19,8 +21,6 @@
#include <Atom/Document/MaterialDocumentSettings.h>
#include <QFileDialog>
namespace MaterialEditor
{
CreateMaterialDialog::CreateMaterialDialog(QWidget* parent)
@@ -95,7 +95,7 @@ namespace MaterialEditor
//When the file selection button is pressed, open a file dialog to select where the material will be saved
QObject::connect(m_ui->m_materialFilePicker, &AzQtComponents::BrowseEdit::attachedButtonTriggered, m_ui->m_materialFilePicker, [this]() {
QFileInfo fileInfo = QFileDialog::getSaveFileName(this,
QFileInfo fileInfo = AzQtComponents::FileDialog::GetSaveFileName(this,
QString("Select Material Filename"),
m_materialFileInfo.absoluteFilePath(),
QString("Material (*.material)"));
-3
View File
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa
size 41127
-1
View File
@@ -7,7 +7,6 @@
"summary": "The Atom Renderer Gem provides Atom Renderer and its associated tools (such as Material Editor), utilites, libraries, and interfaces.",
"canonical_tags": ["Gem"],
"user_tags": ["Rendering", "Core"],
"icon_path": "preview.png",
"requirements": "",
"documentation_url": "https://o3de.org/docs/user-guide/gems/reference/rendering/atom/atom/"
}
@@ -7,6 +7,5 @@
"summary": "Atom Asset Gem with a library of reference materials for StandardPBR (and others in the future)",
"canonical_tags": ["Gem"],
"user_tags": ["Assets"],
"icon_path": "preview.png",
"requirements": ""
}
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa
size 41127
-1
View File
@@ -7,6 +7,5 @@
"summary": "A standard test scene for Global Illumination (forked from crytek sponza scene)",
"canonical_tags": ["Gem"],
"user_tags": ["Assets"],
"icon_path": "preview.png",
"requirements": ""
}
-3
View File
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa
size 41127
-1
View File
@@ -7,7 +7,6 @@
"summary": "The Atom Content Gem provides assets for Atom Renderer and a modified version of the <a href='https://renderman.pixar.com/look-development-studio'>Pixar Look Development Studio</a>.",
"canonical_tags": ["Gem"],
"user_tags": ["Rendering", "Assets", "Tools"],
"icon_path": "preview.png",
"requirements": "",
"documentation_url": "https://o3de.org/docs/user-guide/gems/reference/rendering/atom/atom-content/"
}
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa
size 41127
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa
size 41127
@@ -11,6 +11,7 @@
#include <AzFramework/API/ApplicationAPI.h>
#include <AzQtComponents/Components/Widgets/BrowseEdit.h>
#include <AzQtComponents/Components/Widgets/FileDialog.h>
#include <AzToolsFramework/API/EditorAssetSystemAPI.h>
#include <AzToolsFramework/API/EditorWindowRequestBus.h>
#include <AzToolsFramework/API/ToolsApplicationAPI.h>
@@ -22,7 +23,6 @@ AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // disable warnin
#include <QCheckBox>
#include <QComboBox>
#include <QDialogButtonBox>
#include <QFileDialog>
#include <QHBoxLayout>
#include <QHeaderView>
#include <QLabel>
@@ -145,7 +145,7 @@ namespace AZ
// Whenever the browse button is clicked, open a save file dialog in the same location as the current export file setting
QObject::connect(materialFileWidget, &AzQtComponents::BrowseEdit::attachedButtonTriggered, materialFileWidget, [&dialog, &exportItem, materialFileWidget, overwriteCheckBox]() {
QFileInfo fileInfo = QFileDialog::getSaveFileName(&dialog,
QFileInfo fileInfo = AzQtComponents::FileDialog::GetSaveFileName(&dialog,
QString("Select Material Filename"),
exportItem.GetExportPath().c_str(),
QString("Material (*.material)"),
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa
size 41127
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa
size 41127
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1bda4365dc85f8abbcb2b08e942ad03e3d7d9dabe555e079185789a2e1b282bf
size 23321
-1
View File
@@ -7,7 +7,6 @@
"summary": "The Atom O3DE Integration Gem provides components, libraries, and functionality to support and integrate Atom Renderer in Open 3D Engine.",
"canonical_tags": ["Gem"],
"user_tags": ["Rendering", "Core", "Utility"],
"icon_path": "preview.png",
"requirements": "",
"documentation_url": "https://o3de.org/docs/user-guide/gems/reference/rendering/atom/atom-ly-integration/"
}
-1
View File
@@ -7,7 +7,6 @@
"summary": "The Atom TressFX Gem provides realistic hair and fur simulation and rendering in Atom and Open 3D Engine with AMD TressFX.",
"canonical_tags": ["Gem"],
"user_tags": ["Rendering", "Physics", "Animation"],
"icon_path": "preview.png",
"requirements": "",
"documentation_url": "https://o3de.org/docs/user-guide/gems/reference/rendering/amd/atom-tressfx/"
}
-3
View File
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa
size 41127
@@ -9,7 +9,6 @@
#include "FileManager.h"
#include <MCore/Source/LogManager.h>
#include <MCore/Source/FileSystem.h>
#include <QFileDialog>
#include <QString>
#include <QTranslator>
#include <QMessageBox>
@@ -36,6 +35,8 @@
#include <Source/Integration/Assets/MotionSetAsset.h>
#include <Source/Integration/Assets/AnimGraphAsset.h>
#include <AzQtComponents/Components/Widgets/FileDialog.h>
#include <AzToolsFramework/AssetBrowser/AssetSelectionModel.h>
#include <AzToolsFramework/API/ToolsApplicationAPI.h>
#include <AzToolsFramework/API/EditorAssetSystemAPI.h>
@@ -412,14 +413,12 @@ namespace EMStudio
{
GetManager()->SetAvoidRendering(true);
QFileDialog::Options options;
QString selectedFilter;
const AZStd::string filename = QFileDialog::getSaveFileName(parent, // parent
const AZStd::string filename = AzQtComponents::FileDialog::GetSaveFileName(parent, // parent
"Save", // caption
GetLastUsedFolder(m_lastActorFolder), // directory
"EMotion FX Actor Files (*.actor)",
&selectedFilter,
options).toUtf8().data();
&selectedFilter).toUtf8().data();
GetManager()->SetAvoidRendering(false);
@@ -471,14 +470,12 @@ namespace EMStudio
{
GetManager()->SetAvoidRendering(true);
QFileDialog::Options options;
QString selectedFilter;
AZStd::string filename = QFileDialog::getSaveFileName(parent, // parent
AZStd::string filename = AzQtComponents::FileDialog::GetSaveFileName(parent, // parent
"Save", // caption
GetLastUsedFolder(m_lastWorkspaceFolder), // directory
"EMotionFX Editor Workspace Files (*.emfxworkspace)",
&selectedFilter,
options).toUtf8().data();
&selectedFilter).toUtf8().data();
GetManager()->SetAvoidRendering(false);
@@ -553,14 +550,12 @@ namespace EMStudio
{
GetManager()->SetAvoidRendering(true);
QFileDialog::Options options;
QString selectedFilter;
AZStd::string filename = QFileDialog::getSaveFileName(parent, // parent
AZStd::string filename = AzQtComponents::FileDialog::GetSaveFileName(parent, // parent
"Save", // caption
GetLastUsedFolder(m_lastMotionSetFolder), // directory
"EMotion FX Motion Set Files (*.motionset)",
&selectedFilter,
options).toUtf8().data();
&selectedFilter).toUtf8().data();
GetManager()->SetAvoidRendering(false);
@@ -632,14 +627,12 @@ namespace EMStudio
{
GetManager()->SetAvoidRendering(true);
QFileDialog::Options options;
QString selectedFilter;
AZStd::string filename = QFileDialog::getSaveFileName(parent, // parent
AZStd::string filename = AzQtComponents::FileDialog::GetSaveFileName(parent, // parent
"Save", // caption
GetLastUsedFolder(m_lastAnimGraphFolder), // directory
"EMotion FX Anim Graph Files (*.animgraph);;All Files (*)",
&selectedFilter,
options).toUtf8().data();
&selectedFilter).toUtf8().data();
GetManager()->SetAvoidRendering(false);
@@ -675,14 +668,12 @@ namespace EMStudio
{
GetManager()->SetAvoidRendering(true);
QFileDialog::Options options;
QString selectedFilter;
const AZStd::string filename = QFileDialog::getSaveFileName(parent, // parent
const AZStd::string filename = AzQtComponents::FileDialog::GetSaveFileName(parent, // parent
"Save", // caption
GetLastUsedFolder(m_lastNodeMapFolder), // directory
"Node Map Files (*.nodeMap);;All Files (*)",
&selectedFilter,
options).toUtf8().data();
&selectedFilter).toUtf8().data();
GetManager()->SetAvoidRendering(false);
@@ -737,14 +728,12 @@ namespace EMStudio
GetManager()->SetAvoidRendering(true);
QFileDialog::Options options;
QString selectedFilter;
QString filename = QFileDialog::getSaveFileName(parent, // parent
QString filename = AzQtComponents::FileDialog::GetSaveFileName(parent, // parent
"Save", // caption
dir.c_str(), // directory
"EMotion FX Blend Config Files (*.cfg);;All Files (*)",
&selectedFilter,
options);
&selectedFilter);
GetManager()->SetAvoidRendering(false);
+2 -2
View File
@@ -14,6 +14,7 @@
#include <AzToolsFramework/Slice/SliceUtilities.h>
#include <AzToolsFramework/AssetBrowser/AssetBrowserEntry.h>
#include <AzQtComponents/Components/StyledDockWidget.h>
#include <AzQtComponents/Components/Widgets/FileDialog.h>
#include <AzQtComponents/Components/Widgets/TabWidget.h>
#include <LyShine/UiComponentTypes.h>
#include <LyShine/Bus/UiEditorCanvasBus.h>
@@ -32,7 +33,6 @@
#include <QClipboard>
#include <QUndoGroup>
#include <QScrollBar>
#include <QFileDialog>
#define UICANVASEDITOR_SETTINGS_EDIT_MODE_STATE_KEY (QString("Edit Mode State") + " " + FileHelpers::GetAbsoluteGameDir())
#define UICANVASEDITOR_SETTINGS_EDIT_MODE_GEOM_KEY (QString("Edit Mode Geometry") + " " + FileHelpers::GetAbsoluteGameDir())
@@ -706,7 +706,7 @@ bool EditorWindow::SaveCanvasToXml(UiCanvasMetadata& canvasMetadata, bool forceA
dir.append(canvasMetadata.m_canvasDisplayName.c_str());
}
QString filename = QFileDialog::getSaveFileName(nullptr,
QString filename = AzQtComponents::FileDialog::GetSaveFileName(nullptr,
QString(),
dir,
"*." UICANVASEDITOR_CANVAS_EXTENSION,
@@ -205,6 +205,10 @@ namespace LyShine
////////////////////////////////////////////////////////////////////////////////////////////////////
void LyShineSystemComponent::Deactivate()
{
#if !defined(LYSHINE_BUILDER) && !defined(LYSHINE_TESTS)
m_loadTemplatesHandler.Disconnect();
#endif
UiSystemBus::Handler::BusDisconnect();
UiSystemToolsBus::Handler::BusDisconnect();
UiFrameworkBus::Handler::BusDisconnect();
@@ -7,12 +7,12 @@
<Include File="Multiplayer/NetworkEntity/NetworkEntityRpcMessage.h" />
<Include File="Multiplayer/NetworkEntity/NetworkEntityUpdateMessage.h" />
<Packet Name="Connect" Desc="Client connection packet, on success the server will reply with an Accept">
<Packet Name="Connect" HandshakePacket="true" Desc="Client connection packet, on success the server will reply with an Accept">
<Member Type="uint16_t" Name="networkProtocolVersion" Init="0" />
<Member Type="Multiplayer::LongNetworkString" Name="ticket" />
</Packet>
<Packet Name="Accept" Desc="Server accept packet">
<Packet Name="Accept" HandshakePacket="true" Desc="Server accept packet">
<Member Type="Multiplayer::HostId" Name="hostId" Init="Multiplayer::InvalidHostId" />
<Member Type="Multiplayer::LongNetworkString" Name="map" />
</Packet>
@@ -168,7 +168,7 @@ namespace Multiplayer
;
}
bool MultiplayerEditorConnection::OnPacketReceived(AzNetworking::IConnection* connection, const IPacketHeader& packetHeader, ISerializer& serializer)
AzNetworking::PacketDispatchResult MultiplayerEditorConnection::OnPacketReceived(AzNetworking::IConnection* connection, const IPacketHeader& packetHeader, ISerializer& serializer)
{
return MultiplayerEditorPackets::DispatchPacket(connection, packetHeader, serializer, *this);
}
@@ -33,6 +33,7 @@ namespace Multiplayer
MultiplayerEditorConnection();
~MultiplayerEditorConnection() = default;
bool IsHandshakeComplete() const { return true; };
bool HandleRequest(AzNetworking::IConnection* connection, const AzNetworking::IPacketHeader& packetHeader, MultiplayerEditorPackets::EditorServerInit& packet);
bool HandleRequest(AzNetworking::IConnection* connection, const AzNetworking::IPacketHeader& packetHeader, MultiplayerEditorPackets::EditorServerReady& packet);
@@ -40,7 +41,7 @@ namespace Multiplayer
//! @{
AzNetworking::ConnectResult ValidateConnect(const AzNetworking::IpAddress& remoteAddress, const AzNetworking::IPacketHeader& packetHeader, AzNetworking::ISerializer& serializer) override;
void OnConnect(AzNetworking::IConnection* connection) override;
bool OnPacketReceived(AzNetworking::IConnection* connection, const AzNetworking::IPacketHeader& packetHeader, AzNetworking::ISerializer& serializer) override;
AzNetworking::PacketDispatchResult OnPacketReceived(AzNetworking::IConnection* connection, const AzNetworking::IPacketHeader& packetHeader, AzNetworking::ISerializer& serializer) override;
void OnPacketLost(AzNetworking::IConnection* connection, AzNetworking::PacketId packetId) override;
void OnDisconnect(AzNetworking::IConnection* connection, AzNetworking::DisconnectReason reason, AzNetworking::TerminationEndpoint endpoint) override;
//! @}
@@ -441,6 +441,11 @@ namespace Multiplayer
MultiplayerPackets::SyncConsole m_syncPacket;
};
bool MultiplayerSystemComponent::IsHandshakeComplete() const
{
return m_didHandshake;
}
bool MultiplayerSystemComponent::HandleRequest
(
[[maybe_unused]] AzNetworking::IConnection* connection,
@@ -465,6 +470,8 @@ namespace Multiplayer
if (connection->SendReliablePacket(MultiplayerPackets::Accept(InvalidHostId, sv_map)))
{
m_didHandshake = true;
// Sync our console
ConsoleReplicator consoleReplicator(connection);
AZ::Interface<AZ::IConsole>::Get()->VisitRegisteredFunctors([&consoleReplicator](AZ::ConsoleFunctorBase* functor) { consoleReplicator.Visit(functor); });
@@ -480,6 +487,8 @@ namespace Multiplayer
[[maybe_unused]] MultiplayerPackets::Accept& packet
)
{
m_didHandshake = true;
AZ::CVarFixedString commandString = "sv_map " + packet.GetMap();
AZ::Interface<AZ::IConsole>::Get()->PerformCommand(commandString.c_str());
@@ -670,7 +679,7 @@ namespace Multiplayer
}
}
bool MultiplayerSystemComponent::OnPacketReceived(AzNetworking::IConnection* connection, const IPacketHeader& packetHeader, ISerializer& serializer)
AzNetworking::PacketDispatchResult MultiplayerSystemComponent::OnPacketReceived(AzNetworking::IConnection* connection, const IPacketHeader& packetHeader, ISerializer& serializer)
{
return MultiplayerPackets::DispatchPacket(connection, packetHeader, serializer, *this);
}
@@ -76,6 +76,7 @@ namespace Multiplayer
int GetTickOrder() override;
//! @}
bool IsHandshakeComplete() const;
bool HandleRequest(AzNetworking::IConnection* connection, const AzNetworking::IPacketHeader& packetHeader, MultiplayerPackets::Connect& packet);
bool HandleRequest(AzNetworking::IConnection* connection, const AzNetworking::IPacketHeader& packetHeader, MultiplayerPackets::Accept& packet);
bool HandleRequest(AzNetworking::IConnection* connection, const AzNetworking::IPacketHeader& packetHeader, MultiplayerPackets::ReadyForEntityUpdates& packet);
@@ -89,7 +90,7 @@ namespace Multiplayer
//! @{
AzNetworking::ConnectResult ValidateConnect(const AzNetworking::IpAddress& remoteAddress, const AzNetworking::IPacketHeader& packetHeader, AzNetworking::ISerializer& serializer) override;
void OnConnect(AzNetworking::IConnection* connection) override;
bool OnPacketReceived(AzNetworking::IConnection* connection, const AzNetworking::IPacketHeader& packetHeader, AzNetworking::ISerializer& serializer) override;
AzNetworking::PacketDispatchResult OnPacketReceived(AzNetworking::IConnection* connection, const AzNetworking::IPacketHeader& packetHeader, AzNetworking::ISerializer& serializer) override;
void OnPacketLost(AzNetworking::IConnection* connection, AzNetworking::PacketId packetId) override;
void OnDisconnect(AzNetworking::IConnection* connection, AzNetworking::DisconnectReason reason, AzNetworking::TerminationEndpoint endpoint) override;
//! @}
@@ -158,6 +159,7 @@ namespace Multiplayer
double m_serverSendAccumulator = 0.0;
float m_renderBlendFactor = 0.0f;
float m_tickFactor = 0.0f;
bool m_didHandshake = false;
#if !defined(AZ_RELEASE_BUILD)
MultiplayerEditorConnection m_editorConnectionListener;
@@ -15,7 +15,6 @@
#include <QSplitter>
#include <QListView>
#include <QFileDialog>
#include <QShortcut>
#include <QKeySequence>
#include <QKeyEvent>
@@ -91,6 +90,7 @@
#include <AzToolsFramework/ToolsComponents/ToolsAssetCatalogBus.h>
#include <AzToolsFramework/UI/UICore/WidgetHelpers.h>
#include <AzQtComponents/Components/Widgets/FileDialog.h>
#include <AzQtComponents/Components/Widgets/TabWidget.h>
#include <ScriptCanvas/Core/ScriptCanvasBus.h>
@@ -1868,7 +1868,7 @@ namespace ScriptCanvasEditor
while (!isValidFileName)
{
selectedFile = QFileDialog::getSaveFileName(this, tr("Save As..."), suggestedFilename.data(), filter);
selectedFile = AzQtComponents::FileDialog::GetSaveFileName(this, tr("Save As..."), suggestedFilename.data(), filter);
// If the selected file is empty that means we just cancelled.
// So we want to break out.
@@ -24,6 +24,7 @@
#include <AzCore/Serialization/SerializeContext.h>
#include <AzCore/std/numeric.h>
#include <AzFramework/StringFunc/StringFunc.h>
#include <AzQtComponents/Components/Widgets/FileDialog.h>
#include <AzToolsFramework/API/ComponentEntitySelectionBus.h>
#include <AzToolsFramework/API/EditorAssetSystemAPI.h>
#include <AzToolsFramework/API/EditorPythonRunnerRequestsBus.h>
@@ -31,7 +32,6 @@
#include <AzToolsFramework/Entity/EditorEntityInfoBus.h>
#include <AzToolsFramework/Maths/TransformUtils.h>
#include <AzToolsFramework/UI/UICore/WidgetHelpers.h>
#include <QFileDialog>
#include <QMessageBox>
#include <WhiteBox/EditorWhiteBoxColliderBus.h>
#include <WhiteBox/WhiteBoxBus.h>
@@ -513,7 +513,7 @@ namespace WhiteBox
WhiteBoxPathAtProjectRoot(GetEntity()->GetName(), ObjExtension);
const QString fileFilter = AZStd::string::format("*.%s", ObjExtension).c_str();
const QString absoluteSaveFilePath = QFileDialog::getSaveFileName(
const QString absoluteSaveFilePath = AzQtComponents::FileDialog::GetSaveFileName(
nullptr, "Save As...", QString(initialAbsolutePathToExport.c_str()), fileFilter);
const auto absoluteSaveFilePathUtf8 = absoluteSaveFilePath.toUtf8();
@@ -577,7 +577,7 @@ namespace WhiteBox
{
const QString fileFilter =
AZStd::string::format("*.%s", Pipeline::WhiteBoxMeshAssetHandler::AssetFileExtension).c_str();
const QString absolutePath = QFileDialog::getSaveFileName(
const QString absolutePath = AzQtComponents::FileDialog::GetSaveFileName(
nullptr, "Save As Asset...", QString(initialAbsolutePath.c_str()), fileFilter);
return AZStd::string(absolutePath.toUtf8());