Merge branch 'development' into Atom/jromnoa/add-remaining-gpu-tests-to-optimized-classes
Signed-off-by: jromnoa <80134229+jromnoa@users.noreply.github.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
---
|
||||
name: ar_bug_report.md
|
||||
name: Automated Review bug report
|
||||
about: Create a bug for a an issue found in the Automated Review
|
||||
title: 'AR Bug Report'
|
||||
labels: 'needs-triage,kind/bug,kind/automation'
|
||||
|
||||
@@ -8,11 +8,12 @@
|
||||
|
||||
if(NOT PROJECT_NAME)
|
||||
cmake_minimum_required(VERSION 3.20)
|
||||
include(cmake/CompilerSettings.cmake)
|
||||
project(AutomatedTesting
|
||||
LANGUAGES C CXX
|
||||
VERSION 1.0.0.0
|
||||
)
|
||||
include(EngineFinder.cmake OPTIONAL)
|
||||
include(cmake/EngineFinder.cmake OPTIONAL)
|
||||
find_package(o3de REQUIRED)
|
||||
o3de_initialize()
|
||||
else()
|
||||
|
||||
+54
@@ -14,6 +14,7 @@ from datetime import datetime
|
||||
import ly_test_tools.log.log_monitor
|
||||
|
||||
from AWS.common import constants
|
||||
from AWS.common.resource_mappings import AWS_RESOURCE_MAPPINGS_ACCOUNT_ID_KEY
|
||||
from .aws_metrics_custom_thread import AWSMetricsThread
|
||||
|
||||
# fixture imports
|
||||
@@ -200,6 +201,59 @@ class TestAWSMetricsWindows(object):
|
||||
for thread in operational_threads:
|
||||
thread.join()
|
||||
|
||||
@pytest.mark.parametrize('level', ['AWS/Metrics'])
|
||||
def test_realtime_and_batch_analytics_no_global_accountid(self,
|
||||
level: str,
|
||||
launcher: pytest.fixture,
|
||||
asset_processor: pytest.fixture,
|
||||
workspace: pytest.fixture,
|
||||
aws_utils: pytest.fixture,
|
||||
resource_mappings: pytest.fixture,
|
||||
aws_metrics_utils: pytest.fixture):
|
||||
"""
|
||||
Verify that the metrics events are sent to CloudWatch and S3 for analytics.
|
||||
"""
|
||||
# Remove top-level account ID from resource mappings
|
||||
resource_mappings.clear_select_keys([AWS_RESOURCE_MAPPINGS_ACCOUNT_ID_KEY])
|
||||
# Start Kinesis analytics application on a separate thread to avoid blocking the test.
|
||||
kinesis_analytics_application_thread = AWSMetricsThread(target=update_kinesis_analytics_application_status,
|
||||
args=(aws_metrics_utils, resource_mappings, True))
|
||||
kinesis_analytics_application_thread.start()
|
||||
|
||||
log_monitor = setup(launcher, asset_processor)
|
||||
|
||||
# Kinesis analytics application needs to be in the running state before we start the game launcher.
|
||||
kinesis_analytics_application_thread.join()
|
||||
launcher.args = ['+LoadLevel', level]
|
||||
launcher.args.extend(['-rhi=null'])
|
||||
start_time = datetime.utcnow()
|
||||
with launcher.start(launch_ap=False):
|
||||
monitor_metrics_submission(log_monitor)
|
||||
|
||||
# Verify that real-time analytics metrics are delivered to CloudWatch.
|
||||
aws_metrics_utils.verify_cloud_watch_delivery(
|
||||
AWS_METRICS_FEATURE_NAME,
|
||||
'TotalLogins',
|
||||
[],
|
||||
start_time)
|
||||
logger.info('Real-time metrics are sent to CloudWatch.')
|
||||
|
||||
# Run time-consuming operations on separate threads to avoid blocking the test.
|
||||
operational_threads = list()
|
||||
operational_threads.append(
|
||||
AWSMetricsThread(target=query_metrics_from_s3,
|
||||
args=(aws_metrics_utils, resource_mappings)))
|
||||
operational_threads.append(
|
||||
AWSMetricsThread(target=verify_operational_metrics,
|
||||
args=(aws_metrics_utils, resource_mappings, start_time)))
|
||||
operational_threads.append(
|
||||
AWSMetricsThread(target=update_kinesis_analytics_application_status,
|
||||
args=(aws_metrics_utils, resource_mappings, False)))
|
||||
for thread in operational_threads:
|
||||
thread.start()
|
||||
for thread in operational_threads:
|
||||
thread.join()
|
||||
|
||||
@pytest.mark.parametrize('level', ['AWS/Metrics'])
|
||||
def test_unauthorized_user_request_rejected(self,
|
||||
level: str,
|
||||
|
||||
+36
@@ -12,6 +12,7 @@ import pytest
|
||||
import ly_test_tools.log.log_monitor
|
||||
|
||||
from AWS.common import constants
|
||||
from AWS.common.resource_mappings import AWS_RESOURCE_MAPPINGS_ACCOUNT_ID_KEY
|
||||
|
||||
# fixture imports
|
||||
from assetpipeline.ap_fixtures.asset_processor_fixture import asset_processor
|
||||
@@ -70,6 +71,41 @@ class TestAWSClientAuthWindows(object):
|
||||
halt_on_unexpected=True,
|
||||
)
|
||||
assert result, 'Anonymous credentials fetched successfully.'
|
||||
|
||||
@pytest.mark.parametrize('level', ['AWS/ClientAuth'])
|
||||
def test_anonymous_credentials_no_global_accountid(self,
|
||||
level: str,
|
||||
launcher: pytest.fixture,
|
||||
resource_mappings: pytest.fixture,
|
||||
workspace: pytest.fixture,
|
||||
asset_processor: pytest.fixture
|
||||
):
|
||||
"""
|
||||
Test to verify AWS Cognito Identity pool anonymous authorization.
|
||||
|
||||
Setup: Updates resource mapping file using existing CloudFormation stacks.
|
||||
Tests: Getting credentials when no credentials are configured
|
||||
Verification: Log monitor looks for success credentials log.
|
||||
"""
|
||||
# Remove top-level account ID from resource mappings
|
||||
resource_mappings.clear_select_keys([AWS_RESOURCE_MAPPINGS_ACCOUNT_ID_KEY])
|
||||
|
||||
asset_processor.start()
|
||||
asset_processor.wait_for_idle()
|
||||
|
||||
file_to_monitor = os.path.join(launcher.workspace.paths.project_log(), constants.GAME_LOG_NAME)
|
||||
log_monitor = ly_test_tools.log.log_monitor.LogMonitor(launcher=launcher, log_file_path=file_to_monitor)
|
||||
|
||||
launcher.args = ['+LoadLevel', level]
|
||||
launcher.args.extend(['-rhi=null'])
|
||||
|
||||
with launcher.start(launch_ap=False):
|
||||
result = log_monitor.monitor_log_for_lines(
|
||||
expected_lines=['(Script) - Success anonymous credentials'],
|
||||
unexpected_lines=['(Script) - Fail anonymous credentials'],
|
||||
halt_on_unexpected=True,
|
||||
)
|
||||
assert result, 'Anonymous credentials fetched successfully.'
|
||||
|
||||
def test_password_signin_credentials(self,
|
||||
launcher: pytest.fixture,
|
||||
|
||||
@@ -18,6 +18,7 @@ import ly_test_tools.environment.process_utils as process_utils
|
||||
import ly_test_tools.o3de.asset_processor_utils as asset_processor_utils
|
||||
|
||||
from AWS.common import constants
|
||||
from AWS.common.resource_mappings import AWS_RESOURCE_MAPPINGS_ACCOUNT_ID_KEY
|
||||
|
||||
# fixture imports
|
||||
from assetpipeline.ap_fixtures.asset_processor_fixture import asset_processor
|
||||
@@ -141,3 +142,51 @@ class TestAWSCoreAWSResourceInteraction(object):
|
||||
'The expected file wasn\'t successfully downloaded.'
|
||||
# clean up the file directories.
|
||||
shutil.rmtree(s3_download_dir)
|
||||
|
||||
@pytest.mark.parametrize('expected_lines', [
|
||||
['(Script) - [S3] Head object request is done',
|
||||
'(Script) - [S3] Head object success: Object example.txt is found.',
|
||||
'(Script) - [S3] Get object success: Object example.txt is downloaded.',
|
||||
'(Script) - [Lambda] Completed Invoke',
|
||||
'(Script) - [Lambda] Invoke success: {"statusCode": 200, "body": {}}',
|
||||
'(Script) - [DynamoDB] Results finished']])
|
||||
@pytest.mark.parametrize('unexpected_lines', [
|
||||
['(Script) - [S3] Head object error: No response body.',
|
||||
'(Script) - [S3] Get object error: Request validation failed, output file directory doesn\'t exist.',
|
||||
'(Script) - Request validation failed, output file miss full path.',
|
||||
'(Script) - ']])
|
||||
def test_scripting_behavior_no_global_accountid(self,
|
||||
level: str,
|
||||
launcher: pytest.fixture,
|
||||
workspace: pytest.fixture,
|
||||
asset_processor: pytest.fixture,
|
||||
resource_mappings: pytest.fixture,
|
||||
aws_utils: pytest.fixture,
|
||||
expected_lines: typing.List[str],
|
||||
unexpected_lines: typing.List[str]):
|
||||
"""
|
||||
Setup: Updates resource mapping file using existing CloudFormation stacks.
|
||||
Tests: Interact with AWS S3, DynamoDB and Lambda services.
|
||||
Verification: Script canvas nodes can communicate with AWS services successfully.
|
||||
"""
|
||||
|
||||
resource_mappings.clear_select_keys([AWS_RESOURCE_MAPPINGS_ACCOUNT_ID_KEY])
|
||||
log_monitor, s3_download_dir = setup(launcher, asset_processor)
|
||||
write_test_data_to_dynamodb_table(resource_mappings, aws_utils)
|
||||
|
||||
launcher.args = ['+LoadLevel', level]
|
||||
launcher.args.extend(['-rhi=null'])
|
||||
|
||||
with launcher.start(launch_ap=False):
|
||||
result = log_monitor.monitor_log_for_lines(
|
||||
expected_lines=expected_lines,
|
||||
unexpected_lines=unexpected_lines,
|
||||
halt_on_unexpected=True
|
||||
)
|
||||
|
||||
assert result, "Expected lines weren't found."
|
||||
|
||||
assert os.path.exists(os.path.join(s3_download_dir, 'output.txt')), \
|
||||
'The expected file wasn\'t successfully downloaded.'
|
||||
# clean up the file directories.
|
||||
shutil.rmtree(s3_download_dir)
|
||||
|
||||
@@ -102,3 +102,17 @@ class ResourceMappings:
|
||||
|
||||
def get_resource_name_id(self, resource_key: str):
|
||||
return self._resource_mappings[AWS_RESOURCE_MAPPINGS_KEY][resource_key]['Name/ID']
|
||||
|
||||
def clear_select_keys(self, resource_keys=None) -> None:
|
||||
"""
|
||||
Clears values from select resource mapping keys.
|
||||
:param resource_keys: list of keys to clear out
|
||||
"""
|
||||
with open(self._resource_mapping_file_path) as file_content:
|
||||
resource_mappings = json.load(file_content)
|
||||
|
||||
for key in resource_keys:
|
||||
resource_mappings[key] = ''
|
||||
|
||||
with open(self._resource_mapping_file_path, 'w') as file_content:
|
||||
json.dump(resource_mappings, file_content, indent=4)
|
||||
@@ -13,6 +13,8 @@ from ly_test_tools.o3de.editor_test import EditorSharedTest, EditorTestSuite
|
||||
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
|
||||
class TestAutomation(EditorTestSuite):
|
||||
|
||||
enable_prefab_system = False
|
||||
|
||||
@pytest.mark.test_case_id("C36525657")
|
||||
class AtomEditorComponents_BloomAdded(EditorSharedTest):
|
||||
from Atom.tests import hydra_AtomEditorComponents_BloomAdded as test_module
|
||||
|
||||
@@ -26,6 +26,48 @@ TEST_DIRECTORY = os.path.join(os.path.dirname(__file__), "tests")
|
||||
@pytest.mark.parametrize("level", ["Base"])
|
||||
class TestAllComponentsIndepthTests(object):
|
||||
|
||||
@pytest.mark.parametrize("screenshot_name", ["AtomBasicLevelSetup.ppm"])
|
||||
@pytest.mark.test_case_id("C34603773")
|
||||
def test_BasicLevelSetup_SetsUpLevel(
|
||||
self, request, editor, workspace, project, launcher_platform, level, screenshot_name):
|
||||
"""
|
||||
Please review the hydra script run by this test for more specific test info.
|
||||
Tests that a basic rendering level setup can be created (lighting, meshes, materials, etc.).
|
||||
"""
|
||||
# Clear existing test screenshots before starting test.
|
||||
screenshot_directory = os.path.join(workspace.paths.project(), DEFAULT_SUBFOLDER_PATH)
|
||||
test_screenshots = [os.path.join(screenshot_directory, screenshot_name)]
|
||||
file_system.delete(test_screenshots, True, True)
|
||||
|
||||
golden_images = [os.path.join(golden_images_directory(), screenshot_name)]
|
||||
|
||||
level_creation_expected_lines = [
|
||||
"Viewport is set to the expected size: True",
|
||||
"Exited game mode"
|
||||
]
|
||||
unexpected_lines = ["Traceback (most recent call last):"]
|
||||
|
||||
hydra.launch_and_validate_results(
|
||||
request,
|
||||
TEST_DIRECTORY,
|
||||
editor,
|
||||
"hydra_GPUTest_BasicLevelSetup.py",
|
||||
timeout=180,
|
||||
expected_lines=level_creation_expected_lines,
|
||||
unexpected_lines=unexpected_lines,
|
||||
halt_on_unexpected=True,
|
||||
cfg_args=[level],
|
||||
null_renderer=False,
|
||||
enable_prefab_system=False,
|
||||
)
|
||||
|
||||
similarity_threshold = 0.99
|
||||
for test_screenshot, golden_image in zip(test_screenshots, golden_images):
|
||||
screenshot_comparison_result = compare_screenshot_similarity(
|
||||
test_screenshot, golden_image, similarity_threshold, True, screenshot_directory)
|
||||
if screenshot_comparison_result != "Screenshots match":
|
||||
raise Exception(f"Screenshot test failed: {screenshot_comparison_result}")
|
||||
|
||||
@pytest.mark.test_case_id("C34525095")
|
||||
def test_LightComponent_ScreenshotMatchesGoldenImage(
|
||||
self, request, editor, workspace, project, launcher_platform, level):
|
||||
@@ -71,6 +113,7 @@ class TestAllComponentsIndepthTests(object):
|
||||
halt_on_unexpected=True,
|
||||
cfg_args=[level],
|
||||
null_renderer=False,
|
||||
enable_prefab_system=False,
|
||||
)
|
||||
|
||||
similarity_threshold = 0.99
|
||||
@@ -118,6 +161,7 @@ class TestPerformanceBenchmarkSuite(object):
|
||||
halt_on_unexpected=True,
|
||||
cfg_args=[level],
|
||||
null_renderer=False,
|
||||
enable_prefab_system=False,
|
||||
)
|
||||
|
||||
aggregator = BenchmarkDataAggregator(workspace, logger, 'periodic')
|
||||
@@ -155,5 +199,6 @@ class TestMaterialEditor(object):
|
||||
halt_on_unexpected=False,
|
||||
null_renderer=False,
|
||||
cfg_args=[cfg_args],
|
||||
log_file_name="MaterialEditor.log"
|
||||
log_file_name="MaterialEditor.log",
|
||||
enable_prefab_system=False,
|
||||
)
|
||||
|
||||
@@ -23,6 +23,8 @@ class TestAutomation(EditorTestSuite):
|
||||
# Remove -autotest_mode from global_extra_cmdline_args since we need rendering for these tests.
|
||||
global_extra_cmdline_args = ["-BatchMode"] # Default is ["-BatchMode", "-autotest_mode"]
|
||||
|
||||
enable_prefab_system = False
|
||||
|
||||
@pytest.mark.test_case_id("C34603773")
|
||||
class AtomGPU_BasicLevelSetup_SetsUpLevel(EditorSharedTest):
|
||||
use_null_renderer = False # Default is True
|
||||
|
||||
@@ -85,6 +85,7 @@ class TestAtomEditorComponentsMain(object):
|
||||
halt_on_unexpected=True,
|
||||
null_renderer=True,
|
||||
cfg_args=cfg_args,
|
||||
enable_prefab_system=False,
|
||||
)
|
||||
|
||||
|
||||
@@ -155,5 +156,6 @@ class TestMaterialEditorBasicTests(object):
|
||||
halt_on_unexpected=True,
|
||||
null_renderer=True,
|
||||
log_file_name="MaterialEditor.log",
|
||||
enable_prefab_system=False,
|
||||
)
|
||||
|
||||
|
||||
@@ -23,28 +23,28 @@ from base import TestAutomationBase
|
||||
class TestAutomation(TestAutomationBase):
|
||||
def test_ActorSplitsAfterCollision(self, request, workspace, editor, launcher_platform):
|
||||
from .tests import Blast_ActorSplitsAfterCollision as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_ActorSplitsAfterRadialDamage(self, request, workspace, editor, launcher_platform):
|
||||
from .tests import Blast_ActorSplitsAfterRadialDamage as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_ActorSplitsAfterCapsuleDamage(self, request, workspace, editor, launcher_platform):
|
||||
from .tests import Blast_ActorSplitsAfterCapsuleDamage as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_ActorSplitsAfterImpactSpreadDamage(self, request, workspace, editor, launcher_platform):
|
||||
from .tests import Blast_ActorSplitsAfterImpactSpreadDamage as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_ActorSplitsAfterShearDamage(self, request, workspace, editor, launcher_platform):
|
||||
from .tests import Blast_ActorSplitsAfterShearDamage as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_ActorSplitsAfterTriangleDamage(self, request, workspace, editor, launcher_platform):
|
||||
from .tests import Blast_ActorSplitsAfterTriangleDamage as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_ActorSplitsAfterStressDamage(self, request, workspace, editor, launcher_platform):
|
||||
from .tests import Blast_ActorSplitsAfterStressDamage as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
+2
-1
@@ -51,5 +51,6 @@ class TestComponentAssetListAutomation(object):
|
||||
editor,
|
||||
"ComponentUpdateListProperty_test_case.py",
|
||||
expected_lines=expected_lines,
|
||||
cfg_args=[level]
|
||||
cfg_args=[level],
|
||||
enable_prefab_system=False,
|
||||
)
|
||||
|
||||
@@ -28,7 +28,7 @@ Assuming CMake is already setup on your operating system, below are some sample
|
||||
cd /path/to/od3e/
|
||||
mkdir windows_vs2019
|
||||
cd windows_vs2019
|
||||
cmake .. -G "Visual Studio 16 2019" -A x64 -T host=x64 -DLY_3RDPARTY_PATH="%3RDPARTYPATH%" -DLY_PROJECTS=AutomatedTesting
|
||||
cmake .. -G "Visual Studio 16 2019" -DLY_PROJECTS=AutomatedTesting
|
||||
|
||||
To manually install the project in development mode using your own installed Python interpreter:
|
||||
cd /path/to/od3e/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools
|
||||
|
||||
+4
@@ -57,6 +57,10 @@ def add_level_component(component_name):
|
||||
level_component_list, entity.EntityType().Level)
|
||||
level_component_outcome = editor.EditorLevelComponentAPIBus(bus.Broadcast, 'AddComponentsOfType',
|
||||
[level_component_type_ids_list[0]])
|
||||
if not level_component_outcome.IsSuccess():
|
||||
print('Failed to add {} level component'.format(component_name))
|
||||
return None
|
||||
|
||||
level_component = level_component_outcome.GetValue()[0]
|
||||
return level_component
|
||||
|
||||
|
||||
+7
-2
@@ -29,7 +29,7 @@ def teardown_editor(editor):
|
||||
|
||||
def launch_and_validate_results(request, test_directory, editor, editor_script, expected_lines, unexpected_lines=[],
|
||||
halt_on_unexpected=False, run_python="--runpythontest", auto_test_mode=True, null_renderer=True, cfg_args=[],
|
||||
timeout=300, log_file_name="Editor.log"):
|
||||
timeout=300, log_file_name="Editor.log", enable_prefab_system=True):
|
||||
"""
|
||||
Runs the Editor with the specified script, and monitors for expected log lines.
|
||||
:param request: Special fixture providing information of the requesting test function.
|
||||
@@ -45,17 +45,22 @@ def launch_and_validate_results(request, test_directory, editor, editor_script,
|
||||
:param cfg_args: Additional arguments for CFG, such as LevelName.
|
||||
:param timeout: Length of time for test to run. Default is 60.
|
||||
:param log_file_name: Name of the log file created by the editor. Defaults to 'Editor.log'
|
||||
:param enable_prefab_system: Flag to determine whether to use new prefab system or use deprecated slice system. Defaults to True.
|
||||
"""
|
||||
test_case = os.path.join(test_directory, editor_script)
|
||||
request.addfinalizer(lambda: teardown_editor(editor))
|
||||
logger.debug("Running automated test: {}".format(editor_script))
|
||||
editor.args.extend(["--skipWelcomeScreenDialog", "--regset=/Amazon/Settings/EnableSourceControl=false",
|
||||
"--regset=/Amazon/Preferences/EnablePrefabSystem=false", run_python, test_case,
|
||||
run_python, test_case,
|
||||
f"--pythontestcase={request.node.name}", "--runpythonargs", " ".join(cfg_args)])
|
||||
if auto_test_mode:
|
||||
editor.args.extend(["--autotest_mode"])
|
||||
if null_renderer:
|
||||
editor.args.extend(["-rhi=Null"])
|
||||
if enable_prefab_system:
|
||||
editor.args.extend(["--regset=/Amazon/Preferences/EnablePrefabSystem=true"])
|
||||
else:
|
||||
editor.args.extend(["--regset=/Amazon/Preferences/EnablePrefabSystem=false"])
|
||||
|
||||
with editor.start():
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@ from base import TestAutomationBase
|
||||
class TestAutomation(TestAutomationBase):
|
||||
def _run_prefab_test(self, request, workspace, editor, test_module, batch_mode=True, autotest_mode=True):
|
||||
self._run_test(request, workspace, editor, test_module,
|
||||
extra_cmdline_args=["--regset=/Amazon/Preferences/EnablePrefabSystem=true"],
|
||||
batch_mode=batch_mode,
|
||||
autotest_mode=autotest_mode)
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@ from base import TestAutomationBase
|
||||
class TestAutomation(TestAutomationBase):
|
||||
def _run_prefab_test(self, request, workspace, editor, test_module, batch_mode=True, autotest_mode=True):
|
||||
self._run_test(request, workspace, editor, test_module,
|
||||
extra_cmdline_args=["--regset=/Amazon/Preferences/EnablePrefabSystem=true"],
|
||||
batch_mode=batch_mode,
|
||||
autotest_mode=autotest_mode)
|
||||
|
||||
|
||||
@@ -25,8 +25,8 @@ class TestAutomation(TestAutomationBase):
|
||||
|
||||
def test_NvCloth_AddClothSimulationToMesh(self, request, workspace, editor, launcher_platform):
|
||||
from .tests import NvCloth_AddClothSimulationToMesh as test_module
|
||||
self._run_test(request, workspace, editor, test_module, use_null_renderer = self.use_null_renderer)
|
||||
self._run_test(request, workspace, editor, test_module, use_null_renderer = self.use_null_renderer, enable_prefab_system=False)
|
||||
|
||||
def test_NvCloth_AddClothSimulationToActor(self, request, workspace, editor, launcher_platform):
|
||||
from .tests import NvCloth_AddClothSimulationToActor as test_module
|
||||
self._run_test(request, workspace, editor, test_module, use_null_renderer = self.use_null_renderer)
|
||||
self._run_test(request, workspace, editor, test_module, use_null_renderer = self.use_null_renderer, enable_prefab_system=False)
|
||||
|
||||
@@ -26,158 +26,158 @@ class TestAutomation(TestAutomationBase):
|
||||
r"AutomatedTesting\Levels\Physics\Material_LibraryCrudOperationsReflectOnRagdollBones")
|
||||
def test_Material_LibraryCrudOperationsReflectOnRagdollBones(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.material import Material_LibraryCrudOperationsReflectOnRagdollBones as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_Material_RagdollBones(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.material import Material_RagdollBones as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@fm.file_revert("c15308221_material_componentsinsyncwithlibrary.physmaterial",
|
||||
r"AutomatedTesting\Levels\Physics\Material_ComponentsInSyncWithLibrary")
|
||||
def test_Material_ComponentsInSyncWithLibrary(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.material import Material_ComponentsInSyncWithLibrary as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
# BUG: LY-107723")
|
||||
def test_ScriptCanvas_SetKinematicTargetTransform(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.script_canvas import ScriptCanvas_SetKinematicTargetTransform as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
# Failing, PhysXTerrain
|
||||
@fm.file_revert("c4925579_material_addmodifydeleteonterrain.physmaterial",
|
||||
r"AutomatedTesting\Levels\Physics\Material_LibraryCrudOperationsReflectOnTerrain")
|
||||
def test_Material_LibraryCrudOperationsReflectOnTerrain(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.material import Material_LibraryCrudOperationsReflectOnTerrain as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
# Failing, PhysXTerrain
|
||||
def test_Terrain_TerrainTexturePainterWorks(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.terrain import Terrain_TerrainTexturePainterWorks as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
# Failing, PhysXTerrain
|
||||
def test_Material_CanBeAssignedToTerrain(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.material import Material_CanBeAssignedToTerrain as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
# Failing, PhysXTerrain
|
||||
def test_Material_DefaultLibraryConsistentOnAllFeatures(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.material import Material_DefaultLibraryConsistentOnAllFeatures as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
# Failing, PhysXTerrain
|
||||
@fm.file_revert("all_ones_1.physmaterial", r"AutomatedTesting\Levels\Physics\Material_DefaultMaterialLibraryChangesWork")
|
||||
@fm.file_override("default.physxconfiguration", "Material_DefaultMaterialLibraryChangesWork.physxconfiguration", "AutomatedTesting")
|
||||
def test_Material_DefaultMaterialLibraryChangesWork(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.material import Material_DefaultMaterialLibraryChangesWork as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_Collider_SameCollisionGroupSameLayerCollide(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.collider import Collider_SameCollisionGroupSameLayerCollide as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_Ragdoll_OldRagdollSerializationNoErrors(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.ragdoll import Ragdoll_OldRagdollSerializationNoErrors as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@fm.file_override("default.physxconfiguration", "ScriptCanvas_OverlapNode.physxconfiguration")
|
||||
def test_ScriptCanvas_OverlapNode(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.script_canvas import ScriptCanvas_OverlapNode as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_Material_StaticFriction(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.material import Material_StaticFriction as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@fm.file_revert("c4888315_material_addmodifydeleteoncollider.physmaterial",
|
||||
r"AutomatedTesting\Levels\Physics\Material_LibraryCrudOperationsReflectOnCollider")
|
||||
def test_Material_LibraryCrudOperationsReflectOnCollider(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.material import Material_LibraryCrudOperationsReflectOnCollider as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@fm.file_revert("c15563573_material_addmodifydeleteoncharactercontroller.physmaterial",
|
||||
r"AutomatedTesting\Levels\Physics\Material_LibraryCrudOperationsReflectOnCharacterController")
|
||||
def test_Material_LibraryCrudOperationsReflectOnCharacterController(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.material import Material_LibraryCrudOperationsReflectOnCharacterController as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@fm.file_revert("c4888315_material_addmodifydeleteoncollider.physmaterial",
|
||||
r"AutomatedTesting\Levels\Physics\Material_LibraryCrudOperationsReflectOnCollider")
|
||||
def test_Material_LibraryCrudOperationsReflectOnCollider(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.material import Material_LibraryCrudOperationsReflectOnCollider as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
|
||||
@fm.file_revert("c15563573_material_addmodifydeleteoncharactercontroller.physmaterial",
|
||||
r"AutomatedTesting\Levels\Physics\Material_LibraryCrudOperationsReflectOnCharacterController")
|
||||
def test_Material_LibraryCrudOperationsReflectOnCharacterController(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.material import Material_LibraryCrudOperationsReflectOnCharacterController as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@fm.file_revert("c4044455_material_librarychangesinstantly.physmaterial",
|
||||
r"AutomatedTesting\Levels\Physics\C4044455_Material_LibraryChangesInstantly")
|
||||
def test_Material_LibraryChangesReflectInstantly(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.material import Material_LibraryChangesReflectInstantly as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@fm.file_revert("Material_LibraryUpdatedAcrossLevels.physmaterial",
|
||||
r"AutomatedTesting\Levels\Physics\Material_LibraryUpdatedAcrossLevels")
|
||||
def test_Material_LibraryUpdatedAcrossLevels(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.material import Material_LibraryUpdatedAcrossLevels as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_RigidBody_LinearDampingAffectsMotion(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.rigid_body import RigidBody_LinearDampingAffectsMotion as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_Terrain_CollisionAgainstRigidBody(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.terrain import Terrain_CollisionAgainstRigidBody as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_ShapeCollider_CylinderShapeCollides(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.collider import ShapeCollider_CylinderShapeCollides as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_Physics_WorldBodyBusWorksOnEditorComponents(self, request, workspace, editor, launcher_platform):
|
||||
from .tests import Physics_WorldBodyBusWorksOnEditorComponents as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_Collider_PxMeshErrorIfNoMesh(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.collider import Collider_PxMeshErrorIfNoMesh as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_ForceRegion_ImpulsesBoxShapedRigidBody(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.force_region import ForceRegion_ImpulsesBoxShapedRigidBody as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_Terrain_SpawnSecondTerrainComponentWarning(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.terrain import Terrain_SpawnSecondTerrainComponentWarning as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_Terrain_AddPhysTerrainComponent(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.terrain import Terrain_AddPhysTerrainComponent as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_Terrain_CanAddMultipleTerrainComponents(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.terrain import Terrain_CanAddMultipleTerrainComponents as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_Terrain_MultipleTerrainComponentsWarning(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.terrain import Terrain_MultipleTerrainComponentsWarning as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_Terrain_MultipleTerrainComponentsWarning(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.terrain import Terrain_MultipleTerrainComponentsWarning as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_ForceRegion_HighValuesDirectionAxesWorkWithNoError(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.force_region import ForceRegion_HighValuesDirectionAxesWorkWithNoError as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_Terrain_MultipleResolutionsValid(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.terrain import Terrain_MultipleResolutionsValid as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_ForceRegion_SmallMagnitudeDeviationOnLargeForces(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.force_region import ForceRegion_SmallMagnitudeDeviationOnLargeForces as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@@ -30,33 +30,33 @@ class TestAutomation(TestAutomationBase):
|
||||
|
||||
def test_RigidBody_EnablingGravityWorksUsingNotificationsPoC(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.rigid_body import RigidBody_EnablingGravityWorksUsingNotificationsPoC as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_ForceRegion_LocalSpaceForceOnRigidBodies(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.force_region import ForceRegion_LocalSpaceForceOnRigidBodies as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
@fm.file_override('physxsystemconfiguration.setreg','Material_DynamicFriction.setreg_override',
|
||||
'AutomatedTesting/Registry', search_subdirs=True)
|
||||
def test_Material_DynamicFriction(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.material import Material_DynamicFriction as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_Collider_SameCollisionGroupDiffLayersCollide(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.collider import Collider_SameCollisionGroupDiffLayersCollide as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_CharacterController_SwitchLevels(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.character_controller import CharacterController_SwitchLevels as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_Ragdoll_AddPhysxRagdollComponentWorks(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.ragdoll import Ragdoll_AddPhysxRagdollComponentWorks as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_ScriptCanvas_MultipleRaycastNode(self, request, workspace, editor, launcher_platform):
|
||||
@@ -64,43 +64,43 @@ class TestAutomation(TestAutomationBase):
|
||||
# Fixme: This test previously relied on unexpected lines log reading with is now not supported.
|
||||
# Now the log reading must be done inside the test, preferably with the Tracer() utility
|
||||
# unexpected_lines = ["Assert"] + test_module.Lines.unexpected
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
@fm.file_override('physxsystemconfiguration.setreg','Collider_DiffCollisionGroupDiffCollidingLayersNotCollide.setreg_override',
|
||||
'AutomatedTesting/Registry', search_subdirs=True)
|
||||
def test_Collider_DiffCollisionGroupDiffCollidingLayersNotCollide(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.collider import Collider_DiffCollisionGroupDiffCollidingLayersNotCollide as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_Joints_HingeLeadFollowerCollide(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.joints import Joints_HingeLeadFollowerCollide as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_Collider_PxMeshConvexMeshCollides(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.collider import Collider_PxMeshConvexMeshCollides as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_ShapeCollider_CylinderShapeCollides(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.shape_collider import ShapeCollider_CylinderShapeCollides as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_C15425929_Undo_Redo(self, request, workspace, editor, launcher_platform):
|
||||
from .tests import Physics_UndoRedoWorksOnEntityWithPhysComponents as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@pytest.mark.GROUP_tick
|
||||
@pytest.mark.xfail(reason="Test still under development.")
|
||||
def test_Tick_InterpolatedRigidBodyMotionIsSmooth(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.tick import Tick_InterpolatedRigidBodyMotionIsSmooth as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@pytest.mark.GROUP_tick
|
||||
@pytest.mark.xfail(reason="Test still under development.")
|
||||
def test_Tick_CharacterGameplayComponentMotionIsSmooth(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.tick import Tick_CharacterGameplayComponentMotionIsSmooth as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@@ -59,9 +59,6 @@ class EditorSingleTest_WithFileOverrides(EditorSingleTest):
|
||||
@pytest.mark.parametrize("project", ["AutomatedTesting"])
|
||||
class TestAutomationWithPrefabSystemEnabled(EditorTestSuite):
|
||||
|
||||
global_extra_cmdline_args = ['-BatchMode', '-autotest_mode',
|
||||
'--regset=/Amazon/Preferences/EnablePrefabSystem=true']
|
||||
|
||||
@staticmethod
|
||||
def get_number_parallel_editors():
|
||||
return 16
|
||||
@@ -81,6 +78,8 @@ class TestAutomationWithPrefabSystemEnabled(EditorTestSuite):
|
||||
@pytest.mark.parametrize("project", ["AutomatedTesting"])
|
||||
class TestAutomation(EditorTestSuite):
|
||||
|
||||
enable_prefab_system = False
|
||||
|
||||
@staticmethod
|
||||
def get_number_parallel_editors():
|
||||
return 16
|
||||
|
||||
@@ -31,223 +31,223 @@ class TestAutomation(TestAutomationBase):
|
||||
@revert_physics_config
|
||||
def test_Terrain_NoPhysTerrainComponentNoCollision(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.terrain import Terrain_NoPhysTerrainComponentNoCollision as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_RigidBody_InitialLinearVelocity(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.rigid_body import RigidBody_InitialLinearVelocity as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_RigidBody_StartGravityEnabledWorks(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.rigid_body import RigidBody_StartGravityEnabledWorks as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_RigidBody_KinematicModeWorks(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.rigid_body import RigidBody_KinematicModeWorks as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_ForceRegion_LinearDampingForceOnRigidBodies(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.force_region import ForceRegion_LinearDampingForceOnRigidBodies as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_ForceRegion_SimpleDragForceOnRigidBodies(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.force_region import ForceRegion_SimpleDragForceOnRigidBodies as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_ForceRegion_CapsuleShapedForce(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.force_region import ForceRegion_CapsuleShapedForce as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_ForceRegion_ImpulsesCapsuleShapedRigidBody(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.force_region import ForceRegion_ImpulsesCapsuleShapedRigidBody as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_RigidBody_MomentOfInertiaManualSetting(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.rigid_body import RigidBody_MomentOfInertiaManualSetting as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_RigidBody_COM_ManualSettingWorks(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.rigid_body import RigidBody_COM_ManualSettingWorks as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_RigidBody_AddRigidBodyComponent(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.rigid_body import RigidBody_AddRigidBodyComponent as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_ForceRegion_SplineForceOnRigidBodies(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.force_region import ForceRegion_SplineForceOnRigidBodies as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
@fm.file_override('physxsystemconfiguration.setreg','Material_RestitutionCombine.setreg_override',
|
||||
'AutomatedTesting/Registry', search_subdirs=True)
|
||||
def test_Material_RestitutionCombine(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.material import Material_RestitutionCombine as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
@fm.file_override('physxsystemconfiguration.setreg','Material_FrictionCombine.setreg_override',
|
||||
'AutomatedTesting/Registry', search_subdirs=True)
|
||||
def test_Material_FrictionCombine(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.material import Material_FrictionCombine as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_Collider_ColliderPositionOffset(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.collider import Collider_ColliderPositionOffset as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_RigidBody_AngularDampingAffectsRotation(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.rigid_body import RigidBody_AngularDampingAffectsRotation as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_Physics_VerifyColliderRigidBodyMeshAndTerrainWorkTogether(self, request, workspace, editor, launcher_platform):
|
||||
from .tests import Physics_VerifyColliderRigidBodyMeshAndTerrainWorkTogether as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_ForceRegion_MultipleForcesInSameComponentCombineForces(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.force_region import ForceRegion_MultipleForcesInSameComponentCombineForces as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_ForceRegion_ImpulsesPxMeshShapedRigidBody(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.force_region import ForceRegion_ImpulsesPxMeshShapedRigidBody as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_ScriptCanvas_TriggerEvents(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.script_canvas import ScriptCanvas_TriggerEvents as test_module
|
||||
# FIXME: expected_lines = test_module.LogLines.expected_lines
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_ForceRegion_ZeroPointForceDoesNothing(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.force_region import ForceRegion_ZeroPointForceDoesNothing as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_ForceRegion_ZeroWorldSpaceForceDoesNothing(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.force_region import ForceRegion_ZeroWorldSpaceForceDoesNothing as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_ForceRegion_ZeroLinearDampingDoesNothing(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.force_region import ForceRegion_ZeroLinearDampingDoesNothing as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_ForceRegion_MovingForceRegionChangesNetForce(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.force_region import ForceRegion_MovingForceRegionChangesNetForce as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_ScriptCanvas_CollisionEvents(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.script_canvas import ScriptCanvas_CollisionEvents as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_ForceRegion_DirectionHasNoAffectOnTotalForce(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.force_region import ForceRegion_DirectionHasNoAffectOnTotalForce as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_RigidBody_StartAsleepWorks(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.rigid_body import RigidBody_StartAsleepWorks as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_ForceRegion_SliceFileInstantiates(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.force_region import ForceRegion_SliceFileInstantiates as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_ForceRegion_ZeroLocalSpaceForceDoesNothing(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.force_region import ForceRegion_ZeroLocalSpaceForceDoesNothing as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_ForceRegion_ZeroSimpleDragForceDoesNothing(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.force_region import ForceRegion_ZeroSimpleDragForceDoesNothing as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_RigidBody_COM_ComputingWorks(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.rigid_body import RigidBody_COM_ComputingWorks as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_RigidBody_MassDifferentValuesWorks(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.rigid_body import RigidBody_MassDifferentValuesWorks as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
@fm.file_override('physxsystemconfiguration.setreg','Material_RestitutionCombinePriorityOrder.setreg_override',
|
||||
'AutomatedTesting/Registry', search_subdirs=True)
|
||||
def test_Material_RestitutionCombinePriorityOrder(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.material import Material_RestitutionCombinePriorityOrder as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_ForceRegion_SplineRegionWithModifiedTransform(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.force_region import ForceRegion_SplineRegionWithModifiedTransform as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_ScriptCanvas_ShapeCast(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.script_canvas import ScriptCanvas_ShapeCast as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_RigidBody_InitialAngularVelocity(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.rigid_body import RigidBody_InitialAngularVelocity as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_ForceRegion_ZeroSplineForceDoesNothing(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.force_region import ForceRegion_ZeroSplineForceDoesNothing as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_Physics_DynamicSliceWithPhysNotSpawnsStaticSlice(self, request, workspace, editor, launcher_platform):
|
||||
from .tests import Physics_DynamicSliceWithPhysNotSpawnsStaticSlice as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_ForceRegion_PositionOffset(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.force_region import ForceRegion_PositionOffset as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
@fm.file_override('physxsystemconfiguration.setreg','Material_FrictionCombinePriorityOrder.setreg_override',
|
||||
'AutomatedTesting/Registry', search_subdirs=True)
|
||||
def test_Material_FrictionCombinePriorityOrder(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.material import Material_FrictionCombinePriorityOrder as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@pytest.mark.xfail(
|
||||
reason="Something with the CryRenderer disabling is causing this test to fail now.")
|
||||
@revert_physics_config
|
||||
def test_Ragdoll_LevelSwitchDoesNotCrash(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.ragdoll import Ragdoll_LevelSwitchDoesNotCrash as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_ForceRegion_MultipleComponentsCombineForces(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.force_region import ForceRegion_MultipleComponentsCombineForces as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
# Marking the test as an expected failure due to sporadic failure on Automated Review: LYN-2580
|
||||
# The test still runs, but a failure of the test doesn't result in the test run failing
|
||||
@@ -258,102 +258,102 @@ class TestAutomation(TestAutomationBase):
|
||||
'AutomatedTesting/Registry', search_subdirs=True)
|
||||
def test_Material_PerFaceMaterialGetsCorrectMaterial(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.material import Material_PerFaceMaterialGetsCorrectMaterial as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@pytest.mark.xfail(
|
||||
reason="This test will sometimes fail as the ball will continue to roll before the timeout is reached.")
|
||||
@revert_physics_config
|
||||
def test_RigidBody_SleepWhenBelowKineticThreshold(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.rigid_body import RigidBody_SleepWhenBelowKineticThreshold as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_RigidBody_COM_NotIncludesTriggerShapes(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.rigid_body import RigidBody_COM_NotIncludesTriggerShapes as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_Material_NoEffectIfNoColliderShape(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.material import Material_NoEffectIfNoColliderShape as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_Collider_TriggerPassThrough(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.collider import Collider_TriggerPassThrough as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_RigidBody_SetGravityWorks(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.rigid_body import RigidBody_SetGravityWorks as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
@fm.file_override('physxsystemconfiguration.setreg','Material_CharacterController.setreg_override',
|
||||
'AutomatedTesting/Registry', search_subdirs=True)
|
||||
def test_Material_CharacterController(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.material import Material_CharacterController as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_Material_EmptyLibraryUsesDefault(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.material import Material_EmptyLibraryUsesDefault as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_ForceRegion_NoQuiverOnHighLinearDampingForce(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.force_region import ForceRegion_NoQuiverOnHighLinearDampingForce as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_RigidBody_ComputeInertiaWorks(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.rigid_body import RigidBody_ComputeInertiaWorks as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_ScriptCanvas_PostPhysicsUpdate(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.script_canvas import ScriptCanvas_PostPhysicsUpdate as test_module
|
||||
# Fixme: unexpected_lines = ["Assert"] + test_module.Lines.unexpected
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
@fm.file_override('physxsystemconfiguration.setreg','Collider_NoneCollisionGroupSameLayerNotCollide.setreg_override',
|
||||
'AutomatedTesting/Registry', search_subdirs=True)
|
||||
def test_Collider_NoneCollisionGroupSameLayerNotCollide(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.collider import Collider_NoneCollisionGroupSameLayerNotCollide as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
@fm.file_override('physxsystemconfiguration.setreg','Collider_SameCollisionGroupSameCustomLayerCollide.setreg_override',
|
||||
'AutomatedTesting/Registry', search_subdirs=True)
|
||||
def test_Collider_SameCollisionGroupSameCustomLayerCollide(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.collider import Collider_SameCollisionGroupSameCustomLayerCollide as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
@fm.file_override('physxdefaultsceneconfiguration.setreg','ScriptCanvas_PostUpdateEvent.setreg_override',
|
||||
'AutomatedTesting/Registry', search_subdirs=True)
|
||||
def test_ScriptCanvas_PostUpdateEvent(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.script_canvas import ScriptCanvas_PostUpdateEvent as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
@fm.file_override('physxsystemconfiguration.setreg','Material_Restitution.setreg_override',
|
||||
'AutomatedTesting/Registry', search_subdirs=True)
|
||||
def test_Material_Restitution(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.material import Material_Restitution as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
@fm.file_override('physxdefaultsceneconfiguration.setreg', 'ScriptCanvas_PreUpdateEvent.setreg_override',
|
||||
'AutomatedTesting/Registry', search_subdirs=True)
|
||||
def test_ScriptCanvas_PreUpdateEvent(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.script_canvas import ScriptCanvas_PreUpdateEvent as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_ForceRegion_PxMeshShapedForce(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.force_region import ForceRegion_PxMeshShapedForce as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
# Marking the Test as expected to fail using the xfail decorator due to sporadic failure on Automated Review: SPEC-3146
|
||||
# The test still runs, but a failure of the test doesn't result in the test run failing
|
||||
@@ -361,176 +361,173 @@ class TestAutomation(TestAutomationBase):
|
||||
@revert_physics_config
|
||||
def test_RigidBody_MaxAngularVelocityWorks(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.rigid_body import RigidBody_MaxAngularVelocityWorks as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_Joints_HingeSoftLimitsConstrained(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.joints import Joints_HingeSoftLimitsConstrained as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_Joints_BallSoftLimitsConstrained(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.joints import Joints_BallSoftLimitsConstrained as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_Joints_BallLeadFollowerCollide(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.joints import Joints_BallLeadFollowerCollide as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
@fm.file_override('physxsystemconfiguration.setreg','Collider_AddingNewGroupWorks.setreg_override',
|
||||
'AutomatedTesting/Registry', search_subdirs=True)
|
||||
def test_Collider_AddingNewGroupWorks(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.collider import Collider_AddingNewGroupWorks as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_ShapeCollider_InactiveWhenNoShapeComponent(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.shape_collider import ShapeCollider_InactiveWhenNoShapeComponent as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_Collider_CheckDefaultShapeSettingIsPxMesh(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.collider import Collider_CheckDefaultShapeSettingIsPxMesh as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_ShapeCollider_LargeNumberOfShapeCollidersWontCrashEditor(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.shape_collider import ShapeCollider_LargeNumberOfShapeCollidersWontCrashEditor as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_Collider_SphereShapeEditing(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.collider import Collider_SphereShapeEditing as test_module
|
||||
self._run_test(request, workspace, editor, test_module,
|
||||
extra_cmdline_args=["--regset=/Amazon/Preferences/EnablePrefabSystem=true"])
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
|
||||
@revert_physics_config
|
||||
def test_Collider_BoxShapeEditing(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.collider import Collider_BoxShapeEditing as test_module
|
||||
self._run_test(request, workspace, editor, test_module,
|
||||
extra_cmdline_args=["--regset=/Amazon/Preferences/EnablePrefabSystem=true"])
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
|
||||
@revert_physics_config
|
||||
def test_Collider_CapsuleShapeEditing(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.collider import Collider_CapsuleShapeEditing as test_module
|
||||
self._run_test(request, workspace, editor, test_module,
|
||||
extra_cmdline_args=["--regset=/Amazon/Preferences/EnablePrefabSystem=true"])
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
|
||||
def test_ForceRegion_WithNonTriggerColliderWarning(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.force_region import ForceRegion_WithNonTriggerColliderWarning as test_module
|
||||
# Fixme: expected_lines = ["[Warning] (PhysX Force Region) - Please ensure collider component marked as trigger exists in entity"]
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_ForceRegion_WorldSpaceForceOnRigidBodies(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.force_region import ForceRegion_WorldSpaceForceOnRigidBodies as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_ForceRegion_PointForceOnRigidBodies(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.force_region import ForceRegion_PointForceOnRigidBodies as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_ForceRegion_SphereShapedForce(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.force_region import ForceRegion_SphereShapedForce as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_ForceRegion_RotationalOffset(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.force_region import ForceRegion_RotationalOffset as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_Material_LibraryClearingAssignsDefault(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.material import Material_LibraryClearingAssignsDefault as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_Collider_AddColliderComponent(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.collider import Collider_AddColliderComponent as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@pytest.mark.xfail(
|
||||
reason="This will fail due to this issue ATOM-15487.")
|
||||
def test_Collider_PxMeshAutoAssignedWhenModifyingRenderMeshComponent(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.collider import Collider_PxMeshAutoAssignedWhenModifyingRenderMeshComponent as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_Collider_PxMeshAutoAssignedWhenAddingRenderMeshComponent(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.collider import Collider_PxMeshAutoAssignedWhenAddingRenderMeshComponent as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_Collider_MultipleSurfaceSlots(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.collider import Collider_MultipleSurfaceSlots as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_Collider_PxMeshNotAutoAssignedWhenNoPhysicsFbx(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.collider import Collider_PxMeshNotAutoAssignedWhenNoPhysicsFbx as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_RigidBody_EnablingGravityWorksPoC(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.rigid_body import RigidBody_EnablingGravityWorksPoC as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
@fm.file_override('physxsystemconfiguration.setreg','Collider_CollisionGroupsWorkflow.setreg_override',
|
||||
'AutomatedTesting/Registry', search_subdirs=True)
|
||||
def test_Collider_CollisionGroupsWorkflow(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.collider import Collider_CollisionGroupsWorkflow as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_Collider_ColliderRotationOffset(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.collider import Collider_ColliderRotationOffset as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_ForceRegion_ParentChildForcesCombineForces(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.force_region import ForceRegion_ParentChildForcesCombineForces as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_ShapeCollider_CanBeAddedWitNoWarnings(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.shape_collider import ShapeCollider_CanBeAddedWitNoWarnings as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_Physics_UndoRedoWorksOnEntityWithPhysComponents(self, request, workspace, editor, launcher_platform):
|
||||
from .tests import Physics_UndoRedoWorksOnEntityWithPhysComponents as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_Joints_Fixed2BodiesConstrained(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.joints import Joints_Fixed2BodiesConstrained as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_Joints_Hinge2BodiesConstrained(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.joints import Joints_Hinge2BodiesConstrained as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_Joints_Ball2BodiesConstrained(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.joints import Joints_Ball2BodiesConstrained as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_Joints_FixedBreakable(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.joints import Joints_FixedBreakable as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_Joints_HingeBreakable(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.joints import Joints_HingeBreakable as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_Joints_BallBreakable(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.joints import Joints_BallBreakable as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_Joints_HingeNoLimitsConstrained(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.joints import Joints_HingeNoLimitsConstrained as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_Joints_BallNoLimitsConstrained(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.joints import Joints_BallNoLimitsConstrained as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_Joints_GlobalFrameConstrained(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.joints import Joints_GlobalFrameConstrained as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@revert_physics_config
|
||||
def test_Material_DefaultLibraryUpdatedAcrossLevels(self, request, workspace, editor, launcher_platform):
|
||||
@@ -540,7 +537,7 @@ class TestAutomation(TestAutomationBase):
|
||||
search_subdirs=True)
|
||||
def levels_before(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.material import Material_DefaultLibraryUpdatedAcrossLevels_before as test_module_0
|
||||
self._run_test(request, workspace, editor, test_module_0)
|
||||
self._run_test(request, workspace, editor, test_module_0, enable_prefab_system=False)
|
||||
|
||||
# File override replaces the previous physxconfiguration file with another where the only difference is the default material library
|
||||
@fm.file_override("physxsystemconfiguration.setreg",
|
||||
@@ -549,7 +546,7 @@ class TestAutomation(TestAutomationBase):
|
||||
search_subdirs=True)
|
||||
def levels_after(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.material import Material_DefaultLibraryUpdatedAcrossLevels_after as test_module_1
|
||||
self._run_test(request, workspace, editor, test_module_1)
|
||||
self._run_test(request, workspace, editor, test_module_1, enable_prefab_system=False)
|
||||
|
||||
levels_before(self, request, workspace, editor, launcher_platform)
|
||||
levels_after(self, request, workspace, editor, launcher_platform)
|
||||
@@ -32,7 +32,7 @@ class TestAutomation(TestAutomationBase):
|
||||
def test_ScriptCanvas_GetCollisionNameReturnsName(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.script_canvas import ScriptCanvas_GetCollisionNameReturnsName as test_module
|
||||
# Fixme: expected_lines=["Layer Name: Right"]
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
## Seems to be flaky, need to investigate
|
||||
def test_ScriptCanvas_GetCollisionNameReturnsNothingWhenHasToggledLayer(self, request, workspace, editor, launcher_platform):
|
||||
@@ -42,4 +42,4 @@ class TestAutomation(TestAutomationBase):
|
||||
# Fixme: for group in collision_groups:
|
||||
# Fixme: unexpected_lines.append(f"GroupName: {group}")
|
||||
# Fixme: expected_lines=["GroupName: "]
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@@ -30,11 +30,11 @@ class TestUtils(TestAutomationBase):
|
||||
|
||||
expected_lines = []
|
||||
unexpected_lines = ["Assert"]
|
||||
self._run_test(request, workspace, editor, physmaterial_editor_test_module, expected_lines, unexpected_lines)
|
||||
self._run_test(request, workspace, editor, physmaterial_editor_test_module, expected_lines, unexpected_lines, enable_prefab_system=False)
|
||||
|
||||
def test_UtilTest_Tracer_PicksErrorsAndWarnings(self, request, workspace, launcher_platform, editor):
|
||||
from .utils import UtilTest_Tracer_PicksErrorsAndWarnings as testcase_module
|
||||
self._run_test(request, workspace, editor, testcase_module, [], [])
|
||||
self._run_test(request, workspace, editor, testcase_module, [], [], enable_prefab_system=False)
|
||||
|
||||
def test_FileManagement_FindingFiles(self, workspace, launcher_platform):
|
||||
"""
|
||||
@@ -263,4 +263,4 @@ class TestUtils(TestAutomationBase):
|
||||
|
||||
expected_lines = []
|
||||
unexpected_lines = ["Assert"]
|
||||
self._run_test(request, workspace, editor, test_module, expected_lines, unexpected_lines)
|
||||
self._run_test(request, workspace, editor, test_module, expected_lines, unexpected_lines, enable_prefab_system=False)
|
||||
|
||||
@@ -12,7 +12,6 @@ import pytest
|
||||
import os
|
||||
import sys
|
||||
|
||||
from ly_test_tools import LAUNCHERS
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../automatedtesting_shared')
|
||||
|
||||
from base import TestAutomationBase
|
||||
@@ -24,42 +23,41 @@ class TestAutomation(TestAutomationBase):
|
||||
|
||||
def _run_prefab_test(self, request, workspace, editor, test_module, batch_mode=True, autotest_mode=True):
|
||||
self._run_test(request, workspace, editor, test_module,
|
||||
extra_cmdline_args=["--regset=/Amazon/Preferences/EnablePrefabSystem=true"],
|
||||
batch_mode=batch_mode,
|
||||
autotest_mode=autotest_mode)
|
||||
|
||||
def test_PrefabLevel_OpensLevelWithEntities(self, request, workspace, editor, launcher_platform):
|
||||
from .tests import PrefabLevel_OpensLevelWithEntities as test_module
|
||||
def test_OpenLevel_ContainingTwoEntities(self, request, workspace, editor, launcher_platform):
|
||||
from Prefab.tests.open_level import OpenLevel_ContainingTwoEntities as test_module
|
||||
self._run_prefab_test(request, workspace, editor, test_module)
|
||||
|
||||
def test_PrefabBasicWorkflow_CreatePrefab(self, request, workspace, editor, launcher_platform):
|
||||
from .tests import PrefabBasicWorkflow_CreatePrefab as test_module
|
||||
def test_CreatePrefab_WithSingleEntity(self, request, workspace, editor, launcher_platform):
|
||||
from Prefab.tests.create_prefab import CreatePrefab_WithSingleEntity as test_module
|
||||
self._run_prefab_test(request, workspace, editor, test_module)
|
||||
|
||||
def test_PrefabBasicWorkflow_InstantiatePrefab(self, request, workspace, editor, launcher_platform):
|
||||
from .tests import PrefabBasicWorkflow_InstantiatePrefab as test_module
|
||||
def test_InstantiatePrefab_ContainingASingleEntity(self, request, workspace, editor, launcher_platform):
|
||||
from Prefab.tests.instantiate_prefab import InstantiatePrefab_ContainingASingleEntity as test_module
|
||||
self._run_prefab_test(request, workspace, editor, test_module)
|
||||
|
||||
def test_PrefabBasicWorkflow_CreateAndDeletePrefab(self, request, workspace, editor, launcher_platform):
|
||||
from .tests import PrefabBasicWorkflow_CreateAndDeletePrefab as test_module
|
||||
def test_DeletePrefab_ContainingASingleEntity(self, request, workspace, editor, launcher_platform):
|
||||
from Prefab.tests.delete_prefab import DeletePrefab_ContainingASingleEntity as test_module
|
||||
self._run_prefab_test(request, workspace, editor, test_module)
|
||||
|
||||
def test_PrefabBasicWorkflow_CreateAndReparentPrefab(self, request, workspace, editor, launcher_platform):
|
||||
from .tests import PrefabBasicWorkflow_CreateAndReparentPrefab as test_module
|
||||
def test_ReparentPrefab_UnderAnotherPrefab(self, request, workspace, editor, launcher_platform):
|
||||
from Prefab.tests.reparent_prefab import ReparentPrefab_UnderAnotherPrefab as test_module
|
||||
self._run_prefab_test(request, workspace, editor, test_module, autotest_mode=False)
|
||||
|
||||
def test_PrefabBasicWorkflow_CreateReparentAndDetachPrefab(self, request, workspace, editor, launcher_platform):
|
||||
from .tests import PrefabBasicWorkflow_CreateReparentAndDetachPrefab as test_module
|
||||
def test_DetachPrefab_UnderAnotherPrefab(self, request, workspace, editor, launcher_platform):
|
||||
from Prefab.tests.detach_prefab import DetachPrefab_UnderAnotherPrefab as test_module
|
||||
self._run_prefab_test(request, workspace, editor, test_module, autotest_mode=False)
|
||||
|
||||
def test_PrefabBasicWorkflow_CreateAndDuplicatePrefab(self, request, workspace, editor, launcher_platform):
|
||||
from .tests import PrefabBasicWorkflow_CreateAndDuplicatePrefab as test_module
|
||||
def test_DuplicatePrefab_ContainingASingleEntity(self, request, workspace, editor, launcher_platform):
|
||||
from Prefab.tests.duplicate_prefab import DuplicatePrefab_ContainingASingleEntity as test_module
|
||||
self._run_prefab_test(request, workspace, editor, test_module)
|
||||
|
||||
def test_PrefabComplexWorflow_CreatePrefabOfChildEntity(self, request, workspace, editor, launcher_platform):
|
||||
from .tests import PrefabComplexWorflow_CreatePrefabOfChildEntity as test_module
|
||||
def test_CreatePrefab_UnderAnEntity(self, request, workspace, editor, launcher_platform):
|
||||
from Prefab.tests.create_prefab import CreatePrefab_UnderAnEntity as test_module
|
||||
self._run_prefab_test(request, workspace, editor, test_module, autotest_mode=False)
|
||||
|
||||
def test_PrefabComplexWorflow_CreatePrefabInsidePrefab(self, request, workspace, editor, launcher_platform):
|
||||
from .tests import PrefabComplexWorflow_CreatePrefabInsidePrefab as test_module
|
||||
def test_CreatePrefab_UnderAnotherPrefab(self, request, workspace, editor, launcher_platform):
|
||||
from Prefab.tests.create_prefab import CreatePrefab_UnderAnotherPrefab as test_module
|
||||
self._run_prefab_test(request, workspace, editor, test_module, autotest_mode=False)
|
||||
|
||||
+3
-3
@@ -5,7 +5,7 @@ For complete copyright and license terms please see the LICENSE at the root of t
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
def PrefabComplexWorflow_CreatePrefabOfChildEntity():
|
||||
def CreatePrefab_UnderAnEntity():
|
||||
"""
|
||||
Test description:
|
||||
- Creates two entities, parent and child. Child entity has Parent entity as its parent.
|
||||
@@ -18,7 +18,7 @@ def PrefabComplexWorflow_CreatePrefabOfChildEntity():
|
||||
from editor_python_test_tools.editor_entity_utils import EditorEntity
|
||||
from editor_python_test_tools.prefab_utils import Prefab
|
||||
|
||||
import PrefabTestUtils as prefab_test_utils
|
||||
import Prefab.tests.PrefabTestUtils as prefab_test_utils
|
||||
|
||||
prefab_test_utils.open_base_tests_level()
|
||||
|
||||
@@ -49,4 +49,4 @@ def PrefabComplexWorflow_CreatePrefabOfChildEntity():
|
||||
|
||||
if __name__ == "__main__":
|
||||
from editor_python_test_tools.utils import Report
|
||||
Report.start_test(PrefabComplexWorflow_CreatePrefabOfChildEntity)
|
||||
Report.start_test(CreatePrefab_UnderAnEntity)
|
||||
+3
-3
@@ -5,7 +5,7 @@ For complete copyright and license terms please see the LICENSE at the root of t
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
def PrefabComplexWorflow_CreatePrefabInsidePrefab():
|
||||
def CreatePrefab_UnderAnotherPrefab():
|
||||
"""
|
||||
Test description:
|
||||
- Creates an entity with a physx collider
|
||||
@@ -17,7 +17,7 @@ def PrefabComplexWorflow_CreatePrefabInsidePrefab():
|
||||
from editor_python_test_tools.editor_entity_utils import EditorEntity
|
||||
from editor_python_test_tools.prefab_utils import Prefab
|
||||
|
||||
import PrefabTestUtils as prefab_test_utils
|
||||
import Prefab.tests.PrefabTestUtils as prefab_test_utils
|
||||
|
||||
prefab_test_utils.open_base_tests_level()
|
||||
|
||||
@@ -54,4 +54,4 @@ def PrefabComplexWorflow_CreatePrefabInsidePrefab():
|
||||
|
||||
if __name__ == "__main__":
|
||||
from editor_python_test_tools.utils import Report
|
||||
Report.start_test(PrefabComplexWorflow_CreatePrefabInsidePrefab)
|
||||
Report.start_test(CreatePrefab_UnderAnotherPrefab)
|
||||
+3
-3
@@ -5,7 +5,7 @@ For complete copyright and license terms please see the LICENSE at the root of t
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
def PrefabBasicWorkflow_CreatePrefab():
|
||||
def CreatePrefab_WithSingleEntity():
|
||||
|
||||
CAR_PREFAB_FILE_NAME = 'car_prefab'
|
||||
|
||||
@@ -13,7 +13,7 @@ def PrefabBasicWorkflow_CreatePrefab():
|
||||
from editor_python_test_tools.utils import Report
|
||||
from editor_python_test_tools.prefab_utils import Prefab
|
||||
|
||||
import PrefabTestUtils as prefab_test_utils
|
||||
import Prefab.tests.PrefabTestUtils as prefab_test_utils
|
||||
|
||||
prefab_test_utils.open_base_tests_level()
|
||||
|
||||
@@ -26,4 +26,4 @@ def PrefabBasicWorkflow_CreatePrefab():
|
||||
|
||||
if __name__ == "__main__":
|
||||
from editor_python_test_tools.utils import Report
|
||||
Report.start_test(PrefabBasicWorkflow_CreatePrefab)
|
||||
Report.start_test(CreatePrefab_WithSingleEntity)
|
||||
+3
-3
@@ -5,14 +5,14 @@ For complete copyright and license terms please see the LICENSE at the root of t
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
def PrefabBasicWorkflow_CreateAndDeletePrefab():
|
||||
def DeletePrefab_ContainingASingleEntity():
|
||||
|
||||
CAR_PREFAB_FILE_NAME = 'car_prefab'
|
||||
|
||||
from editor_python_test_tools.editor_entity_utils import EditorEntity
|
||||
from editor_python_test_tools.prefab_utils import Prefab
|
||||
|
||||
import PrefabTestUtils as prefab_test_utils
|
||||
import Prefab.tests.PrefabTestUtils as prefab_test_utils
|
||||
|
||||
prefab_test_utils.open_base_tests_level()
|
||||
|
||||
@@ -29,4 +29,4 @@ def PrefabBasicWorkflow_CreateAndDeletePrefab():
|
||||
|
||||
if __name__ == "__main__":
|
||||
from editor_python_test_tools.utils import Report
|
||||
Report.start_test(PrefabBasicWorkflow_CreateAndDeletePrefab)
|
||||
Report.start_test(DeletePrefab_ContainingASingleEntity)
|
||||
+3
-3
@@ -5,7 +5,7 @@ For complete copyright and license terms please see the LICENSE at the root of t
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
def PrefabBasicWorkflow_CreateReparentAndDetachPrefab():
|
||||
def DetachPrefab_UnderAnotherPrefab():
|
||||
|
||||
CAR_PREFAB_FILE_NAME = 'car_prefab'
|
||||
WHEEL_PREFAB_FILE_NAME = 'wheel_prefab'
|
||||
@@ -18,7 +18,7 @@ def PrefabBasicWorkflow_CreateReparentAndDetachPrefab():
|
||||
from editor_python_test_tools.editor_entity_utils import EditorEntity
|
||||
from editor_python_test_tools.prefab_utils import Prefab
|
||||
|
||||
import PrefabTestUtils as prefab_test_utils
|
||||
import Prefab.tests.PrefabTestUtils as prefab_test_utils
|
||||
|
||||
prefab_test_utils.open_base_tests_level()
|
||||
|
||||
@@ -48,4 +48,4 @@ def PrefabBasicWorkflow_CreateReparentAndDetachPrefab():
|
||||
|
||||
if __name__ == "__main__":
|
||||
from editor_python_test_tools.utils import Report
|
||||
Report.start_test(PrefabBasicWorkflow_CreateReparentAndDetachPrefab)
|
||||
Report.start_test(DetachPrefab_UnderAnotherPrefab)
|
||||
+3
-3
@@ -5,14 +5,14 @@ For complete copyright and license terms please see the LICENSE at the root of t
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
def PrefabBasicWorkflow_CreateAndDuplicatePrefab():
|
||||
def DuplicatePrefab_ContainingASingleEntity():
|
||||
|
||||
CAR_PREFAB_FILE_NAME = 'car_prefab'
|
||||
|
||||
from editor_python_test_tools.editor_entity_utils import EditorEntity
|
||||
from editor_python_test_tools.prefab_utils import Prefab
|
||||
|
||||
import PrefabTestUtils as prefab_test_utils
|
||||
import Prefab.tests.PrefabTestUtils as prefab_test_utils
|
||||
|
||||
prefab_test_utils.open_base_tests_level()
|
||||
|
||||
@@ -29,4 +29,4 @@ def PrefabBasicWorkflow_CreateAndDuplicatePrefab():
|
||||
|
||||
if __name__ == "__main__":
|
||||
from editor_python_test_tools.utils import Report
|
||||
Report.start_test(PrefabBasicWorkflow_CreateAndDuplicatePrefab)
|
||||
Report.start_test(DuplicatePrefab_ContainingASingleEntity)
|
||||
+3
-3
@@ -5,7 +5,7 @@ For complete copyright and license terms please see the LICENSE at the root of t
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
def PrefabBasicWorkflow_InstantiatePrefab():
|
||||
def InstantiatePrefab_ContainingASingleEntity():
|
||||
|
||||
from azlmbr.math import Vector3
|
||||
|
||||
@@ -15,7 +15,7 @@ def PrefabBasicWorkflow_InstantiatePrefab():
|
||||
|
||||
from editor_python_test_tools.prefab_utils import Prefab
|
||||
|
||||
import PrefabTestUtils as prefab_test_utils
|
||||
import Prefab.tests.PrefabTestUtils as prefab_test_utils
|
||||
|
||||
prefab_test_utils.open_base_tests_level()
|
||||
|
||||
@@ -30,4 +30,4 @@ def PrefabBasicWorkflow_InstantiatePrefab():
|
||||
|
||||
if __name__ == "__main__":
|
||||
from editor_python_test_tools.utils import Report
|
||||
Report.start_test(PrefabBasicWorkflow_InstantiatePrefab)
|
||||
Report.start_test(InstantiatePrefab_ContainingASingleEntity)
|
||||
+2
-2
@@ -14,7 +14,7 @@ class Tests():
|
||||
|
||||
# fmt:on
|
||||
|
||||
def PrefabLevel_OpensLevelWithEntities():
|
||||
def OpenLevel_ContainingTwoEntities():
|
||||
"""
|
||||
Opens the level that contains 2 entities, "EmptyEntity" and "EntityWithPxCollider".
|
||||
This test makes sure that both entities exist after opening the level and that:
|
||||
@@ -70,4 +70,4 @@ def PrefabLevel_OpensLevelWithEntities():
|
||||
if __name__ == "__main__":
|
||||
|
||||
from editor_python_test_tools.utils import Report
|
||||
Report.start_test(PrefabLevel_OpensLevelWithEntities)
|
||||
Report.start_test(OpenLevel_ContainingTwoEntities)
|
||||
+3
-3
@@ -5,7 +5,7 @@ For complete copyright and license terms please see the LICENSE at the root of t
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
def PrefabBasicWorkflow_CreateAndReparentPrefab():
|
||||
def ReparentPrefab_UnderAnotherPrefab():
|
||||
|
||||
CAR_PREFAB_FILE_NAME = 'car_prefab'
|
||||
WHEEL_PREFAB_FILE_NAME = 'wheel_prefab'
|
||||
@@ -18,7 +18,7 @@ def PrefabBasicWorkflow_CreateAndReparentPrefab():
|
||||
from editor_python_test_tools.editor_entity_utils import EditorEntity
|
||||
from editor_python_test_tools.prefab_utils import Prefab
|
||||
|
||||
import PrefabTestUtils as prefab_test_utils
|
||||
import Prefab.tests.PrefabTestUtils as prefab_test_utils
|
||||
|
||||
prefab_test_utils.open_base_tests_level()
|
||||
|
||||
@@ -45,4 +45,4 @@ def PrefabBasicWorkflow_CreateAndReparentPrefab():
|
||||
|
||||
if __name__ == "__main__":
|
||||
from editor_python_test_tools.utils import Report
|
||||
Report.start_test(PrefabBasicWorkflow_CreateAndReparentPrefab)
|
||||
Report.start_test(ReparentPrefab_UnderAnotherPrefab)
|
||||
@@ -8,42 +8,54 @@ import azlmbr.bus
|
||||
import azlmbr.asset
|
||||
import azlmbr.editor
|
||||
import azlmbr.math
|
||||
import azlmbr.legacy.general
|
||||
|
||||
def raise_and_stop(msg):
|
||||
print (msg)
|
||||
print('Starting mock asset tests')
|
||||
handler = azlmbr.editor.EditorEventBusHandler()
|
||||
|
||||
def on_notify_editor_initialized(args):
|
||||
# These tests are meant to check that the test_asset.mock source asset turned into
|
||||
# a test_asset.mock_asset product asset via the Python asset builder system
|
||||
mockAssetType = azlmbr.math.Uuid_CreateString('{9274AD17-3212-4651-9F3B-7DCCB080E467}', 0)
|
||||
mockAssetPath = 'gem/pythontests/pythonassetbuilder/test_asset.mock_asset'
|
||||
assetId = azlmbr.asset.AssetCatalogRequestBus(azlmbr.bus.Broadcast, 'GetAssetIdByPath', mockAssetPath, mockAssetType, False)
|
||||
if (assetId.is_valid() is False):
|
||||
print(f'Mock AssetId is not valid! Got {assetId.to_string()} instead')
|
||||
else:
|
||||
print(f'Mock AssetId is valid!')
|
||||
|
||||
assetIdString = assetId.to_string()
|
||||
if (assetIdString.endswith(':528cca58') is False):
|
||||
print(f'Mock AssetId {assetIdString} has unexpected sub-id for {mockAssetPath}!')
|
||||
else:
|
||||
print(f'Mock AssetId has expected sub-id for {mockAssetPath}!')
|
||||
|
||||
print ('Mock asset exists')
|
||||
|
||||
# These tests detect if the geom_group.fbx file turns into a number of azmodel product assets
|
||||
def test_azmodel_product(generatedModelAssetPath):
|
||||
azModelAssetType = azlmbr.math.Uuid_CreateString('{2C7477B6-69C5-45BE-8163-BCD6A275B6D8}', 0)
|
||||
assetId = azlmbr.asset.AssetCatalogRequestBus(azlmbr.bus.Broadcast, 'GetAssetIdByPath', generatedModelAssetPath, azModelAssetType, False)
|
||||
assetIdString = assetId.to_string()
|
||||
if (assetId.is_valid()):
|
||||
print(f'AssetId found for asset ({generatedModelAssetPath}) found')
|
||||
else:
|
||||
print(f'Asset at path {generatedModelAssetPath} has unexpected asset ID ({assetIdString})!')
|
||||
|
||||
test_azmodel_product('gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_z_positive_1.azmodel')
|
||||
test_azmodel_product('gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_z_negative_1.azmodel')
|
||||
test_azmodel_product('gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_y_positive_1.azmodel')
|
||||
test_azmodel_product('gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_y_negative_1.azmodel')
|
||||
test_azmodel_product('gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_x_positive_1.azmodel')
|
||||
test_azmodel_product('gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_x_negative_1.azmodel')
|
||||
test_azmodel_product('gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_center_1.azmodel')
|
||||
|
||||
# clear up notification handler
|
||||
global handler
|
||||
handler.disconnect()
|
||||
handler = None
|
||||
|
||||
print('Finished mock asset tests')
|
||||
azlmbr.editor.EditorToolsApplicationRequestBus(azlmbr.bus.Broadcast, 'ExitNoPrompt')
|
||||
|
||||
# These tests are meant to check that the test_asset.mock source asset turned into
|
||||
# a test_asset.mock_asset product asset via the Python asset builder system
|
||||
mockAssetType = azlmbr.math.Uuid_CreateString('{9274AD17-3212-4651-9F3B-7DCCB080E467}', 0)
|
||||
mockAssetPath = 'gem/pythontests/pythonassetbuilder/test_asset.mock_asset'
|
||||
assetId = azlmbr.asset.AssetCatalogRequestBus(azlmbr.bus.Broadcast, 'GetAssetIdByPath', mockAssetPath, mockAssetType, False)
|
||||
if (assetId.is_valid() is False):
|
||||
raise_and_stop(f'Mock AssetId is not valid! Got {assetId.to_string()} instead')
|
||||
|
||||
assetIdString = assetId.to_string()
|
||||
if (assetIdString.endswith(':528cca58') is False):
|
||||
raise_and_stop(f'Mock AssetId {assetIdString} has unexpected sub-id for {mockAssetPath}!')
|
||||
|
||||
print ('Mock asset exists')
|
||||
|
||||
# These tests detect if the geom_group.fbx file turns into a number of azmodel product assets
|
||||
def test_azmodel_product(generatedModelAssetPath):
|
||||
azModelAssetType = azlmbr.math.Uuid_CreateString('{2C7477B6-69C5-45BE-8163-BCD6A275B6D8}', 0)
|
||||
assetId = azlmbr.asset.AssetCatalogRequestBus(azlmbr.bus.Broadcast, 'GetAssetIdByPath', generatedModelAssetPath, azModelAssetType, False)
|
||||
assetIdString = assetId.to_string()
|
||||
if (assetId.is_valid()):
|
||||
print(f'AssetId found for asset ({generatedModelAssetPath}) found')
|
||||
else:
|
||||
raise_and_stop(f'Asset at path {generatedModelAssetPath} has unexpected asset ID ({assetIdString})!')
|
||||
|
||||
test_azmodel_product('gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_z_positive_1.azmodel')
|
||||
test_azmodel_product('gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_z_negative_1.azmodel')
|
||||
test_azmodel_product('gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_y_positive_1.azmodel')
|
||||
test_azmodel_product('gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_y_negative_1.azmodel')
|
||||
test_azmodel_product('gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_x_positive_1.azmodel')
|
||||
test_azmodel_product('gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_x_negative_1.azmodel')
|
||||
test_azmodel_product('gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_center_1.azmodel')
|
||||
|
||||
azlmbr.editor.EditorToolsApplicationRequestBus(azlmbr.bus.Broadcast, 'ExitNoPrompt')
|
||||
handler.connect()
|
||||
handler.add_callback('NotifyEditorInitialized', on_notify_editor_initialized)
|
||||
|
||||
+1
-2
@@ -12,13 +12,12 @@ class Tests():
|
||||
add_terrain_collider = ("Terrain Physics Heightfield Collider component added", "Failed to add a Terrain Physics Heightfield Collider component")
|
||||
box_dimensions_changed = ("Aabb dimensions changed successfully", "Failed change Aabb dimensions")
|
||||
configuration_changed = ("Terrain size changed successfully", "Failed terrain size change")
|
||||
no_errors_and_warnings_found = ("No errors and warnings found", "Found errors and warnings")
|
||||
#fmt: on
|
||||
|
||||
def TerrainPhysicsCollider_ChangesSizeWithAxisAlignedBoxShapeChanges():
|
||||
"""
|
||||
Summary:
|
||||
Test aspects of the TerrainHeightGradientList through the BehaviorContext and the Property Tree.
|
||||
Test aspects of the Terrain Physics Heightfield Collider through the BehaviorContext and the Property Tree.
|
||||
|
||||
Test Steps:
|
||||
Expected Behavior:
|
||||
|
||||
@@ -0,0 +1,164 @@
|
||||
"""
|
||||
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
|
||||
"""
|
||||
|
||||
#fmt: off
|
||||
class Tests():
|
||||
create_terrain_spawner_entity = ("Terrain_spawner_entity created successfully", "Failed to create terrain_spawner_entity")
|
||||
create_height_provider_entity = ("Height_provider_entity created successfully", "Failed to create height_provider_entity")
|
||||
create_test_ball = ("Ball created successfully", "Failed to create Ball")
|
||||
box_dimensions_changed = ("Aabb dimensions changed successfully", "Failed change Aabb dimensions")
|
||||
shape_changed = ("Shape changed successfully", "Failed Shape change")
|
||||
entity_added = ("Entity added successfully", "Failed Entity add")
|
||||
frequency_changed = ("Frequency changed successfully", "Failed Frequency change")
|
||||
shape_set = ("Shape set to Sphere successfully", "Failed to set Sphere shape")
|
||||
test_collision = ("Ball collided with terrain", "Ball failed to collide with terrain")
|
||||
no_errors_and_warnings_found = ("No errors and warnings found", "Found errors and warnings")
|
||||
#fmt: on
|
||||
|
||||
def Terrain_SupportsPhysics():
|
||||
"""
|
||||
Summary:
|
||||
Test aspects of the TerrainHeightGradientList through the BehaviorContext and the Property Tree.
|
||||
|
||||
Test Steps:
|
||||
Expected Behavior:
|
||||
The Editor is stable there are no warnings or errors.
|
||||
|
||||
Test Steps:
|
||||
1) Load the base level
|
||||
2) Create 2 test entities, one parent at 512.0, 512.0, 50.0 and one child at the default position and add the required components
|
||||
2a) Create a ball at 600.0, 600.0, 46.0 - This position is not too high over the heightfield so will collide in a reasonable time
|
||||
3) Start the Tracer to catch any errors and warnings
|
||||
4) Change the Axis Aligned Box Shape dimensions
|
||||
5) Set the Vegetation Shape reference to TestEntity1
|
||||
6) Set the FastNoise gradient frequency to 0.01
|
||||
7) Set the Gradient List to TestEntity2
|
||||
8) Set the PhysX Collider to Sphere mode
|
||||
9) Disable and Enable the Terrain Gradient List so that it is recognised
|
||||
10) Enter game mode and test if the ball hits the heightfield within 3 seconds
|
||||
11) Verify there are no errors and warnings in the logs
|
||||
|
||||
|
||||
:return: None
|
||||
"""
|
||||
|
||||
from editor_python_test_tools.editor_entity_utils import EditorEntity
|
||||
from editor_python_test_tools.utils import TestHelper as helper, Report
|
||||
from editor_python_test_tools.utils import Report, Tracer
|
||||
import editor_python_test_tools.hydra_editor_utils as hydra
|
||||
import azlmbr.math as azmath
|
||||
import azlmbr.legacy.general as general
|
||||
import azlmbr.bus as bus
|
||||
import azlmbr.editor as editor
|
||||
import math
|
||||
|
||||
SET_BOX_X_SIZE = 1024.0
|
||||
SET_BOX_Y_SIZE = 1024.0
|
||||
SET_BOX_Z_SIZE = 100.0
|
||||
|
||||
helper.init_idle()
|
||||
|
||||
# 1) Load the level
|
||||
helper.open_level("", "Base")
|
||||
helper.wait_for_condition(lambda: general.get_current_level_name() == "Base", 2.0)
|
||||
|
||||
#1a) Load the level components
|
||||
hydra.add_level_component("Terrain World")
|
||||
hydra.add_level_component("Terrain World Renderer")
|
||||
|
||||
# 2) Create 2 test entities, one parent at 512.0, 512.0, 50.0 and one child at the default position and add the required components
|
||||
entity1_components_to_add = ["Axis Aligned Box Shape", "Terrain Layer Spawner", "Terrain Height Gradient List", "Terrain Physics Heightfield Collider", "PhysX Heightfield Collider"]
|
||||
entity2_components_to_add = ["Vegetation Reference Shape", "Gradient Transform Modifier", "FastNoise Gradient"]
|
||||
ball_components_to_add = ["Sphere Shape", "PhysX Collider", "PhysX Rigid Body"]
|
||||
terrain_spawner_entity = hydra.Entity("TestEntity1")
|
||||
terrain_spawner_entity.create_entity(azmath.Vector3(512.0, 512.0, 50.0), entity1_components_to_add)
|
||||
Report.result(Tests.create_terrain_spawner_entity, terrain_spawner_entity.id.IsValid())
|
||||
height_provider_entity = hydra.Entity("TestEntity2")
|
||||
height_provider_entity.create_entity(azmath.Vector3(0.0, 0.0, 0.0), entity2_components_to_add,terrain_spawner_entity.id)
|
||||
Report.result(Tests.create_height_provider_entity, height_provider_entity.id.IsValid())
|
||||
# 2a) Create a ball at 600.0, 600.0, 46.0 - This position is not too high over the heightfield so will collide in a reasonable time
|
||||
ball = hydra.Entity("Ball")
|
||||
ball.create_entity(azmath.Vector3(600.0, 600.0, 46.0), ball_components_to_add)
|
||||
Report.result(Tests.create_test_ball, ball.id.IsValid())
|
||||
# Give everything a chance to finish initializing.
|
||||
general.idle_wait_frames(1)
|
||||
|
||||
# 3) Start the Tracer to catch any errors and warnings
|
||||
with Tracer() as section_tracer:
|
||||
# 4) Change the Axis Aligned Box Shape dimensions
|
||||
box_dimensions = azmath.Vector3(SET_BOX_X_SIZE, SET_BOX_Y_SIZE, SET_BOX_Z_SIZE)
|
||||
terrain_spawner_entity.get_set_test(0, "Axis Aligned Box Shape|Box Configuration|Dimensions", box_dimensions)
|
||||
box_shape_dimensions = hydra.get_component_property_value(terrain_spawner_entity.components[0], "Axis Aligned Box Shape|Box Configuration|Dimensions")
|
||||
Report.result(Tests.box_dimensions_changed, box_dimensions == box_shape_dimensions)
|
||||
|
||||
# 5) Set the Vegetaion Shape reference to TestEntity1
|
||||
height_provider_entity.get_set_test(0, "Configuration|Shape Entity Id", terrain_spawner_entity.id)
|
||||
entityId = hydra.get_component_property_value(height_provider_entity.components[0], "Configuration|Shape Entity Id")
|
||||
Report.result(Tests.shape_changed, entityId == terrain_spawner_entity.id)
|
||||
|
||||
# 6) Set the FastNoise Gradient frequency to 0.01
|
||||
Frequency = 0.01
|
||||
height_provider_entity.get_set_test(2, "Configuration|Frequency", Frequency)
|
||||
FrequencyVal = hydra.get_component_property_value(height_provider_entity.components[2], "Configuration|Frequency")
|
||||
Report.result(Tests.frequency_changed, math.isclose(Frequency, FrequencyVal, abs_tol = 0.00001))
|
||||
|
||||
# 7) Set the Gradient List to TestEntity2
|
||||
propertyTree = hydra.get_property_tree(terrain_spawner_entity.components[2])
|
||||
propertyTree.add_container_item("Configuration|Gradient Entities", 0, height_provider_entity.id)
|
||||
checkID = propertyTree.get_container_item("Configuration|Gradient Entities", 0)
|
||||
Report.result(Tests.entity_added, checkID.GetValue() == height_provider_entity.id)
|
||||
|
||||
# 8) Set the PhysX Collider to Sphere mode
|
||||
shape = 0
|
||||
hydra.get_set_test(ball, 1, "Shape Configuration|Shape", shape)
|
||||
setShape = hydra.get_component_property_value(ball.components[1], "Shape Configuration|Shape")
|
||||
Report.result(Tests.shape_set, shape == setShape)
|
||||
|
||||
# 9) Disable and Enable the Terrain Gradient List so that it is recognised
|
||||
editor.EditorComponentAPIBus(bus.Broadcast, 'EnableComponents', [terrain_spawner_entity.components[2]])
|
||||
|
||||
general.enter_game_mode()
|
||||
|
||||
general.idle_wait_frames(1)
|
||||
|
||||
# 10) Enter game mode and test if the ball hits the heightfield within 3 seconds
|
||||
TIMEOUT = 3.0
|
||||
|
||||
class Collider:
|
||||
id = general.find_game_entity("Ball")
|
||||
touched_ground = False
|
||||
|
||||
terrain_id = general.find_game_entity("TestEntity1")
|
||||
|
||||
def on_collision_begin(args):
|
||||
other_id = args[0]
|
||||
if other_id.Equal(terrain_id):
|
||||
Report.info("Touched ground")
|
||||
Collider.touched_ground = True
|
||||
|
||||
handler = azlmbr.physics.CollisionNotificationBusHandler()
|
||||
handler.connect(Collider.id)
|
||||
handler.add_callback("OnCollisionBegin", on_collision_begin)
|
||||
|
||||
helper.wait_for_condition(lambda: Collider.touched_ground, TIMEOUT)
|
||||
Report.result(Tests.test_collision, Collider.touched_ground)
|
||||
|
||||
general.exit_game_mode()
|
||||
|
||||
# 11) Verify there are no errors and warnings in the logs
|
||||
helper.wait_for_condition(lambda: section_tracer.has_errors or section_tracer.has_asserts, 1.0)
|
||||
for error_info in section_tracer.errors:
|
||||
Report.info(f"Error: {error_info.filename} {error_info.function} | {error_info.message}")
|
||||
for assert_info in section_tracer.asserts:
|
||||
Report.info(f"Assert: {assert_info.filename} {assert_info.function} | {assert_info.message}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
from editor_python_test_tools.utils import Report
|
||||
Report.start_test(Terrain_SupportsPhysics)
|
||||
|
||||
@@ -13,13 +13,17 @@ import os
|
||||
import sys
|
||||
|
||||
from ly_test_tools import LAUNCHERS
|
||||
from ly_test_tools.o3de.editor_test import EditorTestSuite, EditorSingleTest
|
||||
from ly_test_tools.o3de.editor_test import EditorTestSuite, EditorSharedTest
|
||||
|
||||
@pytest.mark.SUITE_main
|
||||
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
|
||||
@pytest.mark.parametrize("project", ["AutomatedTesting"])
|
||||
class TestAutomation(EditorTestSuite):
|
||||
#global_extra_cmdline_args=["--regset=/Amazon/Preferences/EnablePrefabSystem=true"]
|
||||
|
||||
class test_AxisAlignedBoxShape_ConfigurationWorks(EditorSingleTest):
|
||||
enable_prefab_system = False
|
||||
|
||||
class test_AxisAlignedBoxShape_ConfigurationWorks(EditorSharedTest):
|
||||
from .EditorScripts import TerrainPhysicsCollider_ChangesSizeWithAxisAlignedBoxShapeChanges as test_module
|
||||
|
||||
class test_Terrain_SupportsPhysics(EditorSharedTest):
|
||||
from .EditorScripts import Terrain_SupportsPhysics as test_module
|
||||
|
||||
@@ -24,12 +24,12 @@ from base import TestAutomationBase
|
||||
class TestAutomation(TestAutomationBase):
|
||||
def test_WhiteBox_AddComponentToEntity(self, request, workspace, editor, launcher_platform):
|
||||
from .tests import WhiteBox_AddComponentToEntity as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_WhiteBox_SetDefaultShape(self, request, workspace, editor, launcher_platform):
|
||||
from .tests import WhiteBox_SetDefaultShape as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_WhiteBox_SetInvisible(self, request, workspace, editor, launcher_platform):
|
||||
from .tests import WhiteBox_SetInvisible as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
+1
-1
@@ -158,7 +158,7 @@ def bundler_batch_setup_fixture(request, workspace, asset_processor, timeout) ->
|
||||
else:
|
||||
cmd.append(f"--{key}")
|
||||
if append_defaults:
|
||||
cmd.append(f"--project-path={os.path.join(workspace.paths.engine_root(), workspace.project)}")
|
||||
cmd.append(f"--project-path={workspace.paths.project()}")
|
||||
return cmd
|
||||
|
||||
# ******
|
||||
|
||||
+55
-222
@@ -88,214 +88,6 @@ class TestsAssetBundlerBatch_WindowsAndMac(object):
|
||||
bundler_batch_helper.call_bundles(help="")
|
||||
bundler_batch_helper.call_bundleSeed(help="")
|
||||
|
||||
@pytest.mark.BAT
|
||||
@pytest.mark.assetpipeline
|
||||
@pytest.mark.test_case_id("C16877175")
|
||||
@pytest.mark.skip("'animations/animationeditorfiles/sample1.animgraph' missing, needs investigation")
|
||||
def test_WindowsAndMac_CreateAssetList_DependenciesCorrect(self, workspace, bundler_batch_helper):
|
||||
r"""
|
||||
Tests that an asset list created maps dependencies correctly.
|
||||
testdependencieslevel\level.pak and lists of known dependencies are used for validation
|
||||
|
||||
Test Steps:
|
||||
1. Create an asset list from the level.pak
|
||||
2. Create Lists of expected assets in the level.pak
|
||||
3. Add lists of expected assets to a single list
|
||||
4. Compare list of expected assets to actual assets
|
||||
"""
|
||||
helper = bundler_batch_helper
|
||||
|
||||
# Create the asset list file
|
||||
helper.call_assetLists(
|
||||
addSeed=r"levels\testdependencieslevel\level.pak",
|
||||
assetListFile=helper['asset_info_file_request']
|
||||
)
|
||||
|
||||
assert os.path.isfile(helper["asset_info_file_result"])
|
||||
|
||||
# Lists of known relative locations of assets
|
||||
default_level_assets = [
|
||||
"engineassets/texturemsg/defaultnouvs.dds",
|
||||
"engineassets/texturemsg/defaultnouvs.dds.1",
|
||||
"engineassets/texturemsg/defaultnouvs.dds.2",
|
||||
"engineassets/texturemsg/defaultnouvs.dds.3",
|
||||
"engineassets/texturemsg/defaultnouvs.dds.4",
|
||||
"engineassets/texturemsg/defaultnouvs.dds.5",
|
||||
"engineassets/texturemsg/defaultnouvs.dds.6",
|
||||
"engineassets/texturemsg/defaultnouvs.dds.7",
|
||||
"engineassets/texturemsg/defaultnouvs_ddn.dds",
|
||||
"engineassets/texturemsg/defaultnouvs_ddn.dds.1",
|
||||
"engineassets/texturemsg/defaultnouvs_ddn.dds.2",
|
||||
"engineassets/texturemsg/defaultnouvs_ddn.dds.3",
|
||||
"engineassets/texturemsg/defaultnouvs_ddn.dds.4",
|
||||
"engineassets/texturemsg/defaultnouvs_ddn.dds.5",
|
||||
"engineassets/texturemsg/defaultnouvs_spec.dds",
|
||||
"engineassets/texturemsg/defaultnouvs_spec.dds.1",
|
||||
"engineassets/texturemsg/defaultnouvs_spec.dds.2",
|
||||
"engineassets/texturemsg/defaultnouvs_spec.dds.3",
|
||||
"engineassets/texturemsg/defaultnouvs_spec.dds.4",
|
||||
"engineassets/texturemsg/defaultnouvs_spec.dds.5",
|
||||
"engineassets/textures/defaults/16_grey.dds",
|
||||
"engineassets/textures/cubemap/default_level_cubemap.dds",
|
||||
"engineassets/textures/cubemap/default_level_cubemap.dds.1",
|
||||
"engineassets/textures/cubemap/default_level_cubemap.dds.2",
|
||||
"engineassets/textures/cubemap/default_level_cubemap.dds.3",
|
||||
"engineassets/textures/cubemap/default_level_cubemap.dds.4",
|
||||
"engineassets/textures/cubemap/default_level_cubemap_diff.dds",
|
||||
"engineassets/materials/water/ocean_default.mtl",
|
||||
"engineassets/textures/defaults/spot_default.dds",
|
||||
"engineassets/textures/defaults/spot_default.dds.1",
|
||||
"engineassets/textures/defaults/spot_default.dds.2",
|
||||
"engineassets/textures/defaults/spot_default.dds.3",
|
||||
"engineassets/textures/defaults/spot_default.dds.4",
|
||||
"engineassets/textures/defaults/spot_default.dds.5",
|
||||
"materials/material_terrain_default.mtl",
|
||||
"textures/skys/night/half_moon.dds",
|
||||
"textures/skys/night/half_moon.dds.1",
|
||||
"textures/skys/night/half_moon.dds.2",
|
||||
"textures/skys/night/half_moon.dds.3",
|
||||
"textures/skys/night/half_moon.dds.4",
|
||||
"textures/skys/night/half_moon.dds.5",
|
||||
"textures/skys/night/half_moon.dds.6",
|
||||
"engineassets/materials/sky/sky.mtl",
|
||||
"levels/testdependencieslevel/level.pak",
|
||||
"levels/testdependencieslevel/terrain/cover.ctc",
|
||||
"levels/testdependencieslevel/terraintexture.pak",
|
||||
]
|
||||
|
||||
sequence_material_cube_assets = [
|
||||
"textures/test_texture_sequence/test_texture_sequence000.dds",
|
||||
"textures/test_texture_sequence/test_texture_sequence001.dds",
|
||||
"textures/test_texture_sequence/test_texture_sequence002.dds",
|
||||
"textures/test_texture_sequence/test_texture_sequence003.dds",
|
||||
"textures/test_texture_sequence/test_texture_sequence004.dds",
|
||||
"textures/test_texture_sequence/test_texture_sequence005.dds",
|
||||
"objects/_primitives/_box_1x1.cgf",
|
||||
"materials/test_texture_sequence.mtl",
|
||||
"objects/_primitives/_box_1x1.mtl",
|
||||
"textures/_primitives/middle_gray_checker.dds",
|
||||
"textures/_primitives/middle_gray_checker.dds.1",
|
||||
"textures/_primitives/middle_gray_checker.dds.2",
|
||||
"textures/_primitives/middle_gray_checker.dds.3",
|
||||
"textures/_primitives/middle_gray_checker.dds.4",
|
||||
"textures/_primitives/middle_gray_checker.dds.5",
|
||||
"textures/_primitives/middle_gray_checker_ddn.dds",
|
||||
"textures/_primitives/middle_gray_checker_ddn.dds.1",
|
||||
"textures/_primitives/middle_gray_checker_ddn.dds.2",
|
||||
"textures/_primitives/middle_gray_checker_ddn.dds.3",
|
||||
"textures/_primitives/middle_gray_checker_ddn.dds.4",
|
||||
"textures/_primitives/middle_gray_checker_ddn.dds.5",
|
||||
"textures/_primitives/middle_gray_checker_spec.dds",
|
||||
"textures/_primitives/middle_gray_checker_spec.dds.1",
|
||||
"textures/_primitives/middle_gray_checker_spec.dds.2",
|
||||
"textures/_primitives/middle_gray_checker_spec.dds.3",
|
||||
"textures/_primitives/middle_gray_checker_spec.dds.4",
|
||||
"textures/_primitives/middle_gray_checker_spec.dds.5",
|
||||
]
|
||||
|
||||
character_with_simplified_material_assets = [
|
||||
"objects/characters/jack/jack.actor",
|
||||
"objects/characters/jack/jack.mtl",
|
||||
"objects/characters/jack/textures/jack_diff.dds",
|
||||
"objects/characters/jack/textures/jack_diff.dds.1",
|
||||
"objects/characters/jack/textures/jack_diff.dds.2",
|
||||
"objects/characters/jack/textures/jack_diff.dds.3",
|
||||
"objects/characters/jack/textures/jack_diff.dds.4",
|
||||
"objects/characters/jack/textures/jack_diff.dds.5",
|
||||
"objects/characters/jack/textures/jack_diff.dds.6",
|
||||
"objects/characters/jack/textures/jack_diff.dds.7",
|
||||
"objects/characters/jack/textures/jack_spec.dds",
|
||||
"objects/characters/jack/textures/jack_spec.dds.1",
|
||||
"objects/characters/jack/textures/jack_spec.dds.2",
|
||||
"objects/characters/jack/textures/jack_spec.dds.3",
|
||||
"objects/characters/jack/textures/jack_spec.dds.4",
|
||||
"objects/characters/jack/textures/jack_spec.dds.5",
|
||||
"objects/characters/jack/textures/jack_spec.dds.6",
|
||||
"objects/characters/jack/textures/jack_spec.dds.7",
|
||||
"objects/default/editorprimitive.mtl",
|
||||
"engineassets/textures/grey.dds",
|
||||
"animations/animationeditorfiles/sample0.animgraph",
|
||||
"animations/motions/jack_death_fall_back_zup.motion",
|
||||
"animations/animationeditorfiles/sample1.animgraph",
|
||||
"animations/animationeditorfiles/sample0.motionset",
|
||||
"animations/motions/rin_jump.motion",
|
||||
"animations/animationeditorfiles/sample1.motionset",
|
||||
"animations/motions/rin_idle.motion",
|
||||
"animations/motions/jack_idle_aim_zup.motion",
|
||||
]
|
||||
|
||||
spawner_assets = [
|
||||
"slices/sphere.dynamicslice",
|
||||
"objects/default/primitive_sphere.cgf",
|
||||
"test1.luac",
|
||||
"test2.luac",
|
||||
]
|
||||
|
||||
ui_canvas_assets = [
|
||||
"fonts/vera.ttf",
|
||||
"fonts/vera.font",
|
||||
"scriptcanvas/mainmenu.scriptcanvas_compiled",
|
||||
"fonts/vera.fontfamily",
|
||||
"ui/canvas/start.uicanvas",
|
||||
"fonts/vera-italic.font",
|
||||
"ui/textureatlas/sample.texatlasidx",
|
||||
"fonts/vera-bold-italic.ttf",
|
||||
"fonts/vera-bold.font",
|
||||
"ui/textures/prefab/button_normal.dds",
|
||||
"ui/textures/prefab/button_normal.sprite",
|
||||
"fonts/vera-italic.ttf",
|
||||
"ui/textureatlas/sample.dds",
|
||||
"fonts/vera-bold-italic.font",
|
||||
"fonts/vera-bold.ttf",
|
||||
"ui/textures/prefab/button_disabled.dds",
|
||||
"ui/textures/prefab/button_disabled.sprite",
|
||||
]
|
||||
|
||||
wwise_and_atl_assets = [
|
||||
"libs/gameaudio/wwise/levels/testdependencieslevel/test_dependencies_level.xml",
|
||||
"sounds/wwise/test_bank3.bnk",
|
||||
"sounds/wwise/test_bank4.bnk",
|
||||
"sounds/wwise/test_bank5.bnk",
|
||||
"sounds/wwise/test_bank1.bnk",
|
||||
"sounds/wwise/init.bnk",
|
||||
"sounds/wwise/499820003.wem",
|
||||
"sounds/wwise/196049145.wem",
|
||||
]
|
||||
|
||||
particle_library_assets = [
|
||||
"libs/particles/milestone2particles.xml",
|
||||
"textures/milestone2/particles/fx_launchermuzzlering_01.dds",
|
||||
"textures/milestone2/particles/fx_launchermuzzlering_01.dds.1",
|
||||
"textures/milestone2/particles/fx_launchermuzzlering_01.dds.2",
|
||||
"textures/milestone2/particles/fx_launchermuzzlering_01.dds.3",
|
||||
"textures/milestone2/particles/fx_launchermuzzlering_01.dds.4",
|
||||
"textures/milestone2/particles/fx_launchermuzzlering_01.dds.5",
|
||||
"textures/milestone2/particles/fx_sparkstreak_01.dds",
|
||||
"textures/milestone2/particles/fx_launchermuzzlefront_01.dds",
|
||||
"textures/milestone2/particles/fx_launchermuzzlefront_01.dds.1",
|
||||
"textures/milestone2/particles/fx_launchermuzzlefront_01.dds.2",
|
||||
"textures/milestone2/particles/fx_launchermuzzlefront_01.dds.3",
|
||||
"textures/milestone2/particles/fx_launchermuzzlefront_01.dds.4",
|
||||
"textures/milestone2/particles/fx_launchermuzzlefront_01.dds.5",
|
||||
]
|
||||
|
||||
lens_flares_library_assets = ["libs/flares/flares.xml", "textures/lights/flare01.dds"]
|
||||
|
||||
expected_assets_list = default_level_assets
|
||||
expected_assets_list.extend(sequence_material_cube_assets)
|
||||
expected_assets_list.extend(character_with_simplified_material_assets)
|
||||
expected_assets_list.extend(spawner_assets)
|
||||
expected_assets_list.extend(ui_canvas_assets)
|
||||
expected_assets_list.extend(wwise_and_atl_assets)
|
||||
expected_assets_list.extend(particle_library_assets)
|
||||
expected_assets_list.extend(lens_flares_library_assets) # All expected assets
|
||||
|
||||
# Get actual calculated dependencies from the asset list created
|
||||
actual_assets_list = []
|
||||
for rel_path in helper.get_asset_relative_paths(helper["asset_info_file_result"]):
|
||||
actual_assets_list.append(rel_path)
|
||||
|
||||
assert sorted(actual_assets_list) == sorted(expected_assets_list)
|
||||
|
||||
@pytest.mark.BAT
|
||||
@pytest.mark.assetpipeline
|
||||
@@ -310,9 +102,9 @@ class TestsAssetBundlerBatch_WindowsAndMac(object):
|
||||
3. Read and store contents of asset list into memory
|
||||
4. Attempt to create a new asset list in without using --allowOverwrites
|
||||
5. Verify that Asset Bundler returns false
|
||||
6. Verify that file contents of the orignally created asset list did not change from what was stored in memory
|
||||
6. Verify that file contents of the originally created asset list did not change from what was stored in memory
|
||||
7. Attempt to create a new asset list without debug while allowing overwrites
|
||||
8. Verify that file contents of the orignally created asset list changed from what was stored in memory
|
||||
8. Verify that file contents of the originally created asset list changed from what was stored in memory
|
||||
"""
|
||||
helper = bundler_batch_helper
|
||||
seed_list = os.path.join(workspace.paths.engine_root(), "Assets", "Engine", "SeedAssetList.seed") # Engine seed list
|
||||
@@ -919,7 +711,7 @@ class TestsAssetBundlerBatch_WindowsAndMac(object):
|
||||
# Extra arguments for pattern comparison
|
||||
cmd.extend([f"--filePatternType={pattern_type}", f"--filePattern={pattern}"])
|
||||
if workspace.project:
|
||||
cmd.append(f'--project-path={project_name}')
|
||||
cmd.append(f'--project-path={workspace.paths.project()}')
|
||||
return cmd
|
||||
# End generate_compare_command()
|
||||
|
||||
@@ -960,7 +752,7 @@ class TestsAssetBundlerBatch_WindowsAndMac(object):
|
||||
output_mac_asset_list = helper.platform_file_name(last_output_arg, platform)
|
||||
|
||||
# Build execution command
|
||||
cmd = generate_compare_command(platform_arg, workspace.project)
|
||||
cmd = generate_compare_command(platform_arg, workspace.paths.project())
|
||||
|
||||
# Execute command
|
||||
subprocess.check_call(cmd)
|
||||
@@ -995,7 +787,7 @@ class TestsAssetBundlerBatch_WindowsAndMac(object):
|
||||
f"--comparisonRulesFile={rule_file}",
|
||||
f"--comparisonType={args[1]}",
|
||||
r"--addComparison",
|
||||
f"--project-path={workspace.project}",
|
||||
f"--project-path={workspace.paths.project()}",
|
||||
]
|
||||
if args[1] == "4":
|
||||
# If pattern comparison, append a few extra arguments
|
||||
@@ -1117,7 +909,7 @@ class TestsAssetBundlerBatch_WindowsAndMac(object):
|
||||
"--addDefaultSeedListFiles",
|
||||
"--platform=pc",
|
||||
"--print",
|
||||
f"--project-path={workspace.project}"
|
||||
f"--project-path={workspace.paths.project()}"
|
||||
],
|
||||
universal_newlines=True,
|
||||
)
|
||||
@@ -1189,7 +981,7 @@ class TestsAssetBundlerBatch_WindowsAndMac(object):
|
||||
# Make sure file gets deleted on teardown
|
||||
request.addfinalizer(lambda: fs.delete([bundle_result_path], True, False))
|
||||
|
||||
bundles_folder = os.path.join(workspace.paths.engine_root(), workspace.project, "Bundles")
|
||||
bundles_folder = os.path.join(workspace.paths.project(), "Bundles")
|
||||
level_pak = r"levels\testdependencieslevel\level.pak"
|
||||
bundle_request_path = os.path.join(bundles_folder, "bundle.pak")
|
||||
bundle_result_path = os.path.join(bundles_folder,
|
||||
@@ -1243,23 +1035,64 @@ class TestsAssetBundlerBatch_WindowsAndMac(object):
|
||||
2. Verify file was created
|
||||
3. Verify that only the expected assets are present in the created asset list
|
||||
"""
|
||||
expected_assets = [
|
||||
expected_assets = sorted([
|
||||
"ui/canvases/lyshineexamples/animation/multiplesequences.uicanvas",
|
||||
"ui/textures/prefab/button_normal.sprite"
|
||||
]
|
||||
"ui/textures/prefab/button_disabled.tif.streamingimage",
|
||||
"ui/textures/prefab/tooltip_sliced.tif.streamingimage",
|
||||
"ui/textures/prefab/button_normal.tif.streamingimage"
|
||||
])
|
||||
# Printing these lists out can save a step in debugging if this test fails on Jenkins.
|
||||
logger.info(f"expected_assets: {expected_assets}")
|
||||
|
||||
skip_assets = sorted([
|
||||
"ui/scripts/lyshineexamples/animation/multiplesequences.luac",
|
||||
"ui/scripts/lyshineexamples/unloadthiscanvasbutton.luac",
|
||||
"fonts/vera.fontfamily",
|
||||
"fonts/vera-italic.font",
|
||||
"fonts/vera.font",
|
||||
"fonts/vera-bold.font",
|
||||
"fonts/vera-bold-italic.font",
|
||||
"fonts/vera-italic.ttf",
|
||||
"fonts/vera.ttf",
|
||||
"fonts/vera-bold.ttf",
|
||||
"fonts/vera-bold-italic.ttf"
|
||||
])
|
||||
logger.info(f"skip_assets: {skip_assets}")
|
||||
|
||||
expected_and_skip_assets = sorted(expected_assets + skip_assets)
|
||||
# Printing both together to make it quick to compare the results in the logs for a test failure on Jenkins
|
||||
logger.info(f"expected_and_skip_assets: {expected_and_skip_assets}")
|
||||
|
||||
# First, generate an asset info file without skipping, to get a list that can be used as a baseline to verify
|
||||
# the files were actually skipped, and not just missing.
|
||||
bundler_batch_helper.call_assetLists(
|
||||
assetListFile=bundler_batch_helper['asset_info_file_request'],
|
||||
addSeed="ui/canvases/lyshineexamples/animation/multiplesequences.uicanvas"
|
||||
)
|
||||
assert os.path.isfile(bundler_batch_helper["asset_info_file_result"])
|
||||
assets_in_no_skip_list = []
|
||||
for rel_path in bundler_batch_helper.get_asset_relative_paths(bundler_batch_helper["asset_info_file_result"]):
|
||||
assets_in_no_skip_list.append(rel_path)
|
||||
assets_in_no_skip_list = sorted(assets_in_no_skip_list)
|
||||
logger.info(f"assets_in_no_skip_list: {assets_in_no_skip_list}")
|
||||
assert assets_in_no_skip_list == expected_and_skip_assets
|
||||
|
||||
# Now generate an asset info file using the skip command, and verify the skip files are not in the list.
|
||||
bundler_batch_helper.call_assetLists(
|
||||
assetListFile=bundler_batch_helper['asset_info_file_request'],
|
||||
addSeed="ui/canvases/lyshineexamples/animation/multiplesequences.uicanvas",
|
||||
skip="ui/textures/prefab/button_disabled.sprite,ui/scripts/lyshineexamples/animation/multiplesequences.luac,"
|
||||
"ui/textures/prefab/tooltip_sliced.sprite,ui/scripts/lyshineexamples/unloadthiscanvasbutton.luac,fonts/vera.fontfamily,fonts/vera-italic.font,"
|
||||
"fonts/vera.font,fonts/vera-bold.font,fonts/vera-bold-italic.font,fonts/vera-italic.ttf,fonts/vera.ttf,fonts/vera-bold.ttf,fonts/vera-bold-italic.ttf"
|
||||
allowOverwrites="",
|
||||
skip=','.join(skip_assets)
|
||||
)
|
||||
|
||||
assert os.path.isfile(bundler_batch_helper["asset_info_file_result"])
|
||||
assets_in_list = []
|
||||
for rel_path in bundler_batch_helper.get_asset_relative_paths(bundler_batch_helper["asset_info_file_result"]):
|
||||
assets_in_list.append(rel_path)
|
||||
assets_in_list = sorted(assets_in_list)
|
||||
logger.info(f"assets_in_list: {assets_in_list}")
|
||||
assert assets_in_list == expected_assets
|
||||
|
||||
assert sorted(assets_in_list) == sorted(expected_assets)
|
||||
|
||||
@pytest.mark.BAT
|
||||
@pytest.mark.assetpipeline
|
||||
|
||||
@@ -52,7 +52,7 @@ class TestAutomationBase:
|
||||
cls._kill_ly_processes()
|
||||
|
||||
def _run_test(self, request, workspace, editor, testcase_module, extra_cmdline_args=[], batch_mode=True,
|
||||
autotest_mode=True, use_null_renderer=True):
|
||||
autotest_mode=True, use_null_renderer=True, enable_prefab_system=True):
|
||||
test_starttime = time.time()
|
||||
self.logger = logging.getLogger(__name__)
|
||||
errors = []
|
||||
@@ -97,6 +97,11 @@ class TestAutomationBase:
|
||||
pycmd += ["-BatchMode"]
|
||||
if autotest_mode:
|
||||
pycmd += ["-autotest_mode"]
|
||||
if enable_prefab_system:
|
||||
pycmd += ["--regset=/Amazon/Preferences/EnablePrefabSystem=true"]
|
||||
else:
|
||||
pycmd += ["--regset=/Amazon/Preferences/EnablePrefabSystem=false"]
|
||||
|
||||
pycmd += extra_cmdline_args
|
||||
editor.args.extend(pycmd) # args are added to the WinLauncher start command
|
||||
editor.start(backupFiles = False, launch_ap = False)
|
||||
|
||||
+12
-7
@@ -62,7 +62,7 @@ def AssetBrowser_SearchFiltering():
|
||||
from editor_python_test_tools.utils import Report
|
||||
from editor_python_test_tools.utils import TestHelper as helper
|
||||
|
||||
def verify_files_appeared(model, allowed_asset_extentions, parent_index=QtCore.QModelIndex()):
|
||||
def verify_files_appeared(model, allowed_asset_extensions, parent_index=QtCore.QModelIndex()):
|
||||
indexes = [parent_index]
|
||||
while len(indexes) > 0:
|
||||
parent_index = indexes.pop(0)
|
||||
@@ -71,7 +71,7 @@ def AssetBrowser_SearchFiltering():
|
||||
cur_data = cur_index.data(Qt.DisplayRole)
|
||||
if (
|
||||
"." in cur_data
|
||||
and (cur_data.lower().split(".")[-1] not in allowed_asset_extentions)
|
||||
and (cur_data.lower().split(".")[-1] not in allowed_asset_extensions)
|
||||
and not cur_data[-1] == ")"
|
||||
):
|
||||
Report.info(f"Incorrect file found: {cur_data}")
|
||||
@@ -94,16 +94,21 @@ def AssetBrowser_SearchFiltering():
|
||||
Report.info("Asset Browser is already open")
|
||||
editor_window = pyside_utils.get_editor_main_window()
|
||||
app = QtWidgets.QApplication.instance()
|
||||
|
||||
# 3) Type the name of an asset in the search bar and make sure only one asset is filtered in Asset browser
|
||||
|
||||
# 3) Type the name of an asset in the search bar and make sure it is filtered to and selectable
|
||||
asset_browser = editor_window.findChild(QtWidgets.QDockWidget, "Asset Browser")
|
||||
search_bar = asset_browser.findChild(QtWidgets.QLineEdit, "textSearch")
|
||||
search_bar.setText("cedar.fbx")
|
||||
asset_browser_tree = asset_browser.findChild(QtWidgets.QTreeView, "m_assetBrowserTreeViewWidget")
|
||||
model_index = pyside_utils.find_child_by_pattern(asset_browser_tree, "cedar.fbx")
|
||||
pyside_utils.item_view_index_mouse_click(asset_browser_tree, model_index)
|
||||
asset_browser_table = asset_browser.findChild(QtWidgets.QTreeView, "m_assetBrowserTableViewWidget")
|
||||
found = await pyside_utils.wait_for_condition(lambda: pyside_utils.find_child_by_pattern(asset_browser_table, "cedar.fbx"), 5.0)
|
||||
if found:
|
||||
model_index = pyside_utils.find_child_by_pattern(asset_browser_table, "cedar.fbx")
|
||||
else:
|
||||
Report.result(Tests.asset_filtered, found)
|
||||
pyside_utils.item_view_index_mouse_click(asset_browser_table, model_index)
|
||||
is_filtered = await pyside_utils.wait_for_condition(
|
||||
lambda: asset_browser_tree.indexBelow(asset_browser_tree.currentIndex()) == QtCore.QModelIndex(), 5.0)
|
||||
lambda: asset_browser_table.currentIndex() == model_index, 5.0)
|
||||
Report.result(Tests.asset_filtered, is_filtered)
|
||||
|
||||
# 4) Click the "X" in the search bar.
|
||||
|
||||
+2
-2
@@ -84,8 +84,8 @@ def AssetBrowser_TreeNavigation():
|
||||
|
||||
# 3) Collapse all files initially
|
||||
main_window = editor_window.findChild(QtWidgets.QMainWindow)
|
||||
asset_browser = pyside_utils.find_child_by_hierarchy(main_window, ..., "Asset Browser")
|
||||
tree = pyside_utils.find_child_by_hierarchy(asset_browser, ..., "m_assetBrowserTreeViewWidget")
|
||||
asset_browser = pyside_utils.find_child_by_pattern(main_window, text="Asset Browser", type=QtWidgets.QDockWidget)
|
||||
tree = pyside_utils.find_child_by_pattern(asset_browser, "m_assetBrowserTreeViewWidget")
|
||||
scroll_area = tree.findChild(QtWidgets.QWidget, "qt_scrollarea_vcontainer")
|
||||
scroll_bar = scroll_area.findChild(QtWidgets.QScrollBar)
|
||||
tree.collapseAll()
|
||||
|
||||
@@ -33,14 +33,14 @@ class TestAutomation(TestAutomationBase):
|
||||
def test_BasicEditorWorkflows_LevelEntityComponentCRUD(self, request, workspace, editor, launcher_platform,
|
||||
remove_test_level):
|
||||
from .EditorScripts import BasicEditorWorkflows_LevelEntityComponentCRUD as test_module
|
||||
self._run_test(request, workspace, editor, test_module, batch_mode=False, autotest_mode=False)
|
||||
self._run_test(request, workspace, editor, test_module, batch_mode=False, autotest_mode=False, enable_prefab_system=False)
|
||||
|
||||
@pytest.mark.REQUIRES_gpu
|
||||
def test_BasicEditorWorkflows_GPU_LevelEntityComponentCRUD(self, request, workspace, editor, launcher_platform,
|
||||
remove_test_level):
|
||||
from .EditorScripts import BasicEditorWorkflows_LevelEntityComponentCRUD as test_module
|
||||
self._run_test(request, workspace, editor, test_module, batch_mode=False, autotest_mode=False,
|
||||
use_null_renderer=False)
|
||||
use_null_renderer=False, enable_prefab_system=False)
|
||||
|
||||
def test_EntityOutlienr_EntityOrdering(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import EntityOutliner_EntityOrdering as test_module
|
||||
@@ -51,5 +51,4 @@ class TestAutomation(TestAutomationBase):
|
||||
test_module,
|
||||
batch_mode=False,
|
||||
autotest_mode=True,
|
||||
extra_cmdline_args=["--regset=/Amazon/Preferences/EnablePrefabSystem=true"]
|
||||
)
|
||||
|
||||
@@ -21,6 +21,8 @@ class TestAutomationNoAutoTestMode(EditorTestSuite):
|
||||
# Disable -autotest_mode and -BatchMode. Tests cannot run in -BatchMode due to UI interactions, and these tests
|
||||
# interact with modal dialogs
|
||||
global_extra_cmdline_args = []
|
||||
|
||||
enable_prefab_system = False
|
||||
|
||||
class test_BasicEditorWorkflows_LevelEntityComponentCRUD(EditorSingleTest):
|
||||
# Custom teardown to remove slice asset created during test
|
||||
@@ -43,7 +45,6 @@ class TestAutomationNoAutoTestMode(EditorTestSuite):
|
||||
class test_InputBindings_Add_Remove_Input_Events(EditorSharedTest):
|
||||
from .EditorScripts import InputBindings_Add_Remove_Input_Events as test_module
|
||||
|
||||
@pytest.mark.skip(reason="Crashes Editor: ATOM-15493")
|
||||
class test_AssetPicker_UI_UX(EditorSharedTest):
|
||||
from .EditorScripts import AssetPicker_UI_UX as test_module
|
||||
|
||||
@@ -57,10 +58,11 @@ class TestAutomationAutoTestMode(EditorTestSuite):
|
||||
# Enable only -autotest_mode for these tests. Tests cannot run in -BatchMode due to UI interactions
|
||||
global_extra_cmdline_args = ["-autotest_mode"]
|
||||
|
||||
enable_prefab_system = False
|
||||
|
||||
class test_AssetBrowser_TreeNavigation(EditorSharedTest):
|
||||
from .EditorScripts import AssetBrowser_TreeNavigation as test_module
|
||||
|
||||
@pytest.mark.skip(reason="Crashes Editor: ATOM-15493")
|
||||
class test_AssetBrowser_SearchFiltering(EditorSharedTest):
|
||||
from .EditorScripts import AssetBrowser_SearchFiltering as test_module
|
||||
|
||||
@@ -74,6 +76,5 @@ class TestAutomationAutoTestMode(EditorTestSuite):
|
||||
class test_Menus_FileMenuOptions_Work(EditorSharedTest):
|
||||
from .EditorScripts import Menus_FileMenuOptions as test_module
|
||||
|
||||
|
||||
class test_BasicEditorWorkflows_ExistingLevel_EntityComponentCRUD(EditorSharedTest):
|
||||
from .EditorScripts import BasicEditorWorkflows_ExistingLevel_EntityComponentCRUD as test_module
|
||||
|
||||
@@ -32,31 +32,29 @@ class TestAutomation(TestAutomationBase):
|
||||
|
||||
def test_AssetBrowser_TreeNavigation(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import AssetBrowser_TreeNavigation as test_module
|
||||
self._run_test(request, workspace, editor, test_module, batch_mode=False)
|
||||
self._run_test(request, workspace, editor, test_module, batch_mode=False, enable_prefab_system=False)
|
||||
|
||||
@pytest.mark.skip(reason="Crashes Editor: ATOM-15493")
|
||||
def test_AssetBrowser_SearchFiltering(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import AssetBrowser_SearchFiltering as test_module
|
||||
self._run_test(request, workspace, editor, test_module, batch_mode=False)
|
||||
self._run_test(request, workspace, editor, test_module, batch_mode=False, enable_prefab_system=False)
|
||||
|
||||
@pytest.mark.skip(reason="Crashes Editor: ATOM-15493")
|
||||
def test_AssetPicker_UI_UX(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import AssetPicker_UI_UX as test_module
|
||||
self._run_test(request, workspace, editor, test_module, autotest_mode=False, batch_mode=False)
|
||||
self._run_test(request, workspace, editor, test_module, autotest_mode=False, batch_mode=False, enable_prefab_system=False)
|
||||
|
||||
def test_ComponentCRUD_Add_Delete_Components(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import ComponentCRUD_Add_Delete_Components as test_module
|
||||
self._run_test(request, workspace, editor, test_module, batch_mode=False)
|
||||
self._run_test(request, workspace, editor, test_module, batch_mode=False, enable_prefab_system=False)
|
||||
|
||||
def test_InputBindings_Add_Remove_Input_Events(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import InputBindings_Add_Remove_Input_Events as test_module
|
||||
self._run_test(request, workspace, editor, test_module, batch_mode=False, autotest_mode=False)
|
||||
self._run_test(request, workspace, editor, test_module, batch_mode=False, autotest_mode=False, enable_prefab_system=False)
|
||||
|
||||
def test_Menus_ViewMenuOptions_Work(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import Menus_ViewMenuOptions as test_module
|
||||
self._run_test(request, workspace, editor, test_module, batch_mode=False)
|
||||
self._run_test(request, workspace, editor, test_module, batch_mode=False, enable_prefab_system=False)
|
||||
|
||||
@pytest.mark.skip(reason="Times out due to dialogs failing to dismiss: LYN-4208")
|
||||
def test_Menus_FileMenuOptions_Work(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import Menus_FileMenuOptions as test_module
|
||||
self._run_test(request, workspace, editor, test_module, batch_mode=False)
|
||||
self._run_test(request, workspace, editor, test_module, batch_mode=False, enable_prefab_system=False)
|
||||
|
||||
@@ -20,8 +20,8 @@ class TestAutomation(TestAutomationBase):
|
||||
|
||||
def test_Menus_EditMenuOptions_Work(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import Menus_EditMenuOptions as test_module
|
||||
self._run_test(request, workspace, editor, test_module, batch_mode=False)
|
||||
self._run_test(request, workspace, editor, test_module, batch_mode=False, enable_prefab_system=False)
|
||||
|
||||
def test_Docking_BasicDockedTools(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import Docking_BasicDockedTools as test_module
|
||||
self._run_test(request, workspace, editor, test_module, batch_mode=False)
|
||||
self._run_test(request, workspace, editor, test_module, batch_mode=False, enable_prefab_system=False)
|
||||
|
||||
@@ -19,6 +19,8 @@ class TestAutomationAutoTestMode(EditorTestSuite):
|
||||
# Enable only -autotest_mode for these tests. Tests cannot run in -BatchMode due to UI interactions
|
||||
global_extra_cmdline_args = ["-autotest_mode"]
|
||||
|
||||
enable_prefab_system = False
|
||||
|
||||
class test_Docking_BasicDockedTools(EditorSharedTest):
|
||||
from .EditorScripts import Docking_BasicDockedTools as test_module
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@ class TestAutomation(TestAutomationBase):
|
||||
|
||||
def test_DynamicSliceInstanceSpawner_DynamicSliceSpawnerWorks(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import DynamicSliceInstanceSpawner_DynamicSliceSpawnerWorks as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_EmptyInstanceSpawner_EmptySpawnerWorks(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import EmptyInstanceSpawner_EmptySpawnerWorks as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@@ -18,6 +18,8 @@ from ly_test_tools.o3de.editor_test import EditorSingleTest, EditorSharedTest, E
|
||||
@pytest.mark.parametrize("project", ["AutomatedTesting"])
|
||||
class TestAutomation(EditorTestSuite):
|
||||
|
||||
enable_prefab_system = False
|
||||
|
||||
class test_DynamicSliceInstanceSpawner_DynamicSliceSpawnerWorks(EditorParallelTest):
|
||||
from .EditorScripts import DynamicSliceInstanceSpawner_DynamicSliceSpawnerWorks as test_module
|
||||
|
||||
|
||||
@@ -52,158 +52,158 @@ class TestAutomation(TestAutomationBase):
|
||||
|
||||
def test_AltitudeFilter_ComponentAndOverrides_InstancesPlantAtSpecifiedAltitude(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import AltitudeFilter_ComponentAndOverrides_InstancesPlantAtSpecifiedAltitude as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_AltitudeFilter_ShapeSample_InstancesPlantAtSpecifiedAltitude(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import AltitudeFilter_ShapeSample_InstancesPlantAtSpecifiedAltitude as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_AltitudeFilter_FilterStageToggle(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import AltitudeFilter_FilterStageToggle as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_SpawnerSlices_SliceCreationAndVisibilityToggleWorks(self, request, workspace, editor, remove_test_slice, launcher_platform):
|
||||
from .EditorScripts import SpawnerSlices_SliceCreationAndVisibilityToggleWorks as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_AssetListCombiner_CombinedDescriptorsExpressInConfiguredArea(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import AssetListCombiner_CombinedDescriptorsExpressInConfiguredArea as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_AssetWeightSelector_InstancesExpressBasedOnWeight(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import AssetWeightSelector_InstancesExpressBasedOnWeight as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@pytest.mark.xfail(reason="https://github.com/o3de/o3de/issues/4155")
|
||||
def test_DistanceBetweenFilter_InstancesPlantAtSpecifiedRadius(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import DistanceBetweenFilter_InstancesPlantAtSpecifiedRadius as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@pytest.mark.xfail(reason="https://github.com/o3de/o3de/issues/4155")
|
||||
def test_DistanceBetweenFilterOverrides_InstancesPlantAtSpecifiedRadius(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import DistanceBetweenFilterOverrides_InstancesPlantAtSpecifiedRadius as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_SurfaceDataRefreshes_RemainsStable(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import SurfaceDataRefreshes_RemainsStable as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_VegetationInstances_DespawnWhenOutOfRange(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import VegetationInstances_DespawnWhenOutOfRange as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_InstanceSpawnerPriority_LayerAndSubPriority_HigherValuesPlantOverLower(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import InstanceSpawnerPriority_LayerAndSubPriority as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_LayerBlocker_InstancesBlockedInConfiguredArea(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import LayerBlocker_InstancesBlockedInConfiguredArea as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_LayerSpawner_InheritBehaviorFlag(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import LayerSpawner_InheritBehaviorFlag as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_LayerSpawner_InstancesPlantInAllSupportedShapes(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import LayerSpawner_InstancesPlantInAllSupportedShapes as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_LayerSpawner_FilterStageToggle(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import LayerSpawner_FilterStageToggle as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@pytest.mark.xfail(reason="https://github.com/o3de/o3de/issues/2038")
|
||||
def test_LayerSpawner_InstancesRefreshUsingCorrectViewportCamera(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import LayerSpawner_InstancesRefreshUsingCorrectViewportCamera as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_MeshBlocker_InstancesBlockedByMesh(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import MeshBlocker_InstancesBlockedByMesh as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_MeshBlocker_InstancesBlockedByMeshHeightTuning(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import MeshBlocker_InstancesBlockedByMeshHeightTuning as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_MeshSurfaceTagEmitter_DependentOnMeshComponent(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import MeshSurfaceTagEmitter_DependentOnMeshComponent as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_MeshSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import MeshSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_PhysXColliderSurfaceTagEmitter_E2E_Editor(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import PhysXColliderSurfaceTagEmitter_E2E_Editor as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_PositionModifier_ComponentAndOverrides_InstancesPlantAtSpecifiedOffsets(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import PositionModifier_ComponentAndOverrides_InstancesPlantAtSpecifiedOffsets as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_PositionModifier_AutoSnapToSurfaceWorks(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import PositionModifier_AutoSnapToSurfaceWorks as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_RotationModifier_InstancesRotateWithinRange(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import RotationModifier_InstancesRotateWithinRange as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_RotationModifierOverrides_InstancesRotateWithinRange(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import RotationModifierOverrides_InstancesRotateWithinRange as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_ScaleModifier_InstancesProperlyScale(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import ScaleModifier_InstancesProperlyScale as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_ScaleModifierOverrides_InstancesProperlyScale(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import ScaleModifierOverrides_InstancesProperlyScale as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_ShapeIntersectionFilter_InstancesPlantInAssignedShape(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import ShapeIntersectionFilter_InstancesPlantInAssignedShape as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_ShapeIntersectionFilter_FilterStageToggle(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import ShapeIntersectionFilter_FilterStageToggle as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_SlopeAlignmentModifier_InstanceSurfaceAlignment(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import SlopeAlignmentModifier_InstanceSurfaceAlignment as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_SlopeAlignmentModifierOverrides_InstanceSurfaceAlignment(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import SlopeAlignmentModifierOverrides_InstanceSurfaceAlignment as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_SurfaceMaskFilter_BasicSurfaceTagCreation(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import SurfaceMaskFilter_BasicSurfaceTagCreation as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_SurfaceMaskFilter_ExclusiveSurfaceTags_Function(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import SurfaceMaskFilter_ExclusionList as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_SurfaceMaskFilter_InclusiveSurfaceTags_Function(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import SurfaceMaskFilter_InclusionList as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_SurfaceMaskFilterOverrides_MultipleDescriptorOverridesPlantAsExpected(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import SurfaceMaskFilterOverrides_MultipleDescriptorOverridesPlantAsExpected as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_SystemSettings_SectorPointDensity(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import SystemSettings_SectorPointDensity as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_SystemSettings_SectorSize(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import SystemSettings_SectorSize as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_SlopeFilter_ComponentAndOverrides_InstancesPlantOnValidSlopes(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import SlopeFilter_ComponentAndOverrides_InstancesPlantOnValidSlope as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
|
||||
@pytest.mark.SUITE_periodic
|
||||
@@ -219,7 +219,7 @@ class TestAutomationE2E(TestAutomationBase):
|
||||
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
|
||||
|
||||
from .EditorScripts import DynamicSliceInstanceSpawner_Embedded_E2E as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@pytest.mark.parametrize("launcher_platform", ['windows'])
|
||||
def test_DynamicSliceInstanceSpawner_Embedded_E2E_Launcher(self, workspace, launcher, level,
|
||||
@@ -240,7 +240,7 @@ class TestAutomationE2E(TestAutomationBase):
|
||||
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
|
||||
|
||||
from .EditorScripts import DynamicSliceInstanceSpawner_External_E2E as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@pytest.mark.parametrize("launcher_platform", ['windows'])
|
||||
def test_DynamicSliceInstanceSpawner_External_E2E_Launcher(self, workspace, launcher, level,
|
||||
@@ -261,7 +261,7 @@ class TestAutomationE2E(TestAutomationBase):
|
||||
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
|
||||
|
||||
from .EditorScripts import LayerBlender_E2E_Editor as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@pytest.mark.parametrize("launcher_platform", ['windows'])
|
||||
@pytest.mark.xfail(reason="https://github.com/o3de/o3de/issues/4170")
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ from ly_test_tools.o3de.editor_test import EditorSingleTest, EditorSharedTest, E
|
||||
@pytest.mark.parametrize("project", ["AutomatedTesting"])
|
||||
class TestAutomation(EditorTestSuite):
|
||||
|
||||
global_extra_cmdline_args = ["-BatchMode", "-autotest_mode", "--regset=/Amazon/Preferences/EnablePrefabSystem=true"]
|
||||
global_extra_cmdline_args = ["-BatchMode", "-autotest_mode"]
|
||||
|
||||
class test_DynVegUtils_TempPrefabCreationWorks(EditorSharedTest):
|
||||
from .EditorScripts import DynVegUtils_TempPrefabCreationWorks as test_module
|
||||
|
||||
+13
-13
@@ -20,52 +20,52 @@ class TestAutomation(TestAutomationBase):
|
||||
|
||||
def test_GradientGenerators_Incompatibilities(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import GradientGenerators_Incompatibilities as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_GradientModifiers_Incompatibilities(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import GradientModifiers_Incompatibilities as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_GradientPreviewSettings_DefaultPinnedEntityIsSelf(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import GradientPreviewSettings_DefaultPinnedEntityIsSelf as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_GradientPreviewSettings_ClearingPinnedEntitySetsPreviewToOrigin(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import GradientPreviewSettings_ClearingPinnedEntitySetsPreviewToOrigin as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_GradientSampling_GradientReferencesAddRemoveSuccessfully(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import GradientSampling_GradientReferencesAddRemoveSuccessfully as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_GradientSurfaceTagEmitter_ComponentDependencies(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import GradientSurfaceTagEmitter_ComponentDependencies as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_GradientSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import GradientSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_GradientTransform_RequiresShape(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import GradientTransform_RequiresShape as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_GradientTransform_FrequencyZoomCanBeSetBeyondSliderRange(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import GradientTransform_FrequencyZoomCanBeSetBeyondSliderRange as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_GradientTransform_ComponentIncompatibleWithSpawners(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import GradientTransform_ComponentIncompatibleWithSpawners as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_GradientTransform_ComponentIncompatibleWithExpectedGradients(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import GradientTransform_ComponentIncompatibleWithExpectedGradients as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_ImageGradient_RequiresShape(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import ImageGradient_RequiresShape as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_ImageGradient_ProcessedImageAssignedSuccessfully(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import ImageGradient_ProcessedImageAssignedSuccessfully as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
+2
@@ -15,6 +15,8 @@ from ly_test_tools.o3de.editor_test import EditorSingleTest, EditorSharedTest, E
|
||||
@pytest.mark.parametrize("project", ["AutomatedTesting"])
|
||||
class TestAutomation(EditorTestSuite):
|
||||
|
||||
enable_prefab_system = False
|
||||
|
||||
class test_GradientGenerators_Incompatibilities(EditorSharedTest):
|
||||
from .EditorScripts import GradientGenerators_Incompatibilities as test_module
|
||||
|
||||
|
||||
@@ -22,8 +22,8 @@ class TestAutomation(TestAutomationBase):
|
||||
|
||||
def test_LandscapeCanvas_SlotConnections_UpdateComponentReferences(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import SlotConnections_UpdateComponentReferences as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_LandscapeCanvas_GradientMixer_NodeConstruction(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import GradientMixer_NodeConstruction as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
+2
@@ -18,6 +18,8 @@ from ly_test_tools.o3de.editor_test import EditorSingleTest, EditorSharedTest, E
|
||||
@pytest.mark.parametrize("project", ["AutomatedTesting"])
|
||||
class TestAutomation(EditorTestSuite):
|
||||
|
||||
enable_prefab_system = False
|
||||
|
||||
class test_LandscapeCanvas_SlotConnections_UpdateComponentReferences(EditorSharedTest):
|
||||
from .EditorScripts import SlotConnections_UpdateComponentReferences as test_module
|
||||
|
||||
|
||||
+22
-22
@@ -33,89 +33,89 @@ class TestAutomation(TestAutomationBase):
|
||||
|
||||
def test_LandscapeCanvas_AreaNodes_DependentComponentsAdded(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import AreaNodes_DependentComponentsAdded as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_LandscapeCanvas_AreaNodes_EntityCreatedOnNodeAdd(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import AreaNodes_EntityCreatedOnNodeAdd as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_LandscapeCanvas_AreaNodes_EntityRemovedOnNodeDelete(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import AreaNodes_EntityRemovedOnNodeDelete as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_LandscapeCanvas_LayerExtenderNodes_ComponentEntitySync(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import LayerExtenderNodes_ComponentEntitySync as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_LandscapeCanvas_Edit_DisabledNodeDuplication(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import Edit_DisabledNodeDuplication as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_LandscapeCanvas_Edit_UndoNodeDelete_SliceEntity(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import Edit_UndoNodeDelete_SliceEntity as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_LandscapeCanvas_NewGraph_CreatedSuccessfully(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import NewGraph_CreatedSuccessfully as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_LandscapeCanvas_Component_AddedRemoved(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import Component_AddedRemoved as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_LandscapeCanvas_GraphClosed_OnLevelChange(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import GraphClosed_OnLevelChange as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@pytest.mark.xfail(reason="https://github.com/o3de/o3de/issues/2201")
|
||||
def test_LandscapeCanvas_GraphClosed_OnEntityDelete(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import GraphClosed_OnEntityDelete as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_LandscapeCanvas_GraphClosed_TabbedGraphClosesIndependently(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import GraphClosed_TabbedGraph as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_LandscapeCanvas_Slice_CreateInstantiate(self, request, workspace, editor, remove_test_slice, launcher_platform):
|
||||
from .EditorScripts import Slice_CreateInstantiate as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_LandscapeCanvas_GradientModifierNodes_EntityCreatedOnNodeAdd(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import GradientModifierNodes_EntityCreatedOnNodeAdd as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_LandscapeCanvas_GradientModifierNodes_EntityRemovedOnNodeDelete(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import GradientModifierNodes_EntityRemovedOnNodeDelete as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_LandscapeCanvas_GradientNodes_DependentComponentsAdded(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import GradientNodes_DependentComponentsAdded as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_LandscapeCanvas_GradientNodes_EntityCreatedOnNodeAdd(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import GradientNodes_EntityCreatedOnNodeAdd as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_LandscapeCanvas_GradientNodes_EntityRemovedOnNodeDelete(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import GradientNodes_EntityRemovedOnNodeDelete as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_LandscapeCanvas_GraphUpdates_UpdateComponents(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import GraphUpdates_UpdateComponents as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_LandscapeCanvas_ComponentUpdates_UpdateGraph(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import ComponentUpdates_UpdateGraph as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_LandscapeCanvas_LayerBlender_NodeConstruction(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import LayerBlender_NodeConstruction as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_LandscapeCanvas_ShapeNodes_EntityCreatedOnNodeAdd(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import ShapeNodes_EntityCreatedOnNodeAdd as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_LandscapeCanvas_ShapeNodes_EntityRemovedOnNodeDelete(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import ShapeNodes_EntityRemovedOnNodeDelete as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@@ -27,15 +27,15 @@ TEST_DIRECTORY = os.path.dirname(__file__)
|
||||
class TestAutomation(TestAutomationBase):
|
||||
def test_Pane_HappyPath_OpenCloseSuccessfully(self, request, workspace, editor, launcher_platform):
|
||||
from . import Pane_HappyPath_OpenCloseSuccessfully as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_Pane_HappyPath_DocksProperly(self, request, workspace, editor, launcher_platform):
|
||||
from . import Pane_HappyPath_DocksProperly as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_Pane_HappyPath_ResizesProperly(self, request, workspace, editor, launcher_platform):
|
||||
from . import Pane_HappyPath_ResizesProperly as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@pytest.mark.xfail(reason="Test fails to find expected lines, it needs to be fixed.")
|
||||
@pytest.mark.parametrize("level", ["tmp_level"])
|
||||
@@ -45,7 +45,7 @@ class TestAutomation(TestAutomationBase):
|
||||
request.addfinalizer(teardown)
|
||||
file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True)
|
||||
from . import ScriptCanvas_TwoComponents_InteractSuccessfully as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@pytest.mark.xfail(reason="Test fails to find expected lines, it needs to be fixed.")
|
||||
@pytest.mark.parametrize("level", ["tmp_level"])
|
||||
@@ -55,15 +55,15 @@ class TestAutomation(TestAutomationBase):
|
||||
request.addfinalizer(teardown)
|
||||
file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True)
|
||||
from . import ScriptCanvas_ChangingAssets_ComponentStable as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_Graph_HappyPath_ZoomInZoomOut(self, request, workspace, editor, launcher_platform):
|
||||
from . import Graph_HappyPath_ZoomInZoomOut as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_NodePalette_HappyPath_CanSelectNode(self, request, workspace, editor, launcher_platform):
|
||||
from . import NodePalette_HappyPath_CanSelectNode as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@pytest.mark.xfail(reason="Test fails to find expected lines, it needs to be fixed.")
|
||||
@pytest.mark.parametrize("level", ["tmp_level"])
|
||||
@@ -73,11 +73,11 @@ class TestAutomation(TestAutomationBase):
|
||||
request.addfinalizer(teardown)
|
||||
file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True)
|
||||
from . import ScriptCanvasComponent_OnEntityActivatedDeactivated_PrintMessage as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_NodePalette_HappyPath_ClearSelection(self, request, workspace, editor, launcher_platform, project):
|
||||
from . import NodePalette_HappyPath_ClearSelection as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@pytest.mark.xfail(reason="Test fails to find expected lines, it needs to be fixed.")
|
||||
@pytest.mark.parametrize("level", ["tmp_level"])
|
||||
@@ -87,7 +87,7 @@ class TestAutomation(TestAutomationBase):
|
||||
request.addfinalizer(teardown)
|
||||
file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True)
|
||||
from . import ScriptCanvas_TwoEntities_UseSimultaneously as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_ScriptEvent_HappyPath_CreatedWithoutError(self, request, workspace, editor, launcher_platform, project):
|
||||
def teardown():
|
||||
@@ -99,19 +99,19 @@ class TestAutomation(TestAutomationBase):
|
||||
[os.path.join(workspace.paths.project(), "ScriptCanvas", "test_file.scriptevent")], True, True
|
||||
)
|
||||
from . import ScriptEvent_HappyPath_CreatedWithoutError as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_ScriptCanvasTools_Toggle_OpenCloseSuccess(self, request, workspace, editor, launcher_platform):
|
||||
from . import ScriptCanvasTools_Toggle_OpenCloseSuccess as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_NodeInspector_HappyPath_VariableRenames(self, request, workspace, editor, launcher_platform, project):
|
||||
from . import NodeInspector_HappyPath_VariableRenames as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_Debugger_HappyPath_TargetMultipleGraphs(self, request, workspace, editor, launcher_platform, project):
|
||||
from . import Debugger_HappyPath_TargetMultipleGraphs as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@pytest.mark.parametrize("level", ["tmp_level"])
|
||||
def test_Debugger_HappyPath_TargetMultipleEntities(self, request, workspace, editor, launcher_platform, project, level):
|
||||
@@ -120,16 +120,16 @@ class TestAutomation(TestAutomationBase):
|
||||
request.addfinalizer(teardown)
|
||||
file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True)
|
||||
from . import Debugger_HappyPath_TargetMultipleEntities as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@pytest.mark.xfail(reason="Test fails to find expected lines, it needs to be fixed.")
|
||||
def test_EditMenu_Default_UndoRedo(self, request, workspace, editor, launcher_platform, project):
|
||||
from . import EditMenu_Default_UndoRedo as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_Pane_Undocked_ClosesSuccessfully(self, request, workspace, editor, launcher_platform):
|
||||
from . import Pane_Undocked_ClosesSuccessfully as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@pytest.mark.parametrize("level", ["tmp_level"])
|
||||
def test_Entity_HappyPath_AddScriptCanvasComponent(self, request, workspace, editor, launcher_platform, project, level):
|
||||
@@ -138,11 +138,11 @@ class TestAutomation(TestAutomationBase):
|
||||
request.addfinalizer(teardown)
|
||||
file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True)
|
||||
from . import Entity_HappyPath_AddScriptCanvasComponent as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_Pane_Default_RetainOnSCRestart(self, request, workspace, editor, launcher_platform):
|
||||
from . import Pane_Default_RetainOnSCRestart as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@pytest.mark.xfail(reason="Test fails to find expected lines, it needs to be fixed.")
|
||||
@pytest.mark.parametrize("level", ["tmp_level"])
|
||||
@@ -152,7 +152,7 @@ class TestAutomation(TestAutomationBase):
|
||||
request.addfinalizer(teardown)
|
||||
file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True)
|
||||
from . import ScriptEvents_HappyPath_SendReceiveAcrossMultiple as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@pytest.mark.xfail(reason="Test fails to find expected lines, it needs to be fixed.")
|
||||
@pytest.mark.parametrize("level", ["tmp_level"])
|
||||
@@ -162,7 +162,7 @@ class TestAutomation(TestAutomationBase):
|
||||
request.addfinalizer(teardown)
|
||||
file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True)
|
||||
from . import ScriptEvents_Default_SendReceiveSuccessfully as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@pytest.mark.xfail(reason="Test fails to find expected lines, it needs to be fixed.")
|
||||
@pytest.mark.parametrize("level", ["tmp_level"])
|
||||
@@ -172,24 +172,24 @@ class TestAutomation(TestAutomationBase):
|
||||
request.addfinalizer(teardown)
|
||||
file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True)
|
||||
from . import ScriptEvents_ReturnSetType_Successfully as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_NodeCategory_ExpandOnClick(self, request, workspace, editor, launcher_platform):
|
||||
from . import NodeCategory_ExpandOnClick as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_NodePalette_SearchText_Deletion(self, request, workspace, editor, launcher_platform):
|
||||
from . import NodePalette_SearchText_Deletion as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@pytest.mark.xfail(reason="Test fails to find expected lines, it needs to be fixed.")
|
||||
def test_VariableManager_UnpinVariableType_Works(self, request, workspace, editor, launcher_platform):
|
||||
from . import VariableManager_UnpinVariableType_Works as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_Node_HappyPath_DuplicateNode(self, request, workspace, editor, launcher_platform):
|
||||
from . import Node_HappyPath_DuplicateNode as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
def test_ScriptEvent_AddRemoveParameter_ActionsSuccessful(self, request, workspace, editor, launcher_platform):
|
||||
def teardown():
|
||||
@@ -201,7 +201,7 @@ class TestAutomation(TestAutomationBase):
|
||||
[os.path.join(workspace.paths.project(), "ScriptCanvas", "test_file.scriptevent")], True, True
|
||||
)
|
||||
from . import ScriptEvent_AddRemoveParameter_ActionsSuccessful as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
# NOTE: We had to use hydra_test_utils.py, as TestAutomationBase run_test method
|
||||
# fails because of pyside_utils import
|
||||
@@ -220,7 +220,14 @@ class TestScriptCanvasTests(object):
|
||||
"File->Open action working as expected: True",
|
||||
]
|
||||
hydra.launch_and_validate_results(
|
||||
request, TEST_DIRECTORY, editor, "FileMenu_Default_NewAndOpen.py", expected_lines, auto_test_mode=False, timeout=60,
|
||||
request,
|
||||
TEST_DIRECTORY,
|
||||
editor,
|
||||
"FileMenu_Default_NewAndOpen.py",
|
||||
expected_lines,
|
||||
auto_test_mode=False,
|
||||
timeout=60,
|
||||
enable_prefab_system=False,
|
||||
)
|
||||
|
||||
@pytest.mark.xfail(reason="Test fails to find expected lines, it needs to be fixed.")
|
||||
@@ -239,6 +246,7 @@ class TestScriptCanvasTests(object):
|
||||
expected_lines,
|
||||
auto_test_mode=False,
|
||||
timeout=60,
|
||||
enable_prefab_system=False,
|
||||
)
|
||||
|
||||
def test_GraphClose_Default_SavePrompt(self, request, editor, launcher_platform):
|
||||
@@ -255,6 +263,7 @@ class TestScriptCanvasTests(object):
|
||||
expected_lines,
|
||||
auto_test_mode=False,
|
||||
timeout=60,
|
||||
enable_prefab_system=False,
|
||||
)
|
||||
|
||||
def test_VariableManager_Default_CreateDeleteVars(self, request, editor, launcher_platform):
|
||||
@@ -269,6 +278,7 @@ class TestScriptCanvasTests(object):
|
||||
expected_lines,
|
||||
auto_test_mode=False,
|
||||
timeout=60,
|
||||
enable_prefab_system=False,
|
||||
)
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
@@ -304,6 +314,7 @@ class TestScriptCanvasTests(object):
|
||||
cfg_args=[config.get('cfg_args')],
|
||||
auto_test_mode=False,
|
||||
timeout=60,
|
||||
enable_prefab_system=False,
|
||||
)
|
||||
|
||||
@pytest.mark.xfail(reason="Test fails to find expected lines, it needs to be fixed.")
|
||||
@@ -332,6 +343,7 @@ class TestScriptCanvasTests(object):
|
||||
expected_lines,
|
||||
auto_test_mode=False,
|
||||
timeout=60,
|
||||
enable_prefab_system=False,
|
||||
)
|
||||
|
||||
@pytest.mark.xfail(reason="Test fails to find expected lines, it needs to be fixed.")
|
||||
@@ -359,5 +371,6 @@ class TestScriptCanvasTests(object):
|
||||
expected_lines,
|
||||
auto_test_mode=False,
|
||||
timeout=60,
|
||||
enable_prefab_system=False,
|
||||
)
|
||||
|
||||
@@ -23,4 +23,4 @@ class TestAutomation(TestAutomationBase):
|
||||
|
||||
def test_Opening_Closing_Pane(self, request, workspace, editor, launcher_platform):
|
||||
from . import Opening_Closing_Pane as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@@ -31,4 +31,4 @@ class TestAutomation(TestAutomationBase):
|
||||
|
||||
from . import Editor_NewExistingLevels_Works as test_module
|
||||
|
||||
self._run_test(request, workspace, editor, test_module, extra_cmdline_args=["--regset=/Amazon/Preferences/EnablePrefabSystem=false"])
|
||||
self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
|
||||
|
||||
@@ -1,52 +1,61 @@
|
||||
{
|
||||
"ContainerEntity": {
|
||||
"Id": "ContainerEntity",
|
||||
"Name": "Base",
|
||||
"Id": "Entity_[1146574390643]",
|
||||
"Name": "Level",
|
||||
"Components": {
|
||||
"Component_[10182366347512475253]": {
|
||||
"$type": "EditorPrefabComponent",
|
||||
"Id": 10182366347512475253
|
||||
"Component_[10641544592923449938]": {
|
||||
"$type": "EditorInspectorComponent",
|
||||
"Id": 10641544592923449938
|
||||
},
|
||||
"Component_[12917798267488243668]": {
|
||||
"$type": "EditorPendingCompositionComponent",
|
||||
"Id": 12917798267488243668
|
||||
},
|
||||
"Component_[3261249813163778338]": {
|
||||
"Component_[12039882709170782873]": {
|
||||
"$type": "EditorOnlyEntityComponent",
|
||||
"Id": 3261249813163778338
|
||||
"Id": 12039882709170782873
|
||||
},
|
||||
"Component_[3837204912784440039]": {
|
||||
"$type": "EditorDisabledCompositionComponent",
|
||||
"Id": 3837204912784440039
|
||||
"Component_[12265484671603697631]": {
|
||||
"$type": "EditorPendingCompositionComponent",
|
||||
"Id": 12265484671603697631
|
||||
},
|
||||
"Component_[4272963378099646759]": {
|
||||
"Component_[14126657869720434043]": {
|
||||
"$type": "EditorEntitySortComponent",
|
||||
"Id": 14126657869720434043,
|
||||
"ChildEntityOrderEntryArray": [
|
||||
{
|
||||
"EntityId": ""
|
||||
},
|
||||
{
|
||||
"EntityId": "",
|
||||
"SortIndex": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
"Component_[15230859088967841193]": {
|
||||
"$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent",
|
||||
"Id": 4272963378099646759,
|
||||
"Id": 15230859088967841193,
|
||||
"Parent Entity": ""
|
||||
},
|
||||
"Component_[4848458548047175816]": {
|
||||
"$type": "EditorVisibilityComponent",
|
||||
"Id": 4848458548047175816
|
||||
"Component_[16239496886950819870]": {
|
||||
"$type": "EditorDisabledCompositionComponent",
|
||||
"Id": 16239496886950819870
|
||||
},
|
||||
"Component_[5787060997243919943]": {
|
||||
"$type": "EditorInspectorComponent",
|
||||
"Id": 5787060997243919943
|
||||
},
|
||||
"Component_[7804170251266531779]": {
|
||||
"$type": "EditorLockComponent",
|
||||
"Id": 7804170251266531779
|
||||
},
|
||||
"Component_[7874177159288365422]": {
|
||||
"$type": "EditorEntitySortComponent",
|
||||
"Id": 7874177159288365422
|
||||
},
|
||||
"Component_[8018146290632383969]": {
|
||||
"Component_[5688118765544765547]": {
|
||||
"$type": "EditorEntityIconComponent",
|
||||
"Id": 8018146290632383969
|
||||
"Id": 5688118765544765547
|
||||
},
|
||||
"Component_[8452360690590857075]": {
|
||||
"Component_[6545738857812235305]": {
|
||||
"$type": "SelectionComponent",
|
||||
"Id": 8452360690590857075
|
||||
"Id": 6545738857812235305
|
||||
},
|
||||
"Component_[7247035804068349658]": {
|
||||
"$type": "EditorPrefabComponent",
|
||||
"Id": 7247035804068349658
|
||||
},
|
||||
"Component_[9307224322037797205]": {
|
||||
"$type": "EditorLockComponent",
|
||||
"Id": 9307224322037797205
|
||||
},
|
||||
"Component_[9562516168917670048]": {
|
||||
"$type": "EditorVisibilityComponent",
|
||||
"Id": 9562516168917670048
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"Amazon": {
|
||||
"Preferences": {
|
||||
"EnablePrefabSystem": false
|
||||
"EnablePrefabSystem": true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
#
|
||||
# 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
|
||||
#
|
||||
#
|
||||
|
||||
# File to tweak compiler settings before compiler detection happens (before project() is called)
|
||||
# We dont have PAL enabled at this point, so we can only use pure-CMake variables
|
||||
if("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Linux")
|
||||
include(cmake/Platform/Linux/CompilerSettings_linux.cmake)
|
||||
endif()
|
||||
@@ -1,3 +1,4 @@
|
||||
# {BEGIN_LICENSE}
|
||||
#
|
||||
# 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.
|
||||
@@ -5,18 +6,34 @@
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
#
|
||||
# {END_LICENSE}
|
||||
# This file is copied during engine registration. Edits to this file will be lost next
|
||||
# time a registration happens.
|
||||
|
||||
include_guard()
|
||||
|
||||
# Read the engine name from the project_json file
|
||||
file(READ ${CMAKE_CURRENT_LIST_DIR}/project.json project_json)
|
||||
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${CMAKE_CURRENT_LIST_DIR}/project.json)
|
||||
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/project.json project_json)
|
||||
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/project.json)
|
||||
|
||||
string(JSON LY_ENGINE_NAME_TO_USE ERROR_VARIABLE json_error GET ${project_json} engine)
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read key 'engine' from 'project.json', error: ${json_error}")
|
||||
message(FATAL_ERROR "Unable to read key 'engine' from 'project.json'\nError: ${json_error}")
|
||||
endif()
|
||||
|
||||
if(CMAKE_MODULE_PATH)
|
||||
foreach(module_path ${CMAKE_MODULE_PATH})
|
||||
if(EXISTS ${module_path}/Findo3de.cmake)
|
||||
file(READ ${module_path}/../engine.json engine_json)
|
||||
string(JSON engine_name ERROR_VARIABLE json_error GET ${engine_json} engine_name)
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read key 'engine_name' from 'engine.json'\nError: ${json_error}")
|
||||
endif()
|
||||
if(LY_ENGINE_NAME_TO_USE STREQUAL engine_name)
|
||||
return() # Engine being forced through CMAKE_MODULE_PATH
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if(DEFINED ENV{USERPROFILE} AND EXISTS $ENV{USERPROFILE})
|
||||
@@ -25,6 +42,11 @@ else()
|
||||
set(manifest_path $ENV{HOME}/.o3de/o3de_manifest.json) # Unix
|
||||
endif()
|
||||
|
||||
set(registration_error [=[
|
||||
Engine registration is required before configuring a project.
|
||||
Run 'scripts/o3de register --this-engine' from the engine root.
|
||||
]=])
|
||||
|
||||
# Read the ~/.o3de/o3de_manifest.json file and look through the 'engines_path' object.
|
||||
# Find a key that matches LY_ENGINE_NAME_TO_USE and use that as the engine path.
|
||||
if(EXISTS ${manifest_path})
|
||||
@@ -33,36 +55,38 @@ if(EXISTS ${manifest_path})
|
||||
|
||||
string(JSON engines_path_count ERROR_VARIABLE json_error LENGTH ${manifest_json} engines_path)
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read key 'engines_path' from '${manifest_path}', error: ${json_error}")
|
||||
message(FATAL_ERROR "Unable to read key 'engines_path' from '${manifest_path}'\nError: ${json_error}\n${registration_error}")
|
||||
endif()
|
||||
|
||||
string(JSON engines_path_type ERROR_VARIABLE json_error TYPE ${manifest_json} engines_path)
|
||||
if(json_error OR NOT ${engines_path_type} STREQUAL "OBJECT")
|
||||
message(FATAL_ERROR "Type of 'engines_path' in '${manifest_path}' is not a JSON Object, error: ${json_error}")
|
||||
message(FATAL_ERROR "Type of 'engines_path' in '${manifest_path}' is not a JSON Object\nError: ${json_error}")
|
||||
endif()
|
||||
|
||||
math(EXPR engines_path_count "${engines_path_count}-1")
|
||||
foreach(engine_path_index RANGE ${engines_path_count})
|
||||
string(JSON engine_name ERROR_VARIABLE json_error MEMBER ${manifest_json} engines_path ${engine_path_index})
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read 'engines_path/${engine_path_index}' from '${manifest_path}', error: ${json_error}")
|
||||
message(FATAL_ERROR "Unable to read 'engines_path/${engine_path_index}' from '${manifest_path}'\nError: ${json_error}")
|
||||
endif()
|
||||
|
||||
if(LY_ENGINE_NAME_TO_USE STREQUAL engine_name)
|
||||
string(JSON engine_path ERROR_VARIABLE json_error GET ${manifest_json} engines_path ${engine_name})
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read value from 'engines_path/${engine_name}', error: ${json_error}")
|
||||
message(FATAL_ERROR "Unable to read value from 'engines_path/${engine_name}'\nError: ${json_error}")
|
||||
endif()
|
||||
|
||||
if(engine_path)
|
||||
list(APPEND CMAKE_MODULE_PATH "${engine_path}/cmake")
|
||||
break()
|
||||
return()
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
message(FATAL_ERROR "The project.json uses engine name '${LY_ENGINE_NAME_TO_USE}' but no engine with that name has been registered.\n${registration_error}")
|
||||
else()
|
||||
# If the user is passing CMAKE_MODULE_PATH we assume thats where we will find the engine
|
||||
if(NOT CMAKE_MODULE_PATH)
|
||||
message(FATAL_ERROR "Engine registration is required before configuring a project. Please register an engine by running 'scripts/o3de register --this-engine'")
|
||||
message(FATAL_ERROR "O3DE Manifest file not found.\n${registration_error}")
|
||||
endif()
|
||||
endif()
|
||||
@@ -234,7 +234,7 @@ void Q2DViewport::UpdateContent(int flags)
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void Q2DViewport::OnRButtonDown(Qt::KeyboardModifiers modifiers, const QPoint& point)
|
||||
void Q2DViewport::OnRButtonDown([[maybe_unused]] Qt::KeyboardModifiers modifiers, const QPoint& point)
|
||||
{
|
||||
if (GetIEditor()->IsInGameMode())
|
||||
{
|
||||
@@ -246,9 +246,6 @@ void Q2DViewport::OnRButtonDown(Qt::KeyboardModifiers modifiers, const QPoint& p
|
||||
setFocus();
|
||||
}
|
||||
|
||||
// Check Edit Tool.
|
||||
MouseCallback(eMouseRDown, point, modifiers);
|
||||
|
||||
SetCurrentCursor(STD_CURSOR_MOVE, QString());
|
||||
|
||||
// Save the mouse down position
|
||||
@@ -273,17 +270,8 @@ void Q2DViewport::OnRButtonUp([[maybe_unused]] Qt::KeyboardModifiers modifiers,
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void Q2DViewport::OnMButtonDown(Qt::KeyboardModifiers modifiers, const QPoint& point)
|
||||
void Q2DViewport::OnMButtonDown([[maybe_unused]] Qt::KeyboardModifiers modifiers, const QPoint& point)
|
||||
{
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// User pressed the middle mouse button
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// Check Edit Tool.
|
||||
if (MouseCallback(eMouseMDown, point, modifiers))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Save the mouse down position
|
||||
m_RMouseDownPos = point;
|
||||
|
||||
@@ -300,14 +288,8 @@ void Q2DViewport::OnMButtonDown(Qt::KeyboardModifiers modifiers, const QPoint& p
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void Q2DViewport::OnMButtonUp(Qt::KeyboardModifiers modifiers, const QPoint& point)
|
||||
void Q2DViewport::OnMButtonUp([[maybe_unused]] Qt::KeyboardModifiers modifiers, [[maybe_unused]] const QPoint& point)
|
||||
{
|
||||
// Check Edit Tool.
|
||||
if (MouseCallback(eMouseMUp, point, modifiers))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
SetViewMode(NothingMode);
|
||||
|
||||
ReleaseMouse();
|
||||
@@ -547,13 +529,6 @@ QPoint Q2DViewport::WorldToView(const Vec3& wp) const
|
||||
QPoint p = QPoint(static_cast<int>(sp.x), static_cast<int>(sp.y));
|
||||
return p;
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
QPoint Q2DViewport::WorldToViewParticleEditor(const Vec3& wp, [[maybe_unused]] int width, [[maybe_unused]] int height) const //Eric@conffx implement for the children class of IDisplayViewport
|
||||
{
|
||||
Vec3 sp = m_screenTM.TransformPoint(wp);
|
||||
QPoint p = QPoint(static_cast<int>(sp.x), static_cast<int>(sp.y));
|
||||
return p;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
Vec3 Q2DViewport::ViewToWorld(const QPoint& vp, [[maybe_unused]] bool* collideWithTerrain, [[maybe_unused]] bool onlyTerrain, [[maybe_unused]] bool bSkipVegetation, [[maybe_unused]] bool bTestRenderMesh, [[maybe_unused]] bool* collideWithObject) const
|
||||
|
||||
@@ -50,8 +50,6 @@ public:
|
||||
//! Map world space position to viewport position.
|
||||
QPoint WorldToView(const Vec3& wp) const override;
|
||||
|
||||
QPoint WorldToViewParticleEditor(const Vec3& wp, int width, int height) const override; //Eric@conffx
|
||||
|
||||
//! Map viewport position to world space position.
|
||||
Vec3 ViewToWorld(const QPoint& vp, bool* collideWithTerrain = nullptr, bool onlyTerrain = false, bool bSkipVegetation = false, bool bTestRenderMesh = false, bool* collideWithObject = nullptr) const override;
|
||||
//! Map viewport position to world space ray from camera.
|
||||
|
||||
@@ -152,15 +152,6 @@ ActionManager::ActionWrapper& ActionManager::ActionWrapper::SetMenu(DynamicMenu*
|
||||
return *this;
|
||||
}
|
||||
|
||||
ActionManager::ActionWrapper& ActionManager::ActionWrapper::SetApplyHoverEffect()
|
||||
{
|
||||
// Our standard toolbar icons, when hovered on, get a white color effect.
|
||||
// But for this to work we need .pngs that look good with this effect, so this only works with the standard toolbars
|
||||
// and looks very ugly for other toolbars, including toolbars loaded from XML (which just show a white rectangle)
|
||||
m_action->setProperty("IconHasHoverEffect", true);
|
||||
return *this;
|
||||
}
|
||||
|
||||
ActionManager::ActionWrapper& ActionManager::ActionWrapper::SetReserved()
|
||||
{
|
||||
m_action->setProperty("Reserved", true);
|
||||
|
||||
@@ -151,7 +151,6 @@ public:
|
||||
}
|
||||
|
||||
ActionWrapper& SetMenu(DynamicMenu* menu);
|
||||
ActionWrapper& SetApplyHoverEffect();
|
||||
|
||||
operator QAction*() const {
|
||||
return m_action;
|
||||
|
||||
@@ -10,24 +10,21 @@
|
||||
|
||||
#include "AnimationBipedBoneNames.h"
|
||||
|
||||
namespace EditorAnimationBones
|
||||
namespace EditorAnimationBones::Biped
|
||||
{
|
||||
namespace Biped
|
||||
{
|
||||
const char* Pelvis = "Bip01 Pelvis";
|
||||
const char* Head = "Bip01 Head";
|
||||
const char* Weapon = "weapon_bone";
|
||||
const char* Pelvis = "Bip01 Pelvis";
|
||||
const char* Head = "Bip01 Head";
|
||||
const char* Weapon = "weapon_bone";
|
||||
|
||||
const char* LeftEye = "eye_bone_left";
|
||||
const char* RightEye = "eye_bone_right";
|
||||
const char* LeftEye = "eye_bone_left";
|
||||
const char* RightEye = "eye_bone_right";
|
||||
|
||||
const char* Spine[5] = { "Bip01 Spine", "Bip01 Spine1", "Bip01 Spine2", "Bip01 Spine3", "Bip01 Spine4" };
|
||||
const char* Neck[2] = { "Bip01 Neck", "Bip01 Neck1" };
|
||||
const char* Spine[5] = { "Bip01 Spine", "Bip01 Spine1", "Bip01 Spine2", "Bip01 Spine3", "Bip01 Spine4" };
|
||||
const char* Neck[2] = { "Bip01 Neck", "Bip01 Neck1" };
|
||||
|
||||
const char* LeftHeel = "Bip01 L Heel";
|
||||
const char* LeftToe[2] = { "Bip01 L Toe0", "Bip01 L Toe1" };
|
||||
const char* LeftHeel = "Bip01 L Heel";
|
||||
const char* LeftToe[2] = { "Bip01 L Toe0", "Bip01 L Toe1" };
|
||||
|
||||
const char* RightHeel = "Bip01 R Heel";
|
||||
const char* RightToe[2] = { "Bip01 R Toe0", "Bip01 R Toe1" };
|
||||
}
|
||||
}
|
||||
const char* RightHeel = "Bip01 R Heel";
|
||||
const char* RightToe[2] = { "Bip01 R Toe0", "Bip01 R Toe1" };
|
||||
} // namespace EditorAnimationBones::Biped
|
||||
|
||||
@@ -140,7 +140,7 @@ bool AssetImporterManager::OnBrowseFiles()
|
||||
bool encounteredCrate = false;
|
||||
QStringList invalidFiles;
|
||||
|
||||
for (QString path : fileDialog.selectedFiles())
|
||||
for (const QString& path : fileDialog.selectedFiles())
|
||||
{
|
||||
QString fileName = GetFileName(path);
|
||||
QFileInfo info(path);
|
||||
|
||||
@@ -199,41 +199,6 @@ namespace AzAssetBrowserRequestHandlerPrivate
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Helper utility - determines if the thing being dragged is a FBX from the scene import pipeline
|
||||
// This is important to differentiate.
|
||||
// when someone drags a MTL file directly into the viewport, even from a FBX, we want to spawn it as a decal
|
||||
// but when someone drags a FBX that contains MTL files, we want only to spawn the meshes.
|
||||
// so we have to specifically differentiate here between the mimeData type that contains the source as the root
|
||||
// (dragging the fbx file itself)
|
||||
// and one which contains the actual product at its root.
|
||||
|
||||
bool IsDragOfFBX(const QMimeData* mimeData)
|
||||
{
|
||||
AZStd::vector<AssetBrowserEntry*> entries;
|
||||
if (!AssetBrowserEntry::FromMimeData(mimeData, entries))
|
||||
{
|
||||
// if mimedata does not even contain entries, no point in proceeding.
|
||||
return false;
|
||||
}
|
||||
|
||||
for (auto entry : entries)
|
||||
{
|
||||
if (entry->GetEntryType() != AssetBrowserEntry::AssetEntryType::Source)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
// this is a source file. Is it the filetype we're looking for?
|
||||
if (SourceAssetBrowserEntry* source = azrtti_cast<SourceAssetBrowserEntry*>(entry))
|
||||
{
|
||||
if (AzFramework::StringFunc::Equal(source->GetExtension().c_str(), ".fbx", false))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
AzAssetBrowserRequestHandler::AzAssetBrowserRequestHandler()
|
||||
|
||||
@@ -671,7 +671,7 @@ AzToolsFramework::PropertyRowWidget* ReflectedPropertyControl::FindPropertyRowWi
|
||||
return nullptr;
|
||||
}
|
||||
const AzToolsFramework::ReflectedPropertyEditor::WidgetList& widgets = m_editor->GetWidgets();
|
||||
for (auto instance : widgets)
|
||||
for (const auto& instance : widgets)
|
||||
{
|
||||
if (instance.second->label() == item->GetPropertyName())
|
||||
{
|
||||
|
||||
+10
-4
@@ -370,10 +370,8 @@ void CCryEditApp::RegisterActionHandlers()
|
||||
ON_COMMAND(ID_EDIT_FETCH, OnEditFetch)
|
||||
ON_COMMAND(ID_FILE_EXPORTTOGAMENOSURFACETEXTURE, OnFileExportToGameNoSurfaceTexture)
|
||||
ON_COMMAND(ID_VIEW_SWITCHTOGAME, OnViewSwitchToGame)
|
||||
MainWindow::instance()->GetActionManager()->RegisterActionHandler(ID_VIEW_SWITCHTOGAME_FULLSCREEN, [this]() {
|
||||
ed_previewGameInFullscreen_once = true;
|
||||
OnViewSwitchToGame();
|
||||
});
|
||||
ON_COMMAND(ID_VIEW_SWITCHTOGAME_VIEWPORT, OnViewSwitchToGame)
|
||||
ON_COMMAND(ID_VIEW_SWITCHTOGAME_FULLSCREEN, OnViewSwitchToGameFullScreen)
|
||||
ON_COMMAND(ID_MOVE_OBJECT, OnMoveObject)
|
||||
ON_COMMAND(ID_RENAME_OBJ, OnRenameObj)
|
||||
ON_COMMAND(ID_UNDO, OnUndo)
|
||||
@@ -2573,6 +2571,12 @@ void CCryEditApp::OnViewSwitchToGame()
|
||||
GetIEditor()->SetInGameMode(inGame);
|
||||
}
|
||||
|
||||
void CCryEditApp::OnViewSwitchToGameFullScreen()
|
||||
{
|
||||
ed_previewGameInFullscreen_once = true;
|
||||
OnViewSwitchToGame();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CCryEditApp::OnExportSelectedObjects()
|
||||
{
|
||||
@@ -4184,6 +4188,8 @@ extern "C" int AZ_DLL_EXPORT CryEditMain(int argc, char* argv[])
|
||||
"\nThis could be because of incorrectly configured components, or missing required gems."
|
||||
"\nSee other errors for more details.");
|
||||
|
||||
AzToolsFramework::EditorEventsBus::Broadcast(&AzToolsFramework::EditorEvents::NotifyEditorInitialized);
|
||||
|
||||
if (didCryEditStart)
|
||||
{
|
||||
app->EnableOnIdle();
|
||||
|
||||
@@ -212,6 +212,7 @@ public:
|
||||
void OnEditFetch();
|
||||
void OnFileExportToGameNoSurfaceTexture();
|
||||
void OnViewSwitchToGame();
|
||||
void OnViewSwitchToGameFullScreen();
|
||||
void OnViewDeploy();
|
||||
void DeleteSelectedEntities(bool includeDescendants);
|
||||
void OnMoveObject();
|
||||
|
||||
@@ -1128,7 +1128,7 @@ bool CCryEditDoc::SaveLevel(const QString& filename)
|
||||
const QString oldLevelPattern = QDir(oldLevelFolder).absoluteFilePath("*.*");
|
||||
const QString oldLevelName = Path::GetFile(GetLevelPathName());
|
||||
const QString oldLevelXml = Path::ReplaceExtension(oldLevelName, "xml");
|
||||
AZ::IO::ArchiveFileIterator findHandle = pIPak->FindFirst(oldLevelPattern.toUtf8().data(), AZ::IO::IArchive::eFileSearchType_AllowOnDiskAndInZips);
|
||||
AZ::IO::ArchiveFileIterator findHandle = pIPak->FindFirst(oldLevelPattern.toUtf8().data(), AZ::IO::FileSearchLocation::Any);
|
||||
if (findHandle)
|
||||
{
|
||||
do
|
||||
|
||||
@@ -40,10 +40,10 @@ AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING
|
||||
namespace
|
||||
{
|
||||
// File name extension for python files
|
||||
const QString s_kPythonFileNameSpec = "*.py";
|
||||
const QString s_kPythonFileNameSpec("*.py");
|
||||
|
||||
// Tree root element name
|
||||
const QString s_kRootElementName = "Python Scripts";
|
||||
const QString s_kRootElementName("Python Scripts");
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -145,6 +145,15 @@ namespace SandboxEditor
|
||||
}
|
||||
};
|
||||
|
||||
const auto trackingTransform = [viewportId = m_viewportId]
|
||||
{
|
||||
bool tracking = false;
|
||||
AtomToolsFramework::ModularViewportCameraControllerRequestBus::EventResult(
|
||||
tracking, viewportId, &AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::IsTrackingTransform);
|
||||
|
||||
return tracking;
|
||||
};
|
||||
|
||||
m_firstPersonRotateCamera = AZStd::make_shared<AzFramework::RotateCameraInput>(SandboxEditor::CameraFreeLookChannelId());
|
||||
|
||||
m_firstPersonRotateCamera->m_rotateSpeedFn = []
|
||||
@@ -152,6 +161,11 @@ namespace SandboxEditor
|
||||
return SandboxEditor::CameraRotateSpeed();
|
||||
};
|
||||
|
||||
m_firstPersonRotateCamera->m_constrainPitch = [trackingTransform]
|
||||
{
|
||||
return !trackingTransform();
|
||||
};
|
||||
|
||||
// default behavior is to hide the cursor but this can be disabled (useful for remote desktop)
|
||||
// note: See CaptureCursorLook in the Settings Registry
|
||||
m_firstPersonRotateCamera->SetActivationBeganFn(hideCursor);
|
||||
@@ -255,6 +269,11 @@ namespace SandboxEditor
|
||||
return SandboxEditor::CameraOrbitYawRotationInverted();
|
||||
};
|
||||
|
||||
m_orbitRotateCamera->m_constrainPitch = [trackingTransform]
|
||||
{
|
||||
return !trackingTransform();
|
||||
};
|
||||
|
||||
m_orbitTranslateCamera = AZStd::make_shared<AzFramework::TranslateCameraInput>(
|
||||
translateCameraInputChannelIds, AzFramework::LookTranslation, AzFramework::TranslateOffsetOrbit);
|
||||
|
||||
@@ -337,12 +356,12 @@ namespace SandboxEditor
|
||||
AZ::TransformBus::EventResult(worldFromLocal, viewEntityId, &AZ::TransformBus::Events::GetWorldTM);
|
||||
|
||||
AtomToolsFramework::ModularViewportCameraControllerRequestBus::Event(
|
||||
m_viewportId, &AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::SetReferenceFrame, worldFromLocal);
|
||||
m_viewportId, &AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::StartTrackingTransform, worldFromLocal);
|
||||
}
|
||||
else
|
||||
{
|
||||
AtomToolsFramework::ModularViewportCameraControllerRequestBus::Event(
|
||||
m_viewportId, &AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::ClearReferenceFrame);
|
||||
m_viewportId, &AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::StopTrackingTransform);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -298,13 +298,9 @@ AzToolsFramework::ViewportInteraction::MousePick EditorViewportWidget::BuildMous
|
||||
{
|
||||
AzToolsFramework::ViewportInteraction::MousePick mousePick;
|
||||
mousePick.m_screenCoordinates = AzToolsFramework::ViewportInteraction::ScreenPointFromQPoint(point);
|
||||
if (const auto& ray = m_renderViewport->ViewportScreenToWorldRay(mousePick.m_screenCoordinates);
|
||||
ray.has_value())
|
||||
{
|
||||
mousePick.m_rayOrigin = ray.value().origin;
|
||||
mousePick.m_rayDirection = ray.value().direction;
|
||||
}
|
||||
|
||||
const auto[origin, direction] = m_renderViewport->ViewportScreenToWorldRay(mousePick.m_screenCoordinates);
|
||||
mousePick.m_rayOrigin = origin;
|
||||
mousePick.m_rayDirection = direction;
|
||||
return mousePick;
|
||||
}
|
||||
|
||||
@@ -895,23 +891,6 @@ AZ::Vector3 EditorViewportWidget::PickTerrain(const AzFramework::ScreenPoint& po
|
||||
return LYVec3ToAZVec3(ViewToWorld(AzToolsFramework::ViewportInteraction::QPointFromScreenPoint(point), nullptr, true));
|
||||
}
|
||||
|
||||
AZ::EntityId EditorViewportWidget::PickEntity(const AzFramework::ScreenPoint& point)
|
||||
{
|
||||
AZ::EntityId entityId;
|
||||
HitContext hitInfo;
|
||||
hitInfo.view = this;
|
||||
if (HitTest(AzToolsFramework::ViewportInteraction::QPointFromScreenPoint(point), hitInfo))
|
||||
{
|
||||
if (hitInfo.object && (hitInfo.object->GetType() == OBJTYPE_AZENTITY))
|
||||
{
|
||||
auto entityObject = static_cast<CComponentEntityObject*>(hitInfo.object);
|
||||
entityId = entityObject->GetAssociatedEntityId();
|
||||
}
|
||||
}
|
||||
|
||||
return entityId;
|
||||
}
|
||||
|
||||
float EditorViewportWidget::TerrainHeight(const AZ::Vector2& position)
|
||||
{
|
||||
return GetIEditor()->GetTerrainElevation(position.GetX(), position.GetY());
|
||||
@@ -1636,16 +1615,15 @@ void EditorViewportWidget::RenderSelectedRegion()
|
||||
Vec3 EditorViewportWidget::WorldToView3D(const Vec3& wp, [[maybe_unused]] int nFlags) const
|
||||
{
|
||||
Vec3 out(0, 0, 0);
|
||||
float x, y, z;
|
||||
float x, y;
|
||||
|
||||
ProjectToScreen(wp.x, wp.y, wp.z, &x, &y, &z);
|
||||
if (_finite(x) && _finite(y) && _finite(z))
|
||||
ProjectToScreen(wp.x, wp.y, wp.z, &x, &y);
|
||||
if (_finite(x) && _finite(y))
|
||||
{
|
||||
out.x = (x / 100) * m_rcClient.width();
|
||||
out.y = (y / 100) * m_rcClient.height();
|
||||
out.x /= static_cast<float>(QHighDpiScaling::factor(windowHandle()->screen()));
|
||||
out.y /= static_cast<float>(QHighDpiScaling::factor(windowHandle()->screen()));
|
||||
out.z = z;
|
||||
}
|
||||
return out;
|
||||
}
|
||||
@@ -1655,24 +1633,6 @@ QPoint EditorViewportWidget::WorldToView(const Vec3& wp) const
|
||||
{
|
||||
return AzToolsFramework::ViewportInteraction::QPointFromScreenPoint(m_renderViewport->ViewportWorldToScreen(LYVec3ToAZVec3(wp)));
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
QPoint EditorViewportWidget::WorldToViewParticleEditor(const Vec3& wp, int width, int height) const
|
||||
{
|
||||
QPoint p;
|
||||
float x, y, z;
|
||||
|
||||
ProjectToScreen(wp.x, wp.y, wp.z, &x, &y, &z);
|
||||
if (_finite(x) || _finite(y))
|
||||
{
|
||||
p.rx() = static_cast<int>((x / 100) * width);
|
||||
p.ry() = static_cast<int>((y / 100) * height);
|
||||
}
|
||||
else
|
||||
{
|
||||
QPoint(0, 0);
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
Vec3 EditorViewportWidget::ViewToWorld(
|
||||
@@ -1688,20 +1648,16 @@ Vec3 EditorViewportWidget::ViewToWorld(
|
||||
AZ_UNUSED(collideWithObject);
|
||||
|
||||
auto ray = m_renderViewport->ViewportScreenToWorldRay(AzToolsFramework::ViewportInteraction::ScreenPointFromQPoint(vp));
|
||||
if (!ray.has_value())
|
||||
{
|
||||
return Vec3(0, 0, 0);
|
||||
}
|
||||
|
||||
const float maxDistance = 10000.f;
|
||||
Vec3 v = AZVec3ToLYVec3(ray.value().direction) * maxDistance;
|
||||
Vec3 v = AZVec3ToLYVec3(ray.direction) * maxDistance;
|
||||
|
||||
if (!_finite(v.x) || !_finite(v.y) || !_finite(v.z))
|
||||
{
|
||||
return Vec3(0, 0, 0);
|
||||
}
|
||||
|
||||
Vec3 colp = AZVec3ToLYVec3(ray.value().origin) + 0.002f * v;
|
||||
Vec3 colp = AZVec3ToLYVec3(ray.origin) + 0.002f * v;
|
||||
|
||||
return colp;
|
||||
}
|
||||
@@ -1740,21 +1696,19 @@ bool EditorViewportWidget::RayRenderMeshIntersection(IRenderMesh* pRenderMesh, c
|
||||
return bRes;*/
|
||||
}
|
||||
|
||||
void EditorViewportWidget::UnProjectFromScreen(float sx, float sy, float sz, float* px, float* py, float* pz) const
|
||||
void EditorViewportWidget::UnProjectFromScreen(float sx, float sy, float* px, float* py, float* pz) const
|
||||
{
|
||||
AZ::Vector3 wp;
|
||||
wp = m_renderViewport->ViewportScreenToWorld(AzFramework::ScreenPoint{(int)sx, m_rcClient.bottom() - ((int)sy)}, sz).value_or(wp);
|
||||
const AZ::Vector3 wp = m_renderViewport->ViewportScreenToWorld(AzFramework::ScreenPoint{(int)sx, m_rcClient.bottom() - ((int)sy)});
|
||||
*px = wp.GetX();
|
||||
*py = wp.GetY();
|
||||
*pz = wp.GetZ();
|
||||
}
|
||||
|
||||
void EditorViewportWidget::ProjectToScreen(float ptx, float pty, float ptz, float* sx, float* sy, float* sz) const
|
||||
void EditorViewportWidget::ProjectToScreen(float ptx, float pty, float ptz, float* sx, float* sy) const
|
||||
{
|
||||
AzFramework::ScreenPoint screenPosition = m_renderViewport->ViewportWorldToScreen(AZ::Vector3{ptx, pty, ptz});
|
||||
*sx = static_cast<float>(screenPosition.m_x);
|
||||
*sy = static_cast<float>(screenPosition.m_y);
|
||||
*sz = 0.f;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@@ -1764,32 +1718,22 @@ void EditorViewportWidget::ViewToWorldRay(const QPoint& vp, Vec3& raySrc, Vec3&
|
||||
|
||||
Vec3 pos0, pos1;
|
||||
float wx, wy, wz;
|
||||
UnProjectFromScreen(static_cast<float>(vp.x()), static_cast<float>(rc.bottom() - vp.y()), 0.0f, &wx, &wy, &wz);
|
||||
if (!_finite(wx) || !_finite(wy) || !_finite(wz))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (fabs(wx) > 1000000 || fabs(wy) > 1000000 || fabs(wz) > 1000000)
|
||||
{
|
||||
return;
|
||||
}
|
||||
pos0(wx, wy, wz);
|
||||
UnProjectFromScreen(static_cast<float>(vp.x()), static_cast<float>(rc.bottom() - vp.y()), 1.0f, &wx, &wy, &wz);
|
||||
if (!_finite(wx) || !_finite(wy) || !_finite(wz))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (fabs(wx) > 1000000 || fabs(wy) > 1000000 || fabs(wz) > 1000000)
|
||||
{
|
||||
return;
|
||||
}
|
||||
pos1(wx, wy, wz);
|
||||
UnProjectFromScreen(static_cast<float>(vp.x()), static_cast<float>(rc.bottom() - vp.y()), &wx, &wy, &wz);
|
||||
|
||||
Vec3 v = (pos1 - pos0);
|
||||
v = v.GetNormalized();
|
||||
if (!_finite(wx) || !_finite(wy) || !_finite(wz))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (fabs(wx) > 1000000 || fabs(wy) > 1000000 || fabs(wz) > 1000000)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
pos0(wx, wy, wz);
|
||||
|
||||
raySrc = pos0;
|
||||
rayDir = v;
|
||||
rayDir = (pos0 - AZVec3ToLYVec3(m_renderViewport->GetCameraState().m_position)).GetNormalized();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@@ -2338,10 +2282,10 @@ void* EditorViewportWidget::GetSystemCursorConstraintWindow() const
|
||||
return systemCursorConstrained ? renderOverlayHWND() : nullptr;
|
||||
}
|
||||
|
||||
void EditorViewportWidget::BuildDragDropContext(AzQtComponents::ViewportDragContext& context, const QPoint& pt)
|
||||
void EditorViewportWidget::BuildDragDropContext(
|
||||
AzQtComponents::ViewportDragContext& context, const AzFramework::ViewportId viewportId, const QPoint& point)
|
||||
{
|
||||
const auto scaledPoint = WidgetToViewport(pt);
|
||||
QtViewport::BuildDragDropContext(context, scaledPoint);
|
||||
QtViewport::BuildDragDropContext(context, viewportId, point);
|
||||
}
|
||||
|
||||
void EditorViewportWidget::RestoreViewportAfterGameMode()
|
||||
|
||||
@@ -165,7 +165,6 @@ private:
|
||||
Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, const QPoint& point) override;
|
||||
void SetViewportId(int id) override;
|
||||
QPoint WorldToView(const Vec3& wp) const override;
|
||||
QPoint WorldToViewParticleEditor(const Vec3& wp, int width, int height) const override;
|
||||
Vec3 WorldToView3D(const Vec3& wp, int nFlags = 0) const override;
|
||||
Vec3 ViewToWorld(const QPoint& vp, bool* collideWithTerrain = nullptr, bool onlyTerrain = false, bool bSkipVegetation = false, bool bTestRenderMesh = false, bool* collideWithObject = nullptr) const override;
|
||||
void ViewToWorldRay(const QPoint& vp, Vec3& raySrc, Vec3& rayDir) const override;
|
||||
@@ -206,7 +205,6 @@ private:
|
||||
void* GetSystemCursorConstraintWindow() const override;
|
||||
|
||||
// AzToolsFramework::MainEditorViewportInteractionRequestBus overrides ...
|
||||
AZ::EntityId PickEntity(const AzFramework::ScreenPoint& point) override;
|
||||
AZ::Vector3 PickTerrain(const AzFramework::ScreenPoint& point) override;
|
||||
float TerrainHeight(const AZ::Vector2& position) override;
|
||||
bool ShowingWorldSpace() override;
|
||||
@@ -273,7 +271,8 @@ private:
|
||||
|
||||
bool CheckRespondToInput() const;
|
||||
|
||||
void BuildDragDropContext(AzQtComponents::ViewportDragContext& context, const QPoint& pt) override;
|
||||
void BuildDragDropContext(
|
||||
AzQtComponents::ViewportDragContext& context, AzFramework::ViewportId viewportId, const QPoint& point) override;
|
||||
|
||||
void SetAsActiveViewport();
|
||||
void PushDisableRendering();
|
||||
@@ -304,8 +303,8 @@ private:
|
||||
const DisplayContext& GetDisplayContext() const { return m_displayContext; }
|
||||
CBaseObject* GetCameraObject() const;
|
||||
|
||||
void UnProjectFromScreen(float sx, float sy, float sz, float* px, float* py, float* pz) const;
|
||||
void ProjectToScreen(float ptx, float pty, float ptz, float* sx, float* sy, float* sz) const;
|
||||
void UnProjectFromScreen(float sx, float sy, float* px, float* py, float* pz) const;
|
||||
void ProjectToScreen(float ptx, float pty, float ptz, float* sx, float* sy) const;
|
||||
|
||||
AZ::RPI::ViewPtr GetCurrentAtomView() const;
|
||||
|
||||
|
||||
@@ -45,7 +45,6 @@ struct IDisplayViewport
|
||||
virtual const Matrix34& GetViewTM() const = 0;
|
||||
virtual const Matrix34& GetScreenTM() const = 0;
|
||||
virtual QPoint WorldToView(const Vec3& worldPoint) const = 0;
|
||||
virtual QPoint WorldToViewParticleEditor(const Vec3& worldPoint, int width, int height) const = 0;
|
||||
virtual Vec3 WorldToView3D(const Vec3& worldPoint, int flags = 0) const = 0;
|
||||
virtual Vec3 ViewToWorld(const QPoint& vp, bool* collideWithTerrain = nullptr, bool onlyTerrain = false, bool bSkipVegetation = false, bool bTestRenderMesh = false, bool* collideWithObject = nullptr) const = 0;
|
||||
virtual void ViewToWorldRay(const QPoint& vp, Vec3& raySrc, Vec3& rayDir) const = 0;
|
||||
|
||||
@@ -9,10 +9,6 @@
|
||||
#define CRYINCLUDE_EDITOR_MATERIAL_IEDITORMATERIALMANAGER_H
|
||||
#pragma once
|
||||
|
||||
#define MATERIAL_FILE_EXT ".mtl"
|
||||
#define DCC_MATERIAL_FILE_EXT ".dccmtl"
|
||||
#define MATERIALS_PATH "materials/"
|
||||
|
||||
#include <Include/IBaseLibraryManager.h>
|
||||
#include <IMaterial.h>
|
||||
|
||||
|
||||
@@ -27,7 +27,9 @@ namespace UnitTest
|
||||
AZ::Entity* m_entity = nullptr;
|
||||
AZ::ComponentDescriptor* m_transformComponent = nullptr;
|
||||
|
||||
static const AzFramework::ViewportId TestViewportId;
|
||||
static inline constexpr AzFramework::ViewportId TestViewportId = 2345;
|
||||
static inline constexpr float HalfInterpolateToTransformDuration =
|
||||
AtomToolsFramework::ModularViewportCameraControllerRequests::InterpolateToTransformDuration * 0.5f;
|
||||
|
||||
void SetUp() override
|
||||
{
|
||||
@@ -76,8 +78,6 @@ namespace UnitTest
|
||||
}
|
||||
};
|
||||
|
||||
const AzFramework::ViewportId EditorCameraFixture::TestViewportId = AzFramework::ViewportId(1337);
|
||||
|
||||
TEST_F(EditorCameraFixture, ModularViewportCameraControllerReferenceFrameUpdatedWhenViewportEntityisChanged)
|
||||
{
|
||||
// Given
|
||||
@@ -91,8 +91,8 @@ namespace UnitTest
|
||||
&Camera::EditorCameraNotificationBus::Events::OnViewportViewEntityChanged, m_entity->GetId());
|
||||
|
||||
// ensure the viewport updates after the viewport view entity change
|
||||
const float deltaTime = 1.0f / 60.0f;
|
||||
m_controllerList->UpdateViewport({ TestViewportId, AzFramework::FloatSeconds(deltaTime), AZ::ScriptTimePoint() });
|
||||
// note: do a large step to ensure smoothing finishes (e.g. not 1.0f/60.0f)
|
||||
m_controllerList->UpdateViewport({ TestViewportId, AzFramework::FloatSeconds(2.0f), AZ::ScriptTimePoint() });
|
||||
|
||||
// retrieve updated camera transform
|
||||
const AZ::Transform cameraTransform = m_cameraViewportContextView->GetCameraTransform();
|
||||
@@ -102,61 +102,40 @@ namespace UnitTest
|
||||
EXPECT_THAT(cameraTransform, IsClose(entityTransform));
|
||||
}
|
||||
|
||||
TEST_F(EditorCameraFixture, ReferenceFrameRemainsIdentityAfterExternalCameraTransformChangeWhenNotSet)
|
||||
TEST_F(EditorCameraFixture, TrackingTransformIsTrueAfterTransformIsTracked)
|
||||
{
|
||||
// Given
|
||||
m_cameraViewportContextView->SetCameraTransform(AZ::Transform::CreateTranslation(AZ::Vector3(10.0f, 20.0f, 30.0f)));
|
||||
// Given/When
|
||||
const AZ::Transform referenceFrame = AZ::Transform::CreateFromQuaternionAndTranslation(
|
||||
AZ::Quaternion::CreateRotationX(AZ::DegToRad(90.0f)), AZ::Vector3(1.0f, 2.0f, 3.0f));
|
||||
AtomToolsFramework::ModularViewportCameraControllerRequestBus::Event(
|
||||
TestViewportId, &AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::StartTrackingTransform, referenceFrame);
|
||||
|
||||
// When
|
||||
AZ::Transform referenceFrame = AZ::Transform::CreateTranslation(AZ::Vector3(1.0f, 2.0f, 3.0f));
|
||||
bool trackingTransform = false;
|
||||
AtomToolsFramework::ModularViewportCameraControllerRequestBus::EventResult(
|
||||
referenceFrame, TestViewportId, &AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::GetReferenceFrame);
|
||||
trackingTransform, TestViewportId, &AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::IsTrackingTransform);
|
||||
|
||||
// Then
|
||||
// reference frame is still the identity
|
||||
EXPECT_THAT(referenceFrame, IsClose(AZ::Transform::CreateIdentity()));
|
||||
EXPECT_THAT(trackingTransform, ::testing::IsTrue());
|
||||
}
|
||||
|
||||
TEST_F(EditorCameraFixture, ExternalCameraTransformChangeWhenReferenceFrameIsSetUpdatesReferenceFrame)
|
||||
TEST_F(EditorCameraFixture, TrackingTransformIsFalseAfterTransformIsStoppedBeingTracked)
|
||||
{
|
||||
// Given
|
||||
const AZ::Transform referenceFrame = AZ::Transform::CreateFromQuaternionAndTranslation(
|
||||
AZ::Quaternion::CreateRotationX(AZ::DegToRad(90.0f)), AZ::Vector3(1.0f, 2.0f, 3.0f));
|
||||
AtomToolsFramework::ModularViewportCameraControllerRequestBus::Event(
|
||||
TestViewportId, &AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::SetReferenceFrame, referenceFrame);
|
||||
|
||||
const AZ::Transform nextTransform = AZ::Transform::CreateTranslation(AZ::Vector3(10.0f, 20.0f, 30.0f));
|
||||
m_cameraViewportContextView->SetCameraTransform(nextTransform);
|
||||
|
||||
// When
|
||||
AZ::Transform currentReferenceFrame = AZ::Transform::CreateTranslation(AZ::Vector3(1.0f, 2.0f, 3.0f));
|
||||
AtomToolsFramework::ModularViewportCameraControllerRequestBus::EventResult(
|
||||
currentReferenceFrame, TestViewportId,
|
||||
&AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::GetReferenceFrame);
|
||||
|
||||
// Then
|
||||
EXPECT_THAT(currentReferenceFrame, IsClose(nextTransform));
|
||||
}
|
||||
|
||||
TEST_F(EditorCameraFixture, ReferenceFrameReturnedToIdentityAfterClear)
|
||||
{
|
||||
// Given
|
||||
const AZ::Transform referenceFrame = AZ::Transform::CreateFromQuaternionAndTranslation(
|
||||
AZ::Quaternion::CreateRotationX(AZ::DegToRad(90.0f)), AZ::Vector3(1.0f, 2.0f, 3.0f));
|
||||
AtomToolsFramework::ModularViewportCameraControllerRequestBus::Event(
|
||||
TestViewportId, &AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::SetReferenceFrame, referenceFrame);
|
||||
TestViewportId, &AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::StartTrackingTransform, referenceFrame);
|
||||
|
||||
// When
|
||||
AtomToolsFramework::ModularViewportCameraControllerRequestBus::Event(
|
||||
TestViewportId, &AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::ClearReferenceFrame);
|
||||
|
||||
AZ::Transform currentReferenceFrame = AZ::Transform::CreateTranslation(AZ::Vector3(1.0f, 2.0f, 3.0f));
|
||||
AtomToolsFramework::ModularViewportCameraControllerRequestBus::EventResult(
|
||||
currentReferenceFrame, TestViewportId,
|
||||
&AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::GetReferenceFrame);
|
||||
TestViewportId, &AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::StopTrackingTransform);
|
||||
|
||||
// Then
|
||||
EXPECT_THAT(currentReferenceFrame, IsClose(AZ::Transform::CreateIdentity()));
|
||||
bool trackingTransform = false;
|
||||
AtomToolsFramework::ModularViewportCameraControllerRequestBus::EventResult(
|
||||
trackingTransform, TestViewportId, &AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::IsTrackingTransform);
|
||||
|
||||
EXPECT_THAT(trackingTransform, ::testing::IsFalse());
|
||||
}
|
||||
|
||||
TEST_F(EditorCameraFixture, InterpolateToTransform)
|
||||
@@ -169,8 +148,10 @@ namespace UnitTest
|
||||
transformToInterpolateTo);
|
||||
|
||||
// simulate interpolation
|
||||
m_controllerList->UpdateViewport({ TestViewportId, AzFramework::FloatSeconds(0.5f), AZ::ScriptTimePoint() });
|
||||
m_controllerList->UpdateViewport({ TestViewportId, AzFramework::FloatSeconds(0.5f), AZ::ScriptTimePoint() });
|
||||
m_controllerList->UpdateViewport(
|
||||
{ TestViewportId, AzFramework::FloatSeconds(HalfInterpolateToTransformDuration), AZ::ScriptTimePoint() });
|
||||
m_controllerList->UpdateViewport(
|
||||
{ TestViewportId, AzFramework::FloatSeconds(HalfInterpolateToTransformDuration), AZ::ScriptTimePoint() });
|
||||
|
||||
const auto finalTransform = m_cameraViewportContextView->GetCameraTransform();
|
||||
|
||||
@@ -184,7 +165,7 @@ namespace UnitTest
|
||||
const AZ::Transform referenceFrame = AZ::Transform::CreateFromQuaternionAndTranslation(
|
||||
AZ::Quaternion::CreateRotationX(AZ::DegToRad(90.0f)), AZ::Vector3(1.0f, 2.0f, 3.0f));
|
||||
AtomToolsFramework::ModularViewportCameraControllerRequestBus::Event(
|
||||
TestViewportId, &AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::SetReferenceFrame, referenceFrame);
|
||||
TestViewportId, &AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::StartTrackingTransform, referenceFrame);
|
||||
|
||||
AZ::Transform transformToInterpolateTo = AZ::Transform::CreateFromQuaternionAndTranslation(
|
||||
AZ::Quaternion::CreateRotationZ(AZ::DegToRad(90.0f)), AZ::Vector3(20.0f, 40.0f, 60.0f));
|
||||
@@ -195,18 +176,85 @@ namespace UnitTest
|
||||
transformToInterpolateTo);
|
||||
|
||||
// simulate interpolation
|
||||
m_controllerList->UpdateViewport({ TestViewportId, AzFramework::FloatSeconds(0.5f), AZ::ScriptTimePoint() });
|
||||
m_controllerList->UpdateViewport({ TestViewportId, AzFramework::FloatSeconds(0.5f), AZ::ScriptTimePoint() });
|
||||
|
||||
AZ::Transform currentReferenceFrame = AZ::Transform::CreateTranslation(AZ::Vector3(1.0f, 2.0f, 3.0f));
|
||||
AtomToolsFramework::ModularViewportCameraControllerRequestBus::EventResult(
|
||||
currentReferenceFrame, TestViewportId,
|
||||
&AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::GetReferenceFrame);
|
||||
m_controllerList->UpdateViewport(
|
||||
{ TestViewportId, AzFramework::FloatSeconds(HalfInterpolateToTransformDuration), AZ::ScriptTimePoint() });
|
||||
m_controllerList->UpdateViewport(
|
||||
{ TestViewportId, AzFramework::FloatSeconds(HalfInterpolateToTransformDuration), AZ::ScriptTimePoint() });
|
||||
|
||||
const auto finalTransform = m_cameraViewportContextView->GetCameraTransform();
|
||||
|
||||
// Then
|
||||
EXPECT_THAT(finalTransform, IsClose(transformToInterpolateTo));
|
||||
EXPECT_THAT(currentReferenceFrame, IsClose(AZ::Transform::CreateIdentity()));
|
||||
}
|
||||
|
||||
TEST_F(EditorCameraFixture, BeginningCameraInterpolationReturnsTrue)
|
||||
{
|
||||
// Given/When
|
||||
bool interpolationBegan = false;
|
||||
AtomToolsFramework::ModularViewportCameraControllerRequestBus::EventResult(
|
||||
interpolationBegan, TestViewportId,
|
||||
&AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::InterpolateToTransform,
|
||||
AZ::Transform::CreateTranslation(AZ::Vector3(10.0f, 10.0f, 10.0f)));
|
||||
|
||||
// Then
|
||||
EXPECT_THAT(interpolationBegan, ::testing::IsTrue());
|
||||
}
|
||||
|
||||
TEST_F(EditorCameraFixture, CameraInterpolationDoesNotBeginDuringAnExistingInterpolation)
|
||||
{
|
||||
// Given/When
|
||||
bool initialInterpolationBegan = false;
|
||||
AtomToolsFramework::ModularViewportCameraControllerRequestBus::EventResult(
|
||||
initialInterpolationBegan, TestViewportId,
|
||||
&AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::InterpolateToTransform,
|
||||
AZ::Transform::CreateTranslation(AZ::Vector3(10.0f, 10.0f, 10.0f)));
|
||||
|
||||
m_controllerList->UpdateViewport(
|
||||
{ TestViewportId, AzFramework::FloatSeconds(HalfInterpolateToTransformDuration), AZ::ScriptTimePoint() });
|
||||
|
||||
bool nextInterpolationBegan = true;
|
||||
AtomToolsFramework::ModularViewportCameraControllerRequestBus::EventResult(
|
||||
nextInterpolationBegan, TestViewportId,
|
||||
&AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::InterpolateToTransform,
|
||||
AZ::Transform::CreateTranslation(AZ::Vector3(10.0f, 10.0f, 10.0f)));
|
||||
|
||||
bool interpolating = false;
|
||||
AtomToolsFramework::ModularViewportCameraControllerRequestBus::EventResult(
|
||||
interpolating, TestViewportId, &AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::IsInterpolating);
|
||||
|
||||
// Then
|
||||
EXPECT_THAT(initialInterpolationBegan, ::testing::IsTrue());
|
||||
EXPECT_THAT(nextInterpolationBegan, ::testing::IsFalse());
|
||||
EXPECT_THAT(interpolating, ::testing::IsTrue());
|
||||
}
|
||||
|
||||
TEST_F(EditorCameraFixture, CameraInterpolationCanBeginAfterAnInterpolationCompletes)
|
||||
{
|
||||
// Given/When
|
||||
bool initialInterpolationBegan = false;
|
||||
AtomToolsFramework::ModularViewportCameraControllerRequestBus::EventResult(
|
||||
initialInterpolationBegan, TestViewportId,
|
||||
&AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::InterpolateToTransform,
|
||||
AZ::Transform::CreateTranslation(AZ::Vector3(10.0f, 10.0f, 10.0f)));
|
||||
|
||||
m_controllerList->UpdateViewport(
|
||||
{ TestViewportId,
|
||||
AzFramework::FloatSeconds(AtomToolsFramework::ModularViewportCameraControllerRequests::InterpolateToTransformDuration + 0.5f),
|
||||
AZ::ScriptTimePoint() });
|
||||
|
||||
bool interpolating = true;
|
||||
AtomToolsFramework::ModularViewportCameraControllerRequestBus::EventResult(
|
||||
interpolating, TestViewportId, &AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::IsInterpolating);
|
||||
|
||||
bool nextInterpolationBegan = false;
|
||||
AtomToolsFramework::ModularViewportCameraControllerRequestBus::EventResult(
|
||||
nextInterpolationBegan, TestViewportId,
|
||||
&AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::InterpolateToTransform,
|
||||
AZ::Transform::CreateTranslation(AZ::Vector3(10.0f, 10.0f, 10.0f)));
|
||||
|
||||
// Then
|
||||
EXPECT_THAT(initialInterpolationBegan, ::testing::IsTrue());
|
||||
EXPECT_THAT(interpolating, ::testing::IsFalse());
|
||||
EXPECT_THAT(nextInterpolationBegan, ::testing::IsTrue());
|
||||
}
|
||||
} // namespace UnitTest
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace UnitTest
|
||||
class ModularViewportCameraControllerFixture : public AllocatorsTestFixture
|
||||
{
|
||||
public:
|
||||
static const AzFramework::ViewportId TestViewportId;
|
||||
static inline constexpr AzFramework::ViewportId TestViewportId = 1234;
|
||||
|
||||
void SetUp() override
|
||||
{
|
||||
@@ -146,6 +146,17 @@ namespace UnitTest
|
||||
controller->SetCameraPropsBuilderCallback(
|
||||
[](AzFramework::CameraProps& cameraProps)
|
||||
{
|
||||
// note: rotateSmoothness is also used for roll (not related to camera input directly)
|
||||
cameraProps.m_rotateSmoothnessFn = []
|
||||
{
|
||||
return 5.0f;
|
||||
};
|
||||
|
||||
cameraProps.m_translateSmoothnessFn = []
|
||||
{
|
||||
return 5.0f;
|
||||
};
|
||||
|
||||
cameraProps.m_rotateSmoothingEnabledFn = []
|
||||
{
|
||||
return false;
|
||||
@@ -209,8 +220,6 @@ namespace UnitTest
|
||||
AZStd::unique_ptr<SandboxEditor::EditorModularViewportCameraComposer> m_editorModularViewportCameraComposer;
|
||||
};
|
||||
|
||||
const AzFramework::ViewportId ModularViewportCameraControllerFixture::TestViewportId = AzFramework::ViewportId(0);
|
||||
|
||||
TEST_F(ModularViewportCameraControllerFixture, MouseMovementDoesNotAccumulateExcessiveDriftInModularViewportCameraWithVaryingDeltaTime)
|
||||
{
|
||||
SandboxEditor::SetCameraCaptureCursorForLook(false);
|
||||
@@ -380,6 +389,7 @@ namespace UnitTest
|
||||
m_controllerList->UpdateViewport({ TestViewportId, AzFramework::FloatSeconds(deltaTime), AZ::ScriptTimePoint() });
|
||||
|
||||
QTest::mouseRelease(m_rootWidget.get(), Qt::MouseButton::RightButton, Qt::NoModifier, start + mouseDelta);
|
||||
m_controllerList->UpdateViewport({ TestViewportId, AzFramework::FloatSeconds(deltaTime), AZ::ScriptTimePoint() });
|
||||
|
||||
// update the position of the widget
|
||||
const auto offset = QPoint(500, 500);
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <AzToolsFramework/UnitTest/AzToolsFrameworkTestHelpers.h>
|
||||
#include <AzToolsFramework/ViewportSelection/EditorInteractionSystemViewportSelectionRequestBus.h>
|
||||
#include <Editor/ViewportManipulatorController.h>
|
||||
#include <Mocks/MockWindowRequests.h>
|
||||
|
||||
namespace UnitTest
|
||||
{
|
||||
@@ -77,14 +78,15 @@ namespace UnitTest
|
||||
class ViewportManipulatorControllerFixture : public AllocatorsTestFixture
|
||||
{
|
||||
public:
|
||||
static const AzFramework::ViewportId TestViewportId;
|
||||
static inline constexpr AzFramework::ViewportId TestViewportId = 1234;
|
||||
static inline const QSize WidgetSize = QSize(1920, 1080);
|
||||
|
||||
void SetUp() override
|
||||
{
|
||||
AllocatorsTestFixture::SetUp();
|
||||
|
||||
m_rootWidget = AZStd::make_unique<QWidget>();
|
||||
m_rootWidget->setFixedSize(QSize(100, 100));
|
||||
m_rootWidget->setFixedSize(WidgetSize);
|
||||
QApplication::setActiveWindow(m_rootWidget.get());
|
||||
|
||||
m_controllerList = AZStd::make_shared<AzFramework::ViewportControllerList>();
|
||||
@@ -111,8 +113,6 @@ namespace UnitTest
|
||||
AZStd::unique_ptr<AzToolsFramework::QtEventToAzInputMapper> m_inputChannelMapper;
|
||||
};
|
||||
|
||||
const AzFramework::ViewportId ViewportManipulatorControllerFixture::TestViewportId = AzFramework::ViewportId(0);
|
||||
|
||||
TEST_F(ViewportManipulatorControllerFixture, AnEventIsNotPropagatedToTheViewportWhenAManipulatorHandlesItFirst)
|
||||
{
|
||||
// forward input events to our controller list
|
||||
@@ -227,4 +227,74 @@ namespace UnitTest
|
||||
// the key was released (cleared)
|
||||
EXPECT_TRUE(endedEvent);
|
||||
}
|
||||
|
||||
TEST_F(ViewportManipulatorControllerFixture, DoubleClickIsNotRegisteredIfMouseDeltaHasMovedMoreThanDeadzoneInClickInterval)
|
||||
{
|
||||
AzFramework::NativeWindowHandle nativeWindowHandle = nullptr;
|
||||
|
||||
// forward input events to our controller list
|
||||
QObject::connect(
|
||||
m_inputChannelMapper.get(), &AzToolsFramework::QtEventToAzInputMapper::InputChannelUpdated, m_rootWidget.get(),
|
||||
[this, nativeWindowHandle](const AzFramework::InputChannel* inputChannel, [[maybe_unused]] QEvent* event)
|
||||
{
|
||||
m_controllerList->HandleInputChannelEvent(
|
||||
AzFramework::ViewportControllerInputEvent{ TestViewportId, nativeWindowHandle, *inputChannel });
|
||||
});
|
||||
|
||||
::testing::NiceMock<MockWindowRequests> mockWindowRequests;
|
||||
mockWindowRequests.Connect(nativeWindowHandle);
|
||||
|
||||
using ::testing::Return;
|
||||
// note: WindowRequests is used internally by ViewportManipulatorController
|
||||
ON_CALL(mockWindowRequests, GetClientAreaSize())
|
||||
.WillByDefault(Return(AzFramework::WindowSize(WidgetSize.width(), WidgetSize.height())));
|
||||
|
||||
EditorInteractionViewportSelectionFake editorInteractionViewportFake;
|
||||
editorInteractionViewportFake.m_internalHandleMouseManipulatorInteraction = [](const MouseInteractionEvent&)
|
||||
{
|
||||
// report the event was not handled (manipulator was not interacted with)
|
||||
return false;
|
||||
};
|
||||
|
||||
bool doubleClickDetected = false;
|
||||
editorInteractionViewportFake.m_internalHandleMouseViewportInteraction =
|
||||
[&doubleClickDetected](const MouseInteractionEvent& mouseInteractionEvent)
|
||||
{
|
||||
// ensure no double click event is detected with the given inputs below
|
||||
if (mouseInteractionEvent.m_mouseEvent == AzToolsFramework::ViewportInteraction::MouseEvent::DoubleClick)
|
||||
{
|
||||
doubleClickDetected = true;
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
editorInteractionViewportFake.Connect();
|
||||
|
||||
m_controllerList->Add(AZStd::make_shared<SandboxEditor::ViewportManipulatorController>());
|
||||
|
||||
// simulate a click, move, click
|
||||
MouseMove(m_rootWidget.get(), QPoint(0, 0), QPoint(10, 10));
|
||||
MousePressAndMove(m_rootWidget.get(), QPoint(10, 10), QPoint(0, 0), Qt::MouseButton::LeftButton);
|
||||
QTest::mouseRelease(m_rootWidget.get(), Qt::MouseButton::LeftButton, Qt::KeyboardModifier::NoModifier, QPoint(10, 10));
|
||||
MouseMove(m_rootWidget.get(), QPoint(10, 10), QPoint(20, 20));
|
||||
MousePressAndMove(m_rootWidget.get(), QPoint(20, 20), QPoint(0, 0), Qt::MouseButton::LeftButton);
|
||||
QTest::mouseRelease(m_rootWidget.get(), Qt::MouseButton::LeftButton, Qt::KeyboardModifier::NoModifier, QPoint(20, 20));
|
||||
|
||||
// ensure no double click was detected
|
||||
EXPECT_FALSE(doubleClickDetected);
|
||||
|
||||
// simulate double click (sanity check it still is detected correctly with no movement)
|
||||
MouseMove(m_rootWidget.get(), QPoint(0, 0), QPoint(10, 10));
|
||||
MousePressAndMove(m_rootWidget.get(), QPoint(10, 10), QPoint(0, 0), Qt::MouseButton::LeftButton);
|
||||
QTest::mouseRelease(m_rootWidget.get(), Qt::MouseButton::LeftButton, Qt::KeyboardModifier::NoModifier, QPoint(10, 10));
|
||||
MousePressAndMove(m_rootWidget.get(), QPoint(10, 10), QPoint(0, 0), Qt::MouseButton::LeftButton);
|
||||
QTest::mouseRelease(m_rootWidget.get(), Qt::MouseButton::LeftButton, Qt::KeyboardModifier::NoModifier, QPoint(10, 10));
|
||||
|
||||
// ensure a double click was detected
|
||||
EXPECT_TRUE(doubleClickDetected);
|
||||
|
||||
mockWindowRequests.Disconnect();
|
||||
editorInteractionViewportFake.Disconnect();
|
||||
}
|
||||
} // namespace UnitTest
|
||||
|
||||
+17
-31
@@ -519,7 +519,7 @@ MainWindow* MainWindow::instance()
|
||||
|
||||
void MainWindow::closeEvent(QCloseEvent* event)
|
||||
{
|
||||
gSettings.Save();
|
||||
gSettings.Save(true);
|
||||
|
||||
AzFramework::SystemCursorState currentCursorState;
|
||||
bool isInGameMode = false;
|
||||
@@ -708,14 +708,10 @@ void MainWindow::InitActions()
|
||||
.SetShortcut(QKeySequence::Undo)
|
||||
.SetReserved()
|
||||
.SetStatusTip(tr("Undo last operation"))
|
||||
//.SetMenu(new QMenu("FIXME"))
|
||||
.SetApplyHoverEffect()
|
||||
.RegisterUpdateCallback(cryEdit, &CCryEditApp::OnUpdateUndo);
|
||||
am->AddAction(ID_REDO, tr("&Redo"))
|
||||
.SetShortcut(AzQtComponents::RedoKeySequence)
|
||||
.SetReserved()
|
||||
//.SetMenu(new QMenu("FIXME"))
|
||||
.SetApplyHoverEffect()
|
||||
.SetStatusTip(tr("Redo last undo operation"))
|
||||
.RegisterUpdateCallback(cryEdit, &CCryEditApp::OnUpdateRedo);
|
||||
|
||||
@@ -731,7 +727,6 @@ void MainWindow::InitActions()
|
||||
// Modify actions
|
||||
am->AddAction(AzToolsFramework::EditModeMove, tr("Move"))
|
||||
.SetIcon(Style::icon("Move"))
|
||||
.SetApplyHoverEffect()
|
||||
.SetShortcut(tr("1"))
|
||||
.SetToolTip(tr("Move (1)"))
|
||||
.SetCheckable(true)
|
||||
@@ -757,7 +752,6 @@ void MainWindow::InitActions()
|
||||
});
|
||||
am->AddAction(AzToolsFramework::EditModeRotate, tr("Rotate"))
|
||||
.SetIcon(Style::icon("Translate"))
|
||||
.SetApplyHoverEffect()
|
||||
.SetShortcut(tr("2"))
|
||||
.SetToolTip(tr("Rotate (2)"))
|
||||
.SetCheckable(true)
|
||||
@@ -783,7 +777,6 @@ void MainWindow::InitActions()
|
||||
});
|
||||
am->AddAction(AzToolsFramework::EditModeScale, tr("Scale"))
|
||||
.SetIcon(Style::icon("Scale"))
|
||||
.SetApplyHoverEffect()
|
||||
.SetShortcut(tr("3"))
|
||||
.SetToolTip(tr("Scale (3)"))
|
||||
.SetCheckable(true)
|
||||
@@ -808,7 +801,6 @@ void MainWindow::InitActions()
|
||||
|
||||
am->AddAction(AzToolsFramework::SnapToGrid, tr("Snap to grid"))
|
||||
.SetIcon(Style::icon("Grid"))
|
||||
.SetApplyHoverEffect()
|
||||
.SetShortcut(tr("G"))
|
||||
.SetToolTip(tr("Snap to grid (G)"))
|
||||
.SetStatusTip(tr("Toggles snap to grid"))
|
||||
@@ -821,7 +813,6 @@ void MainWindow::InitActions()
|
||||
|
||||
am->AddAction(AzToolsFramework::SnapAngle, tr("Snap angle"))
|
||||
.SetIcon(Style::icon("Angle"))
|
||||
.SetApplyHoverEffect()
|
||||
.SetStatusTip(tr("Snap angle"))
|
||||
.SetCheckable(true)
|
||||
.RegisterUpdateCallback([](QAction* action) {
|
||||
@@ -939,29 +930,28 @@ void MainWindow::InitActions()
|
||||
.Connect(&QAction::triggered, this, &MainWindow::OnRefreshAudioSystem);
|
||||
|
||||
// Game actions
|
||||
am->AddAction(ID_VIEW_SWITCHTOGAME, tr("Play &Game"))
|
||||
am->AddAction(ID_VIEW_SWITCHTOGAME, tr("Play Game"))
|
||||
.SetIcon(QIcon(":/stylesheet/img/UI20/toolbar/Play.svg"))
|
||||
.SetToolTip(tr("Play Game"))
|
||||
.SetStatusTip(tr("Activate the game input mode"))
|
||||
.SetCheckable(true)
|
||||
.RegisterUpdateCallback(cryEdit, &CCryEditApp::OnUpdatePlayGame);
|
||||
am->AddAction(ID_VIEW_SWITCHTOGAME_VIEWPORT, tr("Play Game"))
|
||||
.SetShortcut(tr("Ctrl+G"))
|
||||
.SetToolTip(tr("Play Game (Ctrl+G)"))
|
||||
.SetStatusTip(tr("Activate the game input mode"))
|
||||
.SetApplyHoverEffect()
|
||||
.SetCheckable(true)
|
||||
.RegisterUpdateCallback(cryEdit, &CCryEditApp::OnUpdatePlayGame);
|
||||
am->AddAction(ID_VIEW_SWITCHTOGAME_FULLSCREEN, tr("Play &Game (Maximized)"))
|
||||
am->AddAction(ID_VIEW_SWITCHTOGAME_FULLSCREEN, tr("Play Game (Maximized)"))
|
||||
.SetShortcut(tr("Ctrl+Shift+G"))
|
||||
.SetStatusTip(tr("Activate the game input mode (maximized)"))
|
||||
.SetIcon(Style::icon("Play"))
|
||||
.SetApplyHoverEffect()
|
||||
.SetCheckable(true);
|
||||
.RegisterUpdateCallback(cryEdit, &CCryEditApp::OnUpdatePlayGame);
|
||||
am->AddAction(ID_TOOLBAR_WIDGET_PLAYCONSOLE_LABEL, tr("Play Controls"))
|
||||
.SetText(tr("Play Controls"));
|
||||
am->AddAction(ID_SWITCH_PHYSICS, tr("Simulate"))
|
||||
.SetIcon(QIcon(":/stylesheet/img/UI20/toolbar/Simulate_Physics.svg"))
|
||||
.SetShortcut(tr("Ctrl+P"))
|
||||
.SetToolTip(tr("Simulate (Ctrl+P)"))
|
||||
.SetCheckable(true)
|
||||
.SetStatusTip(tr("Enable processing of Physics and AI."))
|
||||
.SetApplyHoverEffect()
|
||||
.SetCheckable(true)
|
||||
.RegisterUpdateCallback(cryEdit, &CCryEditApp::OnSwitchPhysicsUpdate);
|
||||
am->AddAction(ID_GAME_SYNCPLAYER, tr("Move Player and Camera Separately")).SetCheckable(true)
|
||||
@@ -1051,8 +1041,7 @@ void MainWindow::InitActions()
|
||||
|
||||
// Editors Toolbar actions
|
||||
am->AddAction(ID_OPEN_ASSET_BROWSER, tr("Asset browser"))
|
||||
.SetToolTip(tr("Open Asset Browser"))
|
||||
.SetApplyHoverEffect();
|
||||
.SetToolTip(tr("Open Asset Browser"));
|
||||
|
||||
AZ::EBusReduceResult<bool, AZStd::logical_or<bool>> emfxEnabled(false);
|
||||
using AnimationRequestBus = AzToolsFramework::EditorAnimationSystemRequestsBus;
|
||||
@@ -1062,8 +1051,7 @@ void MainWindow::InitActions()
|
||||
{
|
||||
QAction* action = am->AddAction(ID_OPEN_EMOTIONFX_EDITOR, tr("Animation Editor"))
|
||||
.SetToolTip(tr("Open Animation Editor"))
|
||||
.SetIcon(QIcon(":/EMotionFX/EMFX_icon_32x32.png"))
|
||||
.SetApplyHoverEffect();
|
||||
.SetIcon(QIcon(":/EMotionFX/EMFX_icon_32x32.png"));
|
||||
QObject::connect(action, &QAction::triggered, this, []() {
|
||||
QtViewPaneManager::instance()->OpenPane(LyViewPane::AnimationEditor);
|
||||
});
|
||||
@@ -1071,12 +1059,10 @@ void MainWindow::InitActions()
|
||||
|
||||
am->AddAction(ID_OPEN_AUDIO_CONTROLS_BROWSER, tr("Audio Controls Editor"))
|
||||
.SetToolTip(tr("Open Audio Controls Editor"))
|
||||
.SetIcon(Style::icon("Audio"))
|
||||
.SetApplyHoverEffect();
|
||||
.SetIcon(Style::icon("Audio"));
|
||||
|
||||
am->AddAction(ID_OPEN_UICANVASEDITOR, tr(LyViewPane::UiEditor))
|
||||
.SetToolTip(tr("Open UI Editor"))
|
||||
.SetApplyHoverEffect();
|
||||
.SetToolTip(tr("Open UI Editor"));
|
||||
|
||||
// Edit Mode Toolbar Actions
|
||||
am->AddAction(IDC_SELECTION_MASK, tr("Selected Object Types"));
|
||||
@@ -1089,12 +1075,10 @@ void MainWindow::InitActions()
|
||||
// Object Toolbar Actions
|
||||
am->AddAction(ID_GOTO_SELECTED, tr("Go to selected object"))
|
||||
.SetIcon(Style::icon("select_object"))
|
||||
.SetApplyHoverEffect()
|
||||
.Connect(&QAction::triggered, this, &MainWindow::OnGotoSelected);
|
||||
|
||||
// Misc Toolbar Actions
|
||||
am->AddAction(ID_OPEN_SUBSTANCE_EDITOR, tr("Open Substance Editor"))
|
||||
.SetApplyHoverEffect();
|
||||
am->AddAction(ID_OPEN_SUBSTANCE_EDITOR, tr("Open Substance Editor"));
|
||||
}
|
||||
|
||||
void MainWindow::InitToolActionHandlers()
|
||||
@@ -1266,7 +1250,9 @@ void MainWindow::OnGameModeChanged(bool inGameMode)
|
||||
// block signals on the switch to game actions before setting the checked state, as
|
||||
// setting the checked state triggers the action, which will re-enter this function
|
||||
// and result in an infinite loop
|
||||
AZStd::vector<QAction*> actions = { m_actionManager->GetAction(ID_VIEW_SWITCHTOGAME), m_actionManager->GetAction(ID_VIEW_SWITCHTOGAME_FULLSCREEN) };
|
||||
AZStd::vector<QAction*> actions = { m_actionManager->GetAction(ID_VIEW_SWITCHTOGAME_VIEWPORT),
|
||||
m_actionManager->GetAction(ID_VIEW_SWITCHTOGAME_FULLSCREEN),
|
||||
m_actionManager->GetAction(ID_VIEW_SWITCHTOGAME)};
|
||||
for (auto action : actions)
|
||||
{
|
||||
action->blockSignals(true);
|
||||
|
||||
@@ -1649,7 +1649,7 @@ QString CBaseObject::GetTypeName() const
|
||||
}
|
||||
|
||||
QString name;
|
||||
name.append(className.mid(0, className.length() - subClassName.length()));
|
||||
name.append(className.midRef(0, className.length() - subClassName.length()));
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
@@ -592,11 +592,11 @@ void CEntityObject::AdjustLightProperties(CVarBlockPtr& properties, const char*
|
||||
if (IVariable* pCastShadowVarLegacy = FindVariableInSubBlock(properties, pSubBlockVar, "bCastShadow"))
|
||||
{
|
||||
pCastShadowVarLegacy->SetFlags(pCastShadowVarLegacy->GetFlags() | IVariable::UI_INVISIBLE);
|
||||
|
||||
if (pCastShadowVarLegacy->GetDisplayValue()[0] != '0')
|
||||
const QString zeroPrefix("0");
|
||||
if (!pCastShadowVarLegacy->GetDisplayValue().startsWith(zeroPrefix))
|
||||
{
|
||||
bCastShadowLegacy = true;
|
||||
pCastShadowVarLegacy->SetDisplayValue("0");
|
||||
pCastShadowVarLegacy->SetDisplayValue(zeroPrefix);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -828,7 +828,7 @@ void CObjectManager::ShowLastHiddenObject()
|
||||
{
|
||||
uint64 mostRecentID = CBaseObject::s_invalidHiddenID;
|
||||
CBaseObject* mostRecentObject = nullptr;
|
||||
for (auto it : m_objects)
|
||||
for (const auto& it : m_objects)
|
||||
{
|
||||
CBaseObject* obj = it.second;
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#include <AzCore/Component/ComponentApplicationBus.h>
|
||||
#include <AzCore/Component/Entity.h>
|
||||
#include <AzCore/Component/TransformBus.h>
|
||||
#include <AzCore/Console/IConsole.h>
|
||||
#include <AzCore/Debug/Profiler.h>
|
||||
#include <AzCore/Math/Transform.h>
|
||||
#include <AzCore/RTTI/AttributeReader.h>
|
||||
@@ -57,6 +56,7 @@
|
||||
#include <AzToolsFramework/UI/PropertyEditor/EntityPropertyEditor.hxx>
|
||||
#include <AzToolsFramework/UI/Layer/NameConflictWarning.hxx>
|
||||
#include <AzToolsFramework/ViewportSelection/EditorHelpers.h>
|
||||
#include <AzToolsFramework/ViewportSelection/EditorSelectionUtil.h>
|
||||
#include <MathConversion.h>
|
||||
|
||||
#include <Atom/RPI.Public/ViewportContext.h>
|
||||
@@ -1394,13 +1394,13 @@ void SandboxIntegrationManager::ContextMenu_NewEntity()
|
||||
{
|
||||
AZ::Vector3 worldPosition = AZ::Vector3::CreateZero();
|
||||
|
||||
CViewport* view = GetIEditor()->GetViewManager()->GetGameViewport();
|
||||
// If we don't have a viewport active to aid in placement, the object
|
||||
// will be created at the origin.
|
||||
if (view)
|
||||
if (CViewport* view = GetIEditor()->GetViewManager()->GetGameViewport())
|
||||
{
|
||||
const QPoint viewPoint(static_cast<int>(m_contextMenuViewPoint.GetX()), static_cast<int>(m_contextMenuViewPoint.GetY()));
|
||||
worldPosition = view->GetHitLocation(viewPoint);
|
||||
worldPosition = AzToolsFramework::FindClosestPickIntersection(
|
||||
view->GetViewportId(), AzFramework::ScreenPointFromVector2(m_contextMenuViewPoint), AzToolsFramework::EditorPickRayLength,
|
||||
GetDefaultEntityPlacementDistance());
|
||||
}
|
||||
|
||||
CreateNewEntityAtPosition(worldPosition);
|
||||
@@ -1675,6 +1675,12 @@ void SandboxIntegrationManager::GoToEntitiesInViewports(const AzToolsFramework::
|
||||
if (auto viewportContext = viewportContextManager->GetViewportContextById(viewIndex))
|
||||
{
|
||||
const AZ::Transform cameraTransform = viewportContext->GetCameraTransform();
|
||||
// do not attempt to interpolate to where we currently are
|
||||
if (cameraTransform.GetTranslation().IsClose(center))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
const AZ::Vector3 forward = (center - cameraTransform.GetTranslation()).GetNormalized();
|
||||
|
||||
// move camera 25% further back than required
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
#include <LmbrCentral/Rendering/LensFlareAsset.h>
|
||||
#include <LmbrCentral/Rendering/MeshAsset.h>
|
||||
#include <LmbrCentral/Rendering/MaterialAsset.h>
|
||||
|
||||
#include <AzCore/Memory/Memory.h>
|
||||
#include <AzCore/RTTI/TypeInfo.h>
|
||||
@@ -136,14 +135,6 @@ AssetCatalogModel::AssetCatalogModel(QObject* parent)
|
||||
}
|
||||
}
|
||||
|
||||
// Special cases for SimpleAssets. If these get full-fledged AssetData types, these cases can be removed.
|
||||
QString textureExtensions = LmbrCentral::TextureAsset::GetFileFilter();
|
||||
m_extensionToAssetType.insert(AZStd::make_pair(textureExtensions.replace("*", "").replace(" ", "").toStdString().c_str(), AZStd::vector<AZ::Uuid> { AZ::AzTypeInfo<LmbrCentral::TextureAsset>::Uuid() }));
|
||||
QString materialExtensions = LmbrCentral::MaterialAsset::GetFileFilter();
|
||||
m_extensionToAssetType.insert(AZStd::make_pair(materialExtensions.replace("*", "").replace(" ", "").toStdString().c_str(), AZStd::vector<AZ::Uuid> { AZ::AzTypeInfo<LmbrCentral::MaterialAsset>::Uuid() }));
|
||||
QString dccMaterialExtensions = LmbrCentral::DccMaterialAsset::GetFileFilter();
|
||||
m_extensionToAssetType.insert(AZStd::make_pair(dccMaterialExtensions.replace("*", "").replace(" ", "").toStdString().c_str(), AZStd::vector<AZ::Uuid> { AZ::AzTypeInfo<LmbrCentral::DccMaterialAsset>::Uuid() }));
|
||||
|
||||
AZ::SerializeContext* serializeContext = nullptr;
|
||||
EBUS_EVENT_RESULT(serializeContext, AZ::ComponentApplicationBus, GetSerializeContext);
|
||||
AZ_Assert(serializeContext, "Failed to acquire application serialize context.");
|
||||
|
||||
@@ -2640,7 +2640,7 @@ QSize OutlinerItemDelegate::sizeHint(const QStyleOptionViewItem& option, const Q
|
||||
m_cachedBoundingRectOfTallCharacter = QRect();
|
||||
};
|
||||
|
||||
QTimer::singleShot(0, resetFunction);
|
||||
QTimer::singleShot(0, this, resetFunction);
|
||||
}
|
||||
|
||||
// And add 8 to it gives the outliner roughly the visible spacing we're looking for.
|
||||
|
||||
@@ -121,6 +121,18 @@ namespace
|
||||
SortEntityChildrenRecursively(childId, comparer);
|
||||
}
|
||||
}
|
||||
|
||||
QModelIndex nextIndexForTree(bool direction, OutlinerTreeView *tree, QModelIndex current)
|
||||
{
|
||||
if (direction)
|
||||
{
|
||||
return tree->indexAbove(current);
|
||||
}
|
||||
else
|
||||
{
|
||||
return tree->indexBelow(current);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
OutlinerWidget::OutlinerWidget(QWidget* pParent, Qt::WindowFlags flags)
|
||||
@@ -891,9 +903,7 @@ void OutlinerWidget::DoSelectSliceRootNextToSelection(bool isTraversalUpwards)
|
||||
return;
|
||||
}
|
||||
|
||||
AZStd::function<QModelIndex(QModelIndex)> getNextIdxFunction =
|
||||
AZStd::bind(isTraversalUpwards ? &QTreeView::indexAbove : &QTreeView::indexBelow, treeView, AZStd::placeholders::_1);
|
||||
QModelIndex nextIdx = getNextIdxFunction(currentIdx);
|
||||
QModelIndex nextIdx = nextIndexForTree(isTraversalUpwards,treeView,currentIdx);
|
||||
bool foundSliceRoot = false;
|
||||
|
||||
while (nextIdx.isValid() && !foundSliceRoot)
|
||||
@@ -904,7 +914,7 @@ void OutlinerWidget::DoSelectSliceRootNextToSelection(bool isTraversalUpwards)
|
||||
AzToolsFramework::ToolsApplicationRequestBus::BroadcastResult(
|
||||
foundSliceRoot, &AzToolsFramework::ToolsApplicationRequests::IsSliceRootEntity, currentEntityId);
|
||||
|
||||
nextIdx = getNextIdxFunction(currentIdx);
|
||||
nextIdx = nextIndexForTree(isTraversalUpwards, treeView, currentIdx);
|
||||
}
|
||||
|
||||
if (foundSliceRoot)
|
||||
@@ -934,13 +944,10 @@ void OutlinerWidget::DoSelectEdgeSliceRoot(bool shouldSelectTopMostSlice)
|
||||
}
|
||||
|
||||
QModelIndex currentIdx;
|
||||
AZStd::function<QModelIndex(QModelIndex)> getNextIdxFunction;
|
||||
|
||||
if (shouldSelectTopMostSlice)
|
||||
{
|
||||
currentIdx = itemModel->index(0, OutlinerListModel::ColumnName);
|
||||
|
||||
getNextIdxFunction =
|
||||
AZStd::bind(&QTreeView::indexBelow, treeView, AZStd::placeholders::_1);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -949,9 +956,6 @@ void OutlinerWidget::DoSelectEdgeSliceRoot(bool shouldSelectTopMostSlice)
|
||||
{
|
||||
currentIdx = itemModel->index(itemModel->rowCount(currentIdx) - 1, OutlinerListModel::ColumnName, currentIdx);
|
||||
}
|
||||
|
||||
getNextIdxFunction =
|
||||
AZStd::bind(&QTreeView::indexAbove, treeView, AZStd::placeholders::_1);
|
||||
}
|
||||
|
||||
QModelIndex nextIdx = currentIdx;
|
||||
@@ -964,7 +968,7 @@ void OutlinerWidget::DoSelectEdgeSliceRoot(bool shouldSelectTopMostSlice)
|
||||
|
||||
AzToolsFramework::ToolsApplicationRequestBus::BroadcastResult(
|
||||
foundSliceRoot, &AzToolsFramework::ToolsApplicationRequests::IsSliceRootEntity, currentEntityId);
|
||||
nextIdx = getNextIdxFunction(currentIdx);
|
||||
nextIdx = nextIndexForTree(shouldSelectTopMostSlice,treeView,currentIdx);
|
||||
} while (nextIdx.isValid() && !foundSliceRoot);
|
||||
|
||||
if (foundSliceRoot)
|
||||
@@ -1416,7 +1420,10 @@ void OutlinerWidget::SortContent()
|
||||
}
|
||||
m_entitiesToSort.clear();
|
||||
|
||||
auto comparer = AZStd::bind(&CompareEntitiesForSorting, AZStd::placeholders::_1, AZStd::placeholders::_2, m_sortMode);
|
||||
auto comparer = [sortMode = m_sortMode](AZ::EntityId left, AZ::EntityId right) -> bool
|
||||
{
|
||||
return CompareEntitiesForSorting(left, right, sortMode);
|
||||
};
|
||||
for (const AZ::EntityId& entityId : parentsToSort)
|
||||
{
|
||||
SortEntityChildren(entityId, comparer);
|
||||
@@ -1433,7 +1440,10 @@ void OutlinerWidget::OnSortModeChanged(EntityOutliner::DisplaySortMode sortMode)
|
||||
if (sortMode != EntityOutliner::DisplaySortMode::Manually)
|
||||
{
|
||||
AZ_PROFILE_FUNCTION(AzToolsFramework);
|
||||
auto comparer = AZStd::bind(&CompareEntitiesForSorting, AZStd::placeholders::_1, AZStd::placeholders::_2, sortMode);
|
||||
auto comparer = [sortMode = m_sortMode](AZ::EntityId left, AZ::EntityId right) -> bool
|
||||
{
|
||||
return CompareEntitiesForSorting(left, right, sortMode);
|
||||
};
|
||||
SortEntityChildrenRecursively(AZ::EntityId(), comparer);
|
||||
}
|
||||
|
||||
|
||||
@@ -104,6 +104,7 @@
|
||||
#define ID_FILE_EXPORTTOGAMENOSURFACETEXTURE 33473
|
||||
#define ID_VIEW_SWITCHTOGAME 33477
|
||||
#define ID_VIEW_SWITCHTOGAME_FULLSCREEN 33478
|
||||
#define ID_VIEW_SWITCHTOGAME_VIEWPORT 33479
|
||||
#define ID_MOVE_OBJECT 33481
|
||||
#define ID_RENAME_OBJ 33483
|
||||
#define ID_FETCH 33496
|
||||
|
||||
@@ -471,7 +471,7 @@ void SEditorSettings::LoadValue(const char* sSection, const char* sKey, ESystemC
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void SEditorSettings::Save()
|
||||
void SEditorSettings::Save(bool isEditorClosing)
|
||||
{
|
||||
QString strStringPlaceholder;
|
||||
|
||||
@@ -638,14 +638,16 @@ void SEditorSettings::Save()
|
||||
// --- Settings Registry values
|
||||
|
||||
// Prefab System UI
|
||||
AzFramework::ApplicationRequests::Bus::Broadcast(
|
||||
&AzFramework::ApplicationRequests::SetPrefabSystemEnabled, prefabSystem);
|
||||
AzFramework::ApplicationRequests::Bus::Broadcast(&AzFramework::ApplicationRequests::SetPrefabSystemEnabled, prefabSystem);
|
||||
|
||||
AzToolsFramework::Prefab::PrefabLoaderInterface* prefabLoaderInterface =
|
||||
AZ::Interface<AzToolsFramework::Prefab::PrefabLoaderInterface>::Get();
|
||||
prefabLoaderInterface->SetSaveAllPrefabsPreference(levelSaveSettings.saveAllPrefabsPreference);
|
||||
|
||||
SaveSettingsRegistryFile();
|
||||
if (!isEditorClosing)
|
||||
{
|
||||
SaveSettingsRegistryFile();
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -267,7 +267,7 @@ struct SANDBOX_API SEditorSettings
|
||||
AZ_POP_DISABLE_DLL_EXPORT_BASECLASS_WARNING
|
||||
SEditorSettings();
|
||||
~SEditorSettings() = default;
|
||||
void Save();
|
||||
void Save(bool isEditorClosing = false);
|
||||
void Load();
|
||||
void LoadCloudSettings();
|
||||
|
||||
|
||||
@@ -590,6 +590,16 @@ AmazonToolbar ToolbarManager::GetObjectToolbar() const
|
||||
return t;
|
||||
}
|
||||
|
||||
QMenu* ToolbarManager::CreatePlayButtonMenu() const
|
||||
{
|
||||
QMenu* playButtonMenu = new QMenu("Play Game");
|
||||
|
||||
playButtonMenu->addAction(m_actionManager->GetAction(ID_VIEW_SWITCHTOGAME_VIEWPORT));
|
||||
playButtonMenu->addAction(m_actionManager->GetAction(ID_VIEW_SWITCHTOGAME_FULLSCREEN));
|
||||
|
||||
return playButtonMenu;
|
||||
}
|
||||
|
||||
AmazonToolbar ToolbarManager::GetPlayConsoleToolbar() const
|
||||
{
|
||||
AmazonToolbar t = AmazonToolbar("PlayConsole", QObject::tr("Play Controls"));
|
||||
@@ -598,8 +608,17 @@ AmazonToolbar ToolbarManager::GetPlayConsoleToolbar() const
|
||||
t.AddAction(ID_TOOLBAR_WIDGET_SPACER_RIGHT, ORIGINAL_TOOLBAR_VERSION);
|
||||
t.AddAction(ID_TOOLBAR_SEPARATOR, ORIGINAL_TOOLBAR_VERSION);
|
||||
t.AddAction(ID_TOOLBAR_WIDGET_PLAYCONSOLE_LABEL, ORIGINAL_TOOLBAR_VERSION);
|
||||
t.AddAction(ID_VIEW_SWITCHTOGAME, TOOLBARS_WITH_PLAY_GAME);
|
||||
t.AddAction(ID_VIEW_SWITCHTOGAME_FULLSCREEN, TOOLBARS_WITH_PLAY_GAME);
|
||||
|
||||
QAction* playAction = m_actionManager->GetAction(ID_VIEW_SWITCHTOGAME);
|
||||
QToolButton* playButton = new QToolButton(t.Toolbar());
|
||||
|
||||
QMenu* menu = CreatePlayButtonMenu();
|
||||
menu->setParent(t.Toolbar());
|
||||
playAction->setMenu(menu);
|
||||
|
||||
playButton->setDefaultAction(playAction);
|
||||
t.AddWidget(playButton, ID_VIEW_SWITCHTOGAME, ORIGINAL_TOOLBAR_VERSION);
|
||||
|
||||
t.AddAction(ID_TOOLBAR_SEPARATOR, ORIGINAL_TOOLBAR_VERSION);
|
||||
t.AddAction(ID_SWITCH_PHYSICS, TOOLBARS_WITH_PLAY_GAME);
|
||||
return t;
|
||||
@@ -728,7 +747,14 @@ void AmazonToolbar::SetActionsOnInternalToolbar(ActionManager* actionManager)
|
||||
{
|
||||
if (actionManager->HasAction(actionId))
|
||||
{
|
||||
m_toolbar->addAction(actionManager->GetAction(actionId));
|
||||
if (actionData.widget != nullptr)
|
||||
{
|
||||
m_toolbar->addWidget(actionData.widget);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_toolbar->addAction(actionManager->GetAction(actionId));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1367,7 +1393,12 @@ void AmazonToolbar::InstantiateToolbar(QMainWindow* mainWindow, ToolbarManager*
|
||||
|
||||
void AmazonToolbar::AddAction(int actionId, int toolbarVersionAdded)
|
||||
{
|
||||
m_actions.push_back({ actionId, toolbarVersionAdded });
|
||||
AddWidget(nullptr, actionId, toolbarVersionAdded);
|
||||
}
|
||||
|
||||
void AmazonToolbar::AddWidget(QWidget* widget, int actionId, int toolbarVersionAdded)
|
||||
{
|
||||
m_actions.push_back({ actionId, toolbarVersionAdded, widget });
|
||||
}
|
||||
|
||||
void AmazonToolbar::Clear()
|
||||
|
||||
@@ -87,6 +87,7 @@ public:
|
||||
const QString& GetTranslatedName() const { return m_translatedName; }
|
||||
|
||||
void AddAction(int actionId, int toolbarVersionAdded = 0);
|
||||
void AddWidget(QWidget* widget, int actionId, int toolbarVersionAdded = 0);
|
||||
|
||||
QToolBar* Toolbar() const { return m_toolbar; }
|
||||
|
||||
@@ -117,6 +118,7 @@ private:
|
||||
{
|
||||
int actionId;
|
||||
int toolbarVersionAdded;
|
||||
QWidget* widget;
|
||||
|
||||
bool operator ==(const AmazonToolbar::ActionData& other) const
|
||||
{
|
||||
@@ -133,7 +135,9 @@ private:
|
||||
class AmazonToolBarExpanderWatcher;
|
||||
|
||||
class ToolbarManager
|
||||
: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit ToolbarManager(ActionManager* actionManager, MainWindow* mainWindow);
|
||||
~ToolbarManager();
|
||||
@@ -178,6 +182,8 @@ private:
|
||||
void UpdateAllowedAreas(QToolBar* toolbar);
|
||||
bool IsDirty(const AmazonToolbar& toolbar) const;
|
||||
|
||||
QMenu* CreatePlayButtonMenu() const;
|
||||
|
||||
const AmazonToolbar* FindDefaultToolbar(const QString& toolbarName) const;
|
||||
AmazonToolbar* FindToolbar(const QString& toolbarName);
|
||||
|
||||
|
||||
+26
-210
@@ -14,14 +14,19 @@
|
||||
// Qt
|
||||
#include <QPainter>
|
||||
|
||||
// AzCore
|
||||
#include <AzCore/Console/IConsole.h>
|
||||
|
||||
// AzQtComponents
|
||||
#include <AzQtComponents/DragAndDrop/ViewportDragAndDrop.h>
|
||||
|
||||
#include <AzToolsFramework/API/ComponentEntitySelectionBus.h>
|
||||
#include <AzToolsFramework/ViewportSelection/EditorSelectionUtil.h>
|
||||
#include <AzToolsFramework/Viewport/ViewportMessages.h>
|
||||
#include <AzToolsFramework/ViewportSelection/EditorSelectionUtil.h>
|
||||
|
||||
// Editor
|
||||
#include "Editor/Plugins/ComponentEntityEditorPlugin/SandboxIntegration.h"
|
||||
#include "ViewManager.h"
|
||||
#include "Include/ITransformManipulator.h"
|
||||
#include "Include/HitContext.h"
|
||||
@@ -32,22 +37,35 @@
|
||||
#include "GameEngine.h"
|
||||
#include "Settings.h"
|
||||
|
||||
|
||||
#ifdef LoadCursor
|
||||
#undef LoadCursor
|
||||
#endif
|
||||
|
||||
AZ_CVAR(
|
||||
float,
|
||||
ed_defaultEntityPlacementDistance,
|
||||
10.0f,
|
||||
nullptr,
|
||||
AZ::ConsoleFunctorFlags::Null,
|
||||
"The default distance to place an entity from the camera if no intersection is found");
|
||||
|
||||
float GetDefaultEntityPlacementDistance()
|
||||
{
|
||||
return ed_defaultEntityPlacementDistance;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Viewport drag and drop support
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
void QtViewport::BuildDragDropContext(AzQtComponents::ViewportDragContext& context, const QPoint& pt)
|
||||
void QtViewport::BuildDragDropContext(
|
||||
AzQtComponents::ViewportDragContext& context, const AzFramework::ViewportId viewportId, const QPoint& point)
|
||||
{
|
||||
context.m_hitLocation = AZ::Vector3::CreateZero();
|
||||
context.m_hitLocation = GetHitLocation(pt);
|
||||
context.m_hitLocation = AzToolsFramework::FindClosestPickIntersection(
|
||||
viewportId, AzToolsFramework::ViewportInteraction::ScreenPointFromQPoint(point), AzToolsFramework::EditorPickRayLength,
|
||||
GetDefaultEntityPlacementDistance());
|
||||
}
|
||||
|
||||
|
||||
void QtViewport::dragEnterEvent(QDragEnterEvent* event)
|
||||
{
|
||||
if (!GetIEditor()->GetGameEngine()->IsLevelLoaded())
|
||||
@@ -66,7 +84,7 @@ void QtViewport::dragEnterEvent(QDragEnterEvent* event)
|
||||
// new bus-based way of doing it (install a listener!)
|
||||
using namespace AzQtComponents;
|
||||
ViewportDragContext context;
|
||||
BuildDragDropContext(context, event->pos());
|
||||
BuildDragDropContext(context, GetViewportId(), event->pos());
|
||||
DragAndDropEventsBus::Event(DragAndDropContexts::EditorViewport, &DragAndDropEvents::DragEnter, event, context);
|
||||
}
|
||||
}
|
||||
@@ -89,7 +107,7 @@ void QtViewport::dragMoveEvent(QDragMoveEvent* event)
|
||||
// new bus-based way of doing it (install a listener!)
|
||||
using namespace AzQtComponents;
|
||||
ViewportDragContext context;
|
||||
BuildDragDropContext(context, event->pos());
|
||||
BuildDragDropContext(context, GetViewportId(), event->pos());
|
||||
DragAndDropEventsBus::Event(DragAndDropContexts::EditorViewport, &DragAndDropEvents::DragMove, event, context);
|
||||
}
|
||||
}
|
||||
@@ -112,7 +130,7 @@ void QtViewport::dropEvent(QDropEvent* event)
|
||||
{
|
||||
// new bus-based way of doing it (install a listener!)
|
||||
ViewportDragContext context;
|
||||
BuildDragDropContext(context, event->pos());
|
||||
BuildDragDropContext(context, GetViewportId(), event->pos());
|
||||
DragAndDropEventsBus::Event(DragAndDropContexts::EditorViewport, &DragAndDropEvents::Drop, event, context);
|
||||
}
|
||||
}
|
||||
@@ -340,13 +358,6 @@ void QtViewport::resizeEvent(QResizeEvent* event)
|
||||
Update();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void QtViewport::leaveEvent(QEvent* event)
|
||||
{
|
||||
QWidget::leaveEvent(event);
|
||||
MouseCallback(eMouseLeave, QPoint(), Qt::KeyboardModifiers(), Qt::MouseButtons());
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void QtViewport::paintEvent([[maybe_unused]] QPaintEvent* event)
|
||||
{
|
||||
@@ -581,63 +592,7 @@ void QtViewport::keyReleaseEvent(QKeyEvent* event)
|
||||
OnKeyUp(nativeKey, 1, event->nativeModifiers());
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void QtViewport::OnLButtonDown(Qt::KeyboardModifiers modifiers, const QPoint& point)
|
||||
{
|
||||
// Save the mouse down position
|
||||
m_cMouseDownPos = point;
|
||||
|
||||
if (MouseCallback(eMouseLDown, point, modifiers))
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void QtViewport::OnLButtonUp(Qt::KeyboardModifiers modifiers, const QPoint& point)
|
||||
{
|
||||
// Check Edit Tool.
|
||||
MouseCallback(eMouseLUp, point, modifiers);
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void QtViewport::OnRButtonDown(Qt::KeyboardModifiers modifiers, const QPoint& point)
|
||||
{
|
||||
MouseCallback(eMouseRDown, point, modifiers);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void QtViewport::OnRButtonUp(Qt::KeyboardModifiers modifiers, const QPoint& point)
|
||||
{
|
||||
MouseCallback(eMouseRUp, point, modifiers);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void QtViewport::OnMButtonDown(Qt::KeyboardModifiers modifiers, const QPoint& point)
|
||||
{
|
||||
// Check Edit Tool.
|
||||
MouseCallback(eMouseMDown, point, modifiers);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void QtViewport::OnMButtonUp(Qt::KeyboardModifiers modifiers, const QPoint& point)
|
||||
{
|
||||
// Move the viewer to the mouse location.
|
||||
// Check Edit Tool.
|
||||
MouseCallback(eMouseMUp, point, modifiers);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void QtViewport::OnMButtonDblClk(Qt::KeyboardModifiers modifiers, const QPoint& point)
|
||||
{
|
||||
MouseCallback(eMouseMDblClick, point, modifiers);
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void QtViewport::OnMouseMove(Qt::KeyboardModifiers modifiers, Qt::MouseButtons buttons, const QPoint& point)
|
||||
{
|
||||
MouseCallback(eMouseMove, point, modifiers, buttons);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void QtViewport::OnSetCursor()
|
||||
@@ -696,44 +651,6 @@ void QtViewport::OnDragSelectRectangle(const QRect& rect, bool bNormalizeRect)
|
||||
GetIEditor()->SetStatusText(szNewStatusText);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void QtViewport::OnLButtonDblClk(Qt::KeyboardModifiers modifiers, const QPoint& point)
|
||||
{
|
||||
if (GetIEditor()->IsInGameMode())
|
||||
{
|
||||
// Ignore double clicks while in game.
|
||||
return;
|
||||
}
|
||||
|
||||
MouseCallback(eMouseLDblClick, point, modifiers);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void QtViewport::OnRButtonDblClk(Qt::KeyboardModifiers modifiers, const QPoint& point)
|
||||
{
|
||||
MouseCallback(eMouseRDblClick, point, modifiers);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void QtViewport::OnKeyDown([[maybe_unused]] UINT nChar, [[maybe_unused]] UINT nRepCnt, [[maybe_unused]] UINT nFlags)
|
||||
{
|
||||
if (GetIEditor()->IsInGameMode())
|
||||
{
|
||||
// Ignore key downs while in game.
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void QtViewport::OnKeyUp([[maybe_unused]] UINT nChar, [[maybe_unused]] UINT nRepCnt, [[maybe_unused]] UINT nFlags)
|
||||
{
|
||||
if (GetIEditor()->IsInGameMode())
|
||||
{
|
||||
// Ignore key downs while in game.
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void QtViewport::SetCurrentCursor(const QCursor& hCursor, const QString& cursorString)
|
||||
{
|
||||
@@ -1119,29 +1036,6 @@ bool QtViewport::HitTest(const QPoint& point, HitContext& hitInfo)
|
||||
return false;
|
||||
}
|
||||
|
||||
AZ::Vector3 QtViewport::GetHitLocation(const QPoint& point)
|
||||
{
|
||||
Vec3 pos = Vec3(ZERO);
|
||||
HitContext hit;
|
||||
if (HitTest(point, hit))
|
||||
{
|
||||
pos = hit.raySrc + hit.rayDir * hit.dist;
|
||||
pos = SnapToGrid(pos);
|
||||
}
|
||||
else
|
||||
{
|
||||
bool hitTerrain;
|
||||
pos = ViewToWorld(point, &hitTerrain);
|
||||
if (hitTerrain)
|
||||
{
|
||||
pos.z = GetIEditor()->GetTerrainElevation(pos.x, pos.y);
|
||||
}
|
||||
pos = SnapToGrid(pos);
|
||||
}
|
||||
|
||||
return AZ::Vector3(pos.x, pos.y, pos.z);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void QtViewport::SetZoomFactor(float fZoomFactor)
|
||||
{
|
||||
@@ -1315,84 +1209,6 @@ bool QtViewport::GetAdvancedSelectModeFlag()
|
||||
return m_bAdvancedSelectMode;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
bool QtViewport::MouseCallback(EMouseEvent event, const QPoint& point, Qt::KeyboardModifiers modifiers, Qt::MouseButtons buttons)
|
||||
{
|
||||
AZ_PROFILE_FUNCTION(Editor);
|
||||
|
||||
// Ignore any mouse events in game mode.
|
||||
if (GetIEditor()->IsInGameMode())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// We must ignore mouse events when we are in the middle of an assert.
|
||||
// Reason: If we have an assert called from an engine module under the editor, if we call this function,
|
||||
// it may call the engine again and cause a deadlock.
|
||||
// Concrete example: CryPhysics called from Trackview causing an assert, and moving the cursor over the viewport
|
||||
// would cause the editor to freeze as it calls CryPhysics again for a raycast while it didn't release the lock.
|
||||
if (gEnv->pSystem->IsAssertDialogVisible())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Hit test gizmo objects.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
bool bAltClick = (modifiers & Qt::AltModifier);
|
||||
bool bCtrlClick = (modifiers & Qt::ControlModifier);
|
||||
bool bShiftClick = (modifiers & Qt::ShiftModifier);
|
||||
|
||||
int flags = (bCtrlClick ? MK_CONTROL : 0) |
|
||||
(bShiftClick ? MK_SHIFT : 0) |
|
||||
((buttons& Qt::LeftButton) ? MK_LBUTTON : 0) |
|
||||
((buttons& Qt::MiddleButton) ? MK_MBUTTON : 0) |
|
||||
((buttons& Qt::RightButton) ? MK_RBUTTON : 0);
|
||||
|
||||
switch (event)
|
||||
{
|
||||
case eMouseMove:
|
||||
|
||||
if (m_nLastUpdateFrame == m_nLastMouseMoveFrame)
|
||||
{
|
||||
// If mouse move event generated in the same frame, ignore it.
|
||||
return false;
|
||||
}
|
||||
m_nLastMouseMoveFrame = m_nLastUpdateFrame;
|
||||
|
||||
// Skip the marker position update if anything is selected, since it is only used
|
||||
// by the info bar which doesn't show the marker when there is an active selection.
|
||||
// This helps a performance issue when calling ViewToWorld (which calls RayWorldIntersection)
|
||||
// on every mouse movement becomes very expensive in scenes with large amounts of entities.
|
||||
CSelectionGroup* selection = GetIEditor()->GetSelection();
|
||||
if (!(buttons & Qt::RightButton) /* && m_nLastUpdateFrame != m_nLastMouseMoveFrame*/ && (selection && selection->IsEmpty()))
|
||||
{
|
||||
//m_nLastMouseMoveFrame = m_nLastUpdateFrame;
|
||||
Vec3 pos = ViewToWorld(point);
|
||||
GetIEditor()->SetMarkerPosition(pos);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
QPoint tempPoint(point.x(), point.y());
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Handle viewport manipulators.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
if (!bAltClick)
|
||||
{
|
||||
ITransformManipulator* pManipulator = GetIEditor()->GetTransformManipulator();
|
||||
if (pManipulator)
|
||||
{
|
||||
if (pManipulator->MouseCallback(this, event, tempPoint, flags))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void QtViewport::ProcessRenderLisneters(DisplayContext& rstDisplayContext)
|
||||
{
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user