diff --git a/.gitignore b/.gitignore index 1b63c7698a..c28f6ab123 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ __pycache__ AssetProcessorTemp/** [Bb]uild/** [Oo]ut/** +CMakeUserPresets.json [Cc]ache/ /install/ Editor/EditorEventLog.xml @@ -25,3 +26,4 @@ TestResults/** *.swatches /imgui.ini /scripts/project_manager/logs/ +/AutomatedTesting/Gem/PythonTests/scripting/TestResults diff --git a/Assets/CMakeLists.txt b/Assets/CMakeLists.txt new file mode 100644 index 0000000000..300e11ac3e --- /dev/null +++ b/Assets/CMakeLists.txt @@ -0,0 +1,9 @@ +# +# 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 +# +# + +ly_install_directory(DIRECTORIES .) diff --git a/Assets/Editor/Icons/Components/Viewport/Non Uniform Scale.svg b/Assets/Editor/Icons/Components/Viewport/NonUniformScale.svg similarity index 100% rename from Assets/Editor/Icons/Components/Viewport/Non Uniform Scale.svg rename to Assets/Editor/Icons/Components/Viewport/NonUniformScale.svg diff --git a/AutomatedTesting/AssetProcessorGamePlatformConfig.setreg b/AutomatedTesting/AssetProcessorGamePlatformConfig.setreg new file mode 100644 index 0000000000..5457b3f1ca --- /dev/null +++ b/AutomatedTesting/AssetProcessorGamePlatformConfig.setreg @@ -0,0 +1,19 @@ +{ + "Amazon": { + "AssetProcessor": { + "Settings": { + "RC cgf": { + "ignore": true + }, + "RC fbx": { + "ignore": true + }, + "ScanFolder AtomTestData": { + "watch": "@ENGINEROOT@/Gems/Atom/TestData", + "recursive": 1, + "order": 1000 + } + } + } + } +} diff --git a/AutomatedTesting/Gem/Code/CMakeLists.txt b/AutomatedTesting/Gem/Code/CMakeLists.txt index 76c0db3f5c..58ffd957d6 100644 --- a/AutomatedTesting/Gem/Code/CMakeLists.txt +++ b/AutomatedTesting/Gem/Code/CMakeLists.txt @@ -57,6 +57,12 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS) TARGETS Editor VARIANTS Tools) + # The Material Editor needs the Lyshine "Tools" gem variant for the custom LyShine pass + ly_enable_gems( + PROJECT_NAME AutomatedTesting GEMS LyShine + TARGETS MaterialEditor + VARIANTS Tools) + # The pipeline tools use "Builders" gem variants: ly_enable_gems( PROJECT_NAME AutomatedTesting GEM_FILE enabled_gems.cmake diff --git a/AutomatedTesting/Gem/PythonTests/AWS/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/AWS/CMakeLists.txt index 1c555c1e17..a589a395c1 100644 --- a/AutomatedTesting/Gem/PythonTests/AWS/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonTests/AWS/CMakeLists.txt @@ -12,6 +12,11 @@ ################################################################################ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) + # Only enable AWS automated tests on Windows + if(NOT "${PAL_PLATFORM_NAME}" STREQUAL "Windows") + return() + endif() + # Enable after installing NodeJS and CDK on jenkins Windows AMI. ly_add_pytest( NAME AutomatedTesting::AWSTests diff --git a/AutomatedTesting/Gem/PythonTests/AWS/README.md b/AutomatedTesting/Gem/PythonTests/AWS/README.md new file mode 100644 index 0000000000..8b5e65d6d7 --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/AWS/README.md @@ -0,0 +1,26 @@ +# AWS Gem Automation Tests + +## Prerequisites +1. Build the O3DE Editor and AutomatedTesting.GameLauncher in Profile. +2. AWS CLI is installed and configured following [Configuration and Credential File Settings](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html). +3. [AWS Cloud Development Kit (CDK)](https://docs.aws.amazon.com/cdk/latest/guide/getting_started.html#getting_started_install) is installed. + +## Deploy CDK Applications +1. Go to the AWS IAM console and create an IAM role called o3de-automation-tests which adds your own account as as a trusted entity and uses the "AdministratorAccess" permissions policy. +2. Copy {engine_root}\scripts\build\Platform\Windows\deploy_cdk_applications.cmd to your engine root folder. +3. Open a Command Prompt window at the engine root and set the following environment variables: + Set O3DE_AWS_PROJECT_NAME=AWSAUTO + Set O3DE_AWS_DEPLOY_REGION=us-east-1 + Set ASSUME_ROLE_ARN="arn:aws:iam::{your_aws_account_id}:role/o3de-automation-tests" + Set COMMIT_ID=HEAD +4. Deploy the CDK applications for AWS gems by running deploy_cdk_applications.cmd in the same Command Prompt window. +5. Edit AWS\common\constants.py to replace the assume role ARN with your own: + arn:aws:iam::{your_aws_account_id}:role/o3de-automation-tests + +## Run Automation Tests +### CLI +Open a Command Prompt window at the engine root and run the following CLI command: +python\python.cmd -m pytest {path_to_the_test_file} --build-directory {directory_to_the_profile_build} + +### Pycharm +You can also run any specific automation test directly from Pycharm by providing the "--build-directory" argument in the Run Configuration. \ No newline at end of file diff --git a/AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_automation_test.py b/AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_automation_test.py index cd8858e7f2..061db991cf 100644 --- a/AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_automation_test.py +++ b/AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_automation_test.py @@ -9,18 +9,18 @@ import logging import os import pytest import typing - from datetime import datetime + import ly_test_tools.log.log_monitor +from AWS.common import constants +from .aws_metrics_custom_thread import AWSMetricsThread + # fixture imports from assetpipeline.ap_fixtures.asset_processor_fixture import asset_processor from .aws_metrics_utils import aws_metrics_utils -from .aws_metrics_custom_thread import AWSMetricsThread AWS_METRICS_FEATURE_NAME = 'AWSMetrics' -GAME_LOG_NAME = 'Game.log' -CONTEXT_VARIABLE = ['-c', 'batch_processing=true'] logger = logging.getLogger(__name__) @@ -36,7 +36,7 @@ def setup(launcher: pytest.fixture, asset_processor.start() asset_processor.wait_for_idle() - file_to_monitor = os.path.join(launcher.workspace.paths.project_log(), GAME_LOG_NAME) + file_to_monitor = os.path.join(launcher.workspace.paths.project_log(), constants.GAME_LOG_NAME) # Initialize the log monitor. log_monitor = ly_test_tools.log.log_monitor.LogMonitor(launcher=launcher, log_file_path=file_to_monitor) @@ -73,23 +73,26 @@ def monitor_metrics_submission(log_monitor: pytest.fixture) -> None: f'unexpected_lines values: {unexpected_lines}') -def query_metrics_from_s3(aws_metrics_utils: pytest.fixture, stack_name: str) -> None: +def query_metrics_from_s3(aws_metrics_utils: pytest.fixture, resource_mappings: pytest.fixture, stack_name: str) -> None: """ Verify that the metrics events are delivered to the S3 bucket and can be queried. - aws_metrics_utils: aws_metrics_utils fixture. - stack_name: name of the CloudFormation stack. + :param aws_metrics_utils: aws_metrics_utils fixture. + :param resource_mappings: resource_mappings fixture. + :param stack_name: name of the CloudFormation stack. """ - analytics_bucket_name = aws_metrics_utils.get_analytics_bucket_name(stack_name) - aws_metrics_utils.verify_s3_delivery(analytics_bucket_name) + aws_metrics_utils.verify_s3_delivery( + resource_mappings.get_resource_name_id('AWSMetrics.AnalyticsBucketName') + ) logger.info('Metrics are sent to S3.') - aws_metrics_utils.run_glue_crawler(f'{stack_name}-EventsCrawler') + aws_metrics_utils.run_glue_crawler( + resource_mappings.get_resource_name_id('AWSMetrics.EventsCrawlerName')) + + # Remove the events_json table if exists so that the sample query can create a table with the same name. + aws_metrics_utils.delete_table(f'{stack_name}-eventsdatabase', 'events_json') aws_metrics_utils.run_named_queries(f'{stack_name}-AthenaWorkGroup') logger.info('Query metrics from S3 successfully.') - # Empty the S3 bucket. S3 buckets can only be deleted successfully when it doesn't contain any object. - aws_metrics_utils.empty_batch_analytics_bucket(analytics_bucket_name) - def verify_operational_metrics(aws_metrics_utils: pytest.fixture, stack_name: str, start_time: datetime) -> None: """ @@ -102,7 +105,7 @@ def verify_operational_metrics(aws_metrics_utils: pytest.fixture, stack_name: st 'AWS/Lambda', 'Invocations', [{'Name': 'FunctionName', - 'Value': f'{stack_name}-AnalyticsProcessingLambdaName'}], + 'Value': f'{stack_name}-AnalyticsProcessingLambda'}], start_time) logger.info('AnalyticsProcessingLambda metrics are sent to CloudWatch.') @@ -115,50 +118,59 @@ def verify_operational_metrics(aws_metrics_utils: pytest.fixture, stack_name: st logger.info('EventsProcessingLambda metrics are sent to CloudWatch.') -def start_kinesis_analytics_application(aws_metrics_utils: pytest.fixture, stack_name: str) -> None: +def update_kinesis_analytics_application_status(aws_metrics_utils: pytest.fixture, + resource_mappings: pytest.fixture, start_application: bool) -> None: """ - Start the Kinesis analytics application for real-time analytics. - aws_metrics_utils: aws_metrics_utils fixture. - stack_name: name of the CloudFormation stack. + Update the Kinesis analytics application to start or stop it. + :param aws_metrics_utils: aws_metrics_utils fixture. + :param resource_mappings: resource_mappings fixture. + :param start_application: whether to start or stop the application. """ - analytics_application_name = f'{stack_name}-AnalyticsApplication' - aws_metrics_utils.start_kinesis_data_analytics_application(analytics_application_name) + if start_application: + aws_metrics_utils.start_kinesis_data_analytics_application( + resource_mappings.get_resource_name_id('AWSMetrics.AnalyticsApplicationName')) + else: + aws_metrics_utils.stop_kinesis_data_analytics_application( + resource_mappings.get_resource_name_id('AWSMetrics.AnalyticsApplicationName')) @pytest.mark.SUITE_periodic @pytest.mark.usefixtures('automatic_process_killer') -@pytest.mark.parametrize('project', ['AutomatedTesting']) -@pytest.mark.parametrize('level', ['AWS/Metrics']) -@pytest.mark.parametrize('feature_name', [AWS_METRICS_FEATURE_NAME]) -@pytest.mark.usefixtures('resource_mappings') -@pytest.mark.parametrize('resource_mappings_filename', ['default_aws_resource_mappings.json']) @pytest.mark.usefixtures('aws_credentials') +@pytest.mark.usefixtures('resource_mappings') +@pytest.mark.parametrize('assume_role_arn', [constants.ASSUME_ROLE_ARN]) +@pytest.mark.parametrize('feature_name', [AWS_METRICS_FEATURE_NAME]) +@pytest.mark.parametrize('level', ['AWS/Metrics']) @pytest.mark.parametrize('profile_name', ['AWSAutomationTest']) -@pytest.mark.parametrize('region_name', ['us-west-2']) -@pytest.mark.parametrize('assume_role_arn', ['arn:aws:iam::645075835648:role/o3de-automation-tests']) -@pytest.mark.usefixtures('cdk') -@pytest.mark.parametrize('session_name', ['o3de-Automation-session']) -@pytest.mark.parametrize('deployment_params', [CONTEXT_VARIABLE]) +@pytest.mark.parametrize('project', ['AutomatedTesting']) +@pytest.mark.parametrize('region_name', [constants.AWS_REGION]) +@pytest.mark.parametrize('resource_mappings_filename', [constants.AWS_RESOURCE_MAPPING_FILE_NAME]) +@pytest.mark.parametrize('session_name', [constants.SESSION_NAME]) +@pytest.mark.parametrize('stacks', [[f'{constants.AWS_PROJECT_NAME}-{AWS_METRICS_FEATURE_NAME}-{constants.AWS_REGION}']]) class TestAWSMetricsWindows(object): """ Test class to verify the real-time and batch analytics for metrics. """ - - @pytest.mark.parametrize('destroy_stacks_on_teardown', [False]) def test_realtime_and_batch_analytics(self, level: str, launcher: pytest.fixture, asset_processor: pytest.fixture, workspace: pytest.fixture, aws_utils: pytest.fixture, - cdk: pytest.fixture, + resource_mappings: pytest.fixture, + stacks: typing.List, aws_metrics_utils: pytest.fixture): """ Verify that the metrics events are sent to CloudWatch and S3 for analytics. """ # Start Kinesis analytics application on a separate thread to avoid blocking the test. - kinesis_analytics_application_thread = AWSMetricsThread(target=start_kinesis_analytics_application, - args=(aws_metrics_utils, cdk.stacks[0])) + kinesis_analytics_application_thread = AWSMetricsThread(target=update_kinesis_analytics_application_status, + args=(aws_metrics_utils, resource_mappings, True)) kinesis_analytics_application_thread.start() + + # Clear the analytics bucket objects before sending new metrics. + aws_metrics_utils.empty_bucket( + resource_mappings.get_resource_name_id('AWSMetrics.AnalyticsBucketName')) + log_monitor = setup(launcher, asset_processor) # Kinesis analytics application needs to be in the running state before we start the game launcher. @@ -177,18 +189,22 @@ class TestAWSMetricsWindows(object): start_time) logger.info('Real-time metrics are sent to CloudWatch.') - # Run time-consuming verifications on separate threads to avoid blocking the test. - verification_threads = list() - verification_threads.append( - AWSMetricsThread(target=query_metrics_from_s3, args=(aws_metrics_utils, cdk.stacks[0]))) - verification_threads.append( - AWSMetricsThread(target=verify_operational_metrics, args=(aws_metrics_utils, cdk.stacks[0], start_time))) - for thread in verification_threads: + # 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, stacks[0]))) + operational_threads.append( + AWSMetricsThread(target=verify_operational_metrics, + args=(aws_metrics_utils, stacks[0], 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 verification_threads: + for thread in operational_threads: thread.join() - @pytest.mark.parametrize('destroy_stacks_on_teardown', [True]) def test_unauthorized_user_request_rejected(self, level: str, launcher: pytest.fixture, diff --git a/AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_utils.py b/AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_utils.py index 97cd563651..e7eb486d02 100644 --- a/AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_utils.py +++ b/AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_utils.py @@ -198,7 +198,7 @@ class AWSMetricsUtils: assert state == 'SUCCEEDED', f'Failed to run the named query {named_query.get("Name", {})}' - def empty_batch_analytics_bucket(self, bucket_name: str) -> None: + def empty_bucket(self, bucket_name: str) -> None: """ Empty the S3 bucket following: https://boto3.amazonaws.com/v1/documentation/api/latest/guide/migrations3.html @@ -211,25 +211,18 @@ class AWSMetricsUtils: for key in bucket.objects.all(): key.delete() - def get_analytics_bucket_name(self, stack_name: str) -> str: + def delete_table(self, database_name: str, table_name: str) -> None: """ - Get the name of the deployed S3 bucket. - :param stack_name: Name of the CloudFormation stack. - :return: Name of the deployed S3 bucket. + Delete an existing Glue table. + + :param database_name: Name of the Glue database. + :param table_name: Name of the table to delete. """ - - client = self._aws_util.client('cloudformation') - - response = client.describe_stack_resources( - StackName=stack_name + client = self._aws_util.client('glue') + client.delete_table( + DatabaseName=database_name, + Name=table_name ) - resources = response.get('StackResources', []) - - for resource in resources: - if resource.get('ResourceType') == 'AWS::S3::Bucket': - return resource.get('PhysicalResourceId', '') - - return '' @pytest.fixture(scope='function') diff --git a/AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_waiters.py b/AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_waiters.py index abfeaec076..46070a3a64 100644 --- a/AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_waiters.py +++ b/AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_waiters.py @@ -45,7 +45,8 @@ class KinesisAnalyticsApplicationUpdatedWaiter(CustomWaiter): class GlueCrawlerReadyWaiter(CustomWaiter): """ Subclass of the base custom waiter class. - Wait for the Glue crawler to finish its processing. + Wait for the Glue crawler to finish its processing. Return when the crawler is in the "Stopping" status + to avoid wasting too much time in the automation tests on its shutdown process. """ def __init__(self, client: botocore.client): """ @@ -57,7 +58,7 @@ class GlueCrawlerReadyWaiter(CustomWaiter): 'GlueCrawlerReady', 'GetCrawler', 'Crawler.State', - {'READY': WaitState.SUCCESS}, + {'STOPPING': WaitState.SUCCESS}, client) def wait(self, crawler_name): diff --git a/AutomatedTesting/Gem/PythonTests/AWS/Windows/cdk/__init__.py b/AutomatedTesting/Gem/PythonTests/AWS/Windows/cdk/__init__.py deleted file mode 100644 index bbcbcf1807..0000000000 --- a/AutomatedTesting/Gem/PythonTests/AWS/Windows/cdk/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - diff --git a/AutomatedTesting/Gem/PythonTests/AWS/Windows/cdk/cdk_utils.py b/AutomatedTesting/Gem/PythonTests/AWS/Windows/cdk/cdk_utils.py deleted file mode 100644 index 3643c3bb36..0000000000 --- a/AutomatedTesting/Gem/PythonTests/AWS/Windows/cdk/cdk_utils.py +++ /dev/null @@ -1,248 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -import os -import pytest -import boto3 -import uuid -import logging -import subprocess -import botocore - -import ly_test_tools.environment.process_utils as process_utils -from typing import List - -BOOTSTRAP_STACK_NAME = 'CDKToolkit' -BOOTSTRAP_STAGING_BUCKET_LOGIC_ID = 'StagingBucket' - -logger = logging.getLogger(__name__) - - -class Cdk: - """ - Cdk class that provides methods to run cdk application commands. - Expects system to have NodeJS, AWS CLI and CDK installed globally and have their paths setup as env variables. - """ - - def __init__(self): - self._cdk_env = '' - self._stacks = [] - self._cdk_path = os.path.dirname(os.path.realpath(__file__)) - self._session = '' - - cdk_npm_latest_version_cmd = ['npm', 'view', 'aws-cdk', 'version'] - - output = process_utils.check_output( - cdk_npm_latest_version_cmd, - cwd=self._cdk_path, - shell=True) - cdk_npm_latest_version = output.split()[0] - - cdk_version_cmd = ['cdk', 'version'] - output = process_utils.check_output( - cdk_version_cmd, - cwd=self._cdk_path, - shell=True) - cdk_version = output.split()[0] - logger.info(f'Current CDK version {cdk_version}') - - if cdk_version != cdk_npm_latest_version: - try: - logger.info(f'Updating CDK to latest') - # uninstall and reinstall cdk in case npm has been updated. - output = process_utils.check_output( - 'npm uninstall -g aws-cdk', - cwd=self._cdk_path, - shell=True) - - logger.info(f'Uninstall CDK output: {output}') - - output = process_utils.check_output( - 'npm install -g aws-cdk@latest', - cwd=self._cdk_path, - shell=True) - - logger.info(f'Install CDK output: {output}') - except subprocess.CalledProcessError as error: - logger.warning(f'Failed reinstalling latest CDK on npm' - f'\nError:{error.stderr}') - - def setup(self, cdk_path: str, project: str, account_id: str, - workspace: pytest.fixture, session: boto3.session.Session): - """ - :param cdk_path: Path where cdk app.py is stored. - :param project: Project name used for cdk project name env variable. - :param account_id: AWS account id to use with cdk application. - :param workspace: ly_test_tools workspace fixture. - :param session: Current boto3 session, provides credentials and region. - """ - self._cdk_env = os.environ.copy() - unique_id = uuid.uuid4().hex[-4:] - self._cdk_env['O3DE_AWS_PROJECT_NAME'] = project[:4] + unique_id if len(project) > 4 else project + unique_id - self._cdk_env['O3DE_AWS_DEPLOY_REGION'] = session.region_name - self._cdk_env['O3DE_AWS_DEPLOY_ACCOUNT'] = account_id - self._cdk_env['PATH'] = f'{workspace.paths.engine_root()}\\python;' + self._cdk_env['PATH'] - - credentials = session.get_credentials().get_frozen_credentials() - self._cdk_env['AWS_ACCESS_KEY_ID'] = credentials.access_key - self._cdk_env['AWS_SECRET_ACCESS_KEY'] = credentials.secret_key - self._cdk_env['AWS_SESSION_TOKEN'] = credentials.token - self._cdk_path = cdk_path - - self._session = session - - output = process_utils.check_output( - 'python -m pip install -r requirements.txt', - cwd=self._cdk_path, - env=self._cdk_env, - shell=True) - - logger.info(f'Installing cdk python dependencies: {output}') - - self.bootstrap() - - def bootstrap(self) -> None: - """ - Deploy the bootstrap stack. - """ - try: - bootstrap_cmd = ['cdk', 'bootstrap', - f'aws://{self._cdk_env["O3DE_AWS_DEPLOY_ACCOUNT"]}/{self._cdk_env["O3DE_AWS_DEPLOY_REGION"]}'] - - process_utils.check_call( - bootstrap_cmd, - cwd=self._cdk_path, - env=self._cdk_env, - shell=True) - except botocore.exceptions.ClientError as clientError: - logger.warning(f'Failed creating Bootstrap stack {BOOTSTRAP_STACK_NAME} not found. ' - f'\nError:{clientError["Error"]["Message"]}') - - def list(self, deployment_params: List[str] = None) -> List[str]: - """ - lists cdk stack names. - :param deployment_params: Deployment parameters like --all can be passed in this way. - :return List of cdk stack names. - """ - if not self._cdk_path: - return [] - - list_cdk_application_cmd = ['cdk', 'list'] - if deployment_params: - list_cdk_application_cmd.extend(deployment_params) - - output = process_utils.check_output( - list_cdk_application_cmd, - cwd=self._cdk_path, - env=self._cdk_env, - shell=True) - - return output.splitlines() - - def synthesize(self, deployment_params: List[str] = None) -> None: - """ - Synthesizes all cdk stacks. - :param deployment_params: Deployment parameters like --all can be passed in this way. - """ - if not self._cdk_path: - return - - synth_cdk_application_cmd = ['cdk', 'synth'] - if deployment_params: - synth_cdk_application_cmd.extend(deployment_params) - - process_utils.check_output( - synth_cdk_application_cmd, - cwd=self._cdk_path, - env=self._cdk_env, - shell=True) - - def deploy(self, deployment_params: List[str] = None) -> List[str]: - """ - Deploys all the CDK stacks. - :param deployment_params: Deployment parameters like --all can be passed in this way. - :return List of deployed stack arns. - """ - if not self._cdk_path: - return [] - - deploy_cdk_application_cmd = ['cdk', 'deploy', '--require-approval', 'never'] - if deployment_params: - deploy_cdk_application_cmd.extend(deployment_params) - - output = process_utils.check_output( - deploy_cdk_application_cmd, - cwd=self._cdk_path, - env=self._cdk_env, - shell=True) - - for line in output.splitlines(): - line_sections = line.split('/') - assert len(line_sections), 3 - self._stacks.append(line.split('/')[-2]) - - return self._stacks - - def destroy(self, deployment_params: List[str] = None) -> None: - """ - Destroys the cdk application. - :param deployment_params: Deployment parameters like --all can be passed in this way. - """ - - logger.info(f'CDK Path {self._cdk_path}') - destroy_cdk_application_cmd = ['cdk', 'destroy', '-f'] - if deployment_params: - destroy_cdk_application_cmd.extend(deployment_params) - - try: - process_utils.check_output( - destroy_cdk_application_cmd, - cwd=self._cdk_path, - env=self._cdk_env, - shell=True) - - except subprocess.CalledProcessError as e: - logger.error(e.output) - raise e - - self._stacks = [] - - def remove_bootstrap_stack(self) -> None: - """ - Remove the CDK bootstrap stack. - :param aws_utils: aws_utils fixture. - """ - # Check if the bootstrap stack exists. - response = self._session.client('cloudformation').describe_stacks( - StackName=BOOTSTRAP_STACK_NAME - ) - stacks = response.get('Stacks', []) - if not stacks or len(stacks) is 0: - return - - # Clear the bootstrap staging bucket before deleting the bootstrap stack. - response = self._session.client('cloudformation').describe_stack_resource( - StackName=BOOTSTRAP_STACK_NAME, - LogicalResourceId=BOOTSTRAP_STAGING_BUCKET_LOGIC_ID - ) - - staging_bucket_name = response.get('StackResourceDetail', {}).get('PhysicalResourceId', '') - if staging_bucket_name: - s3 = self._session.resource('s3') - bucket = s3.Bucket(staging_bucket_name) - for key in bucket.objects.all(): - key.delete() - - # Delete the bootstrap stack. - # Should not need to delete the stack if S3 bucket can be cleaned. - # self._session.client('cloudformation').delete_stack( - # StackName=BOOTSTRAP_STACK_NAME - # ) - - @property - def stacks(self): - return self._stacks diff --git a/AutomatedTesting/Gem/PythonTests/AWS/Windows/client_auth/aws_client_auth_automation_test.py b/AutomatedTesting/Gem/PythonTests/AWS/Windows/client_auth/aws_client_auth_automation_test.py index bdd1eea469..b56d3f88f5 100644 --- a/AutomatedTesting/Gem/PythonTests/AWS/Windows/client_auth/aws_client_auth_automation_test.py +++ b/AutomatedTesting/Gem/PythonTests/AWS/Windows/client_auth/aws_client_auth_automation_test.py @@ -4,45 +4,42 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ -import pytest -import os + import logging +import os +import pytest + import ly_test_tools.log.log_monitor +from AWS.common import constants + # fixture imports from assetpipeline.ap_fixtures.asset_processor_fixture import asset_processor -AWS_PROJECT_NAME = 'AWS-AutomationTest' AWS_CLIENT_AUTH_FEATURE_NAME = 'AWSClientAuth' -AWS_CLIENT_AUTH_DEFAULT_PROFILE_NAME = 'default' - -GAME_LOG_NAME = 'Game.log' logger = logging.getLogger(__name__) @pytest.mark.SUITE_periodic -@pytest.mark.usefixtures('automatic_process_killer') @pytest.mark.usefixtures('asset_processor') -@pytest.mark.usefixtures('workspace') -@pytest.mark.parametrize('project', ['AutomatedTesting']) -@pytest.mark.usefixtures('cdk') -@pytest.mark.parametrize('feature_name', [AWS_CLIENT_AUTH_FEATURE_NAME]) -@pytest.mark.usefixtures('resource_mappings') -@pytest.mark.parametrize('resource_mappings_filename', ['default_aws_resource_mappings.json']) +@pytest.mark.usefixtures('automatic_process_killer') @pytest.mark.usefixtures('aws_utils') -@pytest.mark.parametrize('region_name', ['us-west-2']) -@pytest.mark.parametrize('assume_role_arn', ['arn:aws:iam::645075835648:role/o3de-automation-tests']) -@pytest.mark.parametrize('session_name', ['o3de-Automation-session']) -@pytest.mark.usefixtures('cdk') -@pytest.mark.parametrize('deployment_params', [[]]) +@pytest.mark.usefixtures('workspace') +@pytest.mark.parametrize('assume_role_arn', [constants.ASSUME_ROLE_ARN]) +@pytest.mark.parametrize('feature_name', [AWS_CLIENT_AUTH_FEATURE_NAME]) +@pytest.mark.parametrize('project', ['AutomatedTesting']) +@pytest.mark.usefixtures('resource_mappings') +@pytest.mark.parametrize('resource_mappings_filename', [constants.AWS_RESOURCE_MAPPING_FILE_NAME]) +@pytest.mark.parametrize('region_name', [constants.AWS_REGION]) +@pytest.mark.parametrize('session_name', [constants.SESSION_NAME]) +@pytest.mark.parametrize('stacks', [[f'{constants.AWS_PROJECT_NAME}-{AWS_CLIENT_AUTH_FEATURE_NAME}-Stack-{constants.AWS_REGION}']]) class TestAWSClientAuthWindows(object): """ Test class to verify AWS Client Auth gem features on Windows. """ @pytest.mark.parametrize('level', ['AWS/ClientAuth']) - @pytest.mark.parametrize('destroy_stacks_on_teardown', [False]) def test_anonymous_credentials(self, level: str, launcher: pytest.fixture, @@ -53,14 +50,14 @@ class TestAWSClientAuthWindows(object): """ Test to verify AWS Cognito Identity pool anonymous authorization. - Setup: Deploys cdk and updates resource mapping file. + 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. """ asset_processor.start() asset_processor.wait_for_idle() - file_to_monitor = os.path.join(launcher.workspace.paths.project_log(), GAME_LOG_NAME) + 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] @@ -74,10 +71,8 @@ class TestAWSClientAuthWindows(object): ) assert result, 'Anonymous credentials fetched successfully.' - @pytest.mark.parametrize('destroy_stacks_on_teardown', [True]) def test_password_signin_credentials(self, launcher: pytest.fixture, - cdk: pytest.fixture, resource_mappings: pytest.fixture, workspace: pytest.fixture, asset_processor: pytest.fixture, @@ -86,16 +81,29 @@ class TestAWSClientAuthWindows(object): """ Test to verify AWS Cognito IDP Password sign in and Cognito Identity pool authenticated authorization. - Setup: Deploys cdk and updates resource mapping file. + Setup: Updates resource mapping file using existing CloudFormation stacks. Tests: Sign up new test user, admin confirm the user, sign in and get aws credentials. Verification: Log monitor looks for success credentials log. """ asset_processor.start() asset_processor.wait_for_idle() - file_to_monitor = os.path.join(launcher.workspace.paths.project_log(), GAME_LOG_NAME) + 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) + cognito_idp = aws_utils.client('cognito-idp') + user_pool_id = resource_mappings.get_resource_name_id(f'{AWS_CLIENT_AUTH_FEATURE_NAME}.CognitoUserPoolId') + logger.info(f'UserPoolId:{user_pool_id}') + + # Remove the user if already exists + try: + cognito_idp.admin_delete_user( + UserPoolId=user_pool_id, + Username='test1' + ) + except cognito_idp.exceptions.UserNotFoundException: + pass + launcher.args = ['+LoadLevel', 'AWS/ClientAuthPasswordSignUp'] launcher.args.extend(['-rhi=null']) @@ -109,9 +117,6 @@ class TestAWSClientAuthWindows(object): launcher.stop() - cognito_idp = aws_utils.client('cognito-idp') - user_pool_id = resource_mappings.get_resource_name_id(f'{AWS_CLIENT_AUTH_FEATURE_NAME}.CognitoUserPoolId') - print(f'UserPoolId:{user_pool_id}') cognito_idp.admin_confirm_sign_up( UserPoolId=user_pool_id, Username='test1' diff --git a/AutomatedTesting/Gem/PythonTests/AWS/Windows/core/test_aws_resource_interaction.py b/AutomatedTesting/Gem/PythonTests/AWS/Windows/core/test_aws_resource_interaction.py index 55f06660e8..529151f3f6 100644 --- a/AutomatedTesting/Gem/PythonTests/AWS/Windows/core/test_aws_resource_interaction.py +++ b/AutomatedTesting/Gem/PythonTests/AWS/Windows/core/test_aws_resource_interaction.py @@ -5,10 +5,11 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ -import os import logging -import typing +import os import shutil +import typing +from botocore.exceptions import ClientError import pytest import ly_test_tools @@ -16,16 +17,15 @@ import ly_test_tools.log.log_monitor import ly_test_tools.environment.process_utils as process_utils import ly_test_tools.o3de.asset_processor_utils as asset_processor_utils -from botocore.exceptions import ClientError +from AWS.common import constants + +# fixture imports from assetpipeline.ap_fixtures.asset_processor_fixture import asset_processor AWS_CORE_FEATURE_NAME = 'AWSCore' -AWS_RESOURCE_MAPPING_FILE_NAME = 'default_aws_resource_mappings.json' process_utils.kill_processes_named("o3de", ignore_extensions=True) # Kill ProjectManager windows -GAME_LOG_NAME = 'Game.log' - logger = logging.getLogger(__name__) @@ -46,7 +46,7 @@ def setup(launcher: pytest.fixture, asset_processor: pytest.fixture) -> typing.T asset_processor.start() asset_processor.wait_for_idle() - file_to_monitor = os.path.join(launcher.workspace.paths.project_log(), GAME_LOG_NAME) + 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) return log_monitor, s3_download_dir @@ -58,7 +58,7 @@ def write_test_data_to_dynamodb_table(resource_mappings: pytest.fixture, aws_uti :param resource_mappings: resource_mappings fixture. :param aws_utils: aws_utils fixture. """ - table_name = resource_mappings.get_resource_name_id("AWSCore.ExampleDynamoTableOutput") + table_name = resource_mappings.get_resource_name_id(f'{AWS_CORE_FEATURE_NAME}.ExampleDynamoTableOutput') try: aws_utils.client('dynamodb').put_item( TableName=table_name, @@ -77,21 +77,19 @@ def write_test_data_to_dynamodb_table(resource_mappings: pytest.fixture, aws_uti @pytest.mark.SUITE_periodic @pytest.mark.usefixtures('automatic_process_killer') @pytest.mark.usefixtures('asset_processor') -@pytest.mark.usefixtures('cdk') @pytest.mark.parametrize('feature_name', [AWS_CORE_FEATURE_NAME]) -@pytest.mark.parametrize('region_name', ['us-west-2']) -@pytest.mark.parametrize('assume_role_arn', ['arn:aws:iam::645075835648:role/o3de-automation-tests']) -@pytest.mark.parametrize('session_name', ['o3de-Automation-session']) +@pytest.mark.parametrize('region_name', [constants.AWS_REGION]) +@pytest.mark.parametrize('assume_role_arn', [constants.ASSUME_ROLE_ARN]) +@pytest.mark.parametrize('session_name', [constants.SESSION_NAME]) @pytest.mark.usefixtures('workspace') @pytest.mark.parametrize('project', ['AutomatedTesting']) @pytest.mark.parametrize('level', ['AWS/Core']) @pytest.mark.usefixtures('resource_mappings') -@pytest.mark.parametrize('resource_mappings_filename', [AWS_RESOURCE_MAPPING_FILE_NAME]) +@pytest.mark.parametrize('resource_mappings_filename', [constants.AWS_RESOURCE_MAPPING_FILE_NAME]) +@pytest.mark.parametrize('stacks', [[f'{constants.AWS_PROJECT_NAME}-{AWS_CORE_FEATURE_NAME}', + f'{constants.AWS_PROJECT_NAME}-{AWS_CORE_FEATURE_NAME}-Example-{constants.AWS_REGION}']]) @pytest.mark.usefixtures('aws_credentials') @pytest.mark.parametrize('profile_name', ['AWSAutomationTest']) -@pytest.mark.usefixtures('cdk') -@pytest.mark.parametrize('deployment_params', [['--all']]) -@pytest.mark.parametrize('destroy_stacks_on_teardown', [True]) class TestAWSCoreAWSResourceInteraction(object): """ Test class to verify the scripting behavior for the AWSCore gem. @@ -119,7 +117,7 @@ class TestAWSCoreAWSResourceInteraction(object): expected_lines: typing.List[str], unexpected_lines: typing.List[str]): """ - Setup: Deploys cdk and updates resource mapping file. + 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. """ diff --git a/AutomatedTesting/Gem/PythonTests/AWS/Windows/resource_mappings/__init__.py b/AutomatedTesting/Gem/PythonTests/AWS/Windows/resource_mappings/__init__.py deleted file mode 100644 index e01850f919..0000000000 --- a/AutomatedTesting/Gem/PythonTests/AWS/Windows/resource_mappings/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" \ No newline at end of file diff --git a/AutomatedTesting/Gem/PythonTests/AWS/common/constants.py b/AutomatedTesting/Gem/PythonTests/AWS/common/constants.py new file mode 100644 index 0000000000..b12aca5f29 --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/AWS/common/constants.py @@ -0,0 +1,21 @@ +""" +Copyright (c) Contributors to the Open 3D Engine Project. +For complete copyright and license terms please see the LICENSE at the root of this distribution. + +SPDX-License-Identifier: Apache-2.0 OR MIT +""" + +import os + +# ARN of the IAM role to assume for retrieving temporary AWS credentials +ASSUME_ROLE_ARN = os.environ.get('ASSUME_ROLE_ARN', 'arn:aws:iam::645075835648:role/o3de-automation-tests') +# Name of the AWS project deployed by the CDK applications +AWS_PROJECT_NAME = os.environ.get('O3DE_AWS_PROJECT_NAME', 'AWSAUTO') +# Region for the existing CloudFormation stacks used by the automation tests +AWS_REGION = os.environ.get('O3DE_AWS_DEPLOY_REGION', 'us-east-1') +# Name of the default resource mapping config file used by the automation tests +AWS_RESOURCE_MAPPING_FILE_NAME = 'default_aws_resource_mappings.json' +# Name of the game launcher log +GAME_LOG_NAME = 'Game.log' +# Name of the IAM role session for retrieving temporary AWS credentials +SESSION_NAME = 'o3de-Automation-session' diff --git a/AutomatedTesting/Gem/PythonTests/AWS/Windows/resource_mappings/resource_mappings.py b/AutomatedTesting/Gem/PythonTests/AWS/common/resource_mappings.py similarity index 90% rename from AutomatedTesting/Gem/PythonTests/AWS/Windows/resource_mappings/resource_mappings.py rename to AutomatedTesting/Gem/PythonTests/AWS/common/resource_mappings.py index fd679de99d..5f01ecdbf8 100644 --- a/AutomatedTesting/Gem/PythonTests/AWS/Windows/resource_mappings/resource_mappings.py +++ b/AutomatedTesting/Gem/PythonTests/AWS/common/resource_mappings.py @@ -6,9 +6,9 @@ SPDX-License-Identifier: Apache-2.0 OR MIT """ import os -import pytest import json import logging +from AWS.common import constants logger = logging.getLogger(__name__) @@ -22,18 +22,14 @@ class ResourceMappings: ResourceMappings class that handles writing Cloud formation outputs to resource mappings json file in a project. """ - def __init__(self, file_path: str, region: str, feature_name: str, account_id: str, workspace: pytest.fixture, - cloud_formation_client): + def __init__(self, file_path: str, region: str, feature_name: str, account_id: str, cloud_formation_client): """ :param file_path: Path for the resource mapping file. :param region: Region value for the resource mapping file. :param feature_name: Feature gem name to use to append name to mappings key. :param account_id: AWS account id value for the resource mapping file. - :param workspace: ly_test_tools workspace fixture. :param cloud_formation_client: AWS cloud formation client. """ - self._cdk_env = os.environ.copy() - self._cdk_env['PATH'] = f'{workspace.paths.engine_root()}\\python;' + self._cdk_env['PATH'] self._resource_mapping_file_path = file_path self._region = region self._feature_name = feature_name @@ -44,7 +40,7 @@ class ResourceMappings: f'Invalid resource mapping file path {self._resource_mapping_file_path}' self._client = cloud_formation_client - def populate_output_keys(self, stacks=[]) -> None: + def populate_output_keys(self, stacks=None) -> None: """ Calls describe stacks on cloud formation service and persists outputs to resource mappings file. :param stacks List of stack arns to describe and populate resource mappings with. @@ -58,7 +54,7 @@ class ResourceMappings: self._write_resource_mappings(stacks[0].get('Outputs', [])) - def _write_resource_mappings(self, outputs, append_feature_name = True) -> None: + def _write_resource_mappings(self, outputs, append_feature_name=True) -> None: with open(self._resource_mapping_file_path) as file_content: resource_mappings = json.load(file_content) @@ -91,7 +87,7 @@ class ResourceMappings: resource_mappings = json.load(file_content) resource_mappings[AWS_RESOURCE_MAPPINGS_ACCOUNT_ID_KEY] = '' - resource_mappings[AWS_RESOURCE_MAPPINGS_REGION_KEY] = 'us-west-2' + resource_mappings[AWS_RESOURCE_MAPPINGS_REGION_KEY] = constants.AWS_REGION # Append new mappings. resource_mappings[AWS_RESOURCE_MAPPINGS_KEY] = resource_mappings.get(AWS_RESOURCE_MAPPINGS_KEY, {}) diff --git a/AutomatedTesting/Gem/PythonTests/AWS/conftest.py b/AutomatedTesting/Gem/PythonTests/AWS/conftest.py index 6ad495ab66..df65aa7a5c 100644 --- a/AutomatedTesting/Gem/PythonTests/AWS/conftest.py +++ b/AutomatedTesting/Gem/PythonTests/AWS/conftest.py @@ -11,8 +11,7 @@ import typing from AWS.common.aws_utils import AwsUtils from AWS.common.aws_credentials import AwsCredentials -from AWS.Windows.cdk.cdk_utils import Cdk -from AWS.Windows.resource_mappings.resource_mappings import ResourceMappings +from AWS.common.resource_mappings import ResourceMappings logger = logging.getLogger(__name__) @@ -52,6 +51,7 @@ def resource_mappings( project: str, feature_name: str, resource_mappings_filename: str, + stacks: typing.List, workspace: pytest.fixture, aws_utils: pytest.fixture) -> ResourceMappings: """ @@ -61,6 +61,7 @@ def resource_mappings( :param project: Project to find resource mapping file. :param feature_name: AWS Gem name that is prepended to resource mapping keys. :param resource_mappings_filename: Name of resource mapping file. + :param stacks: List of stack names to describe and populate resource mappings with. :param workspace: ly_test_tools workspace fixture. :param aws_utils: AWS utils fixture. :return: ResourceMappings class object. @@ -70,8 +71,8 @@ def resource_mappings( logger.info(f'Resource mapping path : {path}') logger.info(f'Resource mapping resolved path : {abspath(path)}') resource_mappings_obj = ResourceMappings(abspath(path), aws_utils.assume_session().region_name, feature_name, - aws_utils.assume_account_id(), workspace, - aws_utils.client('cloudformation')) + aws_utils.assume_account_id(), aws_utils.client('cloudformation')) + resource_mappings_obj.populate_output_keys(stacks) def teardown(): resource_mappings_obj.clear_output_keys() @@ -81,56 +82,6 @@ def resource_mappings( return resource_mappings_obj -@pytest.fixture(scope='function') -def cdk( - request: pytest.fixture, - project: str, - feature_name: str, - workspace: pytest.fixture, - aws_utils: pytest.fixture, - resource_mappings: pytest.fixture, - deployment_params: typing.List[str], - destroy_stacks_on_teardown: bool) -> Cdk: - """ - Fixture for setting up a Cdk - :param request: _pytest.fixtures.SubRequest class that handles getting - a pytest fixture from a pytest function/fixture. - :param project: Project name used for cdk project name env variable. - :param feature_name: Feature gem name to expect cdk folder in. - :param workspace: ly_test_tools workspace fixture. - :param aws_utils: aws_utils fixture. - :param resource_mappings: resource_mappings fixture. - :param deployment_params: Parameters for the CDK application deployment. - :param destroy_stacks_on_teardown: option to control calling destroy ot the end of test. - :return Cdk class object. - """ - - cdk_path = f'{workspace.paths.engine_root()}/Gems/{feature_name}/cdk' - logger.info(f'CDK Path {cdk_path}') - - if pytest.cdk_obj is None: - pytest.cdk_obj = Cdk() - pytest.cdk_obj.setup(cdk_path, project, aws_utils.assume_account_id(), workspace, aws_utils.assume_session()) - - stacks = pytest.cdk_obj.deploy(deployment_params=deployment_params) - - logger.info(f'Cdk stack names:\n{stacks}') - resource_mappings.populate_output_keys(stacks) - - def teardown(): - if destroy_stacks_on_teardown: - pytest.cdk_obj.destroy(deployment_params=deployment_params) - # Enable after https://github.com/aws/aws-cdk/issues/986 is fixed. - # Until then clean the bootstrap bucket manually. - # pytest.cdk_obj.remove_bootstrap_stack() - - pytest.cdk_obj = None - - request.addfinalizer(teardown) - - return pytest.cdk_obj - - @pytest.fixture(scope='function') def aws_credentials(request: pytest.fixture, aws_utils: pytest.fixture, profile_name: str): """ diff --git a/AutomatedTesting/Gem/PythonTests/Blast/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/Blast/CMakeLists.txt index 7048a6bd46..172eded09a 100644 --- a/AutomatedTesting/Gem/PythonTests/Blast/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonTests/Blast/CMakeLists.txt @@ -12,7 +12,6 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) TEST_SUITE main TEST_SERIAL TRUE PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Active.py - TIMEOUT 1500 RUNTIME_DEPENDENCIES Legacy::Editor AZ::AssetProcessor diff --git a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/README.txt b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/README.txt index 0405dacbf4..90afee39bc 100644 --- a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/README.txt +++ b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/README.txt @@ -8,7 +8,7 @@ INTRODUCTION ------------ EditorPythonBindings is a Python project that contains a collection of editor testing tools -developed by the Lumberyard feature teams. The project contains tools for system level +developed by the O3DE feature teams. The project contains tools for system level editor tests. @@ -23,7 +23,7 @@ installed on your system. INSTALL ----------- -It is recommended to set up these these tools with Lumberyard's CMake build commands. +It is recommended to set up these these tools with O3DE's CMake build commands. Assuming CMake is already setup on your operating system, below are some sample build commands: cd /path/to/od3e/ mkdir windows_vs2019 diff --git a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/asset_utils.py b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/asset_utils.py new file mode 100644 index 0000000000..ece7670a9e --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/asset_utils.py @@ -0,0 +1,47 @@ +""" +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 +""" + +# Built-in Imports +from __future__ import annotations + +# Open 3D Engine Imports +import azlmbr.bus as bus +import azlmbr.asset as azasset +import azlmbr.math as math + + +class Asset: + """ + Used to find Asset Id by its path and path of asset by its Id + If a component has any asset property, then this class object can be called as: + asset_id = editor_python_test_tools.editor_entity_utils.EditorComponent.get_component_property_value() + asset = asset_utils.Asset(asset_id) + """ + def __init__(self, id: azasset.AssetId): + self.id: azasset.AssetId = id + + # Creation functions + @classmethod + def find_asset_by_path(cls, path: str, RegisterType: bool = False) -> Asset: + """ + :param path: Absolute file path of the asset + :param RegisterType: Whether to register the asset if it's not in the database, + default to false for the general case + :return: Asset object associated with file path + """ + asset_id = azasset.AssetCatalogRequestBus(bus.Broadcast, "GetAssetIdByPath", path, math.Uuid(), RegisterType) + assert asset_id.is_valid(), f"Couldn't find Asset with path: {path}" + asset = cls(asset_id) + return asset + + # Methods + def get_path(self) -> str: + """ + :return: Absolute file path of Asset + """ + assert self.id.is_valid(), "Invalid Asset Id" + return azasset.AssetCatalogRequestBus(bus.Broadcast, "GetAssetPathById", self.id) diff --git a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/hydra_editor_utils.py b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/hydra_editor_utils.py index cec1b6456b..985e32ede5 100644 --- a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/hydra_editor_utils.py +++ b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/hydra_editor_utils.py @@ -8,6 +8,7 @@ SPDX-License-Identifier: Apache-2.0 OR MIT import azlmbr.bus as bus import azlmbr.editor as editor import azlmbr.entity as entity +import azlmbr.legacy.general as general import azlmbr.object from typing import List @@ -428,3 +429,32 @@ def get_component_type_id_map(component_name_list): type_ids_by_component[component_names[i]] = typeId return type_ids_by_component + + +def attach_component_to_entity(entity_id, component_name): + # type: (azlmbr.entity.EntityId, str) -> azlmbr.entity.EntityComponentIdPair + """ + Adds the component if not added already. + :param entity_id: EntityId of the entity to attach the component to + :param component_name: name of the component + :return: If successful, returns the EntityComponentIdPair, otherwise returns None. + """ + type_ids_list = editor.EditorComponentAPIBus( + bus.Broadcast, 'FindComponentTypeIdsByEntityType', [component_name], 0) + general.log(f"Components found = {len(type_ids_list)}") + if len(type_ids_list) < 1: + general.log(f"ERROR: A component class with name {component_name} doesn't exist") + return None + elif len(type_ids_list) > 1: + general.log(f"ERROR: Found more than one component classes with same name: {component_name}") + return None + # Before adding the component let's check if it is already attached to the entity. + component_outcome = editor.EditorComponentAPIBus(bus.Broadcast, 'GetComponentOfType', entity_id, type_ids_list[0]) + if component_outcome.IsSuccess(): + return component_outcome.GetValue() # In this case the value is not a list. + component_outcome = editor.EditorComponentAPIBus(bus.Broadcast, 'AddComponentsOfType', entity_id, type_ids_list) + if component_outcome.IsSuccess(): + general.log(f"{component_name} Component added to entity.") + return component_outcome.GetValue()[0] + general.log(f"ERROR: Failed to add component [{component_name}] to entity") + return None diff --git a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/hydra_test_utils.py b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/hydra_test_utils.py index 3004b9ec7d..3d4d9ea419 100644 --- a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/hydra_test_utils.py +++ b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/hydra_test_utils.py @@ -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): + timeout=300, log_file_name="Editor.log"): """ Runs the Editor with the specified script, and monitors for expected log lines. :param request: Special fixture providing information of the requesting test function. @@ -44,6 +44,7 @@ def launch_and_validate_results(request, test_directory, editor, editor_script, :param null_renderer: Specifies the test does not require the renderer. Defaults to True. :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' """ test_case = os.path.join(test_directory, editor_script) request.addfinalizer(lambda: teardown_editor(editor)) @@ -58,7 +59,17 @@ def launch_and_validate_results(request, test_directory, editor, editor_script, with editor.start(): - editorlog_file = os.path.join(editor.workspace.paths.project_log(), 'Editor.log') + editorlog_file = os.path.join(editor.workspace.paths.project_log(), log_file_name) + + # Log monitor requires the file to exist. + logger.debug(f"Waiting until log file <{editorlog_file}> exists...") + waiter.wait_for( + lambda: os.path.exists(editorlog_file), + timeout=60, + exc=f"Log file '{editorlog_file}' was never created by another process.", + interval=1, + ) + logger.debug(f"Done! log file <{editorlog_file}> exists.") # Initialize the log monitor and set time to wait for log creation log_monitor = ly_test_tools.log.log_monitor.LogMonitor(launcher=editor, log_file_path=editorlog_file) diff --git a/AutomatedTesting/Gem/PythonTests/NvCloth/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/NvCloth/CMakeLists.txt index a39cdf04cf..3913041f88 100644 --- a/AutomatedTesting/Gem/PythonTests/NvCloth/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonTests/NvCloth/CMakeLists.txt @@ -13,7 +13,6 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) TEST_REQUIRES gpu TEST_SERIAL PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Active.py - TIMEOUT 1500 RUNTIME_DEPENDENCIES Legacy::Editor AZ::AssetProcessor diff --git a/AutomatedTesting/Gem/PythonTests/PythonAssetBuilder/AssetBuilder_test.py b/AutomatedTesting/Gem/PythonTests/PythonAssetBuilder/AssetBuilder_test.py index 1fe60e3707..45e633a979 100644 --- a/AutomatedTesting/Gem/PythonTests/PythonAssetBuilder/AssetBuilder_test.py +++ b/AutomatedTesting/Gem/PythonTests/PythonAssetBuilder/AssetBuilder_test.py @@ -27,19 +27,19 @@ class TestPythonAssetProcessing(object): unexpected_lines = [] expected_lines = [ 'Mock asset exists', - 'Expected subId for asset (gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_z_positive.azmodel) found', - 'Expected subId for asset (gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_z_negative.azmodel) found', - 'Expected subId for asset (gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_y_positive.azmodel) found', - 'Expected subId for asset (gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_y_negative.azmodel) found', - 'Expected subId for asset (gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_x_positive.azmodel) found', - 'Expected subId for asset (gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_x_negative.azmodel) found', - 'Expected subId for asset (gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_center.azmodel) found' + 'AssetId found for asset (gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_z_positive_1.azmodel) found', + 'AssetId found for asset (gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_z_negative_1.azmodel) found', + 'AssetId found for asset (gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_y_positive_1.azmodel) found', + 'AssetId found for asset (gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_y_negative_1.azmodel) found', + 'AssetId found for asset (gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_x_positive_1.azmodel) found', + 'AssetId found for asset (gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_x_negative_1.azmodel) found', + 'AssetId found for asset (gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_center_1.azmodel) found' ] timeout = 180 halt_on_unexpected = False test_directory = os.path.join(os.path.dirname(__file__)) testFile = os.path.join(test_directory, 'AssetBuilder_test_case.py') - editor.args.extend(['-NullRenderer', "--skipWelcomeScreenDialog", "--autotest_mode", "--runpythontest", testFile]) + editor.args.extend(['-NullRenderer', '-rhi=Null', "--skipWelcomeScreenDialog", "--autotest_mode", "--runpythontest", testFile]) with editor.start(): editorlog_file = os.path.join(editor.workspace.paths.project_log(), 'Editor.log') diff --git a/AutomatedTesting/Gem/PythonTests/PythonAssetBuilder/AssetBuilder_test_case.py b/AutomatedTesting/Gem/PythonTests/PythonAssetBuilder/AssetBuilder_test_case.py index c1519a6fdb..8d418222ce 100644 --- a/AutomatedTesting/Gem/PythonTests/PythonAssetBuilder/AssetBuilder_test_case.py +++ b/AutomatedTesting/Gem/PythonTests/PythonAssetBuilder/AssetBuilder_test_case.py @@ -29,21 +29,21 @@ if (assetIdString.endswith(':528cca58') is False): 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, expectedSubId): +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 (assetIdString.endswith(':' + expectedSubId) is False): - raise_and_stop(f'Asset at path {generatedModelAssetPath} has unexpected asset ID ({assetIdString}) for ({generatedModelAssetPath}), expected {expectedSubId}!') + if (assetId.is_valid()): + print(f'AssetId found for asset ({generatedModelAssetPath}) found') else: - print(f'Expected subId for asset ({generatedModelAssetPath}) found') + 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.azmodel', '1024be55') -test_azmodel_product('gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_z_negative.azmodel', '1052c94e') -test_azmodel_product('gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_y_positive.azmodel', '10130556') -test_azmodel_product('gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_y_negative.azmodel', '1065724d') -test_azmodel_product('gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_x_positive.azmodel', '10d16e68') -test_azmodel_product('gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_x_negative.azmodel', '10a71973') -test_azmodel_product('gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_center.azmodel', '10412075') +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') diff --git a/AutomatedTesting/Gem/PythonTests/PythonAssetBuilder/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/PythonAssetBuilder/CMakeLists.txt index 9b6542b3e3..905470e08f 100644 --- a/AutomatedTesting/Gem/PythonTests/PythonAssetBuilder/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonTests/PythonAssetBuilder/CMakeLists.txt @@ -12,7 +12,6 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) TEST_SUITE periodic TEST_SERIAL PATH ${CMAKE_CURRENT_LIST_DIR} - TIMEOUT 1500 RUNTIME_DEPENDENCIES Legacy::Editor AZ::AssetProcessor diff --git a/AutomatedTesting/Gem/PythonTests/WhiteBox/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/WhiteBox/CMakeLists.txt index b5fcfcc44c..1c7a02862d 100644 --- a/AutomatedTesting/Gem/PythonTests/WhiteBox/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonTests/WhiteBox/CMakeLists.txt @@ -12,7 +12,6 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) TEST_SUITE main TEST_SERIAL PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Active.py - TIMEOUT 1500 RUNTIME_DEPENDENCIES Legacy::Editor AZ::AssetProcessor diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/bundler_batch_setup_fixture.py b/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/bundler_batch_setup_fixture.py index a543527ed7..ff362c732c 100755 --- a/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/bundler_batch_setup_fixture.py +++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/bundler_batch_setup_fixture.py @@ -342,7 +342,7 @@ def bundler_batch_setup_fixture(request, workspace, asset_processor, timeout) -> # Run a full scan to ENSURE that both caches (pc and osx) are COMPLETELY POPULATED # Needed for asset bundling # fmt:off - assert asset_processor.batch_process(fastscan=False, timeout=timeout * len(platforms), platforms=platforms_list), \ + assert asset_processor.batch_process(fastscan=True, timeout=timeout * len(platforms), platforms=platforms_list), \ "AP Batch failed to process in bundler_batch_fixture" # fmt:on diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/CMakeLists.txt index 0170d73af0..5a5809595e 100644 --- a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/CMakeLists.txt @@ -97,26 +97,12 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) PATH ${CMAKE_CURRENT_LIST_DIR}/asset_bundler_batch_tests.py EXCLUDE_TEST_RUN_TARGET_FROM_IDE TEST_SERIAL - TIMEOUT 2400 TEST_SUITE periodic RUNTIME_DEPENDENCIES AZ::AssetProcessor AZ::AssetBundlerBatch ) - ly_add_pytest( - NAME AssetPipelineTests.AssetBundler_SandBox - TEST_SUITE sandbox - PATH ${CMAKE_CURRENT_LIST_DIR}/asset_bundler_batch_tests.py - PYTEST_MARKS "SUITE_sandbox" # run only sandbox tests in this file - EXCLUDE_TEST_RUN_TARGET_FROM_IDE - TEST_SERIAL - TIMEOUT 1500 - RUNTIME_DEPENDENCIES - AZ::AssetProcessor - AZ::AssetBundlerBatch - ) - ly_add_pytest( NAME AssetPipelineTests.AssetBuilder PATH ${CMAKE_CURRENT_LIST_DIR}/asset_builder_tests.py @@ -133,7 +119,6 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) PATH ${CMAKE_CURRENT_LIST_DIR}/missing_dependency_tests.py EXCLUDE_TEST_RUN_TARGET_FROM_IDE TEST_SERIAL - TIMEOUT 1500 TEST_SUITE periodic RUNTIME_DEPENDENCIES AZ::AssetProcessorBatch diff --git a/AutomatedTesting/Gem/PythonTests/atom_renderer/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/atom_renderer/CMakeLists.txt index d4f036faeb..f056623ecd 100644 --- a/AutomatedTesting/Gem/PythonTests/atom_renderer/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonTests/atom_renderer/CMakeLists.txt @@ -39,7 +39,7 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_BUILD_TESTS_SUPPORTED AND AutomatedT TEST_SUITE main TEST_REQUIRES gpu TEST_SERIAL - TIMEOUT 800 + TIMEOUT 1200 PATH ${CMAKE_CURRENT_LIST_DIR}/test_Atom_GPUTests.py RUNTIME_DEPENDENCIES AssetProcessor diff --git a/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_hydra_scripts/hydra_AtomEditorComponents_AddedToEntity.py b/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_hydra_scripts/hydra_AtomEditorComponents_AddedToEntity.py index b4031d2ffa..cd10caf57b 100644 --- a/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_hydra_scripts/hydra_AtomEditorComponents_AddedToEntity.py +++ b/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_hydra_scripts/hydra_AtomEditorComponents_AddedToEntity.py @@ -206,8 +206,8 @@ def run(): # PostFX Layer Component ComponentTests("PostFX Layer") - # Radius Weight Modifier Component - ComponentTests("Radius Weight Modifier") + # PostFX Radius Weight Modifier Component + ComponentTests("PostFX Radius Weight Modifier") # Light Component ComponentTests("Light") diff --git a/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_hydra_scripts/hydra_AtomEditorComponents_LightComponent.py b/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_hydra_scripts/hydra_AtomEditorComponents_LightComponent.py index ec8dc199ae..24866f3b19 100644 --- a/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_hydra_scripts/hydra_AtomEditorComponents_LightComponent.py +++ b/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_hydra_scripts/hydra_AtomEditorComponents_LightComponent.py @@ -19,7 +19,7 @@ import azlmbr.legacy.general as general sys.path.append(os.path.join(azlmbr.paths.devassets, "Gem", "PythonTests")) import editor_python_test_tools.hydra_editor_utils as hydra -from atom_renderer.atom_utils.atom_component_helper import LIGHT_TYPES +from atom_renderer.atom_utils.atom_constants import LIGHT_TYPES LIGHT_TYPE_PROPERTY = 'Controller|Configuration|Light type' SPHERE_AND_SPOT_DISK_LIGHT_PROPERTIES = [ diff --git a/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_hydra_scripts/hydra_AtomMaterialEditor_BasicTests.py b/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_hydra_scripts/hydra_AtomMaterialEditor_BasicTests.py new file mode 100644 index 0000000000..b3c51ca912 --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_hydra_scripts/hydra_AtomMaterialEditor_BasicTests.py @@ -0,0 +1,183 @@ +""" +Copyright (c) Contributors to the Open 3D Engine Project. +For complete copyright and license terms please see the LICENSE at the root of this distribution. + +SPDX-License-Identifier: Apache-2.0 OR MIT + +import azlmbr.materialeditor will fail with a ModuleNotFound error when using this script with Editor.exe +This is because azlmbr.materialeditor only binds to MaterialEditor.exe and not Editor.exe +You need to launch this script with MaterialEditor.exe in order for azlmbr.materialeditor to appear. +""" + +import os +import sys +import time + +import azlmbr.math as math +import azlmbr.paths + +sys.path.append(os.path.join(azlmbr.paths.devassets, "Gem", "PythonTests")) + +import atom_renderer.atom_utils.material_editor_utils as material_editor + +NEW_MATERIAL = "test_material.material" +NEW_MATERIAL_1 = "test_material_1.material" +NEW_MATERIAL_2 = "test_material_2.material" +TEST_MATERIAL_1 = "001_DefaultWhite.material" +TEST_MATERIAL_2 = "002_BaseColorLerp.material" +TEST_MATERIAL_3 = "003_MetalMatte.material" +TEST_DATA_PATH = os.path.join( + azlmbr.paths.devroot, "Gems", "Atom", "TestData", "TestData", "Materials", "StandardPbrTestCases" +) +MATERIAL_TYPE_PATH = os.path.join( + azlmbr.paths.devroot, "Gems", "Atom", "Feature", "Common", "Assets", + "Materials", "Types", "StandardPBR.materialtype", +) + + +def run(): + """ + Summary: + Material Editor basic tests including the below + 1. Opening an Existing Asset + 2. Creating a New Asset + 3. Closing Selected Material + 4. Closing All Materials + 5. Closing all but Selected Material + 6. Saving Material + 7. Saving as a New Material + 8. Saving as a Child Material + 9. Saving all Open Materials + + Expected Result: + All the above functions work as expected in Material Editor. + + :return: None + """ + + # 1) Test Case: Opening an Existing Asset + document_id = material_editor.open_material(MATERIAL_TYPE_PATH) + print(f"Material opened: {material_editor.is_open(document_id)}") + + # Verify if the test material exists initially + target_path = os.path.join(azlmbr.paths.devroot, "AutomatedTesting", "Materials", NEW_MATERIAL) + print(f"Test asset doesn't exist initially: {not os.path.exists(target_path)}") + + # 2) Test Case: Creating a New Material Using Existing One + material_editor.save_document_as_child(document_id, target_path) + material_editor.wait_for_condition(lambda: os.path.exists(target_path), 2.0) + print(f"New asset created: {os.path.exists(target_path)}") + + # Verify if the newly created document is open + new_document_id = material_editor.open_material(target_path) + material_editor.wait_for_condition(lambda: material_editor.is_open(new_document_id)) + print(f"New Material opened: {material_editor.is_open(new_document_id)}") + + # 3) Test Case: Closing Selected Material + print(f"Material closed: {material_editor.close_document(new_document_id)}") + + # Open materials initially + document1_id, document2_id, document3_id = ( + material_editor.open_material(os.path.join(TEST_DATA_PATH, material)) + for material in [TEST_MATERIAL_1, TEST_MATERIAL_2, TEST_MATERIAL_3] + ) + + # 4) Test Case: Closing All Materials + print(f"All documents closed: {material_editor.close_all_documents()}") + + # 5) Test Case: Closing all but Selected Material + document1_id, document2_id, document3_id = ( + material_editor.open_material(os.path.join(TEST_DATA_PATH, material)) + for material in [TEST_MATERIAL_1, TEST_MATERIAL_2, TEST_MATERIAL_3] + ) + result = material_editor.close_all_except_selected(document1_id) + print(f"Close All Except Selected worked as expected: {result and material_editor.is_open(document1_id)}") + + # 6) Test Case: Saving Material + document_id = material_editor.open_material(os.path.join(TEST_DATA_PATH, TEST_MATERIAL_1)) + property_name = azlmbr.name.Name("baseColor.color") + initial_color = material_editor.get_property(document_id, property_name) + # Assign new color to the material file and save the actual material + expected_color = math.Color(0.25, 0.25, 0.25, 1.0) + material_editor.set_property(document_id, property_name, expected_color) + material_editor.save_document(document_id) + + # 7) Test Case: Saving as a New Material + # Assign new color to the material file and save the document as copy + expected_color_1 = math.Color(0.5, 0.5, 0.5, 1.0) + material_editor.set_property(document_id, property_name, expected_color_1) + target_path_1 = os.path.join(azlmbr.paths.devroot, "AutomatedTesting", "Materials", NEW_MATERIAL_1) + material_editor.save_document_as_copy(document_id, target_path_1) + time.sleep(2.0) + + # 8) Test Case: Saving as a Child Material + # Assign new color to the material file save the document as child + expected_color_2 = math.Color(0.75, 0.75, 0.75, 1.0) + material_editor.set_property(document_id, property_name, expected_color_2) + target_path_2 = os.path.join(azlmbr.paths.devroot, "AutomatedTesting", "Materials", NEW_MATERIAL_2) + material_editor.save_document_as_child(document_id, target_path_2) + time.sleep(2.0) + + # Close/Reopen documents + material_editor.close_all_documents() + document_id = material_editor.open_material(os.path.join(TEST_DATA_PATH, TEST_MATERIAL_1)) + document1_id = material_editor.open_material(target_path_1) + document2_id = material_editor.open_material(target_path_2) + + # Verify if the changes are saved in the actual document + actual_color = material_editor.get_property(document_id, property_name) + print(f"Actual Document saved with changes: {material_editor.compare_colors(actual_color, expected_color)}") + + # Verify if the changes are saved in the document saved as copy + actual_color = material_editor.get_property(document1_id, property_name) + result_copy = material_editor.compare_colors(actual_color, expected_color_1) + print(f"Document saved as copy is saved with changes: {result_copy}") + + # Verify if the changes are saved in the document saved as child + actual_color = material_editor.get_property(document2_id, property_name) + result_child = material_editor.compare_colors(actual_color, expected_color_2) + print(f"Document saved as child is saved with changes: {result_child}") + + # Revert back the changes in the actual document + material_editor.set_property(document_id, property_name, initial_color) + material_editor.save_document(document_id) + material_editor.close_all_documents() + + # 9) Test Case: Saving all Open Materials + # Open first material and make change to the values + document1_id = material_editor.open_material(os.path.join(TEST_DATA_PATH, TEST_MATERIAL_1)) + property1_name = azlmbr.name.Name("metallic.factor") + initial_metallic_factor = material_editor.get_property(document1_id, property1_name) + expected_metallic_factor = 0.444 + material_editor.set_property(document1_id, property1_name, expected_metallic_factor) + + # Open second material and make change to the values + document2_id = material_editor.open_material(os.path.join(TEST_DATA_PATH, TEST_MATERIAL_2)) + property2_name = azlmbr.name.Name("baseColor.color") + initial_color = material_editor.get_property(document2_id, property2_name) + expected_color = math.Color(0.4156, 0.0196, 0.6862, 1.0) + material_editor.set_property(document2_id, property2_name, expected_color) + + # Save all and close all documents + material_editor.save_all() + material_editor.close_all_documents() + + # Reopen materials and verify values + document1_id = material_editor.open_material(os.path.join(TEST_DATA_PATH, TEST_MATERIAL_1)) + result = material_editor.is_close( + material_editor.get_property(document1_id, property1_name), expected_metallic_factor, 0.00001 + ) + document2_id = material_editor.open_material(os.path.join(TEST_DATA_PATH, TEST_MATERIAL_2)) + result = result and material_editor.compare_colors( + expected_color, material_editor.get_property(document2_id, property2_name)) + print(f"Save All worked as expected: {result}") + + # Revert the changes made + material_editor.set_property(document1_id, property1_name, initial_metallic_factor) + material_editor.set_property(document2_id, property2_name, initial_color) + material_editor.save_all() + material_editor.close_all_documents() + + +if __name__ == "__main__": + run() diff --git a/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_hydra_scripts/hydra_GPUTest_AtomFeatureIntegrationBenchmark.py b/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_hydra_scripts/hydra_GPUTest_AtomFeatureIntegrationBenchmark.py index b899d7dcde..3aa9fe660c 100644 --- a/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_hydra_scripts/hydra_GPUTest_AtomFeatureIntegrationBenchmark.py +++ b/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_hydra_scripts/hydra_GPUTest_AtomFeatureIntegrationBenchmark.py @@ -93,6 +93,7 @@ def run(): general.idle_wait_frames(100) for i in range(1, 101): benchmarker.capture_pass_timestamp(i) + benchmarker.capture_cpu_frame_time(i) general.exit_game_mode() helper.wait_for_condition(function=lambda: not general.is_in_game_mode(), timeout_in_seconds=2.0) general.log("Capturing complete.") diff --git a/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_hydra_scripts/hydra_GPUTest_LightComponent.py b/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_hydra_scripts/hydra_GPUTest_LightComponent.py new file mode 100644 index 0000000000..8063445608 --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_hydra_scripts/hydra_GPUTest_LightComponent.py @@ -0,0 +1,267 @@ +""" +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 + +Hydra script that is used to create an entity with a Light component attached. +It then updates the property values of the Light component and takes a screenshot. +The screenshot is compared against an expected golden image for test verification. + +See the run() function for more in-depth test info. +""" +import os +import sys + +import azlmbr.asset as asset +import azlmbr.bus as bus +import azlmbr.editor as editor +import azlmbr.math as math +import azlmbr.paths +import azlmbr.legacy.general as general + +sys.path.append(os.path.join(azlmbr.paths.devroot, "AutomatedTesting", "Gem", "PythonTests")) + +import editor_python_test_tools.hydra_editor_utils as hydra +from atom_renderer.atom_utils import atom_component_helper, atom_constants, screenshot_utils +from editor_python_test_tools.editor_test_helper import EditorTestHelper + +helper = EditorTestHelper(log_prefix="Atom_EditorTestHelper") + +LEVEL_NAME = "auto_test" +LIGHT_COMPONENT = "Light" +LIGHT_TYPE_PROPERTY = 'Controller|Configuration|Light type' +DEGREE_RADIAN_FACTOR = 0.0174533 + + +def run(): + """ + Sets up the tests by making sure the required level is created & setup correctly. + It then executes 2 test cases - see each associated test function's docstring for more info. + + Finally prints the string "Light component tests completed" after completion + + Tests will fail immediately if any of these log lines are found: + 1. Trace::Assert + 2. Trace::Error + 3. Traceback (most recent call last): + + :return: None + """ + atom_component_helper.create_basic_atom_level(level_name=LEVEL_NAME) + + # Run tests. + area_light_test() + spot_light_test() + general.log("Light component tests completed.") + + +def area_light_test(): + """ + Basic test for the "Light" component attached to an "area_light" entity. + + Test Case - Light Component: Capsule, Spot (disk), and Point (sphere): + 1. Creates "area_light" entity w/ a Light component that has a Capsule Light type w/ the color set to 255, 0, 0 + 2. Enters game mode to take a screenshot for comparison, then exits game mode. + 3. Sets the Light component Intensity Mode to Lumens (default). + 4. Ensures the Light component Mode is Automatic (default). + 5. Sets the Intensity value of the Light component to 0.0 + 6. Enters game mode again, takes another screenshot for comparison, then exits game mode. + 7. Updates the Intensity value of the Light component to 1000.0 + 8. Enters game mode again, takes another screenshot for comparison, then exits game mode. + 9. Swaps the Capsule light type option to Spot (disk) light type on the Light component + 10. Updates "area_light" entity Transform rotate value to x: 90.0, y:0.0, z:0.0 + 11. Enters game mode again, takes another screenshot for comparison, then exits game mode. + 12. Swaps the Spot (disk) light type for the Point (sphere) light type in the Light component. + 13. Enters game mode again, takes another screenshot for comparison, then exits game mode. + 14. Deletes the Light component from the "area_light" entity and verifies its successful. + """ + # Create an "area_light" entity with "Light" component using Light type of "Capsule" + area_light_entity_name = "area_light" + area_light = hydra.Entity(area_light_entity_name) + area_light.create_entity(math.Vector3(-1.0, -2.0, 3.0), [LIGHT_COMPONENT]) + general.log( + f"{area_light_entity_name}_test: Component added to the entity: " + f"{hydra.has_components(area_light.id, [LIGHT_COMPONENT])}") + light_component_id_pair = hydra.attach_component_to_entity(area_light.id, LIGHT_COMPONENT) + + # Select the "Capsule" light type option. + azlmbr.editor.EditorComponentAPIBus( + azlmbr.bus.Broadcast, + 'SetComponentProperty', + light_component_id_pair, + LIGHT_TYPE_PROPERTY, + atom_constants.LIGHT_TYPES['capsule'] + ) + + # Update color and take screenshot in game mode + color = math.Color(255.0, 0.0, 0.0, 0.0) + area_light.get_set_test(0, "Controller|Configuration|Color", color) + general.idle_wait(1.0) + screenshot_utils.take_screenshot_game_mode("AreaLight_1", area_light_entity_name) + + # Update intensity value to 0.0 and take screenshot in game mode + area_light.get_set_test(0, "Controller|Configuration|Attenuation Radius|Mode", 1) + area_light.get_set_test(0, "Controller|Configuration|Intensity", 0.0) + general.idle_wait(1.0) + screenshot_utils.take_screenshot_game_mode("AreaLight_2", area_light_entity_name) + + # Update intensity value to 1000.0 and take screenshot in game mode + area_light.get_set_test(0, "Controller|Configuration|Intensity", 1000.0) + general.idle_wait(1.0) + screenshot_utils.take_screenshot_game_mode("AreaLight_3", area_light_entity_name) + + # Swap the "Capsule" light type option to "Spot (disk)" light type + azlmbr.editor.EditorComponentAPIBus( + azlmbr.bus.Broadcast, + 'SetComponentProperty', + light_component_id_pair, + LIGHT_TYPE_PROPERTY, + atom_constants.LIGHT_TYPES['spot_disk'] + ) + area_light_rotation = math.Vector3(DEGREE_RADIAN_FACTOR * 90.0, 0.0, 0.0) + azlmbr.components.TransformBus(azlmbr.bus.Event, "SetLocalRotation", area_light.id, area_light_rotation) + general.idle_wait(1.0) + screenshot_utils.take_screenshot_game_mode("AreaLight_4", area_light_entity_name) + + # Swap the "Spot (disk)" light type to the "Point (sphere)" light type and take screenshot. + azlmbr.editor.EditorComponentAPIBus( + azlmbr.bus.Broadcast, + 'SetComponentProperty', + light_component_id_pair, + LIGHT_TYPE_PROPERTY, + atom_constants.LIGHT_TYPES['sphere'] + ) + general.idle_wait(1.0) + screenshot_utils.take_screenshot_game_mode("AreaLight_5", area_light_entity_name) + + editor.ToolsApplicationRequestBus(bus.Broadcast, "DeleteEntityById", area_light.id) + + +def spot_light_test(): + """ + Basic test for the Light component attached to a "spot_light" entity. + + Test Case - Light Component: Spot (disk) with shadows & colors: + 1. Creates "spot_light" entity w/ a Light component attached to it. + 2. Selects the "directional_light" entity already present in the level and disables it. + 3. Selects the "global_skylight" entity already present in the level and disables the HDRi Skybox component, + as well as the Global Skylight (IBL) component. + 4. Enters game mode to take a screenshot for comparison, then exits game mode. + 5. Selects the "ground_plane" entity and changes updates the material to a new material. + 6. Enters game mode to take a screenshot for comparison, then exits game mode. + 7. Selects the "spot_light" entity and increases the Light component Intensity to 800 lm + 8. Enters game mode to take a screenshot for comparison, then exits game mode. + 9. Selects the "spot_light" entity and sets the Light component Color to 47, 75, 37 + 10. Enters game mode to take a screenshot for comparison, then exits game mode. + 11. Selects the "spot_light" entity and modifies the Shutter controls to the following values: + - Enable shutters: True + - Inner Angle: 60.0 + - Outer Angle: 75.0 + 12. Enters game mode to take a screenshot for comparison, then exits game mode. + 13. Selects the "spot_light" entity and modifies the Shadow controls to the following values: + - Enable Shadow: True + - ShadowmapSize: 256 + 14. Modifies the world translate position of the "spot_light" entity to 0.7, -2.0, 1.9 (for casting shadows better) + 15. Enters game mode to take a screenshot for comparison, then exits game mode. + """ + # Disable "Directional Light" component for the "directional_light" entity + # "directional_light" entity is created by the create_basic_atom_level() function by default. + directional_light_entity_id = hydra.find_entity_by_name("directional_light") + directional_light = hydra.Entity(name='directional_light', id=directional_light_entity_id) + directional_light_component_type = azlmbr.editor.EditorComponentAPIBus( + azlmbr.bus.Broadcast, 'FindComponentTypeIdsByEntityType', ["Directional Light"], 0)[0] + directional_light_component = azlmbr.editor.EditorComponentAPIBus( + azlmbr.bus.Broadcast, 'GetComponentOfType', directional_light.id, directional_light_component_type + ).GetValue() + editor.EditorComponentAPIBus(bus.Broadcast, "DisableComponents", [directional_light_component]) + general.idle_wait(0.5) + + # Disable "Global Skylight (IBL)" and "HDRi Skybox" components for the "global_skylight" entity + global_skylight_entity_id = hydra.find_entity_by_name("global_skylight") + global_skylight = hydra.Entity(name='global_skylight', id=global_skylight_entity_id) + global_skylight_component_type = azlmbr.editor.EditorComponentAPIBus( + azlmbr.bus.Broadcast, 'FindComponentTypeIdsByEntityType', ["Global Skylight (IBL)"], 0)[0] + global_skylight_component = azlmbr.editor.EditorComponentAPIBus( + azlmbr.bus.Broadcast, 'GetComponentOfType', global_skylight.id, global_skylight_component_type + ).GetValue() + editor.EditorComponentAPIBus(bus.Broadcast, "DisableComponents", [global_skylight_component]) + hdri_skybox_component_type = azlmbr.editor.EditorComponentAPIBus( + azlmbr.bus.Broadcast, 'FindComponentTypeIdsByEntityType', ["HDRi Skybox"], 0)[0] + hdri_skybox_component = azlmbr.editor.EditorComponentAPIBus( + azlmbr.bus.Broadcast, 'GetComponentOfType', global_skylight.id, hdri_skybox_component_type + ).GetValue() + editor.EditorComponentAPIBus(bus.Broadcast, "DisableComponents", [hdri_skybox_component]) + general.idle_wait(0.5) + + # Create a "spot_light" entity with "Light" component using Light Type of "Spot (disk)" + spot_light_entity_name = "spot_light" + spot_light = hydra.Entity(spot_light_entity_name) + spot_light.create_entity(math.Vector3(0.7, -2.0, 1.0), [LIGHT_COMPONENT]) + general.log( + f"{spot_light_entity_name}_test: Component added to the entity: " + f"{hydra.has_components(spot_light.id, [LIGHT_COMPONENT])}") + rotation = math.Vector3(DEGREE_RADIAN_FACTOR * 300.0, 0.0, 0.0) + azlmbr.components.TransformBus(azlmbr.bus.Event, "SetLocalRotation", spot_light.id, rotation) + light_component_type = hydra.attach_component_to_entity(spot_light.id, LIGHT_COMPONENT) + editor.EditorComponentAPIBus( + azlmbr.bus.Broadcast, + 'SetComponentProperty', + light_component_type, + LIGHT_TYPE_PROPERTY, + atom_constants.LIGHT_TYPES['spot_disk'] + ) + + general.idle_wait(1.0) + screenshot_utils.take_screenshot_game_mode("SpotLight_1", spot_light_entity_name) + + # Change default material of ground plane entity and take screenshot + ground_plane_entity_id = hydra.find_entity_by_name("ground_plane") + ground_plane = hydra.Entity(name='ground_plane', id=ground_plane_entity_id) + ground_plane_asset_path = os.path.join("Materials", "Presets", "MacBeth", "22_neutral_5-0_0-70d.azmaterial") + ground_plane_asset_value = asset.AssetCatalogRequestBus( + bus.Broadcast, "GetAssetIdByPath", ground_plane_asset_path, math.Uuid(), False) + material_property_path = "Default Material|Material Asset" + material_component_type = azlmbr.editor.EditorComponentAPIBus( + azlmbr.bus.Broadcast, 'FindComponentTypeIdsByEntityType', ["Material"], 0)[0] + material_component = azlmbr.editor.EditorComponentAPIBus( + azlmbr.bus.Broadcast, 'GetComponentOfType', ground_plane.id, material_component_type).GetValue() + editor.EditorComponentAPIBus( + azlmbr.bus.Broadcast, + 'SetComponentProperty', + material_component, + material_property_path, + ground_plane_asset_value + ) + general.idle_wait(1.0) + screenshot_utils.take_screenshot_game_mode("SpotLight_2", spot_light_entity_name) + + # Increase intensity value of the Spot light and take screenshot in game mode + spot_light.get_set_test(0, "Controller|Configuration|Intensity", 800.0) + general.idle_wait(1.0) + screenshot_utils.take_screenshot_game_mode("SpotLight_3", spot_light_entity_name) + + # Update the Spot light color and take screenshot in game mode + color_value = math.Color(47.0 / 255.0, 75.0 / 255.0, 37.0 / 255.0, 255.0 / 255.0) + spot_light.get_set_test(0, "Controller|Configuration|Color", color_value) + general.idle_wait(1.0) + screenshot_utils.take_screenshot_game_mode("SpotLight_4", spot_light_entity_name) + + # Update the Shutter controls of the Light component and take screenshot + spot_light.get_set_test(0, "Controller|Configuration|Shutters|Enable shutters", True) + spot_light.get_set_test(0, "Controller|Configuration|Shutters|Inner angle", 60.0) + spot_light.get_set_test(0, "Controller|Configuration|Shutters|Outer angle", 75.0) + general.idle_wait(1.0) + screenshot_utils.take_screenshot_game_mode("SpotLight_5", spot_light_entity_name) + + # Update the Shadow controls, move the spot_light entity world translate position and take screenshot + spot_light.get_set_test(0, "Controller|Configuration|Shadows|Enable shadow", True) + spot_light.get_set_test(0, "Controller|Configuration|Shadows|Shadowmap size", 256.0) + azlmbr.components.TransformBus( + azlmbr.bus.Event, "SetWorldTranslation", spot_light.id, math.Vector3(0.7, -2.0, 1.9)) + general.idle_wait(1.0) + screenshot_utils.take_screenshot_game_mode("SpotLight_6", spot_light_entity_name) + + +if __name__ == "__main__": + run() diff --git a/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_utils/atom_component_helper.py b/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_utils/atom_component_helper.py index de4e28bb36..58b72ef01a 100644 --- a/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_utils/atom_component_helper.py +++ b/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_utils/atom_component_helper.py @@ -3,17 +3,184 @@ Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright SPDX-License-Identifier: Apache-2.0 OR MIT -File to assist with common hydra component functions or constants used across various Atom tests. +File to assist with common hydra component functions used across various Atom tests. """ +import os -# Light type options for the Light component. -LIGHT_TYPES = { - 'unknown': 0, - 'sphere': 1, - 'spot_disk': 2, - 'capsule': 3, - 'quad': 4, - 'polygon': 5, - 'simple_point': 6, - 'simple_spot': 7, -} +from editor_python_test_tools.editor_test_helper import EditorTestHelper + +helper = EditorTestHelper(log_prefix="Atom_EditorTestHelper") + + +def create_basic_atom_level(level_name): + """ + Creates a new level inside the Editor matching level_name & adds the following: + 1. "default_level" entity to hold all other entities. + 2. Adds Grid, Global Skylight (IBL), ground Mesh, Directional Light, Sphere w/ material+mesh, & Camera components. + 3. Each of these components has its settings tweaked slightly to match the ideal scene to test Atom rendering. + :param level_name: name of the level to create and apply this basic setup to. + :return: None + """ + import azlmbr.asset as asset + import azlmbr.bus as bus + import azlmbr.camera as camera + import azlmbr.editor as editor + import azlmbr.entity as entity + import azlmbr.legacy.general as general + import azlmbr.math as math + import azlmbr.object + + import editor_python_test_tools.hydra_editor_utils as hydra + + # Create a new level. + new_level_name = level_name + heightmap_resolution = 512 + heightmap_meters_per_pixel = 1 + terrain_texture_resolution = 412 + use_terrain = False + + # Return codes are ECreateLevelResult defined in CryEdit.h + return_code = general.create_level_no_prompt( + new_level_name, heightmap_resolution, heightmap_meters_per_pixel, terrain_texture_resolution, use_terrain) + if return_code == 1: + general.log(f"{new_level_name} level already exists") + elif return_code == 2: + general.log("Failed to create directory") + elif return_code == 3: + general.log("Directory length is too long") + elif return_code != 0: + general.log("Unknown error, failed to create level") + else: + general.log(f"{new_level_name} level created successfully") + + # Enable idle and update viewport. + general.idle_enable(True) + general.idle_wait(1.0) + general.update_viewport() + general.idle_wait(0.5) # half a second is more than enough for updating the viewport. + + # Close out problematic windows, FPS meters, and anti-aliasing. + if general.is_helpers_shown(): # Turn off the helper gizmos if visible + general.toggle_helpers() + general.idle_wait(1.0) + if general.is_pane_visible("Error Report"): # Close Error Report windows that block focus. + general.close_pane("Error Report") + if general.is_pane_visible("Error Log"): # Close Error Log windows that block focus. + general.close_pane("Error Log") + general.idle_wait(1.0) + general.run_console("r_displayInfo=0") + general.run_console("r_antialiasingmode=0") + general.idle_wait(1.0) + + # Delete all existing entities & create default_level entity + search_filter = azlmbr.entity.SearchFilter() + all_entities = entity.SearchBus(azlmbr.bus.Broadcast, "SearchEntities", search_filter) + editor.ToolsApplicationRequestBus(bus.Broadcast, "DeleteEntities", all_entities) + default_level = hydra.Entity("default_level") + default_position = math.Vector3(0.0, 0.0, 0.0) + default_level.create_entity(default_position, ["Grid"]) + default_level.get_set_test(0, "Controller|Configuration|Secondary Grid Spacing", 1.0) + + # Set the viewport up correctly after adding the parent default_level entity. + screen_width = 1280 + screen_height = 720 + degree_radian_factor = 0.0174533 # Used by "Rotation" property for the Transform component. + general.set_viewport_size(screen_width, screen_height) + general.update_viewport() + helper.wait_for_condition( + function=lambda: helper.isclose(a=general.get_viewport_size().x, b=screen_width, rel_tol=0.1) + and helper.isclose(a=general.get_viewport_size().y, b=screen_height, rel_tol=0.1), + timeout_in_seconds=4.0 + ) + result = helper.isclose(a=general.get_viewport_size().x, b=screen_width, rel_tol=0.1) and helper.isclose( + a=general.get_viewport_size().y, b=screen_height, rel_tol=0.1) + general.log(general.get_viewport_size().x) + general.log(general.get_viewport_size().y) + general.log(general.get_viewport_size().z) + general.log(f"Viewport is set to the expected size: {result}") + general.log("Basic level created") + general.run_console("r_DisplayInfo = 0") + + # Create global_skylight entity and set the properties + global_skylight = hydra.Entity("global_skylight") + global_skylight.create_entity( + entity_position=default_position, + components=["HDRi Skybox", "Global Skylight (IBL)"], + parent_id=default_level.id) + global_skylight_asset_path = os.path.join( + "LightingPresets", "greenwich_park_02_4k_iblskyboxcm_iblspecular.exr.streamingimage") + global_skylight_asset_value = asset.AssetCatalogRequestBus( + bus.Broadcast, "GetAssetIdByPath", global_skylight_asset_path, math.Uuid(), False) + global_skylight.get_set_test(0, "Controller|Configuration|Cubemap Texture", global_skylight_asset_value) + global_skylight.get_set_test(1, "Controller|Configuration|Diffuse Image", global_skylight_asset_value) + global_skylight.get_set_test(1, "Controller|Configuration|Specular Image", global_skylight_asset_value) + + # Create ground_plane entity and set the properties + ground_plane = hydra.Entity("ground_plane") + ground_plane.create_entity( + entity_position=default_position, + components=["Material"], + parent_id=default_level.id) + azlmbr.components.TransformBus(azlmbr.bus.Event, "SetLocalUniformScale", ground_plane.id, 32.0) + ground_plane_material_asset_path = os.path.join( + "Materials", "Presets", "PBR", "metal_chrome.azmaterial") + ground_plane_material_asset_value = asset.AssetCatalogRequestBus( + bus.Broadcast, "GetAssetIdByPath", ground_plane_material_asset_path, math.Uuid(), False) + ground_plane.get_set_test(0, "Default Material|Material Asset", ground_plane_material_asset_value) + + # Work around to add the correct Atom Mesh component + mesh_type_id = azlmbr.globals.property.EditorMeshComponentTypeId + ground_plane.components.append( + editor.EditorComponentAPIBus( + bus.Broadcast, "AddComponentsOfType", ground_plane.id, [mesh_type_id] + ).GetValue()[0] + ) + ground_plane_mesh_asset_path = os.path.join("Models", "plane.azmodel") + ground_plane_mesh_asset_value = asset.AssetCatalogRequestBus( + bus.Broadcast, "GetAssetIdByPath", ground_plane_mesh_asset_path, math.Uuid(), False) + ground_plane.get_set_test(1, "Controller|Configuration|Mesh Asset", ground_plane_mesh_asset_value) + + # Create directional_light entity and set the properties + directional_light = hydra.Entity("directional_light") + directional_light.create_entity( + entity_position=math.Vector3(0.0, 0.0, 10.0), + components=["Directional Light"], + parent_id=default_level.id) + directional_light_rotation = math.Vector3(degree_radian_factor * -90.0, 0.0, 0.0) + azlmbr.components.TransformBus( + azlmbr.bus.Event, "SetLocalRotation", directional_light.id, directional_light_rotation) + + # Create sphere entity and set the properties + sphere_entity = hydra.Entity("sphere") + sphere_entity.create_entity( + entity_position=math.Vector3(0.0, 0.0, 1.0), + components=["Material"], + parent_id=default_level.id) + sphere_material_asset_path = os.path.join("Materials", "Presets", "PBR", "metal_brass_polished.azmaterial") + sphere_material_asset_value = asset.AssetCatalogRequestBus( + bus.Broadcast, "GetAssetIdByPath", sphere_material_asset_path, math.Uuid(), False) + sphere_entity.get_set_test(0, "Default Material|Material Asset", sphere_material_asset_value) + + # Work around to add the correct Atom Mesh component + sphere_entity.components.append( + editor.EditorComponentAPIBus( + bus.Broadcast, "AddComponentsOfType", sphere_entity.id, [mesh_type_id] + ).GetValue()[0] + ) + sphere_mesh_asset_path = os.path.join("Models", "sphere.azmodel") + sphere_mesh_asset_value = asset.AssetCatalogRequestBus( + bus.Broadcast, "GetAssetIdByPath", sphere_mesh_asset_path, math.Uuid(), False) + sphere_entity.get_set_test(1, "Controller|Configuration|Mesh Asset", sphere_mesh_asset_value) + + # Create camera component and set the properties + camera_entity = hydra.Entity("camera") + camera_entity.create_entity( + entity_position=math.Vector3(5.5, -12.0, 9.0), + components=["Camera"], + parent_id=default_level.id) + rotation = math.Vector3( + degree_radian_factor * -27.0, degree_radian_factor * -12.0, degree_radian_factor * 25.0 + ) + azlmbr.components.TransformBus(azlmbr.bus.Event, "SetLocalRotation", camera_entity.id, rotation) + camera_entity.get_set_test(0, "Controller|Configuration|Field of view", 60.0) + camera.EditorCameraViewRequestBus(azlmbr.bus.Event, "ToggleCameraAsActiveView", camera_entity.id) diff --git a/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_utils/atom_constants.py b/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_utils/atom_constants.py new file mode 100644 index 0000000000..88a959f198 --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_utils/atom_constants.py @@ -0,0 +1,19 @@ +""" +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 + +Hold constants used across both hydra and non-hydra scripts. +""" + +# Light type options for the Light component. +LIGHT_TYPES = { + 'unknown': 0, + 'sphere': 1, + 'spot_disk': 2, + 'capsule': 3, + 'quad': 4, + 'polygon': 5, + 'simple_point': 6, + 'simple_spot': 7, +} diff --git a/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_utils/benchmark_utils.py b/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_utils/benchmark_utils.py index 21c7489ed3..b4fdfcb8a0 100644 --- a/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_utils/benchmark_utils.py +++ b/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_utils/benchmark_utils.py @@ -61,6 +61,25 @@ class BenchmarkHelper(object): general.log('Failed to capture pass timestamps.') return self.capturedData + def capture_cpu_frame_time(self, frame_number): + """ + Capture CPU frame times and block further execution until it has been written to the disk. + """ + self.handler = azlmbr.atom.ProfilingCaptureNotificationBusHandler() + self.handler.connect() + self.handler.add_callback('OnCaptureCpuFrameTimeFinished', self.on_data_captured) + + self.done = False + self.capturedData = False + success = azlmbr.atom.ProfilingCaptureRequestBus( + azlmbr.bus.Broadcast, "CaptureCpuFrameTime", f'{self.output_path}/cpu_frame{frame_number}_time.json') + if success: + self.wait_until_data() + general.log('CPU frame time captured.') + else: + general.log('Failed to capture CPU frame time.') + return self.capturedData + def on_data_captured(self, parameters): # the parameters come in as a tuple if parameters[0]: diff --git a/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_utils/material_editor_utils.py b/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_utils/material_editor_utils.py new file mode 100644 index 0000000000..ef0a592df0 --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_utils/material_editor_utils.py @@ -0,0 +1,274 @@ +""" +Copyright (c) Contributors to the Open 3D Engine Project. +For complete copyright and license terms please see the LICENSE at the root of this distribution. + +SPDX-License-Identifier: Apache-2.0 OR MIT + +import azlmbr.materialeditor will fail with a ModuleNotFound error when using this script with Editor.exe +This is because azlmbr.materialeditor only binds to MaterialEditor.exe and not Editor.exe +You need to launch this script with MaterialEditor.exe in order for azlmbr.materialeditor to appear. +""" + +import os +import sys +import time +import azlmbr.atom +import azlmbr.atomtools as atomtools +import azlmbr.materialeditor as materialeditor +import azlmbr.bus as bus + + +def is_close(actual, expected, buffer=sys.float_info.min): + """ + :param actual: actual value + :param expected: expected value + :param buffer: acceptable variation from expected + :return: bool + """ + return abs(actual - expected) < buffer + + +def compare_colors(color1, color2, buffer=0.00001): + """ + Compares the red, green and blue properties of a color allowing a slight variance of buffer + :param color1: first color to compare + :param color2: second color + :param buffer: allowed variance in individual color value + :return: bool + """ + return ( + is_close(color1.r, color2.r, buffer) + and is_close(color1.g, color2.g, buffer) + and is_close(color1.b, color2.b, buffer) + ) + + +def open_material(file_path): + """ + :return: uuid of material document opened + """ + return azlmbr.atomtools.AtomToolsDocumentSystemRequestBus(bus.Broadcast, "OpenDocument", file_path) + + +def is_open(document_id): + """ + :return: bool + """ + return azlmbr.atomtools.AtomToolsDocumentRequestBus(bus.Event, "IsOpen", document_id) + + +def save_document(document_id): + """ + :return: bool success + """ + return azlmbr.atomtools.AtomToolsDocumentSystemRequestBus(bus.Broadcast, "SaveDocument", document_id) + + +def save_document_as_copy(document_id, target_path): + """ + :return: bool success + """ + return azlmbr.atomtools.AtomToolsDocumentSystemRequestBus( + bus.Broadcast, "SaveDocumentAsCopy", document_id, target_path + ) + + +def save_document_as_child(document_id, target_path): + """ + :return: bool success + """ + return azlmbr.atomtools.AtomToolsDocumentSystemRequestBus( + bus.Broadcast, "SaveDocumentAsChild", document_id, target_path + ) + + +def save_all(): + """ + :return: bool success + """ + return azlmbr.atomtools.AtomToolsDocumentSystemRequestBus(bus.Broadcast, "SaveAllDocuments") + + +def close_document(document_id): + """ + :return: bool success + """ + return azlmbr.atomtools.AtomToolsDocumentSystemRequestBus(bus.Broadcast, "CloseDocument", document_id) + + +def close_all_documents(): + """ + :return: bool success + """ + return azlmbr.atomtools.AtomToolsDocumentSystemRequestBus(bus.Broadcast, "CloseAllDocuments") + + +def close_all_except_selected(document_id): + """ + :return: bool success + """ + return azlmbr.atomtools.AtomToolsDocumentSystemRequestBus(bus.Broadcast, "CloseAllDocumentsExcept", document_id) + + +def get_property(document_id, property_name): + """ + :return: property value or invalid value if the document is not open or the property_name can't be found + """ + return azlmbr.atomtools.AtomToolsDocumentRequestBus(bus.Event, "GetPropertyValue", document_id, property_name) + + +def set_property(document_id, property_name, value): + azlmbr.atomtools.AtomToolsDocumentRequestBus(bus.Event, "SetPropertyValue", document_id, property_name, value) + + +def is_pane_visible(pane_name): + """ + :return: bool + """ + return atomtools.AtomToolsWindowRequestBus(bus.Broadcast, "IsDockWidgetVisible", pane_name) + + +def set_pane_visibility(pane_name, value): + atomtools.AtomToolsWindowRequestBus(bus.Broadcast, "SetDockWidgetVisible", pane_name, value) + + +def select_lighting_config(config_name): + azlmbr.materialeditor.MaterialViewportRequestBus(azlmbr.bus.Broadcast, "SelectLightingPresetByName", config_name) + + +def set_grid_enable_disable(value): + azlmbr.materialeditor.MaterialViewportRequestBus(azlmbr.bus.Broadcast, "SetGridEnabled", value) + + +def get_grid_enable_disable(): + """ + :return: bool + """ + return azlmbr.materialeditor.MaterialViewportRequestBus(azlmbr.bus.Broadcast, "GetGridEnabled") + + +def set_shadowcatcher_enable_disable(value): + azlmbr.materialeditor.MaterialViewportRequestBus(azlmbr.bus.Broadcast, "SetShadowCatcherEnabled", value) + + +def get_shadowcatcher_enable_disable(): + """ + :return: bool + """ + return azlmbr.materialeditor.MaterialViewportRequestBus(azlmbr.bus.Broadcast, "GetShadowCatcherEnabled") + + +def select_model_config(configname): + azlmbr.materialeditor.MaterialViewportRequestBus(azlmbr.bus.Broadcast, "SelectModelPresetByName", configname) + + +def wait_for_condition(function, timeout_in_seconds=1.0): + # type: (function, float) -> bool + """ + Function to run until it returns True or timeout is reached + the function can have no parameters and + waiting idle__wait_* is handled here not in the function + + :param function: a function that returns a boolean indicating a desired condition is achieved + :param timeout_in_seconds: when reached, function execution is abandoned and False is returned + """ + with Timeout(timeout_in_seconds) as t: + while True: + try: + azlmbr.atomtools.general.idle_wait_frames(1) + except Exception: + print("WARNING: Couldn't wait for frame") + + if t.timed_out: + return False + + ret = function() + if not isinstance(ret, bool): + raise TypeError("return value for wait_for_condition function must be a bool") + if ret: + return True + + +class Timeout: + # type: (float) -> None + """ + contextual timeout + :param seconds: float seconds to allow before timed_out is True + """ + + def __init__(self, seconds): + self.seconds = seconds + + def __enter__(self): + self.die_after = time.time() + self.seconds + return self + + def __exit__(self, type, value, traceback): + pass + + @property + def timed_out(self): + return time.time() > self.die_after + + +screenshotsFolder = os.path.join(azlmbr.paths.devroot, "AtomTest", "Cache" "pc", "Screenshots") + + +class ScreenshotHelper: + """ + A helper to capture screenshots and wait for them. + """ + + def __init__(self, idle_wait_frames_callback): + super().__init__() + self.done = False + self.capturedScreenshot = False + self.max_frames_to_wait = 60 + + self.idle_wait_frames_callback = idle_wait_frames_callback + + def capture_screenshot_blocking(self, filename): + """ + Capture a screenshot and block the execution until the screenshot has been written to the disk. + """ + self.handler = azlmbr.atom.FrameCaptureNotificationBusHandler() + self.handler.connect() + self.handler.add_callback("OnCaptureFinished", self.on_screenshot_captured) + + self.done = False + self.capturedScreenshot = False + success = azlmbr.atom.FrameCaptureRequestBus(azlmbr.bus.Broadcast, "CaptureScreenshot", filename) + if success: + self.wait_until_screenshot() + print("Screenshot taken.") + else: + print("screenshot failed") + return self.capturedScreenshot + + def on_screenshot_captured(self, parameters): + # the parameters come in as a tuple + if parameters[0]: + print("screenshot saved: {}".format(parameters[1])) + self.capturedScreenshot = True + else: + print("screenshot failed: {}".format(parameters[1])) + self.done = True + self.handler.disconnect() + + def wait_until_screenshot(self): + frames_waited = 0 + while self.done == False: + self.idle_wait_frames_callback(1) + if frames_waited > self.max_frames_to_wait: + print("timeout while waiting for the screenshot to be written") + self.handler.disconnect() + break + else: + frames_waited = frames_waited + 1 + print("(waited {} frames)".format(frames_waited)) + + +def capture_screenshot(file_path): + return ScreenshotHelper(azlmbr.atomtools.general.idle_wait_frames).capture_screenshot_blocking( + os.path.join(file_path) + ) diff --git a/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_utils/screenshot_utils.py b/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_utils/screenshot_utils.py index 28a4037dcc..a7a02816ac 100644 --- a/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_utils/screenshot_utils.py +++ b/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_utils/screenshot_utils.py @@ -91,3 +91,20 @@ class ScreenshotHelper(object): else: frames_waited = frames_waited + 1 general.log(f"(waited {frames_waited} frames)") + + +def take_screenshot_game_mode(screenshot_name, entity_name=None): + """ + Enters game mode & takes a screenshot, then exits game mode after. + :param screenshot_name: name to give the captured screenshot .ppm file. + :param entity_name: name of the entity being tested (for generating unique log lines). + :return: None + """ + general.enter_game_mode() + helper.wait_for_condition(lambda: general.is_in_game_mode(), 2.0) + general.log(f"{entity_name}_test: Entered game mode: {general.is_in_game_mode()}") + ScreenshotHelper(general.idle_wait_frames).capture_screenshot_blocking(f"{screenshot_name}.ppm") + general.idle_wait(1.0) + general.exit_game_mode() + helper.wait_for_condition(lambda: not general.is_in_game_mode(), 2.0) + general.log(f"{entity_name}_test: Exit game mode: {not general.is_in_game_mode()}") diff --git a/AutomatedTesting/Gem/PythonTests/atom_renderer/golden_images/AreaLight_1.ppm b/AutomatedTesting/Gem/PythonTests/atom_renderer/golden_images/AreaLight_1.ppm new file mode 100644 index 0000000000..0725999dcf --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/atom_renderer/golden_images/AreaLight_1.ppm @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:954d7d0df47c840a24e313893800eb3126d0c0d47c3380926776b51833778db7 +size 6220817 diff --git a/AutomatedTesting/Gem/PythonTests/atom_renderer/golden_images/AreaLight_2.ppm b/AutomatedTesting/Gem/PythonTests/atom_renderer/golden_images/AreaLight_2.ppm new file mode 100644 index 0000000000..3a45bd31e3 --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/atom_renderer/golden_images/AreaLight_2.ppm @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e81c19128f42ba362a2d5f3ccf159dfbc942d67ceeb1ac8c21f295a6fd9d2ce5 +size 6220817 diff --git a/AutomatedTesting/Gem/PythonTests/atom_renderer/golden_images/AreaLight_3.ppm b/AutomatedTesting/Gem/PythonTests/atom_renderer/golden_images/AreaLight_3.ppm new file mode 100644 index 0000000000..15d679b784 --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/atom_renderer/golden_images/AreaLight_3.ppm @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5e20801213e065b6ea8c95ede81c23faa9b6dc70a2002dc5bced293e1bed989f +size 6220817 diff --git a/AutomatedTesting/Gem/PythonTests/atom_renderer/golden_images/AreaLight_4.ppm b/AutomatedTesting/Gem/PythonTests/atom_renderer/golden_images/AreaLight_4.ppm new file mode 100644 index 0000000000..85c083a386 --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/atom_renderer/golden_images/AreaLight_4.ppm @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e250f812e594e5152bf2d6f23caa8b53b78276bfdf344d7a8d355dd96cb995c0 +size 6220817 diff --git a/AutomatedTesting/Gem/PythonTests/atom_renderer/golden_images/AreaLight_5.ppm b/AutomatedTesting/Gem/PythonTests/atom_renderer/golden_images/AreaLight_5.ppm new file mode 100644 index 0000000000..d575de761e --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/atom_renderer/golden_images/AreaLight_5.ppm @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:95be359041f8291c74b335297a4dfe9902a180510f24a181b15e1a5ba4d3b024 +size 6220817 diff --git a/AutomatedTesting/Gem/PythonTests/atom_renderer/golden_images/SpotLight_1.ppm b/AutomatedTesting/Gem/PythonTests/atom_renderer/golden_images/SpotLight_1.ppm new file mode 100644 index 0000000000..bbbd127929 --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/atom_renderer/golden_images/SpotLight_1.ppm @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:118e43e4b915e262726183467cc4b82f244565213fea5b6bfe02be07f0851ab1 +size 6220817 diff --git a/AutomatedTesting/Gem/PythonTests/atom_renderer/golden_images/SpotLight_2.ppm b/AutomatedTesting/Gem/PythonTests/atom_renderer/golden_images/SpotLight_2.ppm new file mode 100644 index 0000000000..8e716fabcc --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/atom_renderer/golden_images/SpotLight_2.ppm @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dc2ce3256a6552975962c9e113c52c1a22bf3817d417151f6f60640dd568e0fa +size 6220817 diff --git a/AutomatedTesting/Gem/PythonTests/atom_renderer/golden_images/SpotLight_3.ppm b/AutomatedTesting/Gem/PythonTests/atom_renderer/golden_images/SpotLight_3.ppm new file mode 100644 index 0000000000..6b6a5a5d6e --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/atom_renderer/golden_images/SpotLight_3.ppm @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:287d98890b35427688999760f9d066bcbff1a3bc9001534241dc212b32edabd8 +size 6220817 diff --git a/AutomatedTesting/Gem/PythonTests/atom_renderer/golden_images/SpotLight_4.ppm b/AutomatedTesting/Gem/PythonTests/atom_renderer/golden_images/SpotLight_4.ppm new file mode 100644 index 0000000000..eb05228cc2 --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/atom_renderer/golden_images/SpotLight_4.ppm @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:66e91c92c868167c850078cd91714db47e10a96e23cc30191994486bd79c353f +size 6220817 diff --git a/AutomatedTesting/Gem/PythonTests/atom_renderer/golden_images/SpotLight_5.ppm b/AutomatedTesting/Gem/PythonTests/atom_renderer/golden_images/SpotLight_5.ppm new file mode 100644 index 0000000000..5e12edc46d --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/atom_renderer/golden_images/SpotLight_5.ppm @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d950d173f5101820c5e18205401ca08ce5feeff2302ac2920b292750d86a8fa4 +size 6220817 diff --git a/AutomatedTesting/Gem/PythonTests/atom_renderer/golden_images/SpotLight_6.ppm b/AutomatedTesting/Gem/PythonTests/atom_renderer/golden_images/SpotLight_6.ppm new file mode 100644 index 0000000000..d442d90287 --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/atom_renderer/golden_images/SpotLight_6.ppm @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:72eddb7126eae0c839b933886e0fb69d78229f72d49ef13199de28df2b7879db +size 6220817 diff --git a/AutomatedTesting/Gem/PythonTests/atom_renderer/test_Atom_GPUTests.py b/AutomatedTesting/Gem/PythonTests/atom_renderer/test_Atom_GPUTests.py index ede140c075..047f46a40f 100644 --- a/AutomatedTesting/Gem/PythonTests/atom_renderer/test_Atom_GPUTests.py +++ b/AutomatedTesting/Gem/PythonTests/atom_renderer/test_Atom_GPUTests.py @@ -15,11 +15,11 @@ import pytest import ly_test_tools.environment.file_system as file_system from ly_test_tools.image.screenshot_compare_qssim import qssim as compare_screenshots from ly_test_tools.benchmark.data_aggregator import BenchmarkDataAggregator + import editor_python_test_tools.hydra_test_utils as hydra logger = logging.getLogger(__name__) DEFAULT_SUBFOLDER_PATH = 'user/PythonTests/Automated/Screenshots' -EDITOR_TIMEOUT = 600 TEST_DIRECTORY = os.path.join(os.path.dirname(__file__), "atom_hydra_scripts") @@ -67,6 +67,7 @@ class TestAllComponentsIndepthTests(object): "Trace::Assert", "Trace::Error", "Traceback (most recent call last):", + "Screenshot failed" ] hydra.launch_and_validate_results( @@ -74,7 +75,7 @@ class TestAllComponentsIndepthTests(object): TEST_DIRECTORY, editor, "hydra_GPUTest_BasicLevelSetup.py", - timeout=EDITOR_TIMEOUT, + timeout=180, expected_lines=level_creation_expected_lines, unexpected_lines=unexpected_lines, halt_on_unexpected=True, @@ -85,6 +86,60 @@ class TestAllComponentsIndepthTests(object): for test_screenshot, golden_screenshot in zip(test_screenshots, golden_images): compare_screenshots(test_screenshot, golden_screenshot) + def test_LightComponent_ScreenshotMatchesGoldenImage( + self, request, editor, workspace, project, launcher_platform, level): + """ + Please review the hydra script run by this test for more specific test info. + Tests that the Light component screenshots in a rendered level appear the same as the golden images. + """ + screenshot_names = [ + "AreaLight_1.ppm", + "AreaLight_2.ppm", + "AreaLight_3.ppm", + "AreaLight_4.ppm", + "AreaLight_5.ppm", + "SpotLight_1.ppm", + "SpotLight_2.ppm", + "SpotLight_3.ppm", + "SpotLight_4.ppm", + "SpotLight_5.ppm", + "SpotLight_6.ppm", + ] + test_screenshots = [] + for screenshot in screenshot_names: + screenshot_path = os.path.join(workspace.paths.project(), DEFAULT_SUBFOLDER_PATH, screenshot) + test_screenshots.append(screenshot_path) + file_system.delete(test_screenshots, True, True) + + golden_images = [] + for golden_image in screenshot_names: + golden_image_path = os.path.join(golden_images_directory(), golden_image) + golden_images.append(golden_image_path) + + expected_lines = ["Light component tests completed."] + unexpected_lines = [ + "Trace::Assert", + "Trace::Error", + "Traceback (most recent call last):", + "Screenshot failed", + ] + hydra.launch_and_validate_results( + request, + TEST_DIRECTORY, + editor, + "hydra_GPUTest_LightComponent.py", + timeout=180, + expected_lines=expected_lines, + unexpected_lines=unexpected_lines, + halt_on_unexpected=True, + cfg_args=[level], + null_renderer=False, + ) + + for test_screenshot, golden_screenshot in zip(test_screenshots, golden_images): + compare_screenshots(test_screenshot, golden_screenshot) + + @pytest.mark.parametrize('rhi', ['dx12', 'vulkan']) @pytest.mark.parametrize("project", ["AutomatedTesting"]) @pytest.mark.parametrize("launcher_platform", ["windows_editor"]) @@ -99,6 +154,7 @@ class TestPerformanceBenchmarkSuite(object): expected_lines = [ "Benchmark metadata captured.", "Pass timestamps captured.", + "CPU frame time captured.", "Capturing complete.", "Captured data successfully." ] @@ -106,6 +162,7 @@ class TestPerformanceBenchmarkSuite(object): unexpected_lines = [ "Failed to capture data.", "Failed to capture pass timestamps.", + "Failed to capture CPU frame time.", "Failed to capture benchmark metadata." ] @@ -114,7 +171,7 @@ class TestPerformanceBenchmarkSuite(object): TEST_DIRECTORY, editor, "hydra_GPUTest_AtomFeatureIntegrationBenchmark.py", - timeout=EDITOR_TIMEOUT, + timeout=600, expected_lines=expected_lines, unexpected_lines=unexpected_lines, halt_on_unexpected=True, @@ -124,3 +181,39 @@ class TestPerformanceBenchmarkSuite(object): aggregator = BenchmarkDataAggregator(workspace, logger, 'periodic') aggregator.upload_metrics(rhi) + + +@pytest.mark.parametrize("project", ["AutomatedTesting"]) +@pytest.mark.parametrize("launcher_platform", ['windows_generic']) +@pytest.mark.system +class TestMaterialEditor(object): + + @pytest.mark.parametrize("cfg_args", ["-rhi=dx12", "-rhi=Vulkan"]) + @pytest.mark.parametrize("exe_file_name", ["MaterialEditor"]) + def test_MaterialEditorLaunch_AllRHIOptionsSucceed( + self, request, workspace, project, launcher_platform, generic_launcher, exe_file_name, cfg_args): + """ + Tests each valid RHI option (Null RHI excluded) can be launched with the MaterialEditor. + Checks for the "Finished loading viewport configurtions." success message post lounch. + """ + expected_lines = ["Finished loading viewport configurtions."] + unexpected_lines = [ + # "Trace::Assert", + # "Trace::Error", + "Traceback (most recent call last):", + ] + + hydra.launch_and_validate_results( + request, + TEST_DIRECTORY, + generic_launcher, + editor_script="", + run_python="--runpython", + timeout=30, + expected_lines=expected_lines, + unexpected_lines=unexpected_lines, + halt_on_unexpected=False, + null_renderer=False, + cfg_args=[cfg_args], + log_file_name="MaterialEditor.log" + ) diff --git a/AutomatedTesting/Gem/PythonTests/atom_renderer/test_Atom_MainSuite.py b/AutomatedTesting/Gem/PythonTests/atom_renderer/test_Atom_MainSuite.py index 98d2ba0632..bb7a16ad6b 100644 --- a/AutomatedTesting/Gem/PythonTests/atom_renderer/test_Atom_MainSuite.py +++ b/AutomatedTesting/Gem/PythonTests/atom_renderer/test_Atom_MainSuite.py @@ -11,8 +11,9 @@ import os import pytest +import ly_test_tools.environment.file_system as file_system import editor_python_test_tools.hydra_test_utils as hydra -from atom_renderer.atom_utils.atom_component_helper import LIGHT_TYPES +from atom_renderer.atom_utils.atom_constants import LIGHT_TYPES logger = logging.getLogger(__name__) EDITOR_TIMEOUT = 120 @@ -31,7 +32,7 @@ class TestAtomEditorComponentsMain(object): Tests the following Atom components and verifies all "expected_lines" appear in Editor.log: 1. Display Mapper 2. Light - 3. Radius Weight Modifier + 3. PostFX Radius Weight Modifier 4. PostFX Layer 5. Physical Sky 6. Global Skylight (IBL) @@ -125,18 +126,18 @@ class TestAtomEditorComponentsMain(object): "PostFX Layer_test: Entity deleted: True", "PostFX Layer_test: UNDO entity deletion works: True", "PostFX Layer_test: REDO entity deletion works: True", - # Radius Weight Modifier Component - "Radius Weight Modifier Entity successfully created", - "Radius Weight Modifier_test: Component added to the entity: True", - "Radius Weight Modifier_test: Component removed after UNDO: True", - "Radius Weight Modifier_test: Component added after REDO: True", - "Radius Weight Modifier_test: Entered game mode: True", - "Radius Weight Modifier_test: Exit game mode: True", - "Radius Weight Modifier_test: Entity is hidden: True", - "Radius Weight Modifier_test: Entity is shown: True", - "Radius Weight Modifier_test: Entity deleted: True", - "Radius Weight Modifier_test: UNDO entity deletion works: True", - "Radius Weight Modifier_test: REDO entity deletion works: True", + # PostFX Radius Weight Modifier Component + "PostFX Radius Weight Modifier Entity successfully created", + "PostFX Radius Weight Modifier_test: Component added to the entity: True", + "PostFX Radius Weight Modifier_test: Component removed after UNDO: True", + "PostFX Radius Weight Modifier_test: Component added after REDO: True", + "PostFX Radius Weight Modifier_test: Entered game mode: True", + "PostFX Radius Weight Modifier_test: Exit game mode: True", + "PostFX Radius Weight Modifier_test: Entity is hidden: True", + "PostFX Radius Weight Modifier_test: Entity is shown: True", + "PostFX Radius Weight Modifier_test: Entity deleted: True", + "PostFX Radius Weight Modifier_test: UNDO entity deletion works: True", + "PostFX Radius Weight Modifier_test: REDO entity deletion works: True", # Light Component "Light Entity successfully created", "Light_test: Component added to the entity: True", @@ -242,3 +243,66 @@ class TestAtomEditorComponentsMain(object): null_renderer=True, cfg_args=cfg_args, ) + + +@pytest.mark.parametrize("project", ["AutomatedTesting"]) +@pytest.mark.parametrize("launcher_platform", ['windows_generic']) +@pytest.mark.system +class TestMaterialEditorBasicTests(object): + @pytest.fixture(autouse=True) + def setup_teardown(self, request, workspace, project): + def delete_files(): + file_system.delete( + [ + os.path.join(workspace.paths.project(), "Materials", "test_material.material"), + os.path.join(workspace.paths.project(), "Materials", "test_material_1.material"), + os.path.join(workspace.paths.project(), "Materials", "test_material_2.material"), + ], + True, + True, + ) + # Cleanup our newly created materials + delete_files() + + def teardown(): + # Cleanup our newly created materials + delete_files() + + request.addfinalizer(teardown) + + @pytest.mark.parametrize("exe_file_name", ["MaterialEditor"]) + def test_MaterialEditorBasicTests( + self, request, workspace, project, launcher_platform, generic_launcher, exe_file_name): + + expected_lines = [ + "Material opened: True", + "Test asset doesn't exist initially: True", + "New asset created: True", + "New Material opened: True", + "Material closed: True", + "All documents closed: True", + "Close All Except Selected worked as expected: True", + "Actual Document saved with changes: True", + "Document saved as copy is saved with changes: True", + "Document saved as child is saved with changes: True", + "Save All worked as expected: True", + ] + unexpected_lines = [ + # "Trace::Assert", + # "Trace::Error", + "Traceback (most recent call last):" + ] + + hydra.launch_and_validate_results( + request, + TEST_DIRECTORY, + generic_launcher, + "hydra_AtomMaterialEditor_BasicTests.py", + run_python="--runpython", + timeout=80, + expected_lines=expected_lines, + unexpected_lines=unexpected_lines, + halt_on_unexpected=True, + null_renderer=True, + log_file_name="MaterialEditor.log", + ) diff --git a/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/base.py b/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/base.py index e6c28be2a5..f5cd66cbbe 100755 --- a/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/base.py +++ b/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/base.py @@ -51,8 +51,8 @@ class TestAutomationBase: cls.asset_processor.teardown() cls._kill_ly_processes() - - def _run_test(self, request, workspace, editor, testcase_module, extra_cmdline_args=[], use_null_renderer=True): + def _run_test(self, request, workspace, editor, testcase_module, extra_cmdline_args=[], batch_mode=True, + autotest_mode=True, use_null_renderer=True): test_starttime = time.time() self.logger = logging.getLogger(__name__) errors = [] @@ -90,9 +90,13 @@ class TestAutomationBase: editor_starttime = time.time() self.logger.debug("Running automated test") testcase_module_filepath = self._get_testcase_module_filepath(testcase_module) - pycmd = ["--runpythontest", testcase_module_filepath, "-BatchMode", "-autotest_mode", f"-pythontestcase={request.node.originalname}"] + pycmd = ["--runpythontest", testcase_module_filepath, f"-pythontestcase={request.node.originalname}"] if use_null_renderer: pycmd += ["-rhi=null"] + if batch_mode: + pycmd += ["-BatchMode"] + if autotest_mode: + pycmd += ["-autotest_mode"] pycmd += extra_cmdline_args editor.args.extend(pycmd) # args are added to the WinLauncher start command editor.start(backupFiles = False, launch_ap = False) diff --git a/AutomatedTesting/Gem/PythonTests/editor/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/editor/CMakeLists.txt index afde0a0d94..bf42579970 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonTests/editor/CMakeLists.txt @@ -11,24 +11,8 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_ NAME AutomatedTesting::EditorTests_Main TEST_SUITE main TEST_SERIAL - PATH ${CMAKE_CURRENT_LIST_DIR} - PYTEST_MARKS "SUITE_main and not REQUIRES_gpu" - TIMEOUT 1500 - RUNTIME_DEPENDENCIES - Legacy::Editor - AZ::AssetProcessor - AutomatedTesting.Assets - COMPONENT - Editor - ) - - ly_add_pytest( - NAME AutomatedTesting::EditorTests_Periodic - TEST_SUITE periodic - TEST_SERIAL - PATH ${CMAKE_CURRENT_LIST_DIR} - PYTEST_MARKS "SUITE_periodic and not REQUIRES_gpu" - TIMEOUT 1500 + PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Main.py + PYTEST_MARKS "not REQUIRES_gpu" RUNTIME_DEPENDENCIES Legacy::Editor AZ::AssetProcessor @@ -42,9 +26,21 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_ TEST_SUITE main TEST_SERIAL TEST_REQUIRES gpu - PATH ${CMAKE_CURRENT_LIST_DIR} - PYTEST_MARKS "SUITE_main and REQUIRES_gpu" - TIMEOUT 1500 + PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Main.py + PYTEST_MARKS "REQUIRES_gpu" + RUNTIME_DEPENDENCIES + Legacy::Editor + AZ::AssetProcessor + AutomatedTesting.Assets + COMPONENT + Editor + ) + + ly_add_pytest( + NAME AutomatedTesting::EditorTests_Periodic + TEST_SUITE periodic + TEST_SERIAL + PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Periodic.py RUNTIME_DEPENDENCIES Legacy::Editor AZ::AssetProcessor @@ -57,9 +53,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_ NAME AutomatedTesting::EditorTests_Sandbox TEST_SUITE sandbox TEST_SERIAL - PATH ${CMAKE_CURRENT_LIST_DIR} - PYTEST_MARKS "SUITE_sandbox" - TIMEOUT 1500 + PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Sandbox.py RUNTIME_DEPENDENCIES Legacy::Editor AZ::AssetProcessor @@ -67,4 +61,47 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_ COMPONENT Editor ) + + ly_add_pytest( + NAME AutomatedTesting::EditorTests_Main_Optimized + TEST_SUITE main + TEST_SERIAL + PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Main_Optimized.py + PYTEST_MARKS "not REQUIRES_gpu" + RUNTIME_DEPENDENCIES + Legacy::Editor + AZ::AssetProcessor + AutomatedTesting.Assets + COMPONENT + Editor + ) + + ly_add_pytest( + NAME AutomatedTesting::EditorTests_Main_GPU_Optimized + TEST_SUITE main + TEST_SERIAL + TEST_REQUIRES gpu + PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Main_Optimized.py + PYTEST_MARKS "REQUIRES_gpu" + RUNTIME_DEPENDENCIES + Legacy::Editor + AZ::AssetProcessor + AutomatedTesting.Assets + COMPONENT + Editor + ) + + ly_add_pytest( + NAME AutomatedTesting::EditorTests_Sandbox_Optimized + TEST_SUITE sandbox + TEST_SERIAL + PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Sandbox_Optimized.py + RUNTIME_DEPENDENCIES + Legacy::Editor + AZ::AssetProcessor + AutomatedTesting.Assets + COMPONENT + Editor + ) + endif() diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetBrowser_SearchFiltering.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetBrowser_SearchFiltering.py index 60c8926eb2..33c48c7a77 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetBrowser_SearchFiltering.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetBrowser_SearchFiltering.py @@ -5,30 +5,24 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ -""" -C13660194 : Asset Browser - Filtering -""" -import os -import sys -from PySide2 import QtWidgets, QtTest, QtCore -from PySide2.QtCore import Qt - -import azlmbr.legacy.general as general -import azlmbr.paths - -sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests')) -import editor_python_test_tools.hydra_editor_utils as hydra -import editor_python_test_tools.pyside_utils as pyside_utils -from editor_python_test_tools.editor_test_helper import EditorTestHelper +class Tests: + asset_filtered = ( + "Asset was filtered to in the Asset Browser", + "Failed to filter to the expected asset" + ) + asset_type_filtered = ( + "Expected asset type was filtered to in the Asset Browser", + "Failed to filter to the expected asset type" + ) -class AssetBrowserSearchFilteringTest(EditorTestHelper): - def __init__(self): - EditorTestHelper.__init__(self, log_prefix="AssetBrowser_SearchFiltering", args=["level"]) +def AssetBrowser_SearchFiltering(): + + import editor_python_test_tools.pyside_utils as pyside_utils @pyside_utils.wrap_async - async def run_test(self): + async def run_test(): """ Summary: Asset Browser - Filtering @@ -60,7 +54,13 @@ class AssetBrowserSearchFilteringTest(EditorTestHelper): :return: None """ - self.incorrect_file_found = False + from PySide2 import QtWidgets, QtTest, QtCore + from PySide2.QtCore import Qt + + import azlmbr.legacy.general as general + + 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()): indexes = [parent_index] @@ -74,25 +74,24 @@ class AssetBrowserSearchFilteringTest(EditorTestHelper): and (cur_data.lower().split(".")[-1] not in allowed_asset_extentions) and not cur_data[-1] == ")" ): - print(f"Incorrect file found: {cur_data}") - self.incorrect_file_found = True - indexes = list() - break + Report.info(f"Incorrect file found: {cur_data}") + return False indexes.append(cur_index) + return True + # 1) Open an existing simple level + helper.init_idle() + helper.open_level("Physics", "Base") - # 1) Open level - self.test_success = self.create_level( - self.args["level"], - heightmap_resolution=1024, - heightmap_meters_per_pixel=1, - terrain_texture_resolution=4096, - use_terrain=False, - ) - - # 2) Open Asset Browser - general.close_pane("Asset Browser") - general.open_pane("Asset Browser") + # 2) Open Asset Browser (if not opened already) + editor_window = pyside_utils.get_editor_main_window() + asset_browser_open = general.is_pane_visible("Asset Browser") + if not asset_browser_open: + Report.info("Opening Asset Browser") + action = pyside_utils.get_action_for_menu_path(editor_window, "Tools", "Asset Browser") + action.trigger() + else: + Report.info("Asset Browser is already open") editor_window = pyside_utils.get_editor_main_window() app = QtWidgets.QApplication.instance() @@ -103,10 +102,9 @@ class AssetBrowserSearchFilteringTest(EditorTestHelper): 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) - is_filtered = pyside_utils.wait_for_condition( + is_filtered = await pyside_utils.wait_for_condition( lambda: asset_browser_tree.indexBelow(asset_browser_tree.currentIndex()) == QtCore.QModelIndex(), 5.0) - if is_filtered: - print("cedar.fbx asset is filtered in Asset Browser") + Report.result(Tests.asset_filtered, is_filtered) # 4) Click the "X" in the search bar. clear_search = asset_browser.findChild(QtWidgets.QToolButton, "ClearToolButton") @@ -122,40 +120,47 @@ class AssetBrowserSearchFilteringTest(EditorTestHelper): tree.model().setData(animation_model_index, 2, Qt.CheckStateRole) general.idle_wait(1.0) # check asset types after clicking on Animation filter - verify_files_appeared(asset_browser_tree.model(), ["i_caf", "fbx", "xml", "animgraph", "motionset"]) - print(f"Animation file type(s) is present in the file tree: {not self.incorrect_file_found}") + asset_type_filter = verify_files_appeared(asset_browser_tree.model(), ["i_caf", "fbx", "xml", "animgraph", "motionset"]) + Report.result(Tests.asset_type_filtered, asset_type_filter) # 6) Add additional filter(FileTag) from the filter menu - self.incorrect_file_found = False line_edit.setText("FileTag") filetag_model_index = await pyside_utils.wait_for_child_by_pattern(tree, "FileTag") tree.model().setData(filetag_model_index, 2, Qt.CheckStateRole) general.idle_wait(1.0) # check asset types after clicking on FileTag filter - verify_files_appeared( + more_types_filtered = verify_files_appeared( asset_browser_tree.model(), ["i_caf", "fbx", "xml", "animgraph", "motionset", "filetag"] ) - print(f"FileTag file type(s) and Animation file type(s) is present in the file tree: {not self.incorrect_file_found}") + Report.result(Tests.asset_type_filtered, more_types_filtered) # 7) Remove one of the filtered asset types from the list of applied filters - self.incorrect_file_found = False filter_layout = asset_browser.findChild(QtWidgets.QFrame, "filteredLayout") animation_close_button = filter_layout.children()[1] first_close_button = animation_close_button.findChild(QtWidgets.QPushButton, "closeTag") first_close_button.click() general.idle_wait(1.0) # check asset types after removing Animation filter - verify_files_appeared(asset_browser_tree.model(), ["filetag"]) - print(f"FileTag file type(s) is present in the file tree after removing Animation filter: {not self.incorrect_file_found}") + remove_filtered = verify_files_appeared(asset_browser_tree.model(), ["filetag"]) + Report.result(Tests.asset_type_filtered, remove_filtered) # 8) Remove all of the filter asset types from the list of filters filetag_close_button = filter_layout.children()[1] second_close_button = filetag_close_button.findChild(QtWidgets.QPushButton, "closeTag") second_close_button.click() - # 9) Close the asset browser - asset_browser.close() + # Click off of the Asset Browser filter window to close it + QtTest.QTest.mouseClick(tree, Qt.LeftButton, Qt.NoModifier) + + # 9) Restore Asset Browser tool state and + if not asset_browser_open: + Report.info("Closing Asset Browser") + general.close_pane("Asset Browser") + + run_test() -test = AssetBrowserSearchFilteringTest() -test.run() +if __name__ == "__main__": + + from editor_python_test_tools.utils import Report + Report.start_test(AssetBrowser_SearchFiltering) diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetBrowser_TreeNavigation.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetBrowser_TreeNavigation.py index d57d9cda5e..b4f0dc7f6c 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetBrowser_TreeNavigation.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetBrowser_TreeNavigation.py @@ -5,124 +5,119 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ -""" -C13660195: Asset Browser - File Tree Navigation -""" -import os -import sys -from PySide2 import QtWidgets, QtTest, QtCore - -import azlmbr.legacy.general as general -import azlmbr.paths - -sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests')) -from editor_python_test_tools.editor_test_helper import EditorTestHelper -import editor_python_test_tools.pyside_utils as pyside_utils +class Tests: + collapse_expand = ( + "Asset Browser hierarchy successfully collapsed/expanded", + "Failed to collapse/expand Asset Browser hierarchy" + ) + asset_visible = ( + "Expected asset is visible in the Asset Browser hierarchy", + "Failed to find expected asset in the Asset Browser hierarchy" + ) + scrollbar_visible = ( + "Scrollbar is visible", + "Scrollbar was not found" + ) -class AssetBrowserTreeNavigationTest(EditorTestHelper): - def __init__(self): - EditorTestHelper.__init__(self, log_prefix="AssetBrowser_TreeNavigation", args=["level"]) +def AssetBrowser_TreeNavigation(): + """ + Summary: + Verify if we are able to expand a file hierarchy in the Asset Browser and ScrollBar appears + appropriately. - def run_test(self): - """ - Summary: - Verify if we are able to expand a file hierarchy in the Asset Browser and ScrollBar appears - appropriately. + Expected Behavior: + The folder list is expanded to display the children of the selected folder. + A scroll bar appears to allow scrolling up and down through the asset browser. + Assets are present in the Asset Browser. - Expected Behavior: - The folder list is expanded to display the children of the selected folder. - A scroll bar appears to allow scrolling up and down through the asset browser. - Assets are present in the Asset Browser. + Test Steps: + 1) Open a simple level + 2) Open Asset Browser + 3) Collapse all files initially + 4) Get all Model Indexes + 5) Expand each of the folder and verify if it is opened + 6) Verify if the ScrollBar appears after expanding the tree - Test Steps: - 1) Open a new level - 2) Open Asset Browser - 3) Collapse all files initially - 4) Get all Model Indexes - 5) Expand each of the folder and verify if it is opened - 6) Verify if the ScrollBar appears after expanding the tree + Note: + - This test file must be called from the Open 3D Engine Editor command terminal + - Any passed and failed tests are written to the Editor.log file. + Parsing the file or running a log_monitor are required to observe the test results. - Note: - - This test file must be called from the Open 3D Engine Editor command terminal - - Any passed and failed tests are written to the Editor.log file. - Parsing the file or running a log_monitor are required to observe the test results. + :return: None + """ - :return: None - """ + from PySide2 import QtWidgets, QtTest, QtCore - def collapse_expand_and_verify(model_index, hierarchy_level): - tree.collapse(model_index) - collapse_success = not tree.isExpanded(model_index) - self.log(f"Level {hierarchy_level} collapsed: {collapse_success}") - tree.expand(model_index) - expand_success = tree.isExpanded(model_index) - self.log(f"Level {hierarchy_level} expanded: {expand_success}") - return collapse_success and expand_success + import azlmbr.legacy.general as general - # This is the hierarchy we are expanding (4 steps inside) - self.file_path = ("AutomatedTesting", "Assets", "ImageGradients", "image_grad_test_gsi.png") + import editor_python_test_tools.pyside_utils as pyside_utils + from editor_python_test_tools.utils import Report + from editor_python_test_tools.utils import TestHelper as helper - # 1) Open a new level - self.test_success = self.create_level( - self.args["level"], - heightmap_resolution=1024, - heightmap_meters_per_pixel=1, - terrain_texture_resolution=4096, - use_terrain=False, - ) + def collapse_expand_and_verify(model_index, hierarchy_level): + tree.collapse(model_index) + collapse_success = not tree.isExpanded(model_index) + Report.info(f"Level {hierarchy_level} collapsed: {collapse_success}") + tree.expand(model_index) + expand_success = tree.isExpanded(model_index) + Report.info(f"Level {hierarchy_level} expanded: {expand_success}") + return collapse_success and expand_success - # 2) Open Asset Browser (if not opened already) - editor_window = pyside_utils.get_editor_main_window() - asset_browser_open = general.is_pane_visible("Asset Browser") - if not asset_browser_open: - self.log("Opening Asset Browser") - action = pyside_utils.get_action_for_menu_path(editor_window, "Tools", "Asset Browser") - action.trigger() - else: - self.log("Asset Browser is already open") + # This is the hierarchy we are expanding (4 steps inside) + file_path = ("AutomatedTesting", "Assets", "ImageGradients", "image_grad_test_gsi.png") - # 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") - scroll_area = tree.findChild(QtWidgets.QWidget, "qt_scrollarea_vcontainer") - scroll_bar = scroll_area.findChild(QtWidgets.QScrollBar) - tree.collapseAll() + # 1) Open an existing simple level + helper.init_idle() + helper.open_level("Physics", "Base") - # 4) Get all Model Indexes - model_index_1 = pyside_utils.find_child_by_hierarchy(tree, self.file_path[0]) - model_index_2 = pyside_utils.find_child_by_hierarchy(model_index_1, self.file_path[1]) - model_index_3 = pyside_utils.find_child_by_hierarchy(model_index_2, self.file_path[2]) - model_index_4 = pyside_utils.find_child_by_hierarchy(model_index_3, self.file_path[3]) + # 2) Open Asset Browser (if not opened already) + editor_window = pyside_utils.get_editor_main_window() + asset_browser_open = general.is_pane_visible("Asset Browser") + if not asset_browser_open: + Report.info("Opening Asset Browser") + action = pyside_utils.get_action_for_menu_path(editor_window, "Tools", "Asset Browser") + action.trigger() + else: + Report.info("Asset Browser is already open") - # 5) Verify each level of the hierarchy to the file can be collapsed/expanded - self.test_success = collapse_expand_and_verify(model_index_1, 1) and self.test_success - self.test_success = collapse_expand_and_verify(model_index_2, 2) and self.test_success - self.test_success = collapse_expand_and_verify(model_index_3, 3) and self.test_success - self.log(f"Collapse/Expand tests: {self.test_success}") + # 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") + scroll_area = tree.findChild(QtWidgets.QWidget, "qt_scrollarea_vcontainer") + scroll_bar = scroll_area.findChild(QtWidgets.QScrollBar) + tree.collapseAll() - # Select the asset - tree.scrollTo(model_index_4) - pyside_utils.item_view_index_mouse_click(tree, model_index_4) + # 4) Get all Model Indexes + model_index_1 = pyside_utils.find_child_by_hierarchy(tree, file_path[0]) + model_index_2 = pyside_utils.find_child_by_hierarchy(model_index_1, file_path[1]) + model_index_3 = pyside_utils.find_child_by_hierarchy(model_index_2, file_path[2]) + model_index_4 = pyside_utils.find_child_by_hierarchy(model_index_3, file_path[3]) - # Verify if the currently selected item model index is same as the Asset Model index - # to prove that it is visible - asset_visible = tree.currentIndex() == model_index_4 - self.test_success = asset_visible and self.test_success - self.log(f"Asset visibility test: {asset_visible}") + # 5) Verify each level of the hierarchy to the file can be collapsed/expanded + Report.result(Tests.collapse_expand, collapse_expand_and_verify(model_index_1, 1) and + collapse_expand_and_verify(model_index_2, 2) and collapse_expand_and_verify(model_index_3, 3)) - # 6) Verify if the ScrollBar appears after expanding the tree - scrollbar_visible = scroll_bar.isVisible() - self.test_success = scrollbar_visible and self.test_success - self.log(f"Scrollbar visibility test: {scrollbar_visible}") + # Select the asset + tree.scrollTo(model_index_4) + pyside_utils.item_view_index_mouse_click(tree, model_index_4) - # 7) Restore Asset Browser tool state - if not asset_browser_open: - self.log("Closing Asset Browser") - general.close_pane("Asset Browser") + # Verify if the currently selected item model index is same as the Asset Model index + # to prove that it is visible + Report.result(Tests.asset_visible, tree.currentIndex() == model_index_4) + + # 6) Verify if the ScrollBar appears after expanding the tree + Report.result(Tests.scrollbar_visible, scroll_bar.isVisible()) + + # 7) Restore Asset Browser tool state + if not asset_browser_open: + Report.info("Closing Asset Browser") + general.close_pane("Asset Browser") -test = AssetBrowserTreeNavigationTest() -test.run() +if __name__ == "__main__": + + from editor_python_test_tools.utils import Report + Report.start_test(AssetBrowser_TreeNavigation) diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetPicker_UI_UX.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetPicker_UI_UX.py index f728714125..59a78c9e5d 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetPicker_UI_UX.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetPicker_UI_UX.py @@ -5,33 +5,13 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ -""" -C13751579: Asset Picker UI/UX -""" -import os -import sys -from PySide2 import QtWidgets, QtTest, QtCore -from PySide2.QtCore import Qt +def AssetPicker_UI_UX(): -import azlmbr.asset as asset -import azlmbr.bus as bus -import azlmbr.legacy.general as general -import azlmbr.paths -import azlmbr.math as math - -sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests')) -import editor_python_test_tools.hydra_editor_utils as hydra -import editor_python_test_tools.pyside_utils as pyside_utils -from editor_python_test_tools.editor_test_helper import EditorTestHelper - - -class AssetPickerUIUXTest(EditorTestHelper): - def __init__(self): - EditorTestHelper.__init__(self, log_prefix="AssetPicker_UI_UX", args=["level"]) + import editor_python_test_tools.pyside_utils as pyside_utils @pyside_utils.wrap_async - async def run_test(self): + async def run_test(): """ Summary: Verify the functionality of Asset Picker and UI/UX properties @@ -45,7 +25,7 @@ class AssetPickerUIUXTest(EditorTestHelper): The asset picker is closed and the selected asset is assigned to the mesh component. Test Steps: - 1) Open a new level + 1) Open a simple level 2) Create entity and add Mesh component 3) Access Entity Inspector 4) Click Asset Picker (Mesh Asset) @@ -61,17 +41,27 @@ class AssetPickerUIUXTest(EditorTestHelper): 5) Verify if Mesh Asset is assigned via both OK/Enter options Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the O3DE Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. :return: None """ - self.file_path = ["AutomatedTesting", "Assets", "Objects", "Foliage"] - self.incorrect_file_found = False - self.mesh_asset = "cedar.azmodel" - self.prefix = "" + import os + from PySide2 import QtWidgets, QtTest, QtCore + from PySide2.QtCore import Qt + + import azlmbr.asset as asset + import azlmbr.bus as bus + import azlmbr.legacy.general as general + import azlmbr.math as math + + import editor_python_test_tools.hydra_editor_utils as hydra + from editor_python_test_tools.utils import Report + from editor_python_test_tools.utils import TestHelper as helper + + file_path = ["AutomatedTesting", "Assets", "Objects", "Foliage"] def is_asset_assigned(component, interaction_option): path = os.path.join("assets", "objects", "foliage", "cedar.azmodel") @@ -80,7 +70,7 @@ class AssetPickerUIUXTest(EditorTestHelper): result = hydra.get_component_property_value(component, "Controller|Configuration|Mesh Asset") expected_asset_str = expected_asset_id.invoke("ToString") result_str = result.invoke("ToString") - print(f"Asset assigned for {interaction_option} option: {expected_asset_str == result_str}") + Report.info(f"Asset assigned for {interaction_option} option: {expected_asset_str == result_str}") return expected_asset_str == result_str def move_and_resize_widget(widget): @@ -89,9 +79,11 @@ class AssetPickerUIUXTest(EditorTestHelper): x, y = initial_position.x() + 5, initial_position.y() + 5 widget.move(x, y) curr_position = widget.pos() - move_success = curr_position.x() == x and curr_position.y() == y - self.test_success = move_success and self.test_success - self.log(f"Widget Move Test: {move_success}") + asset_picker_moved = ( + "Asset Picker widget moved successfully", + "Failed to move Asset Picker widget" + ) + Report.result(asset_picker_moved, curr_position.x() == x and curr_position.y() == y) # Resize the widget and verify size width, height = ( @@ -99,9 +91,36 @@ class AssetPickerUIUXTest(EditorTestHelper): widget.geometry().height() + 10, ) widget.resize(width, height) - resize_success = widget.geometry().width() == width and widget.geometry().height() == height - self.test_success = resize_success and self.test_success - self.log(f"Widget Resize Test: {resize_success}") + asset_picker_resized = ( + "Resized Asset Picker widget successfully", + "Failed to resize Asset Picker widget" + ) + Report.result(asset_picker_resized, widget.geometry().width() == width and widget.geometry().height() == + height) + + def verify_expand(model_index, tree): + initially_collapsed = ( + "Folder initially collapsed", + "Folder unexpectedly expanded" + ) + expanded = ( + "Folder expanded successfully", + "Failed to expand folder" + ) + # Check initial collapse + Report.result(initially_collapsed, not tree.isExpanded(model_index)) + # Expand at the specified index + tree.expand(model_index) + # Verify expansion + Report.result(expanded, tree.isExpanded(model_index)) + + def verify_collapse(model_index, tree): + collapsed = ( + "Folder hierarchy collapsed successfully", + "Failed to collapse folder hierarchy" + ) + tree.collapse(model_index) + Report.result(collapsed, not tree.isExpanded(model_index)) def verify_files_appeared(model, allowed_asset_extensions, parent_index=QtCore.QModelIndex()): indices = [parent_index] @@ -115,22 +134,20 @@ class AssetPickerUIUXTest(EditorTestHelper): and (cur_data.lower().split(".")[-1] not in allowed_asset_extensions) and not cur_data[-1] == ")" ): - print(f"Incorrect file found: {cur_data}") - self.incorrect_file_found = True - indices = list() - break + Report.info(f"Incorrect file found: {cur_data}") + return False indices.append(cur_index) - self.test_success = not self.incorrect_file_found and self.test_success + return True - def print_message_prefix(message): - print(f"{self.prefix}: {message}") - - async def asset_picker(prefix, allowed_asset_extensions, asset, interaction_option): + async def asset_picker(allowed_asset_extensions, asset, interaction_option): active_modal_widget = await pyside_utils.wait_for_modal_widget() - if active_modal_widget and self.prefix == "": - self.prefix = prefix + if active_modal_widget: dialog = active_modal_widget.findChildren(QtWidgets.QDialog, "AssetPickerDialogClass")[0] - print_message_prefix(f"Asset Picker title for Mesh: {dialog.windowTitle()}") + asset_picker_title = ( + "Asset Picker window is titled as expected", + "Asset Picker window has an unexpected title" + ) + Report.result(asset_picker_title, dialog.windowTitle() == "Pick ModelAsset") tree = dialog.findChildren(QtWidgets.QTreeView, "m_assetBrowserTreeViewWidget")[0] scroll_area = tree.findChild(QtWidgets.QWidget, "qt_scrollarea_vcontainer") scroll_bar = scroll_area.findChild(QtWidgets.QScrollBar) @@ -138,39 +155,42 @@ class AssetPickerUIUXTest(EditorTestHelper): # a) Collapse all the files initially and verify if scroll bar is not visible tree.collapseAll() await pyside_utils.wait_for_condition(lambda: not scroll_bar.isVisible(), 0.5) - print_message_prefix( - f"Scroll Bar is not visible before expanding the tree: {not scroll_bar.isVisible()}" + scroll_bar_hidden = ( + "Scroll Bar is not visible before tree expansion", + "Scroll Bar is visible before tree expansion" ) + Report.result(scroll_bar_hidden, not scroll_bar.isVisible()) # Get Model Index of the file paths - model_index_1 = pyside_utils.find_child_by_pattern(tree, self.file_path[0]) - print(model_index_1.model()) - model_index_2 = pyside_utils.find_child_by_pattern(model_index_1, self.file_path[1]) + model_index_1 = pyside_utils.find_child_by_pattern(tree, file_path[0]) + model_index_2 = pyside_utils.find_child_by_pattern(model_index_1, file_path[1]) # b) Expand/Verify Top folder of file path - print_message_prefix(f"Top level folder initially collapsed: {not tree.isExpanded(model_index_1)}") - tree.expand(model_index_1) - print_message_prefix(f"Top level folder expanded: {tree.isExpanded(model_index_1)}") + verify_expand(model_index_1, tree) # c) Expand/Verify Nested folder of file path - print_message_prefix(f"Nested folder initially collapsed: {not tree.isExpanded(model_index_2)}") - tree.expand(model_index_2) - print_message_prefix(f"Nested folder expanded: {tree.isExpanded(model_index_2)}") + verify_expand(model_index_2, tree) # d) Verify if the ScrollBar appears after expanding folders tree.expandAll() await pyside_utils.wait_for_condition(lambda: scroll_bar.isVisible(), 0.5) - print_message_prefix(f"Scroll Bar appeared after expanding tree: {scroll_bar.isVisible()}") + scroll_bar_visible = ( + "Scroll Bar is visible after tree expansion", + "Scroll Bar is not visible after tree expansion" + ) + Report.result(scroll_bar_visible, scroll_bar.isVisible()) # e) Collapse Nested and Top Level folders and verify if collapsed - tree.collapse(model_index_2) - print_message_prefix(f"Nested folder collapsed: {not tree.isExpanded(model_index_2)}") - tree.collapse(model_index_1) - print_message_prefix(f"Top level folder collapsed: {not tree.isExpanded(model_index_1)}") + verify_collapse(model_index_2, tree) + verify_collapse(model_index_1, tree) # f) Verify if the correct files are appearing in the Asset Picker - verify_files_appeared(tree.model(), allowed_asset_extensions) - print_message_prefix(f"Expected Assets populated in the file picker: {not self.incorrect_file_found}") + asset_picker_correct_files_appear = ( + "Expected assets populated in the file picker", + "Found unexpected assets in the file picker" + ) + Report.result(asset_picker_correct_files_appear, verify_files_appeared(tree.model(), + allowed_asset_extensions)) # While we are here we can also check if we can resize and move the widget move_and_resize_widget(active_modal_widget) @@ -193,16 +213,10 @@ class AssetPickerUIUXTest(EditorTestHelper): await pyside_utils.click_button_async(ok_button) elif interaction_option == "enter": QtTest.QTest.keyClick(tree, Qt.Key_Enter, Qt.NoModifier) - self.prefix = "" - # 1) Open a new level - self.test_success = self.create_level( - self.args["level"], - heightmap_resolution=1024, - heightmap_meters_per_pixel=1, - terrain_texture_resolution=4096, - use_terrain=False, - ) + # 1) Open an existing simple level + helper.init_idle() + helper.open_level("Physics", "Base") # 2) Create entity and add Mesh component entity_position = math.Vector3(125.0, 136.0, 32.0) @@ -222,7 +236,7 @@ class AssetPickerUIUXTest(EditorTestHelper): # Assign Mesh Asset via OK button pyside_utils.click_button_async(attached_button) - await asset_picker("Mesh Asset", ["azmodel", "fbx"], "cedar (ModelAsset)", "ok") + await asset_picker(["azmodel", "fbx"], "cedar (ModelAsset)", "ok") # 5) Verify if Mesh Asset is assigned try: @@ -231,7 +245,11 @@ class AssetPickerUIUXTest(EditorTestHelper): except pyside_utils.EventLoopTimeoutException as err: print(err) mesh_success = False - self.test_success = mesh_success and self.test_success + mesh_asset_assigned_ok = ( + "Successfully assigned Mesh asset via OK button", + "Failed to assign Mesh asset via OK button" + ) + Report.result(mesh_asset_assigned_ok, mesh_success) # Clear Mesh Asset hydra.get_set_test(entity, 0, "Controller|Configuration|Mesh Asset", None) @@ -242,7 +260,7 @@ class AssetPickerUIUXTest(EditorTestHelper): # Assign Mesh Asset via Enter pyside_utils.click_button_async(attached_button) - await asset_picker("Mesh Asset", ["azmodel", "fbx"], "cedar (ModelAsset)", "enter") + await asset_picker(["azmodel", "fbx"], "cedar (ModelAsset)", "enter") # 5) Verify if Mesh Asset is assigned try: @@ -251,8 +269,16 @@ class AssetPickerUIUXTest(EditorTestHelper): except pyside_utils.EventLoopTimeoutException as err: print(err) mesh_success = False - self.test_success = mesh_success and self.test_success + mesh_asset_assigned_enter = ( + "Successfully assigned Mesh asset via Enter button", + "Failed to assign Mesh asset via Enter button" + ) + Report.result(mesh_asset_assigned_enter, mesh_success) + + run_test() -test = AssetPickerUIUXTest() -test.run() +if __name__ == "__main__": + + from editor_python_test_tools.utils import Report + Report.start_test(AssetPicker_UI_UX) diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/BasicEditorWorkflows_LevelEntityComponentCRUD.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/BasicEditorWorkflows_LevelEntityComponentCRUD.py index 32d20ea2b4..9c5880ab1e 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/BasicEditorWorkflows_LevelEntityComponentCRUD.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/BasicEditorWorkflows_LevelEntityComponentCRUD.py @@ -5,39 +5,47 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ -""" -C6351273: Create a new level -C6384955: Basic Workflow: Entity Manipulation in the Outliner -C16929880: Add Delete Components -C15167490: Save a level -C15167491: Export a level -""" -import os -import sys -from PySide2 import QtWidgets - -import azlmbr.bus as bus -import azlmbr.editor as editor -import azlmbr.entity as entity -import azlmbr.math as math -import azlmbr.paths - -sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests')) -from editor_python_test_tools.editor_test_helper import EditorTestHelper -import editor_python_test_tools.pyside_utils as pyside_utils -import editor_python_test_tools.hydra_editor_utils as hydra +class Tests: + level_created = ( + "New level created successfully", + "Failed to create new level" + ) + new_entity_created = ( + "New entity created successfully", + "Failed to create a new entity" + ) + child_entity_created = ( + "New child entity created successfully", + "Failed to create new child entity" + ) + component_added = ( + "Component added to entity successfully", + "Failed to add component to entity" + ) + component_updated = ( + "Component property updated successfully", + "Failed to update component property" + ) + component_removed = ( + "Component removed from entity successfully", + "Failed to remove component from entity" + ) + level_saved_and_exported = ( + "Level saved and exported successfully", + "Failed to save/export level" + ) -class TestBasicEditorWorkflows(EditorTestHelper): - def __init__(self): - EditorTestHelper.__init__(self, log_prefix="BasicEditorWorkflows_LevelEntityComponent", args=["level"]) +def BasicEditorWorkflows_LevelEntityComponentCRUD(): + + import editor_python_test_tools.pyside_utils as pyside_utils @pyside_utils.wrap_async - async def run_test(self): + async def run_test(): """ Summary: - Open Lumberyard editor and check if basic Editor workflows are completable. + Open O3DE editor and check if basic Editor workflows are completable. Expected Behavior: - A new level can be created @@ -48,13 +56,25 @@ class TestBasicEditorWorkflows(EditorTestHelper): - Level can be exported Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the O3DE Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. :return: None """ + import os + from PySide2 import QtWidgets + + import azlmbr.bus as bus + import azlmbr.editor as editor + import azlmbr.entity as entity + import azlmbr.math as math + import azlmbr.paths + + import editor_python_test_tools.hydra_editor_utils as hydra + from editor_python_test_tools.utils import Report + def find_entity_by_name(entity_name): search_filter = entity.SearchFilter() search_filter.names = [entity_name] @@ -64,6 +84,7 @@ class TestBasicEditorWorkflows(EditorTestHelper): return None # 1) Create a new level + level = "tmp_level" editor_window = pyside_utils.get_editor_main_window() new_level_action = pyside_utils.get_action_for_menu_path(editor_window, "File", "New Level") pyside_utils.trigger_action_async(new_level_action) @@ -71,21 +92,17 @@ class TestBasicEditorWorkflows(EditorTestHelper): new_level_dlg = active_modal_widget.findChild(QtWidgets.QWidget, "CNewLevelDialog") if new_level_dlg: if new_level_dlg.windowTitle() == "New Level": - self.log("New Level dialog opened") + Report.info("New Level dialog opened") grp_box = new_level_dlg.findChild(QtWidgets.QGroupBox, "STATIC_GROUP1") level_name = grp_box.findChild(QtWidgets.QLineEdit, "LEVEL") - level_name.setText(self.args["level"]) + level_name.setText(level) button_box = new_level_dlg.findChild(QtWidgets.QDialogButtonBox, "buttonBox") button_box.button(QtWidgets.QDialogButtonBox.Ok).click() # Verify new level was created successfully level_create_success = await pyside_utils.wait_for_condition(lambda: editor.EditorToolsApplicationRequestBus( - bus.Broadcast, "GetCurrentLevelName") == self.args["level"], 5.0) - self.test_success = level_create_success - self.log(f"Create and load new level: {level_create_success}") - - # Execute EditorTestHelper setup since level was created outside of EditorTestHelper's methods - self.test_success = self.test_success and self.after_level_load() + bus.Broadcast, "GetCurrentLevelName") == level, 5.0) + Report.critical_result(Tests.level_created, level_create_success) # 2) Delete existing entities, and create and manipulate new entities via Entity Inspector search_filter = azlmbr.entity.SearchFilter() @@ -99,8 +116,7 @@ class TestBasicEditorWorkflows(EditorTestHelper): # Find the new entity parent_entity_id = find_entity_by_name("Entity1") parent_entity_success = await pyside_utils.wait_for_condition(lambda: parent_entity_id is not None, 5.0) - self.test_success = self.test_success and parent_entity_success - self.log(f"New entity creation: {parent_entity_success}") + Report.critical_result(Tests.new_entity_created, parent_entity_success) # TODO: Replace Hydra call to creates child entity and add components with context menu triggering - LYN-3951 # Create a new child entity @@ -111,29 +127,27 @@ class TestBasicEditorWorkflows(EditorTestHelper): # Verify entity hierarchy child_entity.get_parent_info() - self.test_success = self.test_success and child_entity.parent_id == parent_entity_id - self.log(f"Create entity hierarchy: {child_entity.parent_id == parent_entity_id}") + Report.result(Tests.child_entity_created, child_entity.parent_id == parent_entity_id) # 3) Add/configure a component on an entity # Add component and verify success child_entity.add_component("Box Shape") - component_add_success = self.wait_for_condition(lambda: hydra.has_components(child_entity.id, ["Box Shape"]), 5.0) - self.test_success = self.test_success and component_add_success - self.log(f"Add component: {component_add_success}") + component_add_success = await pyside_utils.wait_for_condition(lambda: hydra.has_components(child_entity.id, + ["Box Shape"]), 5.0) + Report.result(Tests.component_added, component_add_success) # Update the component dimensions_to_set = math.Vector3(16.0, 16.0, 16.0) child_entity.get_set_test(0, "Box Shape|Box Configuration|Dimensions", dimensions_to_set) - box_shape_dimensions = hydra.get_component_property_value(child_entity.components[0], "Box Shape|Box Configuration|Dimensions") - self.test_success = self.test_success and box_shape_dimensions == dimensions_to_set - self.log(f"Component update: {box_shape_dimensions == dimensions_to_set}") + box_shape_dimensions = hydra.get_component_property_value(child_entity.components[0], + "Box Shape|Box Configuration|Dimensions") + Report.result(Tests.component_updated, box_shape_dimensions == dimensions_to_set) # Remove the component child_entity.remove_component("Box Shape") - component_rem_success = self.wait_for_condition(lambda: not hydra.has_components(child_entity.id, ["Box Shape"]), - 5.0) - self.test_success = self.test_success and component_rem_success - self.log(f"Remove component: {component_rem_success}") + component_rem_success = await pyside_utils.wait_for_condition(lambda: not hydra.has_components(child_entity.id, + ["Box Shape"]), 5.0) + Report.result(Tests.component_removed, component_rem_success) # 4) Save the level save_level_action = pyside_utils.get_action_for_menu_path(editor_window, "File", "Save") @@ -143,12 +157,15 @@ class TestBasicEditorWorkflows(EditorTestHelper): export_action = pyside_utils.get_action_for_menu_path(editor_window, "Game", "Export to Engine") pyside_utils.trigger_action_async(export_action) level_pak_file = os.path.join( - "AutomatedTesting", "Levels", self.args["level"], "level.pak" + "AutomatedTesting", "Levels", level, "level.pak" ) - export_success = self.wait_for_condition(lambda: os.path.exists(level_pak_file), 5.0) - self.test_success = self.test_success and export_success - self.log(f"Save and Export: {export_success}") + export_success = await pyside_utils.wait_for_condition(lambda: os.path.exists(level_pak_file), 5.0) + Report.result(Tests.level_saved_and_exported, export_success) + + run_test() -test = TestBasicEditorWorkflows() -test.run() +if __name__ == "__main__": + + from editor_python_test_tools.utils import Report + Report.start_test(BasicEditorWorkflows_LevelEntityComponentCRUD) diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/ComponentCRUD_Add_Delete_Components.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/ComponentCRUD_Add_Delete_Components.py index 8f2264c9d1..779f1ef953 100755 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/ComponentCRUD_Add_Delete_Components.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/ComponentCRUD_Add_Delete_Components.py @@ -5,37 +5,39 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ -""" -C16929880: Add Delete Components -""" -import os -import sys -from PySide2 import QtWidgets, QtTest, QtCore -from PySide2.QtCore import Qt - -import azlmbr.legacy.general as general -import azlmbr.bus as bus -import azlmbr.editor as editor -import azlmbr.entity as entity -import azlmbr.math as math -import azlmbr.paths - -sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests')) -import editor_python_test_tools.hydra_editor_utils as hydra -import editor_python_test_tools.pyside_utils as pyside_utils -from editor_python_test_tools.editor_test_helper import EditorTestHelper +class Tests: + entity_created = ( + "Entity created successfully", + "Failed to create entity" + ) + box_component_added = ( + "Box Shape component added to entity", + "Failed to add Box Shape component to entity" + ) + mesh_component_added = ( + "Mesh component added to entity", + "Failed to add Mesh component to entity" + ) + mesh_component_deleted = ( + "Mesh component removed from entity", + "Failed to remove Mesh component from entity" + ) + mesh_component_delete_undo = ( + "Mesh component removal was successfully undone", + "Failed to undo Mesh component removal" + ) -class AddDeleteComponentsTest(EditorTestHelper): - def __init__(self): - EditorTestHelper.__init__(self, log_prefix="ComponentCRUD_Add_Delete_Components", args=["level"]) +def ComponentCRUD_Add_Delete_Components(): + + import editor_python_test_tools.pyside_utils as pyside_utils @pyside_utils.wrap_async - async def run_test(self): + async def run_test(): """ Summary: - Add/Delete Components to an entity. + Add/Delete Components to/from an entity. Expected Behavior: 1) Components can be added to an entity. @@ -61,36 +63,43 @@ class AddDeleteComponentsTest(EditorTestHelper): :return: None """ + from PySide2 import QtWidgets, QtTest, QtCore + from PySide2.QtCore import Qt + + import azlmbr.legacy.general as general + import azlmbr.bus as bus + import azlmbr.editor as editor + import azlmbr.entity as entity + import azlmbr.math as math + + import editor_python_test_tools.hydra_editor_utils as hydra + from editor_python_test_tools.utils import Report + from editor_python_test_tools.utils import TestHelper as helper + async def add_component(component_name): pyside_utils.click_button_async(add_comp_btn) popup = await pyside_utils.wait_for_popup_widget() tree = popup.findChild(QtWidgets.QTreeView, "Tree") component_index = pyside_utils.find_child_by_pattern(tree, component_name) if component_index.isValid(): - print(f"{component_name} found") + Report.info(f"{component_name} found") tree.expand(component_index) tree.setCurrentIndex(component_index) QtTest.QTest.keyClick(tree, Qt.Key_Enter, Qt.NoModifier) - # 1) Open level - self.test_success = self.create_level( - self.args["level"], - heightmap_resolution=1024, - heightmap_meters_per_pixel=1, - terrain_texture_resolution=4096, - use_terrain=False, - ) + # 1) Open an existing simple level + helper.init_idle() + helper.open_level("Physics", "Base") # 2) Create entity entity_position = math.Vector3(125.0, 136.0, 32.0) entity_id = editor.ToolsApplicationRequestBus( bus.Broadcast, "CreateNewEntityAtPosition", entity_position, entity.EntityId() ) - if entity_id.IsValid(): - print("Entity Created") + Report.critical_result(Tests.entity_created, entity_id.IsValid()) # 3) Select the newly created entity - general.select_object("Entity2") + general.select_object("Entity1") # Give the Entity Inspector time to fully create its contents general.idle_wait(0.5) @@ -100,11 +109,11 @@ class AddDeleteComponentsTest(EditorTestHelper): entity_inspector = editor_window.findChild(QtWidgets.QDockWidget, "Entity Inspector") add_comp_btn = entity_inspector.findChild(QtWidgets.QPushButton, "m_addComponentButton") await add_component("Box Shape") - print(f"Box Shape Component added: {hydra.has_components(entity_id, ['Box Shape'])}") + Report.result(Tests.box_component_added, hydra.has_components(entity_id, ['Box Shape'])) # 5) Add/verify Mesh component await add_component("Mesh") - print(f"Mesh Component added: {hydra.has_components(entity_id, ['Mesh'])}") + Report.result(Tests.mesh_component_added, hydra.has_components(entity_id, ['Mesh'])) # 6) Delete Mesh Component general.idle_wait(0.5) @@ -116,15 +125,17 @@ class AddDeleteComponentsTest(EditorTestHelper): QtTest.QTest.mouseClick(mesh_frame, Qt.LeftButton, Qt.NoModifier) QtTest.QTest.keyClick(mesh_frame, Qt.Key_Delete, Qt.NoModifier) success = await pyside_utils.wait_for_condition(lambda: not hydra.has_components(entity_id, ['Mesh']), 5.0) - if success: - print(f"Mesh Component deleted: {not hydra.has_components(entity_id, ['Mesh'])}") + Report.result(Tests.mesh_component_deleted, success) # 7) Undo deletion of component QtTest.QTest.keyPress(entity_inspector, Qt.Key_Z, Qt.ControlModifier) success = await pyside_utils.wait_for_condition(lambda: hydra.has_components(entity_id, ['Mesh']), 5.0) - if success: - print(f"Mesh Component deletion undone: {hydra.has_components(entity_id, ['Mesh'])}") + Report.result(Tests.mesh_component_delete_undo, success) + + run_test() -test = AddDeleteComponentsTest() -test.run() +if __name__ == "__main__": + + from editor_python_test_tools.utils import Report + Report.start_test(ComponentCRUD_Add_Delete_Components) diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Docking_BasicDockedTools.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Docking_BasicDockedTools.py index cc8ab24bed..2a91e7a374 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Docking_BasicDockedTools.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Docking_BasicDockedTools.py @@ -7,27 +7,32 @@ SPDX-License-Identifier: Apache-2.0 OR MIT C6376081: Basic Function: Docked/Undocked Tools """ -import os -import sys -from PySide2 import QtWidgets, QtTest, QtCore -import azlmbr.legacy.general as general -import azlmbr.bus as bus -import azlmbr.editor as editor -import azlmbr.entity as entity -import azlmbr.paths - -sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests')) -from editor_python_test_tools.editor_test_helper import EditorTestHelper -import editor_python_test_tools.pyside_utils as pyside_utils +class Tests: + all_tools_docked = ( + "The tools are all docked together in a tabbed widget", + "Failed to dock all tools together" + ) + docked_outliner_works = ( + "Entity Outliner works when docked, can select an Entity", + "Failed to select an Entity in the Outliner while docked" + ) + docked_inspector_works = ( + "Entity Inspector works when docked, Entity name changed", + "Failed to change Entity name in the Inspector while docked" + ) + docked_console_works = ( + "Console works when docked, sent a Console Command", + "Failed to send Console Command in the Console while docked" + ) -class TestDockingBasicDockedTools(EditorTestHelper): - def __init__(self): - EditorTestHelper.__init__(self, log_prefix="Docking_BasicDockedTools", args=["level"]) +def Docking_BasicDockedTools(): + + import editor_python_test_tools.pyside_utils as pyside_utils @pyside_utils.wrap_async - async def run_test(self): + async def run_test(): """ Summary: Test that tools still work as expected when docked together. @@ -50,14 +55,19 @@ class TestDockingBasicDockedTools(EditorTestHelper): :return: None """ - # Create a level since we are going to be dealing with an Entity. - self.create_level( - self.args["level"], - heightmap_resolution=1024, - heightmap_meters_per_pixel=1, - terrain_texture_resolution=4096, - use_terrain=False, - ) + from PySide2 import QtWidgets, QtTest, QtCore + + import azlmbr.legacy.general as general + import azlmbr.bus as bus + import azlmbr.editor as editor + import azlmbr.entity as entity + + from editor_python_test_tools.utils import Report + from editor_python_test_tools.utils import TestHelper as helper + + # Open an existing simple level + helper.init_idle() + helper.open_level("Physics", "Base") # Make sure the Entity Outliner, Entity Inspector and Console tools are open general.open_pane("Entity Outliner (PREVIEW)") @@ -101,12 +111,14 @@ class TestDockingBasicDockedTools(EditorTestHelper): entity_inspector_parent = entity_inspector.parentWidget() entity_outliner_parent = entity_outliner.parentWidget() console_parent = console.parentWidget() - print(f"Entity Inspector parent = {entity_inspector_parent}, Entity Outliner parent = {entity_outliner_parent}, Console parent = {console_parent}") - return isinstance(entity_inspector_parent, QtWidgets.QStackedWidget) and (entity_inspector_parent == entity_outliner_parent) and (entity_outliner_parent == console_parent) + Report.info(f"Entity Inspector parent = {entity_inspector_parent}, Entity Outliner parent = " + f"{entity_outliner_parent}, Console parent = {console_parent}") + return isinstance(entity_inspector_parent, QtWidgets.QStackedWidget) and \ + (entity_inspector_parent == entity_outliner_parent) and \ + (entity_outliner_parent == console_parent) success = await pyside_utils.wait_for(check_all_panes_tabbed, timeout=3.0) - if success: - print("The tools are all docked together in a tabbed widget") + Report.result(Tests.all_tools_docked, success) # 2.1,2) Select an Entity in the Entity Outliner. entity_inspector = editor_window.findChild(QtWidgets.QDockWidget, "Entity Inspector") @@ -116,8 +128,7 @@ class TestDockingBasicDockedTools(EditorTestHelper): test_entity_index = pyside_utils.find_child_by_pattern(object_tree, entity_original_name) object_tree.clearSelection() object_tree.setCurrentIndex(test_entity_index) - if object_tree.currentIndex(): - print("Entity Outliner works when docked, can select an Entity") + Report.result(Tests.docked_outliner_works, object_tree.currentIndex() == test_entity_index) # 2.3,4) Change the name of the selected Entity via the Entity Inspector. entity_inspector_name_field = entity_inspector.findChild(QtWidgets.QLineEdit, "m_entityNameEditor") @@ -125,14 +136,23 @@ class TestDockingBasicDockedTools(EditorTestHelper): entity_inspector_name_field.setText(expected_new_name) QtTest.QTest.keyClick(entity_inspector_name_field, QtCore.Qt.Key_Enter) entity_new_name = editor.EditorEntityInfoRequestBus(bus.Event, "GetName", entity_id) - if entity_new_name == expected_new_name: - print(f"Entity Inspector works when docked, Entity name changed to {entity_new_name}") + Report.result(Tests.docked_inspector_works, entity_new_name == expected_new_name) # 2.5,6) Send a console command. console_line_edit = console.findChild(QtWidgets.QLineEdit, "lineEdit") - console_line_edit.setText("Hello, world!") + console_line_edit.setText("t_Scale 2") + QtTest.QTest.keyClick(console_line_edit, QtCore.Qt.Key_Enter) + general.get_cvar("t_Scale") + Report.result(Tests.docked_console_works, general.get_cvar("t_Scale") == "2") + + # Reset the altered cvar + console_line_edit.setText("t_Scale 1") QtTest.QTest.keyClick(console_line_edit, QtCore.Qt.Key_Enter) + run_test() -test = TestDockingBasicDockedTools() -test.run() + +if __name__ == "__main__": + + from editor_python_test_tools.utils import Report + Report.start_test(Docking_BasicDockedTools) diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/InputBindings_Add_Remove_Input_Events.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/InputBindings_Add_Remove_Input_Events.py index 4693f20155..f4769dab4d 100755 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/InputBindings_Add_Remove_Input_Events.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/InputBindings_Add_Remove_Input_Events.py @@ -5,32 +5,36 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ -""" -C1506881: Adding/Removing Event Groups -""" -import os -import sys -from PySide2 import QtWidgets +class Tests: + asset_editor_opened = ( + "Successfully opened the Asset Editor", + "Failed to open the Asset Editor" + ) + event_groups_added = ( + "Successfully added event groups via +", + "Failed to add event groups" + ) + single_event_group_deleted = ( + "Successfully deleted an event group", + "Failed to delete event group" + ) + all_event_groups_deleted = ( + "Successfully deleted all event groups", + "Failed to delete all event groups" + ) + asset_editor_closed = ( + "Successfully closed the Asset Editor", + "Failed to close the Asset Editor" + ) -import azlmbr.legacy.general as general -import azlmbr.bus as bus -import azlmbr.editor as editor -import azlmbr.entity as entity -import azlmbr.math as math -import azlmbr.paths -sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests')) -import editor_python_test_tools.hydra_editor_utils as hydra -import editor_python_test_tools.pyside_utils as pyside_utils -from editor_python_test_tools.editor_test_helper import EditorTestHelper +def InputBindings_Add_Remove_Input_Events(): -class AddRemoveInputEventsTest(EditorTestHelper): - def __init__(self): - EditorTestHelper.__init__(self, log_prefix="InputBindings_Add_Remove_Input_Events", args=["level"]) + import editor_python_test_tools.pyside_utils as pyside_utils @pyside_utils.wrap_async - async def run_test(self): + async def run_test(): """ Summary: Verify if we are able add/remove input events in inputbindings file. @@ -42,7 +46,7 @@ class AddRemoveInputEventsTest(EditorTestHelper): Test Steps: - 1) Open a new level + 1) Open an existing level 2) Open Asset Editor 3) Access Asset Editor 4) Create a new .inputbindings file and add event groups @@ -61,6 +65,13 @@ class AddRemoveInputEventsTest(EditorTestHelper): :return: None """ + from PySide2 import QtWidgets + + import azlmbr.legacy.general as general + + from editor_python_test_tools.utils import Report + from editor_python_test_tools.utils import TestHelper as helper + def open_asset_editor(): general.open_pane("Asset Editor") return general.is_pane_visible("Asset Editor") @@ -69,17 +80,12 @@ class AddRemoveInputEventsTest(EditorTestHelper): general.close_pane("Asset Editor") return not general.is_pane_visible("Asset Editor") - # 1) Open a new level - self.test_success = self.create_level( - self.args["level"], - heightmap_resolution=1024, - heightmap_meters_per_pixel=1, - terrain_texture_resolution=4096, - use_terrain=False, - ) + # 1) Open an existing simple level + helper.init_idle() + helper.open_level("Physics", "Base") # 2) Open Asset Editor - print(f"Asset Editor opened: {open_asset_editor()}") + Report.result(Tests.asset_editor_opened, open_asset_editor()) # 3) Access Asset Editor editor_window = pyside_utils.get_editor_main_window() @@ -103,8 +109,7 @@ class AddRemoveInputEventsTest(EditorTestHelper): # 5) Verify if there are 3 elements in the Input Event Groups label no_of_elements_label = input_event_groups.findChild(QtWidgets.QLabel, "DefaultLabel") success = await pyside_utils.wait_for_condition(lambda: "3 elements" in no_of_elements_label.text(), 2.0) - if success: - print("New Event Groups added when + is clicked") + Report.result(Tests.event_groups_added, success) # 6) Delete one event group event = asset_editor_widget.findChildren(QtWidgets.QFrame, "")[0] @@ -121,11 +126,11 @@ class AddRemoveInputEventsTest(EditorTestHelper): input_event_group = input_event_groups[1] no_of_elements_label = input_event_group.findChild(QtWidgets.QLabel, "DefaultLabel") return no_of_elements_label.text() + return "" - return ""; - success = await pyside_utils.wait_for_condition(lambda: "2 elements" in get_elements_label_text(asset_editor_widget), 2.0) - if success: - print("Event Group deleted when the Delete button is clicked on an Event Group") + success = await pyside_utils.wait_for_condition(lambda: "2 elements" in + get_elements_label_text(asset_editor_widget), 2.0) + Report.result(Tests.single_event_group_deleted, success) # 8) Click on Delete button to delete all the Event Groups # First QToolButton child of active input_event_groups is +, Second QToolButton is Delete @@ -141,13 +146,17 @@ class AddRemoveInputEventsTest(EditorTestHelper): yes_button.click() # 9) Verify if all the elements are deleted - success = await pyside_utils.wait_for_condition(lambda: "0 elements" in get_elements_label_text(asset_editor_widget), 2.0) - if success: - print("All event groups deleted on clicking the Delete button") + success = await pyside_utils.wait_for_condition(lambda: "0 elements" in + get_elements_label_text(asset_editor_widget), 2.0) + Report.result(Tests.all_event_groups_deleted, success) # 10) Close Asset Editor - print(f"Asset Editor closed: {close_asset_editor()}") + Report.result(Tests.asset_editor_closed, close_asset_editor()) + + run_test() -test = AddRemoveInputEventsTest() -test.run() +if __name__ == "__main__": + + from editor_python_test_tools.utils import Report + Report.start_test(InputBindings_Add_Remove_Input_Events) diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_EditMenuOptions.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_EditMenuOptions.py index 6b861894c0..c7088a54c5 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_EditMenuOptions.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_EditMenuOptions.py @@ -5,93 +5,78 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ -""" -C24064529: Base Edit Menu Options -""" -import os -import sys +def Menus_EditMenuOptions_Work(): + """ + Summary: + Interact with Edit Menu options and verify if all the options are working. -import azlmbr.paths + Expected Behavior: + The Edit menu functions normally. -sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests')) -from editor_python_test_tools.editor_test_helper import EditorTestHelper -import editor_python_test_tools.pyside_utils as pyside_utils + Test Steps: + 1) Open an existing level + 2) Interact with Edit Menu options + Note: + - This test file must be called from the O3DE Editor command terminal + - Any passed and failed tests are written to the Editor.log file. + Parsing the file or running a log_monitor are required to observe the test results. -class TestEditMenuOptions(EditorTestHelper): - def __init__(self): - EditorTestHelper.__init__(self, log_prefix="Menus_EditMenuOptions", args=["level"]) + :return: None + """ - def run_test(self): - """ - Summary: - Interact with Edit Menu options and verify if all the options are working. + import editor_python_test_tools.pyside_utils as pyside_utils + from editor_python_test_tools.utils import Report + from editor_python_test_tools.utils import TestHelper as helper - Expected Behavior: - The Edit menu functions normally. + edit_menu_options = [ + ("Undo",), + ("Redo",), + ("Duplicate",), + ("Delete",), + ("Select All",), + ("Invert Selection",), + ("Toggle Pivot Location",), + ("Reset Entity Transform",), + ("Reset Manipulator",), + ("Reset Transform (Local)",), + ("Reset Transform (World)",), + ("Hide Selection",), + ("Show All",), + ("Modify", "Snap", "Snap angle"), + ("Modify", "Transform Mode", "Move"), + ("Modify", "Transform Mode", "Rotate"), + ("Modify", "Transform Mode", "Scale"), + ("Editor Settings", "Global Preferences"), + ("Editor Settings", "Editor Settings Manager"), + ("Editor Settings", "Keyboard Customization", "Customize Keyboard"), + ("Editor Settings", "Keyboard Customization", "Export Keyboard Settings"), + ("Editor Settings", "Keyboard Customization", "Import Keyboard Settings"), + ] - Test Steps: - 1) Create a temp level - 2) Interact with Edit Menu options + # 1) Open an existing simple level + helper.init_idle() + helper.open_level("Physics", "Base") - Note: - - This test file must be called from the Lumberyard Editor command terminal - - Any passed and failed tests are written to the Editor.log file. - Parsing the file or running a log_monitor are required to observe the test results. - - :return: None - """ - edit_menu_options = [ - ("Undo",), - ("Redo",), - ("Duplicate",), - ("Delete",), - ("Select All",), - ("Invert Selection",), - ("Toggle Pivot Location",), - ("Reset Entity Transform",), - ("Reset Manipulator",), - ("Reset Transform (Local)",), - ("Reset Transform (World)",), - ("Hide Selection",), - ("Show All",), - ("Modify", "Snap", "Snap angle"), - ("Modify", "Transform Mode", "Move"), - ("Modify", "Transform Mode", "Rotate"), - ("Modify", "Transform Mode", "Scale"), - ("Editor Settings", "Global Preferences"), - ("Editor Settings", "Editor Settings Manager"), - ("Editor Settings", "Keyboard Customization", "Customize Keyboard"), - ("Editor Settings", "Keyboard Customization", "Export Keyboard Settings"), - ("Editor Settings", "Keyboard Customization", "Import Keyboard Settings"), - ] - - # 1) Create and open the temp level - self.test_success = self.create_level( - self.args["level"], - heightmap_resolution=1024, - heightmap_meters_per_pixel=1, - terrain_texture_resolution=4096, - use_terrain=False, - ) - - def on_action_triggered(action_name): - print(f"{action_name} Action triggered") - - # 2) Interact with Edit Menu options + # 2) Interact with Edit Menu options + editor_window = pyside_utils.get_editor_main_window() + for option in edit_menu_options: try: - editor_window = pyside_utils.get_editor_main_window() - for option in edit_menu_options: - action = pyside_utils.get_action_for_menu_path(editor_window, "Edit", *option) - trig_func = lambda: on_action_triggered(action.iconText()) - action.triggered.connect(trig_func) - action.trigger() - action.triggered.disconnect(trig_func) + action = pyside_utils.get_action_for_menu_path(editor_window, "Edit", *option) + action.trigger() + action_triggered = True except Exception as e: - self.test_success = False + action_triggered = False print(e) + menu_action_triggered = ( + f"{action.iconText()} action triggered successfully", + f"Failed to trigger {action.iconText()} action" + ) + Report.result(menu_action_triggered, action_triggered) -test = TestEditMenuOptions() -test.run() +if __name__ == "__main__": + + from editor_python_test_tools.utils import Report + Report.start_test(Menus_EditMenuOptions_Work) diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_FileMenuOptions.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_FileMenuOptions.py index ab9aa1d326..a3e7611b5e 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_FileMenuOptions.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_FileMenuOptions.py @@ -5,80 +5,69 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ -import os -import sys -import azlmbr.paths +def Menus_FileMenuOptions_Work(): + """ + Summary: + Interact with File Menu options and verify if all the options are working. -sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests')) -from editor_python_test_tools.editor_test_helper import EditorTestHelper -import editor_python_test_tools.pyside_utils as pyside_utils + Expected Behavior: + The File menu functions normally. + Test Steps: + 1) Open level + 2) Interact with File Menu options -class TestFileMenuOptions(EditorTestHelper): - def __init__(self): - EditorTestHelper.__init__(self, log_prefix="file_menu_options: ", args=["level"]) + Note: + - This test file must be called from the O3DE Editor command terminal + - Any passed and failed tests are written to the Editor.log file. + Parsing the file or running a log_monitor are required to observe the test results. - def run_test(self): - """ - Summary: - Interact with File Menu options and verify if all the options are working. + :return: None + """ - Expected Behavior: - The File menu functions normally. + import editor_python_test_tools.pyside_utils as pyside_utils + from editor_python_test_tools.utils import Report + from editor_python_test_tools.utils import TestHelper as helper - Test Steps: - 1) Open level - 2) Interact with File Menu options + file_menu_options = [ + ("New Level",), + ("Open Level",), + ("Import",), + ("Save",), + ("Save As",), + ("Save Level Statistics",), + ("Edit Project Settings",), + ("Edit Platform Settings",), + ("New Project",), + ("Open Project",), + ("Show Log File",), + ("Resave All Slices",), + ("Exit",), + ] - Note: - - This test file must be called from the Lumberyard Editor command terminal - - Any passed and failed tests are written to the Editor.log file. - Parsing the file or running a log_monitor are required to observe the test results. + # 1) Open an existing simple level + helper.init_idle() + helper.open_level("Physics", "Base") - :return: None - """ - file_menu_options = [ - ("New Level",), - ("Open Level",), - ("Import",), - ("Save",), - ("Save As",), - ("Save Level Statistics",), - ("Edit Project Settings",), - ("Edit Platform Settings",), - ("New Project",), - ("Open Project",), - ("Show Log File",), - ("Resave All Slices",), - ("Exit",), - ] - - # 1) Open level - self.test_success = self.create_level( - self.args["level"], - heightmap_resolution=1024, - heightmap_meters_per_pixel=1, - terrain_texture_resolution=4096, - use_terrain=False, - ) - - def on_action_triggered(action_name): - print(f"{action_name} Action triggered") - - # 2) Interact with File Menu options + # 2) Interact with File Menu options + editor_window = pyside_utils.get_editor_main_window() + for option in file_menu_options: try: - editor_window = pyside_utils.get_editor_main_window() - for option in file_menu_options: - action = pyside_utils.get_action_for_menu_path(editor_window, "File", *option) - trig_func = lambda: on_action_triggered(action.iconText()) - action.triggered.connect(trig_func) - action.trigger() - action.triggered.disconnect(trig_func) + action = pyside_utils.get_action_for_menu_path(editor_window, "File", *option) + action.trigger() + action_triggered = True except Exception as e: - self.test_success = False + action_triggered = False print(e) + menu_action_triggered = ( + f"{action.iconText()} action triggered successfully", + f"Failed to trigger {action.iconText()} action" + ) + Report.result(menu_action_triggered, action_triggered) -test = TestFileMenuOptions() -test.run() +if __name__ == "__main__": + + from editor_python_test_tools.utils import Report + Report.start_test(Menus_FileMenuOptions_Work) diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_ViewMenuOptions.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_ViewMenuOptions.py index d1233e9815..f1b9e5d4d8 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_ViewMenuOptions.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_ViewMenuOptions.py @@ -5,81 +5,66 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ -""" -C24064534: The View menu options function normally -""" -import os -import sys +def Menus_ViewMenuOptions_Work(): + """ + Summary: + Interact with View Menu options and verify if all the options are working. -import azlmbr.paths + Expected Behavior: + The View menu functions normally. -sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests')) -from editor_python_test_tools.editor_test_helper import EditorTestHelper -import editor_python_test_tools.pyside_utils as pyside_utils + Test Steps: + 1) Open an existing level + 2) Interact with View Menu options + Note: + - This test file must be called from the O3DE Editor command terminal + - Any passed and failed tests are written to the Editor.log file. + Parsing the file or running a log_monitor are required to observe the test results. -class TestViewMenuOptions(EditorTestHelper): - def __init__(self): - EditorTestHelper.__init__(self, log_prefix="Menus_EditMenuOptions", args=["level"]) + :return: None + """ - def run_test(self): - """ - Summary: - Interact with View Menu options and verify if all the options are working. + import editor_python_test_tools.pyside_utils as pyside_utils + from editor_python_test_tools.utils import Report + from editor_python_test_tools.utils import TestHelper as helper - Expected Behavior: - The View menu functions normally. + view_menu_options = [ + ("Center on Selection",), + ("Show Quick Access Bar",), + ("Viewport", "Configure Layout"), + ("Viewport", "Go to Position"), + ("Viewport", "Center on Selection"), + ("Viewport", "Go to Location"), + ("Viewport", "Remember Location"), + ("Viewport", "Switch Camera"), + ("Viewport", "Show/Hide Helpers"), + ("Refresh Style",), + ] - Test Steps: - 1) Create a temp level - 2) Interact with View Menu options + # 1) Open an existing simple level + helper.init_idle() + helper.open_level("Physics", "Base") - Note: - - This test file must be called from the Lumberyard Editor command terminal - - Any passed and failed tests are written to the Editor.log file. - Parsing the file or running a log_monitor are required to observe the test results. - - :return: None - """ - view_menu_options = [ - ("Center on Selection",), - ("Show Quick Access Bar",), - ("Viewport", "Configure Layout"), - ("Viewport", "Go to Position"), - ("Viewport", "Center on Selection"), - ("Viewport", "Go to Location"), - ("Viewport", "Remember Location"), - ("Viewport", "Switch Camera"), - ("Viewport", "Show/Hide Helpers"), - ("Refresh Style",), - ] - - # 1) Create and open the temp level - self.test_success = self.create_level( - self.args["level"], - heightmap_resolution=1024, - heightmap_meters_per_pixel=1, - terrain_texture_resolution=4096, - use_terrain=False, - ) - - def on_action_triggered(action_name): - print(f"{action_name} Action triggered") - - # 2) Interact with View Menu options + # 2) Interact with View Menu options + editor_window = pyside_utils.get_editor_main_window() + for option in view_menu_options: try: - editor_window = pyside_utils.get_editor_main_window() - for option in view_menu_options: - action = pyside_utils.get_action_for_menu_path(editor_window, "View", *option) - trig_func = lambda: on_action_triggered(action.iconText()) - action.triggered.connect(trig_func) - action.trigger() - action.triggered.disconnect(trig_func) + action = pyside_utils.get_action_for_menu_path(editor_window, "View", *option) + action.trigger() + action_triggered = True except Exception as e: - self.test_success = False + action_triggered = False print(e) + menu_action_triggered = ( + f"{action.iconText()} action triggered successfully", + f"Failed to trigger {action.iconText()} action" + ) + Report.result(menu_action_triggered, action_triggered) -test = TestViewMenuOptions() -test.run() +if __name__ == "__main__": + + from editor_python_test_tools.utils import Report + Report.start_test(Menus_ViewMenuOptions_Work) diff --git a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main.py b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main.py new file mode 100644 index 0000000000..26b254ae71 --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main.py @@ -0,0 +1,43 @@ +""" +Copyright (c) Contributors to the Open 3D Engine Project. +For complete copyright and license terms please see the LICENSE at the root of this distribution. + +SPDX-License-Identifier: Apache-2.0 OR MIT +""" + +import os +import pytest +import sys + +import ly_test_tools.environment.file_system as file_system + +sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../automatedtesting_shared') +from base import TestAutomationBase + + +@pytest.fixture +def remove_test_level(request, workspace, project): + file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", "tmp_level")], True, True) + + def teardown(): + file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", "tmp_level")], True, True) + + request.addfinalizer(teardown) + + +@pytest.mark.SUITE_main +@pytest.mark.parametrize("launcher_platform", ['windows_editor']) +@pytest.mark.parametrize("project", ["AutomatedTesting"]) +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) + + @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) diff --git a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main_Optimized.py b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main_Optimized.py new file mode 100644 index 0000000000..9c0b99daff --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main_Optimized.py @@ -0,0 +1,75 @@ +""" +Copyright (c) Contributors to the Open 3D Engine Project. +For complete copyright and license terms please see the LICENSE at the root of this distribution. + +SPDX-License-Identifier: Apache-2.0 OR MIT +""" + +import os +import pytest + +import ly_test_tools.environment.file_system as file_system +from ly_test_tools.o3de.editor_test import EditorSingleTest, EditorSharedTest, EditorParallelTest, EditorTestSuite + + +@pytest.mark.xfail(reason="Optimized tests are experimental, we will enable xfail and monitor them temporarily.") +@pytest.mark.SUITE_main +@pytest.mark.parametrize("launcher_platform", ['windows_editor']) +@pytest.mark.parametrize("project", ["AutomatedTesting"]) +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 = [] + + class test_BasicEditorWorkflows_LevelEntityComponentCRUD(EditorSingleTest): + # Custom teardown to remove slice asset created during test + def teardown(self, request, workspace, editor, editor_test_results, launcher_platform): + file_system.delete([os.path.join(workspace.paths.engine_root(), "AutomatedTesting", "Levels", "tmp_level")], + True, True) + from .EditorScripts import BasicEditorWorkflows_LevelEntityComponentCRUD as test_module + + @pytest.mark.REQUIRES_gpu + class test_BasicEditorWorkflows_GPU_LevelEntityComponentCRUD(EditorSingleTest): + # Disable null renderer + use_null_renderer = False + + # Custom teardown to remove slice asset created during test + def teardown(self, request, workspace, editor, editor_test_results, launcher_platform): + file_system.delete([os.path.join(workspace.paths.engine_root(), "AutomatedTesting", "Levels", "tmp_level")], + True, True) + from .EditorScripts import BasicEditorWorkflows_LevelEntityComponentCRUD as test_module + + 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 + + +@pytest.mark.xfail(reason="Optimized tests are experimental, we will enable xfail and monitor them temporarily.") +@pytest.mark.SUITE_main +@pytest.mark.parametrize("launcher_platform", ['windows_editor']) +@pytest.mark.parametrize("project", ["AutomatedTesting"]) +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"] + + 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 + + class test_ComponentCRUD_Add_Delete_Components(EditorSharedTest): + from .EditorScripts import ComponentCRUD_Add_Delete_Components as test_module + + class test_Menus_ViewMenuOptions_Work(EditorSharedTest): + from .EditorScripts import Menus_ViewMenuOptions as test_module + + @pytest.mark.skip(reason="Times out due to dialogs failing to dismiss: LYN-4208") + class test_Menus_FileMenuOptions_Work(EditorSharedTest): + from .EditorScripts import Menus_FileMenuOptions as test_module diff --git a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Periodic.py b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Periodic.py new file mode 100644 index 0000000000..398b64bc87 --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Periodic.py @@ -0,0 +1,62 @@ +""" +Copyright (c) Contributors to the Open 3D Engine Project. +For complete copyright and license terms please see the LICENSE at the root of this distribution. + +SPDX-License-Identifier: Apache-2.0 OR MIT +""" + +import os +import pytest +import sys + +import ly_test_tools.environment.file_system as file_system + +sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../automatedtesting_shared') +from base import TestAutomationBase + + +@pytest.fixture +def remove_test_level(request, workspace, project): + file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", "tmp_level")], True, True) + + def teardown(): + file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", "tmp_level")], True, True) + + request.addfinalizer(teardown) + + +@pytest.mark.SUITE_periodic +@pytest.mark.parametrize("launcher_platform", ['windows_editor']) +@pytest.mark.parametrize("project", ["AutomatedTesting"]) +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) + + @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) + + @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) + + 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) + + 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) + + 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) + + @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) diff --git a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Sandbox.py b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Sandbox.py new file mode 100644 index 0000000000..98a6620d9c --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Sandbox.py @@ -0,0 +1,27 @@ +""" +Copyright (c) Contributors to the Open 3D Engine Project. +For complete copyright and license terms please see the LICENSE at the root of this distribution. + +SPDX-License-Identifier: Apache-2.0 OR MIT +""" + +import os +import pytest +import sys + +sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../automatedtesting_shared') +from base import TestAutomationBase + + +@pytest.mark.SUITE_sandbox +@pytest.mark.parametrize("launcher_platform", ['windows_editor']) +@pytest.mark.parametrize("project", ["AutomatedTesting"]) +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) + + 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) diff --git a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Sandbox_Optimized.py b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Sandbox_Optimized.py new file mode 100644 index 0000000000..d49e9e1c9b --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Sandbox_Optimized.py @@ -0,0 +1,27 @@ +""" +Copyright (c) Contributors to the Open 3D Engine Project. +For complete copyright and license terms please see the LICENSE at the root of this distribution. + +SPDX-License-Identifier: Apache-2.0 OR MIT +""" + +import os +import pytest + +from ly_test_tools.o3de.editor_test import EditorSingleTest, EditorSharedTest, EditorParallelTest, EditorTestSuite + + +@pytest.mark.xfail(reason="Optimized tests are experimental, we will enable xfail and monitor them temporarily.") +@pytest.mark.SUITE_sandbox +@pytest.mark.parametrize("launcher_platform", ['windows_editor']) +@pytest.mark.parametrize("project", ["AutomatedTesting"]) +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"] + + class test_Docking_BasicDockedTools(EditorSharedTest): + from .EditorScripts import Docking_BasicDockedTools as test_module + + class test_Menus_EditMenuOptions_Work(EditorSharedTest): + from .EditorScripts import Menus_EditMenuOptions as test_module diff --git a/AutomatedTesting/Gem/PythonTests/editor/test_AssetBrowser.py b/AutomatedTesting/Gem/PythonTests/editor/test_AssetBrowser.py deleted file mode 100644 index 6067ffd1c0..0000000000 --- a/AutomatedTesting/Gem/PythonTests/editor/test_AssetBrowser.py +++ /dev/null @@ -1,89 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -""" -C13660195: Asset Browser - File Tree Navigation -""" - -import os -import pytest - -# Bail on the test if ly_test_tools doesn't exist. -pytest.importorskip('ly_test_tools') -import ly_test_tools.environment.file_system as file_system -import editor_python_test_tools.hydra_test_utils as hydra - -test_directory = os.path.join(os.path.dirname(__file__), "EditorScripts") -log_monitor_timeout = 180 - - -@pytest.mark.parametrize('project', ['AutomatedTesting']) -@pytest.mark.parametrize('level', ['tmp_level']) -@pytest.mark.usefixtures("automatic_process_killer") -@pytest.mark.parametrize("launcher_platform", ['windows_editor']) -class TestAssetBrowser(object): - - @pytest.fixture(autouse=True) - def setup_teardown(self, request, workspace, project, level): - def teardown(): - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - - request.addfinalizer(teardown) - - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - - @pytest.mark.test_case_id("C13660195") - @pytest.mark.SUITE_periodic - def test_AssetBrowser_TreeNavigation(self, request, editor, level, launcher_platform): - expected_lines = [ - "Collapse/Expand tests: True", - "Asset visibility test: True", - "Scrollbar visibility test: True", - "AssetBrowser_TreeNavigation: result=SUCCESS" - - ] - - hydra.launch_and_validate_results( - request, - test_directory, - editor, - "AssetBrowser_TreeNavigation.py", - expected_lines, - run_python="--runpython", - cfg_args=[level], - timeout=log_monitor_timeout - ) - - @pytest.mark.test_case_id("C13660194") - @pytest.mark.SUITE_periodic - def test_AssetBrowser_SearchFiltering(self, request, editor, level, launcher_platform): - expected_lines = [ - "cedar.fbx asset is filtered in Asset Browser", - "Animation file type(s) is present in the file tree: True", - "FileTag file type(s) and Animation file type(s) is present in the file tree: True", - "FileTag file type(s) is present in the file tree after removing Animation filter: True", - ] - - unexpected_lines = [ - "Asset Browser opened: False", - "Animation file type(s) is present in the file tree: False", - "FileTag file type(s) and Animation file type(s) is present in the file tree: False", - "FileTag file type(s) is present in the file tree after removing Animation filter: False", - ] - - hydra.launch_and_validate_results( - request, - test_directory, - editor, - "AssetBrowser_SearchFiltering.py", - expected_lines, - unexpected_lines=unexpected_lines, - cfg_args=[level], - auto_test_mode=False, - run_python="--runpython", - timeout=log_monitor_timeout, - ) diff --git a/AutomatedTesting/Gem/PythonTests/editor/test_AssetPicker.py b/AutomatedTesting/Gem/PythonTests/editor/test_AssetPicker.py deleted file mode 100644 index 9fc5582e0b..0000000000 --- a/AutomatedTesting/Gem/PythonTests/editor/test_AssetPicker.py +++ /dev/null @@ -1,74 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -""" -C13751579: Asset Picker UI/UX -""" - -import os -import pytest - -# Bail on the test if ly_test_tools doesn't exist. -pytest.importorskip('ly_test_tools') -import ly_test_tools.environment.file_system as file_system -import editor_python_test_tools.hydra_test_utils as hydra - -test_directory = os.path.join(os.path.dirname(__file__), "EditorScripts") -log_monitor_timeout = 90 - - -@pytest.mark.parametrize('project', ['AutomatedTesting']) -@pytest.mark.parametrize('level', ['tmp_level']) -@pytest.mark.usefixtures("automatic_process_killer") -@pytest.mark.parametrize("launcher_platform", ['windows_editor']) -class TestAssetPicker(object): - - @pytest.fixture(autouse=True) - def setup_teardown(self, request, workspace, project, level): - def teardown(): - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - - request.addfinalizer(teardown) - - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - - @pytest.mark.test_case_id("C13751579", "C1508814") - @pytest.mark.SUITE_periodic - @pytest.mark.xfail # ATOM-15493 - def test_AssetPicker_UI_UX(self, request, editor, level, launcher_platform): - expected_lines = [ - "TestEntity Entity successfully created", - "Mesh component was added to entity", - "Entity has a Mesh component", - "Mesh Asset: Asset Picker title for Mesh: Pick ModelAsset", - "Mesh Asset: Scroll Bar is not visible before expanding the tree: True", - "Mesh Asset: Top level folder initially collapsed: True", - "Mesh Asset: Top level folder expanded: True", - "Mesh Asset: Nested folder initially collapsed: True", - "Mesh Asset: Nested folder expanded: True", - "Mesh Asset: Scroll Bar appeared after expanding tree: True", - "Mesh Asset: Nested folder collapsed: True", - "Mesh Asset: Top level folder collapsed: True", - "Mesh Asset: Expected Assets populated in the file picker: True", - "Widget Move Test: True", - "Widget Resize Test: True", - "Asset assigned for ok option: True", - "Asset assigned for enter option: True", - "AssetPicker_UI_UX: result=SUCCESS" - ] - - hydra.launch_and_validate_results( - request, - test_directory, - editor, - "AssetPicker_UI_UX.py", - expected_lines, - cfg_args=[level], - run_python="--runpython", - auto_test_mode=False, - timeout=log_monitor_timeout, - ) diff --git a/AutomatedTesting/Gem/PythonTests/editor/test_BasicEditorWorkflows.py b/AutomatedTesting/Gem/PythonTests/editor/test_BasicEditorWorkflows.py deleted file mode 100644 index 49860c8387..0000000000 --- a/AutomatedTesting/Gem/PythonTests/editor/test_BasicEditorWorkflows.py +++ /dev/null @@ -1,96 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -import os -import pytest - -# Bail on the test if ly_test_tools doesn't exist. -pytest.importorskip('ly_test_tools') -import ly_test_tools.environment.file_system as file_system -import ly_test_tools._internal.pytest_plugin as internal_plugin -import editor_python_test_tools.hydra_test_utils as hydra - -test_directory = os.path.join(os.path.dirname(__file__), "EditorScripts") -log_monitor_timeout = 180 - - -@pytest.mark.parametrize('project', ['AutomatedTesting']) -@pytest.mark.parametrize('level', ['tmp_level']) -@pytest.mark.usefixtures("automatic_process_killer") -@pytest.mark.parametrize("launcher_platform", ['windows_editor']) -class TestBasicEditorWorkflows(object): - - @pytest.fixture(autouse=True) - def setup_teardown(self, request, workspace, project, level): - def teardown(): - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - - request.addfinalizer(teardown) - - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - - @pytest.mark.test_case_id("C6351273", "C6384955", "C16929880", "C15167490", "C15167491") - @pytest.mark.SUITE_main - def test_BasicEditorWorkflows_LevelEntityComponentCRUD(self, request, editor, level, launcher_platform): - - # Skip test if running against Debug build - if "debug" in internal_plugin.build_directory: - pytest.skip("Does not execute against debug builds.") - - expected_lines = [ - "Create and load new level: True", - "New entity creation: True", - "Create entity hierarchy: True", - "Add component: True", - "Component update: True", - "Remove component: True", - "Save and Export: True", - "BasicEditorWorkflows_LevelEntityComponent: result=SUCCESS", - ] - - hydra.launch_and_validate_results( - request, - test_directory, - editor, - "BasicEditorWorkflows_LevelEntityComponentCRUD.py", - expected_lines, - cfg_args=[level], - timeout=log_monitor_timeout, - auto_test_mode=False - ) - - @pytest.mark.test_case_id("C6351273", "C6384955", "C16929880", "C15167490", "C15167491") - @pytest.mark.SUITE_main - @pytest.mark.REQUIRES_gpu - def test_BasicEditorWorkflows_GPU_LevelEntityComponentCRUD(self, request, editor, level, launcher_platform): - - # Skip test if running against Debug build - if "debug" in internal_plugin.build_directory: - pytest.skip("Does not execute against debug builds.") - - expected_lines = [ - "Create and load new level: True", - "New entity creation: True", - "Create entity hierarchy: True", - "Add component: True", - "Component update: True", - "Remove component: True", - "Save and Export: True", - "BasicEditorWorkflows_LevelEntityComponent: result=SUCCESS", - ] - - hydra.launch_and_validate_results( - request, - test_directory, - editor, - "BasicEditorWorkflows_LevelEntityComponentCRUD.py", - expected_lines, - cfg_args=[level], - timeout=log_monitor_timeout, - auto_test_mode=False, - null_renderer=False - ) diff --git a/AutomatedTesting/Gem/PythonTests/editor/test_ComponentCRUD.py b/AutomatedTesting/Gem/PythonTests/editor/test_ComponentCRUD.py deleted file mode 100755 index de09cf9ab7..0000000000 --- a/AutomatedTesting/Gem/PythonTests/editor/test_ComponentCRUD.py +++ /dev/null @@ -1,62 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -""" -C16929880: Add Delete Components -""" - -import os -import pytest - -# Bail on the test if ly_test_tools doesn't exist. -pytest.importorskip('ly_test_tools') -import ly_test_tools.environment.file_system as file_system -import editor_python_test_tools.hydra_test_utils as hydra - -test_directory = os.path.join(os.path.dirname(__file__), "EditorScripts") -log_monitor_timeout = 180 - - -@pytest.mark.parametrize('project', ['AutomatedTesting']) -@pytest.mark.parametrize('level', ['tmp_level']) -@pytest.mark.usefixtures("automatic_process_killer") -@pytest.mark.parametrize("launcher_platform", ['windows_editor']) -class TestComponentCRUD(object): - - @pytest.fixture(autouse=True) - def setup_teardown(self, request, workspace, project, level): - def teardown(): - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - - request.addfinalizer(teardown) - - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - - @pytest.mark.test_case_id("C16929880", "C16877220") - @pytest.mark.SUITE_periodic - @pytest.mark.BAT - def test_ComponentCRUD_Add_Delete_Components(self, request, editor, level, launcher_platform): - expected_lines = [ - "Entity Created", - "Box Shape found", - "Box Shape Component added: True", - "Mesh found", - "Mesh Component added: True", - "Mesh Component deleted: True", - "Mesh Component deletion undone: True", - ] - - hydra.launch_and_validate_results( - request, - test_directory, - editor, - "ComponentCRUD_Add_Delete_Components.py", - expected_lines, - cfg_args=[level], - auto_test_mode=False, - timeout=log_monitor_timeout - ) diff --git a/AutomatedTesting/Gem/PythonTests/editor/test_Docking.py b/AutomatedTesting/Gem/PythonTests/editor/test_Docking.py deleted file mode 100644 index 7d97f31710..0000000000 --- a/AutomatedTesting/Gem/PythonTests/editor/test_Docking.py +++ /dev/null @@ -1,55 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT - -C6376081: Basic Function: Docked/Undocked Tools -""" - -import os -import pytest - -# Bail on the test if ly_test_tools doesn't exist. -pytest.importorskip('ly_test_tools') -import ly_test_tools.environment.file_system as file_system -import editor_python_test_tools.hydra_test_utils as hydra - -test_directory = os.path.join(os.path.dirname(__file__), "EditorScripts") -log_monitor_timeout = 180 - - -@pytest.mark.parametrize('project', ['AutomatedTesting']) -@pytest.mark.parametrize('level', ['tmp_level']) -@pytest.mark.usefixtures("automatic_process_killer") -@pytest.mark.parametrize("launcher_platform", ['windows_editor']) -class TestDocking(object): - - @pytest.fixture(autouse=True) - def setup_teardown(self, request, workspace, project, level): - def teardown(): - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - - request.addfinalizer(teardown) - - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - - @pytest.mark.test_case_id("C6376081") - @pytest.mark.SUITE_sandbox - def test_Docking_BasicDockedTools(self, request, editor, level, launcher_platform): - expected_lines = [ - "The tools are all docked together in a tabbed widget", - "Entity Outliner works when docked, can select an Entity", - "Entity Inspector works when docked, Entity name changed to DifferentName", - "Hello, world!" # This line verifies the Console is working while docked - ] - - hydra.launch_and_validate_results( - request, - test_directory, - editor, - "Docking_BasicDockedTools.py", - expected_lines, - cfg_args=[level], - timeout=log_monitor_timeout, - ) diff --git a/AutomatedTesting/Gem/PythonTests/editor/test_InputBindings.py b/AutomatedTesting/Gem/PythonTests/editor/test_InputBindings.py deleted file mode 100755 index 214fac2af4..0000000000 --- a/AutomatedTesting/Gem/PythonTests/editor/test_InputBindings.py +++ /dev/null @@ -1,66 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -""" -C1506881: Adding/Removing Event Groups -""" - -import os -import pytest - -# Bail on the test if ly_test_tools doesn't exist. -pytest.importorskip('ly_test_tools') -import ly_test_tools.environment.file_system as file_system -import editor_python_test_tools.hydra_test_utils as hydra - -test_directory = os.path.join(os.path.dirname(__file__), "EditorScripts") -log_monitor_timeout = 180 - - -@pytest.mark.parametrize('project', ['AutomatedTesting']) -@pytest.mark.parametrize('level', ['tmp_level']) -@pytest.mark.usefixtures("automatic_process_killer") -@pytest.mark.parametrize("launcher_platform", ['windows_editor']) -class TestInputBindings(object): - - @pytest.fixture(autouse=True) - def setup_teardown(self, request, workspace, project, level): - def teardown(): - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - - request.addfinalizer(teardown) - - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - - @pytest.mark.test_case_id("C1506881") - @pytest.mark.SUITE_periodic - def test_InputBindings_Add_Remove_Input_Events(self, request, editor, level, launcher_platform): - expected_lines = [ - "Asset Editor opened: True", - "New Event Groups added when + is clicked", - "Event Group deleted when the Delete button is clicked on an Event Group", - "All event groups deleted on clicking the Delete button", - "Asset Editor closed: True", - ] - - unexpected_lines = [ - "Asset Editor opened: False", - "Asset Editor closed: False", - ] - - hydra.launch_and_validate_results( - request, - test_directory, - editor, - "InputBindings_Add_Remove_Input_Events.py", - expected_lines, - unexpected_lines=unexpected_lines, - cfg_args=[level], - run_python="--runpython", - auto_test_mode=False, - timeout=log_monitor_timeout, - ) diff --git a/AutomatedTesting/Gem/PythonTests/editor/test_Menus.py b/AutomatedTesting/Gem/PythonTests/editor/test_Menus.py deleted file mode 100644 index d35fd021ee..0000000000 --- a/AutomatedTesting/Gem/PythonTests/editor/test_Menus.py +++ /dev/null @@ -1,132 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -import os -import pytest - -# Bail on the test if ly_test_tools doesn't exist. -pytest.importorskip('ly_test_tools') -import ly_test_tools.environment.file_system as file_system -import ly_test_tools.environment.process_utils as process_utils -import editor_python_test_tools.hydra_test_utils as hydra - -test_directory = os.path.join(os.path.dirname(__file__), "EditorScripts") -log_monitor_timeout = 180 - - -@pytest.mark.parametrize('project', ['AutomatedTesting']) -@pytest.mark.parametrize('level', ['tmp_level']) -@pytest.mark.usefixtures("automatic_process_killer") -@pytest.mark.parametrize("launcher_platform", ['windows_editor']) -class TestMenus(object): - - @pytest.fixture(autouse=True) - def setup_teardown(self, request, workspace, project, level): - def teardown(): - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - process_utils.kill_processes_named("o3de", ignore_extensions=True) # Kill ProjectManager windows - - request.addfinalizer(teardown) - - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - - @pytest.mark.test_case_id("C16780783", "C2174438") - @pytest.mark.SUITE_sandbox - def test_Menus_EditMenuOptions_Work(self, request, editor, level, launcher_platform): - expected_lines = [ - "Undo Action triggered", - "Redo Action triggered", - "Duplicate Action triggered", - "Delete Action triggered", - "Select All Action triggered", - "Invert Selection Action triggered", - "Toggle Pivot Location Action triggered", - "Reset Entity Transform", - "Reset Manipulator", - "Reset Transform (Local) Action triggered", - "Reset Transform (World) Action triggered", - "Hide Selection Action triggered", - "Show All Action triggered", - "Snap angle Action triggered", - "Move Action triggered", - "Rotate Action triggered", - "Scale Action triggered", - "Global Preferences Action triggered", - "Editor Settings Manager Action triggered", - "Customize Keyboard Action triggered", - "Export Keyboard Settings Action triggered", - "Import Keyboard Settings Action triggered", - "Menus_EditMenuOptions: result=SUCCESS" - ] - - hydra.launch_and_validate_results( - request, - test_directory, - editor, - "Menus_EditMenuOptions.py", - expected_lines, - cfg_args=[level], - run_python="--runpython", - timeout=log_monitor_timeout - ) - - @pytest.mark.test_case_id("C16780807") - @pytest.mark.SUITE_periodic - def test_Menus_ViewMenuOptions_Work(self, request, editor, level, launcher_platform): - expected_lines = [ - "Center on Selection Action triggered", - "Show Quick Access Bar Action triggered", - "Configure Layout Action triggered", - "Go to Position Action triggered", - "Center on Selection Action triggered", - "Go to Location Action triggered", - "Remember Location Action triggered", - "Switch Camera Action triggered", - "Show/Hide Helpers Action triggered", - "Refresh Style Action triggered", - ] - hydra.launch_and_validate_results( - request, - test_directory, - editor, - "Menus_ViewMenuOptions.py", - expected_lines, - cfg_args=[level], - run_python="--runpython", - timeout=log_monitor_timeout - ) - - @pytest.mark.test_case_id("C16780778") - @pytest.mark.SUITE_sandbox - @pytest.mark.xfail # LYN-4208 - def test_Menus_FileMenuOptions_Work(self, request, editor, level, launcher_platform): - expected_lines = [ - "New Level Action triggered", - "Open Level Action triggered", - "Import Action triggered", - "Save Action triggered", - "Save As Action triggered", - "Save Level Statistics Action triggered", - "Edit Project Settings Action triggered", - "Edit Platform Settings Action triggered", - "New Project Action triggered", - "Open Project Action triggered", - "Show Log File Action triggered", - "Resave All Slices Action triggered", - "Exit Action triggered", - ] - - hydra.launch_and_validate_results( - request, - test_directory, - editor, - "Menus_FileMenuOptions.py", - expected_lines, - cfg_args=[level], - run_python="--runpython", - timeout=log_monitor_timeout - ) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/largeworlds/CMakeLists.txt index 351ca19031..b3030e84ac 100644 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/CMakeLists.txt @@ -16,7 +16,6 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_ TEST_SUITE main PATH ${CMAKE_CURRENT_LIST_DIR}/dyn_veg PYTEST_MARKS "not SUITE_sandbox and not SUITE_periodic and not SUITE_benchmark" - TIMEOUT 1500 RUNTIME_DEPENDENCIES AZ::AssetProcessor Legacy::Editor @@ -33,7 +32,6 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_ TEST_SUITE sandbox PATH ${CMAKE_CURRENT_LIST_DIR}/dyn_veg PYTEST_MARKS "SUITE_sandbox" - TIMEOUT 1500 RUNTIME_DEPENDENCIES AZ::AssetProcessor Legacy::Editor @@ -49,7 +47,6 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_ TEST_SUITE periodic PATH ${CMAKE_CURRENT_LIST_DIR}/dyn_veg PYTEST_MARKS "SUITE_periodic and dynveg_filter" - TIMEOUT 1500 RUNTIME_DEPENDENCIES AZ::AssetProcessor Legacy::Editor @@ -64,7 +61,6 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_ TEST_SUITE periodic PATH ${CMAKE_CURRENT_LIST_DIR}/dyn_veg PYTEST_MARKS "SUITE_periodic and dynveg_modifier" - TIMEOUT 1500 RUNTIME_DEPENDENCIES AZ::AssetProcessor Legacy::Editor @@ -79,7 +75,6 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_ TEST_SUITE periodic PATH ${CMAKE_CURRENT_LIST_DIR}/dyn_veg PYTEST_MARKS "SUITE_periodic and dynveg_regression" - TIMEOUT 1500 RUNTIME_DEPENDENCIES AZ::AssetProcessor Legacy::Editor @@ -94,7 +89,6 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_ TEST_SUITE periodic PATH ${CMAKE_CURRENT_LIST_DIR}/dyn_veg PYTEST_MARKS "SUITE_periodic and dynveg_area" - TIMEOUT 1500 RUNTIME_DEPENDENCIES AZ::AssetProcessor Legacy::Editor @@ -109,7 +103,6 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_ TEST_SUITE periodic PATH ${CMAKE_CURRENT_LIST_DIR}/dyn_veg PYTEST_MARKS "SUITE_periodic and dynveg_misc" - TIMEOUT 1500 RUNTIME_DEPENDENCIES AZ::AssetProcessor Legacy::Editor @@ -124,7 +117,6 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_ TEST_SUITE periodic PATH ${CMAKE_CURRENT_LIST_DIR}/dyn_veg PYTEST_MARKS "SUITE_periodic and dynveg_surfacetagemitter" - TIMEOUT 1500 RUNTIME_DEPENDENCIES AZ::AssetProcessor Legacy::Editor @@ -132,15 +124,14 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_ COMPONENT LargeWorlds ) + ## LandscapeCanvas ## ly_add_pytest( NAME AutomatedTesting::LandscapeCanvasTests_Main TEST_SERIAL TEST_SUITE main - PATH ${CMAKE_CURRENT_LIST_DIR}/landscape_canvas - PYTEST_MARKS "not SUITE_sandbox and not SUITE_periodic and not SUITE_benchmark" - TIMEOUT 1500 + PATH ${CMAKE_CURRENT_LIST_DIR}/landscape_canvas/TestSuite_Main.py RUNTIME_DEPENDENCIES AZ::AssetProcessor Legacy::Editor @@ -153,9 +144,20 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_ NAME AutomatedTesting::LandscapeCanvasTests_Periodic TEST_SERIAL TEST_SUITE periodic - PATH ${CMAKE_CURRENT_LIST_DIR}/landscape_canvas - PYTEST_MARKS "SUITE_periodic" - TIMEOUT 1500 + PATH ${CMAKE_CURRENT_LIST_DIR}/landscape_canvas/TestSuite_Periodic.py + RUNTIME_DEPENDENCIES + AZ::AssetProcessor + Legacy::Editor + AutomatedTesting.Assets + COMPONENT + LargeWorlds + ) + + ly_add_pytest( + NAME AutomatedTesting::LandscapeCanvasTests_Main_Optimized + TEST_SERIAL + TEST_SUITE main + PATH ${CMAKE_CURRENT_LIST_DIR}/landscape_canvas/TestSuite_Main_Optimized.py RUNTIME_DEPENDENCIES AZ::AssetProcessor Legacy::Editor @@ -165,12 +167,25 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_ ) ## GradientSignal ## + ly_add_pytest( NAME AutomatedTesting::GradientSignalTests_Periodic TEST_SERIAL TEST_SUITE periodic - PATH ${CMAKE_CURRENT_LIST_DIR}/gradient_signal - TIMEOUT 1500 + PATH ${CMAKE_CURRENT_LIST_DIR}/gradient_signal/TestSuite_Periodic.py + RUNTIME_DEPENDENCIES + AZ::AssetProcessor + Legacy::Editor + AutomatedTesting.Assets + COMPONENT + LargeWorlds + ) + + ly_add_pytest( + NAME AutomatedTesting::GradientSignalTests_Periodic_Optimized + TEST_SERIAL + TEST_SUITE periodic + PATH ${CMAKE_CURRENT_LIST_DIR}/gradient_signal/TestSuite_Periodic_Optimized.py RUNTIME_DEPENDENCIES AZ::AssetProcessor Legacy::Editor diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/PhysXColliderSurfaceTagEmitter_E2E_Editor.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/PhysXColliderSurfaceTagEmitter_E2E_Editor.py index beb5c2af72..2052c59a94 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/PhysXColliderSurfaceTagEmitter_E2E_Editor.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/PhysXColliderSurfaceTagEmitter_E2E_Editor.py @@ -10,6 +10,7 @@ import sys sys.path.append(os.path.dirname(os.path.abspath(__file__))) import azlmbr.asset as asset +import azlmbr.editor as editor import azlmbr.legacy.general as general import azlmbr.bus as bus import azlmbr.math as math @@ -107,7 +108,7 @@ class TestPhysXColliderSurfaceTagEmitter(EditorTestHelper): # Create an entity with a PhysX Collider and our PhysX Collider Surface Tag Emitter collider_entity = hydra.Entity("Collider Surface") collider_entity.create_entity( - entity_center_point, + entity_center_point, ["PhysX Collider", "PhysX Collider Surface Tag Emitter"] ) if collider_entity.id.IsValid(): @@ -153,23 +154,29 @@ class TestPhysXColliderSurfaceTagEmitter(EditorTestHelper): self.test_success = self.test_success and baseline_success # Setup collider entity with a PhysX Mesh - test_physx_mesh_asset_path = asset.AssetCatalogRequestBus( + test_physx_mesh_asset_id = asset.AssetCatalogRequestBus( bus.Broadcast, "GetAssetIdByPath", os.path.join("levels", "physics", "c4044697_material_perfacematerialvalidation", "test.pxmesh"), math.Uuid(), False) - hydra.get_set_test(collider_entity, 0, "Shape Configuration|Shape", 7) - hydra.get_set_test(collider_entity, 0, "Shape Configuration|Asset|PhysX Mesh", test_physx_mesh_asset_path) + + # Remove/re-add component due to LYN-5496 + collider_entity.remove_component("PhysX Collider") + collider_entity.add_component("PhysX Collider") + self.wait_for_condition(lambda: editor.EditorComponentAPIBus(bus.Broadcast, 'IsComponentEnabled', + collider_entity.components[1]), 5.0) + hydra.get_set_test(collider_entity, 1, "Shape Configuration|Shape", 7) + hydra.get_set_test(collider_entity, 1, "Shape Configuration|Asset|PhysX Mesh", test_physx_mesh_asset_id) # Set the asset scale to match the test heights of the shapes tested asset_scale = math.Vector3(1.0, 1.0, 9.0) - collider_entity.get_set_test(0, "Shape Configuration|Asset|Configuration|Asset Scale", asset_scale) + collider_entity.get_set_test(1, "Shape Configuration|Asset|Configuration|Asset Scale", asset_scale) # Test: Generate a new surface on the collider. # There should be one instance at the very top of the collider mesh, and none on the baseline surface # (We use a small query box to only check for one placed instance point) self.log("Starting PhysX Mesh Collider Test") - hydra.get_set_test(collider_entity, 1, "Configuration|Generated Tags", [surface_tag]) - hydra.get_set_test(collider_entity, 1, "Configuration|Extended Tags", [invalid_tag]) + hydra.get_set_test(collider_entity, 0, "Configuration|Generated Tags", [surface_tag]) + hydra.get_set_test(collider_entity, 0, "Configuration|Extended Tags", [invalid_tag]) top_point_success = self.wait_for_condition(lambda: dynveg.validate_instance_count(top_point, 0.25, 1), 5.0) self.test_success = self.test_success and top_point_success baseline_success = self.wait_for_condition(lambda: dynveg.validate_instance_count(baseline_surface_point, @@ -180,8 +187,8 @@ class TestPhysXColliderSurfaceTagEmitter(EditorTestHelper): # There should be no instances at the very top of the collider mesh, and none on the baseline surface within # our query box as PhysX meshes are treated as hollow shells, not solid volumes. # (We use a small query box to only check for one placed instance point) - hydra.get_set_test(collider_entity, 1, "Configuration|Generated Tags", [invalid_tag]) - hydra.get_set_test(collider_entity, 1, "Configuration|Extended Tags", [surface_tag]) + hydra.get_set_test(collider_entity, 0, "Configuration|Generated Tags", [invalid_tag]) + hydra.get_set_test(collider_entity, 0, "Configuration|Extended Tags", [surface_tag]) top_point_success = self.wait_for_condition(lambda: dynveg.validate_instance_count(top_point, 0.25, 0), 5.0) self.test_success = self.test_success and top_point_success baseline_success = self.wait_for_condition(lambda: dynveg.validate_instance_count(baseline_surface_point, diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientGenerators_Incompatibilities.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientGenerators_Incompatibilities.py index 37679d34ef..09cd760647 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientGenerators_Incompatibilities.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientGenerators_Incompatibilities.py @@ -4,124 +4,118 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ -import os -import sys - -import azlmbr.bus as bus -import azlmbr.editor as editor -import azlmbr.entity as entity -import azlmbr.paths - -sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests')) -import editor_python_test_tools.hydra_editor_utils as hydra -from editor_python_test_tools.editor_test_helper import EditorTestHelper -class TestGradientGeneratorIncompatibilities(EditorTestHelper): - def __init__(self): - EditorTestHelper.__init__(self, log_prefix="GradientGeneratorIncompatibilities", args=["level"]) +def GradientGenerators_Incompatibilities(): + """ + Summary: + This test verifies that components are disabled when conflicting components are present on the same entity. - def run_test(self): - """ - Summary: - This test verifies that components are disabled when conflicting components are present on the same entity. + Expected Behavior: + Gradient Generator components are incompatible with Vegetation area components. - Expected Behavior: - Gradient Generator components are incompatible with Vegetation area components. + Test Steps: + 1) Open a simple level + 2) Create a new entity in the level + 3) Add each Gradient Generator component to an entity, and add a Vegetation Area component to the same entity + 4) Verify that components are only enabled when entity is free of a conflicting component - Test Steps: - 1) Create a new level - 2) Create a new entity in the level - 3) Add each Gradient Generator component to an entity, and add a Vegetation Area component to the same entity - 4) Verify that components are only enabled when entity is free of a conflicting component + Note: + - This test file must be called from the Open 3D Engine Editor command terminal + - Any passed and failed tests are written to the Editor.log file. + Parsing the file or running a log_monitor are required to observe the test results. - Note: - - This test file must be called from the Open 3D Engine Editor command terminal - - Any passed and failed tests are written to the Editor.log file. - Parsing the file or running a log_monitor are required to observe the test results. + :return: None + """ - :return: None - """ + import azlmbr.bus as bus + import azlmbr.editor as editor + import azlmbr.entity as entity - gradient_generators = [ - 'Altitude Gradient', - 'Constant Gradient', - 'FastNoise Gradient', - 'Image Gradient', - 'Perlin Noise Gradient', - 'Random Noise Gradient', - 'Shape Falloff Gradient', - 'Slope Gradient', - 'Surface Mask Gradient' - ] - require_transform_modifiers = [ - 'FastNoise Gradient', - 'Image Gradient', - 'Perlin Noise Gradient', - 'Random Noise Gradient' - ] - vegetation_areas = [ - 'Vegetation Layer Spawner', - 'Vegetation Layer Blender', - 'Vegetation Layer Blocker', - 'Vegetation Layer Blocker (Mesh)' - ] - area_dependencies = { - 'Vegetation Layer Spawner': 'Vegetation Asset List', - 'Vegetation Layer Blocker (Mesh)': 'Mesh' - } + import editor_python_test_tools.hydra_editor_utils as hydra + from editor_python_test_tools.utils import Report + from editor_python_test_tools.utils import TestHelper as helper - # Create a new empty level - self.test_success = self.create_level( - self.args["level"], - heightmap_resolution=1024, - heightmap_meters_per_pixel=1, - terrain_texture_resolution=4096, - use_terrain=False, - ) + gradient_generators = [ + 'Altitude Gradient', + 'Constant Gradient', + 'FastNoise Gradient', + 'Image Gradient', + 'Perlin Noise Gradient', + 'Random Noise Gradient', + 'Shape Falloff Gradient', + 'Slope Gradient', + 'Surface Mask Gradient' + ] + require_transform_modifiers = [ + 'FastNoise Gradient', + 'Image Gradient', + 'Perlin Noise Gradient', + 'Random Noise Gradient' + ] + vegetation_areas = [ + 'Vegetation Layer Spawner', + 'Vegetation Layer Blender', + 'Vegetation Layer Blocker', + 'Vegetation Layer Blocker (Mesh)' + ] + area_dependencies = { + 'Vegetation Layer Spawner': 'Vegetation Asset List', + 'Vegetation Layer Blocker (Mesh)': 'Mesh' + } - # For every gradient generator component, verify that they are incompatible - # which each vegetation area component - for component_name in gradient_generators: - for vegetation_area_name in vegetation_areas: - # Create a new Entity in the level - entity_id = editor.ToolsApplicationRequestBus(bus.Broadcast, 'CreateNewEntity', entity.EntityId()) + # Open an existing simple level + helper.init_idle() + helper.open_level("Physics", "Base") - # Most of these need a shape, so use a Box Shape - hydra.add_component('Box Shape', entity_id) + # For every gradient generator component, verify that they are incompatible + # which each vegetation area component + for component_name in gradient_generators: + for vegetation_area_name in vegetation_areas: + # Create a new Entity in the level + entity_id = editor.ToolsApplicationRequestBus(bus.Broadcast, 'CreateNewEntity', entity.EntityId()) - # Add the specific vegetation area dependencies (if necessary) - if vegetation_area_name in area_dependencies: - hydra.add_component(area_dependencies[vegetation_area_name], entity_id) + # Most of these need a shape, so use a Box Shape + hydra.add_component('Box Shape', entity_id) - # Add the vegetation area component we are validating against, then add the - # gradient generator afterwards, so that the gradient generator will actually - # be disabled (if it was present before, it would only get deactivated instead of disabled - # by the vegetation area) - area_component = hydra.add_component(vegetation_area_name, entity_id) - gradient_component = hydra.add_component(component_name, entity_id) + # Add the specific vegetation area dependencies (if necessary) + if vegetation_area_name in area_dependencies: + hydra.add_component(area_dependencies[vegetation_area_name], entity_id) - # Verify the gradient generator component is disabled since the vegetation area is incompatible - active = editor.EditorComponentAPIBus(bus.Broadcast, 'IsComponentEnabled', gradient_component) - self.test_success = self.test_success and not active - if not active: - self.log(f"{component_name} is disabled before removing {vegetation_area_name} component") + # Add the vegetation area component we are validating against, then add the + # gradient generator afterwards, so that the gradient generator will actually + # be disabled (if it was present before, it would only get deactivated instead of disabled + # by the vegetation area) + area_component = hydra.add_component(vegetation_area_name, entity_id) + gradient_component = hydra.add_component(component_name, entity_id) - # Remove the vegetation area component - editor.EditorComponentAPIBus(bus.Broadcast, 'RemoveComponents', [area_component]) + # Verify the gradient generator component is disabled since the vegetation area is incompatible + active = editor.EditorComponentAPIBus(bus.Broadcast, 'IsComponentEnabled', gradient_component) + component_is_disabled = ( + f"{component_name} is disabled before removing {vegetation_area_name} component", + f"{component_name} is unexpectedly enabled before removing {vegetation_area_name} component" + ) + Report.result(component_is_disabled, not active) - # Add required dependencies for our gradient generators after the vegetation - # area has been removed, because the transform modifier is also incompatible - # with the vegetation areas - if component_name in require_transform_modifiers: - hydra.add_component('Gradient Transform Modifier', entity_id) + # Remove the vegetation area component + editor.EditorComponentAPIBus(bus.Broadcast, 'RemoveComponents', [area_component]) - # Verify the gradient generator component is enabled now that the vegetation area is gone - active = editor.EditorComponentAPIBus(bus.Broadcast, 'IsComponentEnabled', gradient_component) - self.test_success = self.test_success and active - if active: - self.log(f"{component_name} is enabled after removing {vegetation_area_name} component") + # Add required dependencies for our gradient generators after the vegetation + # area has been removed, because the transform modifier is also incompatible + # with the vegetation areas + if component_name in require_transform_modifiers: + hydra.add_component('Gradient Transform Modifier', entity_id) + + # Verify the gradient generator component is enabled now that the vegetation area is gone + active = editor.EditorComponentAPIBus(bus.Broadcast, 'IsComponentEnabled', gradient_component) + component_is_enabled = ( + f"{component_name} is enabled after removing {vegetation_area_name} component", + f"{component_name} is unexpectedly disabled after removing {vegetation_area_name} component" + ) + Report.result(component_is_enabled, active) -test = TestGradientGeneratorIncompatibilities() -test.run() +if __name__ == "__main__": + + from editor_python_test_tools.utils import Report + Report.start_test(GradientGenerators_Incompatibilities) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientModifiers_Incompatibilities.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientModifiers_Incompatibilities.py index 8908493187..a4d9181744 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientModifiers_Incompatibilities.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientModifiers_Incompatibilities.py @@ -4,164 +4,162 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ -import os -import sys - -import azlmbr.bus as bus -import azlmbr.editor as editor -import azlmbr.entity as entity -import azlmbr.paths - -sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests')) -import editor_python_test_tools.hydra_editor_utils as hydra -from editor_python_test_tools.editor_test_helper import EditorTestHelper -class TestGradientModifiersIncompatibilities(EditorTestHelper): - def __init__(self): - EditorTestHelper.__init__(self, log_prefix="GradientModifiersIncompatibilities", args=["level"]) +def GradientModifiers_Incompatibilities(): + """ + Summary: + This test verifies that components are disabled when conflicting components are present on the same entity. - def run_test(self): - """ - Summary: - This test verifies that components are disabled when conflicting components are present on the same entity. + Expected Behavior: + Gradient Modifier components are incompatible with Vegetation area components. - Expected Behavior: - Gradient Modifier components are incompatible with Vegetation area components. + Test Steps: + 1) Open a simple level + 2) Create a new entity in the level + 3) Add each Gradient Modifier component to an entity, and add a Vegetation Area component to the same entity + 4) Verify that components are only enabled when entity is free of a conflicting component - Test Steps: - 1) Create a new level - 2) Create a new entity in the level - 3) Add each Gradient Modifier component to an entity, and add a Vegetation Area component to the same entity - 4) Verify that components are only enabled when entity is free of a conflicting component + Note: + - This test file must be called from the Open 3D Engine Editor command terminal + - Any passed and failed tests are written to the Editor.log file. + Parsing the file or running a log_monitor are required to observe the test results. - Note: - - This test file must be called from the Open 3D Engine Editor command terminal - - Any passed and failed tests are written to the Editor.log file. - Parsing the file or running a log_monitor are required to observe the test results. + :return: None + """ - :return: None - """ + import azlmbr.bus as bus + import azlmbr.editor as editor + import azlmbr.entity as entity - gradient_generators = [ - 'Altitude Gradient', - 'Constant Gradient', - 'FastNoise Gradient', - 'Image Gradient', - 'Perlin Noise Gradient', - 'Random Noise Gradient', - 'Shape Falloff Gradient', - 'Slope Gradient', - 'Surface Mask Gradient' - ] - require_transform_modifiers = [ - 'FastNoise Gradient', - 'Image Gradient', - 'Perlin Noise Gradient', - 'Random Noise Gradient' - ] - gradient_modifiers = [ - 'Dither Gradient Modifier', - 'Gradient Mixer', - 'Invert Gradient Modifier', - 'Levels Gradient Modifier', - 'Posterize Gradient Modifier', - 'Smooth-Step Gradient Modifier', - 'Threshold Gradient Modifier' - ] - vegetation_areas = [ - 'Vegetation Layer Spawner', - 'Vegetation Layer Blender', - 'Vegetation Layer Blocker', - 'Vegetation Layer Blocker (Mesh)' - ] - area_dependencies = { - 'Vegetation Layer Spawner': 'Vegetation Asset List', - 'Vegetation Layer Blocker (Mesh)': 'Mesh' - } + import editor_python_test_tools.hydra_editor_utils as hydra + from editor_python_test_tools.utils import Report + from editor_python_test_tools.utils import TestHelper as helper - # Create a new empty level - self.test_success = self.create_level( - self.args["level"], - heightmap_resolution=1024, - heightmap_meters_per_pixel=1, - terrain_texture_resolution=4096, - use_terrain=False, - ) + gradient_generators = [ + 'Altitude Gradient', + 'Constant Gradient', + 'FastNoise Gradient', + 'Image Gradient', + 'Perlin Noise Gradient', + 'Random Noise Gradient', + 'Shape Falloff Gradient', + 'Slope Gradient', + 'Surface Mask Gradient' + ] + require_transform_modifiers = [ + 'FastNoise Gradient', + 'Image Gradient', + 'Perlin Noise Gradient', + 'Random Noise Gradient' + ] + gradient_modifiers = [ + 'Dither Gradient Modifier', + 'Gradient Mixer', + 'Invert Gradient Modifier', + 'Levels Gradient Modifier', + 'Posterize Gradient Modifier', + 'Smooth-Step Gradient Modifier', + 'Threshold Gradient Modifier' + ] + vegetation_areas = [ + 'Vegetation Layer Spawner', + 'Vegetation Layer Blender', + 'Vegetation Layer Blocker', + 'Vegetation Layer Blocker (Mesh)' + ] + area_dependencies = { + 'Vegetation Layer Spawner': 'Vegetation Asset List', + 'Vegetation Layer Blocker (Mesh)': 'Mesh' + } - # For every gradient modifier component, verify that they are incompatible - # which each vegetation area and gradient generator/modifier component - all_gradients = gradient_modifiers + gradient_generators - for component_name in gradient_modifiers: - for vegetation_area_name in vegetation_areas: - # Create a new Entity in the level - entity_id = editor.ToolsApplicationRequestBus(bus.Broadcast, 'CreateNewEntity', entity.EntityId()) + # Open an existing simple level + helper.init_idle() + helper.open_level("Physics", "Base") - # Most of these need a shape, so use a Box Shape - hydra.add_component('Box Shape', entity_id) + # For every gradient modifier component, verify that they are incompatible + # which each vegetation area and gradient generator/modifier component + all_gradients = gradient_modifiers + gradient_generators + for component_name in gradient_modifiers: + for vegetation_area_name in vegetation_areas: + # Create a new Entity in the level + entity_id = editor.ToolsApplicationRequestBus(bus.Broadcast, 'CreateNewEntity', entity.EntityId()) - # Add the specific vegetation area dependencies (if necessary) - if vegetation_area_name in area_dependencies: - hydra.add_component(area_dependencies[vegetation_area_name], entity_id) + # Most of these need a shape, so use a Box Shape + hydra.add_component('Box Shape', entity_id) - # Add the vegetation area component we are validating against, then add the - # gradient modifier afterwards, so that the gradient modifier will actually - # be disabled (if it was present before, it would only get deactivated instead of disabled - # by the vegetation area) - area_component = hydra.add_component(vegetation_area_name, entity_id) - gradient_component = hydra.add_component(component_name, entity_id) + # Add the specific vegetation area dependencies (if necessary) + if vegetation_area_name in area_dependencies: + hydra.add_component(area_dependencies[vegetation_area_name], entity_id) - # Verify the gradient modifier component is disabled since the vegetation area is incompatible - active = editor.EditorComponentAPIBus(bus.Broadcast, 'IsComponentEnabled', gradient_component) - self.test_success = self.test_success and not active - if not active: - self.log("{gradient} is disabled before removing {vegetation_area} component".format(gradient=component_name, vegetation_area=vegetation_area_name)) + # Add the vegetation area component we are validating against, then add the + # gradient modifier afterwards, so that the gradient modifier will actually + # be disabled (if it was present before, it would only get deactivated instead of disabled + # by the vegetation area) + area_component = hydra.add_component(vegetation_area_name, entity_id) + gradient_component = hydra.add_component(component_name, entity_id) - # Remove the vegetation area component - editor.EditorComponentAPIBus(bus.Broadcast, 'RemoveComponents', [area_component]) + # Verify the gradient modifier component is disabled since the vegetation area is incompatible + active = editor.EditorComponentAPIBus(bus.Broadcast, 'IsComponentEnabled', gradient_component) + component_is_disabled = ( + f"{component_name} is disabled before removing {vegetation_area_name} component", + f"{component_name} is unexpectedly enabled before removing {vegetation_area_name} component" + ) + Report.result(component_is_disabled, not active) - # Verify the gradient modifier component is enabled now that the vegetation area is gone - active = editor.EditorComponentAPIBus(bus.Broadcast, 'IsComponentEnabled', gradient_component) - self.test_success = self.test_success and active - if active: - self.log("{gradient} is enabled after removing {vegetation_area} component".format(gradient=component_name, vegetation_area=vegetation_area_name)) + # Remove the vegetation area component + editor.EditorComponentAPIBus(bus.Broadcast, 'RemoveComponents', [area_component]) - for gradient_name in all_gradients: - # Create a new Entity in the level - entity_id = editor.ToolsApplicationRequestBus(bus.Broadcast, 'CreateNewEntity', entity.EntityId()) + # Verify the gradient modifier component is enabled now that the vegetation area is gone + active = editor.EditorComponentAPIBus(bus.Broadcast, 'IsComponentEnabled', gradient_component) + component_is_enabled = ( + f"{component_name} is enabled after removing {vegetation_area_name} component", + f"{component_name} is unexpectedly disabled after removing {vegetation_area_name} component" + ) + Report.result(component_is_enabled, active) - # Most of these need a shape, so use a Box Shape - hydra.add_component('Box Shape', entity_id) + for gradient_name in all_gradients: + # Create a new Entity in the level + entity_id = editor.ToolsApplicationRequestBus(bus.Broadcast, 'CreateNewEntity', entity.EntityId()) - # Add the specific gradient generator dependencies (if necessary) - conflicting_components = [] - if gradient_name in require_transform_modifiers: - component = hydra.add_component('Gradient Transform Modifier', entity_id) - conflicting_components.append(component) + # Most of these need a shape, so use a Box Shape + hydra.add_component('Box Shape', entity_id) - # Add the gradient component we are validating against, then add the - # gradient modifier afterwards, so that the gradient modifier will actually - # be disabled (if it was present before, it would only get deactivated instead of disabled - # by the other gradient) - component = hydra.add_component(gradient_name, entity_id) + # Add the specific gradient generator dependencies (if necessary) + conflicting_components = [] + if gradient_name in require_transform_modifiers: + component = hydra.add_component('Gradient Transform Modifier', entity_id) conflicting_components.append(component) - gradient_component = hydra.add_component(component_name, entity_id) - # Verify the gradient modifier component is disabled since the other gradient is incompatible - active = editor.EditorComponentAPIBus(bus.Broadcast, 'IsComponentEnabled', gradient_component) - self.test_success = self.test_success and not active - if not active: - self.log("{gradient} is disabled before removing {conflicting_gradient} component".format(gradient=component_name, conflicting_gradient=gradient_name)) + # Add the gradient component we are validating against, then add the + # gradient modifier afterwards, so that the gradient modifier will actually + # be disabled (if it was present before, it would only get deactivated instead of disabled + # by the other gradient) + component = hydra.add_component(gradient_name, entity_id) + conflicting_components.append(component) + gradient_component = hydra.add_component(component_name, entity_id) - # Remove the conflicting gradient component (and transform modifier if it was added) - editor.EditorComponentAPIBus(bus.Broadcast, 'RemoveComponents', conflicting_components) + # Verify the gradient modifier component is disabled since the other gradient is incompatible + active = editor.EditorComponentAPIBus(bus.Broadcast, 'IsComponentEnabled', gradient_component) + component_is_disabled = ( + f"{component_name} is disabled before removing {gradient_name} component", + f"{component_name} is unexpectedly enabled before removing {gradient_name} component" + ) + Report.result(component_is_disabled, not active) - # Verify the gradient modifier component is enabled now that the other gradient is gone - active = editor.EditorComponentAPIBus(bus.Broadcast, 'IsComponentEnabled', gradient_component) - self.test_success = self.test_success and active - if active: - self.log("{gradient} is enabled after removing {conflicting_gradient} component".format(gradient=component_name, conflicting_gradient=gradient_name)) + # Remove the conflicting gradient component (and transform modifier if it was added) + editor.EditorComponentAPIBus(bus.Broadcast, 'RemoveComponents', conflicting_components) + + # Verify the gradient modifier component is enabled now that the other gradient is gone + active = editor.EditorComponentAPIBus(bus.Broadcast, 'IsComponentEnabled', gradient_component) + component_is_enabled = ( + f"{component_name} is enabled after removing {gradient_name} component", + f"{component_name} is unexpectedly disabled after removing {gradient_name} component" + ) + Report.result(component_is_enabled, active) -test = TestGradientModifiersIncompatibilities() -test.run() +if __name__ == "__main__": + + from editor_python_test_tools.utils import Report + Report.start_test(GradientModifiers_Incompatibilities) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientPreviewSettings_ClearingPinnedEntitySetsPreviewToOrigin.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientPreviewSettings_ClearingPinnedEntitySetsPreviewToOrigin.py index 73e8b95823..3749f93bf5 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientPreviewSettings_ClearingPinnedEntitySetsPreviewToOrigin.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientPreviewSettings_ClearingPinnedEntitySetsPreviewToOrigin.py @@ -5,129 +5,125 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ -import os -import sys -sys.path.append(os.path.dirname(os.path.abspath(__file__))) -import azlmbr.bus as bus -import azlmbr.editor as editor -import azlmbr.math as math -import azlmbr.paths -import azlmbr.entity as EntityId +def GradientPreviewSettings_ClearingPinnedEntitySetsPreviewToOrigin(): + """ + Summary: + A temporary level is created. An entity for each test case is created and added with the corresponding + components to verify if the gradient transform is set to the world origin. -sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests')) -import editor_python_test_tools.hydra_editor_utils as hydra -from editor_python_test_tools.editor_test_helper import EditorTestHelper + Expected Behavior: + 1) Preview image updates to reflect change in transform of the gradient sampler. + 2) New Preview Position property is exposed, and set to 0,0,0 (world origin). + 3) Preview Size is set to 1,1,1 by default. + Test Steps: + 1) Open level + 2) Create entity with Random Noise gradient and verify gradient position after clearing pinned entity + 3) Create entity with Levels Gradient Modifier and verify gradient position after clearing pinned entity + 4) Create entity with Posterize Gradient Modifier and verify gradient position after clearing pinned entity + 5) Create entity with Smooth-Step Gradient Modifier and verify gradient position after clearing pinned entity + 6) Create entity with Threshold Gradient Modifier and verify gradient position after clearing pinned entity + 7) Create entity with FastNoise Gradient and verify gradient position after clearing pinned entity + 8) Create entity with Dither Gradient Modifier and verify gradient position after clearing pinned entity + 9) Create entity with Invert Gradient Modifier and verify gradient position after clearing pinned entity + 10) Create entity with Perlin Noise Gradient and verify gradient position after clearing pinned entity -class TestGradientPreviewSettings(EditorTestHelper): - def __init__(self): - EditorTestHelper.__init__(self, log_prefix="GradientPreviewSettings_ClearPinnedEntity", args=["level"]) + Note: + - This test file must be called from the Open 3D Engine Editor command terminal + - Any passed and failed tests are written to the Editor.log file. + Parsing the file or running a log_monitor are required to observe the test results. - def run_test(self): - """ - Summary: - A temporary level is created. An entity for each test case is created and added with the corresponding - components to verify if the gradient transform is set to the world origin. + :return: None + """ - Expected Behavior: - 1) Preview image updates to reflect change in transform of the gradient sampler. - 2) New Preview Position property is exposed, and set to 0,0,0 (world origin). - 3) Preview Size is set to 1,1,1 by default. + import sys - Test Steps: - 1) Open level - 2) Create entity with Random Noise gradient and verify gradient position after clearing pinned entity - 3) Create entity with Levels Gradient Modifier and verify gradient position after clearing pinned entity - 4) Create entity with Posterize Gradient Modifier and verify gradient position after clearing pinned entity - 5) Create entity with Smooth-Step Gradient Modifier and verify gradient position after clearing pinned entity - 6) Create entity with Threshold Gradient Modifier and verify gradient position after clearing pinned entity - 7) Create entity with FastNoise Gradient and verify gradient position after clearing pinned entity - 8) Create entity with Dither Gradient Modifier and verify gradient position after clearing pinned entity - 9) Create entity with Invert Gradient Modifier and verify gradient position after clearing pinned entity - 10) Create entity with Perlin Noise Gradient and verify gradient position after clearing pinned entity + import azlmbr.bus as bus + import azlmbr.editor as editor + import azlmbr.math as math + import azlmbr.entity as EntityId - Note: - - This test file must be called from the Open 3D Engine Editor command terminal - - Any passed and failed tests are written to the Editor.log file. - Parsing the file or running a log_monitor are required to observe the test results. + import editor_python_test_tools.hydra_editor_utils as hydra + from editor_python_test_tools.utils import Report + from editor_python_test_tools.utils import TestHelper as helper - :return: None - """ + WORLD_ORIGIN = math.Vector3(0.0, 0.0, 0.0) + EXPECTED_SIZE = math.Vector3(1.0, 1.0, 1.0) + CLOSE_THRESHOLD = sys.float_info.min - WORLD_ORIGIN = math.Vector3(0.0, 0.0, 0.0) - EXPECTED_SIZE = math.Vector3(1.0, 1.0, 1.0) - CLOSE_THRESHOLD = sys.float_info.min + def create_entity(entity_name, components_to_add): + entity_position = math.Vector3(125.0, 136.0, 32.0) + entity_id = editor.ToolsApplicationRequestBus( + bus.Broadcast, "CreateNewEntityAtPosition", entity_position, EntityId.EntityId() + ) + entity = hydra.Entity(entity_name, entity_id) + if entity_id.IsValid(): + print(f"{entity_name} entity Created") + entity.components = [] + for component in components_to_add: + entity.components.append(hydra.add_component(component, entity_id)) + return entity - def create_entity(enity_name, components_to_add): - entity_position = math.Vector3(125.0, 136.0, 32.0) - entity_id = editor.ToolsApplicationRequestBus( - bus.Broadcast, "CreateNewEntityAtPosition", entity_position, EntityId.EntityId() + def clear_entityid_check_position(entity_name, components_to_add, check_preview_size=False): + entity = create_entity(entity_name, components_to_add) + hydra.get_set_test(entity, 0, "Preview Settings|Pin Preview to Shape", EntityId.EntityId()) + preview_position = hydra.get_component_property_value( + entity.components[0], "Preview Settings|Preview Position" + ) + preview_set_to_origin = ( + f"{entity_name}: Preview Position set to world origin", + f"{entity_name}: Preview Position set to unexpected coords" + ) + Report.result(preview_set_to_origin, preview_position.IsClose(WORLD_ORIGIN, CLOSE_THRESHOLD)) + if check_preview_size: + preview_size = hydra.get_component_property_value(entity.components[0], "Preview Settings|Preview Size") + preview_size_default_set = ( + f"{entity_name}: Preview Size set as expected", + f"{entity_name}: Preview Size set to unexpected value. Expected {EXPECTED_SIZE}, Found {preview_size}" ) - entity = hydra.Entity(enity_name, entity_id) - if entity_id.IsValid(): - print(f"{enity_name} entity Created") - entity.components = [] - for component in components_to_add: - entity.components.append(hydra.add_component(component, entity_id)) - return entity + Report.result(preview_size_default_set, preview_size.IsClose(EXPECTED_SIZE, CLOSE_THRESHOLD)) + return entity - def clear_entityid_check_position(entity_name, components_to_add, check_preview_size=False): - entity = create_entity(entity_name, components_to_add) - hydra.get_set_test(entity, 0, "Preview Settings|Pin Preview to Shape", EntityId.EntityId()) - preview_position = hydra.get_component_property_value( - entity.components[0], "Preview Settings|Preview Position" - ) - if preview_position.IsClose(WORLD_ORIGIN, CLOSE_THRESHOLD): - print(f"{entity_name} --- Preview Position set to world origin") - if check_preview_size: - preview_size = hydra.get_component_property_value(entity.components[0], "Preview Settings|Preview Size") - if preview_size.IsClose(EXPECTED_SIZE, CLOSE_THRESHOLD): - print(f"{entity_name} --- Preview Size set to (1, 1, 1)") - return entity + # 1) Open an existing simple level + helper.init_idle() + helper.open_level("Physics", "Base") - # 1) Open level - self.test_success = self.create_level( - self.args["level"], - heightmap_resolution=1024, - heightmap_meters_per_pixel=1, - terrain_texture_resolution=4096, - use_terrain=False, - ) + # 2) Create entity with Random Noise gradient and verify gradient position after clearing pinned entity + clear_entityid_check_position( + "Random Noise Gradient", ["Random Noise Gradient", "Gradient Transform Modifier", "Box Shape"], True + ) - # 2) Create entity with Random Noise gradient and verify gradient position after clearing pinned entity - clear_entityid_check_position( - "Random Noise Gradient", ["Random Noise Gradient", "Gradient Transform Modifier", "Box Shape"], True - ) + # 3) Create entity with Levels Gradient Modifier and verify gradient position after clearing pinned entity + clear_entityid_check_position("Levels Gradient Modifier", ["Levels Gradient Modifier"]) - # 3) Create entity with Levels Gradient Modifier and verify gradient position after clearing pinned entity - clear_entityid_check_position("Levels Gradient Modifier", ["Levels Gradient Modifier"]) + # 4) Create entity with Posterize Gradient Modifier and verify gradient position after clearing pinned entity + clear_entityid_check_position("Posterize Gradient Modifier", ["Posterize Gradient Modifier"]) - # 4) Create entity with Posterize Gradient Modifier and verify gradient position after clearing pinned entity - clear_entityid_check_position("Posterize Gradient Modifier", ["Posterize Gradient Modifier"]) + # 5) Create entity with Smooth-Step Gradient Modifier and verify gradient position after clearing pinned entity + clear_entityid_check_position("Smooth-Step Gradient Modifier", ["Smooth-Step Gradient Modifier"]) - # 5) Create entity with Smooth-Step Gradient Modifier and verify gradient position after clearing pinned entity - clear_entityid_check_position("Smooth-Step Gradient Modifier", ["Smooth-Step Gradient Modifier"]) + # 6) Create entity with Threshold Gradient Modifier and verify gradient position after clearing pinned entity + clear_entityid_check_position("Threshold Gradient Modifier", ["Threshold Gradient Modifier"]) - # 6) Create entity with Threshold Gradient Modifier and verify gradient position after clearing pinned entity - clear_entityid_check_position("Threshold Gradient Modifier", ["Threshold Gradient Modifier"]) + # 7) Create entity with FastNoise Gradient and verify gradient position after clearing pinned entity + clear_entityid_check_position( + "FastNoise Gradient", ["FastNoise Gradient", "Gradient Transform Modifier", "Box Shape"], True + ) - # 7) Create entity with FastNoise Gradient and verify gradient position after clearing pinned entity - clear_entityid_check_position( - "FastNoise Gradient", ["FastNoise Gradient", "Gradient Transform Modifier", "Box Shape"], True - ) + # 8) Create entity with Dither Gradient Modifier and verify gradient position after clearing pinned entity + clear_entityid_check_position("Dither Gradient Modifier", ["Dither Gradient Modifier"], True) - # 8) Create entity with Dither Gradient Modifier and verify gradient position after clearing pinned entity - clear_entityid_check_position("Dither Gradient Modifier", ["Dither Gradient Modifier"], True) + # 9) Create entity with Invert Gradient Modifier and verify gradient position after clearing pinned entity + clear_entityid_check_position("Invert Gradient Modifier", ["Invert Gradient Modifier"]) - # 9) Create entity with Invert Gradient Modifier and verify gradient position after clearing pinned entity - clear_entityid_check_position("Invert Gradient Modifier", ["Invert Gradient Modifier"]) - - # 10) Create entity with Perlin Noise Gradient and verify gradient position after clearing pinned entity - clear_entityid_check_position( - "Perlin Noise Gradient", ["Perlin Noise Gradient", "Gradient Transform Modifier", "Box Shape"], True - ) + # 10) Create entity with Perlin Noise Gradient and verify gradient position after clearing pinned entity + clear_entityid_check_position( + "Perlin Noise Gradient", ["Perlin Noise Gradient", "Gradient Transform Modifier", "Box Shape"], True + ) -test = TestGradientPreviewSettings() -test.run() +if __name__ == "__main__": + + from editor_python_test_tools.utils import Report + Report.start_test(GradientPreviewSettings_ClearingPinnedEntitySetsPreviewToOrigin) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientPreviewSettings_DefaultPinnedEntityIsSelf.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientPreviewSettings_DefaultPinnedEntityIsSelf.py index 99a54f614a..3756452710 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientPreviewSettings_DefaultPinnedEntityIsSelf.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientPreviewSettings_DefaultPinnedEntityIsSelf.py @@ -5,18 +5,6 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ -import os -import sys - -import azlmbr.bus as bus -import azlmbr.editor as editor -import azlmbr.entity as entity -import azlmbr.paths - -sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests')) -import editor_python_test_tools.hydra_editor_utils as hydra -from editor_python_test_tools.editor_test_helper import EditorTestHelper - class Scoped: def __init__(self, constructor, destructor, *args): @@ -33,81 +21,84 @@ class TestParams: self.accessed_component = accessed_component -class TestGradientPreviewSettings(EditorTestHelper): - def __init__(self): - EditorTestHelper.__init__(self, log_prefix="GradientPreviewSettings_DefaultPinnedEntity", args=["level"]) +def GradientPreviewSettings_DefaultPinnedEntityIsSelf(): + """ + Summary: + This test verifies default values for the pinned entity for Gradient Preview settings. - def run_test(self): - """ - Summary: - This test verifies default values for the pinned entity for Gradient Preview settings. + Expected Behavior: + Pinned entity is self for all gradient generator/modifiers. - Expected Behavior: - Pinned entity is self for all gradient generator/modifiers. + Test Steps: + 1) Open a simple level + 2) Create a new entity in the level + 3) Add each Gradient Generator component to an entity, and verify the Pin Preview to Shape property is set to + self - Test Steps: - 1) Create a new level - 2) Create a new entity in the level - 3) Add each Gradient Generator component to an entity, and verify the Pin Preview to Shape property is set to - self + Note: + - This test file must be called from the Open 3D Engine Editor command terminal + - Any passed and failed tests are written to the Editor.log file. + Parsing the file or running a log_monitor are required to observe the test results. - Note: - - This test file must be called from the Open 3D Engine Editor command terminal - - Any passed and failed tests are written to the Editor.log file. - Parsing the file or running a log_monitor are required to observe the test results. + :return: None + """ - :return: None - """ + import azlmbr.bus as bus + import azlmbr.editor as editor + import azlmbr.entity as entity - def execute_test(test_id, function, *args): - if function(*args): - self.log(test_id + ' has Preview pinned to own Entity result: SUCCESS') + import editor_python_test_tools.hydra_editor_utils as hydra + from editor_python_test_tools.utils import Report + from editor_python_test_tools.utils import TestHelper as helper - def create_entity(): - return editor.ToolsApplicationRequestBus(bus.Broadcast, 'CreateNewEntity', entity.EntityId()) - - def delete_entity(entity_id): - editor.ToolsApplicationRequestBus(bus.Broadcast, 'DeleteEntityAndAllDescendants', entity_id) - - def attach_components(component_list, entity_id): - components = [] - for i in component_list: - components.append(hydra.add_component(i, entity_id)) - return components - - def validate_id_is_current(param): - entity_ptr = Scoped(create_entity, delete_entity) - added_components = attach_components(param.required_components, entity_ptr.data) - value = hydra.get_component_property_value(added_components[param.accessed_component], - 'Preview Settings|Pin Preview to Shape') - self.test_success = self.test_success and entity_ptr.data.Equal(value) - return entity_ptr.data.Equal(value) - - param_list = [ - TestParams(['Gradient Transform Modifier', 'Box Shape', 'Perlin Noise Gradient'], 2), - TestParams(['Random Noise Gradient', 'Gradient Transform Modifier', 'Box Shape'], 0), - TestParams(['FastNoise Gradient', 'Gradient Transform Modifier', 'Box Shape'], 0), - TestParams(['Dither Gradient Modifier'], 0), - TestParams(['Invert Gradient Modifier'], 0), - TestParams(['Levels Gradient Modifier'], 0), - TestParams(['Posterize Gradient Modifier'], 0), - TestParams(['Smooth-Step Gradient Modifier'], 0), - TestParams(['Threshold Gradient Modifier'], 0) - ] - - # Create a new empty level - self.test_success = self.create_level( - self.args["level"], - heightmap_resolution=1024, - heightmap_meters_per_pixel=1, - terrain_texture_resolution=4096, - use_terrain=False, + def execute_test(test_id, function, *args): + pinned_to_self = ( + f"{test_id} has Preview pinned to self", + f"{test_id} has Preview pinned to a different entity" ) + Report.result(pinned_to_self, function(*args)) - for param in param_list: - execute_test(param.required_components[param.accessed_component], - validate_id_is_current, param) + def create_entity(): + return editor.ToolsApplicationRequestBus(bus.Broadcast, 'CreateNewEntity', entity.EntityId()) + + def delete_entity(entity_id): + editor.ToolsApplicationRequestBus(bus.Broadcast, 'DeleteEntityAndAllDescendants', entity_id) + + def attach_components(component_list, entity_id): + components = [] + for i in component_list: + components.append(hydra.add_component(i, entity_id)) + return components + + def validate_id_is_current(param): + entity_ptr = Scoped(create_entity, delete_entity) + added_components = attach_components(param.required_components, entity_ptr.data) + value = hydra.get_component_property_value(added_components[param.accessed_component], + 'Preview Settings|Pin Preview to Shape') + return entity_ptr.data.Equal(value) + + param_list = [ + TestParams(['Gradient Transform Modifier', 'Box Shape', 'Perlin Noise Gradient'], 2), + TestParams(['Random Noise Gradient', 'Gradient Transform Modifier', 'Box Shape'], 0), + TestParams(['FastNoise Gradient', 'Gradient Transform Modifier', 'Box Shape'], 0), + TestParams(['Dither Gradient Modifier'], 0), + TestParams(['Invert Gradient Modifier'], 0), + TestParams(['Levels Gradient Modifier'], 0), + TestParams(['Posterize Gradient Modifier'], 0), + TestParams(['Smooth-Step Gradient Modifier'], 0), + TestParams(['Threshold Gradient Modifier'], 0) + ] + + # 1) Open an existing simple level + helper.init_idle() + helper.open_level("Physics", "Base") + + for param in param_list: + execute_test(param.required_components[param.accessed_component], + validate_id_is_current, param) -test = TestGradientPreviewSettings() -test.run() +if __name__ == "__main__": + + from editor_python_test_tools.utils import Report + Report.start_test(GradientPreviewSettings_DefaultPinnedEntityIsSelf) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientSampling_GradientReferencesAddRemoveSuccessfully.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientSampling_GradientReferencesAddRemoveSuccessfully.py index 6d88f43d5a..8e85345a6f 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientSampling_GradientReferencesAddRemoveSuccessfully.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientSampling_GradientReferencesAddRemoveSuccessfully.py @@ -5,92 +5,82 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ -import os -import sys -sys.path.append(os.path.dirname(os.path.abspath(__file__))) -import azlmbr.math as math -import azlmbr.paths -import azlmbr.entity as EntityId +def GradientSampling_GradientReferencesAddRemoveSuccessfully(): + """ + Summary: + An existing gradient generator can be pinned and cleared to/from the Gradient Entity Id field -sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests')) -import editor_python_test_tools.hydra_editor_utils as hydra -from editor_python_test_tools.editor_test_helper import EditorTestHelper + Expected Behavior: + Gradient generator is assigned to the Gradient Entity Id field. + Gradient generator is removed from the field. + Test Steps: + 1) Open level + 2) Create a new entity with components "Random Noise Gradient", "Gradient Transform Modifier" and "Box Shape" + 3) Create a new entity with Gradient Modifier's, pin and clear the random noise entity id to the Gradient Id + field in Gradient Modifier -class TestGradientSampling(EditorTestHelper): - def __init__(self): - EditorTestHelper.__init__(self, log_prefix="GradientSampling_GradientReferences", args=["level"]) + Note: + - This test file must be called from the Open 3D Engine Editor command terminal + - Any passed and failed tests are written to the Editor.log file. + Parsing the file or running a log_monitor are required to observe the test results. - def run_test(self): - """ - Summary: - An existing gradient generator can be pinned and cleared to/from the Gradient Entity Id field + :return: None + """ - Expected Behavior: - Gradient generator is assigned to the Gradient Entity Id field. - Gradient generator is removed from the field. + import azlmbr.math as math + import azlmbr.entity as EntityId - Test Steps: - 1) Open level - 2) Create a new entity with components "Random Noise Gradient", "Gradient Transform Modifier" and "Box Shape" - 3) Create a new entity with Gradient Modifier's, pin and clear the random noise entity id to the Gradient Id - field in Gradient Modifier + import editor_python_test_tools.hydra_editor_utils as hydra + from editor_python_test_tools.utils import Report + from editor_python_test_tools.utils import TestHelper as helper - Note: - - This test file must be called from the Open 3D Engine Editor command terminal - - Any passed and failed tests are written to the Editor.log file. - Parsing the file or running a log_monitor are required to observe the test results. - - :return: None - """ - - def modifier_pin_clear_to_gradiententityid(modifier): - entity_position = math.Vector3(125.0, 136.0, 32.0) - component_to_add = [modifier] - gradient_modifier = hydra.Entity(modifier) - gradient_modifier.create_entity(entity_position, component_to_add) - gradient_modifier.get_set_test(0, "Configuration|Gradient|Gradient Entity Id", random_noise.id) - entity = hydra.get_component_property_value( - gradient_modifier.components[0], "Configuration|Gradient|Gradient Entity Id" - ) - if entity.Equal(random_noise.id): - print(f"Gradient Generator is pinned to the {modifier} successfully") - else: - print(f"Failed to pin Gradient Generator to the {modifier}") - hydra.get_set_test(gradient_modifier, 0, "Configuration|Gradient|Gradient Entity Id", EntityId.EntityId()) - entity = hydra.get_component_property_value( - gradient_modifier.components[0], "Configuration|Gradient|Gradient Entity Id" - ) - if entity.Equal(EntityId.EntityId()): - print(f"Gradient Generator is cleared from the {modifier} successfully") - else: - print(f"Failed to clear Gradient Generator from the {modifier}") - - # 1) Open level - self.test_success = self.create_level( - self.args["level"], - heightmap_resolution=1024, - heightmap_meters_per_pixel=1, - terrain_texture_resolution=4096, - use_terrain=False, - ) - - # 2) Create a new entity with components "Random Noise Gradient", "Gradient Transform Modifier" and "Box Shape" + def modifier_pin_clear_to_gradiententityid(modifier): entity_position = math.Vector3(125.0, 136.0, 32.0) - components_to_add = ["Random Noise Gradient", "Gradient Transform Modifier", "Box Shape"] - random_noise = hydra.Entity("Random_Noise") - random_noise.create_entity(entity_position, components_to_add) + component_to_add = [modifier] + gradient_modifier = hydra.Entity(modifier) + gradient_modifier.create_entity(entity_position, component_to_add) + gradient_modifier.get_set_test(0, "Configuration|Gradient|Gradient Entity Id", random_noise.id) + entity = hydra.get_component_property_value( + gradient_modifier.components[0], "Configuration|Gradient|Gradient Entity Id" + ) + gradient_pinned_to_modifier = ( + f"Gradient Generator is pinned to the {modifier} successfully", + f"Failed to pin Gradient Generator to the {modifier}" + ) + Report.result(gradient_pinned_to_modifier, entity.Equal(random_noise.id)) + hydra.get_set_test(gradient_modifier, 0, "Configuration|Gradient|Gradient Entity Id", EntityId.EntityId()) + entity = hydra.get_component_property_value( + gradient_modifier.components[0], "Configuration|Gradient|Gradient Entity Id" + ) + gradient_cleared_from_modifier = ( + f"Gradient Generator is cleared from the {modifier} successfully", + f"Failed to clear Gradient Generator from the {modifier}" + ) + Report.result(gradient_cleared_from_modifier, entity.Equal(EntityId.EntityId())) - # 3) Create a new entity with Gradient Modifier's, pin and clear the random noise entity id to the Gradient Id - # field in Gradient Modifier - modifier_pin_clear_to_gradiententityid("Dither Gradient Modifier") - modifier_pin_clear_to_gradiententityid("Invert Gradient Modifier") - modifier_pin_clear_to_gradiententityid("Levels Gradient Modifier") - modifier_pin_clear_to_gradiententityid("Posterize Gradient Modifier") - modifier_pin_clear_to_gradiententityid("Smooth-Step Gradient Modifier") - modifier_pin_clear_to_gradiententityid("Threshold Gradient Modifier") + # 1) Open an existing simple level + helper.init_idle() + helper.open_level("Physics", "Base") + + # 2) Create a new entity with components "Random Noise Gradient", "Gradient Transform Modifier" and "Box Shape" + entity_position = math.Vector3(125.0, 136.0, 32.0) + components_to_add = ["Random Noise Gradient", "Gradient Transform Modifier", "Box Shape"] + random_noise = hydra.Entity("Random_Noise") + random_noise.create_entity(entity_position, components_to_add) + + # 3) Create a new entity with Gradient Modifier's, pin and clear the random noise entity id to the Gradient Id + # field in Gradient Modifier + modifier_pin_clear_to_gradiententityid("Dither Gradient Modifier") + modifier_pin_clear_to_gradiententityid("Invert Gradient Modifier") + modifier_pin_clear_to_gradiententityid("Levels Gradient Modifier") + modifier_pin_clear_to_gradiententityid("Posterize Gradient Modifier") + modifier_pin_clear_to_gradiententityid("Smooth-Step Gradient Modifier") + modifier_pin_clear_to_gradiententityid("Threshold Gradient Modifier") -test = TestGradientSampling() -test.run() +if __name__ == "__main__": + + from editor_python_test_tools.utils import Report + Report.start_test(GradientSampling_GradientReferencesAddRemoveSuccessfully) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientSurfaceTagEmitter_ComponentDependencies.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientSurfaceTagEmitter_ComponentDependencies.py index 26d791495a..f653515a39 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientSurfaceTagEmitter_ComponentDependencies.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientSurfaceTagEmitter_ComponentDependencies.py @@ -5,114 +5,104 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ -import os -import sys -import azlmbr.math as math -import azlmbr.bus as bus -import azlmbr.entity as entity -import azlmbr.paths -import azlmbr.editor as editor - -sys.path.append(os.path.join(azlmbr.paths.devroot, "AutomatedTesting", "Gem", "PythonTests")) -import editor_python_test_tools.hydra_editor_utils as hydra -from editor_python_test_tools.editor_test_helper import EditorTestHelper -class TestGradientSurfaceTagEmitterDependencies(EditorTestHelper): - def __init__(self): - EditorTestHelper.__init__( - self, log_prefix="GradientSurfaceTagEmitter_ComponentDependencies", args=["level"] +def GradientSurfaceTagEmitter_ComponentDependencies(): + """ + Summary: + This test verifies that the Gradient Surface Tag Emitter component is dependent on a gradient component. + + Expected Result: + Gradient Surface Tag Emitter component is disabled until a Gradient Generator, Modifier or Gradient Reference + component (and any sub-dependencies) is added to the entity. + + Test Steps: + 1) Open level + 2) Create a new entity with a Gradient Surface Tag Emitter component + 3) Verify the component is disabled until a dependent component is also added to the entity + + Note: + - This test file must be called from the Open 3D Engine Editor command terminal + - Any passed and failed tests are written to the Editor.log file. + Parsing the file or running a log_monitor are required to observe the test results. + + :return: None + """ + + import azlmbr.math as math + import azlmbr.bus as bus + import azlmbr.entity as entity + import azlmbr.editor as editor + + import editor_python_test_tools.hydra_editor_utils as hydra + from editor_python_test_tools.utils import Report + from editor_python_test_tools.utils import TestHelper as helper + + def is_enabled(EntityComponentIdPair): + return editor.EditorComponentAPIBus(bus.Broadcast, "IsComponentEnabled", EntityComponentIdPair) + + # Open an existing simple level + helper.init_idle() + helper.open_level("Physics", "Base") + + # Create an entity with Gradient Surface Tag Emitter component + position = math.Vector3(512.0, 512.0, 32.0) + gradient = hydra.Entity("gradient") + gradient.create_entity(position, ["Gradient Surface Tag Emitter"]) + + # Make sure Gradient Surface Tag Emitter is disabled + gradient_surface_tag_disabled = ( + "Gradient Surface Tag Emitter is Disabled", + "Gradient Surface Tag Emitter is Enabled, but should be Disabled without dependencies met" + ) + Report.result(gradient_surface_tag_disabled, not is_enabled(gradient.components[0])) + + # Verify Gradient Surface Tag Emitter component is enabled after adding Gradient, Generator, Modifier + # or Reference component + new_components_to_add = [ + "Dither Gradient Modifier", + "Gradient Mixer", + "Invert Gradient Modifier", + "Levels Gradient Modifier", + "Posterize Gradient Modifier", + "Smooth-Step Gradient Modifier", + "Threshold Gradient Modifier", + "Altitude Gradient", + "Constant Gradient", + "FastNoise Gradient", + "Image Gradient", + "Perlin Noise Gradient", + "Random Noise Gradient", + "Reference Gradient", + "Shape Falloff Gradient", + "Slope Gradient", + "Surface Mask Gradient", + ] + for component in new_components_to_add: + component_list = ["FastNoise Gradient", "Image Gradient", "Perlin Noise Gradient", "Random Noise Gradient"] + if component in component_list: + for Component in ["Gradient Transform Modifier", "Box Shape"]: + hydra.add_component(Component, gradient.id) + typeIdsList = editor.EditorComponentAPIBus(bus.Broadcast, 'FindComponentTypeIdsByEntityType', [component], + entity.EntityType().Game) + ComponentOutcome = editor.EditorComponentAPIBus(bus.Broadcast, 'AddComponentsOfType', gradient.id, [typeIdsList[0]]) + Components = ComponentOutcome.GetValue() + ComponentIdPair = Components[0] + gradient_enabled = is_enabled(gradient.components[0]) + new_components_enabled = is_enabled(ComponentIdPair) + dependencies_met = ( + f"{component} and Gradient Surface Tag Emitter are enabled", + f"{component} and Gradient Surface Tag Emitter are disabled" ) + Report.result(dependencies_met, new_components_enabled and gradient_enabled) - def run_test(self): - """ - Summary: - This test verifies that the Gradient Surface Tag Emitter component is dependent on a gradient component. - - Expected Result: - Gradient Surface Tag Emitter component is disabled until a Gradient Generator, Modifier or Gradient Reference - component (and any sub-dependencies) is added to the entity. - - Test Steps: - 1) Open level - 2) Create a new entity with a Gradient Surface Tag Emitter component - 3) Verify the component is disabled until a dependent component is also added to the entity - - Note: - - This test file must be called from the Open 3D Engine Editor command terminal - - Any passed and failed tests are written to the Editor.log file. - Parsing the file or running a log_monitor are required to observe the test results. - - :return: None - """ - - def is_enabled(EntityComponentIdPair): - return editor.EditorComponentAPIBus(bus.Broadcast, "IsComponentEnabled", EntityComponentIdPair) - - # Create empty level - self.test_success = self.create_level( - self.args["level"], - heightmap_resolution=1024, - heightmap_meters_per_pixel=1, - terrain_texture_resolution=4096, - use_terrain=False, - ) - - # Create an entity with Gradient Surface Tag Emitter component - position = math.Vector3(512.0, 512.0, 32.0) - gradient = hydra.Entity("gradient") - gradient.create_entity(position, ["Gradient Surface Tag Emitter"]) - - # Make sure Gradient Surface Tag Emitter is disabled - is_enable = is_enabled(gradient.components[0]) - if not is_enable: - self.log("Gradient Surface Tag Emitter is Disabled") - elif not is_enable: - self.log("Gradient Surface Tag Emitter is Enabled, but should be Disabled without dependencies met") - - # Verify Gradient Surface Tag Emitter component is enabled after adding Gradient, Generator, Modifier - # or Reference component - new_components_to_add = [ - "Dither Gradient Modifier", - "Gradient Mixer", - "Invert Gradient Modifier", - "Levels Gradient Modifier", - "Posterize Gradient Modifier", - "Smooth-Step Gradient Modifier", - "Threshold Gradient Modifier", - "Altitude Gradient", - "Constant Gradient", - "FastNoise Gradient", - "Image Gradient", - "Perlin Noise Gradient", - "Random Noise Gradient", - "Reference Gradient", - "Shape Falloff Gradient", - "Slope Gradient", - "Surface Mask Gradient", - ] - for component in new_components_to_add: - component_list = ["FastNoise Gradient", "Image Gradient", "Perlin Noise Gradient", "Random Noise Gradient"] - if component in component_list: - for Component in ["Gradient Transform Modifier", "Box Shape"]: - hydra.add_component(Component, gradient.id) - typeIdsList = editor.EditorComponentAPIBus(bus.Broadcast, 'FindComponentTypeIdsByEntityType', [component], - entity.EntityType().Game) - ComponentOutcome = editor.EditorComponentAPIBus(bus.Broadcast, 'AddComponentsOfType', gradient.id, [typeIdsList[0]]) - Components = ComponentOutcome.GetValue() - ComponentIdPair = Components[0] - gradient_enabled = new_components_enabled = False - gradient_enabled = is_enabled(gradient.components[0]) - new_components_enabled = is_enabled(ComponentIdPair) - if new_components_enabled and gradient_enabled: - self.log(f"{component} and Gradient Surface Tag Emitter are enabled") - else: - self.log(f"{component} and Gradient Surface Tag Emitter are disabled") - if component in component_list: - hydra.remove_component("Gradient Transform Modifier", gradient.id) - hydra.remove_component("Box Shape", gradient.id) - hydra.remove_component(component, gradient.id) + if component in component_list: + hydra.remove_component("Gradient Transform Modifier", gradient.id) + hydra.remove_component("Box Shape", gradient.id) + hydra.remove_component(component, gradient.id) -test = TestGradientSurfaceTagEmitterDependencies() -test.run() +if __name__ == "__main__": + + from editor_python_test_tools.utils import Report + Report.start_test(GradientSurfaceTagEmitter_ComponentDependencies) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully.py index 44c9792296..90840a135d 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully.py @@ -5,75 +5,69 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ -import os -import sys -sys.path.append(os.path.dirname(os.path.abspath(__file__))) -import azlmbr.math as math -import azlmbr.paths -import azlmbr.surface_data as surface_data +def GradientSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully(): + """ + Summary: + Entity with Gradient Surface Tag Emitter and Reference Gradient components is created. + And new surface tag has been added and removed. -sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests')) -import editor_python_test_tools.hydra_editor_utils as hydra -from editor_python_test_tools.editor_test_helper import EditorTestHelper + Expected Behavior: + A new Surface Tag can be added and removed from the component + + Test Steps: + 1) Open level + 2) Create an entity with Gradient Surface Tag Emitter and Reference Gradient components. + 3) Add/ remove Surface Tags + + Note: + - This test file must be called from the Open 3D Engine Editor command terminal + - Any passed and failed tests are written to the Editor.log file. + Parsing the file or running a log_monitor are required to observe the test results. + + :return: None + """ + + import azlmbr.math as math + import azlmbr.surface_data as surface_data + + import editor_python_test_tools.hydra_editor_utils as hydra + from editor_python_test_tools.utils import Report + from editor_python_test_tools.utils import TestHelper as helper + + # 1) Open an existing simple level + helper.init_idle() + helper.open_level("Physics", "Base") + + # 2) Create an entity with Gradient Surface Tag Emitter and Reference Gradient components. + entity_position = math.Vector3(125.0, 136.0, 32.0) + components_to_add = ["Gradient Surface Tag Emitter", "Reference Gradient"] + entity = hydra.Entity("entity") + entity.create_entity(entity_position, components_to_add) + + # 3) Add/ remove Surface Tags + tag = surface_data.SurfaceTag() + tag.SetTag("water") + pte = hydra.get_property_tree(entity.components[0]) + path = "Configuration|Extended Tags" + pte.add_container_item(path, 0, tag) + success = helper.wait_for_condition(lambda: pte.get_container_count(path).GetValue() == 1, 1.0) + tag_added_to_container = ( + "Successfully added surface tag", + "Failed to add surface tag" + ) + Report.result(tag_added_to_container, success) + pte.remove_container_item(path, 0) + success = helper.wait_for_condition(lambda: pte.get_container_count(path).GetValue() == 0, 1.0) + tag_removed_from_container = ( + "Successfully removed surface tag", + "Failed to remove surface tag" + ) + Report.result(tag_removed_from_container, success) -class TestGradientSurfaceTagEmitter(EditorTestHelper): - def __init__(self): - EditorTestHelper.__init__(self, log_prefix="GradientSurfaceTagEmitter_SurfaceTagsAddRemoveSucessfully", - args=["level"]) +if __name__ == "__main__": - def run_test(self): - """ - Summary: - Entity with Gradient Surface Tag Emitter and Reference Gradient components is created. - And new surface tag has been added and removed. - - Expected Behavior: - A new Surface Tag can be added and removed from the component + from editor_python_test_tools.utils import Report + Report.start_test(GradientSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully) - Test Steps: - 1) Open level - 2) Create an entity with Gradient Surface Tag Emitter and Reference Gradient components. - 3) Add/ remove Surface Tags - - Note: - - This test file must be called from the Open 3D Engine Editor command terminal - - Any passed and failed tests are written to the Editor.log file. - Parsing the file or running a log_monitor are required to observe the test results. - - :return: None - """ - - # 1) Open level - self.test_success = self.create_level( - self.args["level"], - heightmap_resolution=1024, - heightmap_meters_per_pixel=1, - terrain_texture_resolution=4096, - use_terrain=False, - ) - - # 2) Create an entity with Gradient Surface Tag Emitter and Reference Gradient components. - entity_position = math.Vector3(125.0, 136.0, 32.0) - components_to_add = ["Gradient Surface Tag Emitter", "Reference Gradient"] - entity = hydra.Entity("entity") - entity.create_entity(entity_position, components_to_add) - - # 3) Add/ remove Surface Tags - tag = surface_data.SurfaceTag() - tag.SetTag("water") - pte = hydra.get_property_tree(entity.components[0]) - path = "Configuration|Extended Tags" - pte.add_container_item(path, 0, tag) - success = self.wait_for_condition(lambda: pte.get_container_count(path).GetValue() == 1) - self.test_success = self.test_success and success - print(f"Added SurfaceTag: container count is {pte.get_container_count(path).GetValue()}") - pte.remove_container_item(path, 0) - success = self.wait_for_condition(lambda: pte.get_container_count(path).GetValue() == 0) - self.test_success = self.test_success and success - print(f"Removed SurfaceTag: container count is {pte.get_container_count(path).GetValue()}") - - -test = TestGradientSurfaceTagEmitter() -test.run() diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientTransform_ComponentIncompatibleWithExpectedGradients.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientTransform_ComponentIncompatibleWithExpectedGradients.py index b5f342a15f..5e6df4d52f 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientTransform_ComponentIncompatibleWithExpectedGradients.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientTransform_ComponentIncompatibleWithExpectedGradients.py @@ -5,118 +5,102 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ -import os -import sys -sys.path.append(os.path.dirname(os.path.abspath(__file__))) -import azlmbr.bus as bus -import azlmbr.editor as editor -import azlmbr.math as math -import azlmbr.entity as EntityId +def GradientTransform_ComponentIncompatibleWithExpectedGradients(): + """ + Summary: + A New level is created. A New entity is created with components Gradient Transform Modifier and Box Shape. + Adding components Constant Gradient, Altitude Gradient, Gradient Mixer, Reference Gradient, Shape + Falloff Gradient, Slope Gradient and Surface Mask Gradient to the same entity. -sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests')) -import editor_python_test_tools.hydra_editor_utils as hydra -from editor_python_test_tools.editor_test_helper import EditorTestHelper + Expected Behavior: + All added components are disabled and inform the user that they are incompatible with the Gradient Transform + Modifier + Test Steps: + 1) Create level + 2) Create a new entity with components Gradient Transform Modifier and Box Shape + 3) Make sure all components are enabled in Entity + 4) Add Constant Gradient, Altitude Gradient, Gradient Mixer, Reference Gradient, Shape + Falloff Gradient, Slope Gradient and Surface Mask Gradient to the same entity + 5) Make sure all newly added components are disabled -class TestGradientTransform_ComponentIncompatibleWithExpectedGradients(EditorTestHelper): - def __init__(self): - EditorTestHelper.__init__(self, log_prefix="GradientTransform_ComponentIncompatibleWithExpectedGradients", - args=["level"]) + Note: + - This test file must be called from the Open 3D Engine Editor command terminal + - Any passed and failed tests are written to the Editor.log file. + Parsing the file or running a log_monitor are required to observe the test results. - def run_test(self): - """ - Summary: - A New level is created. A New entity is created with components Gradient Transform Modifier and Box Shape. - Adding components Constant Gradient, Altitude Gradient, Gradient Mixer, Reference Gradient, Shape - Falloff Gradient, Slope Gradient and Surface Mask Gradient to the same entity. + :return: None + """ - Expected Behavior: - All added components are disabled and inform the user that they are incompatible with the Gradient Transform - Modifier + import azlmbr.bus as bus + import azlmbr.editor as editor + import azlmbr.math as math + import azlmbr.entity as EntityId - Test Steps: - 1) Create level - 2) Create a new entity with components Gradient Transform Modifier and Box Shape - 3) Make sure all components are enabled in Entity - 4) Add Constant Gradient, Altitude Gradient, Gradient Mixer, Reference Gradient, Shape - Falloff Gradient, Slope Gradient and Surface Mask Gradient to the same entity - 5) Make sure all newly added components are disabled + import editor_python_test_tools.hydra_editor_utils as hydra + from editor_python_test_tools.utils import Report + from editor_python_test_tools.utils import TestHelper as helper - Note: - - This test file must be called from the Open 3D Engine Editor command terminal - - Any passed and failed tests are written to the Editor.log file. - Parsing the file or running a log_monitor are required to observe the test results. + def is_enabled(EntityComponentIdPair): + return editor.EditorComponentAPIBus(bus.Broadcast, "IsComponentEnabled", EntityComponentIdPair) - :return: None - """ + # 1) Open an existing simple level + helper.init_idle() + helper.open_level("Physics", "Base") - def is_enabled(EntityComponentIdPair): - return editor.EditorComponentAPIBus(bus.Broadcast, "IsComponentEnabled", EntityComponentIdPair) + # 2) Create a new entity with components Gradient Transform Modifier and Box Shape + entity_position = math.Vector3(125.0, 136.0, 32.0) + components_to_add = ["Gradient Transform Modifier", "Box Shape"] + gradient_id = editor.ToolsApplicationRequestBus( + bus.Broadcast, "CreateNewEntityAtPosition", entity_position, EntityId.EntityId() + ) + gradient = hydra.Entity("gradient", gradient_id) - # 1) Create level - self.test_success = self.create_level( - self.args["level"], - heightmap_resolution=1024, - heightmap_meters_per_pixel=1, - terrain_texture_resolution=4096, - use_terrain=False, + gradient.components = [] + + for component in components_to_add: + gradient.components.append(hydra.add_component(component, gradient_id)) + entity_created = ( + "Entity created successfully", + "Failed to create entity" + ) + Report.critical_result(entity_created, gradient_id.isValid()) + + # 3) Make sure all components are enabled in Entity + index = 0 + for component in components_to_add: + components_enabled = ( + f"{component} is enabled", + f"{component} is unexpectedly disabled" ) + Report.critical_result(components_enabled, is_enabled(gradient.components[index])) + index += 1 - # 2) Create a new entity with components Gradient Transform Modifier and Box Shape - entity_position = math.Vector3(125.0, 136.0, 32.0) - components_to_add = ["Gradient Transform Modifier", "Box Shape"] - gradient_id = editor.ToolsApplicationRequestBus( - bus.Broadcast, "CreateNewEntityAtPosition", entity_position, EntityId.EntityId() + # 4) Add Constant Gradient, Altitude Gradient, Gradient Mixer, Reference Gradient, Shape + # Falloff Gradient, Slope Gradient and Surface Mask Gradient to the same entity + new_components_to_add = [ + "Constant Gradient", + "Altitude Gradient", + "Gradient Mixer", + "Reference Gradient", + "Shape Falloff Gradient", + "Slope Gradient", + "Surface Mask Gradient", + ] + new_components_enabled = False + for component in new_components_to_add: + gradient.components.append(hydra.add_component(component, gradient_id)) + gradient_components_disabled = ( + f"{component} is disabled", + f"{component} is enabled, but should be disabled" ) - gradient = hydra.Entity("gradient", gradient_id) - - gradient.components = [] - - for component in components_to_add: - gradient.components.append(hydra.add_component(component, gradient_id)) - if gradient_id.isValid(): - self.log("New Entity Created") - - # 3) Make sure all components are enabled in Entity - index = 0 - for component in components_to_add: - is_enable = is_enabled(gradient.components[index]) - if is_enable: - self.log(f"{component} is Enabled") - self.test_success = self.test_success and is_enable - elif not is_enable: - self.log(f"{component} is disabled, but it should be enabled") - self.test_success = self.test_success and is_enable - break - index += 1 - - # 4) Add Constant Gradient, Altitude Gradient, Gradient Mixer, Reference Gradient, Shape - # Falloff Gradient, Slope Gradient and Surface Mask Gradient to the same entity - new_components_to_add = [ - "Constant Gradient", - "Altitude Gradient", - "Gradient Mixer", - "Reference Gradient", - "Shape Falloff Gradient", - "Slope Gradient", - "Surface Mask Gradient", - ] - index = 2 - new_components_enabled = False - for component in new_components_to_add: - gradient.components.append(hydra.add_component(component, gradient_id)) - new_components_enabled = is_enabled(gradient.components[index]) - if new_components_enabled: - self.log(f"{component} is enabled, but should be disabled") - break + Report.result(gradient_components_disabled, not is_enabled(gradient.components[2])) + if not is_enabled(gradient.components[2]): editor.EditorComponentAPIBus(bus.Broadcast, "RemoveComponents", component) - # 5) Make sure all newly added components are disabled - if not new_components_enabled: - self.log("All newly added components are incompatible and disabled") - self.test_success = self.test_success and not new_components_enabled +if __name__ == "__main__": -test = TestGradientTransform_ComponentIncompatibleWithExpectedGradients() -test.run() + from editor_python_test_tools.utils import Report + Report.start_test(GradientTransform_ComponentIncompatibleWithExpectedGradients) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientTransform_ComponentIncompatibleWithSpawners.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientTransform_ComponentIncompatibleWithSpawners.py index 54270c5ee5..fd65996fdd 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientTransform_ComponentIncompatibleWithSpawners.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientTransform_ComponentIncompatibleWithSpawners.py @@ -5,104 +5,88 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ -import os -import sys -sys.path.append(os.path.dirname(os.path.abspath(__file__))) -import azlmbr.bus as bus -import azlmbr.editor as editor -import azlmbr.math as math -import azlmbr.entity as EntityId +def GradientTransform_ComponentIncompatibleWithSpawners(): + """ + Summary: + A simple level is opened. A New entity is created with components Gradient Transform Modifier and Box Shape. + Adding a component Vegetation Layer Spawner to the same entity. -sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests')) -import editor_python_test_tools.hydra_editor_utils as hydra -from editor_python_test_tools.editor_test_helper import EditorTestHelper + Expected Behavior: + The Vegetation Layer Spawner is deactivated and it is communicated that it is incompatible with Gradient + Transform Modifier + Test Steps: + 1) Open a simple level + 2) Create a new entity with components Gradient Transform Modifier and Box Shape + 3) Make sure all components are enabled in Entity + 4) Add Vegetation Layer Spawner to the same entity + 5) Make sure newly added component is disabled -class TestGradientTransform_ComponentIncompatibleWithSpawners(EditorTestHelper): - def __init__(self): - EditorTestHelper.__init__(self, log_prefix="GradientTransform_ComponentIncompatibleWithSpawners", - args=["level"]) + Note: + - This test file must be called from the Open 3D Engine Editor command terminal + - Any passed and failed tests are written to the Editor.log file. + Parsing the file or running a log_monitor are required to observe the test results. - def run_test(self): - """ - Summary: - A New level is created. A New entity is created with components Gradient Transform Modifier and Box Shape. - Adding a component Vegetation Layer Spawner to the same entity. + :return: None + """ - Expected Behavior: - The Vegetation Layer Spawner is deactivated and it is communicated that it is incompatible with Gradient - Transform Modifier + import azlmbr.bus as bus + import azlmbr.editor as editor + import azlmbr.math as math + import azlmbr.entity as EntityId - Test Steps: - 1) Create level - 2) Create a new entity with components Gradient Transform Modifier and Box Shape - 3) Make sure all components are enabled in Entity - 4) Add Vegetation Layer Spawner to the same entity - 5) Make sure newly added component is disabled + import editor_python_test_tools.hydra_editor_utils as hydra + from editor_python_test_tools.utils import Report + from editor_python_test_tools.utils import TestHelper as helper - Note: - - This test file must be called from the Open 3D Engine Editor command terminal - - Any passed and failed tests are written to the Editor.log file. - Parsing the file or running a log_monitor are required to observe the test results. + def is_enabled(EntityComponentIdPair): + return editor.EditorComponentAPIBus(bus.Broadcast, "IsComponentEnabled", EntityComponentIdPair) - :return: None - """ + # 1) Open an existing simple level + helper.init_idle() + helper.open_level("Physics", "Base") - def is_enabled(EntityComponentIdPair): - return editor.EditorComponentAPIBus(bus.Broadcast, "IsComponentEnabled", EntityComponentIdPair) + # 2) Create a new entity with components Gradient Transform Modifier and Box Shape + entity_position = math.Vector3(125.0, 136.0, 32.0) + components_to_add = ["Gradient Transform Modifier", "Box Shape"] + gradient_id = editor.ToolsApplicationRequestBus( + bus.Broadcast, "CreateNewEntityAtPosition", entity_position, EntityId.EntityId() + ) + gradient = hydra.Entity("gradient", gradient_id) - # 1) Create level - self.test_success = self.create_level( - self.args["level"], - heightmap_resolution=1024, - heightmap_meters_per_pixel=1, - terrain_texture_resolution=4096, - use_terrain=False, + gradient.components = [] + + for component in components_to_add: + gradient.components.append(hydra.add_component(component, gradient_id)) + entity_created = ( + "Entity created successfully", + "Failed to create entity" + ) + Report.critical_result(entity_created, gradient_id.isValid()) + + # 3) Make sure all components are enabled in Entity + index = 0 + for component in components_to_add: + components_enabled = ( + f"{component} is enabled", + f"{component} is unexpectedly disabled" ) + Report.critical_result(components_enabled, is_enabled(gradient.components[index])) + index += 1 - # 2) Create a new entity with components Gradient Transform Modifier and Box Shape - entity_position = math.Vector3(125.0, 136.0, 32.0) - components_to_add = ["Gradient Transform Modifier", "Box Shape"] - gradient_id = editor.ToolsApplicationRequestBus( - bus.Broadcast, "CreateNewEntityAtPosition", entity_position, EntityId.EntityId() - ) - gradient = hydra.Entity("gradient", gradient_id) + # 4) Add Vegetation Layer Spawner to the same entity + gradient.components.append(hydra.add_component("Vegetation Layer Spawner", gradient_id)) - gradient.components = [] - - for component in components_to_add: - gradient.components.append(hydra.add_component(component, gradient_id)) - if gradient_id.isValid(): - self.log("New Entity Created") - - # 3) Make sure all components are enabled in Entity - index = 0 - for component in components_to_add: - is_enable = is_enabled(gradient.components[index]) - if is_enable: - self.log(f"{component} is Enabled") - self.test_success = self.test_success and is_enable - elif not is_enable: - self.log(f"{component} is Disabled. But It should be Enabled in an Entity") - self.test_success = self.test_success and is_enable - break - index += 1 - - # 4) Add Vegetation Layer Spawner to the same entity - new_component_to_add = "Vegetation Layer Spawner" - index = 2 - gradient.components.append(hydra.add_component(new_component_to_add, gradient_id)) - new_component_enabled = is_enabled(gradient.components[index]) - - # 5) Make sure newly added component is disabled - if not new_component_enabled: - self.log(f"{new_component_to_add} is incompatible and disabled") - self.test_success = self.test_success and not new_component_enabled - elif new_component_enabled: - self.log(f"{new_component_to_add} is compatible and enabled. But It should be Incompatible and disabled") - self.test_success = self.test_success and new_component_enabled + # 5) Make sure newly added component is disabled + spawner_component_disabled = ( + "Spawner component is disabled", + "Spawner component is unexpectedly enabled" + ) + Report.result(spawner_component_disabled, not is_enabled(gradient.components[2])) -test = TestGradientTransform_ComponentIncompatibleWithSpawners() -test.run() +if __name__ == "__main__": + + from editor_python_test_tools.utils import Report + Report.start_test(GradientTransform_ComponentIncompatibleWithSpawners) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientTransform_FrequencyZoomCanBeSetBeyondSliderRange.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientTransform_FrequencyZoomCanBeSetBeyondSliderRange.py index 94647a0b6f..530503db86 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientTransform_FrequencyZoomCanBeSetBeyondSliderRange.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientTransform_FrequencyZoomCanBeSetBeyondSliderRange.py @@ -5,87 +5,82 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ -""" -C3430292: Frequency Zoom can manually be set higher than 8. -""" -import os -import sys - -sys.path.append(os.path.dirname(os.path.abspath(__file__))) -import azlmbr.bus as bus -import azlmbr.editor as editor -import azlmbr.math as math -import azlmbr.paths -import azlmbr.entity as EntityId - -sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests')) -import editor_python_test_tools.hydra_editor_utils as hydra -from editor_python_test_tools.editor_test_helper import EditorTestHelper +class Tests: + entity_created = ( + "Entity created successfully", + "Failed to create entity" + ) + components_added = ( + "All expected components added to entity", + "Failed to add expected components to entity" + ) + higher_zoom_value_set = ( + "Frequency Zoom is equal to expected value", + "Frequency Zoom is not equal to expected value" + ) -class TestGradientTransformFrequencyZoom(EditorTestHelper): - def __init__(self): - EditorTestHelper.__init__(self, log_prefix="GradientTransform_FrequencyZoomBeyondSliders", args=["level"]) +def GradientTransform_FrequencyZoomCanBeSetBeyondSliderRange(): + """ + Summary: + Frequency Zoom can manually be set higher than 8 in a random noise gradient - def run_test(self): - """ - Summary: - Frequency Zoom can manually be set higher than 8 in a random noise gradient + Expected Behavior: + The value properly changes, despite the value being outside of the slider limit - Expected Behavior: - The value properly changes, despite the value being outside of the slider limit + Test Steps: + 1) Open level + 2) Create entity + 3) Add components to the entity + 4) Set the frequency value of the component + 5) Verify if the frequency value is set to higher value - Test Steps: - 1) Open level - 2) Create entity - 3) Add components to the entity - 4) Set the frequency value of the component - 5) Verify if the frequency value is set to higher value + Note: + - This test file must be called from the Open 3D Engine Editor command terminal + - Any passed and failed tests are written to the Editor.log file. + Parsing the file or running a log_monitor are required to observe the test results. - Note: - - This test file must be called from the Open 3D Engine Editor command terminal - - Any passed and failed tests are written to the Editor.log file. - Parsing the file or running a log_monitor are required to observe the test results. + :return: None + """ - :return: None - """ + import azlmbr.bus as bus + import azlmbr.editor as editor + import azlmbr.math as math + import azlmbr.entity as EntityId - # 1) Open level - self.test_success = self.create_level( - self.args["level"], - heightmap_resolution=1024, - heightmap_meters_per_pixel=1, - terrain_texture_resolution=4096, - use_terrain=False, - ) + import editor_python_test_tools.hydra_editor_utils as hydra + from editor_python_test_tools.utils import Report + from editor_python_test_tools.utils import TestHelper as helper - # 2) Create entity - entity_position = math.Vector3(125.0, 136.0, 32.0) - entity_id = editor.ToolsApplicationRequestBus( - bus.Broadcast, "CreateNewEntityAtPosition", entity_position, EntityId.EntityId() - ) - if entity_id.IsValid(): - print("Entity Created") + # 1) Open an existing simple level + helper.init_idle() + helper.open_level("Physics", "Base") - # 3) Add components to the entity - components_to_add = ["Random Noise Gradient", "Gradient Transform Modifier", "Box Shape"] - entity = hydra.Entity("entity", entity_id) - entity.components = [] - for component in components_to_add: - entity.components.append(hydra.add_component(component, entity_id)) - print("Components added to the entity") + # 2) Create entity + entity_position = math.Vector3(125.0, 136.0, 32.0) + entity_id = editor.ToolsApplicationRequestBus( + bus.Broadcast, "CreateNewEntityAtPosition", entity_position, EntityId.EntityId() + ) + Report.critical_result(Tests.entity_created, entity_id.IsValid()) - # 4) Set the frequency value of the component - hydra.get_set_test(entity, 1, "Configuration|Frequency Zoom", 10) + # 3) Add components to the entity + components_to_add = ["Random Noise Gradient", "Gradient Transform Modifier", "Box Shape"] + entity = hydra.Entity("entity", entity_id) + entity.components = [] + for component in components_to_add: + entity.components.append(hydra.add_component(component, entity_id)) + Report.critical_result(Tests.components_added, len(entity.components) == 3) - # 5) Verify if the frequency value is set to higher value - curr_value = hydra.get_component_property_value(entity.components[1], "Configuration|Frequency Zoom") - if curr_value == 10.0: - print("Frequency Zoom is equal to expected value") - else: - print("Frequency Zoom is not equal to expected value") + # 4) Set the frequency value of the component + hydra.get_set_test(entity, 1, "Configuration|Frequency Zoom", 10) + + # 5) Verify if the frequency value is set to higher value + curr_value = hydra.get_component_property_value(entity.components[1], "Configuration|Frequency Zoom") + Report.result(Tests.higher_zoom_value_set, curr_value == 10.0) -test = TestGradientTransformFrequencyZoom() -test.run() +if __name__ == "__main__": + + from editor_python_test_tools.utils import Report + Report.start_test(GradientTransform_FrequencyZoomCanBeSetBeyondSliderRange) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientTransform_RequiresShape.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientTransform_RequiresShape.py index c9cfc225d1..09cce359d5 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientTransform_RequiresShape.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientTransform_RequiresShape.py @@ -4,73 +4,71 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ -import os -import sys - -import azlmbr.bus as bus -import azlmbr.editor as editor -import azlmbr.entity as entity -import azlmbr.paths - -sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests')) -import editor_python_test_tools.hydra_editor_utils as hydra -from editor_python_test_tools.editor_test_helper import EditorTestHelper -class TestGradientTransformRequiresShape(EditorTestHelper): - def __init__(self): - EditorTestHelper.__init__(self, log_prefix="GradientTransformRequiresShape", args=["level"]) - - def run_test(self): - """ - Summary: - This test verifies that the Gradient Transform Modifier component is dependent on a shape component. - - Expected Result: - Gradient Transform Modifier component is disabled until a shape component is added to the entity. - - Test Steps: - 1) Open level - 2) Create a new entity with a Gradient Transform Modifier component - 3) Verify the component is disabled until a shape component is also added to the entity - - Note: - - This test file must be called from the Open 3D Engine Editor command terminal - - Any passed and failed tests are written to the Editor.log file. - Parsing the file or running a log_monitor are required to observe the test results. - - :return: None - """ - # Create a new empty level - self.test_success = self.create_level( - self.args["level"], - heightmap_resolution=1024, - heightmap_meters_per_pixel=1, - terrain_texture_resolution=4096, - use_terrain=False, - ) - - # Create a new Entity in the level - entity_id = editor.ToolsApplicationRequestBus(bus.Broadcast, 'CreateNewEntity', entity.EntityId()) - - # Add a Gradient Transform Component (that will be disabled since there is no shape on the Entity) - gradient_transform_component = hydra.add_component('Gradient Transform Modifier', entity_id) - - # Verify the Gradient Transform Component is not active before adding the Shape - active = editor.EditorComponentAPIBus(bus.Broadcast, 'IsComponentEnabled', gradient_transform_component) - self.test_success = self.test_success and not active - if not active: - self.log("Gradient Transform component is not active without a Shape component on the Entity") - - # Add a Shape component to the same Entity - hydra.add_component('Box Shape', entity_id) - - # Check if the Gradient Transform Component is active now after adding the Shape - active = editor.EditorComponentAPIBus(bus.Broadcast, 'IsComponentEnabled', gradient_transform_component) - self.test_success = self.test_success and active - if active: - self.log("Gradient Transform Modifier component is active now that the Entity has a Shape") +class Tests: + disabled_without_shape = ( + "Gradient Transform Modifier component is disabled without a Shape component on the Entity", + "Gradient Transform Modifier component is unexpectedly enabled without a Shape component on the Entity", + ) + enabled_with_shape = ( + "Gradient Transform Modifier component is enabled now that the Entity has a Shape", + "Gradient Transform Modifier component is still disabled alongside a Shape component", + ) -test = TestGradientTransformRequiresShape() -test.run() +def GradientTransform_RequiresShape(): + """ + Summary: + This test verifies that the Gradient Transform Modifier component is dependent on a shape component. + + Expected Result: + Gradient Transform Modifier component is disabled until a shape component is added to the entity. + + Test Steps: + 1) Open level + 2) Create a new entity with a Gradient Transform Modifier component + 3) Verify the component is disabled until a shape component is also added to the entity + + Note: + - This test file must be called from the Open 3D Engine Editor command terminal + - Any passed and failed tests are written to the Editor.log file. + Parsing the file or running a log_monitor are required to observe the test results. + + :return: None + """ + + import azlmbr.bus as bus + import azlmbr.editor as editor + import azlmbr.entity as entity + + import editor_python_test_tools.hydra_editor_utils as hydra + from editor_python_test_tools.utils import Report + from editor_python_test_tools.utils import TestHelper as helper + + # Open an existing simple level + helper.init_idle() + helper.open_level("Physics", "Base") + + # Create a new Entity in the level + entity_id = editor.ToolsApplicationRequestBus(bus.Broadcast, 'CreateNewEntity', entity.EntityId()) + + # Add a Gradient Transform Component (that will be disabled since there is no shape on the Entity) + gradient_transform_component = hydra.add_component('Gradient Transform Modifier', entity_id) + + # Verify the Gradient Transform Component is not active before adding the Shape + active = editor.EditorComponentAPIBus(bus.Broadcast, 'IsComponentEnabled', gradient_transform_component) + Report.result(Tests.disabled_without_shape, not active) + + # Add a Shape component to the same Entity + hydra.add_component('Box Shape', entity_id) + + # Check if the Gradient Transform Component is active now after adding the Shape + active = editor.EditorComponentAPIBus(bus.Broadcast, 'IsComponentEnabled', gradient_transform_component) + Report.result(Tests.enabled_with_shape, active) + + +if __name__ == "__main__": + + from editor_python_test_tools.utils import Report + Report.start_test(GradientTransform_RequiresShape) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/ImageGradient_ProcessedImageAssignedSuccessfully.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/ImageGradient_ProcessedImageAssignedSuccessfully.py index 1063260550..42458665e1 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/ImageGradient_ProcessedImageAssignedSuccessfully.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/ImageGradient_ProcessedImageAssignedSuccessfully.py @@ -5,89 +5,91 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ -import os -import sys -sys.path.append(os.path.dirname(os.path.abspath(__file__))) -import azlmbr.asset as asset -import azlmbr.bus as bus -import azlmbr.entity as EntityId -import azlmbr.editor as editor -import azlmbr.math as math -import azlmbr.paths - -sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests')) -import editor_python_test_tools.hydra_editor_utils as hydra -from editor_python_test_tools.editor_test_helper import EditorTestHelper +class Tests: + image_gradient_entity_created = ( + "Image Gradient entity created", + "Failed to create Image Gradient entity", + ) + image_gradient_asset_found = ( + "image_grad_test_gsi.png was found in the workspace", + "image_grad_test_gsi.png was not found in the workspace" + ) + image_gradient_assigned = ( + "Successfully assigned image gradient asset", + "Failed to assign image gradient asset" + ) -class TestImageGradient(EditorTestHelper): - def __init__(self): - EditorTestHelper.__init__(self, log_prefix="ImageGradient_ProcessedImageAssignedSucessfully", - args=["level"]) +def ImageGradient_ProcessedImageAssignedSuccessfully(): + """ + Summary: + Level created with Entity having Image Gradient and Gradient Transform Modifier components. + Save any new image to your workspace with the suffix "_gsi" and assign as image asset. - def run_test(self): - """ - Summary: - Level created with Entity having Image Gradient and Gradient Transform Modifier components. - Save any new image to your workspace with the suffix "_gsi" and assign as image asset. - - Expected Behavior: - Image can be assigned as the Image Asset for the Image as Gradient component. + Expected Behavior: + Image can be assigned as the Image Asset for the Image as Gradient component. - Test Steps: - 1) Create level - 2) Create an entity with Image Gradient and Gradient Transform Modifier components. - 3) Assign the newly processed gradient image as Image asset. + Test Steps: + 1) Open a level + 2) Create an entity with Image Gradient and Gradient Transform Modifier components. + 3) Assign the newly processed gradient image as Image asset. - Note: - - This test file must be called from the Open 3D Engine Editor command terminal - - Any passed and failed tests are written to the Editor.log file. - Parsing the file or running a log_monitor are required to observe the test results. + Note: + - This test file must be called from the Open 3D Engine Editor command terminal + - Any passed and failed tests are written to the Editor.log file. + Parsing the file or running a log_monitor are required to observe the test results. - :return: None - """ + :return: None + """ - # 1) Create level - self.test_success = self.create_level( - self.args["level"], - heightmap_resolution=1024, - heightmap_meters_per_pixel=1, - terrain_texture_resolution=4096, - use_terrain=False, - ) + import os - # 2) Create an entity with Image Gradient and Gradient Transform Modifier components - components_to_add = ["Image Gradient", "Gradient Transform Modifier", "Box Shape"] - entity_position = math.Vector3(512.0, 512.0, 32.0) - new_entity_id = editor.ToolsApplicationRequestBus( - bus.Broadcast, "CreateNewEntityAtPosition", entity_position, EntityId.EntityId() - ) - if new_entity_id.IsValid(): - print("Image Gradient Entity created") - image_gradient_entity = hydra.Entity("Image Gradient Entity", new_entity_id) - image_gradient_entity.components = [] - for component in components_to_add: - image_gradient_entity.add_component(component) + import azlmbr.asset as asset + import azlmbr.bus as bus + import azlmbr.entity as EntityId + import azlmbr.editor as editor + import azlmbr.math as math - # 3) Assign the processed gradient signal image as the Image Gradient's image asset and verify success + import editor_python_test_tools.hydra_editor_utils as hydra + from editor_python_test_tools.utils import Report + from editor_python_test_tools.utils import TestHelper as helper - # First, check for the base image in the workspace - base_image = "image_grad_test_gsi.png" - base_image_path = os.path.join("AutomatedTesting", "Assets", "ImageGradients", base_image) - if os.path.isfile(base_image_path): - print(f"{base_image} was found in the workspace") + # 1) Open an existing simple level + helper.init_idle() + helper.open_level("Physics", "Base") - # Next, assign the processed image to the Image Gradient's Image Asset property - processed_image_path = os.path.join("Assets", "ImageGradients", "image_grad_test_gsi.gradimage") - asset_id = asset.AssetCatalogRequestBus(bus.Broadcast, "GetAssetIdByPath", processed_image_path, math.Uuid(), - False) - hydra.get_set_test(image_gradient_entity, 0, "Configuration|Image Asset", asset_id) + # 2) Create an entity with Image Gradient and Gradient Transform Modifier components + components_to_add = ["Image Gradient", "Gradient Transform Modifier", "Box Shape"] + entity_position = math.Vector3(512.0, 512.0, 32.0) + new_entity_id = editor.ToolsApplicationRequestBus( + bus.Broadcast, "CreateNewEntityAtPosition", entity_position, EntityId.EntityId() + ) + Report.critical_result(Tests.image_gradient_entity_created, new_entity_id.IsValid()) + image_gradient_entity = hydra.Entity("Image Gradient Entity", new_entity_id) + image_gradient_entity.components = [] + for component in components_to_add: + image_gradient_entity.add_component(component) - # Finally, verify if the gradient image is assigned as the Image Asset - success = hydra.get_component_property_value(image_gradient_entity.components[0], "Configuration|Image Asset") == asset_id - self.test_success = self.test_success and success + # 3) Assign the processed gradient signal image as the Image Gradient's image asset and verify success + + # First, check for the base image in the workspace + base_image = "image_grad_test_gsi.png" + base_image_path = os.path.join("AutomatedTesting", "Assets", "ImageGradients", base_image) + Report.critical_result(Tests.image_gradient_asset_found, os.path.isfile(base_image_path)) + + # Next, assign the processed image to the Image Gradient's Image Asset property + processed_image_path = os.path.join("Assets", "ImageGradients", "image_grad_test_gsi.gradimage") + asset_id = asset.AssetCatalogRequestBus(bus.Broadcast, "GetAssetIdByPath", processed_image_path, math.Uuid(), + False) + hydra.get_set_test(image_gradient_entity, 0, "Configuration|Image Asset", asset_id) + + # Finally, verify if the gradient image is assigned as the Image Asset + success = hydra.get_component_property_value(image_gradient_entity.components[0], "Configuration|Image Asset") == asset_id + Report.result(Tests.image_gradient_assigned, success) -test = TestImageGradient() -test.run() +if __name__ == "__main__": + + from editor_python_test_tools.utils import Report + Report.start_test(ImageGradient_ProcessedImageAssignedSuccessfully) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/ImageGradient_RequiresShape.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/ImageGradient_RequiresShape.py index 2c6ac8d15b..3b832d160a 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/ImageGradient_RequiresShape.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/ImageGradient_RequiresShape.py @@ -4,74 +4,72 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ -import os -import sys - -import azlmbr.bus as bus -import azlmbr.editor as editor -import azlmbr.entity as entity -import azlmbr.paths - -sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests')) -import editor_python_test_tools.hydra_editor_utils as hydra -from editor_python_test_tools.editor_test_helper import EditorTestHelper -class TestImageGradientRequiresShape(EditorTestHelper): - def __init__(self): - EditorTestHelper.__init__(self, log_prefix="ImageGradientRequiresShape", args=["level"]) - - def run_test(self): - """ - Summary: - This test verifies that the Image Gradient component is dependent on a shape component. - - Expected Result: - Gradient Transform Modifier component is disabled until a shape component is added to the entity. - - Test Steps: - 1) Open level - 2) Create a new entity with a Image Gradient component - 3) Verify the component is disabled until a shape component is also added to the entity - - Note: - - This test file must be called from the Open 3D Engine Editor command terminal - - Any passed and failed tests are written to the Editor.log file. - Parsing the file or running a log_monitor are required to observe the test results. - - :return: None - """ - # Create a new empty level - self.test_success = self.create_level( - self.args["level"], - heightmap_resolution=1024, - heightmap_meters_per_pixel=1, - terrain_texture_resolution=4096, - use_terrain=False, - ) - - # Create a new Entity in the level - entity_id = editor.ToolsApplicationRequestBus(bus.Broadcast, 'CreateNewEntity', entity.EntityId()) - - # Add an Image Gradient and Gradient Transform Component (should be disabled until a Shape exists on the Entity) - image_gradient_component = hydra.add_component('Image Gradient', entity_id) - hydra.add_component('Gradient Transform Modifier', entity_id) - - # Verify the Image Gradient Component is not active before adding the Shape - active = editor.EditorComponentAPIBus(bus.Broadcast, 'IsComponentEnabled', image_gradient_component) - self.test_success = self.test_success and not active - if not active: - self.log("Image Gradient component is not active without a Shape component on the Entity") - - # Add a Shape component to the same Entity - hydra.add_component('Box Shape', entity_id) - - # Check if the Image Gradient Component is active now after adding the Shape - active = editor.EditorComponentAPIBus(bus.Broadcast, 'IsComponentEnabled', image_gradient_component) - self.test_success = self.test_success and active - if active: - self.log("Image Gradient component is active now that the Entity has a Shape") +class Tests: + disabled_without_shape = ( + "Image Gradient component is disabled without a Shape component on the Entity", + "Image Gradient component is unexpectedly enabled without a Shape component on the Entity", + ) + enabled_with_shape = ( + "Image Gradient component is enabled now that the Entity has a Shape", + "Image Gradient component is still disabled alongside a Shape component", + ) -test = TestImageGradientRequiresShape() -test.run() +def ImageGradient_RequiresShape(): + """ + Summary: + This test verifies that the Image Gradient component is dependent on a shape component. + + Expected Result: + Gradient Transform Modifier component is disabled until a shape component is added to the entity. + + Test Steps: + 1) Open level + 2) Create a new entity with a Image Gradient component + 3) Verify the component is disabled until a shape component is also added to the entity + + Note: + - This test file must be called from the Open 3D Engine Editor command terminal + - Any passed and failed tests are written to the Editor.log file. + Parsing the file or running a log_monitor are required to observe the test results. + + :return: None + """ + + import azlmbr.bus as bus + import azlmbr.editor as editor + import azlmbr.entity as entity + + import editor_python_test_tools.hydra_editor_utils as hydra + from editor_python_test_tools.utils import Report + from editor_python_test_tools.utils import TestHelper as helper + + # Open an existing simple level + helper.init_idle() + helper.open_level("Physics", "Base") + + # Create a new Entity in the level + entity_id = editor.ToolsApplicationRequestBus(bus.Broadcast, 'CreateNewEntity', entity.EntityId()) + + # Add an Image Gradient and Gradient Transform Component (should be disabled until a Shape exists on the Entity) + image_gradient_component = hydra.add_component('Image Gradient', entity_id) + hydra.add_component('Gradient Transform Modifier', entity_id) + + # Verify the Image Gradient Component is not active before adding the Shape + active = editor.EditorComponentAPIBus(bus.Broadcast, 'IsComponentEnabled', image_gradient_component) + Report.result(Tests.disabled_without_shape, not active) + + # Add a Shape component to the same Entity + hydra.add_component('Box Shape', entity_id) + + # Check if the Image Gradient Component is active now after adding the Shape + active = editor.EditorComponentAPIBus(bus.Broadcast, 'IsComponentEnabled', image_gradient_component) + Report.result(Tests.enabled_with_shape, active) + + +if __name__ == "__main__": + + from editor_python_test_tools.utils import Report + Report.start_test(ImageGradient_RequiresShape) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/TestSuite_Periodic.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/TestSuite_Periodic.py new file mode 100644 index 0000000000..21eecf642c --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/TestSuite_Periodic.py @@ -0,0 +1,71 @@ +""" +Copyright (c) Contributors to the Open 3D Engine Project. +For complete copyright and license terms please see the LICENSE at the root of this distribution. + +SPDX-License-Identifier: Apache-2.0 OR MIT +""" + +import os +import pytest +import sys + +sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../../automatedtesting_shared') +from base import TestAutomationBase + + +@pytest.mark.SUITE_periodic +@pytest.mark.parametrize("launcher_platform", ['windows_editor']) +@pytest.mark.parametrize("project", ["AutomatedTesting"]) +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) + + 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) + + 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) + + 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) + + 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) + + 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) + + 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) + + 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) + + 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) + + 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) + + 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) + + 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) + + 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) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/TestSuite_Periodic_Optimized.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/TestSuite_Periodic_Optimized.py new file mode 100644 index 0000000000..514504d324 --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/TestSuite_Periodic_Optimized.py @@ -0,0 +1,55 @@ +""" +Copyright (c) Contributors to the Open 3D Engine Project. +For complete copyright and license terms please see the LICENSE at the root of this distribution. + +SPDX-License-Identifier: Apache-2.0 OR MIT +""" + +import pytest + +from ly_test_tools.o3de.editor_test import EditorSingleTest, EditorSharedTest, EditorParallelTest, EditorTestSuite + + +@pytest.mark.SUITE_periodic +@pytest.mark.parametrize("launcher_platform", ['windows_editor']) +@pytest.mark.parametrize("project", ["AutomatedTesting"]) +class TestAutomation(EditorTestSuite): + + class test_GradientGenerators_Incompatibilities(EditorSharedTest): + from .EditorScripts import GradientGenerators_Incompatibilities as test_module + + class test_GradientModifiers_Incompatibilities(EditorSharedTest): + from .EditorScripts import GradientModifiers_Incompatibilities as test_module + + class test_GradientPreviewSettings_DefaultPinnedEntityIsSelf(EditorSharedTest): + from .EditorScripts import GradientPreviewSettings_DefaultPinnedEntityIsSelf as test_module + + class test_GradientPreviewSettings_ClearingPinnedEntitySetsPreviewToOrigin(EditorSharedTest): + from .EditorScripts import GradientPreviewSettings_ClearingPinnedEntitySetsPreviewToOrigin as test_module + + class test_GradientSampling_GradientReferencesAddRemoveSuccessfully(EditorSharedTest): + from .EditorScripts import GradientSampling_GradientReferencesAddRemoveSuccessfully as test_module + + class test_GradientSurfaceTagEmitter_ComponentDependencies(EditorSharedTest): + from .EditorScripts import GradientSurfaceTagEmitter_ComponentDependencies as test_module + + class test_GradientSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully(EditorSharedTest): + from .EditorScripts import GradientSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully as test_module + + class test_GradientTransform_RequiresShape(EditorSharedTest): + from .EditorScripts import GradientTransform_RequiresShape as test_module + + class test_GradientTransform_FrequencyZoomCanBeSetBeyondSliderRange(EditorSharedTest): + from .EditorScripts import GradientTransform_FrequencyZoomCanBeSetBeyondSliderRange as test_module + + class test_GradientTransform_ComponentIncompatibleWithSpawners(EditorSharedTest): + from .EditorScripts import GradientTransform_ComponentIncompatibleWithSpawners as test_module + + class test_GradientTransform_ComponentIncompatibleWithExpectedGradients(EditorSharedTest): + from .EditorScripts import GradientTransform_ComponentIncompatibleWithExpectedGradients as test_module + + class test_ImageGradient_RequiresShape(EditorSharedTest): + from .EditorScripts import ImageGradient_RequiresShape as test_module + + class test_ImageGradient_ProcessedImageAssignedSuccessfully(EditorSharedTest): + from .EditorScripts import ImageGradient_ProcessedImageAssignedSuccessfully as test_module diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/test_GradientIncompatibilities.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/test_GradientIncompatibilities.py deleted file mode 100755 index ec9fb7cb0b..0000000000 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/test_GradientIncompatibilities.py +++ /dev/null @@ -1,103 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - - -""" -Tests that the Gradient Generator components are incompatible with Vegetation Area components -""" - -import os -import pytest -pytest.importorskip('ly_test_tools') - -import ly_test_tools.environment.file_system as file_system -import editor_python_test_tools.hydra_test_utils as hydra - -test_directory = os.path.join(os.path.dirname(__file__), 'EditorScripts') - -gradient_generators = [ - 'Altitude Gradient', - 'Constant Gradient', - 'FastNoise Gradient', - 'Image Gradient', - 'Perlin Noise Gradient', - 'Random Noise Gradient', - 'Shape Falloff Gradient', - 'Slope Gradient', - 'Surface Mask Gradient' -] - -gradient_modifiers = [ - 'Dither Gradient Modifier', - 'Gradient Mixer', - 'Invert Gradient Modifier', - 'Levels Gradient Modifier', - 'Posterize Gradient Modifier', - 'Smooth-Step Gradient Modifier', - 'Threshold Gradient Modifier' -] - -vegetation_areas = [ - 'Vegetation Layer Spawner', - 'Vegetation Layer Blender', - 'Vegetation Layer Blocker', - 'Vegetation Layer Blocker (Mesh)' -] - -all_gradients = gradient_modifiers + gradient_generators - - -@pytest.mark.parametrize('project', ['AutomatedTesting']) -@pytest.mark.parametrize('level', ['tmp_level']) -@pytest.mark.usefixtures("automatic_process_killer") -@pytest.mark.parametrize("launcher_platform", ['windows_editor']) -class TestGradientIncompatibilities(object): - @pytest.fixture(autouse=True) - def setup_teardown(self, request, workspace, project, level): - def teardown(): - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - - request.addfinalizer(teardown) - - @pytest.mark.test_case_id('C2691648', 'C2691649', 'C2691650', 'C2691651', - 'C2691653', 'C2691656', 'C2691657', 'C2691658', - 'C2691647', 'C2691655') - @pytest.mark.SUITE_periodic - def test_GradientGenerators_Incompatibilities(self, request, editor, level, launcher_platform): - cfg_args = [level] - - expected_lines = [] - for gradient_generator in gradient_generators: - for vegetation_area in vegetation_areas: - expected_lines.append(f"{gradient_generator} is disabled before removing {vegetation_area} component") - expected_lines.append(f"{gradient_generator} is enabled after removing {vegetation_area} component") - expected_lines.append("GradientGeneratorIncompatibilities: result=SUCCESS") - hydra.launch_and_validate_results(request, test_directory, editor, - 'GradientGenerators_Incompatibilities.py', - expected_lines=expected_lines, cfg_args=cfg_args) - - @pytest.mark.test_case_id('C3416464', 'C3416546', 'C3961318', 'C3961319', - 'C3961323', 'C3961324', 'C3980656', 'C3980657', - 'C3980661', 'C3980662', 'C3980666', 'C3980667', - 'C2691652') - @pytest.mark.SUITE_periodic - def test_GradientModifiers_Incompatibilities(self, request, editor, level, launcher_platform): - cfg_args = [level] - - expected_lines = [] - for gradient_modifier in gradient_modifiers: - for vegetation_area in vegetation_areas: - expected_lines.append(f"{gradient_modifier} is disabled before removing {vegetation_area} component") - expected_lines.append(f"{gradient_modifier} is enabled after removing {vegetation_area} component") - - for conflicting_gradient in all_gradients: - expected_lines.append(f"{gradient_modifier} is disabled before removing {conflicting_gradient} component") - expected_lines.append(f"{gradient_modifier} is enabled after removing {conflicting_gradient} component") - expected_lines.append("GradientModifiersIncompatibilities: result=SUCCESS") - hydra.launch_and_validate_results(request, test_directory, editor, - 'GradientModifiers_Incompatibilities.py', - expected_lines=expected_lines, cfg_args=cfg_args) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/test_GradientPreviewSettings.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/test_GradientPreviewSettings.py deleted file mode 100755 index f41dd605e6..0000000000 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/test_GradientPreviewSettings.py +++ /dev/null @@ -1,118 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -import os -import pytest - -# Bail on the test if ly_test_tools doesn't exist. -pytest.importorskip('ly_test_tools') -import ly_test_tools.environment.file_system as file_system -import editor_python_test_tools.hydra_test_utils as hydra - -test_directory = os.path.join(os.path.dirname(__file__), 'EditorScripts') - - -@pytest.mark.parametrize('project', ['AutomatedTesting']) -@pytest.mark.parametrize('level', ['tmp_level']) -@pytest.mark.usefixtures("automatic_process_killer") -@pytest.mark.parametrize("launcher_platform", ['windows_editor']) -class TestGradientPreviewSettings(object): - - @pytest.fixture(autouse=True) - def setup_teardown(self, request, workspace, project, level): - def teardown(): - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - request.addfinalizer(teardown) - - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - - @pytest.mark.test_case_id('C3980668', 'C2676825', 'C2676828', 'C2676822', 'C3416547', 'C3961320', 'C3961325', - 'C3980658', 'C3980663') - @pytest.mark.SUITE_periodic - def test_GradientPreviewSettings_DefaultPinnedEntityIsSelf(self, request, editor, level, launcher_platform): - - expected_lines = [ - "Perlin Noise Gradient has Preview pinned to own Entity result: SUCCESS", - "Random Noise Gradient has Preview pinned to own Entity result: SUCCESS", - "FastNoise Gradient has Preview pinned to own Entity result: SUCCESS", - "Dither Gradient Modifier has Preview pinned to own Entity result: SUCCESS", - "Invert Gradient Modifier has Preview pinned to own Entity result: SUCCESS", - "Levels Gradient Modifier has Preview pinned to own Entity result: SUCCESS", - "Posterize Gradient Modifier has Preview pinned to own Entity result: SUCCESS", - "Smooth-Step Gradient Modifier has Preview pinned to own Entity result: SUCCESS", - "Threshold Gradient Modifier has Preview pinned to own Entity result: SUCCESS", - "GradientPreviewSettings_DefaultPinnedEntity: result=SUCCESS" - ] - - hydra.launch_and_validate_results( - request, - test_directory, - editor, - "GradientPreviewSettings_DefaultPinnedEntityIsSelf.py", - expected_lines, - cfg_args=[level] - ) - - @pytest.mark.test_case_id("C2676829", "C3961326", "C3980659", "C3980664", "C3980669", "C3416548", "C2676823", - "C3961321", "C2676826") - @pytest.mark.SUITE_periodic - def test_GradientPreviewSettings_ClearingPinnedEntitySetsPreviewToOrigin(self, request, editor, level, - launcher_platform): - - expected_lines = [ - "Random Noise Gradient entity Created", - "Entity has a Random Noise Gradient component", - "Entity has a Gradient Transform Modifier component", - "Entity has a Box Shape component", - "Random Noise Gradient Preview Settings|Pin Preview to Shape: SUCCESS", - "Random Noise Gradient --- Preview Position set to world origin", - "Random Noise Gradient --- Preview Size set to (1, 1, 1)", - "Levels Gradient Modifier entity Created", - "Entity has a Levels Gradient Modifier component", - "Levels Gradient Modifier Preview Settings|Pin Preview to Shape: SUCCESS", - "Levels Gradient Modifier --- Preview Position set to world origin", - "Posterize Gradient Modifier entity Created", - "Entity has a Posterize Gradient Modifier component", - "Posterize Gradient Modifier Preview Settings|Pin Preview to Shape: SUCCESS", - "Posterize Gradient Modifier --- Preview Position set to world origin", - "Smooth-Step Gradient Modifier entity Created", - "Entity has a Smooth-Step Gradient Modifier component", - "Smooth-Step Gradient Modifier Preview Settings|Pin Preview to Shape: SUCCESS", - "Smooth-Step Gradient Modifier --- Preview Position set to world origin", - "Threshold Gradient Modifier entity Created", - "Entity has a Threshold Gradient Modifier component", - "Threshold Gradient Modifier Preview Settings|Pin Preview to Shape: SUCCESS", - "Threshold Gradient Modifier --- Preview Position set to world origin", - "FastNoise Gradient entity Created", - "Entity has a FastNoise Gradient component", - "FastNoise Gradient Preview Settings|Pin Preview to Shape: SUCCESS", - "FastNoise Gradient --- Preview Position set to world origin", - "FastNoise Gradient --- Preview Size set to (1, 1, 1)", - "Dither Gradient Modifier entity Created", - "Entity has a Dither Gradient Modifier component", - "Dither Gradient Modifier Preview Settings|Pin Preview to Shape: SUCCESS", - "Dither Gradient Modifier --- Preview Position set to world origin", - "Dither Gradient Modifier --- Preview Size set to (1, 1, 1)", - "Invert Gradient Modifier entity Created", - "Entity has a Invert Gradient Modifier component", - "Invert Gradient Modifier Preview Settings|Pin Preview to Shape: SUCCESS", - "Invert Gradient Modifier --- Preview Position set to world origin", - "Perlin Noise Gradient entity Created", - "Entity has a Perlin Noise Gradient component", - "Perlin Noise Gradient Preview Settings|Pin Preview to Shape: SUCCESS", - "Perlin Noise Gradient --- Preview Position set to world origin", - "Perlin Noise Gradient --- Preview Size set to (1, 1, 1)", - ] - - hydra.launch_and_validate_results( - request, - test_directory, - editor, - "GradientPreviewSettings_ClearingPinnedEntitySetsPreviewToOrigin.py", - expected_lines, - cfg_args=[level] - ) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/test_GradientSampling.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/test_GradientSampling.py deleted file mode 100755 index 099a9404e1..0000000000 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/test_GradientSampling.py +++ /dev/null @@ -1,86 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -import os -import pytest -import logging - -# Bail on the test if ly_test_tools doesn't exist. -pytest.importorskip("ly_test_tools") -import ly_test_tools.environment.file_system as file_system -import editor_python_test_tools.hydra_test_utils as hydra - -logger = logging.getLogger(__name__) -test_directory = os.path.join(os.path.dirname(__file__), "EditorScripts") - - -@pytest.mark.parametrize('project', ['AutomatedTesting']) -@pytest.mark.parametrize('level', ['tmp_level']) -@pytest.mark.usefixtures("automatic_process_killer") -@pytest.mark.parametrize("launcher_platform", ['windows_editor']) -class TestGradientSampling(object): - - @pytest.fixture(autouse=True) - def setup_teardown(self, request, workspace, project, level): - def teardown(): - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - request.addfinalizer(teardown) - - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - - @pytest.mark.test_case_id("C3526311") - @pytest.mark.SUITE_periodic - def test_GradientSampling_GradientReferencesAddRemoveSuccessfully(self, request, editor, level, launcher_platform): - - expected_lines = [ - "Entity has a Random Noise Gradient component", - "Entity has a Gradient Transform Modifier component", - "Entity has a Box Shape component", - "Entity has a Dither Gradient Modifier component", - "Gradient Generator is pinned to the Dither Gradient Modifier successfully", - "Gradient Generator is cleared from the Dither Gradient Modifier successfully", - "Entity has a Invert Gradient Modifier component", - "Gradient Generator is pinned to the Invert Gradient Modifier successfully", - "Gradient Generator is cleared from the Invert Gradient Modifier successfully", - "Entity has a Levels Gradient Modifier component", - "Gradient Generator is pinned to the Levels Gradient Modifier successfully", - "Gradient Generator is cleared from the Levels Gradient Modifier successfully", - "Entity has a Posterize Gradient Modifier component", - "Gradient Generator is pinned to the Posterize Gradient Modifier successfully", - "Gradient Generator is cleared from the Posterize Gradient Modifier successfully", - "Entity has a Smooth-Step Gradient Modifier component", - "Gradient Generator is pinned to the Smooth-Step Gradient Modifier successfully", - "Gradient Generator is cleared from the Smooth-Step Gradient Modifier successfully", - "Entity has a Threshold Gradient Modifier component", - "Gradient Generator is pinned to the Threshold Gradient Modifier successfully", - "Gradient Generator is cleared from the Threshold Gradient Modifier successfully", - ] - - unexpected_lines = [ - "Failed to pin Gradient Generator to the Dither Gradient Modifier", - "Failed to clear Gradient Generator from the Dither Gradient Modifier", - "Failed to pin Gradient Generator to the Invert Gradient Modifier", - "Failed to clear Gradient Generator from the Invert Gradient Modifier", - "Failed to pin Gradient Generator to the Levels Gradient Modifier", - "Failed to clear Gradient Generator from the Levels Gradient Modifier", - "Failed to pin Gradient Generator to the Posterize Gradient Modifier", - "Failed to clear Gradient Generator from the Posterize Gradient Modifier", - "Failed to pin Gradient Generator to the Smooth-Step Gradient Modifier", - "Failed to clear Gradient Generator from the Smooth-Step Gradient Modifier", - "Failed to pin Gradient Generator to the Threshold Gradient Modifier", - "Failed to clear Gradient Generator from the Threshold Gradient Modifier", - ] - - hydra.launch_and_validate_results( - request, - test_directory, - editor, - "GradientSampling_GradientReferencesAddRemoveSuccessfully.py", - expected_lines, - unexpected_lines, - cfg_args=[level] - ) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/test_GradientSurfaceTagEmitter.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/test_GradientSurfaceTagEmitter.py deleted file mode 100755 index 6d4a832875..0000000000 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/test_GradientSurfaceTagEmitter.py +++ /dev/null @@ -1,116 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -import os -import pytest -import logging - -# Bail on the test if ly_test_tools doesn't exist. -pytest.importorskip("ly_test_tools") -import ly_test_tools.environment.file_system as file_system -import editor_python_test_tools.hydra_test_utils as hydra - -logger = logging.getLogger(__name__) -test_directory = os.path.join(os.path.dirname(__file__), "EditorScripts") - - -@pytest.mark.parametrize("project", ["AutomatedTesting"]) -@pytest.mark.parametrize("level", ["tmp_level"]) -@pytest.mark.usefixtures("automatic_process_killer") -@pytest.mark.parametrize("launcher_platform", ['windows_editor']) -class TestGradientSurfaceTagEmitter(object): - - @pytest.fixture(autouse=True) - def setup_teardown(self, request, workspace, project, level): - # Cleanup temp level before and after test runs - def teardown(): - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - request.addfinalizer(teardown) - - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - - @pytest.mark.test_case_id("C3297302") - @pytest.mark.SUITE_periodic - def test_GradientSurfaceTagEmitter_ComponentDependencies(self, request, editor, level, workspace, - launcher_platform): - cfg_args = [level] - - expected_lines = [ - "GradientSurfaceTagEmitter_ComponentDependencies: test started", - "GradientSurfaceTagEmitter_ComponentDependencies: Gradient Surface Tag Emitter is Disabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Dither Gradient Modifier and Gradient Surface Tag Emitter are enabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Gradient Mixer and Gradient Surface Tag Emitter are enabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Invert Gradient Modifier and Gradient Surface Tag Emitter are enabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Levels Gradient Modifier and Gradient Surface Tag Emitter are enabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Posterize Gradient Modifier and Gradient Surface Tag Emitter are enabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Smooth-Step Gradient Modifier and Gradient Surface Tag Emitter are enabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Threshold Gradient Modifier and Gradient Surface Tag Emitter are enabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Altitude Gradient and Gradient Surface Tag Emitter are enabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Constant Gradient and Gradient Surface Tag Emitter are enabled", - "GradientSurfaceTagEmitter_ComponentDependencies: FastNoise Gradient and Gradient Surface Tag Emitter are enabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Image Gradient and Gradient Surface Tag Emitter are enabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Perlin Noise Gradient and Gradient Surface Tag Emitter are enabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Random Noise Gradient and Gradient Surface Tag Emitter are enabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Reference Gradient and Gradient Surface Tag Emitter are enabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Shape Falloff Gradient and Gradient Surface Tag Emitter are enabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Slope Gradient and Gradient Surface Tag Emitter are enabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Surface Mask Gradient and Gradient Surface Tag Emitter are enabled", - "GradientSurfaceTagEmitter_ComponentDependencies: result=SUCCESS", - ] - - unexpected_lines = [ - "GradientSurfaceTagEmitter_ComponentDependencies: Gradient Surface Tag Emitter is Enabled, but should be Disabled without dependencies met", - "GradientSurfaceTagEmitter_ComponentDependencies: Dither Gradient Modifier and Gradient Surface Tag Emitter are disabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Gradient Mixer and Gradient Surface Tag Emitter are disabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Invert Gradient Modifier and Gradient Surface Tag Emitter are disabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Levels Gradient Modifier and Gradient Surface Tag Emitter are disabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Posterize Gradient Modifier and Gradient Surface Tag Emitter are disabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Smooth-Step Gradient Modifier and Gradient Surface Tag Emitter are disabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Threshold Gradient Modifier and Gradient Surface Tag Emitter are disabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Altitude Gradient and Gradient Surface Tag Emitter are disabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Constant Gradient and Gradient Surface Tag Emitter are disabled", - "GradientSurfaceTagEmitter_ComponentDependencies: FastNoise Gradient and Gradient Surface Tag Emitter are disabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Image Gradient and Gradient Surface Tag Emitter are disabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Perlin Noise Gradient and Gradient Surface Tag Emitter are disabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Random Noise Gradient and Gradient Surface Tag Emitter are disabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Reference Gradient and Gradient Surface Tag Emitter are disabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Shape Falloff Gradient and Gradient Surface Tag Emitter are disabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Slope Gradient and Gradient Surface Tag Emitter are disabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Surface Mask Gradient and Gradient Surface Tag Emitter are disabled", - ] - - hydra.launch_and_validate_results( - request, - test_directory, - editor, - "GradientSurfaceTagEmitter_ComponentDependencies.py", - expected_lines=expected_lines, - unexpected_lines=unexpected_lines, - cfg_args=cfg_args - ) - - @pytest.mark.test_case_id("C3297303") - @pytest.mark.SUITE_periodic - def test_GradientSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully(self, request, editor, level, - launcher_platform): - - expected_lines = [ - "Entity has a Gradient Surface Tag Emitter component", - "Entity has a Reference Gradient component", - "Added SurfaceTag: container count is 1", - "Removed SurfaceTag: container count is 0", - "GradientSurfaceTagEmitter_SurfaceTagsAddRemoveSucessfully: result=SUCCESS" - ] - - hydra.launch_and_validate_results( - request, - test_directory, - editor, - "GradientSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully.py", - expected_lines, - cfg_args=[level] - ) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/test_GradientTransform.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/test_GradientTransform.py deleted file mode 100755 index 447a548abb..0000000000 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/test_GradientTransform.py +++ /dev/null @@ -1,157 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - - -""" -Tests that the Gradient Transform Modifier component isn't enabled unless it has a component on -the same Entity that provides the ShapeService (e.g. box shape, or reference shape) -""" - -import os -import pytest - -# Bail on the test if ly_test_tools doesn't exist. -pytest.importorskip('ly_test_tools') -import ly_test_tools.environment.file_system as file_system -import editor_python_test_tools.hydra_test_utils as hydra - -test_directory = os.path.join(os.path.dirname(__file__), 'EditorScripts') - - -@pytest.mark.parametrize('project', ['AutomatedTesting']) -@pytest.mark.parametrize('level', ['tmp_level']) -@pytest.mark.usefixtures("automatic_process_killer") -@pytest.mark.parametrize("launcher_platform", ['windows_editor']) -class TestGradientTransformRequiresShape(object): - - @pytest.fixture(autouse=True) - def setup_teardown(self, request, workspace, project, level): - def teardown(): - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - - request.addfinalizer(teardown) - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - - @pytest.mark.test_case_id('C3430289') - @pytest.mark.SUITE_periodic - def test_GradientTransform_RequiresShape(self, request, editor, level, launcher_platform): - - expected_lines = [ - "Gradient Transform Modifier component was added to entity, but the component is disabled", - "Gradient Transform component is not active without a Shape component on the Entity", - "Box Shape component was added to entity", - "Gradient Transform Modifier component is active now that the Entity has a Shape", - "GradientTransformRequiresShape: result=SUCCESS" - ] - - hydra.launch_and_validate_results( - request, - test_directory, - editor, - "GradientTransform_RequiresShape.py", - expected_lines, - cfg_args=[level] - ) - - @pytest.mark.test_case_id("C3430292") - @pytest.mark.SUITE_periodic - def test_GradientTransform_FrequencyZoomCanBeSetBeyondSliderRange(self, request, editor, level, launcher_platform): - - expected_lines = [ - "Entity Created", - "Entity has a Random Noise Gradient component", - "Entity has a Gradient Transform Modifier component", - "Entity has a Box Shape component", - "Components added to the entity", - "entity Configuration|Frequency Zoom: SUCCESS", - "Frequency Zoom is equal to expected value", - ] - - unexpected_lines = ["Frequency Zoom is not equal to expected value"] - - hydra.launch_and_validate_results( - request, - test_directory, - editor, - "GradientTransform_FrequencyZoomCanBeSetBeyondSliderRange.py", - expected_lines, - unexpected_lines=unexpected_lines, - cfg_args=[level] - ) - - @pytest.mark.test_case_id("C3430297") - @pytest.mark.SUITE_periodic - def test_GradientTransform_ComponentIncompatibleWithSpawners(self, request, editor, launcher_platform, level): - # C3430297: Component cannot be active on the same Entity as an active Vegetation Layer Spawner - expected_lines = [ - "Entity has a Gradient Transform Modifier component", - "Entity has a Box Shape component", - "New Entity Created", - "Gradient Transform Modifier is Enabled", - "Box Shape is Enabled", - "Entity has a Vegetation Layer Spawner component", - "Vegetation Layer Spawner is incompatible and disabled", - "GradientTransform_ComponentIncompatibleWithSpawners: result=SUCCESS" - ] - - unexpected_lines = [ - "Gradient Transform Modifier is Disabled. But It should be Enabled in an Entity", - "Box Shape is Disabled. But It should be Enabled in an Entity", - "Vegetation Layer Spawner is compatible and enabled. But It should be Incompatible and disabled", - ] - - hydra.launch_and_validate_results( - request, - test_directory, - editor, - "GradientTransform_ComponentIncompatibleWithSpawners.py", - expected_lines, - unexpected_lines, - cfg_args=[level] - ) - - @pytest.mark.test_case_id("C4753767") - @pytest.mark.SUITE_periodic - def test_GradientTransform_ComponentIncompatibleWithExpectedGradients(self, request, editor, launcher_platform, level): - expected_lines = [ - "Entity has a Gradient Transform Modifier component", - "Entity has a Box Shape component", - "New Entity Created", - "Gradient Transform Modifier is Enabled", - "Box Shape is Enabled", - "Entity has a Constant Gradient component", - "Entity has a Altitude Gradient component", - "Entity has a Gradient Mixer component", - "Entity has a Reference Gradient component", - "Entity has a Shape Falloff Gradient component", - "Entity has a Slope Gradient component", - "Entity has a Surface Mask Gradient component", - "All newly added components are incompatible and disabled", - "GradientTransform_ComponentIncompatibleWithExpectedGradients: result=SUCCESS" - ] - - unexpected_lines = [ - "Gradient Transform Modifier is disabled, but it should be enabled", - "Box Shape is disabled, but it should be enabled", - "Constant Gradient is enabled, but should be disabled", - "Altitude Gradient is enabled, but should be disabled", - "Gradient Mixer is enabled, but should be disabled", - "Reference Gradient is enabled, but should be disabled", - "Shape Falloff Gradient is enabled, but should be disabled", - "Slope Gradient is enabled, but should be disabled", - "Surface Mask Gradient component is enabled, but should be disabled", - ] - - hydra.launch_and_validate_results( - request, - test_directory, - editor, - "GradientTransform_ComponentIncompatibleWithExpectedGradients.py", - expected_lines, - unexpected_lines, - cfg_args=[level] - ) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/test_ImageGradient.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/test_ImageGradient.py deleted file mode 100755 index c4280678ee..0000000000 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/test_ImageGradient.py +++ /dev/null @@ -1,69 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -import os -import pytest - -# Bail on the test if ly_test_tools doesn't exist. -pytest.importorskip('ly_test_tools') -import ly_test_tools.environment.file_system as file_system -import editor_python_test_tools.hydra_test_utils as hydra - -test_directory = os.path.join(os.path.dirname(__file__), 'EditorScripts') - - -@pytest.mark.parametrize('project', ['AutomatedTesting']) -@pytest.mark.parametrize('level', ['tmp_level']) -@pytest.mark.usefixtures("automatic_process_killer") -@pytest.mark.parametrize("launcher_platform", ['windows_editor']) -class TestImageGradientRequiresShape(object): - @pytest.fixture(autouse=True) - def setup_teardown(self, request, workspace, project, level): - def teardown(): - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - - request.addfinalizer(teardown) - - @pytest.mark.test_case_id('C2707570') - @pytest.mark.SUITE_periodic - def test_ImageGradient_RequiresShape(self, request, editor, level, launcher_platform): - cfg_args = [level] - expected_lines = [ - "Image Gradient component was added to entity, but the component is disabled", - "Gradient Transform Modifier component was added to entity, but the component is disabled", - "Image Gradient component is not active without a Shape component on the Entity", - "Box Shape component was added to entity", - "Image Gradient component is active now that the Entity has a Shape", - "ImageGradientRequiresShape: result=SUCCESS" - ] - - hydra.launch_and_validate_results(request, test_directory, editor, - 'ImageGradient_RequiresShape.py', - expected_lines=expected_lines, cfg_args=cfg_args) - - @pytest.mark.test_case_id("C3829430") - @pytest.mark.SUITE_periodic - def test_ImageGradient_ProcessedImageAssignedSuccessfully(self, request, editor, level, launcher_platform): - - expected_lines = [ - "Image Gradient Entity created", - "Entity has a Image Gradient component", - "Entity has a Gradient Transform Modifier component", - "Entity has a Box Shape component", - "image_grad_test_gsi.png was found in the workspace", - "Entity Configuration|Image Asset: SUCCESS", - "ImageGradient_ProcessedImageAssignedSucessfully: result=SUCCESS", - ] - - hydra.launch_and_validate_results( - request, - test_directory, - editor, - "ImageGradient_ProcessedImageAssignedSuccessfully.py", - expected_lines, - cfg_args=[level] - ) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/AreaNodes_DependentComponentsAdded.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/AreaNodes_DependentComponentsAdded.py index 913dc46fa5..9703423901 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/AreaNodes_DependentComponentsAdded.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/AreaNodes_DependentComponentsAdded.py @@ -5,144 +5,147 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ -import os -import sys -import azlmbr.bus as bus -import azlmbr.editor as editor -import azlmbr.editor.graph as graph -import azlmbr.landscapecanvas as landscapecanvas -import azlmbr.legacy.general as general -import azlmbr.math as math -import azlmbr.paths +class Tests: + lc_tool_opened = ( + "Landscape Canvas tool opened", + "Failed to open Landscape Canvas tool" + ) + new_graph_created = ( + "Successfully created new graph", + "Failed to create new graph" + ) + graph_registered = ( + "Graph registered with Landscape Canvas", + "Failed to register graph" + ) + dependencies_added = ( + "Node created new Entity with all required components", + "Failed to create node with all required components" + ) -sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests')) -import editor_python_test_tools.hydra_editor_utils as hydra -from editor_python_test_tools.editor_test_helper import EditorTestHelper -editorId = azlmbr.globals.property.LANDSCAPE_CANVAS_EDITOR_ID newEntityId = None -class TestAreaNodeComponentDependency(EditorTestHelper): - def __init__(self): - EditorTestHelper.__init__(self, log_prefix="AreaNodeComponentDependency", args=["level"]) +def AreaNodes_DependentComponentsAdded(): + """ + Summary: + This test verifies that the Landscape Canvas nodes can be added to a graph, and correctly create entities with + proper dependent components. - def run_test(self): - """ - Summary: - This test verifies that the Landscape Canvas nodes can be added to a graph, and correctly create entities with - proper dependent components. + Expected Behavior: + All expected component dependencies are met when adding an area node to a graph. - Expected Behavior: - All expected component dependencies are met when adding an area node to a graph. + Test Steps: + 1) Open a simple level + 2) Open Landscape Canvas and create a new graph + 3) Drag each of the area nodes to the graph area, and ensure the proper dependent components are added - Test Steps: - 1) Create a new level - 2) Open Landscape Canvas and create a new graph - 3) Drag each of the area nodes to the graph area, and ensure the proper dependent components are added + Note: + - This test file must be called from the Open 3D Engine Editor command terminal + - Any passed and failed tests are written to the Editor.log file. + Parsing the file or running a log_monitor are required to observe the test results. - Note: - - This test file must be called from the Open 3D Engine Editor command terminal - - Any passed and failed tests are written to the Editor.log file. - Parsing the file or running a log_monitor are required to observe the test results. + :return: None + """ - :return: None - """ + import azlmbr.bus as bus + import azlmbr.editor as editor + import azlmbr.editor.graph as graph + import azlmbr.landscapecanvas as landscapecanvas + import azlmbr.legacy.general as general + import azlmbr.math as math - def onEntityCreated(parameters): - global newEntityId - newEntityId = parameters[0] + import editor_python_test_tools.hydra_editor_utils as hydra + from editor_python_test_tools.utils import Report + from editor_python_test_tools.utils import TestHelper as helper - # Create a new empty level - self.test_success = self.create_level( - self.args["level"], - heightmap_resolution=128, - heightmap_meters_per_pixel=1, - terrain_texture_resolution=128, - use_terrain=False, - ) + editorId = azlmbr.globals.property.LANDSCAPE_CANVAS_EDITOR_ID - # Open Landscape Canvas tool and verify - general.open_pane('Landscape Canvas') - self.test_success = self.test_success and general.is_pane_visible('Landscape Canvas') - if general.is_pane_visible('Landscape Canvas'): - self.log('Landscape Canvas pane is open') + def onEntityCreated(parameters): + global newEntityId + newEntityId = parameters[0] - # Create a new graph in Landscape Canvas - newGraphId = graph.AssetEditorRequestBus(bus.Event, 'CreateNewGraph', editorId) - self.test_success = self.test_success and newGraphId - if newGraphId: - self.log("New graph created") + # Open an existing simple level + helper.init_idle() + helper.open_level("Physics", "Base") - # Make sure the graph we created is in Landscape Canvas - success = graph.AssetEditorRequestBus(bus.Event, 'ContainsGraph', editorId, newGraphId) - self.test_success = self.test_success and success - if success: - self.log("Graph registered with Landscape Canvas") + # Open Landscape Canvas tool and verify + general.open_pane('Landscape Canvas') + Report.critical_result(Tests.lc_tool_opened, general.is_pane_visible('Landscape Canvas')) - # Listen for entity creation notifications so we can check if the entity created - # from adding these vegetation area nodes has the main target Vegetation Layer Component - # as well as automatically adding all required dependency components - handler = editor.EditorEntityContextNotificationBusHandler() - handler.connect() - handler.add_callback('OnEditorEntityCreated', onEntityCreated) + # Create a new graph in Landscape Canvas + newGraphId = graph.AssetEditorRequestBus(bus.Event, 'CreateNewGraph', editorId) + Report.critical_result(Tests.new_graph_created, newGraphId is not None) - # Vegetation area mapping with the key being the node name and the value is the - # expected Components that should be added to the Entity created for the node - areas = { - 'SpawnerAreaNode': [ - 'Vegetation Layer Spawner', - 'Vegetation Asset List', - 'Vegetation Reference Shape' - ], - 'MeshBlockerAreaNode': [ - 'Vegetation Layer Blocker (Mesh)', - 'Mesh' - ], - 'BlockerAreaNode': [ - 'Vegetation Layer Blocker', - 'Vegetation Reference Shape' - ] - } + # Make sure the graph we created is in Landscape Canvas + graph_registered = graph.AssetEditorRequestBus(bus.Event, 'ContainsGraph', editorId, newGraphId) + Report.result(Tests.graph_registered, graph_registered) - # Retrieve a mapping of the TypeIds for all the components - # we will be checking for - componentNames = [] - for name in areas: - componentNames.extend(areas[name]) - componentTypeIds = hydra.get_component_type_id_map(componentNames) + # Listen for entity creation notifications so we can check if the entity created + # from adding these vegetation area nodes has the main target Vegetation Layer Component + # as well as automatically adding all required dependency components + handler = editor.EditorEntityContextNotificationBusHandler() + handler.connect() + handler.add_callback('OnEditorEntityCreated', onEntityCreated) - # Create nodes for the vegetation areas that have additional required dependencies and check if - # the Entity created by adding the node has the appropriate component and required - # additional components added automatically to it - newGraph = graph.GraphManagerRequestBus(bus.Broadcast, 'GetGraph', newGraphId) - x = 10.0 - y = 10.0 - for nodeName in areas: - nodePosition = math.Vector2(x, y) - node = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, 'CreateNodeForTypeName', - newGraph, nodeName) - graph.GraphControllerRequestBus(bus.Event, 'AddNode', newGraphId, node, nodePosition) + # Vegetation area mapping with the key being the node name and the value is the + # expected Components that should be added to the Entity created for the node + areas = { + 'SpawnerAreaNode': [ + 'Vegetation Layer Spawner', + 'Vegetation Asset List', + 'Vegetation Reference Shape' + ], + 'MeshBlockerAreaNode': [ + 'Vegetation Layer Blocker (Mesh)', + 'Mesh' + ], + 'BlockerAreaNode': [ + 'Vegetation Layer Blocker', + 'Vegetation Reference Shape' + ] + } - components = areas[nodeName] - success = False - for component in components: - componentTypeId = componentTypeIds[component] - success = editor.EditorComponentAPIBus(bus.Broadcast, 'HasComponentOfType', newEntityId, - componentTypeId) - if not success: - break - self.test_success = self.test_success and success - if success: - self.log("{node} created new Entity with all required components".format(node=nodeName)) + # Retrieve a mapping of the TypeIds for all the components + # we will be checking for + componentNames = [] + for name in areas: + componentNames.extend(areas[name]) + componentTypeIds = hydra.get_component_type_id_map(componentNames) - x += 40.0 - y += 40.0 + # Create nodes for the vegetation areas that have additional required dependencies and check if + # the Entity created by adding the node has the appropriate component and required + # additional components added automatically to it + newGraph = graph.GraphManagerRequestBus(bus.Broadcast, 'GetGraph', newGraphId) + x = 10.0 + y = 10.0 + for nodeName in areas: + nodePosition = math.Vector2(x, y) + node = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, 'CreateNodeForTypeName', + newGraph, nodeName) + graph.GraphControllerRequestBus(bus.Event, 'AddNode', newGraphId, node, nodePosition) - # Stop listening for entity creation notifications - handler.disconnect() + components = areas[nodeName] + success = False + for component in components: + componentTypeId = componentTypeIds[component] + success = editor.EditorComponentAPIBus(bus.Broadcast, 'HasComponentOfType', newEntityId, + componentTypeId) + if not success: + break + Report.info(nodeName) + Report.result(Tests.dependencies_added, success) + + x += 40.0 + y += 40.0 + + # Stop listening for entity creation notifications + handler.disconnect() -test = TestAreaNodeComponentDependency() -test.run() +if __name__ == "__main__": + + from editor_python_test_tools.utils import Report + Report.start_test(AreaNodes_DependentComponentsAdded) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/AreaNodes_EntityCreatedOnNodeAdd.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/AreaNodes_EntityCreatedOnNodeAdd.py index 2ee0c60a7d..f3f4a1862d 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/AreaNodes_EntityCreatedOnNodeAdd.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/AreaNodes_EntityCreatedOnNodeAdd.py @@ -5,125 +5,129 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ -import os -import sys -import azlmbr.bus as bus -import azlmbr.editor as editor -import azlmbr.editor.graph as graph -import azlmbr.landscapecanvas as landscapecanvas -import azlmbr.legacy.general as general -import azlmbr.math as math -import azlmbr.paths +class Tests: + lc_tool_opened = ( + "Landscape Canvas tool opened", + "Failed to open Landscape Canvas tool" + ) + new_graph_created = ( + "Successfully created new graph", + "Failed to create new graph" + ) + graph_registered = ( + "Graph registered with Landscape Canvas", + "Failed to register graph" + ) + component_added = ( + "New entity created with the expected component", + "Expected component was not found on entity" + ) -sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests')) -import editor_python_test_tools.hydra_editor_utils as hydra -from editor_python_test_tools.editor_test_helper import EditorTestHelper -editorId = azlmbr.globals.property.LANDSCAPE_CANVAS_EDITOR_ID newEntityId = None -class TestGradientNodeEntityCreate(EditorTestHelper): - def __init__(self): - EditorTestHelper.__init__(self, log_prefix="AreaNodeEntityCreate", args=["level"]) +def AreaNodes_EntityCreatedOnNodeAdd(): + """ + Summary: + This test verifies that the Landscape Canvas nodes can be added to a graph, and correctly create entities. - def run_test(self): - """ - Summary: - This test verifies that the Landscape Canvas nodes can be added to a graph, and correctly create entities. + Expected Behavior: + New entities are created when dragging area nodes to graph area. - Expected Behavior: - New entities are created when dragging area nodes to graph area. + Test Steps: + 1) Open a simple level + 2) Open Landscape Canvas and create a new graph + 3) Drag each of the area nodes to the graph area, and ensure a new entity is created - Test Steps: - 1) Create a new level - 2) Open Landscape Canvas and create a new graph - 3) Drag each of the area nodes to the graph area, and ensure a new entity is created + Note: + - This test file must be called from the Open 3D Engine Editor command terminal + - Any passed and failed tests are written to the Editor.log file. + Parsing the file or running a log_monitor are required to observe the test results. - Note: - - This test file must be called from the Open 3D Engine Editor command terminal - - Any passed and failed tests are written to the Editor.log file. - Parsing the file or running a log_monitor are required to observe the test results. + :return: None + """ - :return: None - """ - def onEntityCreated(parameters): - global newEntityId - newEntityId = parameters[0] + import azlmbr.bus as bus + import azlmbr.editor as editor + import azlmbr.editor.graph as graph + import azlmbr.landscapecanvas as landscapecanvas + import azlmbr.legacy.general as general + import azlmbr.math as math - # Create a new empty level - self.test_success = self.create_level( - self.args["level"], - heightmap_resolution=128, - heightmap_meters_per_pixel=1, - terrain_texture_resolution=128, - use_terrain=False, - ) + import editor_python_test_tools.hydra_editor_utils as hydra + from editor_python_test_tools.utils import Report + from editor_python_test_tools.utils import TestHelper as helper - # Open Landscape Canvas tool and verify - general.open_pane('Landscape Canvas') - self.test_success = self.test_success and general.is_pane_visible('Landscape Canvas') - if general.is_pane_visible('Landscape Canvas'): - self.log('Landscape Canvas pane is open') + editorId = azlmbr.globals.property.LANDSCAPE_CANVAS_EDITOR_ID - # Create a new graph in Landscape Canvas - newGraphId = graph.AssetEditorRequestBus(bus.Event, 'CreateNewGraph', editorId) - self.test_success = self.test_success and newGraphId - if newGraphId: - self.log("New graph created") + def onEntityCreated(parameters): + global newEntityId + newEntityId = parameters[0] - # Make sure the graph we created is in Landscape Canvas - success = graph.AssetEditorRequestBus(bus.Event, 'ContainsGraph', editorId, newGraphId) - self.test_success = self.test_success and success - if success: - self.log("Graph registered with Landscape Canvas") + # Open an existing simple level + helper.init_idle() + helper.open_level("Physics", "Base") - # Listen for entity creation notifications so we can check if the entity created - # from adding vegetation area nodes has the appropriate Vegetation Layer Component - handler = editor.EditorEntityContextNotificationBusHandler() - handler.connect() - handler.add_callback('OnEditorEntityCreated', onEntityCreated) + # Open Landscape Canvas tool and verify + general.open_pane('Landscape Canvas') + Report.critical_result(Tests.lc_tool_opened, general.is_pane_visible('Landscape Canvas')) - # Vegetation Area mapping with the key being the node name and the value is the - # expected Component that should be added to the Entity created for the node - areas = { - 'AreaBlenderNode': 'Vegetation Layer Blender', - 'BlockerAreaNode': 'Vegetation Layer Blocker', - 'MeshBlockerAreaNode': 'Vegetation Layer Blocker (Mesh)', - 'SpawnerAreaNode': 'Vegetation Layer Spawner' - } + # Create a new graph in Landscape Canvas + newGraphId = graph.AssetEditorRequestBus(bus.Event, 'CreateNewGraph', editorId) + Report.critical_result(Tests.new_graph_created, newGraphId is not None) - # Retrieve a mapping of the TypeIds for all the components - # we will be checking for - componentNames = [] - for name in areas: - componentNames.append(areas[name]) - componentTypeIds = hydra.get_component_type_id_map(componentNames) + # Make sure the graph we created is in Landscape Canvas + graph_registered = graph.AssetEditorRequestBus(bus.Event, 'ContainsGraph', editorId, newGraphId) + Report.result(Tests.graph_registered, graph_registered) - # Create nodes for all the vegetation areas we support and check if the Entity created by - # adding the node has the appropriate Component added automatically to it - newGraph = graph.GraphManagerRequestBus(bus.Broadcast, 'GetGraph', newGraphId) - x = 10.0 - y = 10.0 - for nodeName in areas: - nodePosition = math.Vector2(x, y) - node = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, 'CreateNodeForTypeName', newGraph, nodeName) - graph.GraphControllerRequestBus(bus.Event, 'AddNode', newGraphId, node, nodePosition) + # Listen for entity creation notifications so we can check if the entity created + # from adding vegetation area nodes has the appropriate Vegetation Layer Component + handler = editor.EditorEntityContextNotificationBusHandler() + handler.connect() + handler.add_callback('OnEditorEntityCreated', onEntityCreated) - areaComponent = areas[nodeName] - componentTypeId = componentTypeIds[areaComponent] - hasComponent = editor.EditorComponentAPIBus(bus.Broadcast, 'HasComponentOfType', newEntityId, componentTypeId) - self.test_success = self.test_success and hasComponent - if hasComponent: - self.log("{node} created new Entity with {component} Component".format(node=nodeName, component=areaComponent)) + # Vegetation Area mapping with the key being the node name and the value is the + # expected Component that should be added to the Entity created for the node + areas = { + 'AreaBlenderNode': 'Vegetation Layer Blender', + 'BlockerAreaNode': 'Vegetation Layer Blocker', + 'MeshBlockerAreaNode': 'Vegetation Layer Blocker (Mesh)', + 'SpawnerAreaNode': 'Vegetation Layer Spawner' + } - x += 40.0 - y += 40.0 + # Retrieve a mapping of the TypeIds for all the components + # we will be checking for + componentNames = [] + for name in areas: + componentNames.append(areas[name]) + componentTypeIds = hydra.get_component_type_id_map(componentNames) - # Stop listening for entity creation notifications - handler.disconnect() + # Create nodes for all the vegetation areas we support and check if the Entity created by + # adding the node has the appropriate Component added automatically to it + newGraph = graph.GraphManagerRequestBus(bus.Broadcast, 'GetGraph', newGraphId) + x = 10.0 + y = 10.0 + for nodeName in areas: + nodePosition = math.Vector2(x, y) + node = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, 'CreateNodeForTypeName', newGraph, nodeName) + graph.GraphControllerRequestBus(bus.Event, 'AddNode', newGraphId, node, nodePosition) + + areaComponent = areas[nodeName] + componentTypeId = componentTypeIds[areaComponent] + hasComponent = editor.EditorComponentAPIBus(bus.Broadcast, 'HasComponentOfType', newEntityId, componentTypeId) + Report.info(f"Node: {nodeName} | Component: {areaComponent}") + Report.result(Tests.component_added, hasComponent) + + x += 40.0 + y += 40.0 + + # Stop listening for entity creation notifications + handler.disconnect() -test = TestGradientNodeEntityCreate() -test.run() +if __name__ == "__main__": + + from editor_python_test_tools.utils import Report + Report.start_test(AreaNodes_EntityCreatedOnNodeAdd) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/AreaNodes_EntityRemovedOnNodeDelete.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/AreaNodes_EntityRemovedOnNodeDelete.py index b9960447c6..f8b0539759 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/AreaNodes_EntityRemovedOnNodeDelete.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/AreaNodes_EntityRemovedOnNodeDelete.py @@ -5,123 +5,128 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ -import os -import sys -import azlmbr.bus as bus -import azlmbr.editor as editor -import azlmbr.editor.graph as graph -import azlmbr.landscapecanvas as landscapecanvas -import azlmbr.legacy.general as general -import azlmbr.math as math -import azlmbr.paths +class Tests: + lc_tool_opened = ( + "Landscape Canvas tool opened", + "Failed to open Landscape Canvas tool" + ) + new_graph_created = ( + "Successfully created new graph", + "Failed to create new graph" + ) + graph_registered = ( + "Graph registered with Landscape Canvas", + "Failed to register graph" + ) + entity_deleted = ( + "Entity was deleted when node was removed", + "Entity was not deleted as expected when node was removed" + ) -sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests')) -from editor_python_test_tools.editor_test_helper import EditorTestHelper -editorId = azlmbr.globals.property.LANDSCAPE_CANVAS_EDITOR_ID createdEntityId = None deletedEntityId = None -class TestAreaNodeEntityDelete(EditorTestHelper): +def AreaNodes_EntityRemovedOnNodeDelete(): + """ + Summary: + This test verifies that the Landscape Canvas node deletion properly cleans up entities in the Editor. - def __init__(self): - EditorTestHelper.__init__(self, log_prefix="AreaNodeEntityDelete", args=["level"]) + Expected Behavior: + Entities are removed when area nodes are deleted from a graph. - def run_test(self): - """ - Summary: - This test verifies that the Landscape Canvas node deletion properly cleans up entities in the Editor. + Test Steps: + 1) Open a simple level + 2) Open Landscape Canvas and create a new graph + 3) Drag each of the area nodes to the graph area, and ensure a new entity is created + 4) Delete the nodes, and ensure the newly created entities are removed - Expected Behavior: - Entities are removed when area nodes are deleted from a graph. + Note: + - This test file must be called from the Open 3D Engine Editor command terminal + - Any passed and failed tests are written to the Editor.log file. + Parsing the file or running a log_monitor are required to observe the test results. - Test Steps: - 1) Create a new level - 2) Open Landscape Canvas and create a new graph - 3) Drag each of the area nodes to the graph area, and ensure a new entity is created - 4) Delete the nodes, and ensure the newly created entities are removed + :return: None + """ - Note: - - This test file must be called from the Open 3D Engine Editor command terminal - - Any passed and failed tests are written to the Editor.log file. - Parsing the file or running a log_monitor are required to observe the test results. + import azlmbr.bus as bus + import azlmbr.editor as editor + import azlmbr.editor.graph as graph + import azlmbr.landscapecanvas as landscapecanvas + import azlmbr.legacy.general as general + import azlmbr.math as math + import azlmbr.paths - :return: None - """ - def onEntityCreated(parameters): - global createdEntityId - createdEntityId = parameters[0] + from editor_python_test_tools.utils import Report + from editor_python_test_tools.utils import TestHelper as helper - def onEntityDeleted(parameters): - global deletedEntityId - deletedEntityId = parameters[0] + editorId = azlmbr.globals.property.LANDSCAPE_CANVAS_EDITOR_ID - # Create a new empty level - self.test_success = self.create_level( - self.args["level"], - heightmap_resolution=128, - heightmap_meters_per_pixel=1, - terrain_texture_resolution=128, - use_terrain=False, - ) + def onEntityCreated(parameters): + global createdEntityId + createdEntityId = parameters[0] - # Open Landscape Canvas tool and verify - general.open_pane('Landscape Canvas') - self.test_success = self.test_success and general.is_pane_visible('Landscape Canvas') - if general.is_pane_visible('Landscape Canvas'): - self.log('Landscape Canvas pane is open') + def onEntityDeleted(parameters): + global deletedEntityId + deletedEntityId = parameters[0] - # Create a new graph in Landscape Canvas - newGraphId = graph.AssetEditorRequestBus(bus.Event, 'CreateNewGraph', editorId) - self.test_success = self.test_success and newGraphId - if newGraphId: - self.log("New graph created") + # Open an existing simple level + helper.init_idle() + helper.open_level("Physics", "Base") - # Make sure the graph we created is in Landscape Canvas - success = graph.AssetEditorRequestBus(bus.Event, 'ContainsGraph', editorId, newGraphId) - self.test_success = self.test_success and success - if success: - self.log("Graph registered with Landscape Canvas") + # Open Landscape Canvas tool and verify + general.open_pane('Landscape Canvas') + Report.critical_result(Tests.lc_tool_opened, general.is_pane_visible('Landscape Canvas')) - # Listen for entity creation notifications so we can check if the entity created - # from adding gradient nodes has the appropriate Gradient Component - handler = editor.EditorEntityContextNotificationBusHandler() - handler.connect() - handler.add_callback('OnEditorEntityCreated', onEntityCreated) - handler.add_callback('OnEditorEntityDeleted', onEntityDeleted) + # Create a new graph in Landscape Canvas + newGraphId = graph.AssetEditorRequestBus(bus.Event, 'CreateNewGraph', editorId) + Report.critical_result(Tests.new_graph_created, newGraphId is not None) - # Vegetation Area mapping with the key being the node name and the value is the - # expected Component that should be added to the Entity created for the node - areas = [ - 'AreaBlenderNode', - 'BlockerAreaNode', - 'MeshBlockerAreaNode', - 'SpawnerAreaNode', - ] + # Make sure the graph we created is in Landscape Canvas + graph_registered = graph.AssetEditorRequestBus(bus.Event, 'ContainsGraph', editorId, newGraphId) + Report.result(Tests.graph_registered, graph_registered) - # Create nodes for all the gradients we support and check if the Entity created by - # adding the node has the appropriate Component added automatically to it - newGraph = graph.GraphManagerRequestBus(bus.Broadcast, 'GetGraph', newGraphId) - x = 10.0 - y = 10.0 - for nodeName in areas: - nodePosition = math.Vector2(x, y) - node = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, 'CreateNodeForTypeName', newGraph, nodeName) - graph.GraphControllerRequestBus(bus.Event, 'AddNode', newGraphId, node, nodePosition) + # Listen for entity creation notifications so we can check if the entity created + # from adding gradient nodes has the appropriate Gradient Component + handler = editor.EditorEntityContextNotificationBusHandler() + handler.connect() + handler.add_callback('OnEditorEntityCreated', onEntityCreated) + handler.add_callback('OnEditorEntityDeleted', onEntityDeleted) - removed = graph.GraphControllerRequestBus(bus.Event, 'RemoveNode', newGraphId, node) + # Vegetation Area mapping with the key being the node name and the value is the + # expected Component that should be added to the Entity created for the node + areas = [ + 'AreaBlenderNode', + 'BlockerAreaNode', + 'MeshBlockerAreaNode', + 'SpawnerAreaNode', + ] - # Verify that the created Entity for this node matches the Entity that gets - # deleted when the node is removed - self.test_success = self.test_success and removed and createdEntityId.invoke("Equal", deletedEntityId) - if removed and createdEntityId.invoke("Equal", deletedEntityId): - self.log("{node} corresponding Entity was deleted when node is removed".format(node=nodeName)) + # Create nodes for all the gradients we support and check if the Entity created by + # adding the node has the appropriate Component added automatically to it + newGraph = graph.GraphManagerRequestBus(bus.Broadcast, 'GetGraph', newGraphId) + x = 10.0 + y = 10.0 + for nodeName in areas: + nodePosition = math.Vector2(x, y) + node = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, 'CreateNodeForTypeName', newGraph, + nodeName) + graph.GraphControllerRequestBus(bus.Event, 'AddNode', newGraphId, node, nodePosition) - # Stop listening for entity creation notifications - handler.disconnect() + removed = graph.GraphControllerRequestBus(bus.Event, 'RemoveNode', newGraphId, node) + + # Verify that the created Entity for this node matches the Entity that gets + # deleted when the node is removed + Report.info(f"Node: {nodeName}") + Report.result(Tests.entity_deleted, removed and createdEntityId.invoke("Equal", deletedEntityId)) + + # Stop listening for entity creation notifications + handler.disconnect() -test = TestAreaNodeEntityDelete() -test.run() +if __name__ == "__main__": + + from editor_python_test_tools.utils import Report + Report.start_test(AreaNodes_EntityRemovedOnNodeDelete) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/ComponentUpdates_UpdateGraph.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/ComponentUpdates_UpdateGraph.py index a704cc9dab..cc40d8b861 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/ComponentUpdates_UpdateGraph.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/ComponentUpdates_UpdateGraph.py @@ -5,197 +5,209 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ -import os -import sys -import azlmbr.asset as asset -import azlmbr.bus as bus -import azlmbr.editor as editor -import azlmbr.entity as entity -import azlmbr.legacy.general as general -import azlmbr.landscapecanvas as landscapecanvas -import azlmbr.math as math -import azlmbr.slice as slice -import azlmbr.paths - -sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests')) -import editor_python_test_tools.hydra_editor_utils as hydra -from editor_python_test_tools.editor_test_helper import EditorTestHelper +class Tests: + slice_instantiated = ( + "Slice instantiated successfully", + "Failed to instantiate slice" + ) + lc_entity_found = ( + "LandscapeCanvas entity found", + "Failed to find LandscapeCanvas entity" + ) + spawner_entity_found = ( + "BushSpawner entity found", + "Failed to find BushSpawner entity" + ) + dist_filter_component_found = ( + "Vegetation Distribution Filter component on BushSpawner entity found", + "Failed to find Distribution Filter component on BushSpawner entity" + ) + existing_graph_opened = ( + "Opened existing graph from slice", + "Failed to open existing graph" + ) + dist_filter_node_found = ( + "Vegetation Distribution Filter node found on graph", + "Failed to find Distribution Filter node on graph" + ) + alt_filter_component_found = ( + "Vegetation Altitude Filter component on BushSpawner entity found", + "Failed to find Altitude Filter component on BushSpawner entity" + ) + alt_filter_node_found = ( + "Vegetation Altitude Filter node found on graph", + "Failed to find Altitude Filter node on graph" + ) + dist_filter_component_removed = ( + "Vegetation Distribution Filter component removed from BushSpawner entity", + "Failed to remove Distribution Filter component from BushSpawner entity" + ) + dist_filter_node_removed = ( + "Vegetation Distribution Filter node removed from graph", + "Failed to remove Distribution Filter node from graph" + ) + child_entity_added = ( + "New entity successfully added as a child of the BushSpawner entity", + "New entity added with an unexpected parent" + ) + box_shape_component_found = ( + "Box Shape component on Box entity found", + "Failed to find Box Shape component on Box entity" + ) + box_shape_node_found = ( + "Box Shape node found on graph", + "Failed to find Box Shape node on graph" + ) -class TestComponentUpdatesUpdateGraph(EditorTestHelper): - def __init__(self): - EditorTestHelper.__init__(self, log_prefix="ComponentUpdatesUpdateGraph", args=["level"]) +def ComponentUpdates_UpdateGraph(): + """ + Summary: + This test verifies that the Landscape Canvas graphs update properly when components are added/removed outside of + Landscape Canvas. - def run_test(self): - """ - Summary: - This test verifies that the Landscape Canvas graphs update properly when components are added/removed outside of - Landscape Canvas. + Expected Behavior: + Graphs properly reflect component changes made to entities outside of Landscape Canvas. - Expected Behavior: - Graphs properly reflect component changes made to entities outside of Landscape Canvas. + Test Steps: + 1. Open Level + 2. Find LandscapeCanvas named entity + 3. Ensure Vegetation Distribution Component is present on the BushSpawner entity + 4. Open graph and ensure Distribution Filter wrapped node is present + 5. Delete the Vegetation Distribution Filter component from the BushSpawner entity via Entity Inspector + 6. Ensure the Vegetation Distribution Filter component was deleted from the BushSpawner entity and node is + no longer present in the graph + 7. Add Vegetation Altitude Filter to the BushSpawner entity through Entity Inspector + 8. Ensure Altitude Filter was added to the BushSpawner node in the open graph + 9. Add a new entity with unique name as a child of the Landscape Canvas entity + 10. Add a Box Shape component to the new child entity + 11. Ensure Box Shape node is present on the open graph - Test Steps: - 1. Open Level - 2. Find LandscapeCanvas named entity - 3. Ensure Vegetation Distribution Component is present on the BushSpawner entity - 4. Open graph and ensure Distribution Filter wrapped node is present - 5. Delete the Vegetation Distribution Filter component from the BushSpawner entity via Entity Inspector - 6. Ensure the Vegetation Distribution Filter component was deleted from the BushSpawner entity and node is - no longer present in the graph - 7. Add Vegetation Altitude Filter to the BushSpawner entity through Entity Inspector - 8. Ensure Altitude Filter was added to the BushSpawner node in the open graph - 9. Add a new entity with unique name as a child of the Landscape Canvas entity - 10. Add a Box Shape component to the new child entity - 11. Ensure Box Shape node is present on the open graph + Note: + - This test file must be called from the Open 3D Engine Editor command terminal + - Any passed and failed tests are written to the Editor.log file. + Parsing the file or running a log_monitor are required to observe the test results. - Note: - - This test file must be called from the Open 3D Engine Editor command terminal - - Any passed and failed tests are written to the Editor.log file. - Parsing the file or running a log_monitor are required to observe the test results. + :return: None + """ - :return: None - """ + import os - # Create a new empty level and instantiate LC_BushFlowerBlender.slice - self.test_success = self.create_level( - self.args["level"], - heightmap_resolution=128, - heightmap_meters_per_pixel=1, - terrain_texture_resolution=128, - use_terrain=False, - ) - transform = math.Transform_CreateIdentity() - position = math.Vector3(64.0, 64.0, 32.0) - transform.invoke('SetPosition', position) - test_slice_path = os.path.join("Slices", "LC_BushFlowerBlender.slice") - test_slice_id = asset.AssetCatalogRequestBus(bus.Broadcast, "GetAssetIdByPath", test_slice_path, math.Uuid(), - False) - test_slice = slice.SliceRequestBus(bus.Broadcast, 'InstantiateSliceFromAssetId', test_slice_id, transform) - self.test_success = self.test_success and test_slice.IsValid() - if test_slice.IsValid(): - self.log("Slice spawned!") + import azlmbr.asset as asset + import azlmbr.bus as bus + import azlmbr.editor as editor + import azlmbr.entity as entity + import azlmbr.legacy.general as general + import azlmbr.landscapecanvas as landscapecanvas + import azlmbr.math as math + import azlmbr.slice as slice - # Find root entity in the loaded level - search_filter = entity.SearchFilter() - search_filter.names = ["LandscapeCanvas"] + import editor_python_test_tools.hydra_editor_utils as hydra + from editor_python_test_tools.utils import Report + from editor_python_test_tools.utils import TestHelper as helper - # Allow a few seconds for matching entity to be found - self.wait_for_condition(lambda: len(entity.SearchBus(bus.Broadcast, 'SearchEntities', search_filter)) > 0, 5.0) - lc_matching_entities = entity.SearchBus(bus.Broadcast, 'SearchEntities', search_filter) - slice_root_id = lc_matching_entities[0] #Entity with Landscape Canvas component - self.test_success = self.test_success and slice_root_id.IsValid() - if slice_root_id.IsValid(): - self.log("LandscapeCanvas entity found") + # Open a simple level and instantiate LC_BushFlowerBlender.slice + helper.init_idle() + helper.open_level("Physics", "Base") + transform = math.Transform_CreateIdentity() + position = math.Vector3(64.0, 64.0, 32.0) + transform.invoke('SetPosition', position) + test_slice_path = os.path.join("Slices", "LC_BushFlowerBlender.slice") + test_slice_id = asset.AssetCatalogRequestBus(bus.Broadcast, "GetAssetIdByPath", test_slice_path, math.Uuid(), + False) + test_slice = slice.SliceRequestBus(bus.Broadcast, 'InstantiateSliceFromAssetId', test_slice_id, transform) + Report.critical_result(Tests.slice_instantiated, test_slice.IsValid()) - # Find the BushSpawner entity - search_filter.names = ["BushSpawner"] - spawner_matching_entities = entity.SearchBus(bus.Broadcast, 'SearchEntities', search_filter) - spawner_id = spawner_matching_entities[0] #Entity with Vegetation Layer Spawner component - self.test_success = self.test_success and spawner_id.IsValid() - if spawner_id.IsValid(): - self.log("BushSpawner entity found") + # Find root entity in the loaded level + search_filter = entity.SearchFilter() + search_filter.names = ["LandscapeCanvas"] - # Get needed component type ids - distribution_filter_type_id = hydra.get_component_type_id("Vegetation Distribution Filter") - altitude_filter_type_id = hydra.get_component_type_id("Vegetation Altitude Filter") - box_shape_type_id = hydra.get_component_type_id("Box Shape") + # Allow a few seconds for matching entity to be found + helper.wait_for_condition(lambda: len(entity.SearchBus(bus.Broadcast, 'SearchEntities', search_filter)) > 0, 5.0) + lc_matching_entities = entity.SearchBus(bus.Broadcast, 'SearchEntities', search_filter) + slice_root_id = lc_matching_entities[0] #Entity with Landscape Canvas component + Report.critical_result(Tests.lc_entity_found, slice_root_id.IsValid()) - # Verify the BushSpawner entity has a Distribution Filter - has_distribution_filter = editor.EditorComponentAPIBus(bus.Broadcast, 'HasComponentOfType', spawner_id, - distribution_filter_type_id) - self.test_success = self.test_success and has_distribution_filter - if has_distribution_filter: - self.log("Vegetation Distribution Filter on BushSpawner entity found") + # Find the BushSpawner entity + search_filter.names = ["BushSpawner"] + spawner_matching_entities = entity.SearchBus(bus.Broadcast, 'SearchEntities', search_filter) + spawner_id = spawner_matching_entities[0] #Entity with Vegetation Layer Spawner component + Report.critical_result(Tests.spawner_entity_found, spawner_id.IsValid()) - # Open Landscape Canvas and the existing graph - general.open_pane('Landscape Canvas') - open_graph = landscapecanvas.LandscapeCanvasRequestBus(bus.Broadcast, 'OnGraphEntity', slice_root_id) - self.test_success = self.test_success and open_graph.IsValid() - if open_graph.IsValid(): - self.log("Graph opened") + # Get needed component type ids + distribution_filter_type_id = hydra.get_component_type_id("Vegetation Distribution Filter") + altitude_filter_type_id = hydra.get_component_type_id("Vegetation Altitude Filter") + box_shape_type_id = hydra.get_component_type_id("Box Shape") - # Verify that Distribution Filter node is present on the graph - spawner_distribution_filter_component = editor.EditorComponentAPIBus(bus.Broadcast, 'GetComponentOfType', spawner_id, - distribution_filter_type_id) - spawner_distribution_filter_component_id = spawner_distribution_filter_component.GetValue() - distribution_filter_node = landscapecanvas.LandscapeCanvasRequestBus(bus.Broadcast, - 'GetNodeMatchingEntityComponentInGraph', - open_graph, - spawner_distribution_filter_component_id) - self.test_success = self.test_success and distribution_filter_node is not None - if distribution_filter_node is not None: - self.log("Distribution Filter node found on graph") - else: - self.log("Distribution Filter node not found on graph") + # Verify the BushSpawner entity has a Distribution Filter + has_distribution_filter = editor.EditorComponentAPIBus(bus.Broadcast, 'HasComponentOfType', spawner_id, + distribution_filter_type_id) + Report.critical_result(Tests.dist_filter_component_found, has_distribution_filter) - # Add a Vegetation Altitude Filter component to the BushSpawner entity, and verify the node is added to the graph - spawner_altitude_filter_component = editor.EditorComponentAPIBus(bus.Broadcast, 'GetComponentOfType', spawner_id, - altitude_filter_type_id) - spawner_altitude_filter_component_id = spawner_altitude_filter_component.GetValue() - editor.EditorComponentAPIBus(bus.Broadcast, 'AddComponentOfType', spawner_id, altitude_filter_type_id) - has_altitude_filter = editor.EditorComponentAPIBus(bus.Broadcast, 'HasComponentOfType', spawner_id, - altitude_filter_type_id) - altitude_filter_node = landscapecanvas.LandscapeCanvasRequestBus(bus.Broadcast, 'GetNodeMatchingEntityComponentInGraph', - open_graph, spawner_altitude_filter_component_id) - self.test_success = self.test_success and has_altitude_filter and altitude_filter_node is not None - if has_altitude_filter: - self.log("Vegetation Altitude Filter on BushSpawner entity found") + # Open Landscape Canvas and the existing graph + general.open_pane('Landscape Canvas') + open_graph = landscapecanvas.LandscapeCanvasRequestBus(bus.Broadcast, 'OnGraphEntity', slice_root_id) + Report.critical_result(Tests.existing_graph_opened, open_graph.IsValid()) - if altitude_filter_node is not None: - self.log("Altitude Filter node found on graph") - else: - self.log("Altitude Filter node not found on graph") + # Verify that Distribution Filter node is present on the graph + spawner_distribution_filter_component = editor.EditorComponentAPIBus(bus.Broadcast, 'GetComponentOfType', spawner_id, + distribution_filter_type_id) + spawner_distribution_filter_component_id = spawner_distribution_filter_component.GetValue() + distribution_filter_node = landscapecanvas.LandscapeCanvasRequestBus(bus.Broadcast, + 'GetNodeMatchingEntityComponentInGraph', + open_graph, + spawner_distribution_filter_component_id) + Report.critical_result(Tests.dist_filter_node_found, distribution_filter_node is not None) - # Remove the Distribution Filter - editor.EditorComponentAPIBus(bus.Broadcast, 'RemoveComponents', [spawner_distribution_filter_component_id]) - general.idle_wait(1.0) + # Add a Vegetation Altitude Filter component to the BushSpawner entity, and verify the node is added to the graph + spawner_altitude_filter_component = editor.EditorComponentAPIBus(bus.Broadcast, 'GetComponentOfType', spawner_id, + altitude_filter_type_id) + spawner_altitude_filter_component_id = spawner_altitude_filter_component.GetValue() + editor.EditorComponentAPIBus(bus.Broadcast, 'AddComponentOfType', spawner_id, altitude_filter_type_id) + has_altitude_filter = editor.EditorComponentAPIBus(bus.Broadcast, 'HasComponentOfType', spawner_id, + altitude_filter_type_id) + altitude_filter_node = landscapecanvas.LandscapeCanvasRequestBus(bus.Broadcast, 'GetNodeMatchingEntityComponentInGraph', + open_graph, spawner_altitude_filter_component_id) + Report.result(Tests.dist_filter_component_found, has_altitude_filter) + Report.result(Tests.dist_filter_node_found, altitude_filter_node is not None) - # Verify the Distribution Filter was successfully removed from entity and the node was likewise removed - has_distribution_filter = editor.EditorComponentAPIBus(bus.Broadcast, 'HasComponentOfType', spawner_id, - distribution_filter_type_id) - self.test_success = self.test_success and not has_distribution_filter - if not has_distribution_filter: - self.log("Vegetation Distribution Filter removed from BushSpawner entity") + # Remove the Distribution Filter + editor.EditorComponentAPIBus(bus.Broadcast, 'RemoveComponents', [spawner_distribution_filter_component_id]) + general.idle_wait(1.0) - distribution_filter_node = landscapecanvas.LandscapeCanvasRequestBus(bus.Broadcast, - 'GetAllNodesMatchingEntityComponent', - spawner_distribution_filter_component_id) - self.test_success = self.test_success and not distribution_filter_node - if distribution_filter_node: - self.log("Distribution Filter node is still present on the graph") - else: - self.log("Distribution Filter node was removed from the graph") + # Verify the Distribution Filter was successfully removed from entity and the node was likewise removed + has_distribution_filter = editor.EditorComponentAPIBus(bus.Broadcast, 'HasComponentOfType', spawner_id, + distribution_filter_type_id) + Report.result(Tests.dist_filter_component_removed, not has_distribution_filter) - # Add a new child entity of BushSpawner entity - box_id = editor.ToolsApplicationRequestBus(bus.Broadcast, 'CreateNewEntity', spawner_id) - if editor.EditorEntityInfoRequestBus(bus.Event, 'GetParent', box_id) == spawner_id: - self.log("New entity successfully added as a child of the BushSpawner entity") - else: - self.log("New entity added with an unexpected parent") + distribution_filter_node = landscapecanvas.LandscapeCanvasRequestBus(bus.Broadcast, + 'GetAllNodesMatchingEntityComponent', + spawner_distribution_filter_component_id) + Report.result(Tests.dist_filter_node_removed, not distribution_filter_node) - # Add a Box Shape component to the new entity and verify it was properly added - editor.EditorComponentAPIBus(bus.Broadcast, 'AddComponentOfType', box_id, box_shape_type_id) - has_box_shape = editor.EditorComponentAPIBus(bus.Broadcast, 'HasComponentOfType', box_id, - box_shape_type_id) - self.test_success = self.test_success and has_box_shape - if has_box_shape: - self.log("Box Shape on Box entity found") + # Add a new child entity of BushSpawner entity + box_id = editor.ToolsApplicationRequestBus(bus.Broadcast, 'CreateNewEntity', spawner_id) + Report.result(Tests.child_entity_added, editor.EditorEntityInfoRequestBus(bus.Event, 'GetParent', box_id) == + spawner_id) - # Verify the Box Shape node appear on the graph - box_shape_component = editor.EditorComponentAPIBus(bus.Broadcast, 'GetComponentOfType', box_id, - box_shape_type_id) + # Add a Box Shape component to the new entity and verify it was properly added + editor.EditorComponentAPIBus(bus.Broadcast, 'AddComponentOfType', box_id, box_shape_type_id) + has_box_shape = editor.EditorComponentAPIBus(bus.Broadcast, 'HasComponentOfType', box_id, + box_shape_type_id) + Report.result(Tests.box_shape_component_found, has_box_shape) - box_shape_component_id = box_shape_component.GetValue() - box_shape_node = landscapecanvas.LandscapeCanvasRequestBus(bus.Broadcast, 'GetAllNodesMatchingEntityComponent', - box_shape_component_id) - self.test_success = self.test_success and box_shape_node is not None - if box_shape_node is not None: - self.log("Box Shape node found on graph") - else: - self.log("Box Shape node not found on graph") + # Verify the Box Shape node appears on the graph + box_shape_component = editor.EditorComponentAPIBus(bus.Broadcast, 'GetComponentOfType', box_id, + box_shape_type_id) + + box_shape_component_id = box_shape_component.GetValue() + box_shape_node = landscapecanvas.LandscapeCanvasRequestBus(bus.Broadcast, 'GetAllNodesMatchingEntityComponent', + box_shape_component_id) + Report.result(Tests.box_shape_node_found, box_shape_node is not None) -test = TestComponentUpdatesUpdateGraph() -test.run() +if __name__ == "__main__": + + from editor_python_test_tools.utils import Report + Report.start_test(ComponentUpdates_UpdateGraph) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/Component_AddedRemoved.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/Component_AddedRemoved.py new file mode 100644 index 0000000000..7f21a26595 --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/Component_AddedRemoved.py @@ -0,0 +1,80 @@ +""" +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 +""" + + +class Tests: + lc_component_added = ( + "Landscape Canvas component successfully added to entity", + "Failed to add Landscape Canvas component to entity" + ) + lc_component_removed = ( + "Landscape Canvas component successfully removed from entity", + "Failed to remove Landscape Canvas component from entity" + ) + + +def Component_AddedRemoved(): + """ + Summary: + This test verifies that the Landscape Canvas component can be added to/removed from an entity. + + Expected Behavior: + Closing a tabbed graph only closes the appropriate graph. + + Test Steps: + 1) Open a simple level + 2) Create a new entity + 3) Add a Landscape Canvas component to the entity + 4) Remove the Landscape Canvas component from the entity + + Note: + - This test file must be called from the Open 3D Engine Editor command terminal + - Any passed and failed tests are written to the Editor.log file. + Parsing the file or running a log_monitor are required to observe the test results. + + :return: None + """ + + import azlmbr.bus as bus + import azlmbr.editor as editor + import azlmbr.entity as entity + + import editor_python_test_tools.hydra_editor_utils as hydra + from editor_python_test_tools.utils import Report + from editor_python_test_tools.utils import TestHelper as helper + + # Open an existing simple level + helper.init_idle() + helper.open_level("Physics", "Base") + + # Create an Entity at the root of the level + newEntityId = editor.ToolsApplicationRequestBus(bus.Broadcast, 'CreateNewEntity', entity.EntityId()) + + # Find the component TypeId for our Landscape Canvas component + landscape_canvas_type_id = hydra.get_component_type_id("Landscape Canvas") + + # Add the Landscape Canvas Component to our Entity + componentOutcome = editor.EditorComponentAPIBus(bus.Broadcast, 'AddComponentsOfType', newEntityId, [landscape_canvas_type_id]) + components = componentOutcome.GetValue() + landscapeCanvasComponent = components[0] + + # Validate the Landscape Canvas Component exists + hasComponent = editor.EditorComponentAPIBus(bus.Broadcast, 'HasComponentOfType', newEntityId, landscape_canvas_type_id) + Report.result(Tests.lc_component_added, hasComponent) + + # Remove the Landscape Canvas Component + editor.EditorComponentAPIBus(bus.Broadcast, 'RemoveComponents', [landscapeCanvasComponent]) + + # Validate the Landscape Canvas Component is no longer on our Entity + hasComponent = editor.EditorComponentAPIBus(bus.Broadcast, 'HasComponentOfType', newEntityId, landscape_canvas_type_id) + Report.result(Tests.lc_component_removed, not hasComponent) + + +if __name__ == "__main__": + + from editor_python_test_tools.utils import Report + Report.start_test(Component_AddedRemoved) \ No newline at end of file diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/CreateNewGraph.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/CreateNewGraph.py deleted file mode 100755 index 971134becf..0000000000 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/CreateNewGraph.py +++ /dev/null @@ -1,106 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -import os -import sys - -import azlmbr.bus as bus -import azlmbr.editor as editor -import azlmbr.editor.graph as graph -import azlmbr.legacy.general as general -import azlmbr.paths - -sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests')) -import editor_python_test_tools.hydra_editor_utils as hydra -from editor_python_test_tools.editor_test_helper import EditorTestHelper - -editorId = azlmbr.globals.property.LANDSCAPE_CANVAS_EDITOR_ID -new_root_entity_id = None - - -class TestCreateNewGraph(EditorTestHelper): - def __init__(self): - EditorTestHelper.__init__(self, log_prefix="CreateNewGraph", args=["level"]) - - def on_entity_created(self, parameters): - global new_root_entity_id - new_root_entity_id = parameters[0] - - print("New root entity created") - - def run_test(self): - """ - Summary: - This test verifies that new graphs can be created in Landscape Canvas. - - Expected Behavior: - New graphs can be created, and proper entity is created to hold graph data with a Landscape Canvas component. - - Test Steps: - 1) Create a new level - 2) Open Landscape Canvas and create a new graph - 3) Ensures the root entity created contains a Landscape Canvas component - - Note: - - This test file must be called from the Open 3D Engine Editor command terminal - - Any passed and failed tests are written to the Editor.log file. - Parsing the file or running a log_monitor are required to observe the test results. - - :return: None - """ - self.test_success = self.create_level( - self.args["level"], - heightmap_resolution=128, - heightmap_meters_per_pixel=1, - terrain_texture_resolution=128, - use_terrain=False, - ) - # Open Landscape Canvas tool and verify - general.open_pane("Landscape Canvas") - self.test_success = self.test_success and general.is_pane_visible("Landscape Canvas") - if general.is_pane_visible("Landscape Canvas"): - self.log("Landscape Canvas pane is open") - - # Listen for entity creation notifications so we can check if the entity created - # with the new graph has our Landscape Canvas component automatically added - handler = editor.EditorEntityContextNotificationBusHandler() - handler.connect() - handler.add_callback("OnEditorEntityCreated", self.on_entity_created) - - # Create a new graph in Landscape Canvas - newGraphId = graph.AssetEditorRequestBus(bus.Event, "CreateNewGraph", editorId) - self.test_success = self.test_success and newGraphId - if newGraphId: - self.log("New graph created") - - # Make sure the graph we created is in Landscape Canvas - success = graph.AssetEditorRequestBus(bus.Event, "ContainsGraph", editorId, newGraphId) - self.test_success = self.test_success and success - if success: - self.log("Graph registered with Landscape Canvas") - - # Check if the entity created when we create a new graph has the - # Landscape Canvas component already added to it - landscape_canvas_type_id = hydra.get_component_type_id("Landscape Canvas") - success = editor.EditorComponentAPIBus(bus.Broadcast, "HasComponentOfType", new_root_entity_id, - landscape_canvas_type_id) - self.test_success = self.test_success and success - if success: - self.log("Root entity has Landscape Canvas component") - - # Close Landscape Canvas tool and verify - general.close_pane("Landscape Canvas") - self.test_success = self.test_success and not general.is_pane_visible("Landscape Canvas") - if not general.is_pane_visible("Landscape Canvas"): - self.log("Landscape Canvas pane is closed") - - # Stop listening for entity creation notifications - handler.disconnect() - - -test = TestCreateNewGraph() -test.run() diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/Edit_DisabledNodeDuplication.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/Edit_DisabledNodeDuplication.py index b2b9e63a56..417e093567 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/Edit_DisabledNodeDuplication.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/Edit_DisabledNodeDuplication.py @@ -5,131 +5,132 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ -import os -import sys -import azlmbr.bus as bus -import azlmbr.editor as editor -import azlmbr.editor.graph as graph -import azlmbr.landscapecanvas as landscapecanvas -import azlmbr.legacy.general as general -import azlmbr.math as math -import azlmbr.paths +class Tests: + lc_tool_opened = ( + "Landscape Canvas tool opened", + "Failed to open Landscape Canvas tool" + ) + new_graph_created = ( + "Successfully created new graph", + "Failed to create new graph" + ) -sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests')) -import editor_python_test_tools.hydra_editor_utils as hydra -from editor_python_test_tools.editor_test_helper import EditorTestHelper -editorId = azlmbr.globals.property.LANDSCAPE_CANVAS_EDITOR_ID newEntityId = None -class TestDisabledNodeDuplication(EditorTestHelper): - def __init__(self): - EditorTestHelper.__init__(self, log_prefix="DisabledNodeDuplication", args=["level"]) +def Edit_DisabledNodeDuplication(): + """ + Summary: + This test verifies Editor stability after duplicating disabled Landscape Canvas nodes. - def run_test(self): - """ - Summary: - This test verifies Editor stability after duplicating disabled Landscape Canvas nodes. + Expected Behavior: + Editor remains stable and free of crashes. - Expected Behavior: - Editor remains stable and free of crashes. + Test Steps: + 1) Open a simple level + 2) Open Landscape Canvas and create a new graph + 3) Create several new nodes, disable the nodes via disabling/deleting components, and duplicate the nodes - Test Steps: - 1) Create a new level - 2) Open Landscape Canvas and create a new graph - 3) Create several new nodes, disable the nodes via disabling/deleting components, and duplicate the nodes + Note: + - This test file must be called from the Open 3D Engine Editor command terminal + - Any passed and failed tests are written to the Editor.log file. + Parsing the file or running a log_monitor are required to observe the test results. - Note: - - This test file must be called from the Open 3D Engine Editor command terminal - - Any passed and failed tests are written to the Editor.log file. - Parsing the file or running a log_monitor are required to observe the test results. + :return: None + """ - :return: None - """ - def onEntityCreated(parameters): - global newEntityId - newEntityId = parameters[0] + import azlmbr.bus as bus + import azlmbr.editor as editor + import azlmbr.editor.graph as graph + import azlmbr.landscapecanvas as landscapecanvas + import azlmbr.legacy.general as general + import azlmbr.math as math - # Create a new empty level - self.test_success = self.create_level( - self.args["level"], - heightmap_resolution=128, - heightmap_meters_per_pixel=1, - terrain_texture_resolution=128, - use_terrain=False, - ) + import editor_python_test_tools.hydra_editor_utils as hydra + from editor_python_test_tools.utils import Report + from editor_python_test_tools.utils import TestHelper as helper - # Open Landscape Canvas tool and verify - general.open_pane('Landscape Canvas') - self.test_success = self.test_success and general.is_pane_visible('Landscape Canvas') - if general.is_pane_visible('Landscape Canvas'): - self.log('Landscape Canvas pane is open') + editorId = azlmbr.globals.property.LANDSCAPE_CANVAS_EDITOR_ID - # Create a new graph in Landscape Canvas - newGraphId = graph.AssetEditorRequestBus(bus.Event, 'CreateNewGraph', editorId) - self.test_success = self.test_success and newGraphId - if newGraphId: - self.log("New graph created") + def onEntityCreated(parameters): + global newEntityId + newEntityId = parameters[0] - # Listen for entity creation notifications so when we add a new node - # we can access the corresponding Entity that was created so that we - # can disable/remove components on that Entity - handler = editor.EditorEntityContextNotificationBusHandler() - handler.connect() - handler.add_callback('OnEditorEntityCreated', onEntityCreated) + # Open an existing simple level + helper.init_idle() + helper.open_level("Physics", "Base") - # Mapping of our Landscape Canvas nodes with corresponding dependent components - # that we can disable/remove to reproduce the crash - nodes = { - 'SpawnerAreaNode': 'Vegetation Asset List', - 'MeshBlockerAreaNode': 'Mesh', - 'BlockerAreaNode': 'Vegetation Reference Shape', - 'FastNoiseGradientNode': 'Gradient Transform Modifier', - 'ImageGradientNode': 'Gradient Transform Modifier', - 'PerlinNoiseGradientNode': 'Gradient Transform Modifier', - 'RandomNoiseGradientNode': 'Gradient Transform Modifier' - } + # Open Landscape Canvas tool and verify + general.open_pane('Landscape Canvas') + Report.critical_result(Tests.lc_tool_opened, general.is_pane_visible('Landscape Canvas')) - # Retrieve a mapping of the TypeIds for all the components - # we will be checking for - componentNames = list(set(nodes.values())) # Convert to set then back to list to remove any duplicates - componentTypeIds = hydra.get_component_type_id_map(componentNames) + # Create a new graph in Landscape Canvas + newGraphId = graph.AssetEditorRequestBus(bus.Event, 'CreateNewGraph', editorId) + Report.critical_result(Tests.new_graph_created, newGraphId is not None) - # Iterate through creating our nodes and then disabling/deleting required components - # and then duplicating the node to reproduce the crash - newGraph = graph.GraphManagerRequestBus(bus.Broadcast, 'GetGraph', newGraphId) - x = 10.0 - y = 10.0 - for nodeName in nodes: - nodePosition = math.Vector2(x, y) - node = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, 'CreateNodeForTypeName', newGraph, nodeName) - graph.GraphControllerRequestBus(bus.Event, 'AddNode', newGraphId, node, nodePosition) + # Listen for entity creation notifications so when we add a new node + # we can access the corresponding Entity that was created so that we + # can disable/remove components on that Entity + handler = editor.EditorEntityContextNotificationBusHandler() + handler.connect() + handler.add_callback('OnEditorEntityCreated', onEntityCreated) - dependentComponentName = nodes[nodeName] - componentTypeId = componentTypeIds[dependentComponentName] - componentOutcome = editor.EditorComponentAPIBus(bus.Broadcast, 'GetComponentOfType', newEntityId, componentTypeId) - component = componentOutcome.GetValue() + # Mapping of our Landscape Canvas nodes with corresponding dependent components + # that we can disable/remove to reproduce the crash + nodes = { + 'SpawnerAreaNode': 'Vegetation Asset List', + 'MeshBlockerAreaNode': 'Mesh', + 'BlockerAreaNode': 'Vegetation Reference Shape', + 'FastNoiseGradientNode': 'Gradient Transform Modifier', + 'ImageGradientNode': 'Gradient Transform Modifier', + 'PerlinNoiseGradientNode': 'Gradient Transform Modifier', + 'RandomNoiseGradientNode': 'Gradient Transform Modifier' + } - # First make sure we can duplicate a node with a dependent component that is disabled - editor.EditorComponentAPIBus(bus.Broadcast, 'DisableComponents', [component]) - general.idle_wait(1.0) - graph.SceneRequestBus(bus.Event, 'DuplicateSelection', newGraphId) # This duplication would cause a crash without the fix - self.log("{node} duplicated with disabled component".format(node=nodeName)) + # Retrieve a mapping of the TypeIds for all the components + # we will be checking for + componentNames = list(set(nodes.values())) # Convert to set then back to list to remove any duplicates + componentTypeIds = hydra.get_component_type_id_map(componentNames) - # Then, make sure we can duplicate the node with a dependent component that is deleted - editor.EditorComponentAPIBus(bus.Broadcast, 'RemoveComponents', [component]) - general.idle_wait(1.0) - graph.SceneRequestBus(bus.Event, 'DuplicateSelection', newGraphId) # This duplication would cause a crash without the fix - self.log("{node} duplicated with deleted component".format(node=nodeName)) + # Iterate through creating our nodes and then disabling/deleting required components + # and then duplicating the node to reproduce the crash + newGraph = graph.GraphManagerRequestBus(bus.Broadcast, 'GetGraph', newGraphId) + x = 10.0 + y = 10.0 + for nodeName in nodes: + nodePosition = math.Vector2(x, y) + node = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, 'CreateNodeForTypeName', newGraph, nodeName) + graph.GraphControllerRequestBus(bus.Event, 'AddNode', newGraphId, node, nodePosition) - x += 40.0 - y += 40.0 + dependentComponentName = nodes[nodeName] + componentTypeId = componentTypeIds[dependentComponentName] + componentOutcome = editor.EditorComponentAPIBus(bus.Broadcast, 'GetComponentOfType', newEntityId, componentTypeId) + component = componentOutcome.GetValue() - # Stop listening for entity creation notifications - handler.disconnect() + # First make sure we can duplicate a node with a dependent component that is disabled + editor.EditorComponentAPIBus(bus.Broadcast, 'DisableComponents', [component]) + helper.wait_for_condition(lambda: not editor.EditorComponentAPIBus(bus.Broadcast, 'IsComponentEnabled', + [component]), 1.0) + graph.SceneRequestBus(bus.Event, 'DuplicateSelection', newGraphId) # This duplication would cause a crash without the fix + Report.info("{node} duplicated with disabled component".format(node=nodeName)) + + # Then, make sure we can duplicate the node with a dependent component that is deleted + editor.EditorComponentAPIBus(bus.Broadcast, 'RemoveComponents', [component]) + helper.wait_for_condition(lambda: not editor.EditorComponentAPIBus(bus.Broadcast, 'HasComponentOfType', + componentTypeIds[dependentComponentName]), 1.0) + graph.SceneRequestBus(bus.Event, 'DuplicateSelection', newGraphId) # This duplication would cause a crash without the fix + Report.info("{node} duplicated with deleted component".format(node=nodeName)) + + x += 40.0 + y += 40.0 + + # Stop listening for entity creation notifications + handler.disconnect() -test = TestDisabledNodeDuplication() -test.run() +if __name__ == "__main__": + + from editor_python_test_tools.utils import Report + Report.start_test(Edit_DisabledNodeDuplication) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/Edit_UndoNodeDelete_SliceEntity.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/Edit_UndoNodeDelete_SliceEntity.py index a651567f85..a26e16755f 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/Edit_UndoNodeDelete_SliceEntity.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/Edit_UndoNodeDelete_SliceEntity.py @@ -5,133 +5,134 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ -import os -import sys -import azlmbr.asset as asset -import azlmbr.bus as bus -import azlmbr.editor as editor -import azlmbr.entity as entity -import azlmbr.legacy.general as general -import azlmbr.editor.graph as graph -import azlmbr.landscapecanvas as landscapecanvas -import azlmbr.math as math -import azlmbr.slice as slice -import azlmbr.paths +class Tests: + slice_spawned = ( + "Slice instantiated successfully", + "Failed to instantiate slice" + ) + lc_entity_found = ( + "Landscape Canvas entity found", + "Failed to find Landscape Canvas entity" + ) + spawner_entity_found = ( + "Spawner entity found", + "Failed to find Spawner entity" + ) + graph_opened = ( + "Graph successfully opened", + "Graph failed to open" + ) + spawner_node_found = ( + "Vegetation Layer Spawner node found on graph", + "Failed to find Vegetation Layer Spawner node on graph" + ) + spawner_node_removed = ( + "Vegetation Layer Spawner node was successfully removed", + "Failed to remove Vegetation Layer Spawner node" + ) +def Edit_UndoNodeDelete_SliceEntity(): + """ + Summary: + This test verifies Editor stability after undoing the deletion of nodes on a slice entity. -sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests')) -import editor_python_test_tools.hydra_editor_utils as hydra -from editor_python_test_tools.editor_test_helper import EditorTestHelper + Expected Behavior: + Editor remains stable and free of crashes. + + Test Steps: + 1) Open a simple level + 2) Instantiate a slice with a Landscape Canvas setup + 3) Find a specific node on the graph, and delete it + 4) Restore the node with Undo + + Note: + - This test file must be called from the Open 3D Engine Editor command terminal + - Any passed and failed tests are written to the Editor.log file. + Parsing the file or running a log_monitor are required to observe the test results. + + :return: None + """ + + import os + + import azlmbr.asset as asset + import azlmbr.bus as bus + import azlmbr.editor as editor + import azlmbr.entity as entity + import azlmbr.legacy.general as general + import azlmbr.editor.graph as graph + import azlmbr.landscapecanvas as landscapecanvas + import azlmbr.math as math + import azlmbr.slice as slice + + import editor_python_test_tools.hydra_editor_utils as hydra + from editor_python_test_tools.utils import Report + from editor_python_test_tools.utils import TestHelper as helper + + # Open an existing simple level + helper.init_idle() + helper.open_level("Physics", "Base") + + # Instantiate slice + transform = math.Transform_CreateIdentity() + position = math.Vector3(64.0, 64.0, 32.0) + transform.invoke('SetPosition', position) + test_slice_path = os.path.join("Slices", "LC_BushFlowerBlender.slice") + test_slice_id = asset.AssetCatalogRequestBus(bus.Broadcast, "GetAssetIdByPath", test_slice_path, math.Uuid(), + False) + test_slice = slice.SliceRequestBus(bus.Broadcast, 'InstantiateSliceFromAssetId', test_slice_id, transform) + Report.result(Tests.slice_spawned, test_slice.IsValid()) + + # Find root entity in the loaded level + search_filter = entity.SearchFilter() + search_filter.names = ["LandscapeCanvas"] + + # Allow a few seconds for matching entity to be found + helper.wait_for_condition(lambda: len(entity.SearchBus(bus.Broadcast, 'SearchEntities', search_filter)) > 0, 5.0) + lc_matching_entities = entity.SearchBus(bus.Broadcast, 'SearchEntities', search_filter) + slice_root_id = lc_matching_entities[0] # Entity with Landscape Canvas component + Report.result(Tests.lc_entity_found, slice_root_id.IsValid()) + + # Find the BushSpawner entity + search_filter.names = ["BushSpawner"] + spawner_matching_entities = entity.SearchBus(bus.Broadcast, 'SearchEntities', search_filter) + spawner_id = spawner_matching_entities[0] # Entity with Vegetation Layer Spawner component + Report.result(Tests.spawner_entity_found, spawner_id.IsValid()) + + # Open Landscape Canvas and the existing graph + general.open_pane('Landscape Canvas') + open_graph = landscapecanvas.LandscapeCanvasRequestBus(bus.Broadcast, 'OnGraphEntity', slice_root_id) + Report.result(Tests.graph_opened, open_graph.IsValid()) + + # Get needed component type ids + layer_spawner_type_id = hydra.get_component_type_id("Vegetation Layer Spawner") + + # Find the Vegetation Layer Spawner node on the BushSpawner entity + layer_spawner_component = editor.EditorComponentAPIBus(bus.Broadcast, 'GetComponentOfType', spawner_id, + layer_spawner_type_id) + layer_spawner_component_component_id = layer_spawner_component.GetValue() + layer_spawner_node = landscapecanvas.LandscapeCanvasRequestBus(bus.Broadcast, 'GetAllNodesMatchingEntityComponent', + layer_spawner_component_component_id) + Report.result(Tests.spawner_node_found, layer_spawner_node is not None) + + # Remove the Layer Spawner node + graph.GraphControllerRequestBus(bus.Event, "RemoveNode", open_graph, layer_spawner_node[0]) + + # Verify node was removed + layer_spawner_node = landscapecanvas.LandscapeCanvasRequestBus(bus.Broadcast, 'GetAllNodesMatchingEntityComponent', + layer_spawner_component_component_id) + Report.result(Tests.spawner_node_removed, not layer_spawner_node) + + # Undo the Node deletion. This is required to be executed twice to hit the node removal. + general.undo() + general.undo() + + # self.log a line to the Console to verify the Editor is still active + Report.info("Editor is still responsive") -class TestUndoNodeDeleteSlice(EditorTestHelper): - def __init__(self): - EditorTestHelper.__init__(self, log_prefix="UndoNodeDeleteSlice", args=["level"]) +if __name__ == "__main__": - def run_test(self): - """ - Summary: - This test verifies Editor stability after undoing the deletion of nodes on a slice entity. + from editor_python_test_tools.utils import Report + Report.start_test(Edit_UndoNodeDelete_SliceEntity) - Expected Behavior: - Editor remains stable and free of crashes. - - Test Steps: - 1) Create a new level - 2) Instantiate a slice with a Landscape Canvas setup - 3) Find a specific node on the graph, and delete it - 4) Restore the node with Undo - - Note: - - This test file must be called from the Open 3D Engine Editor command terminal - - Any passed and failed tests are written to the Editor.log file. - Parsing the file or running a log_monitor are required to observe the test results. - - :return: None - """ - # Create a new empty level and instantiate LC_BushFlowerBlender.slice - self.test_success = self.create_level( - self.args["level"], - heightmap_resolution=128, - heightmap_meters_per_pixel=1, - terrain_texture_resolution=128, - use_terrain=False, - ) - transform = math.Transform_CreateIdentity() - position = math.Vector3(64.0, 64.0, 32.0) - transform.invoke('SetPosition', position) - test_slice_path = os.path.join("Slices", "LC_BushFlowerBlender.slice") - test_slice_id = asset.AssetCatalogRequestBus(bus.Broadcast, "GetAssetIdByPath", test_slice_path, math.Uuid(), - False) - test_slice = slice.SliceRequestBus(bus.Broadcast, 'InstantiateSliceFromAssetId', test_slice_id, transform) - self.test_success = self.test_success and test_slice.IsValid() - if test_slice.IsValid(): - self.log("Slice spawned!") - - # Find root entity in the loaded level - search_filter = entity.SearchFilter() - search_filter.names = ["LandscapeCanvas"] - - # Allow a few seconds for matching entity to be found - self.wait_for_condition(lambda: len(entity.SearchBus(bus.Broadcast, 'SearchEntities', search_filter)) > 0, - 5.0) - lc_matching_entities = entity.SearchBus(bus.Broadcast, 'SearchEntities', search_filter) - slice_root_id = lc_matching_entities[0] # Entity with Landscape Canvas component - self.test_success = self.test_success and slice_root_id.IsValid() - if slice_root_id.IsValid(): - self.log("LandscapeCanvas entity found") - - # Find the BushSpawner entity - search_filter.names = ["BushSpawner"] - spawner_matching_entities = entity.SearchBus(bus.Broadcast, 'SearchEntities', search_filter) - spawner_id = spawner_matching_entities[0] # Entity with Vegetation Layer Spawner component - self.test_success = self.test_success and spawner_id.IsValid() - if spawner_id.IsValid(): - self.log("BushSpawner entity found") - - # Open Landscape Canvas and the existing graph - general.open_pane('Landscape Canvas') - open_graph = landscapecanvas.LandscapeCanvasRequestBus(bus.Broadcast, 'OnGraphEntity', slice_root_id) - self.test_success = self.test_success and open_graph.IsValid() - if open_graph.IsValid(): - self.log("Graph opened") - - # Get needed component type ids - layer_spawner_type_id = hydra.get_component_type_id("Vegetation Layer Spawner") - - # Find the Vegetation Layer Spawner node on the BushSpawner entity - layer_spawner_component = editor.EditorComponentAPIBus(bus.Broadcast, 'GetComponentOfType', spawner_id, - layer_spawner_type_id) - layer_spawner_component_component_id = layer_spawner_component.GetValue() - layer_spawner_node = landscapecanvas.LandscapeCanvasRequestBus(bus.Broadcast, 'GetAllNodesMatchingEntityComponent', - layer_spawner_component_component_id) - - self.test_success = self.test_success and layer_spawner_node - if layer_spawner_node: - self.log("Vegetation Layer Spawner node found on graph") - else: - self.log("Vegetation Layer Spawner node not found") - - # Remove the Layer Spawner node - graph.GraphControllerRequestBus(bus.Event, "RemoveNode", open_graph, layer_spawner_node[0]) - - # Verify node was removed - layer_spawner_node = landscapecanvas.LandscapeCanvasRequestBus(bus.Broadcast, 'GetAllNodesMatchingEntityComponent', - layer_spawner_component_component_id) - - self.test_success = self.test_success and not layer_spawner_node - if not layer_spawner_node: - self.log("Vegetation Layer Spawner node was removed") - else: - self.log("Vegetation Layer Spawner node was not removed") - - # Undo the Node deletion. This is required to be executed twice to hit the node removal. - general.undo() - general.undo() - - # self.log a line to the Console to verify the Editor is still active - self.log("Editor is still responsive") - - -test = TestUndoNodeDeleteSlice() -test.run() diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientMixer_NodeConstruction.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientMixer_NodeConstruction.py index 341e6d3367..c390df7c61 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientMixer_NodeConstruction.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientMixer_NodeConstruction.py @@ -5,190 +5,205 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ -import os -import sys -import azlmbr.bus as bus -import azlmbr.editor as editor -import azlmbr.editor.graph as graph -import azlmbr.entity as entity -import azlmbr.landscapecanvas as landscapecanvas -import azlmbr.legacy.general as general -import azlmbr.math as math -import azlmbr.paths +class Tests: + lc_tool_opened = ( + "Landscape Canvas tool opened", + "Failed to open Landscape Canvas tool" + ) + new_graph_created = ( + "Successfully created new graph", + "Failed to create new graph" + ) + graph_registered = ( + "Graph registered with Landscape Canvas", + "Failed to register graph" + ) + preview_entity_set = ( + "Perlin Noise Gradient component Preview Entity property set to Box Shape EntityId", + "Unexpected entity set in Perlin Noise Gradient Preview Entity property" + ) + mixer_inbound_gradient_set_a = ( + "Gradient Mixer component Inbound Gradient extendable property set to Perlin Noise Gradient EntityId", + "Unexpected entity set in Gradient Mixer's Inbound Gradient property" + ) + mixer_inbound_gradient_set_b = ( + "Gradient Mixer component Inbound Gradient extendable property set to FastNoise Gradient EntityId", + "Unexpected entity set in Gradient Mixer's Inbound Gradient property" + ) + mixer_operation_a = ( + "Layer 1 Operation is set to Initialize", + "Layer 1 Operation is not set to Initialize as expected" + ) + mixer_operation_b = ( + "Layer 2 Operation is set to Average", + "Layer 2 Operation is not set to Average as expected" + ) -sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests')) -import editor_python_test_tools.hydra_editor_utils as hydra -from editor_python_test_tools.editor_test_helper import EditorTestHelper - -editorId = azlmbr.globals.property.LANDSCAPE_CANVAS_EDITOR_ID newEntityId = None -class TestGradientMixerNodeConstruction(EditorTestHelper): - def __init__(self): - EditorTestHelper.__init__(self, log_prefix="GradientMixerNodeConstruction", args=["level"]) +def GradientMixer_NodeConstruction(): + """ + Summary: + This test verifies a Gradient Mixer vegetation setup can be constructed through Landscape Canvas. - def run_test(self): - """ - Summary: - This test verifies a Gradient Mixer vegetation setup can be constructed through Landscape Canvas. + Expected Behavior: + Entities contain all required components and component references after creating nodes and setting connections + on a Landscape Canvas graph. - Expected Behavior: - Entities contain all required components and component references after creating nodes and setting connections - on a Landscape Canvas graph. + Test Steps: + 1) Create a new level + 2) Open Landscape Canvas and create a new graph + 3) Add all necessary nodes to the graph and set connections to form a Gradient Mixer setup + 4) Verify all components and component references were properly set during graph construction - Test Steps: - 1) Create a new level - 2) Open Landscape Canvas and create a new graph - 3) Add all necessary nodes to the graph and set connections to form a Gradient Mixer setup - 4) Verify all components and component references were properly set during graph construction + Note: + - This test file must be called from the Open 3D Engine Editor command terminal + - Any passed and failed tests are written to the Editor.log file. + Parsing the file or running a log_monitor are required to observe the test results. - Note: - - This test file must be called from the Open 3D Engine Editor command terminal - - Any passed and failed tests are written to the Editor.log file. - Parsing the file or running a log_monitor are required to observe the test results. + :return: None + """ - :return: None - """ + import azlmbr.bus as bus + import azlmbr.editor as editor + import azlmbr.editor.graph as graph + import azlmbr.landscapecanvas as landscapecanvas + import azlmbr.legacy.general as general + import azlmbr.math as math + import azlmbr.paths - def onEntityCreated(parameters): - global newEntityId - newEntityId = parameters[0] + import editor_python_test_tools.hydra_editor_utils as hydra + from editor_python_test_tools.utils import Report + from editor_python_test_tools.utils import TestHelper as helper - # Create a new empty level - self.test_success = self.create_level( - self.args["level"], - heightmap_resolution=1024, - heightmap_meters_per_pixel=1, - terrain_texture_resolution=4096, - use_terrain=False, - ) + editorId = azlmbr.globals.property.LANDSCAPE_CANVAS_EDITOR_ID - # Open Landscape Canvas tool and verify - general.open_pane('Landscape Canvas') - self.test_success = self.test_success and general.is_pane_visible('Landscape Canvas') - if general.is_pane_visible('Landscape Canvas'): - self.log('Landscape Canvas pane is open') + def onEntityCreated(parameters): + global newEntityId + newEntityId = parameters[0] - # Create a new graph in Landscape Canvas - newGraphId = graph.AssetEditorRequestBus(bus.Event, 'CreateNewGraph', editorId) - self.test_success = self.test_success and newGraphId - if newGraphId: - self.log("New graph created") + # Open an existing simple level + helper.init_idle() + helper.open_level("Physics", "Base") - # Make sure the graph we created is in Landscape Canvas - success = graph.AssetEditorRequestBus(bus.Event, 'ContainsGraph', editorId, newGraphId) - self.test_success = self.test_success and success - if success: - self.log("Graph registered with Landscape Canvas") + # Open Landscape Canvas tool and verify + general.open_pane('Landscape Canvas') + Report.critical_result(Tests.lc_tool_opened, general.is_pane_visible('Landscape Canvas')) - # Listen for entity creation notifications so we can verify the component EntityId - # references are set correctly when connecting slots on the nodes - handler = editor.EditorEntityContextNotificationBusHandler() - handler.connect() - handler.add_callback('OnEditorEntityCreated', onEntityCreated) + # Create a new graph in Landscape Canvas + newGraphId = graph.AssetEditorRequestBus(bus.Event, 'CreateNewGraph', editorId) + Report.critical_result(Tests.new_graph_created, newGraphId is not None) - positionX = 10.0 - positionY = 10.0 - offsetX = 340.0 - offsetY = 100.0 + # Make sure the graph we created is in Landscape Canvas + graph_registered = graph.AssetEditorRequestBus(bus.Event, 'ContainsGraph', editorId, newGraphId) + Report.result(Tests.graph_registered, graph_registered) - # Add a Box Shape node to the graph - newGraph = graph.GraphManagerRequestBus(bus.Broadcast, 'GetGraph', newGraphId) - boxShapeNode = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, 'CreateNodeForTypeName', newGraph, - 'BoxShapeNode') - graph.GraphControllerRequestBus(bus.Event, 'AddNode', newGraphId, boxShapeNode, math.Vector2(positionX, positionY)) - boxShapeEntityId = newEntityId + # Listen for entity creation notifications so we can verify the component EntityId + # references are set correctly when connecting slots on the nodes + handler = editor.EditorEntityContextNotificationBusHandler() + handler.connect() + handler.add_callback('OnEditorEntityCreated', onEntityCreated) - positionX += offsetX - positionY += offsetY + positionX = 10.0 + positionY = 10.0 + offsetX = 340.0 + offsetY = 100.0 - # Add a Random Noise Gradient node to the graph - perlinNoiseNode = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, 'CreateNodeForTypeName', newGraph, - 'PerlinNoiseGradientNode') - graph.GraphControllerRequestBus(bus.Event, 'AddNode', newGraphId, perlinNoiseNode, math.Vector2(positionX, positionY)) - perlinNoiseEntityId = newEntityId + # Add a Box Shape node to the graph + newGraph = graph.GraphManagerRequestBus(bus.Broadcast, 'GetGraph', newGraphId) + boxShapeNode = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, 'CreateNodeForTypeName', newGraph, + 'BoxShapeNode') + graph.GraphControllerRequestBus(bus.Event, 'AddNode', newGraphId, boxShapeNode, math.Vector2(positionX, positionY)) + boxShapeEntityId = newEntityId - positionX += offsetX - positionY += offsetY + positionX += offsetX + positionY += offsetY - # Add a FastNoise Gradient node to the graph - fastNoiseNode = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, 'CreateNodeForTypeName', newGraph, - 'FastNoiseGradientNode') - graph.GraphControllerRequestBus(bus.Event, 'AddNode', newGraphId, fastNoiseNode, math.Vector2(positionX, positionY)) - fastNoiseEntityId = newEntityId + # Add a Random Noise Gradient node to the graph + perlinNoiseNode = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, 'CreateNodeForTypeName', newGraph, + 'PerlinNoiseGradientNode') + graph.GraphControllerRequestBus(bus.Event, 'AddNode', newGraphId, perlinNoiseNode, math.Vector2(positionX, positionY)) + perlinNoiseEntityId = newEntityId - positionX += offsetX - positionY += offsetY + positionX += offsetX + positionY += offsetY - # Add a Gradient Mixer node to the graph - gradientMixerNode = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, 'CreateNodeForTypeName', newGraph, - 'GradientMixerNode') - graph.GraphControllerRequestBus(bus.Event, 'AddNode', newGraphId, gradientMixerNode, math.Vector2(positionX, positionY)) - gradientMixerEntityId = newEntityId + # Add a FastNoise Gradient node to the graph + fastNoiseNode = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, 'CreateNodeForTypeName', newGraph, + 'FastNoiseGradientNode') + graph.GraphControllerRequestBus(bus.Event, 'AddNode', newGraphId, fastNoiseNode, math.Vector2(positionX, positionY)) + fastNoiseEntityId = newEntityId - boundsSlotId = graph.GraphModelSlotId('Bounds') - previewBoundsSlotId = graph.GraphModelSlotId('PreviewBounds') - inboundGradientSlotId = graph.GraphModelSlotId('InboundGradient') - outboundGradientSlotId = graph.GraphModelSlotId('OutboundGradient') - inboundGradientSlotId2 = graph.GraphControllerRequestBus(bus.Event, 'ExtendSlot', newGraphId, gradientMixerNode, - 'InboundGradient') + positionX += offsetX + positionY += offsetY - # Connect slots on our nodes to construct a Gradient Mixer hierarchy - graph.GraphControllerRequestBus(bus.Event, 'AddConnectionBySlotId', newGraphId, boxShapeNode, boundsSlotId, - perlinNoiseNode, previewBoundsSlotId) - graph.GraphControllerRequestBus(bus.Event, 'AddConnectionBySlotId', newGraphId, boxShapeNode, boundsSlotId, - fastNoiseNode, previewBoundsSlotId) - graph.GraphControllerRequestBus(bus.Event, 'AddConnectionBySlotId', newGraphId, boxShapeNode, boundsSlotId, - gradientMixerNode, previewBoundsSlotId) - graph.GraphControllerRequestBus(bus.Event, 'AddConnectionBySlotId', newGraphId, perlinNoiseNode, outboundGradientSlotId, - gradientMixerNode, inboundGradientSlotId) - graph.GraphControllerRequestBus(bus.Event, 'AddConnectionBySlotId', newGraphId, fastNoiseNode, outboundGradientSlotId, - gradientMixerNode, inboundGradientSlotId2) + # Add a Gradient Mixer node to the graph + gradientMixerNode = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, 'CreateNodeForTypeName', newGraph, + 'GradientMixerNode') + graph.GraphControllerRequestBus(bus.Event, 'AddNode', newGraphId, gradientMixerNode, math.Vector2(positionX, positionY)) + gradientMixerEntityId = newEntityId - # Delay to allow all the underlying component properties to be updated after the slot connections are made - general.idle_wait(1.0) + boundsSlotId = graph.GraphModelSlotId('Bounds') + previewBoundsSlotId = graph.GraphModelSlotId('PreviewBounds') + inboundGradientSlotId = graph.GraphModelSlotId('InboundGradient') + outboundGradientSlotId = graph.GraphModelSlotId('OutboundGradient') + inboundGradientSlotId2 = graph.GraphControllerRequestBus(bus.Event, 'ExtendSlot', newGraphId, gradientMixerNode, + 'InboundGradient') - # Get component info - gradientMixerTypeId = hydra.get_component_type_id("Gradient Mixer") - perlinNoiseTypeId = hydra.get_component_type_id("Perlin Noise Gradient") - gradientMixerOutcome = editor.EditorComponentAPIBus(bus.Broadcast, 'GetComponentOfType', gradientMixerEntityId, - gradientMixerTypeId) - gradientMixerComponent = gradientMixerOutcome.GetValue() - perlinNoiseOutcome = editor.EditorComponentAPIBus(bus.Broadcast, 'GetComponentOfType', perlinNoiseEntityId, - perlinNoiseTypeId) - perlinNoiseComponent = perlinNoiseOutcome.GetValue() + # Connect slots on our nodes to construct a Gradient Mixer hierarchy + graph.GraphControllerRequestBus(bus.Event, 'AddConnectionBySlotId', newGraphId, boxShapeNode, boundsSlotId, + perlinNoiseNode, previewBoundsSlotId) + graph.GraphControllerRequestBus(bus.Event, 'AddConnectionBySlotId', newGraphId, boxShapeNode, boundsSlotId, + fastNoiseNode, previewBoundsSlotId) + graph.GraphControllerRequestBus(bus.Event, 'AddConnectionBySlotId', newGraphId, boxShapeNode, boundsSlotId, + gradientMixerNode, previewBoundsSlotId) + graph.GraphControllerRequestBus(bus.Event, 'AddConnectionBySlotId', newGraphId, perlinNoiseNode, outboundGradientSlotId, + gradientMixerNode, inboundGradientSlotId) + graph.GraphControllerRequestBus(bus.Event, 'AddConnectionBySlotId', newGraphId, fastNoiseNode, outboundGradientSlotId, + gradientMixerNode, inboundGradientSlotId2) - # Verify the Preview EntityId property on our Perlin Noise Gradient component has been set to our Box Shape's EntityId - previewEntityId = hydra.get_component_property_value(perlinNoiseComponent, 'Preview Settings|Pin Preview to Shape') - self.test_success = self.test_success and previewEntityId and boxShapeEntityId.invoke("Equal", previewEntityId) - if previewEntityId and boxShapeEntityId.invoke("Equal", previewEntityId): - self.log("Perlin Noise Gradient component Preview Entity property set to Box Shape EntityId") + # Delay to allow all the underlying component properties to be updated after the slot connections are made + general.idle_wait(1.0) - # Verify the 1st Inbound Gradient EntityId property on our Gradient Mixer component has been set to our Perlin Noise - # Gradient's EntityId - inboundGradientEntityId = hydra.get_component_property_value(gradientMixerComponent, - 'Configuration|Layers|[0]|Gradient|Gradient Entity Id') - self.test_success = self.test_success and inboundGradientEntityId and perlinNoiseEntityId.invoke("Equal", inboundGradientEntityId) - if inboundGradientEntityId and perlinNoiseEntityId.invoke("Equal", inboundGradientEntityId): - self.log("Gradient Mixer component Inbound Gradient extendable property set to Perlin Noise Gradient EntityId") + # Get component info + gradientMixerTypeId = hydra.get_component_type_id("Gradient Mixer") + perlinNoiseTypeId = hydra.get_component_type_id("Perlin Noise Gradient") + gradientMixerOutcome = editor.EditorComponentAPIBus(bus.Broadcast, 'GetComponentOfType', gradientMixerEntityId, + gradientMixerTypeId) + gradientMixerComponent = gradientMixerOutcome.GetValue() + perlinNoiseOutcome = editor.EditorComponentAPIBus(bus.Broadcast, 'GetComponentOfType', perlinNoiseEntityId, + perlinNoiseTypeId) + perlinNoiseComponent = perlinNoiseOutcome.GetValue() - # Verify the 2nd Inbound Gradient EntityId property on our Gradient Mixer component has been set to our FastNoise - # Gradient Modifier's EntityId - inboundGradientEntityId2 = hydra.get_component_property_value(gradientMixerComponent, - 'Configuration|Layers|[1]|Gradient|Gradient Entity Id') - self.test_success = self.test_success and inboundGradientEntityId2 and fastNoiseEntityId.invoke("Equal", inboundGradientEntityId2) - if inboundGradientEntityId2 and fastNoiseEntityId.invoke("Equal", inboundGradientEntityId2): - self.log("Gradient Mixer component Inbound Gradient extendable property set to FastNoise Gradient EntityId") + # Verify the Preview EntityId property on our Perlin Noise Gradient component has been set to our Box Shape's EntityId + previewEntityId = hydra.get_component_property_value(perlinNoiseComponent, 'Preview Settings|Pin Preview to Shape') + Report.result(Tests.preview_entity_set, previewEntityId and boxShapeEntityId.invoke("Equal", previewEntityId)) - # Verify that Gradient Mixer Layer Operations are properly set - hydra.get_component_property_value(gradientMixerComponent, 'Configuration|Layers|[0]|Operation') - hydra.get_component_property_value(gradientMixerComponent, 'Configuration|Layers|[1]|Operation') + # Verify the 1st Inbound Gradient EntityId property on our Gradient Mixer component has been set to our Perlin Noise + # Gradient's EntityId + inboundGradientEntityId = hydra.get_component_property_value(gradientMixerComponent, + 'Configuration|Layers|[0]|Gradient|Gradient Entity Id') + Report.result(Tests.mixer_inbound_gradient_set_a, inboundGradientEntityId and perlinNoiseEntityId.invoke("Equal", inboundGradientEntityId)) - # Stop listening for entity creation notifications - handler.disconnect() + # Verify the 2nd Inbound Gradient EntityId property on our Gradient Mixer component has been set to our FastNoise + # Gradient Modifier's EntityId + inboundGradientEntityId2 = hydra.get_component_property_value(gradientMixerComponent, + 'Configuration|Layers|[1]|Gradient|Gradient Entity Id') + Report.result(Tests.mixer_inbound_gradient_set_b, inboundGradientEntityId2 and fastNoiseEntityId.invoke("Equal", inboundGradientEntityId2)) + + # Verify that Gradient Mixer Layer Operations are properly set + mixer_operation_a = hydra.get_component_property_value(gradientMixerComponent, 'Configuration|Layers|[0]|Operation') + mixer_operation_b = hydra.get_component_property_value(gradientMixerComponent, 'Configuration|Layers|[1]|Operation') + Report.result(Tests.mixer_operation_a, mixer_operation_a == 0) + Report.result(Tests.mixer_operation_b, mixer_operation_b == 6) + + # Stop listening for entity creation notifications + handler.disconnect() -test = TestGradientMixerNodeConstruction() -test.run() +if __name__ == "__main__": + + from editor_python_test_tools.utils import Report + Report.start_test(GradientMixer_NodeConstruction) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientModifierNodes_EntityCreatedOnNodeAdd.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientModifierNodes_EntityCreatedOnNodeAdd.py index 43d39602be..c3952fe34b 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientModifierNodes_EntityCreatedOnNodeAdd.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientModifierNodes_EntityCreatedOnNodeAdd.py @@ -5,132 +5,134 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ -import os -import sys -import azlmbr.bus as bus -import azlmbr.editor as editor -import azlmbr.editor.graph as graph -import azlmbr.landscapecanvas as landscapecanvas -import azlmbr.legacy.general as general -import azlmbr.math as math -import azlmbr.paths +class Tests: + lc_tool_opened = ( + "Landscape Canvas tool opened", + "Failed to open Landscape Canvas tool" + ) + new_graph_created = ( + "Successfully created new graph", + "Failed to create new graph" + ) + graph_registered = ( + "Graph registered with Landscape Canvas", + "Failed to register graph" + ) + component_added = ( + "New entity created with the expected component", + "Expected component was not found on entity" + ) -sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests')) -import editor_python_test_tools.hydra_editor_utils as hydra -from editor_python_test_tools.editor_test_helper import EditorTestHelper -editorId = azlmbr.globals.property.LANDSCAPE_CANVAS_EDITOR_ID newEntityId = None -class TestGradientModifierNodeEntityCreate(EditorTestHelper): - def __init__(self): - EditorTestHelper.__init__(self, log_prefix="GradientModifierNodeEntityCreate", args=["level"]) +def GradientModifierNodes_EntityCreatedOnNodeAdd(): + """ + Summary: + This test verifies that the Landscape Canvas nodes can be added to a graph, and correctly create entities. - def run_test(self): - """ - Summary: - This test verifies that the Landscape Canvas nodes can be added to a graph, and correctly create entities. + Expected Behavior: + New entities are created when dragging Gradient Modifier nodes to graph area. - Expected Behavior: - New entities are created when dragging Gradient Modifier nodes to graph area. + Test Steps: + 1) Open a simple level + 2) Open Landscape Canvas and create a new graph + 3) Drag each of the Gradient Modifier nodes to the graph area, and ensure a new entity is created - Test Steps: - 1) Create a new level - 2) Open Landscape Canvas and create a new graph - 3) Drag each of the Gradient Modifier nodes to the graph area, and ensure a new entity is created + Note: + - This test file must be called from the Open 3D Engine Editor command terminal + - Any passed and failed tests are written to the Editor.log file. + Parsing the file or running a log_monitor are required to observe the test results. - Note: - - This test file must be called from the Open 3D Engine Editor command terminal - - Any passed and failed tests are written to the Editor.log file. - Parsing the file or running a log_monitor are required to observe the test results. + :return: None + """ - :return: None - """ + import azlmbr.bus as bus + import azlmbr.editor as editor + import azlmbr.editor.graph as graph + import azlmbr.landscapecanvas as landscapecanvas + import azlmbr.legacy.general as general + import azlmbr.math as math - def onEntityCreated(parameters): - global newEntityId - newEntityId = parameters[0] + import editor_python_test_tools.hydra_editor_utils as hydra + from editor_python_test_tools.utils import Report + from editor_python_test_tools.utils import TestHelper as helper - # Create a new empty level - self.test_success = self.create_level( - self.args["level"], - heightmap_resolution=128, - heightmap_meters_per_pixel=1, - terrain_texture_resolution=128, - use_terrain=False, - ) + editorId = azlmbr.globals.property.LANDSCAPE_CANVAS_EDITOR_ID - # Open Landscape Canvas tool and verify - general.open_pane('Landscape Canvas') - self.test_success = self.test_success and general.is_pane_visible('Landscape Canvas') - if general.is_pane_visible('Landscape Canvas'): - self.log('Landscape Canvas pane is open') + def onEntityCreated(parameters): + global newEntityId + newEntityId = parameters[0] - # Create a new graph in Landscape Canvas - newGraphId = graph.AssetEditorRequestBus(bus.Event, 'CreateNewGraph', editorId) - self.test_success = self.test_success and newGraphId - if newGraphId: - self.log("New graph created") + # Open an existing simple level + helper.init_idle() + helper.open_level("Physics", "Base") - # Make sure the graph we created is in Landscape Canvas - success = graph.AssetEditorRequestBus(bus.Event, 'ContainsGraph', editorId, newGraphId) - self.test_success = self.test_success and success - if success: - self.log("Graph registered with Landscape Canvas") + # Open Landscape Canvas tool and verify + general.open_pane('Landscape Canvas') + Report.critical_result(Tests.lc_tool_opened, general.is_pane_visible('Landscape Canvas')) - # Listen for entity creation notifications so we can check if the entity created - # from adding gradient modifier nodes has the appropriate Gradient Modifier Component - handler = editor.EditorEntityContextNotificationBusHandler() - handler.connect() - handler.add_callback('OnEditorEntityCreated', onEntityCreated) + # Create a new graph in Landscape Canvas + newGraphId = graph.AssetEditorRequestBus(bus.Event, 'CreateNewGraph', editorId) + Report.critical_result(Tests.new_graph_created, newGraphId is not None) - # Gradient modifier mapping with the key being the node name and the value is the - # expected Component that should be added to the Entity created for the node - gradientModifiers = { - 'DitherGradientModifierNode': 'Dither Gradient Modifier', - 'GradientMixerNode': 'Gradient Mixer', - 'InvertGradientModifierNode': 'Invert Gradient Modifier', - 'LevelsGradientModifierNode': 'Levels Gradient Modifier', - 'PosterizeGradientModifierNode': 'Posterize Gradient Modifier', - 'SmoothStepGradientModifierNode': 'Smooth-Step Gradient Modifier', - 'ThresholdGradientModifierNode': 'Threshold Gradient Modifier' - } + # Make sure the graph we created is in Landscape Canvas + graph_registered = graph.AssetEditorRequestBus(bus.Event, 'ContainsGraph', editorId, newGraphId) + Report.result(Tests.graph_registered, graph_registered) - # Retrieve a mapping of the TypeIds for all the components - # we will be checking for - componentNames = [] - for name in gradientModifiers: - componentNames.append(gradientModifiers[name]) - componentTypeIds = hydra.get_component_type_id_map(componentNames) + # Listen for entity creation notifications so we can check if the entity created + # from adding gradient modifier nodes has the appropriate Gradient Modifier Component + handler = editor.EditorEntityContextNotificationBusHandler() + handler.connect() + handler.add_callback('OnEditorEntityCreated', onEntityCreated) - # Create nodes for all the gradients modifiers we support and check if the Entity created by - # adding the node has the appropriate Component added automatically to it - newGraph = graph.GraphManagerRequestBus(bus.Broadcast, 'GetGraph', newGraphId) - x = 10.0 - y = 10.0 - for nodeName in gradientModifiers: - nodePosition = math.Vector2(x, y) - node = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, 'CreateNodeForTypeName', - newGraph, nodeName) - graph.GraphControllerRequestBus(bus.Event, 'AddNode', newGraphId, node, nodePosition) + # Gradient modifier mapping with the key being the node name and the value is the + # expected Component that should be added to the Entity created for the node + gradientModifiers = { + 'DitherGradientModifierNode': 'Dither Gradient Modifier', + 'GradientMixerNode': 'Gradient Mixer', + 'InvertGradientModifierNode': 'Invert Gradient Modifier', + 'LevelsGradientModifierNode': 'Levels Gradient Modifier', + 'PosterizeGradientModifierNode': 'Posterize Gradient Modifier', + 'SmoothStepGradientModifierNode': 'Smooth-Step Gradient Modifier', + 'ThresholdGradientModifierNode': 'Threshold Gradient Modifier' + } - gradientComponent = gradientModifiers[nodeName] - componentTypeId = componentTypeIds[gradientComponent] - hasComponent = editor.EditorComponentAPIBus(bus.Broadcast, 'HasComponentOfType', newEntityId, - componentTypeId) - self.test_success = self.test_success and hasComponent - if hasComponent: - self.log("{node} created new Entity with {component} Component".format(node=nodeName, - component=gradientComponent)) + # Retrieve a mapping of the TypeIds for all the components + # we will be checking for + componentNames = [] + for name in gradientModifiers: + componentNames.append(gradientModifiers[name]) + componentTypeIds = hydra.get_component_type_id_map(componentNames) - x += 40.0 - y += 40.0 + # Create nodes for all the gradients modifiers we support and check if the Entity created by + # adding the node has the appropriate Component added automatically to it + newGraph = graph.GraphManagerRequestBus(bus.Broadcast, 'GetGraph', newGraphId) + x = 10.0 + y = 10.0 + for nodeName in gradientModifiers: + nodePosition = math.Vector2(x, y) + node = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, 'CreateNodeForTypeName', + newGraph, nodeName) + graph.GraphControllerRequestBus(bus.Event, 'AddNode', newGraphId, node, nodePosition) - # Stop listening for entity creation notifications - handler.disconnect() + gradientComponent = gradientModifiers[nodeName] + componentTypeId = componentTypeIds[gradientComponent] + hasComponent = editor.EditorComponentAPIBus(bus.Broadcast, 'HasComponentOfType', newEntityId, + componentTypeId) + Report.info(f"Node: {nodeName} | Component: {gradientComponent}") + Report.result(Tests.component_added, hasComponent) + + x += 40.0 + y += 40.0 + + # Stop listening for entity creation notifications + handler.disconnect() -test = TestGradientModifierNodeEntityCreate() -test.run() +if __name__ == "__main__": + + from editor_python_test_tools.utils import Report + Report.start_test(GradientModifierNodes_EntityCreatedOnNodeAdd) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientModifierNodes_EntityRemovedOnNodeDelete.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientModifierNodes_EntityRemovedOnNodeDelete.py index f7b4dcf557..d7789a21fb 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientModifierNodes_EntityRemovedOnNodeDelete.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientModifierNodes_EntityRemovedOnNodeDelete.py @@ -5,126 +5,129 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ -import os -import sys -import azlmbr.bus as bus -import azlmbr.editor as editor -import azlmbr.editor.graph as graph -import azlmbr.landscapecanvas as landscapecanvas -import azlmbr.legacy.general as general -import azlmbr.math as math -import azlmbr.paths +class Tests: + lc_tool_opened = ( + "Landscape Canvas tool opened", + "Failed to open Landscape Canvas tool" + ) + new_graph_created = ( + "Successfully created new graph", + "Failed to create new graph" + ) + graph_registered = ( + "Graph registered with Landscape Canvas", + "Failed to register graph" + ) + entity_deleted = ( + "Entity was deleted when node was removed", + "Entity was not deleted as expected when node was removed" + ) -sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests')) -from editor_python_test_tools.editor_test_helper import EditorTestHelper -editorId = azlmbr.globals.property.LANDSCAPE_CANVAS_EDITOR_ID createdEntityId = None deletedEntityId = None -class TestGradientModifierNodeEntityDelete(EditorTestHelper): +def GradientModifierNodes_EntityRemovedOnNodeDelete(): + """ + Summary: + This test verifies that the Landscape Canvas node deletion properly cleans up entities in the Editor. - def __init__(self): - EditorTestHelper.__init__(self, log_prefix="GradientModifierNodeEntityDelete", args=["level"]) + Expected Behavior: + Entities are removed when Gradient Modifier nodes are deleted from a graph. - def run_test(self): - """ - Summary: - This test verifies that the Landscape Canvas node deletion properly cleans up entities in the Editor. + Test Steps: + 1) Open a simple level + 2) Open Landscape Canvas and create a new graph + 3) Drag each of the Gradient Modifier nodes to the graph area, and ensure a new entity is created + 4) Delete the nodes, and ensure the newly created entities are removed - Expected Behavior: - Entities are removed when Gradient Modifier nodes are deleted from a graph. + Note: + - This test file must be called from the Open 3D Engine Editor command terminal + - Any passed and failed tests are written to the Editor.log file. + Parsing the file or running a log_monitor are required to observe the test results. - Test Steps: - 1) Create a new level - 2) Open Landscape Canvas and create a new graph - 3) Drag each of the Gradient Modifier nodes to the graph area, and ensure a new entity is created - 4) Delete the nodes, and ensure the newly created entities are removed + :return: None + """ - Note: - - This test file must be called from the Open 3D Engine Editor command terminal - - Any passed and failed tests are written to the Editor.log file. - Parsing the file or running a log_monitor are required to observe the test results. + import azlmbr.bus as bus + import azlmbr.editor as editor + import azlmbr.editor.graph as graph + import azlmbr.landscapecanvas as landscapecanvas + import azlmbr.legacy.general as general + import azlmbr.math as math - :return: None - """ - def onEntityCreated(parameters): - global createdEntityId - createdEntityId = parameters[0] + from editor_python_test_tools.utils import Report + from editor_python_test_tools.utils import TestHelper as helper - def onEntityDeleted(parameters): - global deletedEntityId - deletedEntityId = parameters[0] + editorId = azlmbr.globals.property.LANDSCAPE_CANVAS_EDITOR_ID - # Create a new empty level - self.test_success = self.create_level( - self.args["level"], - heightmap_resolution=128, - heightmap_meters_per_pixel=1, - terrain_texture_resolution=128, - use_terrain=False, - ) + def onEntityCreated(parameters): + global createdEntityId + createdEntityId = parameters[0] - # Open Landscape Canvas tool and verify - general.open_pane('Landscape Canvas') - self.test_success = self.test_success and general.is_pane_visible('Landscape Canvas') - if general.is_pane_visible('Landscape Canvas'): - self.log('Landscape Canvas pane is open') + def onEntityDeleted(parameters): + global deletedEntityId + deletedEntityId = parameters[0] - # Create a new graph in Landscape Canvas - newGraphId = graph.AssetEditorRequestBus(bus.Event, 'CreateNewGraph', editorId) - self.test_success = self.test_success and newGraphId - if newGraphId: - self.log("New graph created") + # Open an existing simple level + helper.init_idle() + helper.open_level("Physics", "Base") - # Make sure the graph we created is in Landscape Canvas - success = graph.AssetEditorRequestBus(bus.Event, 'ContainsGraph', editorId, newGraphId) - self.test_success = self.test_success and success - if success: - self.log("Graph registered with Landscape Canvas") + # Open Landscape Canvas tool and verify + general.open_pane('Landscape Canvas') + Report.critical_result(Tests.lc_tool_opened, general.is_pane_visible('Landscape Canvas')) - # Listen for entity creation notifications so we can check if the entity created - # from adding gradient nodes has the appropriate Gradient Component - handler = editor.EditorEntityContextNotificationBusHandler() - handler.connect() - handler.add_callback('OnEditorEntityCreated', onEntityCreated) - handler.add_callback('OnEditorEntityDeleted', onEntityDeleted) + # Create a new graph in Landscape Canvas + newGraphId = graph.AssetEditorRequestBus(bus.Event, 'CreateNewGraph', editorId) + Report.critical_result(Tests.new_graph_created, newGraphId is not None) - # Vegetation Area mapping with the key being the node name and the value is the - # expected Component that should be added to the Entity created for the node - gradientModifiers = [ - 'DitherGradientModifierNode', - 'GradientMixerNode', - 'InvertGradientModifierNode', - 'LevelsGradientModifierNode', - 'PosterizeGradientModifierNode', - 'SmoothStepGradientModifierNode', - 'ThresholdGradientModifierNode' - ] + # Make sure the graph we created is in Landscape Canvas + graph_registered = graph.AssetEditorRequestBus(bus.Event, 'ContainsGraph', editorId, newGraphId) + Report.result(Tests.graph_registered, graph_registered) - # Create nodes for all the gradients we support and check if the Entity created by - # adding the node has the appropriate Component added automatically to it - newGraph = graph.GraphManagerRequestBus(bus.Broadcast, 'GetGraph', newGraphId) - x = 10.0 - y = 10.0 - for nodeName in gradientModifiers: - nodePosition = math.Vector2(x, y) - node = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, 'CreateNodeForTypeName', newGraph, nodeName) - graph.GraphControllerRequestBus(bus.Event, 'AddNode', newGraphId, node, nodePosition) + # Listen for entity creation notifications so we can check if the entity created + # from adding gradient nodes has the appropriate Gradient Component + handler = editor.EditorEntityContextNotificationBusHandler() + handler.connect() + handler.add_callback('OnEditorEntityCreated', onEntityCreated) + handler.add_callback('OnEditorEntityDeleted', onEntityDeleted) - removed = graph.GraphControllerRequestBus(bus.Event, 'RemoveNode', newGraphId, node) + # Vegetation Area mapping with the key being the node name and the value is the + # expected Component that should be added to the Entity created for the node + gradientModifiers = [ + 'DitherGradientModifierNode', + 'GradientMixerNode', + 'InvertGradientModifierNode', + 'LevelsGradientModifierNode', + 'PosterizeGradientModifierNode', + 'SmoothStepGradientModifierNode', + 'ThresholdGradientModifierNode' + ] - # Verify that the created Entity for this node matches the Entity that gets - # deleted when the node is removed - self.test_success = self.test_success and removed and createdEntityId.invoke("Equal", deletedEntityId) - if removed and createdEntityId.invoke("Equal", deletedEntityId): - self.log("{node} corresponding Entity was deleted when node is removed".format(node=nodeName)) + # Create nodes for all the gradients we support and check if the Entity created by + # adding the node has the appropriate Component added automatically to it + newGraph = graph.GraphManagerRequestBus(bus.Broadcast, 'GetGraph', newGraphId) + x = 10.0 + y = 10.0 + for nodeName in gradientModifiers: + nodePosition = math.Vector2(x, y) + node = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, 'CreateNodeForTypeName', newGraph, nodeName) + graph.GraphControllerRequestBus(bus.Event, 'AddNode', newGraphId, node, nodePosition) - # Stop listening for entity creation notifications - handler.disconnect() + removed = graph.GraphControllerRequestBus(bus.Event, 'RemoveNode', newGraphId, node) + + # Verify that the created Entity for this node matches the Entity that gets + # deleted when the node is removed + Report.info(f"Node: {nodeName}") + Report.result(Tests.entity_deleted, removed and createdEntityId.invoke("Equal", deletedEntityId)) + + # Stop listening for entity creation notifications + handler.disconnect() -test = TestGradientModifierNodeEntityDelete() -test.run() +if __name__ == "__main__": + + from editor_python_test_tools.utils import Report + Report.start_test(GradientModifierNodes_EntityRemovedOnNodeDelete) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientNodes_DependentComponentsAdded.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientNodes_DependentComponentsAdded.py index 96eac887cd..c04f9f05f6 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientNodes_DependentComponentsAdded.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientNodes_DependentComponentsAdded.py @@ -5,141 +5,143 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ -import os -import sys -import azlmbr.bus as bus -import azlmbr.editor as editor -import azlmbr.editor.graph as graph -import azlmbr.landscapecanvas as landscapecanvas -import azlmbr.legacy.general as general -import azlmbr.math as math -import azlmbr.paths +class Tests: + lc_tool_opened = ( + "Landscape Canvas tool opened", + "Failed to open Landscape Canvas tool" + ) + new_graph_created = ( + "Successfully created new graph", + "Failed to create new graph" + ) + graph_registered = ( + "Graph registered with Landscape Canvas", + "Failed to register graph" + ) + dependencies_added = ( + "Node created new Entity with all required components", + "Failed to create node with all required components" + ) -sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests')) -import editor_python_test_tools.hydra_editor_utils as hydra -from editor_python_test_tools.editor_test_helper import EditorTestHelper -editorId = azlmbr.globals.property.LANDSCAPE_CANVAS_EDITOR_ID newEntityId = None -class TestGradientNodeComponentDependency(EditorTestHelper): - def __init__(self): - EditorTestHelper.__init__(self, log_prefix="GradientNodeComponentDependency", args=["level"]) +def GradientNodes_DependentComponentsAdded(): + """ + Summary: + This test verifies that the Landscape Canvas nodes can be added to a graph, and correctly create entities with + proper dependent components. - def run_test(self): - """ - Summary: - This test verifies that the Landscape Canvas nodes can be added to a graph, and correctly create entities with - proper dependent components. + Expected Behavior: + All expected component dependencies are met when adding a Gradient Modifier node to a graph. - Expected Behavior: - All expected component dependencies are met when adding a Gradient Modifier node to a graph. + Test Steps: + 1) Open a simple level + 2) Open Landscape Canvas and create a new graph + 3) Drag each of the Gradient Modifier nodes to the graph area, and ensure the proper dependent components are + added - Test Steps: - 1) Create a new level - 2) Open Landscape Canvas and create a new graph - 3) Drag each of the Gradient Modifier nodes to the graph area, and ensure the proper dependent components are - added + Note: + - This test file must be called from the Open 3D Engine Editor command terminal + - Any passed and failed tests are written to the Editor.log file. + Parsing the file or running a log_monitor are required to observe the test results. - Note: - - This test file must be called from the Open 3D Engine Editor command terminal - - Any passed and failed tests are written to the Editor.log file. - Parsing the file or running a log_monitor are required to observe the test results. + :return: None + """ - :return: None - """ + import azlmbr.bus as bus + import azlmbr.editor as editor + import azlmbr.editor.graph as graph + import azlmbr.landscapecanvas as landscapecanvas + import azlmbr.legacy.general as general + import azlmbr.math as math - def onEntityCreated(parameters): - global newEntityId - newEntityId = parameters[0] + import editor_python_test_tools.hydra_editor_utils as hydra + from editor_python_test_tools.utils import Report + from editor_python_test_tools.utils import TestHelper as helper - # Create a new empty level - self.test_success = self.create_level( - self.args["level"], - heightmap_resolution=1024, - heightmap_meters_per_pixel=1, - terrain_texture_resolution=4096, - use_terrain=False, - ) + editorId = azlmbr.globals.property.LANDSCAPE_CANVAS_EDITOR_ID - # Open Landscape Canvas tool and verify - general.open_pane('Landscape Canvas') - self.test_success = self.test_success and general.is_pane_visible('Landscape Canvas') - if general.is_pane_visible('Landscape Canvas'): - self.log('Landscape Canvas pane is open') + def onEntityCreated(parameters): + global newEntityId + newEntityId = parameters[0] - # Create a new graph in Landscape Canvas - newGraphId = graph.AssetEditorRequestBus(bus.Event, 'CreateNewGraph', editorId) - self.test_success = self.test_success and newGraphId - if newGraphId: - self.log("New graph created") + # Open an existing simple level + helper.init_idle() + helper.open_level("Physics", "Base") - # Make sure the graph we created is in Landscape Canvas - success = graph.AssetEditorRequestBus(bus.Event, 'ContainsGraph', editorId, newGraphId) - self.test_success = self.test_success and success - if success: - self.log("Graph registered with Landscape Canvas") + # Open Landscape Canvas tool and verify + general.open_pane('Landscape Canvas') + Report.critical_result(Tests.lc_tool_opened, general.is_pane_visible('Landscape Canvas')) - # Listen for entity creation notifications so we can check if the entity created - # from adding these gradients nodes has the main target Gradient Component - # as well as automatically adding all required dependency components - handler = editor.EditorEntityContextNotificationBusHandler() - handler.connect() - handler.add_callback('OnEditorEntityCreated', onEntityCreated) + # Create a new graph in Landscape Canvas + newGraphId = graph.AssetEditorRequestBus(bus.Event, 'CreateNewGraph', editorId) + Report.critical_result(Tests.new_graph_created, newGraphId is not None) - # Gradient mapping with the key being the node name and the value is the - # expected Component that should be added to the Entity created for the node - gradients = { - 'FastNoiseGradientNode': 'FastNoise Gradient', - 'ImageGradientNode': 'Image Gradient', - 'PerlinNoiseGradientNode': 'Perlin Noise Gradient', - 'RandomNoiseGradientNode': 'Random Noise Gradient' - } + # Make sure the graph we created is in Landscape Canvas + graph_registered = graph.AssetEditorRequestBus(bus.Event, 'ContainsGraph', editorId, newGraphId) + Report.result(Tests.graph_registered, graph_registered) - # Retrieve a mapping of the TypeIds for all the components - # we will be checking for - commonComponents = [ - 'Gradient Transform Modifier', - 'Vegetation Reference Shape' - ] - componentNames = [] - for name in gradients: - componentNames.append(gradients[name]) - componentNames.extend(commonComponents) - componentTypeIds = hydra.get_component_type_id_map(componentNames) + # Listen for entity creation notifications so we can check if the entity created + # from adding these gradients nodes has the main target Gradient Component + # as well as automatically adding all required dependency components + handler = editor.EditorEntityContextNotificationBusHandler() + handler.connect() + handler.add_callback('OnEditorEntityCreated', onEntityCreated) - # Create nodes for the gradients that have additional required dependencies and check if - # the Entity created by adding the node has the appropriate Component and required - # Gradient Transform Modifier and Vegetation Reference Shape components added automatically to it - newGraph = graph.GraphManagerRequestBus(bus.Broadcast, 'GetGraph', newGraphId) - x = 10.0 - y = 10.0 - for nodeName in gradients: - nodePosition = math.Vector2(x, y) - node = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, 'CreateNodeForTypeName', newGraph, nodeName) - graph.GraphControllerRequestBus(bus.Event, 'AddNode', newGraphId, node, nodePosition) + # Gradient mapping with the key being the node name and the value is the + # expected Component that should be added to the Entity created for the node + gradients = { + 'FastNoiseGradientNode': 'FastNoise Gradient', + 'ImageGradientNode': 'Image Gradient', + 'PerlinNoiseGradientNode': 'Perlin Noise Gradient', + 'RandomNoiseGradientNode': 'Random Noise Gradient' + } - gradientComponent = gradients[nodeName] - components = [gradientComponent] + commonComponents - success = False - for component in components: - componentTypeId = componentTypeIds[component] - success = editor.EditorComponentAPIBus(bus.Broadcast, 'HasComponentOfType', newEntityId, componentTypeId) - self.test_success = self.test_success and success - if not success: - break + # Retrieve a mapping of the TypeIds for all the components + # we will be checking for + commonComponents = [ + 'Gradient Transform Modifier', + 'Vegetation Reference Shape' + ] + componentNames = [] + for name in gradients: + componentNames.append(gradients[name]) + componentNames.extend(commonComponents) + componentTypeIds = hydra.get_component_type_id_map(componentNames) - if success: - self.log("{node} created new Entity with all required components".format(node=nodeName)) + # Create nodes for the gradients that have additional required dependencies and check if + # the Entity created by adding the node has the appropriate Component and required + # Gradient Transform Modifier and Vegetation Reference Shape components added automatically to it + newGraph = graph.GraphManagerRequestBus(bus.Broadcast, 'GetGraph', newGraphId) + x = 10.0 + y = 10.0 + for nodeName in gradients: + nodePosition = math.Vector2(x, y) + node = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, 'CreateNodeForTypeName', newGraph, nodeName) + graph.GraphControllerRequestBus(bus.Event, 'AddNode', newGraphId, node, nodePosition) - x += 40.0 - y += 40.0 + gradientComponent = gradients[nodeName] + components = [gradientComponent] + commonComponents + success = False + for component in components: + componentTypeId = componentTypeIds[component] + success = editor.EditorComponentAPIBus(bus.Broadcast, 'HasComponentOfType', newEntityId, componentTypeId) + if not success: + break + Report.info(nodeName) + Report.result(Tests.dependencies_added, success) - # Stop listening for entity creation notifications - handler.disconnect() + x += 40.0 + y += 40.0 + + # Stop listening for entity creation notifications + handler.disconnect() -test = TestGradientNodeComponentDependency() -test.run() +if __name__ == "__main__": + + from editor_python_test_tools.utils import Report + Report.start_test(GradientNodes_DependentComponentsAdded) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientNodes_EntityCreatedOnNodeAdd.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientNodes_EntityCreatedOnNodeAdd.py index a484de8d2a..d5595e342c 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientNodes_EntityCreatedOnNodeAdd.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientNodes_EntityCreatedOnNodeAdd.py @@ -5,130 +5,134 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ -import os, sys -import azlmbr.bus as bus -import azlmbr.editor as editor -import azlmbr.editor.graph as graph -import azlmbr.landscapecanvas as landscapecanvas -import azlmbr.legacy.general as general -import azlmbr.math as math -import azlmbr.paths +class Tests: + lc_tool_opened = ( + "Landscape Canvas tool opened", + "Failed to open Landscape Canvas tool" + ) + new_graph_created = ( + "Successfully created new graph", + "Failed to create new graph" + ) + graph_registered = ( + "Graph registered with Landscape Canvas", + "Failed to register graph" + ) + component_added = ( + "New entity created with the expected component", + "Expected component was not found on entity" + ) -sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests')) -import editor_python_test_tools.hydra_editor_utils as hydra -from editor_python_test_tools.editor_test_helper import EditorTestHelper -editorId = azlmbr.globals.property.LANDSCAPE_CANVAS_EDITOR_ID newEntityId = None -class TestGradientNodeEntityCreate(EditorTestHelper): - def __init__(self): - EditorTestHelper.__init__(self, log_prefix="GradientNodeEntityCreate", args=["level"]) +def GradientNodes_EntityCreatedOnNodeAdd(): + """ + Summary: + This test verifies that the Landscape Canvas nodes can be added to a graph, and correctly create entities. - def run_test(self): - """ - Summary: - This test verifies that the Landscape Canvas nodes can be added to a graph, and correctly create entities. + Expected Behavior: + New entities are created when dragging Gradient nodes to graph area. - Expected Behavior: - New entities are created when dragging Gradient nodes to graph area. + Test Steps: + 1) Open a simple level + 2) Open Landscape Canvas and create a new graph + 3) Drag each of the Gradient nodes to the graph area, and ensure a new entity is created - Test Steps: - 1) Create a new level - 2) Open Landscape Canvas and create a new graph - 3) Drag each of the Gradient nodes to the graph area, and ensure a new entity is created + Note: + - This test file must be called from the Open 3D Engine Editor command terminal + - Any passed and failed tests are written to the Editor.log file. + Parsing the file or running a log_monitor are required to observe the test results. - Note: - - This test file must be called from the Open 3D Engine Editor command terminal - - Any passed and failed tests are written to the Editor.log file. - Parsing the file or running a log_monitor are required to observe the test results. + :return: None + """ - :return: None - """ + import azlmbr.bus as bus + import azlmbr.editor as editor + import azlmbr.editor.graph as graph + import azlmbr.landscapecanvas as landscapecanvas + import azlmbr.legacy.general as general + import azlmbr.math as math - def onEntityCreated(parameters): - global newEntityId - newEntityId = parameters[0] + import editor_python_test_tools.hydra_editor_utils as hydra + from editor_python_test_tools.utils import Report + from editor_python_test_tools.utils import TestHelper as helper - # Create a new empty level - self.test_success = self.create_level( - self.args["level"], - heightmap_resolution=1024, - heightmap_meters_per_pixel=1, - terrain_texture_resolution=4096, - use_terrain=False, - ) + editorId = azlmbr.globals.property.LANDSCAPE_CANVAS_EDITOR_ID - # Open Landscape Canvas tool and verify - general.open_pane('Landscape Canvas') - self.test_success = self.test_success and general.is_pane_visible('Landscape Canvas') - if general.is_pane_visible('Landscape Canvas'): - self.log('Landscape Canvas pane is open') + def onEntityCreated(parameters): + global newEntityId + newEntityId = parameters[0] - # Create a new graph in Landscape Canvas - newGraphId = graph.AssetEditorRequestBus(bus.Event, 'CreateNewGraph', editorId) - self.test_success = self.test_success and newGraphId - if newGraphId: - self.log("New graph created") + # Open an existing simple level + helper.init_idle() + helper.open_level("Physics", "Base") - # Make sure the graph we created is in Landscape Canvas - success = graph.AssetEditorRequestBus(bus.Event, 'ContainsGraph', editorId, newGraphId) - self.test_success = self.test_success and success - if success: - self.log("Graph registered with Landscape Canvas") + # Open Landscape Canvas tool and verify + general.open_pane('Landscape Canvas') + Report.critical_result(Tests.lc_tool_opened, general.is_pane_visible('Landscape Canvas')) - # Listen for entity creation notifications so we can check if the entity created - # from adding gradient nodes has the appropriate Gradient Component - handler = editor.EditorEntityContextNotificationBusHandler() - handler.connect() - handler.add_callback('OnEditorEntityCreated', onEntityCreated) + # Create a new graph in Landscape Canvas + newGraphId = graph.AssetEditorRequestBus(bus.Event, 'CreateNewGraph', editorId) + Report.critical_result(Tests.new_graph_created, newGraphId is not None) - # Gradient mapping with the key being the node name and the value is the - # expected Component that should be added to the Entity created for the node - gradients = { - 'AltitudeGradientNode': 'Altitude Gradient', - 'ConstantGradientNode': 'Constant Gradient', - 'FastNoiseGradientNode': 'FastNoise Gradient', - 'ImageGradientNode': 'Image Gradient', - 'PerlinNoiseGradientNode': 'Perlin Noise Gradient', - 'RandomNoiseGradientNode': 'Random Noise Gradient', - 'ShapeAreaFalloffGradientNode': 'Shape Falloff Gradient', - 'SlopeGradientNode': 'Slope Gradient', - 'SurfaceMaskGradientNode': 'Surface Mask Gradient', - } + # Make sure the graph we created is in Landscape Canvas + graph_registered = graph.AssetEditorRequestBus(bus.Event, 'ContainsGraph', editorId, newGraphId) + Report.result(Tests.graph_registered, graph_registered) - # Retrieve a mapping of the TypeIds for all the components - # we will be checking for - componentNames = [] - for name in gradients: - componentNames.append(gradients[name]) - componentTypeIds = hydra.get_component_type_id_map(componentNames) + # Listen for entity creation notifications so we can check if the entity created + # from adding gradient nodes has the appropriate Gradient Component + handler = editor.EditorEntityContextNotificationBusHandler() + handler.connect() + handler.add_callback('OnEditorEntityCreated', onEntityCreated) - # Create nodes for all the gradients we support and check if the Entity created by - # adding the node has the appropriate Component added automatically to it - newGraph = graph.GraphManagerRequestBus(bus.Broadcast, 'GetGraph', newGraphId) - x = 10.0 - y = 10.0 - for nodeName in gradients: - nodePosition = math.Vector2(x, y) - node = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, 'CreateNodeForTypeName', newGraph, nodeName) - graph.GraphControllerRequestBus(bus.Event, 'AddNode', newGraphId, node, nodePosition) + # Gradient mapping with the key being the node name and the value is the + # expected Component that should be added to the Entity created for the node + gradients = { + 'AltitudeGradientNode': 'Altitude Gradient', + 'ConstantGradientNode': 'Constant Gradient', + 'FastNoiseGradientNode': 'FastNoise Gradient', + 'ImageGradientNode': 'Image Gradient', + 'PerlinNoiseGradientNode': 'Perlin Noise Gradient', + 'RandomNoiseGradientNode': 'Random Noise Gradient', + 'ShapeAreaFalloffGradientNode': 'Shape Falloff Gradient', + 'SlopeGradientNode': 'Slope Gradient', + 'SurfaceMaskGradientNode': 'Surface Mask Gradient', + } - gradientComponent = gradients[nodeName] - componentTypeId = componentTypeIds[gradientComponent] - hasComponent = editor.EditorComponentAPIBus(bus.Broadcast, 'HasComponentOfType', newEntityId, componentTypeId) - self.test_success = self.test_success and hasComponent - if hasComponent: - self.log("{node} created new Entity with {component} Component".format(node=nodeName, component=gradientComponent)) + # Retrieve a mapping of the TypeIds for all the components + # we will be checking for + componentNames = [] + for name in gradients: + componentNames.append(gradients[name]) + componentTypeIds = hydra.get_component_type_id_map(componentNames) - x += 40.0 - y += 40.0 + # Create nodes for all the gradients we support and check if the Entity created by + # adding the node has the appropriate Component added automatically to it + newGraph = graph.GraphManagerRequestBus(bus.Broadcast, 'GetGraph', newGraphId) + x = 10.0 + y = 10.0 + for nodeName in gradients: + nodePosition = math.Vector2(x, y) + node = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, 'CreateNodeForTypeName', newGraph, nodeName) + graph.GraphControllerRequestBus(bus.Event, 'AddNode', newGraphId, node, nodePosition) - # Stop listening for entity creation notifications - handler.disconnect() + gradientComponent = gradients[nodeName] + componentTypeId = componentTypeIds[gradientComponent] + hasComponent = editor.EditorComponentAPIBus(bus.Broadcast, 'HasComponentOfType', newEntityId, componentTypeId) + Report.info(f"Node: {nodeName} | Component: {gradientComponent}") + Report.result(Tests.component_added, hasComponent) + + x += 40.0 + y += 40.0 + + # Stop listening for entity creation notifications + handler.disconnect() -test = TestGradientNodeEntityCreate() -test.run() +if __name__ == "__main__": + + from editor_python_test_tools.utils import Report + Report.start_test(GradientNodes_EntityCreatedOnNodeAdd) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientNodes_EntityRemovedOnNodeDelete.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientNodes_EntityRemovedOnNodeDelete.py index 2e289ff41b..e5bfbfc7f1 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientNodes_EntityRemovedOnNodeDelete.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientNodes_EntityRemovedOnNodeDelete.py @@ -5,129 +5,131 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ -import os -import sys -import azlmbr.bus as bus -import azlmbr.editor as editor -import azlmbr.editor.graph as graph -import azlmbr.landscapecanvas as landscapecanvas -import azlmbr.legacy.general as general -import azlmbr.math as math -import azlmbr.paths +class Tests: + lc_tool_opened = ( + "Landscape Canvas tool opened", + "Failed to open Landscape Canvas tool" + ) + new_graph_created = ( + "Successfully created new graph", + "Failed to create new graph" + ) + graph_registered = ( + "Graph registered with Landscape Canvas", + "Failed to register graph" + ) + entity_deleted = ( + "Entity was deleted when node was removed", + "Entity was not deleted as expected when node was removed" + ) -sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests')) -from editor_python_test_tools.editor_test_helper import EditorTestHelper -editorId = azlmbr.globals.property.LANDSCAPE_CANVAS_EDITOR_ID createdEntityId = None deletedEntityId = None -class TestGradientNodeEntityDelete(EditorTestHelper): +def GradientNodes_EntityRemovedOnNodeDelete(): + """ + Summary: + This test verifies that the Landscape Canvas node deletion properly cleans up entities in the Editor. - def __init__(self): - EditorTestHelper.__init__(self, log_prefix="GradientNodeEntityDelete", args=["level"]) + Expected Behavior: + Entities are removed when Gradient nodes are deleted from a graph. - def run_test(self): - """ - Summary: - This test verifies that the Landscape Canvas node deletion properly cleans up entities in the Editor. + Test Steps: + 1) Open a simple level + 2) Open Landscape Canvas and create a new graph + 3) Drag each of the Gradient nodes to the graph area, and ensure a new entity is created + 4) Delete the nodes, and ensure the newly created entities are removed - Expected Behavior: - Entities are removed when Gradient nodes are deleted from a graph. + Note: + - This test file must be called from the Open 3D Engine Editor command terminal + - Any passed and failed tests are written to the Editor.log file. + Parsing the file or running a log_monitor are required to observe the test results. - Test Steps: - 1) Create a new level - 2) Open Landscape Canvas and create a new graph - 3) Drag each of the Gradient nodes to the graph area, and ensure a new entity is created - 4) Delete the nodes, and ensure the newly created entities are removed + :return: None + """ - Note: - - This test file must be called from the Open 3D Engine Editor command terminal - - Any passed and failed tests are written to the Editor.log file. - Parsing the file or running a log_monitor are required to observe the test results. + import azlmbr.bus as bus + import azlmbr.editor as editor + import azlmbr.editor.graph as graph + import azlmbr.landscapecanvas as landscapecanvas + import azlmbr.legacy.general as general + import azlmbr.math as math - :return: None - """ + from editor_python_test_tools.utils import Report + from editor_python_test_tools.utils import TestHelper as helper - def onEntityCreated(parameters): - global createdEntityId - createdEntityId = parameters[0] + editorId = azlmbr.globals.property.LANDSCAPE_CANVAS_EDITOR_ID - def onEntityDeleted(parameters): - global deletedEntityId - deletedEntityId = parameters[0] + def onEntityCreated(parameters): + global createdEntityId + createdEntityId = parameters[0] - # Create a new empty level - self.test_success = self.create_level( - self.args["level"], - heightmap_resolution=1024, - heightmap_meters_per_pixel=1, - terrain_texture_resolution=4096, - use_terrain=False, - ) + def onEntityDeleted(parameters): + global deletedEntityId + deletedEntityId = parameters[0] - # Open Landscape Canvas tool and verify - general.open_pane('Landscape Canvas') - self.test_success = self.test_success and general.is_pane_visible('Landscape Canvas') - if general.is_pane_visible('Landscape Canvas'): - self.log('Landscape Canvas pane is open') + # Open an existing simple level + helper.init_idle() + helper.open_level("Physics", "Base") - # Create a new graph in Landscape Canvas - newGraphId = graph.AssetEditorRequestBus(bus.Event, 'CreateNewGraph', editorId) - self.test_success = self.test_success and newGraphId - if newGraphId: - self.log("New graph created") + # Open Landscape Canvas tool and verify + general.open_pane('Landscape Canvas') + Report.critical_result(Tests.lc_tool_opened, general.is_pane_visible('Landscape Canvas')) - # Make sure the graph we created is in Landscape Canvas - success = graph.AssetEditorRequestBus(bus.Event, 'ContainsGraph', editorId, newGraphId) - self.test_success = self.test_success and success - if success: - self.log("Graph registered with Landscape Canvas") + # Create a new graph in Landscape Canvas + newGraphId = graph.AssetEditorRequestBus(bus.Event, 'CreateNewGraph', editorId) + Report.critical_result(Tests.new_graph_created, newGraphId is not None) - # Listen for entity creation notifications so we can check if the entity created - # from adding gradient nodes has the appropriate Gradient Component - handler = editor.EditorEntityContextNotificationBusHandler() - handler.connect() - handler.add_callback('OnEditorEntityCreated', onEntityCreated) - handler.add_callback('OnEditorEntityDeleted', onEntityDeleted) + # Make sure the graph we created is in Landscape Canvas + graph_registered = graph.AssetEditorRequestBus(bus.Event, 'ContainsGraph', editorId, newGraphId) + Report.result(Tests.graph_registered, graph_registered) - # Gradient mapping with the key being the node name and the value is the - # expected Component that should be added to the Entity created for the node - gradients = [ - 'AltitudeGradientNode', - 'ConstantGradientNode', - 'FastNoiseGradientNode', - 'ImageGradientNode', - 'PerlinNoiseGradientNode', - 'RandomNoiseGradientNode', - 'ShapeAreaFalloffGradientNode', - 'SlopeGradientNode', - 'SurfaceMaskGradientNode', - ] + # Listen for entity creation notifications so we can check if the entity created + # from adding gradient nodes has the appropriate Gradient Component + handler = editor.EditorEntityContextNotificationBusHandler() + handler.connect() + handler.add_callback('OnEditorEntityCreated', onEntityCreated) + handler.add_callback('OnEditorEntityDeleted', onEntityDeleted) - # Create nodes for all the gradients we support and check if the Entity created by - # adding the node has the appropriate Component added automatically to it - newGraph = graph.GraphManagerRequestBus(bus.Broadcast, 'GetGraph', newGraphId) - x = 10.0 - y = 10.0 - for nodeName in gradients: - nodePosition = math.Vector2(x, y) - node = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, 'CreateNodeForTypeName', newGraph, nodeName) - graph.GraphControllerRequestBus(bus.Event, 'AddNode', newGraphId, node, nodePosition) + # Gradient mapping with the key being the node name and the value is the + # expected Component that should be added to the Entity created for the node + gradients = [ + 'AltitudeGradientNode', + 'ConstantGradientNode', + 'FastNoiseGradientNode', + 'ImageGradientNode', + 'PerlinNoiseGradientNode', + 'RandomNoiseGradientNode', + 'ShapeAreaFalloffGradientNode', + 'SlopeGradientNode', + 'SurfaceMaskGradientNode', + ] - removed = graph.GraphControllerRequestBus(bus.Event, 'RemoveNode', newGraphId, node) + # Create nodes for all the gradients we support and check if the Entity created by + # adding the node has the appropriate Component added automatically to it + newGraph = graph.GraphManagerRequestBus(bus.Broadcast, 'GetGraph', newGraphId) + x = 10.0 + y = 10.0 + for nodeName in gradients: + nodePosition = math.Vector2(x, y) + node = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, 'CreateNodeForTypeName', newGraph, nodeName) + graph.GraphControllerRequestBus(bus.Event, 'AddNode', newGraphId, node, nodePosition) - # Verify that the created Entity for this node matches the Entity that gets - # deleted when the node is removed - self.test_success = self.test_success and removed and createdEntityId.invoke("Equal", deletedEntityId) - if removed and createdEntityId.invoke("Equal", deletedEntityId): - self.log("{node} corresponding Entity was deleted when node is removed".format(node=nodeName)) + removed = graph.GraphControllerRequestBus(bus.Event, 'RemoveNode', newGraphId, node) - # Stop listening for entity creation notifications - handler.disconnect() + # Verify that the created Entity for this node matches the Entity that gets + # deleted when the node is removed + Report.info(f"Node: {nodeName}") + Report.result(Tests.entity_deleted, removed and createdEntityId.invoke("Equal", deletedEntityId)) + + # Stop listening for entity creation notifications + handler.disconnect() -test = TestGradientNodeEntityDelete() -test.run() +if __name__ == "__main__": + + from editor_python_test_tools.utils import Report + Report.start_test(GradientNodes_EntityRemovedOnNodeDelete) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GraphClosed_OnEntityDelete.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GraphClosed_OnEntityDelete.py index 0ad1549b60..0f83688206 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GraphClosed_OnEntityDelete.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GraphClosed_OnEntityDelete.py @@ -5,100 +5,99 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ -import os -import sys -import azlmbr.bus as bus -import azlmbr.editor as editor -import azlmbr.editor.graph as graph -import azlmbr.legacy.general as general -import azlmbr.paths +class Tests: + lc_tool_opened = ( + "Landscape Canvas tool opened", + "Failed to open Landscape Canvas tool" + ) + graph_registered = ( + "Graph registered with Landscape Canvas", + "Failed to register graph" + ) + graph_closed = ( + "Graph closed on entity delete", + "Graph is still open after entity delete" + ) -sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests')) -from editor_python_test_tools.editor_test_helper import EditorTestHelper -editorId = azlmbr.globals.property.LANDSCAPE_CANVAS_EDITOR_ID newRootEntityId = None -class TestGraphClosedOnEntityDelete(EditorTestHelper): +def GraphClosed_OnEntityDelete(): + """ + Summary: + This test verifies that Landscape Canvas graphs are auto-closed when the corresponding entity is deleted. - def __init__(self): - EditorTestHelper.__init__(self, log_prefix="GraphClosedOnEntityDelete", args=["level"]) + Expected Behavior: + When a Landscape Canvas root entity is deleted, the corresponding graph automatically closes. - def run_test(self): - """ - Summary: - This test verifies that Landscape Canvas graphs are auto-closed when the corresponding entity is deleted. + Test Steps: + 1) Open a simple level + 2) Open Landscape Canvas and create a new graph + 3) Delete the automatically created entity + 4) Verify the open graph is closed - Expected Behavior: - When a Landscape Canvas root entity is deleted, the corresponding graph automatically closes. + Note: + - This test file must be called from the Open 3D Engine Editor command terminal + - Any passed and failed tests are written to the Editor.log file. + Parsing the file or running a log_monitor are required to observe the test results. - Test Steps: - 1) Create a new level - 2) Open Landscape Canvas and create a new graph - 3) Delete the automatically created entity - 4) Verify the open graph is closed + :return: None + """ - Note: - - This test file must be called from the Open 3D Engine Editor command terminal - - Any passed and failed tests are written to the Editor.log file. - Parsing the file or running a log_monitor are required to observe the test results. + import azlmbr.bus as bus + import azlmbr.editor as editor + import azlmbr.editor.graph as graph + import azlmbr.legacy.general as general - :return: None - """ + from editor_python_test_tools.utils import Report + from editor_python_test_tools.utils import TestHelper as helper - def onEntityCreated(parameters): - global newRootEntityId - newRootEntityId = parameters[0] + editorId = azlmbr.globals.property.LANDSCAPE_CANVAS_EDITOR_ID - # Create a new empty level - self.test_success = self.create_level( - self.args["level"], - heightmap_resolution=128, - heightmap_meters_per_pixel=1, - terrain_texture_resolution=128, - use_terrain=False, - ) + def onEntityCreated(parameters): + global newRootEntityId + newRootEntityId = parameters[0] - # Open Landscape Canvas tool and verify - general.open_pane('Landscape Canvas') - self.test_success = self.test_success and general.is_pane_visible('Landscape Canvas') - if general.is_pane_visible('Landscape Canvas'): - self.log('Landscape Canvas pane is open') + # Open an existing simple level + helper.init_idle() + helper.open_level("Physics", "Base") - # Listen for entity creation notifications so we can store the top-level Entity created - # when a new graph is created, and then delete it to test if the graph is closed - handler = editor.EditorEntityContextNotificationBusHandler() - handler.connect() - handler.add_callback('OnEditorEntityCreated', onEntityCreated) + # Open Landscape Canvas tool and verify + general.open_pane('Landscape Canvas') + Report.critical_result(Tests.lc_tool_opened, general.is_pane_visible('Landscape Canvas')) - # Create a new graph in Landscape Canvas and verify - newGraphId = graph.AssetEditorRequestBus(bus.Event, 'CreateNewGraph', editorId) - graphIsOpen = graph.AssetEditorRequestBus(bus.Event, 'ContainsGraph', editorId, newGraphId) - self.test_success = self.test_success and graphIsOpen - if graphIsOpen: - self.log("Graph registered with Landscape Canvas") + # Listen for entity creation notifications so we can store the top-level Entity created + # when a new graph is created, and then delete it to test if the graph is closed + handler = editor.EditorEntityContextNotificationBusHandler() + handler.connect() + handler.add_callback('OnEditorEntityCreated', onEntityCreated) - # Delete the top-level Entity created by the new graph - editor.ToolsApplicationRequestBus(bus.Broadcast, 'DeleteEntityById', newRootEntityId) + # Create a new graph in Landscape Canvas and verify + newGraphId = graph.AssetEditorRequestBus(bus.Event, 'CreateNewGraph', editorId) + graphIsOpen = graph.AssetEditorRequestBus(bus.Event, 'ContainsGraph', editorId, newGraphId) + Report.result(Tests.graph_registered, graphIsOpen) - # We need to delay here because the closing of the graph due to Entity deletion - # is actually queued in order to workaround an undo/redo issue - # Alternatively, we could add a notifications bus for AssetEditorRequests - # that could trigger when graphs are opened/closed and then do the check there - general.idle_enable(True) - general.idle_wait(1.0) + # Delete the top-level Entity created by the new graph + editor.ToolsApplicationRequestBus(bus.Broadcast, 'DeleteEntityById', newRootEntityId) - # Verify that the corresponding graph is no longer open - graphIsClosed = not graph.AssetEditorRequestBus(bus.Event, 'ContainsGraph', editorId, newGraphId) - self.test_success = self.test_success and graphIsClosed - if graphIsClosed: - self.log("The graph is no longer open after deleting the Entity") + # We need to delay here because the closing of the graph due to Entity deletion + # is actually queued in order to workaround an undo/redo issue + # Alternatively, we could add a notifications bus for AssetEditorRequests + # that could trigger when graphs are opened/closed and then do the check there + general.idle_enable(True) + general.idle_wait(1.0) - # Stop listening for entity creation notifications - handler.disconnect() + # Verify that the corresponding graph is no longer open + graphIsClosed = not graph.AssetEditorRequestBus(bus.Event, 'ContainsGraph', editorId, newGraphId) + Report.result(Tests.graph_closed, graphIsClosed) + + # Stop listening for entity creation notifications + handler.disconnect() -test = TestGraphClosedOnEntityDelete() -test.run() +if __name__ == "__main__": + + from editor_python_test_tools.utils import Report + Report.start_test(GraphClosed_OnEntityDelete) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GraphClosed_OnLevelChange.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GraphClosed_OnLevelChange.py index 374f26d3a4..67c2ec6908 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GraphClosed_OnLevelChange.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GraphClosed_OnLevelChange.py @@ -5,82 +5,82 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ -import os -import sys -import azlmbr.bus as bus -import azlmbr.editor.graph as graph -import azlmbr.legacy.general as general -import azlmbr.paths - -sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests')) -from editor_python_test_tools.editor_test_helper import EditorTestHelper - -editorId = azlmbr.globals.property.LANDSCAPE_CANVAS_EDITOR_ID +class Tests: + lc_tool_opened = ( + "Landscape Canvas tool opened", + "Failed to open Landscape Canvas tool" + ) + new_graph_created = ( + "Successfully created new graph", + "Failed to create new graph" + ) + graph_registered = ( + "Graph registered with Landscape Canvas", + "Failed to register graph" + ) + graph_closed = ( + "Graph closed on level change", + "Graph is still open after level change" + ) -class TestGraphClosedOnLevelChange(EditorTestHelper): +def GraphClosed_OnLevelChange(): + """ + Summary: + This test verifies that Landscape Canvas graphs are auto-closed when the currently open level changes. - def __init__(self): - EditorTestHelper.__init__(self, log_prefix="GraphClosedOnLevelChange", args=["level"]) + Expected Behavior: + When a new level is loaded in the Editor, open Landscape Canvas graphs are automatically closed. - def run_test(self): - """ - Summary: - This test verifies that Landscape Canvas graphs are auto-closed when the currently open level changes. + Test Steps: + 1) Open a simple level + 2) Open Landscape Canvas and create a new graph + 3) Open a different level + 4) Verify the open graph is closed - Expected Behavior: - When a new level is loaded in the Editor, open Landscape Canvas graphs are automatically closed. + Note: + - This test file must be called from the Open 3D Engine Editor command terminal + - Any passed and failed tests are written to the Editor.log file. + Parsing the file or running a log_monitor are required to observe the test results. - Test Steps: - 1) Create a new level - 2) Open Landscape Canvas and create a new graph - 3) Open a different level - 4) Verify the open graph is closed + :return: None + """ - Note: - - This test file must be called from the Open 3D Engine Editor command terminal - - Any passed and failed tests are written to the Editor.log file. - Parsing the file or running a log_monitor are required to observe the test results. + import azlmbr.bus as bus + import azlmbr.editor.graph as graph + import azlmbr.legacy.general as general - :return: None - """ - # Create a new empty level - self.test_success = self.create_level( - self.args["level"], - heightmap_resolution=128, - heightmap_meters_per_pixel=1, - terrain_texture_resolution=128, - use_terrain=False, - ) + from editor_python_test_tools.utils import Report + from editor_python_test_tools.utils import TestHelper as helper - # Open Landscape Canvas tool and verify - general.open_pane('Landscape Canvas') - self.test_success = self.test_success and general.is_pane_visible('Landscape Canvas') - if general.is_pane_visible('Landscape Canvas'): - self.log('Landscape Canvas pane is open') + editorId = azlmbr.globals.property.LANDSCAPE_CANVAS_EDITOR_ID - # Create a new graph in Landscape Canvas - newGraphId = graph.AssetEditorRequestBus(bus.Event, 'CreateNewGraph', editorId) - self.test_success = self.test_success and newGraphId - if newGraphId: - self.log("New graph created") + # Open an existing simple level + helper.init_idle() + helper.open_level("Physics", "Base") - # Make sure the graph we created is in Landscape Canvas - graphIsOpen = graph.AssetEditorRequestBus(bus.Event, 'ContainsGraph', editorId, newGraphId) - self.test_success = self.test_success and graphIsOpen - if graphIsOpen: - self.log("Graph registered with Landscape Canvas") + # Open Landscape Canvas tool and verify + general.open_pane('Landscape Canvas') + Report.critical_result(Tests.lc_tool_opened, general.is_pane_visible('Landscape Canvas')) - # Open a different level, which should close any open Landscape Canvas graphs - general.open_level_no_prompt('WhiteBox/EmptyLevel') + # Create a new graph in Landscape Canvas + newGraphId = graph.AssetEditorRequestBus(bus.Event, 'CreateNewGraph', editorId) + Report.critical_result(Tests.new_graph_created, newGraphId is not None) - # Make sure the graph we created is now closed - graphIsOpen = graph.AssetEditorRequestBus(bus.Event, 'ContainsGraph', editorId, newGraphId) - self.test_success = self.test_success and not graphIsOpen - if not graphIsOpen: - self.log("Graph is no longer open in Landscape Canvas") + # Make sure the graph we created is in Landscape Canvas + graph_registered = graph.AssetEditorRequestBus(bus.Event, 'ContainsGraph', editorId, newGraphId) + Report.result(Tests.graph_registered, graph_registered) + + # Open a different level, which should close any open Landscape Canvas graphs + general.open_level_no_prompt('WhiteBox/EmptyLevel') + + # Make sure the graph we created is now closed + graphIsOpen = graph.AssetEditorRequestBus(bus.Event, 'ContainsGraph', editorId, newGraphId) + Report.result(Tests.graph_closed, not graphIsOpen) -test = TestGraphClosedOnLevelChange() -test.run() +if __name__ == "__main__": + + from editor_python_test_tools.utils import Report + Report.start_test(GraphClosed_OnLevelChange) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GraphClosed_TabbedGraph.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GraphClosed_TabbedGraph.py index f8b0cfdb44..83762e0afb 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GraphClosed_TabbedGraph.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GraphClosed_TabbedGraph.py @@ -5,95 +5,93 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ -import os -import sys -import azlmbr.bus as bus -import azlmbr.editor.graph as graph -import azlmbr.legacy.general as general -import azlmbr.paths - -sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests')) -from editor_python_test_tools.editor_test_helper import EditorTestHelper - -editorId = azlmbr.globals.property.LANDSCAPE_CANVAS_EDITOR_ID +class Tests: + lc_tool_opened = ( + "Landscape Canvas tool opened", + "Failed to open Landscape Canvas tool" + ) + new_graph_created = ( + "Successfully created new graph", + "Failed to create new graph" + ) + graph_open = ( + "Graph is open in Landscape Canvas", + "Graph is not open in Landscape Canvas" + ) + tabbed_graph_closed = ( + "Tabbed graph closed independently", + "Closing tabbed graph resulted in unexpected graphs closing" + ) -class TestGraphClosedTabbedGraph(EditorTestHelper): +def GraphClosed_TabbedGraphClosesIndependently(): + """ + Summary: + This test verifies that Landscape Canvas tabbed graphs can be independently closed. - def __init__(self): - EditorTestHelper.__init__(self, log_prefix="GraphClosedTabbedGraph", args=["level"]) + Expected Behavior: + Closing a tabbed graph only closes the appropriate graph. - def run_test(self): - """ - Summary: - This test verifies that Landscape Canvas tabbed graphs can be independently closed. + Test Steps: + 1) Open a simple level + 2) Open Landscape Canvas and create several new graphs + 3) Close one of the open graphs + 4) Ensure the graph properly closed, and other open graphs remain open - Expected Behavior: - Closing a tabbed graph only closes the appropriate graph. + Note: + - This test file must be called from the Open 3D Engine Editor command terminal + - Any passed and failed tests are written to the Editor.log file. + Parsing the file or running a log_monitor are required to observe the test results. - Test Steps: - 1) Create a new level - 2) Open Landscape Canvas and create several new graphs - 3) Close one of the open graphs - 4) Ensure the graph properly closed, and other open graphs remain open + :return: None + """ - Note: - - This test file must be called from the Open 3D Engine Editor command terminal - - Any passed and failed tests are written to the Editor.log file. - Parsing the file or running a log_monitor are required to observe the test results. + import azlmbr.bus as bus + import azlmbr.editor.graph as graph + import azlmbr.legacy.general as general - :return: None - """ + from editor_python_test_tools.utils import Report + from editor_python_test_tools.utils import TestHelper as helper - # Create a new empty level - self.test_success = self.create_level( - self.args["level"], - heightmap_resolution=128, - heightmap_meters_per_pixel=1, - terrain_texture_resolution=128, - use_terrain=False, - ) + editor_id = azlmbr.globals.property.LANDSCAPE_CANVAS_EDITOR_ID - # Open Landscape Canvas tool and verify - general.open_pane('Landscape Canvas') - self.test_success = self.test_success and general.is_pane_visible('Landscape Canvas') - if general.is_pane_visible('Landscape Canvas'): - self.log('Landscape Canvas pane is open') + def create_new_graph(): + new_graph_id = graph.AssetEditorRequestBus(bus.Event, 'CreateNewGraph', editor_id) + return new_graph_id - # Create 3 new graphs in Landscape Canvas - newGraphId = graph.AssetEditorRequestBus(bus.Event, 'CreateNewGraph', editorId) - self.test_success = self.test_success and newGraphId - if newGraphId: - self.log("New graph created") + def is_graph_open(graph_id): + graph_open = graph.AssetEditorRequestBus(bus.Event, 'ContainsGraph', editor_id, graph_id) + return graph_open - newGraphId2 = graph.AssetEditorRequestBus(bus.Event, 'CreateNewGraph', editorId) - self.test_success = self.test_success and newGraphId2 - if newGraphId2: - self.log("2nd new graph created") + # Open an existing simple level + helper.init_idle() + helper.open_level("Physics", "Base") - newGraphId3 = graph.AssetEditorRequestBus(bus.Event, 'CreateNewGraph', editorId) - self.test_success = self.test_success and newGraphId3 - if newGraphId3: - self.log("3rd new graph created") + # Open Landscape Canvas tool and verify + general.open_pane('Landscape Canvas') + Report.critical_result(Tests.lc_tool_opened, general.is_pane_visible('Landscape Canvas')) - # Make sure the graphs we created are open in Landscape Canvas - success = graph.AssetEditorRequestBus(bus.Event, 'ContainsGraph', editorId, newGraphId) - success2 = graph.AssetEditorRequestBus(bus.Event, 'ContainsGraph', editorId, newGraphId2) - success3 = graph.AssetEditorRequestBus(bus.Event, 'ContainsGraph', editorId, newGraphId3) - self.test_success = self.test_success and success and success2 and success3 - if success and success2 and success3: - self.log("Graphs registered with Landscape Canvas") + # Create 3 new graphs in Landscape Canvas and make sure the graphs we created are open in Landscape Canvas + graph1 = create_new_graph() + Report.result(Tests.new_graph_created, graph1 is not None) + Report.result(Tests.graph_open, is_graph_open(graph1)) - # Close a single graph and verify it was properly closed and other graphs remain open - success4 = graph.AssetEditorRequestBus(bus.Event, 'CloseGraph', editorId, newGraphId2) - success = graph.AssetEditorRequestBus(bus.Event, 'ContainsGraph', editorId, newGraphId) - success2 = graph.AssetEditorRequestBus(bus.Event, 'ContainsGraph', editorId, newGraphId2) - success3 = graph.AssetEditorRequestBus(bus.Event, 'ContainsGraph', editorId, newGraphId3) - self.test_success = self.test_success and success and success3 and success4 and not success2 - if success and success3 and success4 and not success2: - self.log("Graph 2 was successfully closed") + graph2 = create_new_graph() + Report.result(Tests.new_graph_created, graph2 is not None) + Report.result(Tests.graph_open, is_graph_open(graph2)) + + graph3 = create_new_graph() + Report.result(Tests.new_graph_created, graph3 is not None) + Report.result(Tests.graph_open, is_graph_open(graph3)) + + # Close a single graph and verify it was properly closed and other graphs remain open + graph.AssetEditorRequestBus(bus.Event, 'CloseGraph', editor_id, graph2) + Report.result(Tests.tabbed_graph_closed, not is_graph_open(graph2) and is_graph_open(graph1) and + is_graph_open(graph3)) -test = TestGraphClosedTabbedGraph() -test.run() +if __name__ == "__main__": + + from editor_python_test_tools.utils import Report + Report.start_test(GraphClosed_TabbedGraphClosesIndependently) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GraphUpdates_UpdateComponents.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GraphUpdates_UpdateComponents.py index cc7c2ca7dd..c489c738d5 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GraphUpdates_UpdateComponents.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GraphUpdates_UpdateComponents.py @@ -5,155 +5,151 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ -import os -import sys -import azlmbr.asset as asset -import azlmbr.bus as bus -import azlmbr.editor as editor -import azlmbr.entity as entity -import azlmbr.legacy.general as general -import azlmbr.editor.graph as graph -import azlmbr.landscapecanvas as landscapecanvas -import azlmbr.math as math -import azlmbr.slice as slice -import azlmbr.paths - -import editor_python_test_tools.hydra_editor_utils as hydra -from editor_python_test_tools.editor_test_helper import EditorTestHelper - -sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests')) -import automatedtesting_shared.landscape_canvas_utils as lc +class Tests: + slice_instantiated = ( + "Slice instantiated successfully", + "Failed to instantiate slice" + ) + existing_graph_opened = ( + "Opened existing graph from slice", + "Failed to open existing graph" + ) + node_removed = ( + "Rotation Modifier node was removed", + "Failed to remove Rotation Modifier node" + ) + component_removed = ( + "Rotation Modifier component was removed from entity", + "Rotation Modifier component is still present on entity" + ) + entity_deleted = ( + "BushSpawner entity was deleted", + "Failed to delete BushSpawner entity" + ) + entity_reference_updated = ( + "Gradient Entity Id reference was properly updated", + "Gradient Entity Id reference was not updated properly" + ) -class TestGraphUpdatesUpdateComponents(EditorTestHelper): - def __init__(self): - EditorTestHelper.__init__(self, log_prefix="GraphUpdatesUpdateComponents", args=["level"]) +def GraphUpdates_UpdateComponent(): + """ + Summary: + This test verifies that components are properly updated as nodes are added/removed/updated. - def run_test(self): - """ - Summary: - This test verifies that components are properly updated as nodes are added/removed/updated. + Expected Behavior: + Landscape Canvas node CRUD properly updates component entities. - Expected Behavior: - Landscape Canvas node CRUD properly updates component entities. + Test Steps: + 1. Open Level. + 2. Open the graph on LC_BushFlowerBlender.slice + 3. Find the Rotation Modifier node on the BushSpawner entity + 4. Delete the Rotation Modifier node + 5. Ensure the Vegetation Rotation Modifier component is removed from the BushSpawner entity + 6. Delete the Vegetation Layer Spawner node from the graph + 7. Ensure BushSpawner entity is deleted + 8. Change connection from second Rotation Modifier node to a different Gradient + 9. Ensure Gradient reference on component is updated - Test Steps: - 1. Open Level. - 2. Open the graph on LC_BushFlowerBlender.slice - 3. Find the Rotation Modifier node on the BushSpawner entity - 4. Delete the Rotation Modifier node - 5. Ensure the Vegetation Rotation Modifier component is removed from the BushSpawner entity - 6. Delete the Vegetation Layer Spawner node from the graph - 7. Ensure BushSpawner entity is deleted - 8. Change connection from second Rotation Modifier node to a different Gradient - 9. Ensure Gradient reference on component is updated + Note: + - This test file must be called from the Open 3D Engine Editor command terminal + - Any passed and failed tests are written to the Editor.log file. + Parsing the file or running a log_monitor are required to observe the test results. - Note: - - This test file must be called from the Open 3D Engine Editor command terminal - - Any passed and failed tests are written to the Editor.log file. - Parsing the file or running a log_monitor are required to observe the test results. + :return: None + """ - :return: None - """ - # Create a new empty level and instantiate LC_BushFlowerBlender.slice - self.test_success = self.create_level( - self.args["level"], - heightmap_resolution=128, - heightmap_meters_per_pixel=1, - terrain_texture_resolution=128, - use_terrain=False, - ) - transform = math.Transform_CreateIdentity() - position = math.Vector3(64.0, 64.0, 32.0) - transform.invoke('SetPosition', position) - test_slice_path = os.path.join("Slices", "LC_BushFlowerBlender.slice") - test_slice_id = asset.AssetCatalogRequestBus(bus.Broadcast, "GetAssetIdByPath", test_slice_path, math.Uuid(), - False) - test_slice = slice.SliceRequestBus(bus.Broadcast, 'InstantiateSliceFromAssetId', test_slice_id, transform) - self.test_success = self.test_success and test_slice.IsValid() - if test_slice.IsValid(): - self.log("Slice spawned!") + import os - # Search for root entity to ensure slice is loaded - search_filter = entity.SearchFilter() - search_filter.names = ["LandscapeCanvas"] - self.wait_for_condition(lambda: len(entity.SearchBus(bus.Broadcast, 'SearchEntities', search_filter)) > 0, 5.0) + import azlmbr.asset as asset + import azlmbr.bus as bus + import azlmbr.editor as editor + import azlmbr.entity as entity + import azlmbr.legacy.general as general + import azlmbr.editor.graph as graph + import azlmbr.landscapecanvas as landscapecanvas + import azlmbr.math as math + import azlmbr.slice as slice - # Find needed entities in the loaded level - slice_root_id = hydra.find_entity_by_name('LandscapeCanvas') - bush_spawner_id = hydra.find_entity_by_name('BushSpawner') - flower_spawner_id = hydra.find_entity_by_name('FlowerSpawner') - inverted_perlin_noise_id = hydra.find_entity_by_name('Invert') + import automatedtesting_shared.landscape_canvas_utils as lc + import editor_python_test_tools.hydra_editor_utils as hydra + from editor_python_test_tools.utils import Report + from editor_python_test_tools.utils import TestHelper as helper - # Open Landscape Canvas and the existing graph - general.open_pane('Landscape Canvas') - open_graph_id = landscapecanvas.LandscapeCanvasRequestBus(bus.Broadcast, 'OnGraphEntity', slice_root_id) - self.test_success = self.test_success and open_graph_id.IsValid() - if open_graph_id.IsValid(): - self.log('Graph opened') + # Open a simple level and instantiate LC_BushFlowerBlender.slice + helper.init_idle() + helper.open_level("Physics", "Base") + transform = math.Transform_CreateIdentity() + position = math.Vector3(64.0, 64.0, 32.0) + transform.invoke('SetPosition', position) + test_slice_path = os.path.join("Slices", "LC_BushFlowerBlender.slice") + test_slice_id = asset.AssetCatalogRequestBus(bus.Broadcast, "GetAssetIdByPath", test_slice_path, math.Uuid(), + False) + test_slice = slice.SliceRequestBus(bus.Broadcast, 'InstantiateSliceFromAssetId', test_slice_id, transform) + Report.critical_result(Tests.slice_instantiated, test_slice.IsValid()) - # Find the Rotation Modifier node on the BushSpawner entity - rotation_modifier_node = lc.find_nodes_matching_entity_component('Vegetation Rotation Modifier', bush_spawner_id) + # Search for root entity to ensure slice is loaded + search_filter = entity.SearchFilter() + search_filter.names = ["LandscapeCanvas"] + helper.wait_for_condition(lambda: len(entity.SearchBus(bus.Broadcast, 'SearchEntities', search_filter)) > 0, 5.0) - # Remove the Rotation Modifier node - graph.GraphControllerRequestBus(bus.Event, 'RemoveNode', open_graph_id, rotation_modifier_node[0]) + # Find needed entities in the loaded level + slice_root_id = hydra.find_entity_by_name('LandscapeCanvas') + bush_spawner_id = hydra.find_entity_by_name('BushSpawner') + flower_spawner_id = hydra.find_entity_by_name('FlowerSpawner') + inverted_perlin_noise_id = hydra.find_entity_by_name('Invert') - # Verify node was removed - rotation_modifier_node = lc.find_nodes_matching_entity_component('Vegetation Rotation Modifier', bush_spawner_id) - self.test_success = self.test_success and not rotation_modifier_node - if not rotation_modifier_node: - self.log('Rotation Modifier node was removed') - else: - self.log('Rotation Modifier node was not removed') + # Open Landscape Canvas and the existing graph + general.open_pane('Landscape Canvas') + open_graph_id = landscapecanvas.LandscapeCanvasRequestBus(bus.Broadcast, 'OnGraphEntity', slice_root_id) + Report.critical_result(Tests.existing_graph_opened, open_graph_id.IsValid()) - # Verify the component was removed from the BushSpawner entity - has_rotation_modifier = editor.EditorComponentAPIBus(bus.Broadcast, 'HasComponentOfType', bush_spawner_id, - hydra.get_component_type_id('Vegetation Rotation Modifier')) - self.test_success = self.test_success and not has_rotation_modifier - if not has_rotation_modifier: - self.log('Rotation Modifier component was removed from entity') - else: - self.log('Rotation Modifier component is still present on entity') + # Find the Rotation Modifier node on the BushSpawner entity + rotation_modifier_node = lc.find_nodes_matching_entity_component('Vegetation Rotation Modifier', bush_spawner_id) - # Find the Vegetation Layer Spawner node on the BushSpawner entity - layer_spawner_node = lc.find_nodes_matching_entity_component('Vegetation Layer Spawner', bush_spawner_id) + # Remove the Rotation Modifier node + graph.GraphControllerRequestBus(bus.Event, 'RemoveNode', open_graph_id, rotation_modifier_node[0]) - # Remove the Vegetation Layer Spawner node and verify the corresponding entity is deleted - graph.GraphControllerRequestBus(bus.Event, 'RemoveNode', open_graph_id, layer_spawner_node[0]) - bush_spawner_id = hydra.find_entity_by_name('BushSpawner') - self.test_success = self.test_success and not bush_spawner_id - if not bush_spawner_id: - self.log('BushSpawner entity was deleted') - else: - self.log('Failed to delete BushSpawner entity') + # Verify node was removed + rotation_modifier_node = lc.find_nodes_matching_entity_component('Vegetation Rotation Modifier', bush_spawner_id) + Report.result(Tests.node_removed, not rotation_modifier_node) - # Connect the FlowerSpawner's Rotation Modifier node to the Invert Gradient Modifier node - rotation_modifier_node = lc.find_nodes_matching_entity_component('Vegetation Rotation Modifier', flower_spawner_id) - invert_node = lc.find_nodes_matching_entity_component('Invert Gradient Modifier', inverted_perlin_noise_id) + # Verify the component was removed from the BushSpawner entity + has_rotation_modifier = editor.EditorComponentAPIBus(bus.Broadcast, 'HasComponentOfType', bush_spawner_id, + hydra.get_component_type_id('Vegetation Rotation Modifier')) + Report.result(Tests.component_removed, not has_rotation_modifier) - inbound_gradient_z_slot = graph.GraphModelSlotId('InboundGradientZ') - outbound_gradient_slot = graph.GraphModelSlotId('OutboundGradient') - graph.GraphControllerRequestBus(bus.Event, 'AddConnectionBySlotId', open_graph_id, invert_node[0], - outbound_gradient_slot, rotation_modifier_node[0], inbound_gradient_z_slot) + # Find the Vegetation Layer Spawner node on the BushSpawner entity + layer_spawner_node = lc.find_nodes_matching_entity_component('Vegetation Layer Spawner', bush_spawner_id) - general.idle_wait(1.0) # Add a small wait to ensure component property has time to update + # Remove the Vegetation Layer Spawner node and verify the corresponding entity is deleted + graph.GraphControllerRequestBus(bus.Event, 'RemoveNode', open_graph_id, layer_spawner_node[0]) + bush_spawner_id = hydra.find_entity_by_name('BushSpawner') + Report.result(Tests.entity_deleted, not bush_spawner_id) - # Verify the Gradient Entity Id reference on the Rotation Modifier component was properly set - rotation_type_id = hydra.get_component_type_id('Vegetation Rotation Modifier') - rotation_outcome = editor.EditorComponentAPIBus(bus.Broadcast, 'GetComponentOfType', flower_spawner_id, - rotation_type_id) - rotation_component = rotation_outcome.GetValue() - gradient_reference = hydra.get_component_property_value(rotation_component, - 'Configuration|Rotation Z|Gradient|Gradient Entity Id') - gradient_reference_success = gradient_reference == inverted_perlin_noise_id - self.test_success = self.test_success and gradient_reference_success - if gradient_reference_success: - self.log('Gradient Entity Id reference was properly updated') - else: - self.log(f'Gradient Entity Id was not updated properly: Expected {inverted_perlin_noise_id.ToString()} -- Got ' - f'{gradient_reference.ToString()}.') + # Connect the FlowerSpawner's Rotation Modifier node to the Invert Gradient Modifier node + rotation_modifier_node = lc.find_nodes_matching_entity_component('Vegetation Rotation Modifier', flower_spawner_id) + invert_node = lc.find_nodes_matching_entity_component('Invert Gradient Modifier', inverted_perlin_noise_id) + + inbound_gradient_z_slot = graph.GraphModelSlotId('InboundGradientZ') + outbound_gradient_slot = graph.GraphModelSlotId('OutboundGradient') + graph.GraphControllerRequestBus(bus.Event, 'AddConnectionBySlotId', open_graph_id, invert_node[0], + outbound_gradient_slot, rotation_modifier_node[0], inbound_gradient_z_slot) + + general.idle_wait(1.0) # Add a small wait to ensure component property has time to update + + # Verify the Gradient Entity Id reference on the Rotation Modifier component was properly set + rotation_type_id = hydra.get_component_type_id('Vegetation Rotation Modifier') + rotation_outcome = editor.EditorComponentAPIBus(bus.Broadcast, 'GetComponentOfType', flower_spawner_id, + rotation_type_id) + rotation_component = rotation_outcome.GetValue() + gradient_reference = hydra.get_component_property_value(rotation_component, + 'Configuration|Rotation Z|Gradient|Gradient Entity Id') + Report.result(Tests.entity_reference_updated, gradient_reference == inverted_perlin_noise_id) -test = TestGraphUpdatesUpdateComponents() -test.run() +if __name__ == "__main__": + + from editor_python_test_tools.utils import Report + Report.start_test(GraphUpdates_UpdateComponent) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/LandscapeCanvasComponent_AddedRemoved.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/LandscapeCanvasComponent_AddedRemoved.py deleted file mode 100755 index ed6f23ae24..0000000000 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/LandscapeCanvasComponent_AddedRemoved.py +++ /dev/null @@ -1,87 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -import os -import sys - -import azlmbr.bus as bus -import azlmbr.editor as editor -import azlmbr.entity as entity -import azlmbr.paths - -sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests')) -import editor_python_test_tools.hydra_editor_utils as hydra -from editor_python_test_tools.editor_test_helper import EditorTestHelper - -editorId = azlmbr.globals.property.LANDSCAPE_CANVAS_EDITOR_ID - - -class TestLandscapeCanvasComponentAddedRemoved(EditorTestHelper): - - def __init__(self): - EditorTestHelper.__init__(self, log_prefix="LandscapeCanvasComponentAddedRemoved", args=["level"]) - - def run_test(self): - """ - Summary: - This test verifies that the Landscape Canvas component can be added to/removed from an entity. - - Expected Behavior: - Closing a tabbed graph only closes the appropriate graph. - - Test Steps: - 1) Create a new level - 2) Create a new entity - 3) Add a Landscape Canvas component to the entity - 4) Remove the Landscape Canvas component from the entity - - Note: - - This test file must be called from the Open 3D Engine Editor command terminal - - Any passed and failed tests are written to the Editor.log file. - Parsing the file or running a log_monitor are required to observe the test results. - - :return: None - """ - - # Create a new empty level - self.test_success = self.create_level( - self.args["level"], - heightmap_resolution=128, - heightmap_meters_per_pixel=1, - terrain_texture_resolution=128, - use_terrain=False, - ) - - # Create an Entity at the root of the level - newEntityId = editor.ToolsApplicationRequestBus(bus.Broadcast, 'CreateNewEntity', entity.EntityId()) - - # Find the component TypeId for our Landscape Canvas component - landscape_canvas_type_id = hydra.get_component_type_id("Landscape Canvas") - - # Add the Landscape Canvas Component to our Entity - componentOutcome = editor.EditorComponentAPIBus(bus.Broadcast, 'AddComponentsOfType', newEntityId, [landscape_canvas_type_id]) - components = componentOutcome.GetValue() - landscapeCanvasComponent = components[0] - - # Validate the Landscape Canvas Component exists - hasComponent = editor.EditorComponentAPIBus(bus.Broadcast, 'HasComponentOfType', newEntityId, landscape_canvas_type_id) - self.test_success = self.test_success and hasComponent - if hasComponent: - self.log("Landscape Canvas Component added to Entity") - - # Remove the Landscape Canvas Component - editor.EditorComponentAPIBus(bus.Broadcast, 'RemoveComponents', [landscapeCanvasComponent]) - - # Validate the Landscape Canvas Component is no longer on our Entity - hasComponent = editor.EditorComponentAPIBus(bus.Broadcast, 'HasComponentOfType', newEntityId, landscape_canvas_type_id) - self.test_success = self.test_success and not hasComponent - if not hasComponent: - self.log("Landscape Canvas Component removed from Entity") - - -test = TestLandscapeCanvasComponentAddedRemoved() -test.run() diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/LandscapeCanvas_SliceCreateInstantiate.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/LandscapeCanvas_SliceCreateInstantiate.py deleted file mode 100755 index 95da5aa7dd..0000000000 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/LandscapeCanvas_SliceCreateInstantiate.py +++ /dev/null @@ -1,82 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -import os -import sys - -import azlmbr.math as math -import azlmbr.paths -import azlmbr.bus as bus -import azlmbr.asset as asset -import azlmbr.slice as slice - -sys.path.append(os.path.join(azlmbr.paths.devroot, "AutomatedTesting", "Gem", "PythonTests")) -import editor_python_test_tools.hydra_editor_utils as hydra -from editor_python_test_tools.editor_test_helper import EditorTestHelper - - -class TestLandscapeCanvasSliceCreateInstantiate(EditorTestHelper): - def __init__(self): - EditorTestHelper.__init__(self, log_prefix="LandscapeCanvas_SliceCreateInstantiate", args=["level"]) - - def run_test(self): - """ - Summary: - A slice containing the LandscapeCanvas component can be created/instantiated. - - Expected Result: - Slice is created/processed/instantiated successfully and free of errors/warnings. - - Test Steps: - 1) Create a new level - 2) Create a new entity with a Landscape Canvas component - 3) Create a slice of the new entity - 4) Instantiate a new copy of the slice - - Note: - - This test file must be called from the Open 3D Engine Editor command terminal - - Any passed and failed tests are written to the Editor.log file. - Parsing the file or running a log_monitor are required to observe the test results. - :return: None - """ - - def path_is_valid_asset(asset_path): - asset_id = asset.AssetCatalogRequestBus(bus.Broadcast, "GetAssetIdByPath", asset_path, math.Uuid(), False) - return asset_id.invoke("IsValid") - - # Create empty level - self.test_success = self.create_level( - self.args["level"], - heightmap_resolution=1024, - heightmap_meters_per_pixel=1, - terrain_texture_resolution=4096, - use_terrain=False, - ) - - # Create entity with LandScape Canvas component - position = math.Vector3(512.0, 512.0, 32.0) - landscape_canvas = hydra.Entity("landscape_canvas_entity") - landscape_canvas.create_entity(position, ["Landscape Canvas"]) - - # Create slice from the created entity - slice_path = os.path.join("slices", "TestSlice.slice") - slice.SliceRequestBus(bus.Broadcast, "CreateNewSlice", landscape_canvas.id, slice_path) - - # Verify if slice is created - self.wait_for_condition(lambda: path_is_valid_asset(slice_path), 5.0) - self.log(f"Slice has been created successfully: {path_is_valid_asset(slice_path)}") - - # Instantiate slice - transform = math.Transform_CreateIdentity() - asset_id = asset.AssetCatalogRequestBus(bus.Broadcast, "GetAssetIdByPath", slice_path, math.Uuid(), False) - test_slice = slice.SliceRequestBus(bus.Broadcast, "InstantiateSliceFromAssetId", asset_id, transform) - self.wait_for_condition(lambda: test_slice.IsValid(), 3.0) - self.log(f"Slice instantiated: {test_slice.IsValid()}") - - -test = TestLandscapeCanvasSliceCreateInstantiate() -test.run() diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/LayerBlender_NodeConstruction.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/LayerBlender_NodeConstruction.py index f68bfd91a6..b2bf20411b 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/LayerBlender_NodeConstruction.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/LayerBlender_NodeConstruction.py @@ -5,157 +5,160 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ -import os -import sys -import azlmbr.bus as bus -import azlmbr.editor as editor -import azlmbr.editor.graph as graph -import azlmbr.entity as entity -import azlmbr.landscapecanvas as landscapecanvas -import azlmbr.legacy.general as general -import azlmbr.math as math -import azlmbr.paths +class Tests: + lc_tool_opened = ( + "Landscape Canvas tool opened", + "Failed to open Landscape Canvas tool" + ) + new_graph_created = ( + "Successfully created new graph", + "Failed to create new graph" + ) + graph_registered = ( + "Graph registered with Landscape Canvas", + "Failed to register graph" + ) + blender_first_layer_set = ( + "Spawner entity set as the first layer of the Vegetation Layer Blender component", + "Unexpected entity set as the first layer of the Vegetation Layer Blender component" + ) + blender_second_layer_set = ( + "Blocker entity set as the second layer of the Vegetation Layer Blender component", + "Unexpected entity set as the second layer of the Vegetation Layer Blender component" + ) -sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests')) -import editor_python_test_tools.hydra_editor_utils as hydra -from editor_python_test_tools.editor_test_helper import EditorTestHelper -editorId = azlmbr.globals.property.LANDSCAPE_CANVAS_EDITOR_ID newEntityId = None -class TestLayerBlenderNodeConstruction(EditorTestHelper): - def __init__(self): - EditorTestHelper.__init__(self, log_prefix="LayerBlenderNodeConstruction", args=["level"]) +def LayerBlender_NodeConstruction(): + """ + Summary: + This test verifies a Layer Blender vegetation setup can be constructed through Landscape Canvas. - def run_test(self): - """ - Summary: - This test verifies a Layer Blender vegetation setup can be constructed through Landscape Canvas. + Expected Behavior: + Entities contain all required components and component references after creating nodes and setting connections + on a Landscape Canvas graph. - Expected Behavior: - Entities contain all required components and component references after creating nodes and setting connections - on a Landscape Canvas graph. + Test Steps: + 1) Open a simple level + 2) Open Landscape Canvas and create a new graph + 3) Add all necessary nodes to the graph and set connections to form a Layer Blender setup + 4) Verify all components and component references were properly set during graph construction - Test Steps: - 1) Create a new level - 2) Open Landscape Canvas and create a new graph - 3) Add all necessary nodes to the graph and set connections to form a Layer Blender setup - 4) Verify all components and component references were properly set during graph construction + Note: + - This test file must be called from the Open 3D Engine Editor command terminal + - Any passed and failed tests are written to the Editor.log file. + Parsing the file or running a log_monitor are required to observe the test results. - Note: - - This test file must be called from the Open 3D Engine Editor command terminal - - Any passed and failed tests are written to the Editor.log file. - Parsing the file or running a log_monitor are required to observe the test results. + :return: None + """ - :return: None - """ + import azlmbr.bus as bus + import azlmbr.editor as editor + import azlmbr.editor.graph as graph + import azlmbr.landscapecanvas as landscapecanvas + import azlmbr.legacy.general as general + import azlmbr.math as math - def onEntityCreated(parameters): - global newEntityId - newEntityId = parameters[0] + import editor_python_test_tools.hydra_editor_utils as hydra + from editor_python_test_tools.utils import Report + from editor_python_test_tools.utils import TestHelper as helper - # Create a new empty level - self.test_success = self.create_level( - self.args["level"], - heightmap_resolution=1024, - heightmap_meters_per_pixel=1, - terrain_texture_resolution=4096, - use_terrain=False, - ) + editorId = azlmbr.globals.property.LANDSCAPE_CANVAS_EDITOR_ID - # Open Landscape Canvas tool and verify - general.open_pane('Landscape Canvas') - self.test_success = self.test_success and general.is_pane_visible('Landscape Canvas') - if general.is_pane_visible('Landscape Canvas'): - self.log('Landscape Canvas pane is open') + def onEntityCreated(parameters): + global newEntityId + newEntityId = parameters[0] - # Create a new graph in Landscape Canvas - newGraphId = graph.AssetEditorRequestBus(bus.Event, 'CreateNewGraph', editorId) - self.test_success = self.test_success and newGraphId - if newGraphId: - self.log("New graph created") + # Open an existing simple level + helper.init_idle() + helper.open_level("Physics", "Base") - # Make sure the graph we created is in Landscape Canvas - success = graph.AssetEditorRequestBus(bus.Event, 'ContainsGraph', editorId, newGraphId) - self.test_success = self.test_success and success - if success: - self.log("Graph registered with Landscape Canvas") + # Open Landscape Canvas tool and verify + general.open_pane('Landscape Canvas') + Report.critical_result(Tests.lc_tool_opened, general.is_pane_visible('Landscape Canvas')) - # Listen for entity creation notifications so we can verify the component EntityId - # references are set correctly when connecting slots on the nodes - handler = editor.EditorEntityContextNotificationBusHandler() - handler.connect() - handler.add_callback('OnEditorEntityCreated', onEntityCreated) + # Create a new graph in Landscape Canvas + newGraphId = graph.AssetEditorRequestBus(bus.Event, 'CreateNewGraph', editorId) + Report.critical_result(Tests.new_graph_created, newGraphId is not None) - positionX = 10.0 - positionY = 10.0 - offsetX = 340.0 - offsetY = 100.0 + # Make sure the graph we created is in Landscape Canvas + graph_registered = graph.AssetEditorRequestBus(bus.Event, 'ContainsGraph', editorId, newGraphId) + Report.result(Tests.graph_registered, graph_registered) - # Add a Vegetation Layer Spawner node to the graph - newGraph = graph.GraphManagerRequestBus(bus.Broadcast, 'GetGraph', newGraphId) - layerSpawnerNode = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, 'CreateNodeForTypeName', - newGraph, 'SpawnerAreaNode') - graph.GraphControllerRequestBus(bus.Event, 'AddNode', newGraphId, layerSpawnerNode, math.Vector2(positionX, positionY)) - layerSpawnerEntityId = newEntityId + # Listen for entity creation notifications so we can verify the component EntityId + # references are set correctly when connecting slots on the nodes + handler = editor.EditorEntityContextNotificationBusHandler() + handler.connect() + handler.add_callback('OnEditorEntityCreated', onEntityCreated) - positionX += offsetX - positionY += offsetY + positionX = 10.0 + positionY = 10.0 + offsetX = 340.0 + offsetY = 100.0 - # Add a Vegetation Layer Blocker node to the graph - layerBlockerNode = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, 'CreateNodeForTypeName', - newGraph, 'BlockerAreaNode') - graph.GraphControllerRequestBus(bus.Event, 'AddNode', newGraphId, layerBlockerNode, math.Vector2(positionX, positionY)) - layerBlockerEntityId = newEntityId + # Add a Vegetation Layer Spawner node to the graph + newGraph = graph.GraphManagerRequestBus(bus.Broadcast, 'GetGraph', newGraphId) + layerSpawnerNode = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, 'CreateNodeForTypeName', + newGraph, 'SpawnerAreaNode') + graph.GraphControllerRequestBus(bus.Event, 'AddNode', newGraphId, layerSpawnerNode, math.Vector2(positionX, positionY)) + layerSpawnerEntityId = newEntityId - positionX += offsetX - positionY += offsetY + positionX += offsetX + positionY += offsetY - # Add a Vegetation Layer Blender node to the graph - layerBlenderNode = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, 'CreateNodeForTypeName', - newGraph, 'AreaBlenderNode') - graph.GraphControllerRequestBus(bus.Event, 'AddNode', newGraphId, layerBlenderNode, math.Vector2(positionX, positionY)) - layerBlenderNodeEntityId = newEntityId + # Add a Vegetation Layer Blocker node to the graph + layerBlockerNode = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, 'CreateNodeForTypeName', + newGraph, 'BlockerAreaNode') + graph.GraphControllerRequestBus(bus.Event, 'AddNode', newGraphId, layerBlockerNode, math.Vector2(positionX, positionY)) + layerBlockerEntityId = newEntityId - positionX += offsetX - positionY += offsetY + positionX += offsetX + positionY += offsetY - outboundAreaSlotId = graph.GraphModelSlotId('OutboundArea') - inboundAreaSlotId = graph.GraphModelSlotId('InboundArea') - inboundAreaSlotId2 = graph.GraphControllerRequestBus(bus.Event, 'ExtendSlot', newGraphId, layerBlenderNode, - 'InboundArea') + # Add a Vegetation Layer Blender node to the graph + layerBlenderNode = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, 'CreateNodeForTypeName', + newGraph, 'AreaBlenderNode') + graph.GraphControllerRequestBus(bus.Event, 'AddNode', newGraphId, layerBlenderNode, math.Vector2(positionX, positionY)) + layerBlenderNodeEntityId = newEntityId - # Connect slots on our nodes to construct a Vegetation Layer Blender hierarchy - graph.GraphControllerRequestBus(bus.Event, 'AddConnectionBySlotId', newGraphId, layerSpawnerNode, outboundAreaSlotId, - layerBlenderNode, inboundAreaSlotId) - graph.GraphControllerRequestBus(bus.Event, 'AddConnectionBySlotId', newGraphId, layerBlockerNode, outboundAreaSlotId, - layerBlenderNode, inboundAreaSlotId2) + positionX += offsetX + positionY += offsetY - # Delay to allow all the underlying component properties to be updated after the slot connections are made - general.idle_wait(1.0) + outboundAreaSlotId = graph.GraphModelSlotId('OutboundArea') + inboundAreaSlotId = graph.GraphModelSlotId('InboundArea') + inboundAreaSlotId2 = graph.GraphControllerRequestBus(bus.Event, 'ExtendSlot', newGraphId, layerBlenderNode, + 'InboundArea') - # Get component info - layerBlenderTypeId = hydra.get_component_type_id("Vegetation Layer Blender") - vegetationLayerBlenderOutcome = editor.EditorComponentAPIBus(bus.Broadcast, 'GetComponentOfType', - layerBlenderNodeEntityId, layerBlenderTypeId) - layerBlenderComponent = vegetationLayerBlenderOutcome.GetValue() + # Connect slots on our nodes to construct a Vegetation Layer Blender hierarchy + graph.GraphControllerRequestBus(bus.Event, 'AddConnectionBySlotId', newGraphId, layerSpawnerNode, outboundAreaSlotId, + layerBlenderNode, inboundAreaSlotId) + graph.GraphControllerRequestBus(bus.Event, 'AddConnectionBySlotId', newGraphId, layerBlockerNode, outboundAreaSlotId, + layerBlenderNode, inboundAreaSlotId2) - # Verify the Vegetation Areas properties on our Vegetation Layer Blender component have been set to our area EntityIds - area1EntityId = hydra.get_component_property_value(layerBlenderComponent, 'Configuration|Vegetation Areas|[0]') - self.test_success = self.test_success and area1EntityId and layerSpawnerEntityId.invoke("Equal", area1EntityId) - if area1EntityId and layerSpawnerEntityId.invoke("Equal", area1EntityId): - self.log("Vegetation Layer Blender component Vegetation Areas[0] property set to Vegetation Layer Spawner EntityId") + # Delay to allow all the underlying component properties to be updated after the slot connections are made + general.idle_wait(1.0) - area2EntityId = hydra.get_component_property_value(layerBlenderComponent, 'Configuration|Vegetation Areas|[1]') - self.test_success = self.test_success and area2EntityId and layerBlockerEntityId.invoke("Equal", area2EntityId) - if area2EntityId and layerBlockerEntityId.invoke("Equal", area2EntityId): - self.log("Vegetation Layer Blender component Vegetation Areas[1] property set to Vegetation Layer Blocker EntityId") + # Get component info + layerBlenderTypeId = hydra.get_component_type_id("Vegetation Layer Blender") + vegetationLayerBlenderOutcome = editor.EditorComponentAPIBus(bus.Broadcast, 'GetComponentOfType', + layerBlenderNodeEntityId, layerBlenderTypeId) + layerBlenderComponent = vegetationLayerBlenderOutcome.GetValue() - # Stop listening for entity creation notifications - handler.disconnect() + # Verify the Vegetation Areas properties on our Vegetation Layer Blender component have been set to our area EntityIds + area1EntityId = hydra.get_component_property_value(layerBlenderComponent, 'Configuration|Vegetation Areas|[0]') + Report.result(Tests.blender_first_layer_set, area1EntityId and layerSpawnerEntityId.invoke("Equal", area1EntityId)) + + area2EntityId = hydra.get_component_property_value(layerBlenderComponent, 'Configuration|Vegetation Areas|[1]') + Report.result(Tests.blender_second_layer_set, area2EntityId and layerBlockerEntityId.invoke("Equal", area2EntityId)) + + # Stop listening for entity creation notifications + handler.disconnect() -test = TestLayerBlenderNodeConstruction() -test.run() +if __name__ == "__main__": + + from editor_python_test_tools.utils import Report + Report.start_test(LayerBlender_NodeConstruction) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/LayerExtenderNodes_ComponentEntitySync.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/LayerExtenderNodes_ComponentEntitySync.py index 5b523e0b38..510c404614 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/LayerExtenderNodes_ComponentEntitySync.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/LayerExtenderNodes_ComponentEntitySync.py @@ -5,164 +5,170 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ -import os -import sys -import azlmbr.bus as bus -import azlmbr.editor as editor -import azlmbr.editor.graph as graph -import azlmbr.landscapecanvas as landscapecanvas -import azlmbr.legacy.general as general -import azlmbr.math as math -import azlmbr.paths +class Tests: + lc_tool_opened = ( + "Landscape Canvas tool opened", + "Failed to open Landscape Canvas tool" + ) + new_graph_created = ( + "Successfully created new graph", + "Failed to create new graph" + ) + graph_registered = ( + "Graph registered with Landscape Canvas", + "Failed to register graph" + ) + component_added = ( + "Expected component is present on entity", + "Expected component was not found on entity" + ) + component_removed = ( + "Expected component was removed from entity", + "Component is unexpectedly still present on entity" + ) -sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests')) -import editor_python_test_tools.hydra_editor_utils as hydra -from editor_python_test_tools.editor_test_helper import EditorTestHelper -editorId = azlmbr.globals.property.LANDSCAPE_CANVAS_EDITOR_ID newEntityId = None -class TestLayerExtenderNodeComponentEntitySync(EditorTestHelper): +def LayerExtenderNodes_ComponentEntitySync(): + """ + Summary: + This test verifies that all wrapped nodes can be successfully added to/removed from parent nodes. - def __init__(self): - EditorTestHelper.__init__(self, log_prefix="LayerExtenderNodeComponentEntitySync", args=["level"]) + Expected Behavior: + All wrapped extender nodes can be added to/removed from appropriate parent nodes. - def run_test(self): - """ - Summary: - This test verifies that all wrapped nodes can be successfully added to/removed from parent nodes. + Test Steps: + 1) Open a simple level + 2) Open Landscape Canvas and create a new graph + 3) Add Area Blender and Layer Spawner nodes to the graph, and add/remove each extender node to/from each - Expected Behavior: - All wrapped extender nodes can be added to/removed from appropriate parent nodes. + Note: + - This test file must be called from the Open 3D Engine Editor command terminal + - Any passed and failed tests are written to the Editor.log file. + Parsing the file or running a log_monitor are required to observe the test results. - Test Steps: - 1) Create a new level - 2) Open Landscape Canvas and create a new graph - 3) Add Area Blender and Layer Spawner nodes to the graph, and add/remove each extender node to/from each + :return: None + """ - Note: - - This test file must be called from the Open 3D Engine Editor command terminal - - Any passed and failed tests are written to the Editor.log file. - Parsing the file or running a log_monitor are required to observe the test results. + import azlmbr.bus as bus + import azlmbr.editor as editor + import azlmbr.editor.graph as graph + import azlmbr.landscapecanvas as landscapecanvas + import azlmbr.legacy.general as general + import azlmbr.math as math + import azlmbr.paths - :return: None - """ + import editor_python_test_tools.hydra_editor_utils as hydra + from editor_python_test_tools.utils import Report + from editor_python_test_tools.utils import TestHelper as helper - def onEntityCreated(parameters): - global newEntityId - newEntityId = parameters[0] + editorId = azlmbr.globals.property.LANDSCAPE_CANVAS_EDITOR_ID - # Create a new empty level - self.test_success = self.create_level( - self.args["level"], - heightmap_resolution=128, - heightmap_meters_per_pixel=1, - terrain_texture_resolution=128, - use_terrain=False, - ) + def onEntityCreated(parameters): + global newEntityId + newEntityId = parameters[0] - # Open Landscape Canvas tool and verify - general.open_pane('Landscape Canvas') - self.test_success = self.test_success and general.is_pane_visible('Landscape Canvas') - if general.is_pane_visible('Landscape Canvas'): - self.log('Landscape Canvas pane is open') + # Open an existing simple level + helper.init_idle() + helper.open_level("Physics", "Base") - # Create a new graph in Landscape Canvas - newGraphId = graph.AssetEditorRequestBus(bus.Event, 'CreateNewGraph', editorId) - self.test_success = self.test_success and newGraphId - if newGraphId: - self.log("New graph created") + # Open Landscape Canvas tool and verify + general.open_pane('Landscape Canvas') + Report.critical_result(Tests.lc_tool_opened, general.is_pane_visible('Landscape Canvas')) - # Make sure the graph we created is in Landscape Canvas - success = graph.AssetEditorRequestBus(bus.Event, 'ContainsGraph', editorId, newGraphId) - self.test_success = self.test_success and success - if success: - self.log("Graph registered with Landscape Canvas") + # Create a new graph in Landscape Canvas + newGraphId = graph.AssetEditorRequestBus(bus.Event, 'CreateNewGraph', editorId) + Report.critical_result(Tests.new_graph_created, newGraphId is not None) - # Listen for entity creation notifications so we can check if the - # proper components are added when we add nodes - handler = editor.EditorEntityContextNotificationBusHandler() - handler.connect() - handler.add_callback('OnEditorEntityCreated', onEntityCreated) + # Make sure the graph we created is in Landscape Canvas + graph_registered = graph.AssetEditorRequestBus(bus.Event, 'ContainsGraph', editorId, newGraphId) + Report.result(Tests.graph_registered, graph_registered) - # Extender mapping with the key being the node name and the value is the - # expected Component that should be added to the layer Entity for that wrapped node - extenders = { - 'AltitudeFilterNode': 'Vegetation Altitude Filter', - 'DistanceBetweenFilterNode': 'Vegetation Distance Between Filter', - 'DistributionFilterNode': 'Vegetation Distribution Filter', - 'ShapeIntersectionFilterNode': 'Vegetation Shape Intersection Filter', - 'SlopeFilterNode': 'Vegetation Slope Filter', - 'SurfaceMaskDepthFilterNode': 'Vegetation Surface Mask Depth Filter', - 'SurfaceMaskFilterNode': 'Vegetation Surface Mask Filter', - 'PositionModifierNode': 'Vegetation Position Modifier', - 'RotationModifierNode': 'Vegetation Rotation Modifier', - 'ScaleModifierNode': 'Vegetation Scale Modifier', - 'SlopeAlignmentModifierNode': 'Vegetation Slope Alignment Modifier', - 'AssetWeightSelectorNode': 'Vegetation Asset Weight Selector' - } + # Listen for entity creation notifications so we can check if the + # proper components are added when we add nodes + handler = editor.EditorEntityContextNotificationBusHandler() + handler.connect() + handler.add_callback('OnEditorEntityCreated', onEntityCreated) - # Retrieve a mapping of the TypeIds for all the components - # we will be checking for - componentNames = [] - for name in extenders: - componentNames.append(extenders[name]) - componentTypeIds = hydra.get_component_type_id_map(componentNames) + # Extender mapping with the key being the node name and the value is the + # expected Component that should be added to the layer Entity for that wrapped node + extenders = { + 'AltitudeFilterNode': 'Vegetation Altitude Filter', + 'DistanceBetweenFilterNode': 'Vegetation Distance Between Filter', + 'DistributionFilterNode': 'Vegetation Distribution Filter', + 'ShapeIntersectionFilterNode': 'Vegetation Shape Intersection Filter', + 'SlopeFilterNode': 'Vegetation Slope Filter', + 'SurfaceMaskDepthFilterNode': 'Vegetation Surface Mask Depth Filter', + 'SurfaceMaskFilterNode': 'Vegetation Surface Mask Filter', + 'PositionModifierNode': 'Vegetation Position Modifier', + 'RotationModifierNode': 'Vegetation Rotation Modifier', + 'ScaleModifierNode': 'Vegetation Scale Modifier', + 'SlopeAlignmentModifierNode': 'Vegetation Slope Alignment Modifier', + 'AssetWeightSelectorNode': 'Vegetation Asset Weight Selector' + } - areas = [ - 'AreaBlenderNode', - 'SpawnerAreaNode' - ] + # Retrieve a mapping of the TypeIds for all the components + # we will be checking for + componentNames = [] + for name in extenders: + componentNames.append(extenders[name]) + componentTypeIds = hydra.get_component_type_id_map(componentNames) - # Add/remove all our supported extender nodes to the Layer Areas and check if the appropriate - # Components are added/removed to the wrapper node's Entity - newGraph = graph.GraphManagerRequestBus(bus.Broadcast, 'GetGraph', newGraphId) - x = 10.0 - y = 10.0 - for areaName in areas: - nodePosition = math.Vector2(x, y) - areaNode = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, 'CreateNodeForTypeName', - newGraph, areaName) - graph.GraphControllerRequestBus(bus.Event, 'AddNode', newGraphId, areaNode, nodePosition) + areas = [ + 'AreaBlenderNode', + 'SpawnerAreaNode' + ] - success = True - for extenderName in extenders: - # Add the wrapped node for the extender - extenderNode = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, - 'CreateNodeForTypeName', newGraph, - extenderName) - graph.GraphControllerRequestBus(bus.Event, 'AddNode', newGraphId, extenderNode, nodePosition) - graph.GraphControllerRequestBus(bus.Event, 'WrapNode', newGraphId, areaNode, extenderNode) + # Add/remove all our supported extender nodes to the Layer Areas and check if the appropriate + # Components are added/removed to the wrapper node's Entity + newGraph = graph.GraphManagerRequestBus(bus.Broadcast, 'GetGraph', newGraphId) + x = 10.0 + y = 10.0 + for areaName in areas: + nodePosition = math.Vector2(x, y) + areaNode = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, 'CreateNodeForTypeName', + newGraph, areaName) + graph.GraphControllerRequestBus(bus.Event, 'AddNode', newGraphId, areaNode, nodePosition) - # Check that the appropriate Component was added when the extender node was added - extenderComponent = extenders[extenderName] - componentTypeId = componentTypeIds[extenderComponent] - success = success and editor.EditorComponentAPIBus(bus.Broadcast, 'HasComponentOfType', newEntityId, + success = True + for extenderName in extenders: + # Add the wrapped node for the extender + extenderNode = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, + 'CreateNodeForTypeName', newGraph, + extenderName) + graph.GraphControllerRequestBus(bus.Event, 'AddNode', newGraphId, extenderNode, nodePosition) + graph.GraphControllerRequestBus(bus.Event, 'WrapNode', newGraphId, areaNode, extenderNode) + + # Check that the appropriate Component was added when the extender node was added + extenderComponent = extenders[extenderName] + componentTypeId = componentTypeIds[extenderComponent] + success = success and editor.EditorComponentAPIBus(bus.Broadcast, 'HasComponentOfType', newEntityId, + componentTypeId) + Report.info(f"Component: {extenderComponent}") + Report.result(Tests.component_added, success) + if not success: + break + + # Check that the appropriate Component was removed when the extender node was removed + graph.GraphControllerRequestBus(bus.Event, 'RemoveNode', newGraphId, extenderNode) + success = success and not editor.EditorComponentAPIBus(bus.Broadcast, 'HasComponentOfType', newEntityId, componentTypeId) - self.test_success = self.test_success and success - if not success: - self.log("{node} failed to add {component} Component".format(node=areaName, - component=extenderComponent)) - break + Report.info(f"Component: {extenderComponent}") + Report.result(Tests.component_removed, success) + if not success: + break - # Check that the appropriate Component was removed when the extender node was removed - graph.GraphControllerRequestBus(bus.Event, 'RemoveNode', newGraphId, extenderNode) - success = success and not editor.EditorComponentAPIBus(bus.Broadcast, 'HasComponentOfType', newEntityId, - componentTypeId) - self.test_success = self.test_success and success - if not success: - self.log("{node} failed to remove {component} Component".format(node=areaName, - component=extenderComponent)) - break + if success: + Report.info(f"{areaName} successfully added and removed all filters/modifiers/selectors") - if success: - self.log("{node} successfully added and removed all filters/modifiers/selectors".format(node=areaName)) - - # Stop listening for entity creation notifications - handler.disconnect() + # Stop listening for entity creation notifications + handler.disconnect() -test = TestLayerExtenderNodeComponentEntitySync() -test.run() +if __name__ == "__main__": + + from editor_python_test_tools.utils import Report + Report.start_test(LayerExtenderNodes_ComponentEntitySync) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/NewGraph_CreatedSuccessfully.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/NewGraph_CreatedSuccessfully.py new file mode 100644 index 0000000000..d13c5dfa2f --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/NewGraph_CreatedSuccessfully.py @@ -0,0 +1,111 @@ +""" +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 +""" + + +class Tests: + lc_tool_opened = ( + "Landscape Canvas tool opened", + "Failed to open Landscape Canvas tool" + ) + new_graph_created = ( + "Successfully created new graph", + "Failed to create new graph" + ) + graph_registered = ( + "Graph registered with Landscape Canvas", + "Failed to register graph" + ) + lc_component_added = ( + "Root entity created with the Landscape Canvas component", + "Landscape Canvas component was not found on the root entity" + ) + lc_tool_closed = ( + "Landscape Canvas tool closed", + "Failed to close Landscape Canvas tool" + ) + + +new_root_entity_id = None + + +def NewGraph_CreatedSuccessfully(): + """ + Summary: + This test verifies that new graphs can be created in Landscape Canvas. + + Expected Behavior: + New graphs can be created, and proper entity is created to hold graph data with a Landscape Canvas component. + + Test Steps: + 1) Open a simple level + 2) Open Landscape Canvas and create a new graph + 3) Ensures the root entity created contains a Landscape Canvas component + + Note: + - This test file must be called from the Open 3D Engine Editor command terminal + - Any passed and failed tests are written to the Editor.log file. + Parsing the file or running a log_monitor are required to observe the test results. + + :return: None + """ + + import azlmbr.bus as bus + import azlmbr.editor as editor + import azlmbr.editor.graph as graph + import azlmbr.legacy.general as general + + import editor_python_test_tools.hydra_editor_utils as hydra + from editor_python_test_tools.utils import Report + from editor_python_test_tools.utils import TestHelper as helper + + editorId = azlmbr.globals.property.LANDSCAPE_CANVAS_EDITOR_ID + + def on_entity_created(parameters): + global new_root_entity_id + new_root_entity_id = parameters[0] + + # Open an existing simple level + helper.init_idle() + helper.open_level("Physics", "Base") + + # Listen for entity creation notifications so we can check if the entity created + # with the new graph has our Landscape Canvas component automatically added + handler = editor.EditorEntityContextNotificationBusHandler() + handler.connect() + handler.add_callback("OnEditorEntityCreated", on_entity_created) + + # Open Landscape Canvas tool and verify + general.open_pane('Landscape Canvas') + Report.critical_result(Tests.lc_tool_opened, general.is_pane_visible('Landscape Canvas')) + + # Create a new graph in Landscape Canvas + new_graph_id = graph.AssetEditorRequestBus(bus.Event, 'CreateNewGraph', editorId) + Report.critical_result(Tests.new_graph_created, new_graph_id is not None) + + # Make sure the graph we created is in Landscape Canvas + graph_registered = graph.AssetEditorRequestBus(bus.Event, 'ContainsGraph', editorId, new_graph_id) + Report.result(Tests.graph_registered, graph_registered) + + # Check if the entity created when we create a new graph has the + # Landscape Canvas component already added to it + landscape_canvas_type_id = hydra.get_component_type_id("Landscape Canvas") + success = editor.EditorComponentAPIBus(bus.Broadcast, "HasComponentOfType", new_root_entity_id, + landscape_canvas_type_id) + Report.result(Tests.lc_component_added, success) + + # Close Landscape Canvas tool and verify + general.close_pane("Landscape Canvas") + Report.result(Tests.lc_tool_closed, not general.is_pane_visible("Landscape Canvas")) + + # Stop listening for entity creation notifications + handler.disconnect() + + +if __name__ == "__main__": + + from editor_python_test_tools.utils import Report + Report.start_test(NewGraph_CreatedSuccessfully) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/ShapeNodes_EntityCreatedOnNodeAdd.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/ShapeNodes_EntityCreatedOnNodeAdd.py index 0c877535a9..93464c7ad3 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/ShapeNodes_EntityCreatedOnNodeAdd.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/ShapeNodes_EntityCreatedOnNodeAdd.py @@ -5,133 +5,136 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ -import os -import sys -import azlmbr.bus as bus -import azlmbr.editor as editor -import azlmbr.editor.graph as graph -import azlmbr.landscapecanvas as landscapecanvas -import azlmbr.legacy.general as general -import azlmbr.math as math -import azlmbr.paths +class Tests: + lc_tool_opened = ( + "Landscape Canvas tool opened", + "Failed to open Landscape Canvas tool" + ) + new_graph_created = ( + "Successfully created new graph", + "Failed to create new graph" + ) + graph_registered = ( + "Graph registered with Landscape Canvas", + "Failed to register graph" + ) + component_added = ( + "New entity created with the expected component", + "Expected component was not found on entity" + ) -sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests')) -import editor_python_test_tools.hydra_editor_utils as hydra -from editor_python_test_tools.editor_test_helper import EditorTestHelper -editorId = azlmbr.globals.property.LANDSCAPE_CANVAS_EDITOR_ID newEntityId = None -class TestShapeNodeEntityCreate(EditorTestHelper): - def __init__(self): - EditorTestHelper.__init__(self, log_prefix="ShapeNodeEntityCreate", args=["level"]) +def ShapeNodes_EntityCreatedOnNodeAdd(): + """ + Summary: + This test verifies that the Landscape Canvas nodes can be added to a graph, and correctly create entities. - def run_test(self): - """ - Summary: - This test verifies that the Landscape Canvas nodes can be added to a graph, and correctly create entities. + Expected Behavior: + New entities are created when dragging shape nodes to graph area. - Expected Behavior: - New entities are created when dragging shape nodes to graph area. + Test Steps: + 1) Open a simple level + 2) Open Landscape Canvas and create a new graph + 3) Drag each of the shape nodes to the graph area, and ensure a new entity is created - Test Steps: - 1) Create a new level - 2) Open Landscape Canvas and create a new graph - 3) Drag each of the shape nodes to the graph area, and ensure a new entity is created + Note: + - This test file must be called from the Open 3D Engine Editor command terminal + - Any passed and failed tests are written to the Editor.log file. + Parsing the file or running a log_monitor are required to observe the test results. - Note: - - This test file must be called from the Open 3D Engine Editor command terminal - - Any passed and failed tests are written to the Editor.log file. - Parsing the file or running a log_monitor are required to observe the test results. + :return: None + """ - :return: None - """ + import azlmbr.bus as bus + import azlmbr.editor as editor + import azlmbr.editor.graph as graph + import azlmbr.landscapecanvas as landscapecanvas + import azlmbr.legacy.general as general + import azlmbr.math as math - def onEntityCreated(parameters): - global newEntityId - newEntityId = parameters[0] + import editor_python_test_tools.hydra_editor_utils as hydra + from editor_python_test_tools.utils import Report + from editor_python_test_tools.utils import TestHelper as helper - # Create a new empty level - self.test_success = self.create_level( - self.args["level"], - heightmap_resolution=128, - heightmap_meters_per_pixel=1, - terrain_texture_resolution=128, - use_terrain=False, - ) + editorId = azlmbr.globals.property.LANDSCAPE_CANVAS_EDITOR_ID - # Open Landscape Canvas tool and verify - general.open_pane('Landscape Canvas') - self.test_success = self.test_success and general.is_pane_visible('Landscape Canvas') - if general.is_pane_visible('Landscape Canvas'): - self.log('Landscape Canvas pane is open') + def onEntityCreated(parameters): + global newEntityId + newEntityId = parameters[0] - # Create a new graph in Landscape Canvas - newGraphId = graph.AssetEditorRequestBus(bus.Event, 'CreateNewGraph', editorId) - self.test_success = self.test_success and newGraphId - if newGraphId: - self.log("New graph created") + # Open an existing simple level - # Make sure the graph we created is in Landscape Canvas - success = graph.AssetEditorRequestBus(bus.Event, 'ContainsGraph', editorId, newGraphId) - self.test_success = self.test_success and success - if success: - self.log("Graph registered with Landscape Canvas") + helper.init_idle() + helper.open_level("Physics", "Base") - # Listen for entity creation notifications so we can check if the entity created - # from adding shape nodes has the appropriate Shape Component - handler = editor.EditorEntityContextNotificationBusHandler() - handler.connect() - handler.add_callback('OnEditorEntityCreated', onEntityCreated) + # Open Landscape Canvas tool and verify + general.open_pane('Landscape Canvas') + Report.critical_result(Tests.lc_tool_opened, general.is_pane_visible('Landscape Canvas')) - # Shape mapping with the key being the node name and the value is the - # expected Component that should be added to the Entity created for the node - shapes = { - 'BoxShapeNode': 'Box Shape', - 'CapsuleShapeNode': 'Capsule Shape', - 'CompoundShapeNode': 'Compound Shape', - 'CylinderShapeNode': 'Cylinder Shape', - 'PolygonPrismShapeNode': 'Polygon Prism Shape', - 'SphereShapeNode': 'Sphere Shape', - 'TubeShapeNode': 'Tube Shape', - 'DiskShapeNode': 'Disk Shape' - } + # Create a new graph in Landscape Canvas + newGraphId = graph.AssetEditorRequestBus(bus.Event, 'CreateNewGraph', editorId) + Report.critical_result(Tests.new_graph_created, newGraphId is not None) - # Retrieve a mapping of the TypeIds for all the components - # we will be checking for - componentNames = [] - for name in shapes: - componentNames.append(shapes[name]) - componentTypeIds = hydra.get_component_type_id_map(componentNames) + # Make sure the graph we created is in Landscape Canvas + graph_registered = graph.AssetEditorRequestBus(bus.Event, 'ContainsGraph', editorId, newGraphId) + Report.result(Tests.graph_registered, graph_registered) - # Create nodes for all the shapes we support and check if the Entity created by - # adding the node has the appropriate Component added automatically to it - newGraph = graph.GraphManagerRequestBus(bus.Broadcast, 'GetGraph', newGraphId) - x = 10.0 - y = 10.0 - for nodeName in shapes: - nodePosition = math.Vector2(x, y) - node = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, 'CreateNodeForTypeName', - newGraph, nodeName) - graph.GraphControllerRequestBus(bus.Event, 'AddNode', newGraphId, node, nodePosition) + # Listen for entity creation notifications so we can check if the entity created + # from adding shape nodes has the appropriate Shape Component + handler = editor.EditorEntityContextNotificationBusHandler() + handler.connect() + handler.add_callback('OnEditorEntityCreated', onEntityCreated) - shapeComponent = shapes[nodeName] - componentTypeId = componentTypeIds[shapeComponent] - hasComponent = editor.EditorComponentAPIBus(bus.Broadcast, 'HasComponentOfType', newEntityId, - componentTypeId) - self.test_success = self.test_success and hasComponent - if hasComponent: - self.log("{node} created new Entity with {component} Component".format(node=nodeName, - component=shapeComponent)) + # Shape mapping with the key being the node name and the value is the + # expected Component that should be added to the Entity created for the node + shapes = { + 'BoxShapeNode': 'Box Shape', + 'CapsuleShapeNode': 'Capsule Shape', + 'CompoundShapeNode': 'Compound Shape', + 'CylinderShapeNode': 'Cylinder Shape', + 'PolygonPrismShapeNode': 'Polygon Prism Shape', + 'SphereShapeNode': 'Sphere Shape', + 'TubeShapeNode': 'Tube Shape', + 'DiskShapeNode': 'Disk Shape' + } - x += 40.0 - y += 40.0 + # Retrieve a mapping of the TypeIds for all the components + # we will be checking for + componentNames = [] + for name in shapes: + componentNames.append(shapes[name]) + componentTypeIds = hydra.get_component_type_id_map(componentNames) - # Stop listening for entity creation notifications - handler.disconnect() + # Create nodes for all the shapes we support and check if the Entity created by + # adding the node has the appropriate Component added automatically to it + newGraph = graph.GraphManagerRequestBus(bus.Broadcast, 'GetGraph', newGraphId) + x = 10.0 + y = 10.0 + for nodeName in shapes: + nodePosition = math.Vector2(x, y) + node = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, 'CreateNodeForTypeName', + newGraph, nodeName) + graph.GraphControllerRequestBus(bus.Event, 'AddNode', newGraphId, node, nodePosition) + + shapeComponent = shapes[nodeName] + componentTypeId = componentTypeIds[shapeComponent] + hasComponent = editor.EditorComponentAPIBus(bus.Broadcast, 'HasComponentOfType', newEntityId, + componentTypeId) + Report.info(f"Node: {nodeName} | Component: {shapeComponent}") + Report.result(Tests.component_added, hasComponent) + + x += 40.0 + y += 40.0 + + # Stop listening for entity creation notifications + handler.disconnect() -test = TestShapeNodeEntityCreate() -test.run() +if __name__ == "__main__": + + from editor_python_test_tools.utils import Report + Report.start_test(ShapeNodes_EntityCreatedOnNodeAdd) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/ShapeNodes_EntityRemovedOnNodeDelete.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/ShapeNodes_EntityRemovedOnNodeDelete.py index 2416e05fdf..d2708f643d 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/ShapeNodes_EntityRemovedOnNodeDelete.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/ShapeNodes_EntityRemovedOnNodeDelete.py @@ -5,127 +5,129 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ -import os -import sys -import azlmbr.bus as bus -import azlmbr.editor as editor -import azlmbr.editor.graph as graph -import azlmbr.landscapecanvas as landscapecanvas -import azlmbr.legacy.general as general -import azlmbr.math as math -import azlmbr.paths +class Tests: + lc_tool_opened = ( + "Landscape Canvas tool opened", + "Failed to open Landscape Canvas tool" + ) + new_graph_created = ( + "Successfully created new graph", + "Failed to create new graph" + ) + graph_registered = ( + "Graph registered with Landscape Canvas", + "Failed to register graph" + ) + entity_deleted = ( + "Entity was deleted when node was removed", + "Entity was not deleted as expected when node was removed" + ) -sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests')) -from editor_python_test_tools.editor_test_helper import EditorTestHelper -editorId = azlmbr.globals.property.LANDSCAPE_CANVAS_EDITOR_ID createdEntityId = None deletedEntityId = None -class TestShapeNodeEntityDelete(EditorTestHelper): +def ShapeNodes_EntityRemovedOnNodeDelete(): + """ + Summary: + This test verifies that the Landscape Canvas node deletion properly cleans up entities in the Editor. - def __init__(self): - EditorTestHelper.__init__(self, log_prefix="ShapeNodeEntityDelete", args=["level"]) + Expected Behavior: + Entities are removed when shape nodes are deleted from a graph. - def run_test(self): - """ - Summary: - This test verifies that the Landscape Canvas node deletion properly cleans up entities in the Editor. + Test Steps: + 1) Open a simple level + 2) Open Landscape Canvas and create a new graph + 3) Drag each of the shape nodes to the graph area, and ensure a new entity is created + 4) Delete the nodes, and ensure the newly created entities are removed - Expected Behavior: - Entities are removed when shape nodes are deleted from a graph. + Note: + - This test file must be called from the Open 3D Engine Editor command terminal + - Any passed and failed tests are written to the Editor.log file. + Parsing the file or running a log_monitor are required to observe the test results. - Test Steps: - 1) Create a new level - 2) Open Landscape Canvas and create a new graph - 3) Drag each of the shape nodes to the graph area, and ensure a new entity is created - 4) Delete the nodes, and ensure the newly created entities are removed + :return: None + """ - Note: - - This test file must be called from the Open 3D Engine Editor command terminal - - Any passed and failed tests are written to the Editor.log file. - Parsing the file or running a log_monitor are required to observe the test results. + import azlmbr.bus as bus + import azlmbr.editor as editor + import azlmbr.editor.graph as graph + import azlmbr.landscapecanvas as landscapecanvas + import azlmbr.legacy.general as general + import azlmbr.math as math - :return: None - """ + from editor_python_test_tools.utils import Report + from editor_python_test_tools.utils import TestHelper as helper - def onEntityCreated(parameters): - global createdEntityId - createdEntityId = parameters[0] - - def onEntityDeleted(parameters): - global deletedEntityId - deletedEntityId = parameters[0] + editorId = azlmbr.globals.property.LANDSCAPE_CANVAS_EDITOR_ID - # Create a new empty level - self.test_success = self.create_level( - self.args["level"], - heightmap_resolution=128, - heightmap_meters_per_pixel=1, - terrain_texture_resolution=128, - use_terrain=False, - ) - - # Open Landscape Canvas tool and verify - general.open_pane('Landscape Canvas') - self.test_success = self.test_success and general.is_pane_visible('Landscape Canvas') - if general.is_pane_visible('Landscape Canvas'): - self.log('Landscape Canvas pane is open') - - # Create a new graph in Landscape Canvas - newGraphId = graph.AssetEditorRequestBus(bus.Event, 'CreateNewGraph', editorId) - self.test_success = self.test_success and newGraphId - if newGraphId: - self.log("New graph created") - - # Make sure the graph we created is in Landscape Canvas - success = graph.AssetEditorRequestBus(bus.Event, 'ContainsGraph', editorId, newGraphId) - self.test_success = self.test_success and success - if success: - self.log("Graph registered with Landscape Canvas") - - # Listen for entity creation/deletion notifications so we can verify the - # Entity created when adding a new also gets deleted when the node is deleted - handler = editor.EditorEntityContextNotificationBusHandler() - handler.connect() - handler.add_callback('OnEditorEntityCreated', onEntityCreated) - handler.add_callback('OnEditorEntityDeleted', onEntityDeleted) - - # All of the shape nodes that we support - shapes = [ - 'BoxShapeNode', - 'CapsuleShapeNode', - 'CompoundShapeNode', - 'CylinderShapeNode', - 'PolygonPrismShapeNode', - 'SphereShapeNode', - 'TubeShapeNode', - 'DiskShapeNode' - ] - - # Create nodes for all the shapes we support and check if the Entity is created - # and then deleted when the node is removed - newGraph = graph.GraphManagerRequestBus(bus.Broadcast, 'GetGraph', newGraphId) - x = 10.0 - y = 10.0 - for nodeName in shapes: - nodePosition = math.Vector2(x, y) - node = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, 'CreateNodeForTypeName', newGraph, nodeName) - graph.GraphControllerRequestBus(bus.Event, 'AddNode', newGraphId, node, nodePosition) - - removed = graph.GraphControllerRequestBus(bus.Event, 'RemoveNode', newGraphId, node) - - # Verify that the created Entity for this node matches the Entity that gets - # deleted when the node is removed - self.test_success = self.test_success and removed and createdEntityId.invoke("Equal", deletedEntityId) - if removed and createdEntityId.invoke("Equal", deletedEntityId): - self.log("{node} corresponding Entity was deleted when node is removed".format(node=nodeName)) - - # Stop listening for entity creation/deletion notifications - handler.disconnect() + def onEntityCreated(parameters): + global createdEntityId + createdEntityId = parameters[0] + + def onEntityDeleted(parameters): + global deletedEntityId + deletedEntityId = parameters[0] + + # Open an existing simple level + helper.init_idle() + helper.open_level("Physics", "Base") + + # Open Landscape Canvas tool and verify + general.open_pane('Landscape Canvas') + Report.critical_result(Tests.lc_tool_opened, general.is_pane_visible('Landscape Canvas')) + + # Create a new graph in Landscape Canvas + newGraphId = graph.AssetEditorRequestBus(bus.Event, 'CreateNewGraph', editorId) + Report.critical_result(Tests.new_graph_created, newGraphId is not None) + + # Make sure the graph we created is in Landscape Canvas + graph_registered = graph.AssetEditorRequestBus(bus.Event, 'ContainsGraph', editorId, newGraphId) + Report.result(Tests.graph_registered, graph_registered) + + # Listen for entity creation/deletion notifications so we can verify the + # Entity created when adding a new also gets deleted when the node is deleted + handler = editor.EditorEntityContextNotificationBusHandler() + handler.connect() + handler.add_callback('OnEditorEntityCreated', onEntityCreated) + handler.add_callback('OnEditorEntityDeleted', onEntityDeleted) + + # All of the shape nodes that we support + shapes = [ + 'BoxShapeNode', + 'CapsuleShapeNode', + 'CompoundShapeNode', + 'CylinderShapeNode', + 'PolygonPrismShapeNode', + 'SphereShapeNode', + 'TubeShapeNode', + 'DiskShapeNode' + ] + + # Create nodes for all the shapes we support and check if the Entity is created + # and then deleted when the node is removed + newGraph = graph.GraphManagerRequestBus(bus.Broadcast, 'GetGraph', newGraphId) + x = 10.0 + y = 10.0 + for nodeName in shapes: + nodePosition = math.Vector2(x, y) + node = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, 'CreateNodeForTypeName', newGraph, nodeName) + graph.GraphControllerRequestBus(bus.Event, 'AddNode', newGraphId, node, nodePosition) + + removed = graph.GraphControllerRequestBus(bus.Event, 'RemoveNode', newGraphId, node) + + # Verify that the created Entity for this node matches the Entity that gets + # deleted when the node is removed + Report.info(f"Node: {nodeName}") + Report.result(Tests.entity_deleted, removed and createdEntityId.invoke("Equal", deletedEntityId)) + + # Stop listening for entity creation/deletion notifications + handler.disconnect() -test = TestShapeNodeEntityDelete() -test.run() +if __name__ == "__main__": + + from editor_python_test_tools.utils import Report + Report.start_test(ShapeNodes_EntityRemovedOnNodeDelete) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/Slice_CreateInstantiate.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/Slice_CreateInstantiate.py new file mode 100644 index 0000000000..c5ab08f99a --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/Slice_CreateInstantiate.py @@ -0,0 +1,84 @@ +""" +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 +""" + + +class Tests: + slice_created = ( + "Slice created successfully", + "Failed to create slice" + ) + slice_instantiated = ( + "Slice instantiated successfully", + "Failed to instantiate slice" + ) + + +def Slice_CreateInstantiate(): + """ + Summary: + A slice containing the LandscapeCanvas component can be created/instantiated. + + Expected Result: + Slice is created/processed/instantiated successfully and free of errors/warnings. + + Test Steps: + 1) Open a simple level + 2) Create a new entity with a Landscape Canvas component + 3) Create a slice of the new entity + 4) Instantiate a new copy of the slice + + Note: + - This test file must be called from the Open 3D Engine Editor command terminal + - Any passed and failed tests are written to the Editor.log file. + Parsing the file or running a log_monitor are required to observe the test results. + :return: None + """ + + import os + + import azlmbr.math as math + import azlmbr.bus as bus + import azlmbr.asset as asset + import azlmbr.slice as slice + + import editor_python_test_tools.hydra_editor_utils as hydra + from editor_python_test_tools.utils import Report + from editor_python_test_tools.utils import TestHelper as helper + + def path_is_valid_asset(asset_path): + asset_id = asset.AssetCatalogRequestBus(bus.Broadcast, "GetAssetIdByPath", asset_path, math.Uuid(), False) + return asset_id.invoke("IsValid") + + # Open an existing simple level + helper.init_idle() + helper.open_level("Physics", "Base") + + # Create entity with Landscape Canvas component + position = math.Vector3(512.0, 512.0, 32.0) + landscape_canvas = hydra.Entity("landscape_canvas_entity") + landscape_canvas.create_entity(position, ["Landscape Canvas"]) + + # Create slice from the created entity + slice_path = os.path.join("slices", "TestSlice.slice") + slice.SliceRequestBus(bus.Broadcast, "CreateNewSlice", landscape_canvas.id, slice_path) + + # Verify if slice is created + helper.wait_for_condition(lambda: path_is_valid_asset(slice_path), 5.0) + Report.result(Tests.slice_created, path_is_valid_asset(slice_path)) + + # Instantiate slice + transform = math.Transform_CreateIdentity() + asset_id = asset.AssetCatalogRequestBus(bus.Broadcast, "GetAssetIdByPath", slice_path, math.Uuid(), False) + test_slice = slice.SliceRequestBus(bus.Broadcast, "InstantiateSliceFromAssetId", asset_id, transform) + helper.wait_for_condition(lambda: test_slice.IsValid(), 5.0) + Report.result(Tests.slice_instantiated, test_slice.IsValid()) + + +if __name__ == "__main__": + + from editor_python_test_tools.utils import Report + Report.start_test(Slice_CreateInstantiate) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/SlotConnections_UpdateComponentReferences.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/SlotConnections_UpdateComponentReferences.py index 2156795b1a..3169908621 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/SlotConnections_UpdateComponentReferences.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/SlotConnections_UpdateComponentReferences.py @@ -5,210 +5,217 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ -import os -import sys -import azlmbr.bus as bus -import azlmbr.editor as editor -import azlmbr.editor.graph as graph -import azlmbr.landscapecanvas as landscapecanvas -import azlmbr.legacy.general as general -import azlmbr.math as math -import azlmbr.paths +class Tests: + lc_tool_opened = ( + "Landscape Canvas tool opened", + "Failed to open Landscape Canvas tool" + ) + new_graph_created = ( + "Successfully created new graph", + "Failed to create new graph" + ) + graph_registered = ( + "Graph registered with Landscape Canvas", + "Failed to register graph" + ) + preview_entity_set = ( + "Random Noise Gradient component Preview Entity property set to Box Shape EntityId", + "Unexpected entity set in Random Noise Gradient Preview Entity property" + ) + dither_inbound_gradient_set = ( + "Dither Gradient Modifier component Inbound Gradient property set to Random Noise Gradient EntityId", + "Unexpected entity set in Dither Gradient's Inbound Gradient property" + ) + mixer_inbound_gradient_set = ( + "Gradient Mixer component Inbound Gradient extendable property set to Dither Gradient Modifier EntityId", + "Unexpected entity set in Gradient Mixer's Inbound Gradient property" + ) -sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests')) -import editor_python_test_tools.hydra_editor_utils as hydra -from editor_python_test_tools.editor_test_helper import EditorTestHelper -editorId = azlmbr.globals.property.LANDSCAPE_CANVAS_EDITOR_ID newEntityId = None -class TestSlotConnectionsUpdateComponents(EditorTestHelper): - def __init__(self): - EditorTestHelper.__init__(self, log_prefix="SlotConnectionsUpdateComponents", args=["level"]) +def SlotConnections_UpdateComponentReferences(): + """ + Summary: + This test verifies that the Landscape Canvas slot connections properly update component references. - def run_test(self): - """ - Summary: - This test verifies that the Landscape Canvas slot connections properly update component references. + Expected Behavior: + A reference created through slot connections in Landscape Canvas is reflected in the Entity Inspector. - Expected Behavior: - A reference created through slot connections in Landscape Canvas is reflected in the Entity Inspector. + Test Steps: + 1) Open an existing level + 2) Open Landscape Canvas and create a new graph + 3) Several nodes are added to a graph, and connections are set between the nodes + 4) Component references are verified via Entity Inspector - Test Steps: - 1) Create a new level - 2) Open Landscape Canvas and create a new graph - 3) Several nodes are added to a graph, and connections are set between the nodes - 4) Component references are verified via Entity Inspector + Note: + - This test file must be called from the Open 3D Engine Editor command terminal + - Any passed and failed tests are written to the Editor.log file. + Parsing the file or running a log_monitor are required to observe the test results. - Note: - - This test file must be called from the Open 3D Engine Editor command terminal - - Any passed and failed tests are written to the Editor.log file. - Parsing the file or running a log_monitor are required to observe the test results. + :return: None + """ + import azlmbr.bus as bus + import azlmbr.editor as editor + import azlmbr.editor.graph as graph + import azlmbr.landscapecanvas as landscapecanvas + import azlmbr.legacy.general as general + import azlmbr.math as math + import azlmbr.paths - :return: None - """ + import editor_python_test_tools.hydra_editor_utils as hydra + from editor_python_test_tools.utils import Report + from editor_python_test_tools.utils import TestHelper as helper - # Retrieve the proper component TypeIds per component name - componentNames = [ - 'Random Noise Gradient', - 'Dither Gradient Modifier', - 'Gradient Mixer' - ] - componentTypeIds = hydra.get_component_type_id_map(componentNames) - - # Helper method for retrieving an EntityId from a specific property on a component - def getEntityIdFromComponentProperty(targetEntityId, componentTypeName, propertyPath): - componentOutcome = editor.EditorComponentAPIBus(bus.Broadcast, 'GetComponentOfType', targetEntityId, - componentTypeIds[componentTypeName]) - if not componentOutcome.IsSuccess(): - return None - - component = componentOutcome.GetValue() - propertyOutcome = editor.EditorComponentAPIBus(bus.Broadcast, 'GetComponentProperty', component, - propertyPath) - if not propertyOutcome.IsSuccess(): - return None - - return propertyOutcome.GetValue() - - def onEntityCreated(parameters): - global newEntityId - newEntityId = parameters[0] - - # Create a new empty level - self.test_success = self.create_level( - self.args["level"], - heightmap_resolution=128, - heightmap_meters_per_pixel=1, - terrain_texture_resolution=128, - use_terrain=False, - ) - - # Open Landscape Canvas tool and verify - general.open_pane('Landscape Canvas') - self.test_success = self.test_success and general.is_pane_visible('Landscape Canvas') - if general.is_pane_visible('Landscape Canvas'): - self.log('Landscape Canvas pane is open') - - # Create a new graph in Landscape Canvas - newGraphId = graph.AssetEditorRequestBus(bus.Event, 'CreateNewGraph', editorId) - self.test_success = self.test_success and newGraphId - if newGraphId: - self.log("New graph created") - - # Make sure the graph we created is in Landscape Canvas - success = graph.AssetEditorRequestBus(bus.Event, 'ContainsGraph', editorId, newGraphId) - self.test_success = self.test_success and success - if success: - self.log("Graph registered with Landscape Canvas") - - # Listen for entity creation notifications so we can verify the component EntityId - # references are set correctly when connecting slots on the nodes - handler = editor.EditorEntityContextNotificationBusHandler() - handler.connect() - handler.add_callback('OnEditorEntityCreated', onEntityCreated) - - positionX = 10.0 - positionY = 10.0 - offsetX = 340.0 - offsetY = 100.0 - - # Add a box shape node to the graph - newGraph = graph.GraphManagerRequestBus(bus.Broadcast, 'GetGraph', newGraphId) - boxShapeNode = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, 'CreateNodeForTypeName', - newGraph, 'BoxShapeNode') - graph.GraphControllerRequestBus(bus.Event, 'AddNode', newGraphId, boxShapeNode, math.Vector2(positionX, - positionY)) - boxShapeEntityId = newEntityId - - positionX += offsetX - positionY += offsetY - - # Add a random noise gradient node to the graph - randomNoiseNode = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, 'CreateNodeForTypeName', - newGraph, 'RandomNoiseGradientNode') - graph.GraphControllerRequestBus(bus.Event, 'AddNode', newGraphId, randomNoiseNode, math.Vector2(positionX, - positionY)) - randomNoiseEntityId = newEntityId - - positionX += offsetX - positionY += offsetY - - # Add a dither gradient modifier node to the graph - ditherNode = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, 'CreateNodeForTypeName', - newGraph, 'DitherGradientModifierNode') - graph.GraphControllerRequestBus(bus.Event, 'AddNode', newGraphId, ditherNode, math.Vector2(positionX, - positionY)) - ditherEntityId = newEntityId - - positionX += offsetX - positionY += offsetY - - # Add a gradient mixer node to the graph - gradientMixerNode = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, 'CreateNodeForTypeName', - newGraph, 'GradientMixerNode') - graph.GraphControllerRequestBus(bus.Event, 'AddNode', newGraphId, gradientMixerNode, math.Vector2(positionX, - positionY)) - gradientMixerEntityId = newEntityId - - boundsSlotId = graph.GraphModelSlotId('Bounds') - previewBoundsSlotId = graph.GraphModelSlotId('PreviewBounds') - inboundGradientSlotId = graph.GraphModelSlotId('InboundGradient') - outboundGradientSlotId = graph.GraphModelSlotId('OutboundGradient') - - # Connect slots on our nodes to test all slot types like so: - # Shape -> Gradient -> Gradient Modifier -> Gradient Mixer - # - # Which tests the following slot types: - # * Shape -> Preview Bounds - # * Gradient Output -> Gradient Modifier - # * Gradient Output -> Gradient Mixer (extendable slots) - graph.GraphControllerRequestBus(bus.Event, 'AddConnectionBySlotId', newGraphId, boxShapeNode, boundsSlotId, - randomNoiseNode, previewBoundsSlotId) - graph.GraphControllerRequestBus(bus.Event, 'AddConnectionBySlotId', newGraphId, randomNoiseNode, - outboundGradientSlotId, ditherNode, inboundGradientSlotId) - graph.GraphControllerRequestBus(bus.Event, 'AddConnectionBySlotId', newGraphId, ditherNode, - outboundGradientSlotId, gradientMixerNode, inboundGradientSlotId) - - # Delay to allow all the underlying component properties to be updated after the slot connections are made - general.idle_wait(1.0) - - # Verify the Preview EntityId property on our Random Noise Gradient component has been set to our Box Shape's - # EntityId - previewEntityId = getEntityIdFromComponentProperty(randomNoiseEntityId, 'Random Noise Gradient', - 'Preview Settings|Pin Preview to Shape') - random_gradient_success = previewEntityId and boxShapeEntityId.invoke("Equal", previewEntityId) - self.test_success = self.test_success and random_gradient_success - if random_gradient_success: - self.log("Random Noise Gradient component Preview Entity property set to Box Shape EntityId") - - # Verify the Inbound Gradient EntityId property on our Dither Gradient Modifier component has been set to our - # Random Noise Gradient's EntityId - inboundGradientEntityId = getEntityIdFromComponentProperty(ditherEntityId, 'Dither Gradient Modifier', - 'Configuration|Gradient|Gradient Entity Id') - dither_gradient_success = inboundGradientEntityId and randomNoiseEntityId.invoke("Equal", - inboundGradientEntityId) - self.test_success = self.test_success and dither_gradient_success - if dither_gradient_success: - self.log("Dither Gradient Modifier component Inbound Gradient property set to Random Noise Gradient " - "EntityId") - - # Verify the Inbound Gradient Mixer EntityId property on our Gradient Mixer component has been set to our - # Dither Gradient Modifier's EntityId - inboundGradientMixerEntityId = getEntityIdFromComponentProperty(gradientMixerEntityId, 'Gradient Mixer', - 'Configuration|Layers|[0]|Gradient|Gradient Entity Id') - gradient_mixer_success = inboundGradientMixerEntityId and ditherEntityId.invoke("Equal", - inboundGradientMixerEntityId) - self.test_success = self.test_success and gradient_mixer_success - if gradient_mixer_success: - self.log("Gradient Mixer component Inbound Gradient extendable property set to Dither Gradient Modifier " - "EntityId") - - # Stop listening for entity creation notifications - handler.disconnect() + editorId = azlmbr.globals.property.LANDSCAPE_CANVAS_EDITOR_ID -test = TestSlotConnectionsUpdateComponents() -test.run() + # Retrieve the proper component TypeIds per component name + componentNames = [ + 'Random Noise Gradient', + 'Dither Gradient Modifier', + 'Gradient Mixer' + ] + componentTypeIds = hydra.get_component_type_id_map(componentNames) + + # Helper method for retrieving an EntityId from a specific property on a component + def getEntityIdFromComponentProperty(targetEntityId, componentTypeName, propertyPath): + componentOutcome = editor.EditorComponentAPIBus(bus.Broadcast, 'GetComponentOfType', targetEntityId, + componentTypeIds[componentTypeName]) + + if not componentOutcome.IsSuccess(): + return None + + component = componentOutcome.GetValue() + propertyOutcome = editor.EditorComponentAPIBus(bus.Broadcast, 'GetComponentProperty', component, + propertyPath) + if not propertyOutcome.IsSuccess(): + return None + + return propertyOutcome.GetValue() + + def onEntityCreated(parameters): + global newEntityId + newEntityId = parameters[0] + + # Open an existing simple level + helper.init_idle() + helper.open_level("Physics", "Base") + + # Open Landscape Canvas tool and verify + general.open_pane('Landscape Canvas') + Report.critical_result(Tests.lc_tool_opened, general.is_pane_visible('Landscape Canvas')) + + # Create a new graph in Landscape Canvas + newGraphId = graph.AssetEditorRequestBus(bus.Event, 'CreateNewGraph', editorId) + Report.critical_result(Tests.new_graph_created, newGraphId is not None) + + # Make sure the graph we created is in Landscape Canvas + graph_registered = graph.AssetEditorRequestBus(bus.Event, 'ContainsGraph', editorId, newGraphId) + Report.result(Tests.graph_registered, graph_registered) + + # Listen for entity creation notifications so we can verify the component EntityId + # references are set correctly when connecting slots on the nodes + handler = editor.EditorEntityContextNotificationBusHandler() + handler.connect() + handler.add_callback('OnEditorEntityCreated', onEntityCreated) + + positionX = 10.0 + positionY = 10.0 + offsetX = 340.0 + offsetY = 100.0 + + # Add a box shape node to the graph + newGraph = graph.GraphManagerRequestBus(bus.Broadcast, 'GetGraph', newGraphId) + boxShapeNode = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, 'CreateNodeForTypeName', + newGraph, 'BoxShapeNode') + graph.GraphControllerRequestBus(bus.Event, 'AddNode', newGraphId, boxShapeNode, math.Vector2(positionX, + positionY)) + boxShapeEntityId = newEntityId + + positionX += offsetX + positionY += offsetY + + # Add a random noise gradient node to the graph + randomNoiseNode = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, 'CreateNodeForTypeName', + newGraph, 'RandomNoiseGradientNode') + graph.GraphControllerRequestBus(bus.Event, 'AddNode', newGraphId, randomNoiseNode, math.Vector2(positionX, + positionY)) + randomNoiseEntityId = newEntityId + + positionX += offsetX + positionY += offsetY + + # Add a dither gradient modifier node to the graph + ditherNode = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, 'CreateNodeForTypeName', + newGraph, 'DitherGradientModifierNode') + graph.GraphControllerRequestBus(bus.Event, 'AddNode', newGraphId, ditherNode, math.Vector2(positionX, + positionY)) + ditherEntityId = newEntityId + + positionX += offsetX + positionY += offsetY + + # Add a gradient mixer node to the graph + gradientMixerNode = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, 'CreateNodeForTypeName', + newGraph, 'GradientMixerNode') + graph.GraphControllerRequestBus(bus.Event, 'AddNode', newGraphId, gradientMixerNode, math.Vector2(positionX, + positionY)) + gradientMixerEntityId = newEntityId + + boundsSlotId = graph.GraphModelSlotId('Bounds') + previewBoundsSlotId = graph.GraphModelSlotId('PreviewBounds') + inboundGradientSlotId = graph.GraphModelSlotId('InboundGradient') + outboundGradientSlotId = graph.GraphModelSlotId('OutboundGradient') + + # Connect slots on our nodes to test all slot types like so: + # Shape -> Gradient -> Gradient Modifier -> Gradient Mixer + # + # Which tests the following slot types: + # * Shape -> Preview Bounds + # * Gradient Output -> Gradient Modifier + # * Gradient Output -> Gradient Mixer (extendable slots) + graph.GraphControllerRequestBus(bus.Event, 'AddConnectionBySlotId', newGraphId, boxShapeNode, boundsSlotId, + randomNoiseNode, previewBoundsSlotId) + graph.GraphControllerRequestBus(bus.Event, 'AddConnectionBySlotId', newGraphId, randomNoiseNode, + outboundGradientSlotId, ditherNode, inboundGradientSlotId) + graph.GraphControllerRequestBus(bus.Event, 'AddConnectionBySlotId', newGraphId, ditherNode, + outboundGradientSlotId, gradientMixerNode, inboundGradientSlotId) + + # Delay to allow all the underlying component properties to be updated after the slot connections are made + general.idle_wait(1.0) + + + # Verify the Preview EntityId property on our Random Noise Gradient component has been set to our Box Shape's + # EntityId + previewEntityId = getEntityIdFromComponentProperty(randomNoiseEntityId, 'Random Noise Gradient', + 'Preview Settings|Pin Preview to Shape') + random_gradient_success = previewEntityId and boxShapeEntityId.invoke("Equal", previewEntityId) + Report.result(Tests.preview_entity_set, random_gradient_success) + + # Verify the Inbound Gradient EntityId property on our Dither Gradient Modifier component has been set to our + # Random Noise Gradient's EntityId + inboundGradientEntityId = getEntityIdFromComponentProperty(ditherEntityId, 'Dither Gradient Modifier', + 'Configuration|Gradient|Gradient Entity Id') + dither_gradient_success = inboundGradientEntityId and randomNoiseEntityId.invoke("Equal", + inboundGradientEntityId) + Report.result(Tests.dither_inbound_gradient_set, dither_gradient_success) + + # Verify the Inbound Gradient Mixer EntityId property on our Gradient Mixer component has been set to our + # Dither Gradient Modifier's EntityId + inboundGradientMixerEntityId = getEntityIdFromComponentProperty(gradientMixerEntityId, 'Gradient Mixer', + 'Configuration|Layers|[0]|Gradient|Gradient Entity Id') + gradient_mixer_success = inboundGradientMixerEntityId and ditherEntityId.invoke("Equal", + inboundGradientMixerEntityId) + Report.result(Tests.mixer_inbound_gradient_set, gradient_mixer_success) + + # Stop listening for entity creation notifications + handler.disconnect() + + +if __name__ == "__main__": + + from editor_python_test_tools.utils import Report + Report.start_test(SlotConnections_UpdateComponentReferences) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/TestSuite_Main.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/TestSuite_Main.py new file mode 100644 index 0000000000..af4855a546 --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/TestSuite_Main.py @@ -0,0 +1,29 @@ +""" +Copyright (c) Contributors to the Open 3D Engine Project. +For complete copyright and license terms please see the LICENSE at the root of this distribution. + +SPDX-License-Identifier: Apache-2.0 OR MIT +""" + +import os +import pytest +import sys + +import ly_test_tools.environment.file_system as file_system + +sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../../automatedtesting_shared') +from base import TestAutomationBase + + +@pytest.mark.SUITE_main +@pytest.mark.parametrize("launcher_platform", ['windows_editor']) +@pytest.mark.parametrize("project", ["AutomatedTesting"]) +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) + + 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) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/TestSuite_Main_Optimized.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/TestSuite_Main_Optimized.py new file mode 100644 index 0000000000..8c662a9b45 --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/TestSuite_Main_Optimized.py @@ -0,0 +1,95 @@ +""" +Copyright (c) Contributors to the Open 3D Engine Project. +For complete copyright and license terms please see the LICENSE at the root of this distribution. + +SPDX-License-Identifier: Apache-2.0 OR MIT +""" + +import os +import pytest + +import ly_test_tools.environment.file_system as file_system +from ly_test_tools.o3de.editor_test import EditorSingleTest, EditorSharedTest, EditorParallelTest, EditorTestSuite + + +@pytest.mark.SUITE_periodic +@pytest.mark.parametrize("launcher_platform", ['windows_editor']) +@pytest.mark.parametrize("project", ["AutomatedTesting"]) +class TestAutomation(EditorTestSuite): + + class test_LandscapeCanvas_SlotConnections_UpdateComponentReferences(EditorSharedTest): + from .EditorScripts import SlotConnections_UpdateComponentReferences as test_module + + class test_LandscapeCanvas_GradientMixer_NodeConstruction(EditorSharedTest): + from .EditorScripts import GradientMixer_NodeConstruction as test_module + + class test_LandscapeCanvas_AreaNodes_DependentComponentsAdded(EditorSharedTest): + from .EditorScripts import AreaNodes_DependentComponentsAdded as test_module + + class test_LandscapeCanvas_AreaNodes_EntityCreatedOnNodeAdd(EditorSharedTest): + from .EditorScripts import AreaNodes_EntityCreatedOnNodeAdd as test_module + + class test_LandscapeCanvas_AreaNodes_EntityRemovedOnNodeDelete(EditorSharedTest): + from .EditorScripts import AreaNodes_EntityRemovedOnNodeDelete as test_module + + class test_LandscapeCanvas_LayerExtenderNodes_ComponentEntitySync(EditorSharedTest): + from .EditorScripts import LayerExtenderNodes_ComponentEntitySync as test_module + + class test_LandscapeCanvas_Edit_DisabledNodeDuplication(EditorSharedTest): + from .EditorScripts import Edit_DisabledNodeDuplication as test_module + + class test_LandscapeCanvas_Edit_UndoNodeDelete_SliceEntity(EditorSharedTest): + from .EditorScripts import Edit_UndoNodeDelete_SliceEntity as test_module + + class test_LandscapeCanvas_NewGraph_CreatedSuccessfully(EditorSharedTest): + from .EditorScripts import NewGraph_CreatedSuccessfully as test_module + + class test_LandscapeCanvas_Component_AddedRemoved(EditorSharedTest): + from .EditorScripts import Component_AddedRemoved as test_module + + class test_LandscapeCanvas_GraphClosed_OnLevelChange(EditorSharedTest): + from .EditorScripts import GraphClosed_OnLevelChange as test_module + + @pytest.mark.xfail(reason="https://github.com/o3de/o3de/issues/2201") + class test_LandscapeCanvas_GraphClosed_OnEntityDelete(EditorSharedTest): + from .EditorScripts import GraphClosed_OnEntityDelete as test_module + + class test_LandscapeCanvas_GraphClosed_TabbedGraphClosesIndependently(EditorSharedTest): + from .EditorScripts import GraphClosed_TabbedGraph as test_module + + class test_LandscapeCanvas_Slice_CreateInstantiate(EditorSingleTest): + # Custom teardown to remove slice asset created during test + def teardown(self, request, workspace, editor, editor_test_results, launcher_platform): + file_system.delete([os.path.join(workspace.paths.engine_root(), "AutomatedTesting", "slices", + "TestSlice.slice")], True, True) + from .EditorScripts import Slice_CreateInstantiate as test_module + + class test_LandscapeCanvas_GradientModifierNodes_EntityCreatedOnNodeAdd(EditorSharedTest): + from .EditorScripts import GradientModifierNodes_EntityCreatedOnNodeAdd as test_module + + class test_LandscapeCanvas_GradientModifierNodes_EntityRemovedOnNodeDelete(EditorSharedTest): + from .EditorScripts import GradientModifierNodes_EntityRemovedOnNodeDelete as test_module + + class test_LandscapeCanvas_GradientNodes_DependentComponentsAdded(EditorSharedTest): + from .EditorScripts import GradientNodes_DependentComponentsAdded as test_module + + class test_LandscapeCanvas_GradientNodes_EntityCreatedOnNodeAdd(EditorSharedTest): + from .EditorScripts import GradientNodes_EntityCreatedOnNodeAdd as test_module + + class test_LandscapeCanvas_GradientNodes_EntityRemovedOnNodeDelete(EditorSharedTest): + from .EditorScripts import GradientNodes_EntityRemovedOnNodeDelete as test_module + + class test_LandscapeCanvas_GraphUpdates_UpdateComponents(EditorSharedTest): + from .EditorScripts import GraphUpdates_UpdateComponents as test_module + + class test_LandscapeCanvas_ComponentUpdates_UpdateGraph(EditorSharedTest): + from .EditorScripts import ComponentUpdates_UpdateGraph as test_module + + class test_LandscapeCanvas_LayerBlender_NodeConstruction(EditorSharedTest): + from .EditorScripts import LayerBlender_NodeConstruction as test_module + + class test_LandscapeCanvas_ShapeNodes_EntityCreatedOnNodeAdd(EditorSharedTest): + from .EditorScripts import ShapeNodes_EntityCreatedOnNodeAdd as test_module + + class test_LandscapeCanvas_ShapeNodes_EntityRemovedOnNodeDelete(EditorSharedTest): + from .EditorScripts import ShapeNodes_EntityRemovedOnNodeDelete as test_module \ No newline at end of file diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/TestSuite_Periodic.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/TestSuite_Periodic.py new file mode 100644 index 0000000000..ef8b3e492b --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/TestSuite_Periodic.py @@ -0,0 +1,121 @@ +""" +Copyright (c) Contributors to the Open 3D Engine Project. +For complete copyright and license terms please see the LICENSE at the root of this distribution. + +SPDX-License-Identifier: Apache-2.0 OR MIT +""" + +import os +import pytest +import sys + +import ly_test_tools.environment.file_system as file_system + +sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../../automatedtesting_shared') +from base import TestAutomationBase + + +@pytest.fixture +def remove_test_slice(request, workspace, project): + file_system.delete([os.path.join(workspace.paths.engine_root(), project, "slices", "TestSlice.slice")], True, True) + + def teardown(): + file_system.delete([os.path.join(workspace.paths.engine_root(), project, "slices", "TestSlice.slice")], True, + True) + + request.addfinalizer(teardown) + + +@pytest.mark.SUITE_periodic +@pytest.mark.parametrize("launcher_platform", ['windows_editor']) +@pytest.mark.parametrize("project", ["AutomatedTesting"]) +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) + + 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) + + 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) + + 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) + + 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) + + 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) + + 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) + + 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) + + 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) + + @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) + + 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) + + 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) + + 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) + + 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) + + 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) + + 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) + + 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) + + 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) + + 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) + + 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) + + 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) + + 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) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_AreaNodes.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_AreaNodes.py deleted file mode 100755 index e5736d9db9..0000000000 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_AreaNodes.py +++ /dev/null @@ -1,125 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -""" -C13815919 - Appropriate component dependencies are automatically added to node entities -C13767844 - All Vegetation Area nodes can be added to a graph -C17605868 - All Vegetation Area nodes can be removed from a graph -C13815873 - All Filters/Modifiers/Selectors can be added to/removed from a Layer node -""" - -import os -import pytest - -# Bail on the test if ly_test_tools doesn't exist. -pytest.importorskip('ly_test_tools') -import ly_test_tools.environment.file_system as file_system -import editor_python_test_tools.hydra_test_utils as hydra - -test_directory = os.path.join(os.path.dirname(__file__), 'EditorScripts') - - -@pytest.mark.parametrize('project', ['AutomatedTesting']) -@pytest.mark.parametrize('level', ['tmp_level']) -@pytest.mark.usefixtures("automatic_process_killer") -@pytest.mark.parametrize("launcher_platform", ['windows_editor']) -class TestAreaNodes(object): - - @pytest.fixture(autouse=True) - def setup_teardown(self, request, workspace, project, level): - def teardown(): - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - - request.addfinalizer(teardown) - - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - - @pytest.mark.test_case_id('C13815919') - @pytest.mark.SUITE_periodic - def test_LandscapeCanvas_AreaNodes_DependentComponentsAdded(self, request, editor, level, launcher_platform): - cfg_args = [level] - - expected_lines = [ - "Landscape Canvas pane is open", - "New graph created", - "Graph registered with Landscape Canvas", - "SpawnerAreaNode created new Entity with all required components", - "MeshBlockerAreaNode created new Entity with all required components", - "BlockerAreaNode created new Entity with all required components", - "AreaNodeComponentDependency: result=SUCCESS" - ] - - hydra.launch_and_validate_results(request, test_directory, editor, 'AreaNodes_DependentComponentsAdded.py', - expected_lines, cfg_args=cfg_args) - - @pytest.mark.test_case_id('C13767844') - @pytest.mark.SUITE_periodic - def test_LandscapeCanvas_AreaNodes_EntityCreatedOnNodeAdd(self, request, editor, level, launcher_platform): - """ - Verifies all Area nodes can be successfully added to a Landscape Canvas graph, and the proper entity - creation occurs. - """ - cfg_args = [level] - - expected_lines = [ - "Landscape Canvas pane is open", - "New graph created", - "Graph registered with Landscape Canvas", - "AreaBlenderNode created new Entity with Vegetation Layer Blender Component", - "BlockerAreaNode created new Entity with Vegetation Layer Blocker Component", - "MeshBlockerAreaNode created new Entity with Vegetation Layer Blocker (Mesh) Component", - "SpawnerAreaNode created new Entity with Vegetation Layer Spawner Component", - "AreaNodeEntityCreate: result=SUCCESS" - ] - - hydra.launch_and_validate_results(request, test_directory, editor, 'AreaNodes_EntityCreatedOnNodeAdd.py', - expected_lines, cfg_args=cfg_args) - - @pytest.mark.test_case_id('C17605868') - @pytest.mark.SUITE_periodic - def test_LandscapeCanvas_AreaNodes_EntityRemovedOnNodeDelete(self, request, editor, level, launcher_platform): - """ - Verifies all Area nodes can be successfully removed from a Landscape Canvas graph, and the proper entity - cleanup occurs. - """ - cfg_args = [level] - - expected_lines = [ - "Landscape Canvas pane is open", - "New graph created", - "Graph registered with Landscape Canvas", - "AreaBlenderNode corresponding Entity was deleted when node is removed", - "MeshBlockerAreaNode corresponding Entity was deleted when node is removed", - "SpawnerAreaNode corresponding Entity was deleted when node is removed", - "BlockerAreaNode corresponding Entity was deleted when node is removed", - "AreaNodeEntityDelete: result=SUCCESS" - ] - - hydra.launch_and_validate_results(request, test_directory, editor, - 'AreaNodes_EntityRemovedOnNodeDelete.py', expected_lines, cfg_args=cfg_args) - - @pytest.mark.test_case_id('C13815873') - @pytest.mark.SUITE_periodic - def test_LandscapeCanvas_LayerExtenderNodes_ComponentEntitySync(self, request, editor, level, launcher_platform): - """ - Verifies all Area Extender nodes can be successfully added to and removed from a Landscape Canvas graph, and the - proper entity creation/cleanup occurs. - """ - cfg_args = [level] - - expected_lines = [ - "Landscape Canvas pane is open", - "New graph created", - "Graph registered with Landscape Canvas", - "AreaBlenderNode successfully added and removed all filters/modifiers/selectors", - "SpawnerAreaNode successfully added and removed all filters/modifiers/selectors", - "LayerExtenderNodeComponentEntitySync: result=SUCCESS" - ] - - hydra.launch_and_validate_results(request, test_directory, editor, - 'LayerExtenderNodes_ComponentEntitySync.py', expected_lines, - cfg_args=cfg_args) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_EditFunctionality.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_EditFunctionality.py deleted file mode 100755 index 7ff110d6b0..0000000000 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_EditFunctionality.py +++ /dev/null @@ -1,84 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -""" -C29278563 - Disabled nodes can be successfully duplicated -C30813586 - Editor remains stable after Undoing deletion of a node on a slice entity -""" - -import os -import pytest - -# Bail on the test if ly_test_tools doesn't exist. -pytest.importorskip('ly_test_tools') -import ly_test_tools.environment.file_system as file_system -import editor_python_test_tools.hydra_test_utils as hydra - -test_directory = os.path.join(os.path.dirname(__file__), 'EditorScripts') - - -@pytest.mark.parametrize('project', ['AutomatedTesting']) -@pytest.mark.parametrize('level', ['tmp_level']) -@pytest.mark.usefixtures("automatic_process_killer") -@pytest.mark.parametrize("launcher_platform", ['windows_editor']) -class TestEditFunctionality(object): - - @pytest.fixture(autouse=True) - def setup_teardown(self, request, workspace, project, level): - def teardown(): - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - request.addfinalizer(teardown) - - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - - @pytest.mark.test_case_id('C29278563') - @pytest.mark.SUITE_periodic - def test_LandscapeCanvas_DuplicateDisabledNodes(self, request, editor, level, launcher_platform): - cfg_args = [level] - - expected_lines = [ - "Landscape Canvas pane is open", - "New graph created", - "SpawnerAreaNode duplicated with disabled component", - "SpawnerAreaNode duplicated with deleted component", - "MeshBlockerAreaNode duplicated with disabled component", - "MeshBlockerAreaNode duplicated with deleted component", - "BlockerAreaNode duplicated with disabled component", - "BlockerAreaNode duplicated with deleted component", - "FastNoiseGradientNode duplicated with disabled component", - "FastNoiseGradientNode duplicated with deleted component", - "ImageGradientNode duplicated with disabled component", - "ImageGradientNode duplicated with deleted component", - "PerlinNoiseGradientNode duplicated with disabled component", - "PerlinNoiseGradientNode duplicated with deleted component", - "RandomNoiseGradientNode duplicated with disabled component", - "RandomNoiseGradientNode duplicated with deleted component", - "DisabledNodeDuplication: result=SUCCESS" - ] - - hydra.launch_and_validate_results(request, test_directory, editor, 'Edit_DisabledNodeDuplication.py', - expected_lines, cfg_args=cfg_args) - - @pytest.mark.test_case_id('C30813586') - @pytest.mark.SUITE_periodic - def test_LandscapeCanvas_UndoNodeDelete_SliceEntity(self, request, editor, level, launcher_platform): - cfg_args = [level] - - expected_lines = [ - "Vegetation Layer Spawner node found on graph", - "Vegetation Layer Spawner node was removed", - "Editor is still responsive", - "UndoNodeDeleteSlice: result=SUCCESS" - ] - - unexpected_lines = [ - "Vegetation Layer Spawner node not found", - "Vegetation Layer Spawner node was not removed" - ] - - hydra.launch_and_validate_results(request, test_directory, editor, 'Edit_UndoNodeDelete_SliceEntity.py', - expected_lines, unexpected_lines=unexpected_lines, cfg_args=cfg_args) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_GeneralGraphFunctionality.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_GeneralGraphFunctionality.py deleted file mode 100755 index d191a82a58..0000000000 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_GeneralGraphFunctionality.py +++ /dev/null @@ -1,173 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -""" -C2735988 - Landscape Canvas tool can be opened/closed -C13815862 - New graph can be created -C13767840 - New root entity is created when a new graph is created through Landscape Canvas -""" - -import os -import pytest - -# Bail on the test if ly_test_tools doesn't exist. -pytest.importorskip("ly_test_tools") -import ly_test_tools.environment.file_system as file_system -import editor_python_test_tools.hydra_test_utils as hydra - -test_directory = os.path.join(os.path.dirname(__file__), "EditorScripts") - - -@pytest.mark.parametrize("project", ["AutomatedTesting"]) -@pytest.mark.parametrize("level", ["tmp_level"]) -@pytest.mark.usefixtures("automatic_process_killer") -@pytest.mark.parametrize("launcher_platform", ['windows_editor']) -class TestGeneralGraphFunctionality(object): - @pytest.fixture(autouse=True) - def setup_teardown(self, request, workspace, project, level): - def teardown(): - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "slices", "TestSlice.slice")], True, True) - - request.addfinalizer(teardown) - - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "slices", "TestSlice.slice")], True, True) - - @pytest.mark.test_case_id("C2735988", "C13815862", "C13767840") - @pytest.mark.SUITE_periodic - def test_LandscapeCanvas_NewGraph_CreatedSuccessfully(self, request, editor, level, launcher_platform): - cfg_args = [level] - - expected_lines = [ - "Landscape Canvas pane is open", - "New graph created", - "Graph registered with Landscape Canvas", - "Root entity has Landscape Canvas component", - "Landscape Canvas pane is closed", - "CreateNewGraph: result=SUCCESS", - ] - - hydra.launch_and_validate_results( - request, - test_directory, - editor, - "CreateNewGraph.py", - expected_lines, - cfg_args=cfg_args - ) - - @pytest.mark.test_case_id("C2735990") - @pytest.mark.SUITE_periodic - def test_LandscapeCanvas_Component_AddedRemoved(self, request, editor, level, launcher_platform): - cfg_args = [level] - - expected_lines = [ - "Landscape Canvas Component added to Entity", - "Landscape Canvas Component removed from Entity", - "LandscapeCanvasComponentAddedRemoved: result=SUCCESS", - ] - - hydra.launch_and_validate_results( - request, - test_directory, - editor, - "LandscapeCanvasComponent_AddedRemoved.py", - expected_lines, - cfg_args=cfg_args - ) - - @pytest.mark.test_case_id("C14212352") - @pytest.mark.SUITE_periodic - def test_LandscapeCanvas_GraphClosed_OnLevelChange(self, request, editor, level, launcher_platform): - cfg_args = [level] - - expected_lines = [ - "Landscape Canvas pane is open", - "New graph created", - "Graph registered with Landscape Canvas", - "Graph is no longer open in Landscape Canvas", - "GraphClosedOnLevelChange: result=SUCCESS", - ] - - hydra.launch_and_validate_results( - request, - test_directory, - editor, - "GraphClosed_OnLevelChange.py", - expected_lines, - cfg_args=cfg_args - ) - - @pytest.mark.test_case_id("C17488412") - @pytest.mark.SUITE_periodic - @pytest.mark.xfail # https://github.com/o3de/o3de/issues/2201 - def test_LandscapeCanvas_GraphClosed_OnEntityDelete(self, request, editor, level, launcher_platform): - cfg_args = [level] - - expected_lines = [ - "Landscape Canvas pane is open", - "Graph registered with Landscape Canvas", - "The graph is no longer open after deleting the Entity", - "GraphClosedOnEntityDelete: result=SUCCESS", - ] - - hydra.launch_and_validate_results( - request, - test_directory, - editor, - "GraphClosed_OnEntityDelete.py", - expected_lines, - cfg_args=cfg_args - ) - - @pytest.mark.test_case_id("C15167461") - @pytest.mark.SUITE_periodic - def test_LandscapeCanvas_GraphClosed_TabbedGraphClosesIndependently(self, request, editor, level, - launcher_platform): - cfg_args = [level] - - expected_lines = [ - "Landscape Canvas pane is open", - "New graph created", - "2nd new graph created", - "3rd new graph created", - "Graphs registered with Landscape Canvas", - "Graph 2 was successfully closed", - "GraphClosedTabbedGraph: result=SUCCESS", - ] - - hydra.launch_and_validate_results( - request, - test_directory, - editor, - "GraphClosed_TabbedGraph.py", - expected_lines, - cfg_args=cfg_args - ) - - @pytest.mark.test_case_id("C22602016") - @pytest.mark.SUITE_periodic - def test_LandscapeCanvas_SliceCreateInstantiate(self, request, editor, level, workspace, launcher_platform): - cfg_args = [level] - - expected_lines = [ - "LandscapeCanvas_SliceCreateInstantiate: test started", - "landscape_canvas_entity Entity successfully created", - "LandscapeCanvas_SliceCreateInstantiate: Slice has been created successfully: True", - "LandscapeCanvas_SliceCreateInstantiate: Slice instantiated: True", - "LandscapeCanvas_SliceCreateInstantiate: result=SUCCESS", - ] - - hydra.launch_and_validate_results( - request, - test_directory, - editor, - "LandscapeCanvas_SliceCreateInstantiate.py", - expected_lines=expected_lines, - cfg_args=cfg_args - ) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_GradientModifierNodes.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_GradientModifierNodes.py deleted file mode 100755 index 99f342a574..0000000000 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_GradientModifierNodes.py +++ /dev/null @@ -1,92 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -""" -C13767841 - All Gradient Modifier nodes can be added to a graph -C18055051 - All Gradient Modifier nodes can be removed from a graph -""" - -import os -import pytest - -# Bail on the test if ly_test_tools doesn't exist. -pytest.importorskip('ly_test_tools') -import ly_test_tools.environment.file_system as file_system -import editor_python_test_tools.hydra_test_utils as hydra - -test_directory = os.path.join(os.path.dirname(__file__), 'EditorScripts') - - -@pytest.mark.parametrize('project', ['AutomatedTesting']) -@pytest.mark.parametrize('level', ['tmp_level']) -@pytest.mark.usefixtures("automatic_process_killer") -@pytest.mark.parametrize("launcher_platform", ['windows_editor']) -class TestGradientModifierNodes(object): - - @pytest.fixture(autouse=True) - def setup_teardown(self, request, workspace, project, level): - def teardown(): - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - request.addfinalizer(teardown) - - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - - @pytest.mark.test_case_id('C13767841') - @pytest.mark.SUITE_periodic - def test_LandscapeCanvas_GradientModifierNodes_EntityCreatedOnNodeAdd(self, request, editor, level, - launcher_platform): - """ - Verifies all Gradient Modifier nodes can be successfully added to a Landscape Canvas graph, and the proper - entity creation occurs. - """ - cfg_args = [level] - - expected_lines = [ - "Landscape Canvas pane is open", - "New graph created", - "Graph registered with Landscape Canvas", - "DitherGradientModifierNode created new Entity with Dither Gradient Modifier Component", - "GradientMixerNode created new Entity with Gradient Mixer Component", - "InvertGradientModifierNode created new Entity with Invert Gradient Modifier Component", - "LevelsGradientModifierNode created new Entity with Levels Gradient Modifier Component", - "PosterizeGradientModifierNode created new Entity with Posterize Gradient Modifier Component", - "SmoothStepGradientModifierNode created new Entity with Smooth-Step Gradient Modifier Component", - "ThresholdGradientModifierNode created new Entity with Threshold Gradient Modifier Component", - "GradientModifierNodeEntityCreate: result=SUCCESS" - ] - - hydra.launch_and_validate_results(request, test_directory, editor, - 'GradientModifierNodes_EntityCreatedOnNodeAdd.py', - expected_lines, cfg_args=cfg_args) - - @pytest.mark.test_case_id('C18055051') - @pytest.mark.SUITE_periodic - def test_LandscapeCanvas_GradientModifierNodes_EntityRemovedOnNodeDelete(self, request, editor, level, - launcher_platform): - """ - Verifies all Gradient Modifier nodes can be successfully removed from a Landscape Canvas graph, and the proper - entity cleanup occurs. - """ - cfg_args = [level] - - expected_lines = [ - "Landscape Canvas pane is open", - "New graph created", - "Graph registered with Landscape Canvas", - "DitherGradientModifierNode corresponding Entity was deleted when node is removed", - "GradientMixerNode corresponding Entity was deleted when node is removed", - "InvertGradientModifierNode corresponding Entity was deleted when node is removed", - "LevelsGradientModifierNode corresponding Entity was deleted when node is removed", - "PosterizeGradientModifierNode corresponding Entity was deleted when node is removed", - "SmoothStepGradientModifierNode corresponding Entity was deleted when node is removed", - "ThresholdGradientModifierNode corresponding Entity was deleted when node is removed", - "GradientModifierNodeEntityDelete: result=SUCCESS" - ] - - hydra.launch_and_validate_results(request, test_directory, editor, - 'GradientModifierNodes_EntityRemovedOnNodeDelete.py', - expected_lines, cfg_args=cfg_args) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_GradientNodes.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_GradientNodes.py deleted file mode 100755 index 1fdb254e98..0000000000 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_GradientNodes.py +++ /dev/null @@ -1,109 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -""" -C13815920 - Appropriate component dependencies are automatically added to node entities -C13767842 - All Gradient nodes can be added to a graph -C17461363 - All Gradient nodes can be removed from a graph -""" - -import os -import pytest - -# Bail on the test if ly_test_tools doesn't exist. -pytest.importorskip('ly_test_tools') -import ly_test_tools.environment.file_system as file_system -import editor_python_test_tools.hydra_test_utils as hydra - -test_directory = os.path.join(os.path.dirname(__file__), 'EditorScripts') - - -@pytest.mark.parametrize('project', ['AutomatedTesting']) -@pytest.mark.parametrize('level', ['tmp_level']) -@pytest.mark.usefixtures("automatic_process_killer") -@pytest.mark.parametrize("launcher_platform", ['windows_editor']) -class TestGradientNodes(object): - - @pytest.fixture(autouse=True) - def setup_teardown(self, request, workspace, project, level): - def teardown(): - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - request.addfinalizer(teardown) - - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - - @pytest.mark.test_case_id('C13815920') - @pytest.mark.SUITE_periodic - def test_LandscapeCanvas_GradientNodes_DependentComponentsAdded(self, request, editor, level, launcher_platform): - cfg_args = [level] - - expected_lines = [ - "Landscape Canvas pane is open", - "New graph created", - "Graph registered with Landscape Canvas", - "FastNoiseGradientNode created new Entity with all required components", - "ImageGradientNode created new Entity with all required components", - "PerlinNoiseGradientNode created new Entity with all required components", - "RandomNoiseGradientNode created new Entity with all required components" - ] - - hydra.launch_and_validate_results(request, test_directory, editor, 'GradientNodes_DependentComponentsAdded.py', - expected_lines, cfg_args=cfg_args) - - @pytest.mark.test_case_id('C13767842') - @pytest.mark.SUITE_periodic - def test_LandscapeCanvas_GradientNodes_EntityCreatedOnNodeAdd(self, request, editor, level, launcher_platform): - """ - Verifies all Gradient nodes can be successfully added to a Landscape Canvas graph, and the proper entity - creation occurs. - """ - cfg_args = [level] - - expected_lines = [ - "Landscape Canvas pane is open", - "New graph created", - "Graph registered with Landscape Canvas", - "AltitudeGradientNode created new Entity with Altitude Gradient Component", - "ConstantGradientNode created new Entity with Constant Gradient Component", - "FastNoiseGradientNode created new Entity with FastNoise Gradient Component", - "ImageGradientNode created new Entity with Image Gradient Component", - "PerlinNoiseGradientNode created new Entity with Perlin Noise Gradient Component", - "RandomNoiseGradientNode created new Entity with Random Noise Gradient Component", - "ShapeAreaFalloffGradientNode created new Entity with Shape Falloff Gradient Component", - "SlopeGradientNode created new Entity with Slope Gradient Component", - "SurfaceMaskGradientNode created new Entity with Surface Mask Gradient Component" - ] - - hydra.launch_and_validate_results(request, test_directory, editor, 'GradientNodes_EntityCreatedOnNodeAdd.py', - expected_lines, cfg_args=cfg_args) - - @pytest.mark.test_case_id('C17461363') - @pytest.mark.SUITE_periodic - def test_LandscapeCanvas_GradientNodes_EntityRemovedOnNodeDelete(self, request, editor, level, launcher_platform): - """ - Verifies all Gradient nodes can be successfully removed from a Landscape Canvas graph, and the proper entity - cleanup occurs. - """ - cfg_args = [level] - - expected_lines = [ - "Landscape Canvas pane is open", - "New graph created", - "Graph registered with Landscape Canvas", - "FastNoiseGradientNode corresponding Entity was deleted when node is removed", - "AltitudeGradientNode corresponding Entity was deleted when node is removed", - "ConstantGradientNode corresponding Entity was deleted when node is removed", - "RandomNoiseGradientNode corresponding Entity was deleted when node is removed", - "ShapeAreaFalloffGradientNode corresponding Entity was deleted when node is removed", - "SlopeGradientNode corresponding Entity was deleted when node is removed", - "PerlinNoiseGradientNode corresponding Entity was deleted when node is removed", - "ImageGradientNode corresponding Entity was deleted when node is removed", - "SurfaceMaskGradientNode corresponding Entity was deleted when node is removed" - ] - - hydra.launch_and_validate_results(request, test_directory, editor, 'GradientNodes_EntityRemovedOnNodeDelete.py', - expected_lines, cfg_args=cfg_args) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_GraphComponentSync.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_GraphComponentSync.py deleted file mode 100755 index 71389dcf5b..0000000000 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_GraphComponentSync.py +++ /dev/null @@ -1,167 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -""" -C4705586 - Altering connections on graph nodes appropriately updates component properties -C22715182 - Components are updated when nodes are added/removed/updated -C22602072 - Graph is updated when underlying components are added/removed -C15987206 - Gradient Mixer Layers are properly setup when constructing in a graph -C21333743 - Vegetation Layer Blenders are properly setup when constructing in a graph -""" - -import os -import pytest - -# Bail on the test if ly_test_tools doesn't exist. -pytest.importorskip('ly_test_tools') -import ly_test_tools.environment.file_system as file_system -import ly_test_tools._internal.pytest_plugin as internal_plugin -import editor_python_test_tools.hydra_test_utils as hydra - -test_directory = os.path.join(os.path.dirname(__file__), 'EditorScripts') - - -@pytest.mark.parametrize('project', ['AutomatedTesting']) -@pytest.mark.parametrize('level', ['tmp_level']) -@pytest.mark.usefixtures("automatic_process_killer") -@pytest.mark.parametrize("launcher_platform", ['windows_editor']) -class TestGraphComponentSync(object): - - @pytest.fixture(autouse=True) - def setup_teardown(self, request, workspace, project, level): - def teardown(): - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - request.addfinalizer(teardown) - - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - - @pytest.mark.test_case_id('C4705586') - @pytest.mark.BAT - @pytest.mark.SUITE_main - def test_LandscapeCanvas_SlotConnections_UpdateComponentReferences(self, request, editor, level, launcher_platform): - - # Skip test if running against Debug build - if "debug" in internal_plugin.build_directory: - pytest.skip("Does not execute against debug builds.") - - cfg_args = [level] - - expected_lines = [ - "Landscape Canvas pane is open", - "New graph created", - "Graph registered with Landscape Canvas", - "Random Noise Gradient component Preview Entity property set to Box Shape EntityId", - "Dither Gradient Modifier component Inbound Gradient property set to Random Noise Gradient EntityId", - "Gradient Mixer component Inbound Gradient extendable property set to Dither Gradient Modifier EntityId", - "SlotConnectionsUpdateComponents: result=SUCCESS" - ] - - hydra.launch_and_validate_results(request, test_directory, editor, - 'SlotConnections_UpdateComponentReferences.py', expected_lines, - cfg_args=cfg_args) - - @pytest.mark.test_case_id('C22715182') - @pytest.mark.SUITE_periodic - def test_LandscapeCanvas_GraphUpdates_UpdateComponents(self, request, editor, level, launcher_platform): - cfg_args = [level] - - expected_lines = [ - 'Rotation Modifier component was removed from entity', - 'BushSpawner entity was deleted', - 'Gradient Entity Id reference was properly updated', - 'GraphUpdatesUpdateComponents: result=SUCCESS' - ] - - unexpected_lines = [ - 'Rotation Modifier component is still present on entity', - 'Failed to delete BushSpawner entity', - 'Gradient Entity Id was not updated properly' - ] - - hydra.launch_and_validate_results(request, test_directory, editor, 'GraphUpdates_UpdateComponents.py', - expected_lines, unexpected_lines=unexpected_lines, - cfg_args=cfg_args) - - @pytest.mark.test_case_id('C22602072') - @pytest.mark.SUITE_periodic - def test_LandscapeCanvas_ComponentUpdates_UpdateGraph(self, request, editor, level, launcher_platform): - cfg_args = [level] - - expected_lines = [ - "LandscapeCanvas entity found", - "BushSpawner entity found", - "Vegetation Distribution Filter on BushSpawner entity found", - "Graph opened", - "Distribution Filter node found on graph", - "Vegetation Altitude Filter on BushSpawner entity found", - "Altitude Filter node found on graph", - "Vegetation Distribution Filter removed from BushSpawner entity", - "Distribution Filter node was removed from the graph", - "New entity successfully added as a child of the BushSpawner entity", - "Box Shape on Box entity found", - "Box Shape node found on graph", - 'ComponentUpdatesUpdateGraph: result=SUCCESS' - ] - - unexpected_lines = [ - "Distribution Filter node not found on graph", - "Distribution Filter node is still present on the graph", - "Altitude Filter node not found on graph", - "New entity added with an unexpected parent", - "Box Shape node not found on graph" - ] - - hydra.launch_and_validate_results(request, test_directory, editor, 'ComponentUpdates_UpdateGraph.py', - expected_lines, unexpected_lines=unexpected_lines, cfg_args=cfg_args) - - @pytest.mark.test_case_id('C15987206') - @pytest.mark.SUITE_main - def test_LandscapeCanvas_GradientMixer_NodeConstruction(self, request, editor, level, launcher_platform): - """ - Verifies a Gradient Mixer can be setup in Landscape Canvas and all references are property set. - """ - - # Skip test if running against Debug build - if "debug" in internal_plugin.build_directory: - pytest.skip("Does not execute against debug builds.") - - cfg_args = [level] - - expected_lines = [ - 'Landscape Canvas pane is open', - 'New graph created', - 'Graph registered with Landscape Canvas', - 'Perlin Noise Gradient component Preview Entity property set to Box Shape EntityId', - 'Gradient Mixer component Inbound Gradient extendable property set to Perlin Noise Gradient EntityId', - 'Gradient Mixer component Inbound Gradient extendable property set to FastNoise Gradient EntityId', - 'Configuration|Layers|[0]|Operation set to 0', - 'Configuration|Layers|[1]|Operation set to 6', - 'GradientMixerNodeConstruction: result=SUCCESS' - ] - - hydra.launch_and_validate_results(request, test_directory, editor, 'GradientMixer_NodeConstruction.py', - expected_lines, cfg_args=cfg_args) - - @pytest.mark.test_case_id('C21333743') - @pytest.mark.SUITE_periodic - def test_LandscapeCanvas_LayerBlender_NodeConstruction(self, request, editor, level, launcher_platform): - """ - Verifies a Layer Blender can be setup in Landscape Canvas and all references are property set. - """ - cfg_args = [level] - - expected_lines = [ - 'Landscape Canvas pane is open', - 'New graph created', - 'Graph registered with Landscape Canvas', - 'Vegetation Layer Blender component Vegetation Areas[0] property set to Vegetation Layer Spawner EntityId', - 'Vegetation Layer Blender component Vegetation Areas[1] property set to Vegetation Layer Blocker EntityId', - 'LayerBlenderNodeConstruction: result=SUCCESS' - ] - - hydra.launch_and_validate_results(request, test_directory, editor, 'LayerBlender_NodeConstruction.py', - expected_lines, cfg_args=cfg_args) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_ShapeNodes.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_ShapeNodes.py deleted file mode 100755 index 8356d5a404..0000000000 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_ShapeNodes.py +++ /dev/null @@ -1,82 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -""" -C13767843 - All Shape nodes can be added to a graph -C17412059 - All Shape nodes can be removed from a graph -""" - -import os -import pytest - -# Bail on the test if ly_test_tools doesn't exist. -pytest.importorskip('ly_test_tools') -import ly_test_tools.environment.file_system as file_system -import editor_python_test_tools.hydra_test_utils as hydra - -test_directory = os.path.join(os.path.dirname(__file__), 'EditorScripts') - - -@pytest.mark.parametrize('project', ['AutomatedTesting']) -@pytest.mark.parametrize('level', ['tmp_level']) -@pytest.mark.usefixtures("automatic_process_killer") -@pytest.mark.parametrize("launcher_platform", ['windows_editor']) -class TestShapeNodes(object): - - @pytest.fixture(autouse=True) - def setup_teardown(self, request, workspace, project, level): - def teardown(): - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - request.addfinalizer(teardown) - - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - - @pytest.mark.test_case_id('C13767843') - @pytest.mark.SUITE_periodic - def test_LandscapeCanvas_ShapeNodes_EntityCreatedOnNodeAdd(self, request, editor, level, launcher_platform): - cfg_args = [level] - - expected_lines = [ - "Landscape Canvas pane is open", - "New graph created", - "Graph registered with Landscape Canvas", - "BoxShapeNode created new Entity with Box Shape Component", - "CapsuleShapeNode created new Entity with Capsule Shape Component", - "CompoundShapeNode created new Entity with Compound Shape Component", - "CylinderShapeNode created new Entity with Cylinder Shape Component", - "PolygonPrismShapeNode created new Entity with Polygon Prism Shape Component", - "SphereShapeNode created new Entity with Sphere Shape Component", - "TubeShapeNode created new Entity with Tube Shape Component", - "DiskShapeNode created new Entity with Disk Shape Component", - "ShapeNodeEntityCreate: result=SUCCESS" - ] - - hydra.launch_and_validate_results(request, test_directory, editor, 'ShapeNodes_EntityCreatedOnNodeAdd.py', - expected_lines, cfg_args=cfg_args) - - @pytest.mark.test_case_id('C17412059') - @pytest.mark.SUITE_periodic - def test_LandscapeCanvas_ShapeNodes_EntityRemovedOnNodeDelete(self, request, editor, level, launcher_platform): - cfg_args = [level] - - expected_lines = [ - "Landscape Canvas pane is open", - "New graph created", - "Graph registered with Landscape Canvas", - "BoxShapeNode corresponding Entity was deleted when node is removed", - "CapsuleShapeNode corresponding Entity was deleted when node is removed", - "CompoundShapeNode corresponding Entity was deleted when node is removed", - "CylinderShapeNode corresponding Entity was deleted when node is removed", - "PolygonPrismShapeNode corresponding Entity was deleted when node is removed", - "SphereShapeNode corresponding Entity was deleted when node is removed", - "TubeShapeNode corresponding Entity was deleted when node is removed", - "DiskShapeNode corresponding Entity was deleted when node is removed", - "ShapeNodeEntityDelete: result=SUCCESS" - ] - - hydra.launch_and_validate_results(request, test_directory, editor, 'ShapeNodes_EntityRemovedOnNodeDelete.py', - expected_lines, cfg_args=cfg_args) diff --git a/AutomatedTesting/Gem/PythonTests/physics/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/physics/CMakeLists.txt index 248bf3fdc5..2557faee43 100644 --- a/AutomatedTesting/Gem/PythonTests/physics/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonTests/physics/CMakeLists.txt @@ -12,6 +12,18 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) TEST_SUITE main TEST_SERIAL PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Main.py + RUNTIME_DEPENDENCIES + Legacy::Editor + AZ::AssetProcessor + AutomatedTesting.Assets + COMPONENT + Physics + ) + ly_add_pytest( + NAME AutomatedTesting::PhysicsTests_Main_Optimized + TEST_SUITE main + TEST_SERIAL + PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Main_Optimized.py TIMEOUT 1500 RUNTIME_DEPENDENCIES Legacy::Editor @@ -25,7 +37,6 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) TEST_SUITE periodic TEST_SERIAL PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Periodic.py - TIMEOUT 1500 RUNTIME_DEPENDENCIES Legacy::Editor AZ::AssetProcessor @@ -38,7 +49,6 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) TEST_SUITE sandbox TEST_SERIAL PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Sandbox.py - TIMEOUT 1500 RUNTIME_DEPENDENCIES Legacy::Editor AZ::AssetProcessor diff --git a/AutomatedTesting/Gem/PythonTests/physics/ImportPathHelper.py b/AutomatedTesting/Gem/PythonTests/physics/ImportPathHelper.py deleted file mode 100755 index 0e395664ad..0000000000 --- a/AutomatedTesting/Gem/PythonTests/physics/ImportPathHelper.py +++ /dev/null @@ -1,11 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -def init(): - import os - import sys - sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../automatedtesting_shared') diff --git a/AutomatedTesting/Gem/PythonTests/physics/TestSuite_InDevelopment.py b/AutomatedTesting/Gem/PythonTests/physics/TestSuite_InDevelopment.py index 2c5cca4f24..dad37297cc 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/TestSuite_InDevelopment.py +++ b/AutomatedTesting/Gem/PythonTests/physics/TestSuite_InDevelopment.py @@ -13,25 +13,25 @@ import pytest import os import sys -from .FileManagement import FileManagement as fm +from .utils.FileManagement import FileManagement as fm sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../automatedtesting_shared') -@pytest.mark.parametrize("spec", ["all"]) +from base import TestAutomationBase + @pytest.mark.parametrize("project", ["AutomatedTesting"]) -@pytest.mark.system class TestAutomation(TestAutomationBase): @fm.file_revert("ragdollbones.physmaterial", r"AutomatedTesting\Levels\Physics\C4925582_Material_AddModifyDeleteOnRagdollBones") def test_C4925582_Material_AddModifyDeleteOnRagdollBones(self, request, workspace, editor): - from . import C4925582_Material_AddModifyDeleteOnRagdollBones as test_module + from .material import C4925582_Material_AddModifyDeleteOnRagdollBones as test_module expected_lines = [] unexpected_lines = ["Assert"] self._run_test(request, workspace, editor, test_module, expected_lines, unexpected_lines) def test_C4925580_Material_RagdollBonesMaterial(self, request, workspace, editor): - from . import C4925580_Material_RagdollBonesMaterial as test_module + from .material import C4925580_Material_RagdollBonesMaterial as test_module expected_lines = [] unexpected_lines = ["Assert"] @@ -40,7 +40,7 @@ class TestAutomation(TestAutomationBase): @fm.file_revert("c15308221_material_componentsinsyncwithlibrary.physmaterial", r"AutomatedTesting\Levels\Physics\C15308221_Material_ComponentsInSyncWithLibrary") def test_C15308221_Material_ComponentsInSyncWithLibrary(self, request, workspace, editor): - from . import C15308221_Material_ComponentsInSyncWithLibrary as test_module + from .material import C15308221_Material_ComponentsInSyncWithLibrary as test_module expected_lines = [] unexpected_lines = ["Assert"] @@ -48,7 +48,7 @@ class TestAutomation(TestAutomationBase): # BUG: LY-107723") def test_C14976308_ScriptCanvas_SetKinematicTargetTransform(self, request, workspace, editor): - from . import C14976308_ScriptCanvas_SetKinematicTargetTransform as test_module + from .script_canvas import C14976308_ScriptCanvas_SetKinematicTargetTransform as test_module expected_lines = [] unexpected_lines = ["Assert"] @@ -58,7 +58,7 @@ class TestAutomation(TestAutomationBase): @fm.file_revert("c4925579_material_addmodifydeleteonterrain.physmaterial", r"AutomatedTesting\Levels\Physics\C4925579_Material_AddModifyDeleteOnTerrain") def test_C4925579_Material_AddModifyDeleteOnTerrain(self, request, workspace, editor): - from . import C4925579_Material_AddModifyDeleteOnTerrain as test_module + from .material import C4925579_Material_AddModifyDeleteOnTerrain as test_module expected_lines = [] unexpected_lines = ["Assert"] @@ -66,7 +66,7 @@ class TestAutomation(TestAutomationBase): # Failing, PhysXTerrain def test_C13508019_Terrain_TerrainTexturePainterWorks(self, request, workspace, editor): - from . import C13508019_Terrain_TerrainTexturePainterWorks as test_module + from .terrain import C13508019_Terrain_TerrainTexturePainterWorks as test_module expected_lines = [] unexpected_lines = ["Assert"] @@ -74,7 +74,7 @@ class TestAutomation(TestAutomationBase): # Failing, PhysXTerrain def test_C4925577_Materials_MaterialAssignedToTerrain(self, request, workspace, editor): - from . import C4925577_Materials_MaterialAssignedToTerrain as test_module + from .material import C4925577_Materials_MaterialAssignedToTerrain as test_module expected_lines = [] unexpected_lines = ["Assert"] @@ -82,7 +82,7 @@ class TestAutomation(TestAutomationBase): # Failing, PhysXTerrain def test_C15096735_Materials_DefaultLibraryConsistency(self, request, workspace, editor): - from . import C15096735_Materials_DefaultLibraryConsistency as test_module + from .material import C15096735_Materials_DefaultLibraryConsistency as test_module expected_lines = [] unexpected_lines = ["Assert"] @@ -92,13 +92,13 @@ class TestAutomation(TestAutomationBase): @fm.file_revert("all_ones_1.physmaterial", r"AutomatedTesting\Levels\Physics\C15096737_Materials_DefaultMaterialLibraryChanges") @fm.file_override("default.physxconfiguration", "C15096737_Materials_DefaultMaterialLibraryChanges.physxconfiguration", "AutomatedTesting") def test_C15096737_Materials_DefaultMaterialLibraryChanges(self, request, workspace, editor): - from . import C15096737_Materials_DefaultMaterialLibraryChanges as test_module + from .material import C15096737_Materials_DefaultMaterialLibraryChanges as test_module expected_lines = [] unexpected_lines = ["Assert"] self._run_test(request, workspace, editor, test_module, expected_lines, unexpected_lines) def test_C4976242_Collision_SameCollisionlayerSameCollisiongroup(self, request, workspace, editor): - from . import C4976242_Collision_SameCollisionlayerSameCollisiongroup as test_module + from .collider import C4976242_Collision_SameCollisionlayerSameCollisiongroup as test_module expected_lines = [] unexpected_lines = ["Assert"] @@ -109,7 +109,7 @@ class TestAutomation(TestAutomationBase): "Material_DefaultLibraryUpdatedAcrossLevels_before.physxconfiguration", "AutomatedTesting", search_subdirs=True) def test_levels_before(self, request, workspace, editor): - from . import C15096732_Material_DefaultLibraryUpdatedAcrossLevels_before as test_module_0 + from .material import C15096732_Material_DefaultLibraryUpdatedAcrossLevels_before as test_module_0 expected_lines = [] unexpected_lines = ["Assert"] self._run_test(request, workspace, editor, test_module_0, expected_lines, unexpected_lines) @@ -119,7 +119,7 @@ class TestAutomation(TestAutomationBase): "Material_DefaultLibraryUpdatedAcrossLevels_after.physxconfiguration", "AutomatedTesting", search_subdirs=True) def test_levels_after(self, request, workspace, editor): - from . import C15096732_Material_DefaultLibraryUpdatedAcrossLevels_after as test_module_1 + from .material import C15096732_Material_DefaultLibraryUpdatedAcrossLevels_after as test_module_1 expected_lines = [] unexpected_lines = ["Assert"] self._run_test(request, workspace, editor, test_module_1, expected_lines, unexpected_lines) @@ -128,7 +128,7 @@ class TestAutomation(TestAutomationBase): test_levels_after(self, request, workspace, editor) def test_C14654882_Ragdoll_ragdollAPTest(self, request, workspace, editor): - from . import C14654882_Ragdoll_ragdollAPTest as test_module + from .ragdoll import C14654882_Ragdoll_ragdollAPTest as test_module expected_lines = [] unexpected_lines = test_module.UnexpectedLines.lines @@ -136,14 +136,14 @@ class TestAutomation(TestAutomationBase): @fm.file_override("default.physxconfiguration", "C12712454_ScriptCanvas_OverlapNodeVerification.physxconfiguration") def test_C12712454_ScriptCanvas_OverlapNodeVerification(self, request, workspace, editor): - from . import C12712454_ScriptCanvas_OverlapNodeVerification as test_module + from .script_canvas import C12712454_ScriptCanvas_OverlapNodeVerification as test_module expected_lines = [] unexpected_lines = ["Assert"] self._run_test(request, workspace, editor, test_module, expected_lines, unexpected_lines) def test_C4044460_Material_StaticFriction(self, request, workspace, editor): - from . import C4044460_Material_StaticFriction as test_module + from .material import C4044460_Material_StaticFriction as test_module expected_lines = [] unexpected_lines = ["Assert"] @@ -154,7 +154,7 @@ class TestAutomation(TestAutomationBase): @fm.file_revert("c4888315_material_addmodifydeleteoncollider.physmaterial", r"AutomatedTesting\Levels\Physics\C4888315_Material_AddModifyDeleteOnCollider") def test_C4888315_Material_AddModifyDeleteOnCollider(self, request, workspace, editor): - from . import C4888315_Material_AddModifyDeleteOnCollider as test_module + from .material import C4888315_Material_AddModifyDeleteOnCollider as test_module expected_lines = [] unexpected_lines = ["Assert"] @@ -164,7 +164,7 @@ class TestAutomation(TestAutomationBase): @fm.file_revert("c15563573_material_addmodifydeleteoncharactercontroller.physmaterial", r"AutomatedTesting\Levels\Physics\C15563573_Material_AddModifyDeleteOnCharacterController") def test_C15563573_Material_AddModifyDeleteOnCharacterController(self, request, workspace, editor): - from . import C15563573_Material_AddModifyDeleteOnCharacterController as test_module + from .material import C15563573_Material_AddModifyDeleteOnCharacterController as test_module expected_lines = [] unexpected_lines = ["Assert"] @@ -173,7 +173,7 @@ class TestAutomation(TestAutomationBase): @fm.file_revert("c4888315_material_addmodifydeleteoncollider.physmaterial", r"AutomatedTesting\Levels\Physics\C4888315_Material_AddModifyDeleteOnCollider") def test_C4888315_Material_AddModifyDeleteOnCollider(self, request, workspace, editor): - from . import C4888315_Material_AddModifyDeleteOnCollider as test_module + from .material import C4888315_Material_AddModifyDeleteOnCollider as test_module expected_lines = [] unexpected_lines = ["Assert"] @@ -185,7 +185,7 @@ class TestAutomation(TestAutomationBase): @fm.file_revert("c15563573_material_addmodifydeleteoncharactercontroller.physmaterial", r"AutomatedTesting\Levels\Physics\C15563573_Material_AddModifyDeleteOnCharacterController") def test_C15563573_Material_AddModifyDeleteOnCharacterController(self, request, workspace, editor): - from . import C15563573_Material_AddModifyDeleteOnCharacterController as test_module + from .material import C15563573_Material_AddModifyDeleteOnCharacterController as test_module expected_lines = [] unexpected_lines = ["Assert"] @@ -194,7 +194,7 @@ class TestAutomation(TestAutomationBase): @fm.file_revert("c4044455_material_librarychangesinstantly.physmaterial", r"AutomatedTesting\Levels\Physics\C4044455_Material_LibraryChangesInstantly") def test_C4044455_Material_libraryChangesInstantly(self, request, workspace, editor): - from . import C4044455_Material_libraryChangesInstantly as test_module + from .material import C4044455_Material_libraryChangesInstantly as test_module expected_lines = [] unexpected_lines = ["Assert"] @@ -204,103 +204,103 @@ class TestAutomation(TestAutomationBase): @fm.file_revert("C15425935_Material_LibraryUpdatedAcrossLevels.physmaterial", r"AutomatedTesting\Levels\Physics\C15425935_Material_LibraryUpdatedAcrossLevels") def test_C15425935_Material_LibraryUpdatedAcrossLevels(self, request, workspace, editor): - from . import C15425935_Material_LibraryUpdatedAcrossLevels as test_module + from .material import C15425935_Material_LibraryUpdatedAcrossLevels as test_module expected_lines = [] unexpected_lines = ["Assert"] self._run_test(request, workspace, editor, test_module, expected_lines, unexpected_lines) def test_C4976199_RigidBodies_LinearDampingObjectMotion(self, request, workspace, editor): - from . import C4976199_RigidBodies_LinearDampingObjectMotion as test_module + from .rigid_body import C4976199_RigidBodies_LinearDampingObjectMotion as test_module expected_lines = [] unexpected_lines = ["Assert"] self._run_test(request, workspace, editor, test_module, expected_lines, unexpected_lines) def test_C5689518_PhysXTerrain_CollidesWithPhysXTerrain(self, request, workspace, editor): - from . import C5689518_PhysXTerrain_CollidesWithPhysXTerrain as test_module + from .terrain import C5689518_PhysXTerrain_CollidesWithPhysXTerrain as test_module expected_lines = [] unexpected_lines = ["Assert"] self._run_test(request, workspace, editor, test_module, expected_lines, unexpected_lines) def test_C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain(self, request, workspace, editor): - from . import C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain as test_module + from .collider import C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain as test_module expected_lines = [] unexpected_lines = ["Assert"] self._run_test(request, workspace, editor, test_module, expected_lines, unexpected_lines) def test_C29032500_EditorComponents_WorldBodyBusWorks(self, request, workspace, editor): - from . import C29032500_EditorComponents_WorldBodyBusWorks as test_module + from .general import C29032500_EditorComponents_WorldBodyBusWorks as test_module expected_lines = [] unexpected_lines = ["Assert"] self._run_test(request, workspace, editor, test_module, expected_lines, unexpected_lines) def test_C14861498_ConfirmError_NoPxMesh(self, request, workspace, editor, launcher_platform): - from . import C14861498_ConfirmError_NoPxMesh as test_module + from .collider import C14861498_ConfirmError_NoPxMesh as test_module expected_lines = [] unexpected_lines = ["Assert"] self._run_test(request, workspace, editor, test_module, expected_lines, unexpected_lines) def test_C5959763_ForceRegion_ForceRegionImpulsesCube(self, request, workspace, editor, launcher_platform): - from . import C5959763_ForceRegion_ForceRegionImpulsesCube as test_module + from .force_region import C5959763_ForceRegion_ForceRegionImpulsesCube as test_module expected_lines = [] unexpected_lines = ["Assert"] self._run_test(request, workspace, editor, test_module, expected_lines, unexpected_lines) def test_C5689531_Warning_TerrainSliceTerrainComponent(self, request, workspace, editor, launcher_platform): - from . import C5689531_Warning_TerrainSliceTerrainComponent as test_module + from .terrain import C5689531_Warning_TerrainSliceTerrainComponent as test_module expected_lines = [] unexpected_lines = ["Assert"] self._run_test(request, workspace, editor, test_module, expected_lines, unexpected_lines) def test_C5689522_Physxterrain_AddPhysxterrainNoEditorCrash(self, request, workspace, editor, launcher_platform): - from . import C5689522_Physxterrain_AddPhysxterrainNoEditorCrash as test_module + from .terrain import C5689522_Physxterrain_AddPhysxterrainNoEditorCrash as test_module expected_lines = [] unexpected_lines = ["Assert"] self._run_test(request, workspace, editor, test_module, expected_lines, unexpected_lines) def test_C5689524_MultipleTerrains_CheckWarningInConsole(self, request, workspace, editor, launcher_platform): - from . import C5689524_MultipleTerrains_CheckWarningInConsole as test_module + from .terrain import C5689524_MultipleTerrains_CheckWarningInConsole as test_module expected_lines = [] unexpected_lines = ["Assert"] self._run_test(request, workspace, editor, test_module, expected_lines, unexpected_lines) def test_C5689528_Terrain_MultipleTerrainComponents(self, request, workspace, editor, launcher_platform): - from . import C5689528_Terrain_MultipleTerrainComponents as test_module + from .terrain import C5689528_Terrain_MultipleTerrainComponents as test_module expected_lines = [] unexpected_lines = ["Assert"] self._run_test(request, workspace, editor, test_module, expected_lines, unexpected_lines) def test_C5689528_Terrain_MultipleTerrainComponents(self, request, workspace, editor, launcher_platform): - from . import C5689528_Terrain_MultipleTerrainComponents as test_module + from .terrain import C5689528_Terrain_MultipleTerrainComponents as test_module expected_lines = [] unexpected_lines = ["Assert"] self._run_test(request, workspace, editor, test_module, expected_lines, unexpected_lines) def test_C6321601_Force_HighValuesDirectionAxes(self, request, workspace, editor, launcher_platform): - from . import C6321601_Force_HighValuesDirectionAxes as test_module + from .force_region import C6321601_Force_HighValuesDirectionAxes as test_module expected_lines = [] unexpected_lines = ["Assert"] self._run_test(request, workspace, editor, test_module, expected_lines, unexpected_lines) def test_C6032082_Terrain_MultipleResolutionsValid(self, request, workspace, editor, launcher_platform): - from . import C6032082_Terrain_MultipleResolutionsValid as test_module + from .terrain import C6032082_Terrain_MultipleResolutionsValid as test_module expected_lines = [] unexpected_lines = ["Assert"] self._run_test(request, workspace, editor, test_module, expected_lines, unexpected_lines) def test_C12905527_ForceRegion_MagnitudeDeviation(self, request, workspace, editor, launcher_platform): - from . import C12905527_ForceRegion_MagnitudeDeviation as test_module + from .force_region import C12905527_ForceRegion_MagnitudeDeviation as test_module expected_lines = [] unexpected_lines = ["Assert"] @@ -308,7 +308,7 @@ class TestAutomation(TestAutomationBase): # Removed from active suite to meet 60 minutes limit in AR job def test_C18243580_Joints_Fixed2BodiesConstrained(self, request, workspace, editor, launcher_platform): - from . import C18243580_Joints_Fixed2BodiesConstrained as test_module + from .joints import C18243580_Joints_Fixed2BodiesConstrained as test_module expected_lines = [] unexpected_lines = ["Assert"] @@ -316,7 +316,7 @@ class TestAutomation(TestAutomationBase): # Removed from active suite to meet 60 minutes limit in AR job def test_C18243583_Joints_Hinge2BodiesConstrained(self, request, workspace, editor, launcher_platform): - from . import C18243583_Joints_Hinge2BodiesConstrained as test_module + from .joints import C18243583_Joints_Hinge2BodiesConstrained as test_module expected_lines = [] unexpected_lines = ["Assert"] @@ -324,7 +324,7 @@ class TestAutomation(TestAutomationBase): # Removed from active suite to meet 60 minutes limit in AR job def test_C18243588_Joints_Ball2BodiesConstrained(self, request, workspace, editor, launcher_platform): - from . import C18243588_Joints_Ball2BodiesConstrained as test_module + from .joints import C18243588_Joints_Ball2BodiesConstrained as test_module expected_lines = [] unexpected_lines = ["Assert"] @@ -332,7 +332,7 @@ class TestAutomation(TestAutomationBase): # Removed from active suite to meet 60 minutes limit in AR job def test_C18243581_Joints_FixedBreakable(self, request, workspace, editor, launcher_platform): - from . import C18243581_Joints_FixedBreakable as test_module + from .joints import C18243581_Joints_FixedBreakable as test_module expected_lines = [] unexpected_lines = ["Assert"] @@ -340,7 +340,7 @@ class TestAutomation(TestAutomationBase): # Removed from active suite to meet 60 minutes limit in AR job def test_C18243587_Joints_HingeBreakable(self, request, workspace, editor, launcher_platform): - from . import C18243587_Joints_HingeBreakable as test_module + from .joints import C18243587_Joints_HingeBreakable as test_module expected_lines = [] unexpected_lines = ["Assert"] @@ -348,7 +348,7 @@ class TestAutomation(TestAutomationBase): # Removed from active suite to meet 60 minutes limit in AR job def test_C18243592_Joints_BallBreakable(self, request, workspace, editor, launcher_platform): - from . import C18243592_Joints_BallBreakable as test_module + from .joints import C18243592_Joints_BallBreakable as test_module expected_lines = [] unexpected_lines = ["Assert"] @@ -356,7 +356,7 @@ class TestAutomation(TestAutomationBase): # Removed from active suite to meet 60 minutes limit in AR job def test_C18243585_Joints_HingeNoLimitsConstrained(self, request, workspace, editor, launcher_platform): - from . import C18243585_Joints_HingeNoLimitsConstrained as test_module + from .joints import C18243585_Joints_HingeNoLimitsConstrained as test_module expected_lines = [] unexpected_lines = ["Assert"] @@ -364,7 +364,7 @@ class TestAutomation(TestAutomationBase): # Removed from active suite to meet 60 minutes limit in AR job def test_C18243590_Joints_BallNoLimitsConstrained(self, request, workspace, editor, launcher_platform): - from . import C18243590_Joints_BallNoLimitsConstrained as test_module + from .joints import C18243590_Joints_BallNoLimitsConstrained as test_module expected_lines = [] unexpected_lines = ["Assert"] @@ -372,7 +372,7 @@ class TestAutomation(TestAutomationBase): # Removed from active suite to meet 60 minutes limit in AR job def test_C18243582_Joints_FixedLeadFollowerCollide(self, request, workspace, editor, launcher_platform): - from . import C18243582_Joints_FixedLeadFollowerCollide as test_module + from .joints import C18243582_Joints_FixedLeadFollowerCollide as test_module expected_lines = [] unexpected_lines = ["Assert"] @@ -380,7 +380,7 @@ class TestAutomation(TestAutomationBase): # Removed from active suite to meet 60 minutes limit in AR job def test_C18243593_Joints_GlobalFrameConstrained(self, request, workspace, editor, launcher_platform): - from . import C18243593_Joints_GlobalFrameConstrained as test_module + from .joints import C18243593_Joints_GlobalFrameConstrained as test_module expected_lines = [] unexpected_lines = ["Assert"] diff --git a/AutomatedTesting/Gem/PythonTests/physics/TestSuite_Main.py b/AutomatedTesting/Gem/PythonTests/physics/TestSuite_Main.py index bda4dae82b..de4828e36a 100644 --- a/AutomatedTesting/Gem/PythonTests/physics/TestSuite_Main.py +++ b/AutomatedTesting/Gem/PythonTests/physics/TestSuite_Main.py @@ -12,7 +12,7 @@ import pytest import os import sys -from .FileManagement import FileManagement as fm +from .utils.FileManagement import FileManagement as fm from ly_test_tools import LAUNCHERS sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../automatedtesting_shared') @@ -29,58 +29,58 @@ revert_physics_config = fm.file_revert_list(['physxdebugconfiguration.setreg', ' class TestAutomation(TestAutomationBase): def test_C111111_RigidBody_EnablingGravityWorksUsingNotificationsPoC(self, request, workspace, editor, launcher_platform): - from . import C111111_RigidBody_EnablingGravityWorksUsingNotificationsPoC as test_module + from .collider import C111111_RigidBody_EnablingGravityWorksUsingNotificationsPoC as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C5932041_PhysXForceRegion_LocalSpaceForceOnRigidBodies(self, request, workspace, editor, launcher_platform): - from . import C5932041_PhysXForceRegion_LocalSpaceForceOnRigidBodies as test_module + from .force_region import C5932041_PhysXForceRegion_LocalSpaceForceOnRigidBodies as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config @fm.file_override('physxsystemconfiguration.setreg','C4044459_Material_DynamicFriction.setreg_override', 'AutomatedTesting/Registry') def test_C4044459_Material_DynamicFriction(self, request, workspace, editor, launcher_platform): - from . import C4044459_Material_DynamicFriction as test_module + from .material import C4044459_Material_DynamicFriction as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C4976243_Collision_SameCollisionGroupDiffCollisionLayers(self, request, workspace, editor, launcher_platform): - from . import C4976243_Collision_SameCollisionGroupDiffCollisionLayers as test_module + from .collider import C4976243_Collision_SameCollisionGroupDiffCollisionLayers as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C14654881_CharacterController_SwitchLevels(self, request, workspace, editor, launcher_platform): - from . import C14654881_CharacterController_SwitchLevels as test_module + from .character_controller import C14654881_CharacterController_SwitchLevels as test_module self._run_test(request, workspace, editor, test_module) def test_C17411467_AddPhysxRagdollComponent(self, request, workspace, editor, launcher_platform): - from . import C17411467_AddPhysxRagdollComponent as test_module + from .ragdoll import C17411467_AddPhysxRagdollComponent as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C12712453_ScriptCanvas_MultipleRaycastNode(self, request, workspace, editor, launcher_platform): - from . import C12712453_ScriptCanvas_MultipleRaycastNode as test_module + from .script_canvas import C12712453_ScriptCanvas_MultipleRaycastNode as test_module # Fixme: unexpected_lines = ["Assert"] + test_module.Lines.unexpected self._run_test(request, workspace, editor, test_module) @revert_physics_config @fm.file_override('physxsystemconfiguration.setreg','C4982593_PhysXCollider_CollisionLayer.setreg_override', 'AutomatedTesting/Registry') def test_C4982593_PhysXCollider_CollisionLayerTest(self, request, workspace, editor, launcher_platform): - from . import C4982593_PhysXCollider_CollisionLayerTest as test_module + from .collider import C4982593_PhysXCollider_CollisionLayerTest as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C18243586_Joints_HingeLeadFollowerCollide(self, request, workspace, editor, launcher_platform): - from . import C18243586_Joints_HingeLeadFollowerCollide as test_module + from .joints import C18243586_Joints_HingeLeadFollowerCollide as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C4982803_Enable_PxMesh_Option(self, request, workspace, editor, launcher_platform): - from . import C4982803_Enable_PxMesh_Option as test_module + from .collider import C4982803_Enable_PxMesh_Option as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain(self, request, workspace, editor, launcher_platform): - from . import C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain as test_module - self._run_test(request, workspace, editor, test_module) \ No newline at end of file + from .collider import C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain as test_module + self._run_test(request, workspace, editor, test_module) diff --git a/AutomatedTesting/Gem/PythonTests/physics/TestSuite_Main_Optimized.py b/AutomatedTesting/Gem/PythonTests/physics/TestSuite_Main_Optimized.py new file mode 100644 index 0000000000..ce68bb10b5 --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/physics/TestSuite_Main_Optimized.py @@ -0,0 +1,348 @@ +""" +Copyright (c) Contributors to the Open 3D Engine Project. +For complete copyright and license terms please see the LICENSE at the root of this distribution. + +SPDX-License-Identifier: Apache-2.0 OR MIT +""" + +import pytest +import os +import sys +import inspect + +from ly_test_tools import LAUNCHERS +from ly_test_tools.o3de.editor_test import EditorSingleTest, EditorSharedTest, EditorParallelTest, EditorTestSuite +from .utils.FileManagement import FileManagement as fm + +# Custom test spec, it provides functionality to override files +class EditorSingleTest_WithFileOverrides(EditorSingleTest): + # Specify here what files to override, [(original, override), ...] + files_to_override = [()] + # Base directory of the files (Default path is {ProjectName}) + base_dir = None + # True will will search sub-directories for the files in base + search_subdirs = False + + @classmethod + def wrap_run(cls, instance, request, workspace, editor, editor_test_results, launcher_platform): + root_path = cls.base_dir + if root_path is not None: + root_path = os.path.join(workspace.paths.engine_root(), root_path) + else: + # Default to project folder + root_path = workspace.paths.project() + + # Try to locate both target and source files + original_file_list, override_file_list = zip(*cls.files_to_override) + try: + file_list = fm._find_files(original_file_list + override_file_list, root_path, cls.search_subdirs) + except RuntimeWarning as w: + assert False, ( + w.message + + " Please check use of search_subdirs; make sure you are using the correct parent directory." + ) + + for f in original_file_list: + fm._restore_file(f, file_list[f]) + fm._backup_file(f, file_list[f]) + + for original, override in cls.files_to_override: + fm._copy_file(override, file_list[override], original, file_list[override]) + + yield # Run Test + for f in original_file_list: + fm._restore_file(f, file_list[f]) + + +@pytest.mark.SUITE_main +@pytest.mark.parametrize("launcher_platform", ['windows_editor']) +@pytest.mark.parametrize("project", ["AutomatedTesting"]) +class TestAutomation(EditorTestSuite): + + @staticmethod + def get_number_parallel_editors(): + return 16 + + ######################################### + # Non-atomic tests: These need to be run in a single editor because they have custom setup and teardown + class C4044459_Material_DynamicFriction(EditorSingleTest_WithFileOverrides): + from .material import C4044459_Material_DynamicFriction as test_module + files_to_override = [ + ('physxsystemconfiguration.setreg', 'C4044459_Material_DynamicFriction.setreg_override') + ] + base_dir = "AutomatedTesting/Registry" + + class C4982593_PhysXCollider_CollisionLayerTest(EditorSingleTest_WithFileOverrides): + from .collider import C4982593_PhysXCollider_CollisionLayerTest as test_module + files_to_override = [ + ('physxsystemconfiguration.setreg', 'C4982593_PhysXCollider_CollisionLayer.setreg_override') + ] + base_dir = "AutomatedTesting/Registry" + ######################################### + + class C111111_RigidBody_EnablingGravityWorksUsingNotificationsPoC(EditorSharedTest): + from .collider import C111111_RigidBody_EnablingGravityWorksUsingNotificationsPoC as test_module + + class C5932041_PhysXForceRegion_LocalSpaceForceOnRigidBodies(EditorSharedTest): + from .force_region import C5932041_PhysXForceRegion_LocalSpaceForceOnRigidBodies as test_module + + class C15425929_Undo_Redo(EditorSharedTest): + from .general import C15425929_Undo_Redo as test_module + + class C4976243_Collision_SameCollisionGroupDiffCollisionLayers(EditorSharedTest): + from .collider import C4976243_Collision_SameCollisionGroupDiffCollisionLayers as test_module + + class C14654881_CharacterController_SwitchLevels(EditorSharedTest): + from .character_controller import C14654881_CharacterController_SwitchLevels as test_module + + class C17411467_AddPhysxRagdollComponent(EditorSharedTest): + from .ragdoll import C17411467_AddPhysxRagdollComponent as test_module + + class C12712453_ScriptCanvas_MultipleRaycastNode(EditorSharedTest): + from .script_canvas import C12712453_ScriptCanvas_MultipleRaycastNode as test_module + + class C18243586_Joints_HingeLeadFollowerCollide(EditorSharedTest): + from .joints import C18243586_Joints_HingeLeadFollowerCollide as test_module + + class C4982803_Enable_PxMesh_Option(EditorSharedTest): + from .collider import C4982803_Enable_PxMesh_Option as test_module + + class C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain(EditorSharedTest): + from .collider import C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain as test_module + + class C3510642_Terrain_NotCollideWithTerrain(EditorSharedTest): + from .terrain import C3510642_Terrain_NotCollideWithTerrain as test_module + + class C4976195_RigidBodies_InitialLinearVelocity(EditorSharedTest): + from .rigid_body import C4976195_RigidBodies_InitialLinearVelocity as test_module + + class C4976206_RigidBodies_GravityEnabledActive(EditorSharedTest): + from .rigid_body import C4976206_RigidBodies_GravityEnabledActive as test_module + + class C4976207_PhysXRigidBodies_KinematicBehavior(EditorSharedTest): + from .rigid_body import C4976207_PhysXRigidBodies_KinematicBehavior as test_module + + class C5932042_PhysXForceRegion_LinearDamping(EditorSharedTest): + from .force_region import C5932042_PhysXForceRegion_LinearDamping as test_module + + class C5932043_ForceRegion_SimpleDragOnRigidBodies(EditorSharedTest): + from .force_region import C5932043_ForceRegion_SimpleDragOnRigidBodies as test_module + + class C5959760_PhysXForceRegion_PointForceExertion(EditorSharedTest): + from .force_region import C5959760_PhysXForceRegion_PointForceExertion as test_module + + class C5959764_ForceRegion_ForceRegionImpulsesCapsule(EditorSharedTest): + from .force_region import C5959764_ForceRegion_ForceRegionImpulsesCapsule as test_module + + class C5340400_RigidBody_ManualMomentOfInertia(EditorSharedTest): + from .rigid_body import C5340400_RigidBody_ManualMomentOfInertia as test_module + + class C4976210_COM_ManualSetting(EditorSharedTest): + from .rigid_body import C4976210_COM_ManualSetting as test_module + + class C4976194_RigidBody_PhysXComponentIsValid(EditorSharedTest): + from .rigid_body import C4976194_RigidBody_PhysXComponentIsValid as test_module + + class C5932045_ForceRegion_Spline(EditorSharedTest): + from .force_region import C5932045_ForceRegion_Spline as test_module + + class C4982797_Collider_ColliderOffset(EditorSharedTest): + from .collider import C4982797_Collider_ColliderOffset as test_module + + class C4976200_RigidBody_AngularDampingObjectRotation(EditorSharedTest): + from .rigid_body import C4976200_RigidBody_AngularDampingObjectRotation as test_module + + class C5689529_Verify_Terrain_RigidBody_Collider_Mesh(EditorSharedTest): + from .general import C5689529_Verify_Terrain_RigidBody_Collider_Mesh as test_module + + class C5959810_ForceRegion_ForceRegionCombinesForces(EditorSharedTest): + from .force_region import C5959810_ForceRegion_ForceRegionCombinesForces as test_module + + class C5959765_ForceRegion_AssetGetsImpulsed(EditorSharedTest): + from .force_region import C5959765_ForceRegion_AssetGetsImpulsed as test_module + + class C6274125_ScriptCanvas_TriggerEvents(EditorSharedTest): + from .script_canvas import C6274125_ScriptCanvas_TriggerEvents as test_module + # needs to be updated to log for unexpected lines + # expected_lines = test_module.LogLines.expected_lines + + class C6090554_ForceRegion_PointForceNegative(EditorSharedTest): + from .force_region import C6090554_ForceRegion_PointForceNegative as test_module + + class C6090550_ForceRegion_WorldSpaceForceNegative(EditorSharedTest): + from .force_region import C6090550_ForceRegion_WorldSpaceForceNegative as test_module + + class C6090552_ForceRegion_LinearDampingNegative(EditorSharedTest): + from .force_region import C6090552_ForceRegion_LinearDampingNegative as test_module + + class C5968760_ForceRegion_CheckNetForceChange(EditorSharedTest): + from .force_region import C5968760_ForceRegion_CheckNetForceChange as test_module + + class C12712452_ScriptCanvas_CollisionEvents(EditorSharedTest): + from .script_canvas import C12712452_ScriptCanvas_CollisionEvents as test_module + + class C12868578_ForceRegion_DirectionHasNoAffectOnMagnitude(EditorSharedTest): + from .force_region import C12868578_ForceRegion_DirectionHasNoAffectOnMagnitude as test_module + + class C4976204_Verify_Start_Asleep_Condition(EditorSharedTest): + from .rigid_body import C4976204_Verify_Start_Asleep_Condition as test_module + + class C6090546_ForceRegion_SliceFileInstantiates(EditorSharedTest): + from .force_region import C6090546_ForceRegion_SliceFileInstantiates as test_module + + class C6090551_ForceRegion_LocalSpaceForceNegative(EditorSharedTest): + from .force_region import C6090551_ForceRegion_LocalSpaceForceNegative as test_module + + class C6090553_ForceRegion_SimpleDragForceOnRigidBodies(EditorSharedTest): + from .force_region import C6090553_ForceRegion_SimpleDragForceOnRigidBodies as test_module + + class C4976209_RigidBody_ComputesCOM(EditorSharedTest): + from .rigid_body import C4976209_RigidBody_ComputesCOM as test_module + + class C4976201_RigidBody_MassIsAssigned(EditorSharedTest): + from .rigid_body import C4976201_RigidBody_MassIsAssigned as test_module + + class C12868580_ForceRegion_SplineModifiedTransform(EditorSharedTest): + from .force_region import C12868580_ForceRegion_SplineModifiedTransform as test_module + + class C12712455_ScriptCanvas_ShapeCastVerification(EditorSharedTest): + from .script_canvas import C12712455_ScriptCanvas_ShapeCastVerification as test_module + + class C4976197_RigidBodies_InitialAngularVelocity(EditorSharedTest): + from .rigid_body import C4976197_RigidBodies_InitialAngularVelocity as test_module + + class C6090555_ForceRegion_SplineFollowOnRigidBodies(EditorSharedTest): + from .force_region import C6090555_ForceRegion_SplineFollowOnRigidBodies as test_module + + class C6131473_StaticSlice_OnDynamicSliceSpawn(EditorSharedTest): + from .general import C6131473_StaticSlice_OnDynamicSliceSpawn as test_module + + class C5959808_ForceRegion_PositionOffset(EditorSharedTest): + from .force_region import C5959808_ForceRegion_PositionOffset as test_module + + @pytest.mark.xfail(reason="Something with the CryRenderer disabling is causing this test to fail now.") + class C13895144_Ragdoll_ChangeLevel(EditorSharedTest): + from .ragdoll import C13895144_Ragdoll_ChangeLevel as test_module + + class C5968759_ForceRegion_ExertsSeveralForcesOnRigidBody(EditorSharedTest): + from .force_region import C5968759_ForceRegion_ExertsSeveralForcesOnRigidBody as test_module + + @pytest.mark.xfail(reason="This test will sometimes fail as the ball will continue to roll before the timeout is reached.") + class C4976202_RigidBody_StopsWhenBelowKineticThreshold(EditorSharedTest): + from .rigid_body import C4976202_RigidBody_StopsWhenBelowKineticThreshold as test_module + + class C13351703_COM_NotIncludeTriggerShapes(EditorSharedTest): + from .rigid_body import C13351703_COM_NotIncludeTriggerShapes as test_module + + class C5296614_PhysXMaterial_ColliderShape(EditorSharedTest): + from .material import C5296614_PhysXMaterial_ColliderShape as test_module + + class C4982595_Collider_TriggerDisablesCollision(EditorSharedTest): + from .collider import C4982595_Collider_TriggerDisablesCollision as test_module + + class C14976307_Gravity_SetGravityWorks(EditorSharedTest): + from .general import C14976307_Gravity_SetGravityWorks as test_module + + class C4044694_Material_EmptyLibraryUsesDefault(EditorSharedTest): + from .material import C4044694_Material_EmptyLibraryUsesDefault as test_module + + class C15845879_ForceRegion_HighLinearDampingForce(EditorSharedTest): + from .force_region import C15845879_ForceRegion_HighLinearDampingForce as test_module + + class C4976218_RigidBodies_InertiaObjectsNotComputed(EditorSharedTest): + from .rigid_body import C4976218_RigidBodies_InertiaObjectsNotComputed as test_module + + class C14902098_ScriptCanvas_PostPhysicsUpdate(EditorSharedTest): + from .script_canvas import C14902098_ScriptCanvas_PostPhysicsUpdate as test_module + # Note: Test needs to be updated to log for unexpected lines + # unexpected_lines = ["Assert"] + test_module.Lines.unexpected + + class C5959761_ForceRegion_PhysAssetExertsPointForce(EditorSharedTest): + from .force_region import C5959761_ForceRegion_PhysAssetExertsPointForce as test_module + + # 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 + @pytest.mark.xfail(reason="Test Sporadically fails with message [ NOT FOUND ] Success: Bar1 : Expected angular velocity") + class C13352089_RigidBodies_MaxAngularVelocity(EditorSharedTest): + from .rigid_body import C13352089_RigidBodies_MaxAngularVelocity as test_module + + class C18243584_Joints_HingeSoftLimitsConstrained(EditorSharedTest): + from .joints import C18243584_Joints_HingeSoftLimitsConstrained as test_module + + class C18243589_Joints_BallSoftLimitsConstrained(EditorSharedTest): + from .joints import C18243589_Joints_BallSoftLimitsConstrained as test_module + + class C18243591_Joints_BallLeadFollowerCollide(EditorSharedTest): + from .joints import C18243591_Joints_BallLeadFollowerCollide as test_module + + class C19578018_ShapeColliderWithNoShapeComponent(EditorSharedTest): + from .collider import C19578018_ShapeColliderWithNoShapeComponent as test_module + + class C14861500_DefaultSetting_ColliderShape(EditorSharedTest): + from .collider import C14861500_DefaultSetting_ColliderShape as test_module + + class C19723164_ShapeCollider_WontCrashEditor(EditorSharedTest): + from .collider import C19723164_ShapeColliders_WontCrashEditor as test_module + + class C4982800_PhysXColliderShape_CanBeSelected(EditorSharedTest): + from .collider import C4982800_PhysXColliderShape_CanBeSelected as test_module + + class C4982801_PhysXColliderShape_CanBeSelected(EditorSharedTest): + from .collider import C4982801_PhysXColliderShape_CanBeSelected as test_module + + class C4982802_PhysXColliderShape_CanBeSelected(EditorSharedTest): + from .collider import C4982802_PhysXColliderShape_CanBeSelected as test_module + + class C12905528_ForceRegion_WithNonTriggerCollider(EditorSharedTest): + from .force_region import C12905528_ForceRegion_WithNonTriggerCollider as test_module + # Fixme: expected_lines = ["[Warning] (PhysX Force Region) - Please ensure collider component marked as trigger exists in entity"] + + class C5932040_ForceRegion_CubeExertsWorldForce(EditorSharedTest): + from .force_region import C5932040_ForceRegion_CubeExertsWorldForce as test_module + + class C5932044_ForceRegion_PointForceOnRigidBody(EditorSharedTest): + from .force_region import C5932044_ForceRegion_PointForceOnRigidBody as test_module + + class C5959759_RigidBody_ForceRegionSpherePointForce(EditorSharedTest): + from .force_region import C5959759_RigidBody_ForceRegionSpherePointForce as test_module + + class C5959809_ForceRegion_RotationalOffset(EditorSharedTest): + from .force_region import C5959809_ForceRegion_RotationalOffset as test_module + + class C15096740_Material_LibraryUpdatedCorrectly(EditorSharedTest): + from .material import C15096740_Material_LibraryUpdatedCorrectly as test_module + + class C4976236_AddPhysxColliderComponent(EditorSharedTest): + from .collider import C4976236_AddPhysxColliderComponent as test_module + + + @pytest.mark.xfail(reason="This will fail due to this issue ATOM-15487.") + class C14861502_PhysXCollider_AssetAutoAssigned(EditorSharedTest): + from .collider import C14861502_PhysXCollider_AssetAutoAssigned as test_module + + class C14861501_PhysXCollider_RenderMeshAutoAssigned(EditorSharedTest): + from .collider import C14861501_PhysXCollider_RenderMeshAutoAssigned as test_module + + class C4044695_PhysXCollider_AddMultipleSurfaceFbx(EditorSharedTest): + from .collider import C4044695_PhysXCollider_AddMultipleSurfaceFbx as test_module + + class C14861504_RenderMeshAsset_WithNoPxAsset(EditorSharedTest): + from .collider import C14861504_RenderMeshAsset_WithNoPxAsset as test_module + + class C100000_RigidBody_EnablingGravityWorksPoC(EditorSharedTest): + from .collider import C100000_RigidBody_EnablingGravityWorksPoC as test_module + + class C4982798_Collider_ColliderRotationOffset(EditorSharedTest): + from .collider import C4982798_Collider_ColliderRotationOffset as test_module + + class C15308217_NoCrash_LevelSwitch(EditorSharedTest): + from .terrain import C15308217_NoCrash_LevelSwitch as test_module + + class C6090547_ForceRegion_ParentChildForceRegions(EditorSharedTest): + from .force_region import C6090547_ForceRegion_ParentChildForceRegions as test_module + + class C19578021_ShapeCollider_CanBeAdded(EditorSharedTest): + from .collider import C19578021_ShapeCollider_CanBeAdded as test_module + + class C15425929_Undo_Redo(EditorSharedTest): + from .general import C15425929_Undo_Redo as test_module diff --git a/AutomatedTesting/Gem/PythonTests/physics/TestSuite_Main_Test.py b/AutomatedTesting/Gem/PythonTests/physics/TestSuite_Main_Test.py deleted file mode 100644 index 6b940f93d1..0000000000 --- a/AutomatedTesting/Gem/PythonTests/physics/TestSuite_Main_Test.py +++ /dev/null @@ -1,105 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -import pytest -import os -import sys -import inspect - -from ly_test_tools import LAUNCHERS -from ly_test_tools.o3de.editor_test import EditorSingleTest, EditorSharedTest, EditorParallelTest, EditorTestSuite -from .FileManagement import FileManagement as fm - -# Custom test spec, it provides functionality to override files -class EditorSingleTest_WithFileOverrides(EditorSingleTest): - # Specify here what files to override, [(original, override), ...] - files_to_override = [()] - # Base directory of the files (Default path is {ProjectName}) - base_dir = None - # True will will search sub-directories for the files in base - search_subdirs = False - - @classmethod - def wrap_run(cls, instance, request, workspace, editor, editor_test_results, launcher_platform): - root_path = cls.base_dir - if root_path is not None: - root_path = os.path.join(workspace.paths.engine_root(), root_path) - else: - # Default to project folder - root_path = workspace.paths.project() - - # Try to locate both target and source files - original_file_list, override_file_list = zip(*cls.files_to_override) - try: - file_list = fm._find_files(original_file_list + override_file_list, root_path, cls.search_subdirs) - except RuntimeWarning as w: - assert False, ( - w.message - + " Please check use of search_subdirs; make sure you are using the correct parent directory." - ) - - for f in original_file_list: - fm._restore_file(f, file_list[f]) - fm._backup_file(f, file_list[f]) - - for original, override in cls.files_to_override: - fm._copy_file(override, file_list[override], original, file_list[override]) - - yield # Run Test - for f in original_file_list: - fm._restore_file(f, file_list[f]) - - -@pytest.mark.SUITE_main -@pytest.mark.parametrize("launcher_platform", ['windows_editor']) -@pytest.mark.parametrize("project", ["AutomatedTesting"]) -class TestAutomation(EditorTestSuite): - - class C4044459_Material_DynamicFriction(EditorSingleTest_WithFileOverrides): - from . import C4044459_Material_DynamicFriction as test_module - files_to_override = [ - ('physxsystemconfiguration.setreg', 'C4044459_Material_DynamicFriction.setreg_override') - ] - base_dir = "AutomatedTesting/Registry" - - class C4982593_PhysXCollider_CollisionLayerTest(EditorSingleTest_WithFileOverrides): - from . import C4982593_PhysXCollider_CollisionLayerTest as test_module - files_to_override = [ - ('physxsystemconfiguration.setreg', 'C4982593_PhysXCollider_CollisionLayer.setreg_override') - ] - base_dir = "AutomatedTesting/Registry" - - class C111111_RigidBody_EnablingGravityWorksUsingNotificationsPoC(EditorSharedTest): - from . import C111111_RigidBody_EnablingGravityWorksUsingNotificationsPoC as test_module - - class C5932041_PhysXForceRegion_LocalSpaceForceOnRigidBodies(EditorSharedTest): - from . import C5932041_PhysXForceRegion_LocalSpaceForceOnRigidBodies as test_module - - class C15425929_Undo_Redo(EditorSharedTest): - from . import C15425929_Undo_Redo as test_module - - class C4976243_Collision_SameCollisionGroupDiffCollisionLayers(EditorSharedTest): - from . import C4976243_Collision_SameCollisionGroupDiffCollisionLayers as test_module - - class C14654881_CharacterController_SwitchLevels(EditorSharedTest): - from . import C14654881_CharacterController_SwitchLevels as test_module - - class C17411467_AddPhysxRagdollComponent(EditorSharedTest): - from . import C17411467_AddPhysxRagdollComponent as test_module - - class C12712453_ScriptCanvas_MultipleRaycastNode(EditorSharedTest): - from . import C12712453_ScriptCanvas_MultipleRaycastNode as test_module - - class C18243586_Joints_HingeLeadFollowerCollide(EditorSharedTest): - from . import C18243586_Joints_HingeLeadFollowerCollide as test_module - - class C4982803_Enable_PxMesh_Option(EditorSharedTest): - from . import C4982803_Enable_PxMesh_Option as test_module - - class C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain(EditorSharedTest): - from . import C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain as test_module - diff --git a/AutomatedTesting/Gem/PythonTests/physics/TestSuite_Periodic.py b/AutomatedTesting/Gem/PythonTests/physics/TestSuite_Periodic.py index 3d86db1014..fca7e0e3af 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/TestSuite_Periodic.py +++ b/AutomatedTesting/Gem/PythonTests/physics/TestSuite_Periodic.py @@ -12,7 +12,7 @@ import pytest import os import sys -from .FileManagement import FileManagement as fm +from .utils.FileManagement import FileManagement as fm from ly_test_tools import LAUNCHERS sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../automatedtesting_shared') @@ -30,219 +30,219 @@ class TestAutomation(TestAutomationBase): @revert_physics_config def test_C3510642_Terrain_NotCollideWithTerrain(self, request, workspace, editor, launcher_platform): - from . import C3510642_Terrain_NotCollideWithTerrain as test_module + from .terrain import C3510642_Terrain_NotCollideWithTerrain as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C4976195_RigidBodies_InitialLinearVelocity(self, request, workspace, editor, launcher_platform): - from . import C4976195_RigidBodies_InitialLinearVelocity as test_module + from .rigid_body import C4976195_RigidBodies_InitialLinearVelocity as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C4976206_RigidBodies_GravityEnabledActive(self, request, workspace, editor, launcher_platform): - from . import C4976206_RigidBodies_GravityEnabledActive as test_module + from .rigid_body import C4976206_RigidBodies_GravityEnabledActive as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C4976207_PhysXRigidBodies_KinematicBehavior(self, request, workspace, editor, launcher_platform): - from . import C4976207_PhysXRigidBodies_KinematicBehavior as test_module + from .rigid_body import C4976207_PhysXRigidBodies_KinematicBehavior as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C5932042_PhysXForceRegion_LinearDamping(self, request, workspace, editor, launcher_platform): - from . import C5932042_PhysXForceRegion_LinearDamping as test_module + from .force_region import C5932042_PhysXForceRegion_LinearDamping as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C5932043_ForceRegion_SimpleDragOnRigidBodies(self, request, workspace, editor, launcher_platform): - from . import C5932043_ForceRegion_SimpleDragOnRigidBodies as test_module + from .force_region import C5932043_ForceRegion_SimpleDragOnRigidBodies as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C5959760_PhysXForceRegion_PointForceExertion(self, request, workspace, editor, launcher_platform): - from . import C5959760_PhysXForceRegion_PointForceExertion as test_module + from .force_region import C5959760_PhysXForceRegion_PointForceExertion as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C5959764_ForceRegion_ForceRegionImpulsesCapsule(self, request, workspace, editor, launcher_platform): - from . import C5959764_ForceRegion_ForceRegionImpulsesCapsule as test_module + from .force_region import C5959764_ForceRegion_ForceRegionImpulsesCapsule as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C5340400_RigidBody_ManualMomentOfInertia(self, request, workspace, editor, launcher_platform): - from . import C5340400_RigidBody_ManualMomentOfInertia as test_module + from .rigid_body import C5340400_RigidBody_ManualMomentOfInertia as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C4976210_COM_ManualSetting(self, request, workspace, editor, launcher_platform): - from . import C4976210_COM_ManualSetting as test_module + from .rigid_body import C4976210_COM_ManualSetting as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C4976194_RigidBody_PhysXComponentIsValid(self, request, workspace, editor, launcher_platform): - from . import C4976194_RigidBody_PhysXComponentIsValid as test_module + from .rigid_body import C4976194_RigidBody_PhysXComponentIsValid as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C5932045_ForceRegion_Spline(self, request, workspace, editor, launcher_platform): - from . import C5932045_ForceRegion_Spline as test_module + from .force_region import C5932045_ForceRegion_Spline as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config @fm.file_override('physxsystemconfiguration.setreg','C4044457_Material_RestitutionCombine.setreg_override', 'AutomatedTesting/Registry') def test_C4044457_Material_RestitutionCombine(self, request, workspace, editor, launcher_platform): - from . import C4044457_Material_RestitutionCombine as test_module + from .material import C4044457_Material_RestitutionCombine as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config @fm.file_override('physxsystemconfiguration.setreg','C4044456_Material_FrictionCombine.setreg_override', 'AutomatedTesting/Registry') def test_C4044456_Material_FrictionCombine(self, request, workspace, editor, launcher_platform): - from . import C4044456_Material_FrictionCombine as test_module + from .material import C4044456_Material_FrictionCombine as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C4982797_Collider_ColliderOffset(self, request, workspace, editor, launcher_platform): - from . import C4982797_Collider_ColliderOffset as test_module + from .collider import C4982797_Collider_ColliderOffset as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C4976200_RigidBody_AngularDampingObjectRotation(self, request, workspace, editor, launcher_platform): - from . import C4976200_RigidBody_AngularDampingObjectRotation as test_module + from .rigid_body import C4976200_RigidBody_AngularDampingObjectRotation as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C5689529_Verify_Terrain_RigidBody_Collider_Mesh(self, request, workspace, editor, launcher_platform): - from . import C5689529_Verify_Terrain_RigidBody_Collider_Mesh as test_module + from .general import C5689529_Verify_Terrain_RigidBody_Collider_Mesh as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C5959810_ForceRegion_ForceRegionCombinesForces(self, request, workspace, editor, launcher_platform): - from . import C5959810_ForceRegion_ForceRegionCombinesForces as test_module + from .force_region import C5959810_ForceRegion_ForceRegionCombinesForces as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C5959765_ForceRegion_AssetGetsImpulsed(self, request, workspace, editor, launcher_platform): - from . import C5959765_ForceRegion_AssetGetsImpulsed as test_module + from .force_region import C5959765_ForceRegion_AssetGetsImpulsed as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C6274125_ScriptCanvas_TriggerEvents(self, request, workspace, editor, launcher_platform): - from . import C6274125_ScriptCanvas_TriggerEvents as test_module + from .script_canvas import C6274125_ScriptCanvas_TriggerEvents as test_module # FIXME: expected_lines = test_module.LogLines.expected_lines self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C6090554_ForceRegion_PointForceNegative(self, request, workspace, editor, launcher_platform): - from . import C6090554_ForceRegion_PointForceNegative as test_module + from .force_region import C6090554_ForceRegion_PointForceNegative as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C6090550_ForceRegion_WorldSpaceForceNegative(self, request, workspace, editor, launcher_platform): - from . import C6090550_ForceRegion_WorldSpaceForceNegative as test_module + from .force_region import C6090550_ForceRegion_WorldSpaceForceNegative as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C6090552_ForceRegion_LinearDampingNegative(self, request, workspace, editor, launcher_platform): - from . import C6090552_ForceRegion_LinearDampingNegative as test_module + from .force_region import C6090552_ForceRegion_LinearDampingNegative as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C5968760_ForceRegion_CheckNetForceChange(self, request, workspace, editor, launcher_platform): - from . import C5968760_ForceRegion_CheckNetForceChange as test_module + from .force_region import C5968760_ForceRegion_CheckNetForceChange as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C12712452_ScriptCanvas_CollisionEvents(self, request, workspace, editor, launcher_platform): - from . import C12712452_ScriptCanvas_CollisionEvents as test_module + from .script_canvas import C12712452_ScriptCanvas_CollisionEvents as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C12868578_ForceRegion_DirectionHasNoAffectOnMagnitude(self, request, workspace, editor, launcher_platform): - from . import C12868578_ForceRegion_DirectionHasNoAffectOnMagnitude as test_module + from .force_region import C12868578_ForceRegion_DirectionHasNoAffectOnMagnitude as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C4976204_Verify_Start_Asleep_Condition(self, request, workspace, editor, launcher_platform): - from . import C4976204_Verify_Start_Asleep_Condition as test_module + from .rigid_body import C4976204_Verify_Start_Asleep_Condition as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C6090546_ForceRegion_SliceFileInstantiates(self, request, workspace, editor, launcher_platform): - from . import C6090546_ForceRegion_SliceFileInstantiates as test_module + from .force_region import C6090546_ForceRegion_SliceFileInstantiates as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C6090551_ForceRegion_LocalSpaceForceNegative(self, request, workspace, editor, launcher_platform): - from . import C6090551_ForceRegion_LocalSpaceForceNegative as test_module + from .force_region import C6090551_ForceRegion_LocalSpaceForceNegative as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C6090553_ForceRegion_SimpleDragForceOnRigidBodies(self, request, workspace, editor, launcher_platform): - from . import C6090553_ForceRegion_SimpleDragForceOnRigidBodies as test_module + from .force_region import C6090553_ForceRegion_SimpleDragForceOnRigidBodies as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C4976209_RigidBody_ComputesCOM(self, request, workspace, editor, launcher_platform): - from . import C4976209_RigidBody_ComputesCOM as test_module + from .rigid_body import C4976209_RigidBody_ComputesCOM as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C4976201_RigidBody_MassIsAssigned(self, request, workspace, editor, launcher_platform): - from . import C4976201_RigidBody_MassIsAssigned as test_module + from .rigid_body import C4976201_RigidBody_MassIsAssigned as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config @fm.file_override('physxsystemconfiguration.setreg','C18981526_Material_RestitutionCombinePriority.setreg_override', 'AutomatedTesting/Registry') def test_C18981526_Material_RestitutionCombinePriority(self, request, workspace, editor, launcher_platform): - from . import C18981526_Material_RestitutionCombinePriority as test_module + from .material import C18981526_Material_RestitutionCombinePriority as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C12868580_ForceRegion_SplineModifiedTransform(self, request, workspace, editor, launcher_platform): - from . import C12868580_ForceRegion_SplineModifiedTransform as test_module + from .force_region import C12868580_ForceRegion_SplineModifiedTransform as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C12712455_ScriptCanvas_ShapeCastVerification(self, request, workspace, editor, launcher_platform): - from . import C12712455_ScriptCanvas_ShapeCastVerification as test_module + from .script_canvas import C12712455_ScriptCanvas_ShapeCastVerification as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C4976197_RigidBodies_InitialAngularVelocity(self, request, workspace, editor, launcher_platform): - from . import C4976197_RigidBodies_InitialAngularVelocity as test_module + from .rigid_body import C4976197_RigidBodies_InitialAngularVelocity as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C6090555_ForceRegion_SplineFollowOnRigidBodies(self, request, workspace, editor, launcher_platform): - from . import C6090555_ForceRegion_SplineFollowOnRigidBodies as test_module + from .force_region import C6090555_ForceRegion_SplineFollowOnRigidBodies as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C6131473_StaticSlice_OnDynamicSliceSpawn(self, request, workspace, editor, launcher_platform): - from . import C6131473_StaticSlice_OnDynamicSliceSpawn as test_module + from .general import C6131473_StaticSlice_OnDynamicSliceSpawn as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C5959808_ForceRegion_PositionOffset(self, request, workspace, editor, launcher_platform): - from . import C5959808_ForceRegion_PositionOffset as test_module + from .force_region import C5959808_ForceRegion_PositionOffset as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config @fm.file_override('physxsystemconfiguration.setreg','C18977601_Material_FrictionCombinePriority.setreg_override', 'AutomatedTesting/Registry') def test_C18977601_Material_FrictionCombinePriority(self, request, workspace, editor, launcher_platform): - from . import C18977601_Material_FrictionCombinePriority as test_module + from .material import C18977601_Material_FrictionCombinePriority as test_module self._run_test(request, workspace, editor, test_module) @pytest.mark.xfail( reason="Something with the CryRenderer disabling is causing this test to fail now.") @revert_physics_config def test_C13895144_Ragdoll_ChangeLevel(self, request, workspace, editor, launcher_platform): - from . import C13895144_Ragdoll_ChangeLevel as test_module + from .ragdoll import C13895144_Ragdoll_ChangeLevel as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C5968759_ForceRegion_ExertsSeveralForcesOnRigidBody(self, request, workspace, editor, launcher_platform): - from . import C5968759_ForceRegion_ExertsSeveralForcesOnRigidBody as test_module + from .force_region import C5968759_ForceRegion_ExertsSeveralForcesOnRigidBody as test_module self._run_test(request, workspace, editor, test_module) # Marking the test as an expected failure due to sporadic failure on Automated Review: LYN-2580 @@ -252,96 +252,96 @@ class TestAutomation(TestAutomationBase): @revert_physics_config @fm.file_override('physxsystemconfiguration.setreg','C4044697_Material_PerfaceMaterialValidation.setreg_override', 'AutomatedTesting/Registry') def test_C4044697_Material_PerfaceMaterialValidation(self, request, workspace, editor, launcher_platform): - from . import C4044697_Material_PerfaceMaterialValidation as test_module + from .material import C4044697_Material_PerfaceMaterialValidation as test_module self._run_test(request, workspace, editor, test_module) @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_C4976202_RigidBody_StopsWhenBelowKineticThreshold(self, request, workspace, editor, launcher_platform): - from . import C4976202_RigidBody_StopsWhenBelowKineticThreshold as test_module + from .rigid_body import C4976202_RigidBody_StopsWhenBelowKineticThreshold as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C13351703_COM_NotIncludeTriggerShapes(self, request, workspace, editor, launcher_platform): - from . import C13351703_COM_NotIncludeTriggerShapes as test_module + from .rigid_body import C13351703_COM_NotIncludeTriggerShapes as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C5296614_PhysXMaterial_ColliderShape(self, request, workspace, editor, launcher_platform): - from . import C5296614_PhysXMaterial_ColliderShape as test_module + from .material import C5296614_PhysXMaterial_ColliderShape as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C4982595_Collider_TriggerDisablesCollision(self, request, workspace, editor, launcher_platform): - from . import C4982595_Collider_TriggerDisablesCollision as test_module + from .collider import C4982595_Collider_TriggerDisablesCollision as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C14976307_Gravity_SetGravityWorks(self, request, workspace, editor, launcher_platform): - from . import C14976307_Gravity_SetGravityWorks as test_module + from .general import C14976307_Gravity_SetGravityWorks as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config @fm.file_override('physxsystemconfiguration.setreg','C15556261_PhysXMaterials_CharacterControllerMaterialAssignment.setreg_override', 'AutomatedTesting/Registry') def test_C15556261_PhysXMaterials_CharacterControllerMaterialAssignment(self, request, workspace, editor, launcher_platform): - from . import C15556261_PhysXMaterials_CharacterControllerMaterialAssignment as test_module + from .material import C15556261_PhysXMaterials_CharacterControllerMaterialAssignment as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C4044694_Material_EmptyLibraryUsesDefault(self, request, workspace, editor, launcher_platform): - from . import C4044694_Material_EmptyLibraryUsesDefault as test_module + from .material import C4044694_Material_EmptyLibraryUsesDefault as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C15845879_ForceRegion_HighLinearDampingForce(self, request, workspace, editor, launcher_platform): - from . import C15845879_ForceRegion_HighLinearDampingForce as test_module + from .force_region import C15845879_ForceRegion_HighLinearDampingForce as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C4976218_RigidBodies_InertiaObjectsNotComputed(self, request, workspace, editor, launcher_platform): - from . import C4976218_RigidBodies_InertiaObjectsNotComputed as test_module + from .rigid_body import C4976218_RigidBodies_InertiaObjectsNotComputed as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C14902098_ScriptCanvas_PostPhysicsUpdate(self, request, workspace, editor, launcher_platform): - from . import C14902098_ScriptCanvas_PostPhysicsUpdate as test_module + from .script_canvas import C14902098_ScriptCanvas_PostPhysicsUpdate as test_module # Fixme: unexpected_lines = ["Assert"] + test_module.Lines.unexpected self._run_test(request, workspace, editor, test_module) @revert_physics_config @fm.file_override('physxsystemconfiguration.setreg','C4976245_PhysXCollider_CollisionLayerTest.setreg_override', 'AutomatedTesting/Registry') def test_C4976245_PhysXCollider_CollisionLayerTest(self, request, workspace, editor, launcher_platform): - from . import C4976245_PhysXCollider_CollisionLayerTest as test_module + from .collider import C4976245_PhysXCollider_CollisionLayerTest as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config @fm.file_override('physxsystemconfiguration.setreg','C4976244_Collider_SameGroupSameLayerCollision.setreg_override', 'AutomatedTesting/Registry') def test_C4976244_Collider_SameGroupSameLayerCollision(self, request, workspace, editor, launcher_platform): - from . import C4976244_Collider_SameGroupSameLayerCollision as test_module + from .collider import C4976244_Collider_SameGroupSameLayerCollision as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config @fm.file_override('physxdefaultsceneconfiguration.setreg','C14195074_ScriptCanvas_PostUpdateEvent.setreg_override', 'AutomatedTesting/Registry') def test_C14195074_ScriptCanvas_PostUpdateEvent(self, request, workspace, editor, launcher_platform): - from . import C14195074_ScriptCanvas_PostUpdateEvent as test_module + from .script_canvas import C14195074_ScriptCanvas_PostUpdateEvent as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config @fm.file_override('physxsystemconfiguration.setreg','C4044461_Material_Restitution.setreg_override', 'AutomatedTesting/Registry') def test_C4044461_Material_Restitution(self, request, workspace, editor, launcher_platform): - from . import C4044461_Material_Restitution as test_module + from .material import C4044461_Material_Restitution as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config @fm.file_override('physxdefaultsceneconfiguration.setreg','C14902097_ScriptCanvas_PreUpdateEvent.setreg_override', 'AutomatedTesting/Registry') def test_C14902097_ScriptCanvas_PreUpdateEvent(self, request, workspace, editor, launcher_platform): - from . import C14902097_ScriptCanvas_PreUpdateEvent as test_module + from .script_canvas import C14902097_ScriptCanvas_PreUpdateEvent as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C5959761_ForceRegion_PhysAssetExertsPointForce(self, request, workspace, editor, launcher_platform): - from . import C5959761_ForceRegion_PhysAssetExertsPointForce as test_module + from .force_region import C5959761_ForceRegion_PhysAssetExertsPointForce as test_module self._run_test(request, workspace, editor, test_module) # Marking the Test as expected to fail using the xfail decorator due to sporadic failure on Automated Review: SPEC-3146 @@ -349,138 +349,138 @@ class TestAutomation(TestAutomationBase): @pytest.mark.xfail(reason="Test Sporadically fails with message [ NOT FOUND ] Success: Bar1 : Expected angular velocity") @revert_physics_config def test_C13352089_RigidBodies_MaxAngularVelocity(self, request, workspace, editor, launcher_platform): - from . import C13352089_RigidBodies_MaxAngularVelocity as test_module + from .rigid_body import C13352089_RigidBodies_MaxAngularVelocity as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C18243584_Joints_HingeSoftLimitsConstrained(self, request, workspace, editor, launcher_platform): - from . import C18243584_Joints_HingeSoftLimitsConstrained as test_module + from .joints import C18243584_Joints_HingeSoftLimitsConstrained as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C18243589_Joints_BallSoftLimitsConstrained(self, request, workspace, editor, launcher_platform): - from . import C18243589_Joints_BallSoftLimitsConstrained as test_module + from .joints import C18243589_Joints_BallSoftLimitsConstrained as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C18243591_Joints_BallLeadFollowerCollide(self, request, workspace, editor, launcher_platform): - from . import C18243591_Joints_BallLeadFollowerCollide as test_module + from .joints import C18243591_Joints_BallLeadFollowerCollide as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config @fm.file_override('physxsystemconfiguration.setreg','C4976227_Collider_NewGroup.setreg_override', 'AutomatedTesting/Registry') def test_C4976227_Collider_NewGroup(self, request, workspace, editor, launcher_platform): - from . import C4976227_Collider_NewGroup as test_module + from .collider import C4976227_Collider_NewGroup as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C19578018_ShapeColliderWithNoShapeComponent(self, request, workspace, editor, launcher_platform): - from . import C19578018_ShapeColliderWithNoShapeComponent as test_module + from .collider import C19578018_ShapeColliderWithNoShapeComponent as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C14861500_DefaultSetting_ColliderShape(self, request, workspace, editor, launcher_platform): - from . import C14861500_DefaultSetting_ColliderShape as test_module + from .collider import C14861500_DefaultSetting_ColliderShape as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C19723164_ShapeCollider_WontCrashEditor(self, request, workspace, editor, launcher_platform): - from . import C19723164_ShapeColliders_WontCrashEditor as test_module + from .collider import C19723164_ShapeColliders_WontCrashEditor as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C4982800_PhysXColliderShape_CanBeSelected(self, request, workspace, editor, launcher_platform): - from . import C4982800_PhysXColliderShape_CanBeSelected as test_module + from .collider import C4982800_PhysXColliderShape_CanBeSelected as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C4982801_PhysXColliderShape_CanBeSelected(self, request, workspace, editor, launcher_platform): - from . import C4982801_PhysXColliderShape_CanBeSelected as test_module + from .collider import C4982801_PhysXColliderShape_CanBeSelected as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C4982802_PhysXColliderShape_CanBeSelected(self, request, workspace, editor, launcher_platform): - from . import C4982802_PhysXColliderShape_CanBeSelected as test_module + from .collider import C4982802_PhysXColliderShape_CanBeSelected as test_module self._run_test(request, workspace, editor, test_module) def test_C12905528_ForceRegion_WithNonTriggerCollider(self, request, workspace, editor, launcher_platform): - from . import C12905528_ForceRegion_WithNonTriggerCollider as test_module + from .force_region import C12905528_ForceRegion_WithNonTriggerCollider 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) def test_C5932040_ForceRegion_CubeExertsWorldForce(self, request, workspace, editor, launcher_platform): - from . import C5932040_ForceRegion_CubeExertsWorldForce as test_module + from .force_region import C5932040_ForceRegion_CubeExertsWorldForce as test_module self._run_test(request, workspace, editor, test_module) def test_C5932044_ForceRegion_PointForceOnRigidBody(self, request, workspace, editor, launcher_platform): - from . import C5932044_ForceRegion_PointForceOnRigidBody as test_module + from .force_region import C5932044_ForceRegion_PointForceOnRigidBody as test_module self._run_test(request, workspace, editor, test_module) def test_C5959759_RigidBody_ForceRegionSpherePointForce(self, request, workspace, editor, launcher_platform): - from . import C5959759_RigidBody_ForceRegionSpherePointForce as test_module + from .force_region import C5959759_RigidBody_ForceRegionSpherePointForce as test_module self._run_test(request, workspace, editor, test_module) def test_C5959809_ForceRegion_RotationalOffset(self, request, workspace, editor, launcher_platform): - from . import C5959809_ForceRegion_RotationalOffset as test_module + from .force_region import C5959809_ForceRegion_RotationalOffset as test_module self._run_test(request, workspace, editor, test_module) def test_C15096740_Material_LibraryUpdatedCorrectly(self, request, workspace, editor, launcher_platform): - from . import C15096740_Material_LibraryUpdatedCorrectly as test_module + from .material import C15096740_Material_LibraryUpdatedCorrectly as test_module self._run_test(request, workspace, editor, test_module) def test_C4976236_AddPhysxColliderComponent(self, request, workspace, editor, launcher_platform): - from . import C4976236_AddPhysxColliderComponent as test_module + from .collider import C4976236_AddPhysxColliderComponent as test_module self._run_test(request, workspace, editor, test_module) @pytest.mark.xfail( reason="This will fail due to this issue ATOM-15487.") def test_C14861502_PhysXCollider_AssetAutoAssigned(self, request, workspace, editor, launcher_platform): - from . import C14861502_PhysXCollider_AssetAutoAssigned as test_module + from .collider import C14861502_PhysXCollider_AssetAutoAssigned as test_module self._run_test(request, workspace, editor, test_module) def test_C14861501_PhysXCollider_RenderMeshAutoAssigned(self, request, workspace, editor, launcher_platform): - from . import C14861501_PhysXCollider_RenderMeshAutoAssigned as test_module + from .collider import C14861501_PhysXCollider_RenderMeshAutoAssigned as test_module self._run_test(request, workspace, editor, test_module) def test_C4044695_PhysXCollider_AddMultipleSurfaceFbx(self, request, workspace, editor, launcher_platform): - from . import C4044695_PhysXCollider_AddMultipleSurfaceFbx as test_module + from .collider import C4044695_PhysXCollider_AddMultipleSurfaceFbx as test_module self._run_test(request, workspace, editor, test_module) def test_C14861504_RenderMeshAsset_WithNoPxAsset(self, request, workspace, editor, launcher_platform): - from . import C14861504_RenderMeshAsset_WithNoPxAsset as test_module + from .collider import C14861504_RenderMeshAsset_WithNoPxAsset as test_module self._run_test(request, workspace, editor, test_module) def test_C100000_RigidBody_EnablingGravityWorksPoC(self, request, workspace, editor, launcher_platform): - from . import C100000_RigidBody_EnablingGravityWorksPoC as test_module + from .collider import C100000_RigidBody_EnablingGravityWorksPoC as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config @fm.file_override('physxsystemconfiguration.setreg','C3510644_Collider_CollisionGroups.setreg_override', 'AutomatedTesting/Registry') def test_C3510644_Collider_CollisionGroups(self, request, workspace, editor, launcher_platform): - from . import C3510644_Collider_CollisionGroups as test_module + from .collider import C3510644_Collider_CollisionGroups as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C4982798_Collider_ColliderRotationOffset(self, request, workspace, editor, launcher_platform): - from . import C4982798_Collider_ColliderRotationOffset as test_module + from .collider import C4982798_Collider_ColliderRotationOffset as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C15308217_NoCrash_LevelSwitch(self, request, workspace, editor, launcher_platform): - from . import C15308217_NoCrash_LevelSwitch as test_module + from .terrain import C15308217_NoCrash_LevelSwitch as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C6090547_ForceRegion_ParentChildForceRegions(self, request, workspace, editor, launcher_platform): - from . import C6090547_ForceRegion_ParentChildForceRegions as test_module + from .force_region import C6090547_ForceRegion_ParentChildForceRegions as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C19578021_ShapeCollider_CanBeAdded(self, request, workspace, editor, launcher_platform): - from . import C19578021_ShapeCollider_CanBeAdded as test_module + from .collider import C19578021_ShapeCollider_CanBeAdded as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config def test_C15425929_Undo_Redo(self, request, workspace, editor, launcher_platform): - from . import C15425929_Undo_Redo as test_module + from .general import C15425929_Undo_Redo as test_module self._run_test(request, workspace, editor, test_module) diff --git a/AutomatedTesting/Gem/PythonTests/physics/TestSuite_Sandbox.py b/AutomatedTesting/Gem/PythonTests/physics/TestSuite_Sandbox.py index 255016ddd6..0346df2ebd 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/TestSuite_Sandbox.py +++ b/AutomatedTesting/Gem/PythonTests/physics/TestSuite_Sandbox.py @@ -12,7 +12,7 @@ import pytest import os import sys -from .FileManagement import FileManagement as fm +from .utils.FileManagement import FileManagement as fm from ly_test_tools import LAUNCHERS sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../automatedtesting_shared') @@ -30,13 +30,13 @@ class TestAutomation(TestAutomationBase): ## Seems to be flaky, need to investigate def test_C19536274_GetCollisionName_PrintsName(self, request, workspace, editor, launcher_platform): - from . import C19536274_GetCollisionName_PrintsName as test_module + from .general import C19536274_GetCollisionName_PrintsName as test_module # Fixme: expected_lines=["Layer Name: Right"] self._run_test(request, workspace, editor, test_module) ## Seems to be flaky, need to investigate def test_C19536277_GetCollisionName_PrintsNothing(self, request, workspace, editor, launcher_platform): - from . import C19536277_GetCollisionName_PrintsNothing as test_module + from .general import C19536277_GetCollisionName_PrintsNothing as test_module # All groups present in the PhysX Collider that could show up in test # Fixme: collision_groups = ["All", "None", "All_NoTouchBend", "All_3", "None_1", "All_NoTouchBend_1", "All_2", "None_1_1", "All_NoTouchBend_1_1", "All_1", "None_1_1_1", "All_NoTouchBend_1_1_1", "All_4", "None_1_1_1_1", "All_NoTouchBend_1_1_1_1", "GroupLeft", "GroupRight"] # Fixme: for group in collision_groups: @@ -49,5 +49,5 @@ class TestAutomation(TestAutomationBase): reason="Editor crashes and errors about files accessed by multiple processes appear in the log.") @revert_physics_config def test_C15425929_Undo_Redo(self, request, workspace, editor, launcher_platform): - from . import C15425929_Undo_Redo as test_module + from .general import C15425929_Undo_Redo as test_module self._run_test(request, workspace, editor, test_module) diff --git a/AutomatedTesting/Gem/PythonTests/physics/TestSuite_Utils.py b/AutomatedTesting/Gem/PythonTests/physics/TestSuite_Utils.py index 9f4edba18b..a3fd5c741f 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/TestSuite_Utils.py +++ b/AutomatedTesting/Gem/PythonTests/physics/TestSuite_Utils.py @@ -29,14 +29,14 @@ class TestUtils(TestAutomationBase): :param request: Built in pytest object, and is needed to call the pytest "addfinalizer" teardown command. :editor: Fixture containing editor details """ - from . import UtilTest_Physmaterial_Editor as physmaterial_editor_test_module + from .utils import UtilTest_Physmaterial_Editor as physmaterial_editor_test_module expected_lines = [] unexpected_lines = ["Assert"] self._run_test(request, workspace, editor, physmaterial_editor_test_module, expected_lines, unexpected_lines) def test_UtilTest_Tracer_PicksErrorsAndWarnings(self, request, workspace, editor): - from . import UtilTest_Tracer_PicksErrorsAndWarnings as testcase_module + from .utils import UtilTest_Tracer_PicksErrorsAndWarnings as testcase_module self._run_test(request, workspace, editor, testcase_module, [], []) def test_FileManagement_FindingFiles(self, workspace): @@ -262,7 +262,7 @@ class TestUtils(TestAutomationBase): ) @fm.file_override("default.physxconfiguration", "UtilTest_PhysxConfig_Override.physxconfiguration") def test_UtilTest_Managed_Files(self, request, workspace, editor): - from . import UtilTest_Managed_Files as test_module + from .utils import UtilTest_Managed_Files as test_module expected_lines = [] unexpected_lines = ["Assert"] diff --git a/AutomatedTesting/Gem/PythonTests/physics/C14654881_CharacterController_SwitchLevels.py b/AutomatedTesting/Gem/PythonTests/physics/character_controller/C14654881_CharacterController_SwitchLevels.py old mode 100755 new mode 100644 similarity index 96% rename from AutomatedTesting/Gem/PythonTests/physics/C14654881_CharacterController_SwitchLevels.py rename to AutomatedTesting/Gem/PythonTests/physics/character_controller/C14654881_CharacterController_SwitchLevels.py index 975c5ee787..3976bcf25c --- a/AutomatedTesting/Gem/PythonTests/physics/C14654881_CharacterController_SwitchLevels.py +++ b/AutomatedTesting/Gem/PythonTests/physics/character_controller/C14654881_CharacterController_SwitchLevels.py @@ -53,11 +53,6 @@ def C14654881_CharacterController_SwitchLevels(): import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper import azlmbr.legacy.general as general @@ -93,8 +88,5 @@ def C14654881_CharacterController_SwitchLevels(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C14654881_CharacterController_SwitchLevels) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C100000_RigidBody_EnablingGravityWorksPoC.py b/AutomatedTesting/Gem/PythonTests/physics/collider/C100000_RigidBody_EnablingGravityWorksPoC.py old mode 100755 new mode 100644 similarity index 96% rename from AutomatedTesting/Gem/PythonTests/physics/C100000_RigidBody_EnablingGravityWorksPoC.py rename to AutomatedTesting/Gem/PythonTests/physics/collider/C100000_RigidBody_EnablingGravityWorksPoC.py index 58d92fd313..f3d3e02d8e --- a/AutomatedTesting/Gem/PythonTests/physics/C100000_RigidBody_EnablingGravityWorksPoC.py +++ b/AutomatedTesting/Gem/PythonTests/physics/collider/C100000_RigidBody_EnablingGravityWorksPoC.py @@ -25,11 +25,6 @@ class Tests(): def C100000_RigidBody_EnablingGravityWorksPoC(): import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -77,8 +72,5 @@ def C100000_RigidBody_EnablingGravityWorksPoC(): helper.exit_game_mode(Tests.exit_game_mode) if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C100000_RigidBody_EnablingGravityWorksPoC) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C111111_RigidBody_EnablingGravityWorksUsingNotificationsPoC.py b/AutomatedTesting/Gem/PythonTests/physics/collider/C111111_RigidBody_EnablingGravityWorksUsingNotificationsPoC.py old mode 100755 new mode 100644 similarity index 96% rename from AutomatedTesting/Gem/PythonTests/physics/C111111_RigidBody_EnablingGravityWorksUsingNotificationsPoC.py rename to AutomatedTesting/Gem/PythonTests/physics/collider/C111111_RigidBody_EnablingGravityWorksUsingNotificationsPoC.py index 77e8c73604..997ea8a5a6 --- a/AutomatedTesting/Gem/PythonTests/physics/C111111_RigidBody_EnablingGravityWorksUsingNotificationsPoC.py +++ b/AutomatedTesting/Gem/PythonTests/physics/collider/C111111_RigidBody_EnablingGravityWorksUsingNotificationsPoC.py @@ -24,11 +24,6 @@ def C111111_RigidBody_EnablingGravityWorksUsingNotificationsPoC(): # Setup path import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -84,8 +79,5 @@ def C111111_RigidBody_EnablingGravityWorksUsingNotificationsPoC(): helper.exit_game_mode(Tests.exit_game_mode) if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C111111_RigidBody_EnablingGravityWorksUsingNotificationsPoC) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C14861498_ConfirmError_NoPxMesh.py b/AutomatedTesting/Gem/PythonTests/physics/collider/C14861498_ConfirmError_NoPxMesh.py old mode 100755 new mode 100644 similarity index 95% rename from AutomatedTesting/Gem/PythonTests/physics/C14861498_ConfirmError_NoPxMesh.py rename to AutomatedTesting/Gem/PythonTests/physics/collider/C14861498_ConfirmError_NoPxMesh.py index 622f2aac35..731f114b8c --- a/AutomatedTesting/Gem/PythonTests/physics/C14861498_ConfirmError_NoPxMesh.py +++ b/AutomatedTesting/Gem/PythonTests/physics/collider/C14861498_ConfirmError_NoPxMesh.py @@ -48,11 +48,6 @@ def C14861498_ConfirmError_NoPxMesh(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper from editor_python_test_tools.utils import Tracer @@ -85,8 +80,5 @@ def C14861498_ConfirmError_NoPxMesh(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C14861498_ConfirmError_NoPxMesh) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C14861500_DefaultSetting_ColliderShape.py b/AutomatedTesting/Gem/PythonTests/physics/collider/C14861500_DefaultSetting_ColliderShape.py old mode 100755 new mode 100644 similarity index 95% rename from AutomatedTesting/Gem/PythonTests/physics/C14861500_DefaultSetting_ColliderShape.py rename to AutomatedTesting/Gem/PythonTests/physics/collider/C14861500_DefaultSetting_ColliderShape.py index 0827ee540a..aed856f530 --- a/AutomatedTesting/Gem/PythonTests/physics/C14861500_DefaultSetting_ColliderShape.py +++ b/AutomatedTesting/Gem/PythonTests/physics/collider/C14861500_DefaultSetting_ColliderShape.py @@ -40,9 +40,7 @@ def C14861500_DefaultSetting_ColliderShape(): :return: None """ # Helper Files - import ImportPathHelper as imports - imports.init() from editor_python_test_tools.editor_entity_utils import EditorEntity as Entity from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -70,8 +68,5 @@ def C14861500_DefaultSetting_ColliderShape(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C14861500_DefaultSetting_ColliderShape) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C14861501_PhysXCollider_RenderMeshAutoAssigned.py b/AutomatedTesting/Gem/PythonTests/physics/collider/C14861501_PhysXCollider_RenderMeshAutoAssigned.py old mode 100755 new mode 100644 similarity index 96% rename from AutomatedTesting/Gem/PythonTests/physics/C14861501_PhysXCollider_RenderMeshAutoAssigned.py rename to AutomatedTesting/Gem/PythonTests/physics/collider/C14861501_PhysXCollider_RenderMeshAutoAssigned.py index 1a4fe471a4..73c94a2dfb --- a/AutomatedTesting/Gem/PythonTests/physics/C14861501_PhysXCollider_RenderMeshAutoAssigned.py +++ b/AutomatedTesting/Gem/PythonTests/physics/collider/C14861501_PhysXCollider_RenderMeshAutoAssigned.py @@ -48,13 +48,11 @@ def C14861501_PhysXCollider_RenderMeshAutoAssigned(): import os # Helper Files - import ImportPathHelper as imports - imports.init() from editor_python_test_tools.editor_entity_utils import EditorEntity as Entity from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper - from asset_utils import Asset + from editor_python_test_tools.asset_utils import Asset # Asset paths STATIC_MESH = os.path.join("assets", "c14861501_physxcollider_rendermeshautoassigned", "spherebot", "r0-b_body.azmodel") @@ -91,8 +89,5 @@ def C14861501_PhysXCollider_RenderMeshAutoAssigned(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C14861501_PhysXCollider_RenderMeshAutoAssigned) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C14861502_PhysXCollider_AssetAutoAssigned.py b/AutomatedTesting/Gem/PythonTests/physics/collider/C14861502_PhysXCollider_AssetAutoAssigned.py old mode 100755 new mode 100644 similarity index 96% rename from AutomatedTesting/Gem/PythonTests/physics/C14861502_PhysXCollider_AssetAutoAssigned.py rename to AutomatedTesting/Gem/PythonTests/physics/collider/C14861502_PhysXCollider_AssetAutoAssigned.py index 490708007e..b8c0e4a529 --- a/AutomatedTesting/Gem/PythonTests/physics/C14861502_PhysXCollider_AssetAutoAssigned.py +++ b/AutomatedTesting/Gem/PythonTests/physics/collider/C14861502_PhysXCollider_AssetAutoAssigned.py @@ -47,13 +47,11 @@ def C14861502_PhysXCollider_AssetAutoAssigned(): import os # Helper Files - import ImportPathHelper as imports - imports.init() from editor_python_test_tools.editor_entity_utils import EditorEntity as Entity from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper - from asset_utils import Asset + from editor_python_test_tools.asset_utils import Asset # Open 3D Engine Imports import azlmbr.legacy.general as general @@ -93,8 +91,5 @@ def C14861502_PhysXCollider_AssetAutoAssigned(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C14861502_PhysXCollider_AssetAutoAssigned) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C14861504_RenderMeshAsset_WithNoPxAsset.py b/AutomatedTesting/Gem/PythonTests/physics/collider/C14861504_RenderMeshAsset_WithNoPxAsset.py old mode 100755 new mode 100644 similarity index 95% rename from AutomatedTesting/Gem/PythonTests/physics/C14861504_RenderMeshAsset_WithNoPxAsset.py rename to AutomatedTesting/Gem/PythonTests/physics/collider/C14861504_RenderMeshAsset_WithNoPxAsset.py index 589245e884..1a63f478fd --- a/AutomatedTesting/Gem/PythonTests/physics/C14861504_RenderMeshAsset_WithNoPxAsset.py +++ b/AutomatedTesting/Gem/PythonTests/physics/collider/C14861504_RenderMeshAsset_WithNoPxAsset.py @@ -22,7 +22,7 @@ class Tests(): # fmt: on -def run(): +def C14861504_RenderMeshAsset_WithNoPxAsset(): """ Summary: Create entity with Mesh component and assign a render mesh that has no physics asset to the Mesh component. @@ -52,14 +52,12 @@ def run(): import os # Helper Files - import ImportPathHelper as imports - imports.init() from editor_python_test_tools.editor_entity_utils import EditorEntity as Entity from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper from editor_python_test_tools.utils import Tracer - from asset_utils import Asset + from editor_python_test_tools.asset_utils import Asset # Open 3D Engine Imports import azlmbr.asset as azasset @@ -102,4 +100,5 @@ def run(): if __name__ == "__main__": - run() + from editor_python_test_tools.utils import Report + Report.start_test(C14861504_RenderMeshAsset_WithNoPxAsset) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C19578018_ShapeColliderWithNoShapeComponent.py b/AutomatedTesting/Gem/PythonTests/physics/collider/C19578018_ShapeColliderWithNoShapeComponent.py old mode 100755 new mode 100644 similarity index 96% rename from AutomatedTesting/Gem/PythonTests/physics/C19578018_ShapeColliderWithNoShapeComponent.py rename to AutomatedTesting/Gem/PythonTests/physics/collider/C19578018_ShapeColliderWithNoShapeComponent.py index 478910e56c..3da42eb40f --- a/AutomatedTesting/Gem/PythonTests/physics/C19578018_ShapeColliderWithNoShapeComponent.py +++ b/AutomatedTesting/Gem/PythonTests/physics/collider/C19578018_ShapeColliderWithNoShapeComponent.py @@ -47,9 +47,7 @@ def C19578018_ShapeColliderWithNoShapeComponent(): """ # Built-in Imports - import ImportPathHelper as imports - imports.init() # Helper Imports from editor_python_test_tools.utils import Report @@ -92,8 +90,5 @@ def C19578018_ShapeColliderWithNoShapeComponent(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C19578018_ShapeColliderWithNoShapeComponent) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C19578021_ShapeCollider_CanBeAdded.py b/AutomatedTesting/Gem/PythonTests/physics/collider/C19578021_ShapeCollider_CanBeAdded.py old mode 100755 new mode 100644 similarity index 96% rename from AutomatedTesting/Gem/PythonTests/physics/C19578021_ShapeCollider_CanBeAdded.py rename to AutomatedTesting/Gem/PythonTests/physics/collider/C19578021_ShapeCollider_CanBeAdded.py index cf5aac6e98..0ec9908f2d --- a/AutomatedTesting/Gem/PythonTests/physics/C19578021_ShapeCollider_CanBeAdded.py +++ b/AutomatedTesting/Gem/PythonTests/physics/collider/C19578021_ShapeCollider_CanBeAdded.py @@ -44,9 +44,7 @@ def C19578021_ShapeCollider_CanBeAdded(): :return: None """ # Helper Files - import ImportPathHelper as imports - imports.init() from editor_python_test_tools.editor_entity_utils import EditorEntity as Entity from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -90,8 +88,5 @@ def C19578021_ShapeCollider_CanBeAdded(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C19578021_ShapeCollider_CanBeAdded) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C19723164_ShapeColliders_WontCrashEditor.py b/AutomatedTesting/Gem/PythonTests/physics/collider/C19723164_ShapeColliders_WontCrashEditor.py old mode 100755 new mode 100644 similarity index 96% rename from AutomatedTesting/Gem/PythonTests/physics/C19723164_ShapeColliders_WontCrashEditor.py rename to AutomatedTesting/Gem/PythonTests/physics/collider/C19723164_ShapeColliders_WontCrashEditor.py index f6f21a5322..7d277a734d --- a/AutomatedTesting/Gem/PythonTests/physics/C19723164_ShapeColliders_WontCrashEditor.py +++ b/AutomatedTesting/Gem/PythonTests/physics/collider/C19723164_ShapeColliders_WontCrashEditor.py @@ -40,9 +40,7 @@ def C19723164_ShapeColliders_WontCrashEditor(): :return: None """ # Helper Files - import ImportPathHelper as imports - imports.init() from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper from editor_python_test_tools.editor_entity_utils import EditorEntity as Entity @@ -96,8 +94,5 @@ def C19723164_ShapeColliders_WontCrashEditor(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C19723164_ShapeColliders_WontCrashEditor) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain.py b/AutomatedTesting/Gem/PythonTests/physics/collider/C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain.py old mode 100755 new mode 100644 similarity index 97% rename from AutomatedTesting/Gem/PythonTests/physics/C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain.py rename to AutomatedTesting/Gem/PythonTests/physics/collider/C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain.py index 9258cf8547..9094ba68c6 --- a/AutomatedTesting/Gem/PythonTests/physics/C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain.py +++ b/AutomatedTesting/Gem/PythonTests/physics/collider/C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain.py @@ -51,9 +51,7 @@ def C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain(): import os import sys - import ImportPathHelper as imports - imports.init() from editor_python_test_tools.editor_entity_utils import EditorEntity import azlmbr.legacy.general as general import azlmbr.bus @@ -134,8 +132,5 @@ def C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C3510644_Collider_CollisionGroups.py b/AutomatedTesting/Gem/PythonTests/physics/collider/C3510644_Collider_CollisionGroups.py old mode 100755 new mode 100644 similarity index 99% rename from AutomatedTesting/Gem/PythonTests/physics/C3510644_Collider_CollisionGroups.py rename to AutomatedTesting/Gem/PythonTests/physics/collider/C3510644_Collider_CollisionGroups.py index e41aecf4fe..28638cc2a6 --- a/AutomatedTesting/Gem/PythonTests/physics/C3510644_Collider_CollisionGroups.py +++ b/AutomatedTesting/Gem/PythonTests/physics/collider/C3510644_Collider_CollisionGroups.py @@ -90,11 +90,6 @@ def C3510644_Collider_CollisionGroups(): import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -362,8 +357,5 @@ def C3510644_Collider_CollisionGroups(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C3510644_Collider_CollisionGroups) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4044695_PhysXCollider_AddMultipleSurfaceFbx.py b/AutomatedTesting/Gem/PythonTests/physics/collider/C4044695_PhysXCollider_AddMultipleSurfaceFbx.py old mode 100755 new mode 100644 similarity index 97% rename from AutomatedTesting/Gem/PythonTests/physics/C4044695_PhysXCollider_AddMultipleSurfaceFbx.py rename to AutomatedTesting/Gem/PythonTests/physics/collider/C4044695_PhysXCollider_AddMultipleSurfaceFbx.py index 538f28ff36..cfe6f3962c --- a/AutomatedTesting/Gem/PythonTests/physics/C4044695_PhysXCollider_AddMultipleSurfaceFbx.py +++ b/AutomatedTesting/Gem/PythonTests/physics/collider/C4044695_PhysXCollider_AddMultipleSurfaceFbx.py @@ -48,13 +48,11 @@ def C4044695_PhysXCollider_AddMultipleSurfaceFbx(): import os # Helper Files - import ImportPathHelper as imports - imports.init() from editor_python_test_tools.editor_entity_utils import EditorEntity as Entity from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper - from asset_utils import Asset + from editor_python_test_tools.asset_utils import Asset # Constants PHYSICS_ASSET_INDEX = 7 # Hardcoded enum index value for Shape property @@ -107,8 +105,5 @@ def C4044695_PhysXCollider_AddMultipleSurfaceFbx(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C4044695_PhysXCollider_AddMultipleSurfaceFbx) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976227_Collider_NewGroup.py b/AutomatedTesting/Gem/PythonTests/physics/collider/C4976227_Collider_NewGroup.py old mode 100755 new mode 100644 similarity index 95% rename from AutomatedTesting/Gem/PythonTests/physics/C4976227_Collider_NewGroup.py rename to AutomatedTesting/Gem/PythonTests/physics/collider/C4976227_Collider_NewGroup.py index e123067f54..e9704d6be5 --- a/AutomatedTesting/Gem/PythonTests/physics/C4976227_Collider_NewGroup.py +++ b/AutomatedTesting/Gem/PythonTests/physics/collider/C4976227_Collider_NewGroup.py @@ -51,11 +51,6 @@ def C4976227_Collider_NewGroup(): import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -84,8 +79,5 @@ def C4976227_Collider_NewGroup(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C4976227_Collider_NewGroup) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976236_AddPhysxColliderComponent.py b/AutomatedTesting/Gem/PythonTests/physics/collider/C4976236_AddPhysxColliderComponent.py old mode 100755 new mode 100644 similarity index 95% rename from AutomatedTesting/Gem/PythonTests/physics/C4976236_AddPhysxColliderComponent.py rename to AutomatedTesting/Gem/PythonTests/physics/collider/C4976236_AddPhysxColliderComponent.py index d4b7d85169..e4341bb148 --- a/AutomatedTesting/Gem/PythonTests/physics/C4976236_AddPhysxColliderComponent.py +++ b/AutomatedTesting/Gem/PythonTests/physics/collider/C4976236_AddPhysxColliderComponent.py @@ -42,14 +42,12 @@ def C4976236_AddPhysxColliderComponent(): """ # Helper file Imports - import ImportPathHelper as imports - imports.init() from editor_python_test_tools.editor_entity_utils import EditorEntity from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper from editor_python_test_tools.utils import Tracer - from asset_utils import Asset + from editor_python_test_tools.asset_utils import Asset helper.init_idle() # 1) Load the level @@ -84,8 +82,5 @@ def C4976236_AddPhysxColliderComponent(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C4976236_AddPhysxColliderComponent) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976242_Collision_SameCollisionlayerSameCollisiongroup.py b/AutomatedTesting/Gem/PythonTests/physics/collider/C4976242_Collision_SameCollisionlayerSameCollisiongroup.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C4976242_Collision_SameCollisionlayerSameCollisiongroup.py rename to AutomatedTesting/Gem/PythonTests/physics/collider/C4976242_Collision_SameCollisionlayerSameCollisiongroup.py index 86dd81a6de..86ef5b6ed4 --- a/AutomatedTesting/Gem/PythonTests/physics/C4976242_Collision_SameCollisionlayerSameCollisiongroup.py +++ b/AutomatedTesting/Gem/PythonTests/physics/collider/C4976242_Collision_SameCollisionlayerSameCollisiongroup.py @@ -62,11 +62,6 @@ def C4976242_Collision_SameCollisionlayerSameCollisiongroup(): import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -188,8 +183,5 @@ def C4976242_Collision_SameCollisionlayerSameCollisiongroup(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C4976242_Collision_SameCollisionlayerSameCollisiongroup) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976243_Collision_SameCollisionGroupDiffCollisionLayers.py b/AutomatedTesting/Gem/PythonTests/physics/collider/C4976243_Collision_SameCollisionGroupDiffCollisionLayers.py old mode 100755 new mode 100644 similarity index 97% rename from AutomatedTesting/Gem/PythonTests/physics/C4976243_Collision_SameCollisionGroupDiffCollisionLayers.py rename to AutomatedTesting/Gem/PythonTests/physics/collider/C4976243_Collision_SameCollisionGroupDiffCollisionLayers.py index f1a646e964..893d0d06f6 --- a/AutomatedTesting/Gem/PythonTests/physics/C4976243_Collision_SameCollisionGroupDiffCollisionLayers.py +++ b/AutomatedTesting/Gem/PythonTests/physics/collider/C4976243_Collision_SameCollisionGroupDiffCollisionLayers.py @@ -66,11 +66,6 @@ def C4976243_Collision_SameCollisionGroupDiffCollisionLayers(): import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -127,8 +122,5 @@ def C4976243_Collision_SameCollisionGroupDiffCollisionLayers(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C4976243_Collision_SameCollisionGroupDiffCollisionLayers) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976244_Collider_SameGroupSameLayerCollision.py b/AutomatedTesting/Gem/PythonTests/physics/collider/C4976244_Collider_SameGroupSameLayerCollision.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C4976244_Collider_SameGroupSameLayerCollision.py rename to AutomatedTesting/Gem/PythonTests/physics/collider/C4976244_Collider_SameGroupSameLayerCollision.py index 1d1f0aba35..44ea29de76 --- a/AutomatedTesting/Gem/PythonTests/physics/C4976244_Collider_SameGroupSameLayerCollision.py +++ b/AutomatedTesting/Gem/PythonTests/physics/collider/C4976244_Collider_SameGroupSameLayerCollision.py @@ -62,11 +62,6 @@ def C4976244_Collider_SameGroupSameLayerCollision(): import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -185,8 +180,5 @@ def C4976244_Collider_SameGroupSameLayerCollision(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C4976244_Collider_SameGroupSameLayerCollision) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976245_PhysXCollider_CollisionLayerTest.py b/AutomatedTesting/Gem/PythonTests/physics/collider/C4976245_PhysXCollider_CollisionLayerTest.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C4976245_PhysXCollider_CollisionLayerTest.py rename to AutomatedTesting/Gem/PythonTests/physics/collider/C4976245_PhysXCollider_CollisionLayerTest.py index 9d2c6f5fb4..a7c9152744 --- a/AutomatedTesting/Gem/PythonTests/physics/C4976245_PhysXCollider_CollisionLayerTest.py +++ b/AutomatedTesting/Gem/PythonTests/physics/collider/C4976245_PhysXCollider_CollisionLayerTest.py @@ -67,11 +67,6 @@ def C4976245_PhysXCollider_CollisionLayerTest(): import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper import azlmbr.legacy.general as general @@ -223,8 +218,5 @@ def C4976245_PhysXCollider_CollisionLayerTest(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C4976245_PhysXCollider_CollisionLayerTest) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4982593_PhysXCollider_CollisionLayerTest.py b/AutomatedTesting/Gem/PythonTests/physics/collider/C4982593_PhysXCollider_CollisionLayerTest.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C4982593_PhysXCollider_CollisionLayerTest.py rename to AutomatedTesting/Gem/PythonTests/physics/collider/C4982593_PhysXCollider_CollisionLayerTest.py index 500515f707..3fdb9d3403 --- a/AutomatedTesting/Gem/PythonTests/physics/C4982593_PhysXCollider_CollisionLayerTest.py +++ b/AutomatedTesting/Gem/PythonTests/physics/collider/C4982593_PhysXCollider_CollisionLayerTest.py @@ -67,11 +67,6 @@ def C4982593_PhysXCollider_CollisionLayerTest(): import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper import azlmbr.legacy.general as general @@ -231,8 +226,5 @@ def C4982593_PhysXCollider_CollisionLayerTest(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C4982593_PhysXCollider_CollisionLayerTest) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4982595_Collider_TriggerDisablesCollision.py b/AutomatedTesting/Gem/PythonTests/physics/collider/C4982595_Collider_TriggerDisablesCollision.py old mode 100755 new mode 100644 similarity index 99% rename from AutomatedTesting/Gem/PythonTests/physics/C4982595_Collider_TriggerDisablesCollision.py rename to AutomatedTesting/Gem/PythonTests/physics/collider/C4982595_Collider_TriggerDisablesCollision.py index 23e43cd741..d3b0faa6d4 --- a/AutomatedTesting/Gem/PythonTests/physics/C4982595_Collider_TriggerDisablesCollision.py +++ b/AutomatedTesting/Gem/PythonTests/physics/collider/C4982595_Collider_TriggerDisablesCollision.py @@ -75,11 +75,6 @@ def C4982595_Collider_TriggerDisablesCollision(): # Setup path import os import sys - - import ImportPathHelper as imports - - imports.init() - import azlmbr.legacy.general as general import azlmbr.bus import azlmbr.components @@ -234,8 +229,5 @@ def C4982595_Collider_TriggerDisablesCollision(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C4982595_Collider_TriggerDisablesCollision) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4982797_Collider_ColliderOffset.py b/AutomatedTesting/Gem/PythonTests/physics/collider/C4982797_Collider_ColliderOffset.py old mode 100755 new mode 100644 similarity index 99% rename from AutomatedTesting/Gem/PythonTests/physics/C4982797_Collider_ColliderOffset.py rename to AutomatedTesting/Gem/PythonTests/physics/collider/C4982797_Collider_ColliderOffset.py index 9ede25e5a0..d4d8ab15fd --- a/AutomatedTesting/Gem/PythonTests/physics/C4982797_Collider_ColliderOffset.py +++ b/AutomatedTesting/Gem/PythonTests/physics/collider/C4982797_Collider_ColliderOffset.py @@ -87,9 +87,7 @@ def C4982797_Collider_ColliderOffset(): import sys # Internal editor imports - import ImportPathHelper as imports - imports.init() from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -332,8 +330,5 @@ def C4982797_Collider_ColliderOffset(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C4982797_Collider_ColliderOffset) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4982798_Collider_ColliderRotationOffset.py b/AutomatedTesting/Gem/PythonTests/physics/collider/C4982798_Collider_ColliderRotationOffset.py old mode 100755 new mode 100644 similarity index 99% rename from AutomatedTesting/Gem/PythonTests/physics/C4982798_Collider_ColliderRotationOffset.py rename to AutomatedTesting/Gem/PythonTests/physics/collider/C4982798_Collider_ColliderRotationOffset.py index c0bc208d48..8368b9a66f --- a/AutomatedTesting/Gem/PythonTests/physics/C4982798_Collider_ColliderRotationOffset.py +++ b/AutomatedTesting/Gem/PythonTests/physics/collider/C4982798_Collider_ColliderRotationOffset.py @@ -86,9 +86,7 @@ def C4982798_Collider_ColliderRotationOffset(): :return: None """ - import ImportPathHelper as imports - imports.init() # Internal editor imports @@ -300,8 +298,5 @@ def C4982798_Collider_ColliderRotationOffset(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C4982798_Collider_ColliderRotationOffset) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4982800_PhysXColliderShape_CanBeSelected.py b/AutomatedTesting/Gem/PythonTests/physics/collider/C4982800_PhysXColliderShape_CanBeSelected.py old mode 100755 new mode 100644 similarity index 96% rename from AutomatedTesting/Gem/PythonTests/physics/C4982800_PhysXColliderShape_CanBeSelected.py rename to AutomatedTesting/Gem/PythonTests/physics/collider/C4982800_PhysXColliderShape_CanBeSelected.py index abfa6c44a1..0f1b9c6070 --- a/AutomatedTesting/Gem/PythonTests/physics/C4982800_PhysXColliderShape_CanBeSelected.py +++ b/AutomatedTesting/Gem/PythonTests/physics/collider/C4982800_PhysXColliderShape_CanBeSelected.py @@ -43,9 +43,7 @@ def C4982800_PhysXColliderShape_CanBeSelected(): :return: None """ # Helper Files - import ImportPathHelper as imports - imports.init() from editor_python_test_tools.editor_entity_utils import EditorEntity as Entity from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -91,8 +89,5 @@ def C4982800_PhysXColliderShape_CanBeSelected(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C4982800_PhysXColliderShape_CanBeSelected) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4982801_PhysXColliderShape_CanBeSelected.py b/AutomatedTesting/Gem/PythonTests/physics/collider/C4982801_PhysXColliderShape_CanBeSelected.py old mode 100755 new mode 100644 similarity index 97% rename from AutomatedTesting/Gem/PythonTests/physics/C4982801_PhysXColliderShape_CanBeSelected.py rename to AutomatedTesting/Gem/PythonTests/physics/collider/C4982801_PhysXColliderShape_CanBeSelected.py index 0d5aa39941..33b7dc0b48 --- a/AutomatedTesting/Gem/PythonTests/physics/C4982801_PhysXColliderShape_CanBeSelected.py +++ b/AutomatedTesting/Gem/PythonTests/physics/collider/C4982801_PhysXColliderShape_CanBeSelected.py @@ -43,9 +43,7 @@ def C4982801_PhysXColliderShape_CanBeSelected(): :return: None """ # Helper Files - import ImportPathHelper as imports - imports.init() from editor_python_test_tools.editor_entity_utils import EditorEntity as Entity from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -103,8 +101,5 @@ def C4982801_PhysXColliderShape_CanBeSelected(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C4982801_PhysXColliderShape_CanBeSelected) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4982802_PhysXColliderShape_CanBeSelected.py b/AutomatedTesting/Gem/PythonTests/physics/collider/C4982802_PhysXColliderShape_CanBeSelected.py old mode 100755 new mode 100644 similarity index 97% rename from AutomatedTesting/Gem/PythonTests/physics/C4982802_PhysXColliderShape_CanBeSelected.py rename to AutomatedTesting/Gem/PythonTests/physics/collider/C4982802_PhysXColliderShape_CanBeSelected.py index 7eec3b070a..4881c5b9a0 --- a/AutomatedTesting/Gem/PythonTests/physics/C4982802_PhysXColliderShape_CanBeSelected.py +++ b/AutomatedTesting/Gem/PythonTests/physics/collider/C4982802_PhysXColliderShape_CanBeSelected.py @@ -43,9 +43,7 @@ def C4982802_PhysXColliderShape_CanBeSelected(): :return: None """ # Helper Files - import ImportPathHelper as imports - imports.init() from editor_python_test_tools.editor_entity_utils import EditorEntity as Entity from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -103,8 +101,5 @@ def C4982802_PhysXColliderShape_CanBeSelected(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C4982802_PhysXColliderShape_CanBeSelected) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4982803_Enable_PxMesh_Option.py b/AutomatedTesting/Gem/PythonTests/physics/collider/C4982803_Enable_PxMesh_Option.py old mode 100755 new mode 100644 similarity index 97% rename from AutomatedTesting/Gem/PythonTests/physics/C4982803_Enable_PxMesh_Option.py rename to AutomatedTesting/Gem/PythonTests/physics/collider/C4982803_Enable_PxMesh_Option.py index 340b9c7785..7497ae8253 --- a/AutomatedTesting/Gem/PythonTests/physics/C4982803_Enable_PxMesh_Option.py +++ b/AutomatedTesting/Gem/PythonTests/physics/collider/C4982803_Enable_PxMesh_Option.py @@ -57,13 +57,11 @@ def C4982803_Enable_PxMesh_Option(): import os # Helper Files - import ImportPathHelper as imports - imports.init() from editor_python_test_tools.editor_entity_utils import EditorEntity from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper - from asset_utils import Asset + from editor_python_test_tools.asset_utils import Asset import azlmbr.math as math # Open 3D Engine Imports @@ -141,8 +139,5 @@ def C4982803_Enable_PxMesh_Option(): helper.exit_game_mode(Tests.exit_game_mode) if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C4982803_Enable_PxMesh_Option) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C12868578_ForceRegion_DirectionHasNoAffectOnMagnitude.py b/AutomatedTesting/Gem/PythonTests/physics/force_region/C12868578_ForceRegion_DirectionHasNoAffectOnMagnitude.py old mode 100755 new mode 100644 similarity index 99% rename from AutomatedTesting/Gem/PythonTests/physics/C12868578_ForceRegion_DirectionHasNoAffectOnMagnitude.py rename to AutomatedTesting/Gem/PythonTests/physics/force_region/C12868578_ForceRegion_DirectionHasNoAffectOnMagnitude.py index aae57cffc8..11488b14c2 --- a/AutomatedTesting/Gem/PythonTests/physics/C12868578_ForceRegion_DirectionHasNoAffectOnMagnitude.py +++ b/AutomatedTesting/Gem/PythonTests/physics/force_region/C12868578_ForceRegion_DirectionHasNoAffectOnMagnitude.py @@ -86,11 +86,6 @@ def C12868578_ForceRegion_DirectionHasNoAffectOnMagnitude(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -283,8 +278,5 @@ def C12868578_ForceRegion_DirectionHasNoAffectOnMagnitude(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C12868578_ForceRegion_DirectionHasNoAffectOnMagnitude) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C12868580_ForceRegion_SplineModifiedTransform.py b/AutomatedTesting/Gem/PythonTests/physics/force_region/C12868580_ForceRegion_SplineModifiedTransform.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C12868580_ForceRegion_SplineModifiedTransform.py rename to AutomatedTesting/Gem/PythonTests/physics/force_region/C12868580_ForceRegion_SplineModifiedTransform.py index f21dde6ae0..4e052a1b00 --- a/AutomatedTesting/Gem/PythonTests/physics/C12868580_ForceRegion_SplineModifiedTransform.py +++ b/AutomatedTesting/Gem/PythonTests/physics/force_region/C12868580_ForceRegion_SplineModifiedTransform.py @@ -73,12 +73,6 @@ def C12868580_ForceRegion_SplineModifiedTransform(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -168,8 +162,5 @@ def C12868580_ForceRegion_SplineModifiedTransform(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C12868580_ForceRegion_SplineModifiedTransform) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C12905527_ForceRegion_MagnitudeDeviation.py b/AutomatedTesting/Gem/PythonTests/physics/force_region/C12905527_ForceRegion_MagnitudeDeviation.py old mode 100755 new mode 100644 similarity index 97% rename from AutomatedTesting/Gem/PythonTests/physics/C12905527_ForceRegion_MagnitudeDeviation.py rename to AutomatedTesting/Gem/PythonTests/physics/force_region/C12905527_ForceRegion_MagnitudeDeviation.py index 6df2d545da..c9d411b873 --- a/AutomatedTesting/Gem/PythonTests/physics/C12905527_ForceRegion_MagnitudeDeviation.py +++ b/AutomatedTesting/Gem/PythonTests/physics/force_region/C12905527_ForceRegion_MagnitudeDeviation.py @@ -54,12 +54,6 @@ def C12905527_ForceRegion_MagnitudeDeviation(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -144,8 +138,5 @@ def C12905527_ForceRegion_MagnitudeDeviation(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C12905527_ForceRegion_MagnitudeDeviation) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C12905528_ForceRegion_WithNonTriggerCollider.py b/AutomatedTesting/Gem/PythonTests/physics/force_region/C12905528_ForceRegion_WithNonTriggerCollider.py old mode 100755 new mode 100644 similarity index 89% rename from AutomatedTesting/Gem/PythonTests/physics/C12905528_ForceRegion_WithNonTriggerCollider.py rename to AutomatedTesting/Gem/PythonTests/physics/force_region/C12905528_ForceRegion_WithNonTriggerCollider.py index ca5a29e182..93453b29c0 --- a/AutomatedTesting/Gem/PythonTests/physics/C12905528_ForceRegion_WithNonTriggerCollider.py +++ b/AutomatedTesting/Gem/PythonTests/physics/force_region/C12905528_ForceRegion_WithNonTriggerCollider.py @@ -19,7 +19,7 @@ class Tests(): # fmt: on -def run(): +def C12905528_ForceRegion_WithNonTriggerCollider(): """ Summary: Create entity with PhysX Force Region component. Check that user is warned if new PhysX Collider component is @@ -43,13 +43,10 @@ def run(): :return: None """ - # Helper file Imports - import ImportPathHelper as imports - + import azlmbr.legacy.general as general from editor_python_test_tools.editor_entity_utils import EditorEntity from editor_python_test_tools.utils import Report - imports.init() from editor_python_test_tools.utils import TestHelper as helper from editor_python_test_tools.utils import Tracer @@ -66,11 +63,14 @@ def run(): Report.result(Tests.add_physx_force_region, test_entity.has_component("PhysX Force Region")) # 4) Start the Tracer to catch any errors and warnings + Report.info("Starting warning monitoring") with Tracer() as section_tracer: # 5) Add the PhysX Collider component test_entity.add_component("PhysX Collider") Report.result(Tests.add_physx_collider, test_entity.has_component("PhysX Collider")) - + general.idle_wait_frames(1) + Report.info("Ending warning monitoring") + # ) Verify there is warning in the logs success_condition = section_tracer.has_warnings # Checking if warning exist and the exact warning is caught in the expected lines in Test file @@ -78,4 +78,5 @@ def run(): if __name__ == "__main__": - run() + from editor_python_test_tools.utils import Report + Report.start_test(C12905528_ForceRegion_WithNonTriggerCollider) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C15845879_ForceRegion_HighLinearDampingForce.py b/AutomatedTesting/Gem/PythonTests/physics/force_region/C15845879_ForceRegion_HighLinearDampingForce.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C15845879_ForceRegion_HighLinearDampingForce.py rename to AutomatedTesting/Gem/PythonTests/physics/force_region/C15845879_ForceRegion_HighLinearDampingForce.py index 1021186a9b..d4807476c2 --- a/AutomatedTesting/Gem/PythonTests/physics/C15845879_ForceRegion_HighLinearDampingForce.py +++ b/AutomatedTesting/Gem/PythonTests/physics/force_region/C15845879_ForceRegion_HighLinearDampingForce.py @@ -56,11 +56,6 @@ def C15845879_ForceRegion_HighLinearDampingForce(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -169,8 +164,5 @@ def C15845879_ForceRegion_HighLinearDampingForce(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C15845879_ForceRegion_HighLinearDampingForce) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5932040_ForceRegion_CubeExertsWorldForce.py b/AutomatedTesting/Gem/PythonTests/physics/force_region/C5932040_ForceRegion_CubeExertsWorldForce.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C5932040_ForceRegion_CubeExertsWorldForce.py rename to AutomatedTesting/Gem/PythonTests/physics/force_region/C5932040_ForceRegion_CubeExertsWorldForce.py index db3d4708ce..969a203502 --- a/AutomatedTesting/Gem/PythonTests/physics/C5932040_ForceRegion_CubeExertsWorldForce.py +++ b/AutomatedTesting/Gem/PythonTests/physics/force_region/C5932040_ForceRegion_CubeExertsWorldForce.py @@ -65,11 +65,6 @@ def C5932040_ForceRegion_CubeExertsWorldForce(): import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -183,8 +178,5 @@ def C5932040_ForceRegion_CubeExertsWorldForce(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C5932040_ForceRegion_CubeExertsWorldForce) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5932041_PhysXForceRegion_LocalSpaceForceOnRigidBodies.py b/AutomatedTesting/Gem/PythonTests/physics/force_region/C5932041_PhysXForceRegion_LocalSpaceForceOnRigidBodies.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C5932041_PhysXForceRegion_LocalSpaceForceOnRigidBodies.py rename to AutomatedTesting/Gem/PythonTests/physics/force_region/C5932041_PhysXForceRegion_LocalSpaceForceOnRigidBodies.py index 09965214b2..15c77ba17e --- a/AutomatedTesting/Gem/PythonTests/physics/C5932041_PhysXForceRegion_LocalSpaceForceOnRigidBodies.py +++ b/AutomatedTesting/Gem/PythonTests/physics/force_region/C5932041_PhysXForceRegion_LocalSpaceForceOnRigidBodies.py @@ -65,11 +65,6 @@ def C5932041_PhysXForceRegion_LocalSpaceForceOnRigidBodies(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -161,8 +156,5 @@ def C5932041_PhysXForceRegion_LocalSpaceForceOnRigidBodies(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C5932041_PhysXForceRegion_LocalSpaceForceOnRigidBodies) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5932042_PhysXForceRegion_LinearDamping.py b/AutomatedTesting/Gem/PythonTests/physics/force_region/C5932042_PhysXForceRegion_LinearDamping.py old mode 100755 new mode 100644 similarity index 99% rename from AutomatedTesting/Gem/PythonTests/physics/C5932042_PhysXForceRegion_LinearDamping.py rename to AutomatedTesting/Gem/PythonTests/physics/force_region/C5932042_PhysXForceRegion_LinearDamping.py index c05e71573f..5112729cc2 --- a/AutomatedTesting/Gem/PythonTests/physics/C5932042_PhysXForceRegion_LinearDamping.py +++ b/AutomatedTesting/Gem/PythonTests/physics/force_region/C5932042_PhysXForceRegion_LinearDamping.py @@ -71,11 +71,6 @@ def C5932042_PhysXForceRegion_LinearDamping(): import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -269,8 +264,5 @@ def C5932042_PhysXForceRegion_LinearDamping(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C5932042_PhysXForceRegion_LinearDamping) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5932043_ForceRegion_SimpleDragOnRigidBodies.py b/AutomatedTesting/Gem/PythonTests/physics/force_region/C5932043_ForceRegion_SimpleDragOnRigidBodies.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C5932043_ForceRegion_SimpleDragOnRigidBodies.py rename to AutomatedTesting/Gem/PythonTests/physics/force_region/C5932043_ForceRegion_SimpleDragOnRigidBodies.py index d88232ff78..cd81315e73 --- a/AutomatedTesting/Gem/PythonTests/physics/C5932043_ForceRegion_SimpleDragOnRigidBodies.py +++ b/AutomatedTesting/Gem/PythonTests/physics/force_region/C5932043_ForceRegion_SimpleDragOnRigidBodies.py @@ -42,9 +42,7 @@ def C5932043_ForceRegion_SimpleDragOnRigidBodies(): # Setup path import os, sys - import ImportPathHelper as imports - imports.init() from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -139,8 +137,5 @@ def C5932043_ForceRegion_SimpleDragOnRigidBodies(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C5932043_ForceRegion_SimpleDragOnRigidBodies) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5932044_ForceRegion_PointForceOnRigidBody.py b/AutomatedTesting/Gem/PythonTests/physics/force_region/C5932044_ForceRegion_PointForceOnRigidBody.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C5932044_ForceRegion_PointForceOnRigidBody.py rename to AutomatedTesting/Gem/PythonTests/physics/force_region/C5932044_ForceRegion_PointForceOnRigidBody.py index 58eec3a9be..23760909db --- a/AutomatedTesting/Gem/PythonTests/physics/C5932044_ForceRegion_PointForceOnRigidBody.py +++ b/AutomatedTesting/Gem/PythonTests/physics/force_region/C5932044_ForceRegion_PointForceOnRigidBody.py @@ -65,11 +65,6 @@ def C5932044_ForceRegion_PointForceOnRigidBody(): import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -189,8 +184,5 @@ def C5932044_ForceRegion_PointForceOnRigidBody(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C5932044_ForceRegion_PointForceOnRigidBody) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5932045_ForceRegion_Spline.py b/AutomatedTesting/Gem/PythonTests/physics/force_region/C5932045_ForceRegion_Spline.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C5932045_ForceRegion_Spline.py rename to AutomatedTesting/Gem/PythonTests/physics/force_region/C5932045_ForceRegion_Spline.py index ea9ca060c0..e74f5cc6e0 --- a/AutomatedTesting/Gem/PythonTests/physics/C5932045_ForceRegion_Spline.py +++ b/AutomatedTesting/Gem/PythonTests/physics/force_region/C5932045_ForceRegion_Spline.py @@ -70,11 +70,6 @@ def C5932045_ForceRegion_Spline(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -162,8 +157,5 @@ def C5932045_ForceRegion_Spline(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C5932045_ForceRegion_Spline) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5959759_RigidBody_ForceRegionSpherePointForce.py b/AutomatedTesting/Gem/PythonTests/physics/force_region/C5959759_RigidBody_ForceRegionSpherePointForce.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C5959759_RigidBody_ForceRegionSpherePointForce.py rename to AutomatedTesting/Gem/PythonTests/physics/force_region/C5959759_RigidBody_ForceRegionSpherePointForce.py index 3bfad9d770..99baeb1fff --- a/AutomatedTesting/Gem/PythonTests/physics/C5959759_RigidBody_ForceRegionSpherePointForce.py +++ b/AutomatedTesting/Gem/PythonTests/physics/force_region/C5959759_RigidBody_ForceRegionSpherePointForce.py @@ -38,11 +38,6 @@ def C5959759_RigidBody_ForceRegionSpherePointForce(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -150,8 +145,5 @@ def C5959759_RigidBody_ForceRegionSpherePointForce(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C5959759_RigidBody_ForceRegionSpherePointForce) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5959760_PhysXForceRegion_PointForceExertion.py b/AutomatedTesting/Gem/PythonTests/physics/force_region/C5959760_PhysXForceRegion_PointForceExertion.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C5959760_PhysXForceRegion_PointForceExertion.py rename to AutomatedTesting/Gem/PythonTests/physics/force_region/C5959760_PhysXForceRegion_PointForceExertion.py index 85d15aec33..6648b41d31 --- a/AutomatedTesting/Gem/PythonTests/physics/C5959760_PhysXForceRegion_PointForceExertion.py +++ b/AutomatedTesting/Gem/PythonTests/physics/force_region/C5959760_PhysXForceRegion_PointForceExertion.py @@ -63,11 +63,6 @@ def C5959760_PhysXForceRegion_PointForceExertion(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -223,8 +218,5 @@ def C5959760_PhysXForceRegion_PointForceExertion(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C5959760_PhysXForceRegion_PointForceExertion) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5959761_ForceRegion_PhysAssetExertsPointForce.py b/AutomatedTesting/Gem/PythonTests/physics/force_region/C5959761_ForceRegion_PhysAssetExertsPointForce.py old mode 100755 new mode 100644 similarity index 97% rename from AutomatedTesting/Gem/PythonTests/physics/C5959761_ForceRegion_PhysAssetExertsPointForce.py rename to AutomatedTesting/Gem/PythonTests/physics/force_region/C5959761_ForceRegion_PhysAssetExertsPointForce.py index 1e58a8d975..c77fc39a77 --- a/AutomatedTesting/Gem/PythonTests/physics/C5959761_ForceRegion_PhysAssetExertsPointForce.py +++ b/AutomatedTesting/Gem/PythonTests/physics/force_region/C5959761_ForceRegion_PhysAssetExertsPointForce.py @@ -61,12 +61,6 @@ def C5959761_ForceRegion_PhysAssetExertsPointForce(): import os import sys - - import ImportPathHelper as imports - - imports.init() - - import azlmbr import azlmbr.legacy.general as general import azlmbr.bus as bus @@ -140,8 +134,5 @@ def C5959761_ForceRegion_PhysAssetExertsPointForce(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C5959761_ForceRegion_PhysAssetExertsPointForce) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5959763_ForceRegion_ForceRegionImpulsesCube.py b/AutomatedTesting/Gem/PythonTests/physics/force_region/C5959763_ForceRegion_ForceRegionImpulsesCube.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C5959763_ForceRegion_ForceRegionImpulsesCube.py rename to AutomatedTesting/Gem/PythonTests/physics/force_region/C5959763_ForceRegion_ForceRegionImpulsesCube.py index 6123381588..8bea169a82 --- a/AutomatedTesting/Gem/PythonTests/physics/C5959763_ForceRegion_ForceRegionImpulsesCube.py +++ b/AutomatedTesting/Gem/PythonTests/physics/force_region/C5959763_ForceRegion_ForceRegionImpulsesCube.py @@ -42,9 +42,7 @@ def C5959763_ForceRegion_ForceRegionImpulsesCube(): # Setup path import os, sys - import ImportPathHelper as imports - imports.init() from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -165,8 +163,5 @@ def C5959763_ForceRegion_ForceRegionImpulsesCube(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C5959763_ForceRegion_ForceRegionImpulsesCube) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5959764_ForceRegion_ForceRegionImpulsesCapsule.py b/AutomatedTesting/Gem/PythonTests/physics/force_region/C5959764_ForceRegion_ForceRegionImpulsesCapsule.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C5959764_ForceRegion_ForceRegionImpulsesCapsule.py rename to AutomatedTesting/Gem/PythonTests/physics/force_region/C5959764_ForceRegion_ForceRegionImpulsesCapsule.py index 9e4ef9379a..4ce345a5eb --- a/AutomatedTesting/Gem/PythonTests/physics/C5959764_ForceRegion_ForceRegionImpulsesCapsule.py +++ b/AutomatedTesting/Gem/PythonTests/physics/force_region/C5959764_ForceRegion_ForceRegionImpulsesCapsule.py @@ -42,9 +42,7 @@ def C5959764_ForceRegion_ForceRegionImpulsesCapsule(): # Setup path import os, sys - import ImportPathHelper as imports - imports.init() from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -167,8 +165,5 @@ def C5959764_ForceRegion_ForceRegionImpulsesCapsule(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C5959764_ForceRegion_ForceRegionImpulsesCapsule) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5959765_ForceRegion_AssetGetsImpulsed.py b/AutomatedTesting/Gem/PythonTests/physics/force_region/C5959765_ForceRegion_AssetGetsImpulsed.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C5959765_ForceRegion_AssetGetsImpulsed.py rename to AutomatedTesting/Gem/PythonTests/physics/force_region/C5959765_ForceRegion_AssetGetsImpulsed.py index 3a28208805..36ecddb3ca --- a/AutomatedTesting/Gem/PythonTests/physics/C5959765_ForceRegion_AssetGetsImpulsed.py +++ b/AutomatedTesting/Gem/PythonTests/physics/force_region/C5959765_ForceRegion_AssetGetsImpulsed.py @@ -45,9 +45,7 @@ def C5959765_ForceRegion_AssetGetsImpulsed(): # Setup path import os, sys - import ImportPathHelper as imports - imports.init() from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -169,8 +167,5 @@ def C5959765_ForceRegion_AssetGetsImpulsed(): helper.exit_game_mode(Tests.exit_game_mode) if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C5959765_ForceRegion_AssetGetsImpulsed) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5959808_ForceRegion_PositionOffset.py b/AutomatedTesting/Gem/PythonTests/physics/force_region/C5959808_ForceRegion_PositionOffset.py old mode 100755 new mode 100644 similarity index 99% rename from AutomatedTesting/Gem/PythonTests/physics/C5959808_ForceRegion_PositionOffset.py rename to AutomatedTesting/Gem/PythonTests/physics/force_region/C5959808_ForceRegion_PositionOffset.py index 4b70fcc734..480869457c --- a/AutomatedTesting/Gem/PythonTests/physics/C5959808_ForceRegion_PositionOffset.py +++ b/AutomatedTesting/Gem/PythonTests/physics/force_region/C5959808_ForceRegion_PositionOffset.py @@ -124,11 +124,6 @@ def C5959808_ForceRegion_PositionOffset(): import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -405,8 +400,5 @@ def C5959808_ForceRegion_PositionOffset(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C5959808_ForceRegion_PositionOffset) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5959809_ForceRegion_RotationalOffset.py b/AutomatedTesting/Gem/PythonTests/physics/force_region/C5959809_ForceRegion_RotationalOffset.py old mode 100755 new mode 100644 similarity index 99% rename from AutomatedTesting/Gem/PythonTests/physics/C5959809_ForceRegion_RotationalOffset.py rename to AutomatedTesting/Gem/PythonTests/physics/force_region/C5959809_ForceRegion_RotationalOffset.py index ccf05cfe5d..d26aebab8d --- a/AutomatedTesting/Gem/PythonTests/physics/C5959809_ForceRegion_RotationalOffset.py +++ b/AutomatedTesting/Gem/PythonTests/physics/force_region/C5959809_ForceRegion_RotationalOffset.py @@ -125,11 +125,6 @@ def C5959809_ForceRegion_RotationalOffset(): import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -405,8 +400,5 @@ def C5959809_ForceRegion_RotationalOffset(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C5959809_ForceRegion_RotationalOffset) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5959810_ForceRegion_ForceRegionCombinesForces.py b/AutomatedTesting/Gem/PythonTests/physics/force_region/C5959810_ForceRegion_ForceRegionCombinesForces.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C5959810_ForceRegion_ForceRegionCombinesForces.py rename to AutomatedTesting/Gem/PythonTests/physics/force_region/C5959810_ForceRegion_ForceRegionCombinesForces.py index 330a2662ab..b7660926d5 --- a/AutomatedTesting/Gem/PythonTests/physics/C5959810_ForceRegion_ForceRegionCombinesForces.py +++ b/AutomatedTesting/Gem/PythonTests/physics/force_region/C5959810_ForceRegion_ForceRegionCombinesForces.py @@ -65,11 +65,6 @@ def C5959810_ForceRegion_ForceRegionCombinesForces(): import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -234,8 +229,5 @@ def C5959810_ForceRegion_ForceRegionCombinesForces(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C5959810_ForceRegion_ForceRegionCombinesForces) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5968759_ForceRegion_ExertsSeveralForcesOnRigidBody.py b/AutomatedTesting/Gem/PythonTests/physics/force_region/C5968759_ForceRegion_ExertsSeveralForcesOnRigidBody.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C5968759_ForceRegion_ExertsSeveralForcesOnRigidBody.py rename to AutomatedTesting/Gem/PythonTests/physics/force_region/C5968759_ForceRegion_ExertsSeveralForcesOnRigidBody.py index 068238e64d..b1f8d27900 --- a/AutomatedTesting/Gem/PythonTests/physics/C5968759_ForceRegion_ExertsSeveralForcesOnRigidBody.py +++ b/AutomatedTesting/Gem/PythonTests/physics/force_region/C5968759_ForceRegion_ExertsSeveralForcesOnRigidBody.py @@ -55,9 +55,7 @@ def C5968759_ForceRegion_ExertsSeveralForcesOnRigidBody(): Second force region: Name = "Force Region Simple Drag" Applies a drag force on both spheres Setup path """ - import ImportPathHelper as imports - imports.init() import azlmbr.legacy.general as general @@ -175,8 +173,5 @@ def C5968759_ForceRegion_ExertsSeveralForcesOnRigidBody(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C5968759_ForceRegion_ExertsSeveralForcesOnRigidBody) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5968760_ForceRegion_CheckNetForceChange.py b/AutomatedTesting/Gem/PythonTests/physics/force_region/C5968760_ForceRegion_CheckNetForceChange.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C5968760_ForceRegion_CheckNetForceChange.py rename to AutomatedTesting/Gem/PythonTests/physics/force_region/C5968760_ForceRegion_CheckNetForceChange.py index 41d5b93eb7..d64a0564f4 --- a/AutomatedTesting/Gem/PythonTests/physics/C5968760_ForceRegion_CheckNetForceChange.py +++ b/AutomatedTesting/Gem/PythonTests/physics/force_region/C5968760_ForceRegion_CheckNetForceChange.py @@ -61,11 +61,6 @@ def C5968760_ForceRegion_CheckNetForceChange(): import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -163,8 +158,5 @@ def C5968760_ForceRegion_CheckNetForceChange(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C5968760_ForceRegion_CheckNetForceChange) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C6090546_ForceRegion_SliceFileInstantiates.py b/AutomatedTesting/Gem/PythonTests/physics/force_region/C6090546_ForceRegion_SliceFileInstantiates.py old mode 100755 new mode 100644 similarity index 97% rename from AutomatedTesting/Gem/PythonTests/physics/C6090546_ForceRegion_SliceFileInstantiates.py rename to AutomatedTesting/Gem/PythonTests/physics/force_region/C6090546_ForceRegion_SliceFileInstantiates.py index f1c13291e3..0c360edee5 --- a/AutomatedTesting/Gem/PythonTests/physics/C6090546_ForceRegion_SliceFileInstantiates.py +++ b/AutomatedTesting/Gem/PythonTests/physics/force_region/C6090546_ForceRegion_SliceFileInstantiates.py @@ -63,11 +63,6 @@ def C6090546_ForceRegion_SliceFileInstantiates(): import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -138,8 +133,5 @@ def C6090546_ForceRegion_SliceFileInstantiates(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C6090546_ForceRegion_SliceFileInstantiates) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C6090547_ForceRegion_ParentChildForceRegions.py b/AutomatedTesting/Gem/PythonTests/physics/force_region/C6090547_ForceRegion_ParentChildForceRegions.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C6090547_ForceRegion_ParentChildForceRegions.py rename to AutomatedTesting/Gem/PythonTests/physics/force_region/C6090547_ForceRegion_ParentChildForceRegions.py index 2091a1a1f4..f466680e0c --- a/AutomatedTesting/Gem/PythonTests/physics/C6090547_ForceRegion_ParentChildForceRegions.py +++ b/AutomatedTesting/Gem/PythonTests/physics/force_region/C6090547_ForceRegion_ParentChildForceRegions.py @@ -72,11 +72,6 @@ def C6090547_ForceRegion_ParentChildForceRegions(): import os import sys - - import ImportPathHelper as imports - - imports.init() - import azlmbr.legacy.general as general import azlmbr.bus import azlmbr.math as lymath @@ -199,8 +194,5 @@ def C6090547_ForceRegion_ParentChildForceRegions(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C6090547_ForceRegion_ParentChildForceRegions) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C6090550_ForceRegion_WorldSpaceForceNegative.py b/AutomatedTesting/Gem/PythonTests/physics/force_region/C6090550_ForceRegion_WorldSpaceForceNegative.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C6090550_ForceRegion_WorldSpaceForceNegative.py rename to AutomatedTesting/Gem/PythonTests/physics/force_region/C6090550_ForceRegion_WorldSpaceForceNegative.py index 7b0586586b..7d6a8966b2 --- a/AutomatedTesting/Gem/PythonTests/physics/C6090550_ForceRegion_WorldSpaceForceNegative.py +++ b/AutomatedTesting/Gem/PythonTests/physics/force_region/C6090550_ForceRegion_WorldSpaceForceNegative.py @@ -69,11 +69,6 @@ def C6090550_ForceRegion_WorldSpaceForceNegative(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - import azlmbr.legacy.general as general import azlmbr.bus @@ -243,8 +238,5 @@ def C6090550_ForceRegion_WorldSpaceForceNegative(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C6090550_ForceRegion_WorldSpaceForceNegative) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C6090551_ForceRegion_LocalSpaceForceNegative.py b/AutomatedTesting/Gem/PythonTests/physics/force_region/C6090551_ForceRegion_LocalSpaceForceNegative.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C6090551_ForceRegion_LocalSpaceForceNegative.py rename to AutomatedTesting/Gem/PythonTests/physics/force_region/C6090551_ForceRegion_LocalSpaceForceNegative.py index 6025777d86..48d08666fd --- a/AutomatedTesting/Gem/PythonTests/physics/C6090551_ForceRegion_LocalSpaceForceNegative.py +++ b/AutomatedTesting/Gem/PythonTests/physics/force_region/C6090551_ForceRegion_LocalSpaceForceNegative.py @@ -69,11 +69,6 @@ def C6090551_ForceRegion_LocalSpaceForceNegative(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - import azlmbr.legacy.general as general import azlmbr.bus @@ -243,8 +238,5 @@ def C6090551_ForceRegion_LocalSpaceForceNegative(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C6090551_ForceRegion_LocalSpaceForceNegative) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C6090552_ForceRegion_LinearDampingNegative.py b/AutomatedTesting/Gem/PythonTests/physics/force_region/C6090552_ForceRegion_LinearDampingNegative.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C6090552_ForceRegion_LinearDampingNegative.py rename to AutomatedTesting/Gem/PythonTests/physics/force_region/C6090552_ForceRegion_LinearDampingNegative.py index 07f399a41a..100a07d346 --- a/AutomatedTesting/Gem/PythonTests/physics/C6090552_ForceRegion_LinearDampingNegative.py +++ b/AutomatedTesting/Gem/PythonTests/physics/force_region/C6090552_ForceRegion_LinearDampingNegative.py @@ -68,11 +68,6 @@ def C6090552_ForceRegion_LinearDampingNegative(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - import azlmbr.legacy.general as general import azlmbr.bus @@ -242,8 +237,5 @@ def C6090552_ForceRegion_LinearDampingNegative(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C6090552_ForceRegion_LinearDampingNegative) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C6090553_ForceRegion_SimpleDragForceOnRigidBodies.py b/AutomatedTesting/Gem/PythonTests/physics/force_region/C6090553_ForceRegion_SimpleDragForceOnRigidBodies.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C6090553_ForceRegion_SimpleDragForceOnRigidBodies.py rename to AutomatedTesting/Gem/PythonTests/physics/force_region/C6090553_ForceRegion_SimpleDragForceOnRigidBodies.py index 57f6d13d8e..7b5904a3d7 --- a/AutomatedTesting/Gem/PythonTests/physics/C6090553_ForceRegion_SimpleDragForceOnRigidBodies.py +++ b/AutomatedTesting/Gem/PythonTests/physics/force_region/C6090553_ForceRegion_SimpleDragForceOnRigidBodies.py @@ -63,11 +63,6 @@ def C6090553_ForceRegion_SimpleDragForceOnRigidBodies(): import os import sys - - import ImportPathHelper as imports - - imports.init() - import azlmbr.legacy.general as general import azlmbr.bus @@ -174,8 +169,5 @@ def C6090553_ForceRegion_SimpleDragForceOnRigidBodies(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C6090553_ForceRegion_SimpleDragForceOnRigidBodies) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C6090554_ForceRegion_PointForceNegative.py b/AutomatedTesting/Gem/PythonTests/physics/force_region/C6090554_ForceRegion_PointForceNegative.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C6090554_ForceRegion_PointForceNegative.py rename to AutomatedTesting/Gem/PythonTests/physics/force_region/C6090554_ForceRegion_PointForceNegative.py index fd3846a801..0b6b9a8b58 --- a/AutomatedTesting/Gem/PythonTests/physics/C6090554_ForceRegion_PointForceNegative.py +++ b/AutomatedTesting/Gem/PythonTests/physics/force_region/C6090554_ForceRegion_PointForceNegative.py @@ -69,11 +69,6 @@ def C6090554_ForceRegion_PointForceNegative(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - import azlmbr.legacy.general as general import azlmbr.bus @@ -243,8 +238,5 @@ def C6090554_ForceRegion_PointForceNegative(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C6090554_ForceRegion_PointForceNegative) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C6090555_ForceRegion_SplineFollowOnRigidBodies.py b/AutomatedTesting/Gem/PythonTests/physics/force_region/C6090555_ForceRegion_SplineFollowOnRigidBodies.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C6090555_ForceRegion_SplineFollowOnRigidBodies.py rename to AutomatedTesting/Gem/PythonTests/physics/force_region/C6090555_ForceRegion_SplineFollowOnRigidBodies.py index 800e9245dc..7a642c6c59 --- a/AutomatedTesting/Gem/PythonTests/physics/C6090555_ForceRegion_SplineFollowOnRigidBodies.py +++ b/AutomatedTesting/Gem/PythonTests/physics/force_region/C6090555_ForceRegion_SplineFollowOnRigidBodies.py @@ -65,11 +65,6 @@ def C6090555_ForceRegion_SplineFollowOnRigidBodies(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -176,8 +171,5 @@ def C6090555_ForceRegion_SplineFollowOnRigidBodies(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C6090555_ForceRegion_SplineFollowOnRigidBodies) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C6321601_Force_HighValuesDirectionAxes.py b/AutomatedTesting/Gem/PythonTests/physics/force_region/C6321601_Force_HighValuesDirectionAxes.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C6321601_Force_HighValuesDirectionAxes.py rename to AutomatedTesting/Gem/PythonTests/physics/force_region/C6321601_Force_HighValuesDirectionAxes.py index 6c94e7aea9..47cc085479 --- a/AutomatedTesting/Gem/PythonTests/physics/C6321601_Force_HighValuesDirectionAxes.py +++ b/AutomatedTesting/Gem/PythonTests/physics/force_region/C6321601_Force_HighValuesDirectionAxes.py @@ -90,11 +90,6 @@ def C6321601_Force_HighValuesDirectionAxes(): import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper from editor_python_test_tools.utils import Tracer @@ -246,10 +241,6 @@ def C6321601_Force_HighValuesDirectionAxes(): Report.result(Tests.error_not_found, not has_physx_error()) - if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C6321601_Force_HighValuesDirectionAxes) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C14976307_Gravity_SetGravityWorks.py b/AutomatedTesting/Gem/PythonTests/physics/general/C14976307_Gravity_SetGravityWorks.py old mode 100755 new mode 100644 similarity index 97% rename from AutomatedTesting/Gem/PythonTests/physics/C14976307_Gravity_SetGravityWorks.py rename to AutomatedTesting/Gem/PythonTests/physics/general/C14976307_Gravity_SetGravityWorks.py index 1b50863ccd..335ef75649 --- a/AutomatedTesting/Gem/PythonTests/physics/C14976307_Gravity_SetGravityWorks.py +++ b/AutomatedTesting/Gem/PythonTests/physics/general/C14976307_Gravity_SetGravityWorks.py @@ -60,11 +60,6 @@ def C14976307_Gravity_SetGravityWorks(): import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -122,8 +117,5 @@ def C14976307_Gravity_SetGravityWorks(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C14976307_Gravity_SetGravityWorks) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C15425929_Undo_Redo.py b/AutomatedTesting/Gem/PythonTests/physics/general/C15425929_Undo_Redo.py old mode 100755 new mode 100644 similarity index 96% rename from AutomatedTesting/Gem/PythonTests/physics/C15425929_Undo_Redo.py rename to AutomatedTesting/Gem/PythonTests/physics/general/C15425929_Undo_Redo.py index 9595030b4b..f74c1d10cb --- a/AutomatedTesting/Gem/PythonTests/physics/C15425929_Undo_Redo.py +++ b/AutomatedTesting/Gem/PythonTests/physics/general/C15425929_Undo_Redo.py @@ -44,11 +44,6 @@ def C15425929_Undo_Redo(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper from editor_python_test_tools.utils import Tracer @@ -91,8 +86,5 @@ def C15425929_Undo_Redo(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C15425929_Undo_Redo) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C19536274_GetCollisionName_PrintsName.py b/AutomatedTesting/Gem/PythonTests/physics/general/C19536274_GetCollisionName_PrintsName.py old mode 100755 new mode 100644 similarity index 93% rename from AutomatedTesting/Gem/PythonTests/physics/C19536274_GetCollisionName_PrintsName.py rename to AutomatedTesting/Gem/PythonTests/physics/general/C19536274_GetCollisionName_PrintsName.py index 4c035eea96..abf2045ed4 --- a/AutomatedTesting/Gem/PythonTests/physics/C19536274_GetCollisionName_PrintsName.py +++ b/AutomatedTesting/Gem/PythonTests/physics/general/C19536274_GetCollisionName_PrintsName.py @@ -17,7 +17,7 @@ class Tests(): # fmt: on -def run(): +def C19536274_GetCollisionName_PrintsName(): """ Summary: Loads a level that contains an entity with script canvas and PhysX Collider components @@ -43,9 +43,7 @@ def run(): :return: None """ # Helper Files - import ImportPathHelper as imports - imports.init() from editor_python_test_tools.utils import Report from editor_python_test_tools.editor_entity_utils import EditorEntity as Entity from editor_python_test_tools.utils import TestHelper as helper @@ -66,4 +64,5 @@ def run(): if __name__ == "__main__": - run() + from editor_python_test_tools.utils import Report + Report.start_test(C19536274_GetCollisionName_PrintsName) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C19536277_GetCollisionName_PrintsNothing.py b/AutomatedTesting/Gem/PythonTests/physics/general/C19536277_GetCollisionName_PrintsNothing.py old mode 100755 new mode 100644 similarity index 93% rename from AutomatedTesting/Gem/PythonTests/physics/C19536277_GetCollisionName_PrintsNothing.py rename to AutomatedTesting/Gem/PythonTests/physics/general/C19536277_GetCollisionName_PrintsNothing.py index 1bf5248a1f..a0d242542f --- a/AutomatedTesting/Gem/PythonTests/physics/C19536277_GetCollisionName_PrintsNothing.py +++ b/AutomatedTesting/Gem/PythonTests/physics/general/C19536277_GetCollisionName_PrintsNothing.py @@ -17,7 +17,7 @@ class Tests(): # fmt: on -def run(): +def C19536277_GetCollisionName_PrintsNothing(): """ Summary: Loads a level that contains an entity with script canvas and PhysX Collider components @@ -43,9 +43,7 @@ def run(): :return: None """ # Helper Files - import ImportPathHelper as imports - imports.init() from editor_python_test_tools.utils import Report from editor_python_test_tools.editor_entity_utils import EditorEntity as Entity from editor_python_test_tools.utils import TestHelper as helper @@ -66,4 +64,5 @@ def run(): if __name__ == "__main__": - run() + from editor_python_test_tools.utils import Report + Report.start_test(C19536277_GetCollisionName_PrintsNothing) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C29032500_EditorComponents_WorldBodyBusWorks.py b/AutomatedTesting/Gem/PythonTests/physics/general/C29032500_EditorComponents_WorldBodyBusWorks.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C29032500_EditorComponents_WorldBodyBusWorks.py rename to AutomatedTesting/Gem/PythonTests/physics/general/C29032500_EditorComponents_WorldBodyBusWorks.py index a022cc7011..0f7f91dafb --- a/AutomatedTesting/Gem/PythonTests/physics/C29032500_EditorComponents_WorldBodyBusWorks.py +++ b/AutomatedTesting/Gem/PythonTests/physics/general/C29032500_EditorComponents_WorldBodyBusWorks.py @@ -82,11 +82,6 @@ def C29032500_EditorComponents_WorldBodyBusWorks(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - import azlmbr.legacy.general as general import azlmbr.bus import math @@ -154,8 +149,5 @@ def C29032500_EditorComponents_WorldBodyBusWorks(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C29032500_EditorComponents_WorldBodyBusWorks) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5689529_Verify_Terrain_RigidBody_Collider_Mesh.py b/AutomatedTesting/Gem/PythonTests/physics/general/C5689529_Verify_Terrain_RigidBody_Collider_Mesh.py old mode 100755 new mode 100644 similarity index 97% rename from AutomatedTesting/Gem/PythonTests/physics/C5689529_Verify_Terrain_RigidBody_Collider_Mesh.py rename to AutomatedTesting/Gem/PythonTests/physics/general/C5689529_Verify_Terrain_RigidBody_Collider_Mesh.py index 1436a98536..f011e65972 --- a/AutomatedTesting/Gem/PythonTests/physics/C5689529_Verify_Terrain_RigidBody_Collider_Mesh.py +++ b/AutomatedTesting/Gem/PythonTests/physics/general/C5689529_Verify_Terrain_RigidBody_Collider_Mesh.py @@ -58,11 +58,6 @@ def C5689529_Verify_Terrain_RigidBody_Collider_Mesh(): import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -106,8 +101,5 @@ def C5689529_Verify_Terrain_RigidBody_Collider_Mesh(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C5689529_Verify_Terrain_RigidBody_Collider_Mesh) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C6131473_StaticSlice_OnDynamicSliceSpawn.py b/AutomatedTesting/Gem/PythonTests/physics/general/C6131473_StaticSlice_OnDynamicSliceSpawn.py old mode 100755 new mode 100644 similarity index 96% rename from AutomatedTesting/Gem/PythonTests/physics/C6131473_StaticSlice_OnDynamicSliceSpawn.py rename to AutomatedTesting/Gem/PythonTests/physics/general/C6131473_StaticSlice_OnDynamicSliceSpawn.py index 16fff25a25..e28893dee3 --- a/AutomatedTesting/Gem/PythonTests/physics/C6131473_StaticSlice_OnDynamicSliceSpawn.py +++ b/AutomatedTesting/Gem/PythonTests/physics/general/C6131473_StaticSlice_OnDynamicSliceSpawn.py @@ -58,11 +58,6 @@ def C6131473_StaticSlice_OnDynamicSliceSpawn(): import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -103,8 +98,5 @@ def C6131473_StaticSlice_OnDynamicSliceSpawn(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C6131473_StaticSlice_OnDynamicSliceSpawn) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C18243580_Joints_Fixed2BodiesConstrained.py b/AutomatedTesting/Gem/PythonTests/physics/joints/C18243580_Joints_Fixed2BodiesConstrained.py old mode 100755 new mode 100644 similarity index 96% rename from AutomatedTesting/Gem/PythonTests/physics/C18243580_Joints_Fixed2BodiesConstrained.py rename to AutomatedTesting/Gem/PythonTests/physics/joints/C18243580_Joints_Fixed2BodiesConstrained.py index 24adc2ff71..ceabb91a28 --- a/AutomatedTesting/Gem/PythonTests/physics/C18243580_Joints_Fixed2BodiesConstrained.py +++ b/AutomatedTesting/Gem/PythonTests/physics/joints/C18243580_Joints_Fixed2BodiesConstrained.py @@ -49,11 +49,6 @@ def C18243580_Joints_Fixed2BodiesConstrained(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -99,8 +94,5 @@ def C18243580_Joints_Fixed2BodiesConstrained(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C18243580_Joints_Fixed2BodiesConstrained) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C18243581_Joints_FixedBreakable.py b/AutomatedTesting/Gem/PythonTests/physics/joints/C18243581_Joints_FixedBreakable.py old mode 100755 new mode 100644 similarity index 96% rename from AutomatedTesting/Gem/PythonTests/physics/C18243581_Joints_FixedBreakable.py rename to AutomatedTesting/Gem/PythonTests/physics/joints/C18243581_Joints_FixedBreakable.py index fb3da2c4e5..716df85c67 --- a/AutomatedTesting/Gem/PythonTests/physics/C18243581_Joints_FixedBreakable.py +++ b/AutomatedTesting/Gem/PythonTests/physics/joints/C18243581_Joints_FixedBreakable.py @@ -48,11 +48,6 @@ def C18243581_Joints_FixedBreakable(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -98,8 +93,5 @@ def C18243581_Joints_FixedBreakable(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C18243581_Joints_FixedBreakable) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C18243582_Joints_FixedLeadFollowerCollide.py b/AutomatedTesting/Gem/PythonTests/physics/joints/C18243582_Joints_FixedLeadFollowerCollide.py old mode 100755 new mode 100644 similarity index 96% rename from AutomatedTesting/Gem/PythonTests/physics/C18243582_Joints_FixedLeadFollowerCollide.py rename to AutomatedTesting/Gem/PythonTests/physics/joints/C18243582_Joints_FixedLeadFollowerCollide.py index 0c7a1d7007..0f130a300b --- a/AutomatedTesting/Gem/PythonTests/physics/C18243582_Joints_FixedLeadFollowerCollide.py +++ b/AutomatedTesting/Gem/PythonTests/physics/joints/C18243582_Joints_FixedLeadFollowerCollide.py @@ -50,11 +50,6 @@ def C18243582_Joints_FixedLeadFollowerCollide(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -93,8 +88,5 @@ def C18243582_Joints_FixedLeadFollowerCollide(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C18243582_Joints_FixedLeadFollowerCollide) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C18243583_Joints_Hinge2BodiesConstrained.py b/AutomatedTesting/Gem/PythonTests/physics/joints/C18243583_Joints_Hinge2BodiesConstrained.py old mode 100755 new mode 100644 similarity index 97% rename from AutomatedTesting/Gem/PythonTests/physics/C18243583_Joints_Hinge2BodiesConstrained.py rename to AutomatedTesting/Gem/PythonTests/physics/joints/C18243583_Joints_Hinge2BodiesConstrained.py index e91a4a495e..e9b11bc198 --- a/AutomatedTesting/Gem/PythonTests/physics/C18243583_Joints_Hinge2BodiesConstrained.py +++ b/AutomatedTesting/Gem/PythonTests/physics/joints/C18243583_Joints_Hinge2BodiesConstrained.py @@ -52,11 +52,6 @@ def C18243583_Joints_Hinge2BodiesConstrained(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -116,8 +111,5 @@ def C18243583_Joints_Hinge2BodiesConstrained(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C18243583_Joints_Hinge2BodiesConstrained) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C18243584_Joints_HingeSoftLimitsConstrained.py b/AutomatedTesting/Gem/PythonTests/physics/joints/C18243584_Joints_HingeSoftLimitsConstrained.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C18243584_Joints_HingeSoftLimitsConstrained.py rename to AutomatedTesting/Gem/PythonTests/physics/joints/C18243584_Joints_HingeSoftLimitsConstrained.py index d4bf9308d2..e100b61494 --- a/AutomatedTesting/Gem/PythonTests/physics/C18243584_Joints_HingeSoftLimitsConstrained.py +++ b/AutomatedTesting/Gem/PythonTests/physics/joints/C18243584_Joints_HingeSoftLimitsConstrained.py @@ -54,9 +54,7 @@ def C18243584_Joints_HingeSoftLimitsConstrained(): import sys import math - import ImportPathHelper as imports - imports.init() from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -142,8 +140,5 @@ def C18243584_Joints_HingeSoftLimitsConstrained(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C18243584_Joints_HingeSoftLimitsConstrained) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C18243585_Joints_HingeNoLimitsConstrained.py b/AutomatedTesting/Gem/PythonTests/physics/joints/C18243585_Joints_HingeNoLimitsConstrained.py old mode 100755 new mode 100644 similarity index 97% rename from AutomatedTesting/Gem/PythonTests/physics/C18243585_Joints_HingeNoLimitsConstrained.py rename to AutomatedTesting/Gem/PythonTests/physics/joints/C18243585_Joints_HingeNoLimitsConstrained.py index 3a734e1ef0..90ac80b1fa --- a/AutomatedTesting/Gem/PythonTests/physics/C18243585_Joints_HingeNoLimitsConstrained.py +++ b/AutomatedTesting/Gem/PythonTests/physics/joints/C18243585_Joints_HingeNoLimitsConstrained.py @@ -52,11 +52,6 @@ def C18243585_Joints_HingeNoLimitsConstrained(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -112,8 +107,5 @@ def C18243585_Joints_HingeNoLimitsConstrained(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C18243585_Joints_HingeNoLimitsConstrained) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C18243586_Joints_HingeLeadFollowerCollide.py b/AutomatedTesting/Gem/PythonTests/physics/joints/C18243586_Joints_HingeLeadFollowerCollide.py old mode 100755 new mode 100644 similarity index 96% rename from AutomatedTesting/Gem/PythonTests/physics/C18243586_Joints_HingeLeadFollowerCollide.py rename to AutomatedTesting/Gem/PythonTests/physics/joints/C18243586_Joints_HingeLeadFollowerCollide.py index f22b1b0c9c..2b5b95939f --- a/AutomatedTesting/Gem/PythonTests/physics/C18243586_Joints_HingeLeadFollowerCollide.py +++ b/AutomatedTesting/Gem/PythonTests/physics/joints/C18243586_Joints_HingeLeadFollowerCollide.py @@ -49,11 +49,6 @@ def C18243586_Joints_HingeLeadFollowerCollide(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -92,8 +87,5 @@ def C18243586_Joints_HingeLeadFollowerCollide(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C18243586_Joints_HingeLeadFollowerCollide) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C18243587_Joints_HingeBreakable.py b/AutomatedTesting/Gem/PythonTests/physics/joints/C18243587_Joints_HingeBreakable.py old mode 100755 new mode 100644 similarity index 97% rename from AutomatedTesting/Gem/PythonTests/physics/C18243587_Joints_HingeBreakable.py rename to AutomatedTesting/Gem/PythonTests/physics/joints/C18243587_Joints_HingeBreakable.py index c11851bde4..b1ea7e123a --- a/AutomatedTesting/Gem/PythonTests/physics/C18243587_Joints_HingeBreakable.py +++ b/AutomatedTesting/Gem/PythonTests/physics/joints/C18243587_Joints_HingeBreakable.py @@ -50,11 +50,6 @@ def C18243587_Joints_HingeBreakable(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -110,8 +105,5 @@ def C18243587_Joints_HingeBreakable(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C18243587_Joints_HingeBreakable) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C18243588_Joints_Ball2BodiesConstrained.py b/AutomatedTesting/Gem/PythonTests/physics/joints/C18243588_Joints_Ball2BodiesConstrained.py old mode 100755 new mode 100644 similarity index 97% rename from AutomatedTesting/Gem/PythonTests/physics/C18243588_Joints_Ball2BodiesConstrained.py rename to AutomatedTesting/Gem/PythonTests/physics/joints/C18243588_Joints_Ball2BodiesConstrained.py index 107140d7d0..fd8556660a --- a/AutomatedTesting/Gem/PythonTests/physics/C18243588_Joints_Ball2BodiesConstrained.py +++ b/AutomatedTesting/Gem/PythonTests/physics/joints/C18243588_Joints_Ball2BodiesConstrained.py @@ -51,11 +51,6 @@ def C18243588_Joints_Ball2BodiesConstrained(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -114,8 +109,5 @@ def C18243588_Joints_Ball2BodiesConstrained(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C18243588_Joints_Ball2BodiesConstrained) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C18243589_Joints_BallSoftLimitsConstrained.py b/AutomatedTesting/Gem/PythonTests/physics/joints/C18243589_Joints_BallSoftLimitsConstrained.py old mode 100755 new mode 100644 similarity index 97% rename from AutomatedTesting/Gem/PythonTests/physics/C18243589_Joints_BallSoftLimitsConstrained.py rename to AutomatedTesting/Gem/PythonTests/physics/joints/C18243589_Joints_BallSoftLimitsConstrained.py index 2c6f1f34b0..30747bc2eb --- a/AutomatedTesting/Gem/PythonTests/physics/C18243589_Joints_BallSoftLimitsConstrained.py +++ b/AutomatedTesting/Gem/PythonTests/physics/joints/C18243589_Joints_BallSoftLimitsConstrained.py @@ -55,9 +55,7 @@ def C18243589_Joints_BallSoftLimitsConstrained(): import sys import math - import ImportPathHelper as imports - imports.init() from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -135,8 +133,5 @@ def C18243589_Joints_BallSoftLimitsConstrained(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C18243589_Joints_BallSoftLimitsConstrained) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C18243590_Joints_BallNoLimitsConstrained.py b/AutomatedTesting/Gem/PythonTests/physics/joints/C18243590_Joints_BallNoLimitsConstrained.py old mode 100755 new mode 100644 similarity index 97% rename from AutomatedTesting/Gem/PythonTests/physics/C18243590_Joints_BallNoLimitsConstrained.py rename to AutomatedTesting/Gem/PythonTests/physics/joints/C18243590_Joints_BallNoLimitsConstrained.py index b5de805d16..990f4f826b --- a/AutomatedTesting/Gem/PythonTests/physics/C18243590_Joints_BallNoLimitsConstrained.py +++ b/AutomatedTesting/Gem/PythonTests/physics/joints/C18243590_Joints_BallNoLimitsConstrained.py @@ -54,11 +54,6 @@ def C18243590_Joints_BallNoLimitsConstrained(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -113,8 +108,5 @@ def C18243590_Joints_BallNoLimitsConstrained(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C18243590_Joints_BallNoLimitsConstrained) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C18243591_Joints_BallLeadFollowerCollide.py b/AutomatedTesting/Gem/PythonTests/physics/joints/C18243591_Joints_BallLeadFollowerCollide.py old mode 100755 new mode 100644 similarity index 96% rename from AutomatedTesting/Gem/PythonTests/physics/C18243591_Joints_BallLeadFollowerCollide.py rename to AutomatedTesting/Gem/PythonTests/physics/joints/C18243591_Joints_BallLeadFollowerCollide.py index 2e73232bd9..47422d1508 --- a/AutomatedTesting/Gem/PythonTests/physics/C18243591_Joints_BallLeadFollowerCollide.py +++ b/AutomatedTesting/Gem/PythonTests/physics/joints/C18243591_Joints_BallLeadFollowerCollide.py @@ -49,11 +49,6 @@ def C18243591_Joints_BallLeadFollowerCollide(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -92,8 +87,5 @@ def C18243591_Joints_BallLeadFollowerCollide(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C18243591_Joints_BallLeadFollowerCollide) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C18243592_Joints_BallBreakable.py b/AutomatedTesting/Gem/PythonTests/physics/joints/C18243592_Joints_BallBreakable.py old mode 100755 new mode 100644 similarity index 97% rename from AutomatedTesting/Gem/PythonTests/physics/C18243592_Joints_BallBreakable.py rename to AutomatedTesting/Gem/PythonTests/physics/joints/C18243592_Joints_BallBreakable.py index 6539b1b413..6182c312dc --- a/AutomatedTesting/Gem/PythonTests/physics/C18243592_Joints_BallBreakable.py +++ b/AutomatedTesting/Gem/PythonTests/physics/joints/C18243592_Joints_BallBreakable.py @@ -49,11 +49,6 @@ def C18243592_Joints_BallBreakable(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -108,8 +103,5 @@ def C18243592_Joints_BallBreakable(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C18243592_Joints_BallBreakable) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C18243593_Joints_GlobalFrameConstrained.py b/AutomatedTesting/Gem/PythonTests/physics/joints/C18243593_Joints_GlobalFrameConstrained.py old mode 100755 new mode 100644 similarity index 97% rename from AutomatedTesting/Gem/PythonTests/physics/C18243593_Joints_GlobalFrameConstrained.py rename to AutomatedTesting/Gem/PythonTests/physics/joints/C18243593_Joints_GlobalFrameConstrained.py index 63708d7571..bd527f10f8 --- a/AutomatedTesting/Gem/PythonTests/physics/C18243593_Joints_GlobalFrameConstrained.py +++ b/AutomatedTesting/Gem/PythonTests/physics/joints/C18243593_Joints_GlobalFrameConstrained.py @@ -53,11 +53,6 @@ def C18243593_Joints_GlobalFrameConstrained(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -121,8 +116,5 @@ def C18243593_Joints_GlobalFrameConstrained(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C18243593_Joints_GlobalFrameConstrained) diff --git a/AutomatedTesting/Gem/PythonTests/physics/JointsHelper.py b/AutomatedTesting/Gem/PythonTests/physics/joints/JointsHelper.py old mode 100755 new mode 100644 similarity index 97% rename from AutomatedTesting/Gem/PythonTests/physics/JointsHelper.py rename to AutomatedTesting/Gem/PythonTests/physics/joints/JointsHelper.py index 12c05c3ced..6226f42534 --- a/AutomatedTesting/Gem/PythonTests/physics/JointsHelper.py +++ b/AutomatedTesting/Gem/PythonTests/physics/joints/JointsHelper.py @@ -5,10 +5,6 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ -import ImportPathHelper as imports - -imports.init() - from editor_python_test_tools.utils import Report import azlmbr.legacy.general as general import azlmbr.bus diff --git a/AutomatedTesting/Gem/PythonTests/physics/AddModifyDelete_Utils.py b/AutomatedTesting/Gem/PythonTests/physics/material/AddModifyDelete_Utils.py old mode 100755 new mode 100644 similarity index 100% rename from AutomatedTesting/Gem/PythonTests/physics/AddModifyDelete_Utils.py rename to AutomatedTesting/Gem/PythonTests/physics/material/AddModifyDelete_Utils.py diff --git a/AutomatedTesting/Gem/PythonTests/physics/C15096732_Material_DefaultLibraryUpdatedAcrossLevels_after.py b/AutomatedTesting/Gem/PythonTests/physics/material/C15096732_Material_DefaultLibraryUpdatedAcrossLevels_after.py old mode 100755 new mode 100644 similarity index 99% rename from AutomatedTesting/Gem/PythonTests/physics/C15096732_Material_DefaultLibraryUpdatedAcrossLevels_after.py rename to AutomatedTesting/Gem/PythonTests/physics/material/C15096732_Material_DefaultLibraryUpdatedAcrossLevels_after.py index 96e05b88fb..de1945bc8d --- a/AutomatedTesting/Gem/PythonTests/physics/C15096732_Material_DefaultLibraryUpdatedAcrossLevels_after.py +++ b/AutomatedTesting/Gem/PythonTests/physics/material/C15096732_Material_DefaultLibraryUpdatedAcrossLevels_after.py @@ -99,11 +99,6 @@ def C15096732_Material_DefaultLibraryUpdatedAcrossLevels_after(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -285,8 +280,5 @@ def C15096732_Material_DefaultLibraryUpdatedAcrossLevels_after(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C15096732_Material_DefaultLibraryUpdatedAcrossLevels_after) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C15096732_Material_DefaultLibraryUpdatedAcrossLevels_before.py b/AutomatedTesting/Gem/PythonTests/physics/material/C15096732_Material_DefaultLibraryUpdatedAcrossLevels_before.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C15096732_Material_DefaultLibraryUpdatedAcrossLevels_before.py rename to AutomatedTesting/Gem/PythonTests/physics/material/C15096732_Material_DefaultLibraryUpdatedAcrossLevels_before.py index 95e3acefd7..46262f3f77 --- a/AutomatedTesting/Gem/PythonTests/physics/C15096732_Material_DefaultLibraryUpdatedAcrossLevels_before.py +++ b/AutomatedTesting/Gem/PythonTests/physics/material/C15096732_Material_DefaultLibraryUpdatedAcrossLevels_before.py @@ -92,11 +92,6 @@ def C15096732_Material_DefaultLibraryUpdatedAcrossLevels_before(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -237,8 +232,5 @@ def C15096732_Material_DefaultLibraryUpdatedAcrossLevels_before(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C15096732_Material_DefaultLibraryUpdatedAcrossLevels_before) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C15096735_Materials_DefaultLibraryConsistency.py b/AutomatedTesting/Gem/PythonTests/physics/material/C15096735_Materials_DefaultLibraryConsistency.py old mode 100755 new mode 100644 similarity index 99% rename from AutomatedTesting/Gem/PythonTests/physics/C15096735_Materials_DefaultLibraryConsistency.py rename to AutomatedTesting/Gem/PythonTests/physics/material/C15096735_Materials_DefaultLibraryConsistency.py index 18ffe68415..75c9849756 --- a/AutomatedTesting/Gem/PythonTests/physics/C15096735_Materials_DefaultLibraryConsistency.py +++ b/AutomatedTesting/Gem/PythonTests/physics/material/C15096735_Materials_DefaultLibraryConsistency.py @@ -140,11 +140,6 @@ def C15096735_Materials_DefaultLibraryConsistency(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -417,8 +412,5 @@ def C15096735_Materials_DefaultLibraryConsistency(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C15096735_Materials_DefaultLibraryConsistency) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C15096737_Materials_DefaultMaterialLibraryChanges.py b/AutomatedTesting/Gem/PythonTests/physics/material/C15096737_Materials_DefaultMaterialLibraryChanges.py old mode 100755 new mode 100644 similarity index 99% rename from AutomatedTesting/Gem/PythonTests/physics/C15096737_Materials_DefaultMaterialLibraryChanges.py rename to AutomatedTesting/Gem/PythonTests/physics/material/C15096737_Materials_DefaultMaterialLibraryChanges.py index 4dae4c536c..a4c65fc24c --- a/AutomatedTesting/Gem/PythonTests/physics/C15096737_Materials_DefaultMaterialLibraryChanges.py +++ b/AutomatedTesting/Gem/PythonTests/physics/material/C15096737_Materials_DefaultMaterialLibraryChanges.py @@ -107,9 +107,7 @@ def C15096737_Materials_DefaultMaterialLibraryChanges(): import os import sys - import ImportPathHelper as imports - imports.init() from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -293,8 +291,5 @@ def C15096737_Materials_DefaultMaterialLibraryChanges(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C15096737_Materials_DefaultMaterialLibraryChanges) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C15096740_Material_LibraryUpdatedCorrectly.py b/AutomatedTesting/Gem/PythonTests/physics/material/C15096740_Material_LibraryUpdatedCorrectly.py old mode 100755 new mode 100644 similarity index 96% rename from AutomatedTesting/Gem/PythonTests/physics/C15096740_Material_LibraryUpdatedCorrectly.py rename to AutomatedTesting/Gem/PythonTests/physics/material/C15096740_Material_LibraryUpdatedCorrectly.py index 341597e36a..88c51bae8a --- a/AutomatedTesting/Gem/PythonTests/physics/C15096740_Material_LibraryUpdatedCorrectly.py +++ b/AutomatedTesting/Gem/PythonTests/physics/material/C15096740_Material_LibraryUpdatedCorrectly.py @@ -49,15 +49,13 @@ def C15096740_Material_LibraryUpdatedCorrectly(): # Built-in Imports import os - import ImportPathHelper as imports - imports.init() # Helper file Imports from editor_python_test_tools.editor_entity_utils import EditorEntity from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper - from asset_utils import Asset + from editor_python_test_tools.asset_utils import Asset # Open 3D Engine Imports import azlmbr.asset as azasset @@ -101,8 +99,5 @@ def C15096740_Material_LibraryUpdatedCorrectly(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C15096740_Material_LibraryUpdatedCorrectly) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C15308221_Material_ComponentsInSyncWithLibrary.py b/AutomatedTesting/Gem/PythonTests/physics/material/C15308221_Material_ComponentsInSyncWithLibrary.py old mode 100755 new mode 100644 similarity index 99% rename from AutomatedTesting/Gem/PythonTests/physics/C15308221_Material_ComponentsInSyncWithLibrary.py rename to AutomatedTesting/Gem/PythonTests/physics/material/C15308221_Material_ComponentsInSyncWithLibrary.py index 349e824a49..b29709e95b --- a/AutomatedTesting/Gem/PythonTests/physics/C15308221_Material_ComponentsInSyncWithLibrary.py +++ b/AutomatedTesting/Gem/PythonTests/physics/material/C15308221_Material_ComponentsInSyncWithLibrary.py @@ -105,11 +105,6 @@ def C15308221_Material_ComponentsInSyncWithLibrary(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - import azlmbr.legacy.general as general import azlmbr.bus as bus import azlmbr.components @@ -244,8 +239,5 @@ def C15308221_Material_ComponentsInSyncWithLibrary(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C15308221_Material_ComponentsInSyncWithLibrary) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C15425935_Material_LibraryUpdatedAcrossLevels.py b/AutomatedTesting/Gem/PythonTests/physics/material/C15425935_Material_LibraryUpdatedAcrossLevels.py old mode 100755 new mode 100644 similarity index 99% rename from AutomatedTesting/Gem/PythonTests/physics/C15425935_Material_LibraryUpdatedAcrossLevels.py rename to AutomatedTesting/Gem/PythonTests/physics/material/C15425935_Material_LibraryUpdatedAcrossLevels.py index 283b8e3d55..91452a1173 --- a/AutomatedTesting/Gem/PythonTests/physics/C15425935_Material_LibraryUpdatedAcrossLevels.py +++ b/AutomatedTesting/Gem/PythonTests/physics/material/C15425935_Material_LibraryUpdatedAcrossLevels.py @@ -112,12 +112,6 @@ def C15425935_Material_LibraryUpdatedAcrossLevels(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -307,8 +301,5 @@ def C15425935_Material_LibraryUpdatedAcrossLevels(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C15425935_Material_LibraryUpdatedAcrossLevels) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C15556261_PhysXMaterials_CharacterControllerMaterialAssignment.py b/AutomatedTesting/Gem/PythonTests/physics/material/C15556261_PhysXMaterials_CharacterControllerMaterialAssignment.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C15556261_PhysXMaterials_CharacterControllerMaterialAssignment.py rename to AutomatedTesting/Gem/PythonTests/physics/material/C15556261_PhysXMaterials_CharacterControllerMaterialAssignment.py index 88abe8dcd1..4d806cda11 --- a/AutomatedTesting/Gem/PythonTests/physics/C15556261_PhysXMaterials_CharacterControllerMaterialAssignment.py +++ b/AutomatedTesting/Gem/PythonTests/physics/material/C15556261_PhysXMaterials_CharacterControllerMaterialAssignment.py @@ -79,11 +79,6 @@ def C15556261_PhysXMaterials_CharacterControllerMaterialAssignment(): import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper import azlmbr.legacy.general as general @@ -202,8 +197,5 @@ def C15556261_PhysXMaterials_CharacterControllerMaterialAssignment(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C15556261_PhysXMaterials_CharacterControllerMaterialAssignment) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C15563573_Material_AddModifyDeleteOnCharacterController.py b/AutomatedTesting/Gem/PythonTests/physics/material/C15563573_Material_AddModifyDeleteOnCharacterController.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C15563573_Material_AddModifyDeleteOnCharacterController.py rename to AutomatedTesting/Gem/PythonTests/physics/material/C15563573_Material_AddModifyDeleteOnCharacterController.py index ca00b30479..cf38ddc11c --- a/AutomatedTesting/Gem/PythonTests/physics/C15563573_Material_AddModifyDeleteOnCharacterController.py +++ b/AutomatedTesting/Gem/PythonTests/physics/material/C15563573_Material_AddModifyDeleteOnCharacterController.py @@ -107,11 +107,6 @@ def C15563573_Material_AddModifyDeleteOnCharacterController(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - import azlmbr.legacy.general as general import azlmbr.math as lymath @@ -197,8 +192,5 @@ def C15563573_Material_AddModifyDeleteOnCharacterController(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C15563573_Material_AddModifyDeleteOnCharacterController) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C18977601_Material_FrictionCombinePriority.py b/AutomatedTesting/Gem/PythonTests/physics/material/C18977601_Material_FrictionCombinePriority.py old mode 100755 new mode 100644 similarity index 99% rename from AutomatedTesting/Gem/PythonTests/physics/C18977601_Material_FrictionCombinePriority.py rename to AutomatedTesting/Gem/PythonTests/physics/material/C18977601_Material_FrictionCombinePriority.py index 14103ad223..4cef743854 --- a/AutomatedTesting/Gem/PythonTests/physics/C18977601_Material_FrictionCombinePriority.py +++ b/AutomatedTesting/Gem/PythonTests/physics/material/C18977601_Material_FrictionCombinePriority.py @@ -126,12 +126,6 @@ def C18977601_Material_FrictionCombinePriority(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -357,8 +351,5 @@ def C18977601_Material_FrictionCombinePriority(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C18977601_Material_FrictionCombinePriority) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C18981526_Material_RestitutionCombinePriority.py b/AutomatedTesting/Gem/PythonTests/physics/material/C18981526_Material_RestitutionCombinePriority.py old mode 100755 new mode 100644 similarity index 99% rename from AutomatedTesting/Gem/PythonTests/physics/C18981526_Material_RestitutionCombinePriority.py rename to AutomatedTesting/Gem/PythonTests/physics/material/C18981526_Material_RestitutionCombinePriority.py index 696eb1115a..9663453df2 --- a/AutomatedTesting/Gem/PythonTests/physics/C18981526_Material_RestitutionCombinePriority.py +++ b/AutomatedTesting/Gem/PythonTests/physics/material/C18981526_Material_RestitutionCombinePriority.py @@ -126,11 +126,6 @@ def C18981526_Material_RestitutionCombinePriority(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -417,8 +412,5 @@ def C18981526_Material_RestitutionCombinePriority(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C18981526_Material_RestitutionCombinePriority) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4044455_Material_libraryChangesInstantly.py b/AutomatedTesting/Gem/PythonTests/physics/material/C4044455_Material_libraryChangesInstantly.py old mode 100755 new mode 100644 similarity index 99% rename from AutomatedTesting/Gem/PythonTests/physics/C4044455_Material_libraryChangesInstantly.py rename to AutomatedTesting/Gem/PythonTests/physics/material/C4044455_Material_libraryChangesInstantly.py index 8a84f5302f..8eb2e7e9a4 --- a/AutomatedTesting/Gem/PythonTests/physics/C4044455_Material_libraryChangesInstantly.py +++ b/AutomatedTesting/Gem/PythonTests/physics/material/C4044455_Material_libraryChangesInstantly.py @@ -173,11 +173,6 @@ def C4044455_Material_libraryChangesInstantly(): import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -478,8 +473,5 @@ def C4044455_Material_libraryChangesInstantly(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C4044455_Material_libraryChangesInstantly) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4044456_Material_FrictionCombine.py b/AutomatedTesting/Gem/PythonTests/physics/material/C4044456_Material_FrictionCombine.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C4044456_Material_FrictionCombine.py rename to AutomatedTesting/Gem/PythonTests/physics/material/C4044456_Material_FrictionCombine.py index 3048224d79..8c3b389264 --- a/AutomatedTesting/Gem/PythonTests/physics/C4044456_Material_FrictionCombine.py +++ b/AutomatedTesting/Gem/PythonTests/physics/material/C4044456_Material_FrictionCombine.py @@ -91,11 +91,6 @@ def C4044456_Material_FrictionCombine(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -213,8 +208,5 @@ def C4044456_Material_FrictionCombine(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C4044456_Material_FrictionCombine) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4044457_Material_RestitutionCombine.py b/AutomatedTesting/Gem/PythonTests/physics/material/C4044457_Material_RestitutionCombine.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C4044457_Material_RestitutionCombine.py rename to AutomatedTesting/Gem/PythonTests/physics/material/C4044457_Material_RestitutionCombine.py index 2ba038c928..a20c7e49f7 --- a/AutomatedTesting/Gem/PythonTests/physics/C4044457_Material_RestitutionCombine.py +++ b/AutomatedTesting/Gem/PythonTests/physics/material/C4044457_Material_RestitutionCombine.py @@ -96,11 +96,6 @@ def C4044457_Material_RestitutionCombine(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -245,8 +240,5 @@ def C4044457_Material_RestitutionCombine(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C4044457_Material_RestitutionCombine) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4044459_Material_DynamicFriction.py b/AutomatedTesting/Gem/PythonTests/physics/material/C4044459_Material_DynamicFriction.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C4044459_Material_DynamicFriction.py rename to AutomatedTesting/Gem/PythonTests/physics/material/C4044459_Material_DynamicFriction.py index 096a1bc742..cdf2816f17 --- a/AutomatedTesting/Gem/PythonTests/physics/C4044459_Material_DynamicFriction.py +++ b/AutomatedTesting/Gem/PythonTests/physics/material/C4044459_Material_DynamicFriction.py @@ -82,11 +82,6 @@ def C4044459_Material_DynamicFriction(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -191,8 +186,5 @@ def C4044459_Material_DynamicFriction(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C4044459_Material_DynamicFriction) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4044460_Material_StaticFriction.py b/AutomatedTesting/Gem/PythonTests/physics/material/C4044460_Material_StaticFriction.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C4044460_Material_StaticFriction.py rename to AutomatedTesting/Gem/PythonTests/physics/material/C4044460_Material_StaticFriction.py index 9730b28e73..5558f01222 --- a/AutomatedTesting/Gem/PythonTests/physics/C4044460_Material_StaticFriction.py +++ b/AutomatedTesting/Gem/PythonTests/physics/material/C4044460_Material_StaticFriction.py @@ -80,11 +80,6 @@ def C4044460_Material_StaticFriction(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -188,8 +183,5 @@ def C4044460_Material_StaticFriction(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C4044460_Material_StaticFriction) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4044461_Material_Restitution.py b/AutomatedTesting/Gem/PythonTests/physics/material/C4044461_Material_Restitution.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C4044461_Material_Restitution.py rename to AutomatedTesting/Gem/PythonTests/physics/material/C4044461_Material_Restitution.py index 9cb54331cb..b077af1593 --- a/AutomatedTesting/Gem/PythonTests/physics/C4044461_Material_Restitution.py +++ b/AutomatedTesting/Gem/PythonTests/physics/material/C4044461_Material_Restitution.py @@ -87,11 +87,6 @@ def C4044461_Material_Restitution(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -230,8 +225,5 @@ def C4044461_Material_Restitution(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C4044461_Material_Restitution) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4044694_Material_EmptyLibraryUsesDefault.py b/AutomatedTesting/Gem/PythonTests/physics/material/C4044694_Material_EmptyLibraryUsesDefault.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C4044694_Material_EmptyLibraryUsesDefault.py rename to AutomatedTesting/Gem/PythonTests/physics/material/C4044694_Material_EmptyLibraryUsesDefault.py index 4cf092d3bf..8cba90cba8 --- a/AutomatedTesting/Gem/PythonTests/physics/C4044694_Material_EmptyLibraryUsesDefault.py +++ b/AutomatedTesting/Gem/PythonTests/physics/material/C4044694_Material_EmptyLibraryUsesDefault.py @@ -66,11 +66,6 @@ def C4044694_Material_EmptyLibraryUsesDefault(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - import azlmbr.legacy.general as general import azlmbr.bus as bus import azlmbr.components @@ -189,8 +184,5 @@ def C4044694_Material_EmptyLibraryUsesDefault(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C4044694_Material_EmptyLibraryUsesDefault) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4044697_Material_PerfaceMaterialValidation.py b/AutomatedTesting/Gem/PythonTests/physics/material/C4044697_Material_PerfaceMaterialValidation.py old mode 100755 new mode 100644 similarity index 99% rename from AutomatedTesting/Gem/PythonTests/physics/C4044697_Material_PerfaceMaterialValidation.py rename to AutomatedTesting/Gem/PythonTests/physics/material/C4044697_Material_PerfaceMaterialValidation.py index e365a799aa..9ee8d404d7 --- a/AutomatedTesting/Gem/PythonTests/physics/C4044697_Material_PerfaceMaterialValidation.py +++ b/AutomatedTesting/Gem/PythonTests/physics/material/C4044697_Material_PerfaceMaterialValidation.py @@ -107,11 +107,6 @@ def C4044697_Material_PerfaceMaterialValidation(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -302,8 +297,5 @@ def C4044697_Material_PerfaceMaterialValidation(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C4044697_Material_PerfaceMaterialValidation) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4888315_Material_AddModifyDeleteOnCollider.py b/AutomatedTesting/Gem/PythonTests/physics/material/C4888315_Material_AddModifyDeleteOnCollider.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C4888315_Material_AddModifyDeleteOnCollider.py rename to AutomatedTesting/Gem/PythonTests/physics/material/C4888315_Material_AddModifyDeleteOnCollider.py index d66cf17b5f..61c378d287 --- a/AutomatedTesting/Gem/PythonTests/physics/C4888315_Material_AddModifyDeleteOnCollider.py +++ b/AutomatedTesting/Gem/PythonTests/physics/material/C4888315_Material_AddModifyDeleteOnCollider.py @@ -90,11 +90,6 @@ def C4888315_Material_AddModifyDeleteOnCollider(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - import azlmbr.legacy.general as general import azlmbr.math as lymath @@ -176,8 +171,5 @@ def C4888315_Material_AddModifyDeleteOnCollider(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C4888315_Material_AddModifyDeleteOnCollider) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4925577_Materials_MaterialAssignedToTerrain.py b/AutomatedTesting/Gem/PythonTests/physics/material/C4925577_Materials_MaterialAssignedToTerrain.py old mode 100755 new mode 100644 similarity index 99% rename from AutomatedTesting/Gem/PythonTests/physics/C4925577_Materials_MaterialAssignedToTerrain.py rename to AutomatedTesting/Gem/PythonTests/physics/material/C4925577_Materials_MaterialAssignedToTerrain.py index feafce07d5..219e12fdb2 --- a/AutomatedTesting/Gem/PythonTests/physics/C4925577_Materials_MaterialAssignedToTerrain.py +++ b/AutomatedTesting/Gem/PythonTests/physics/material/C4925577_Materials_MaterialAssignedToTerrain.py @@ -76,11 +76,6 @@ def C4925577_Materials_MaterialAssignedToTerrain(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -305,8 +300,5 @@ def C4925577_Materials_MaterialAssignedToTerrain(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C4925577_Materials_MaterialAssignedToTerrain) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4925579_Material_AddModifyDeleteOnTerrain.py b/AutomatedTesting/Gem/PythonTests/physics/material/C4925579_Material_AddModifyDeleteOnTerrain.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C4925579_Material_AddModifyDeleteOnTerrain.py rename to AutomatedTesting/Gem/PythonTests/physics/material/C4925579_Material_AddModifyDeleteOnTerrain.py index db2093047e..8b3d72a932 --- a/AutomatedTesting/Gem/PythonTests/physics/C4925579_Material_AddModifyDeleteOnTerrain.py +++ b/AutomatedTesting/Gem/PythonTests/physics/material/C4925579_Material_AddModifyDeleteOnTerrain.py @@ -91,11 +91,6 @@ def C4925579_Material_AddModifyDeleteOnTerrain(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - import azlmbr.legacy.general as general import azlmbr.math as lymath @@ -176,8 +171,5 @@ def C4925579_Material_AddModifyDeleteOnTerrain(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C4925579_Material_AddModifyDeleteOnTerrain) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4925580_Material_RagdollBonesMaterial.py b/AutomatedTesting/Gem/PythonTests/physics/material/C4925580_Material_RagdollBonesMaterial.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C4925580_Material_RagdollBonesMaterial.py rename to AutomatedTesting/Gem/PythonTests/physics/material/C4925580_Material_RagdollBonesMaterial.py index 203db0bd39..96316b1cdf --- a/AutomatedTesting/Gem/PythonTests/physics/C4925580_Material_RagdollBonesMaterial.py +++ b/AutomatedTesting/Gem/PythonTests/physics/material/C4925580_Material_RagdollBonesMaterial.py @@ -66,11 +66,6 @@ def C4925580_Material_RagdollBonesMaterial(): # Setup path import os import sys - - import ImportPathHelper as imports - - imports.init() - import azlmbr.legacy.general as general import azlmbr.bus import azlmbr.components @@ -194,8 +189,5 @@ def C4925580_Material_RagdollBonesMaterial(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C4925580_Material_RagdollBonesMaterial) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4925582_Material_AddModifyDeleteOnRagdollBones.py b/AutomatedTesting/Gem/PythonTests/physics/material/C4925582_Material_AddModifyDeleteOnRagdollBones.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C4925582_Material_AddModifyDeleteOnRagdollBones.py rename to AutomatedTesting/Gem/PythonTests/physics/material/C4925582_Material_AddModifyDeleteOnRagdollBones.py index acdfb98411..0abfae08f9 --- a/AutomatedTesting/Gem/PythonTests/physics/C4925582_Material_AddModifyDeleteOnRagdollBones.py +++ b/AutomatedTesting/Gem/PythonTests/physics/material/C4925582_Material_AddModifyDeleteOnRagdollBones.py @@ -92,11 +92,6 @@ def C4925582_Material_AddModifyDeleteOnRagdollBones(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - import azlmbr.legacy.general as general import azlmbr.bus as bus import azlmbr.components @@ -212,8 +207,5 @@ def C4925582_Material_AddModifyDeleteOnRagdollBones(): Report.info("Modified max bouce: " + str(modified_ragdoll.bounces[0])) if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C4925582_Material_AddModifyDeleteOnRagdollBones) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5296614_PhysXMaterial_ColliderShape.py b/AutomatedTesting/Gem/PythonTests/physics/material/C5296614_PhysXMaterial_ColliderShape.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C5296614_PhysXMaterial_ColliderShape.py rename to AutomatedTesting/Gem/PythonTests/physics/material/C5296614_PhysXMaterial_ColliderShape.py index 82275d1b0d..de7ed4db9b --- a/AutomatedTesting/Gem/PythonTests/physics/C5296614_PhysXMaterial_ColliderShape.py +++ b/AutomatedTesting/Gem/PythonTests/physics/material/C5296614_PhysXMaterial_ColliderShape.py @@ -60,11 +60,6 @@ def C5296614_PhysXMaterial_ColliderShape(): import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper import azlmbr.legacy.general as general @@ -152,8 +147,5 @@ def C5296614_PhysXMaterial_ColliderShape(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C5296614_PhysXMaterial_ColliderShape) diff --git a/AutomatedTesting/Gem/PythonTests/physics/Physmaterial_Editor.py b/AutomatedTesting/Gem/PythonTests/physics/material/Physmaterial_Editor.py old mode 100755 new mode 100644 similarity index 100% rename from AutomatedTesting/Gem/PythonTests/physics/Physmaterial_Editor.py rename to AutomatedTesting/Gem/PythonTests/physics/material/Physmaterial_Editor.py diff --git a/AutomatedTesting/Gem/PythonTests/physics/C13895144_Ragdoll_ChangeLevel.py b/AutomatedTesting/Gem/PythonTests/physics/ragdoll/C13895144_Ragdoll_ChangeLevel.py old mode 100755 new mode 100644 similarity index 96% rename from AutomatedTesting/Gem/PythonTests/physics/C13895144_Ragdoll_ChangeLevel.py rename to AutomatedTesting/Gem/PythonTests/physics/ragdoll/C13895144_Ragdoll_ChangeLevel.py index 28baa2bcf3..c7ff00a7e3 --- a/AutomatedTesting/Gem/PythonTests/physics/C13895144_Ragdoll_ChangeLevel.py +++ b/AutomatedTesting/Gem/PythonTests/physics/ragdoll/C13895144_Ragdoll_ChangeLevel.py @@ -58,11 +58,6 @@ def C13895144_Ragdoll_ChangeLevel(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -104,8 +99,5 @@ def C13895144_Ragdoll_ChangeLevel(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C13895144_Ragdoll_ChangeLevel) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C14654882_Ragdoll_ragdollAPTest.py b/AutomatedTesting/Gem/PythonTests/physics/ragdoll/C14654882_Ragdoll_ragdollAPTest.py old mode 100755 new mode 100644 similarity index 97% rename from AutomatedTesting/Gem/PythonTests/physics/C14654882_Ragdoll_ragdollAPTest.py rename to AutomatedTesting/Gem/PythonTests/physics/ragdoll/C14654882_Ragdoll_ragdollAPTest.py index 024126ef55..56784b0c72 --- a/AutomatedTesting/Gem/PythonTests/physics/C14654882_Ragdoll_ragdollAPTest.py +++ b/AutomatedTesting/Gem/PythonTests/physics/ragdoll/C14654882_Ragdoll_ragdollAPTest.py @@ -69,11 +69,6 @@ def C14654882_Ragdoll_ragdollAPTest(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -129,8 +124,5 @@ def C14654882_Ragdoll_ragdollAPTest(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C14654882_Ragdoll_ragdollAPTest) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C17411467_AddPhysxRagdollComponent.py b/AutomatedTesting/Gem/PythonTests/physics/ragdoll/C17411467_AddPhysxRagdollComponent.py old mode 100755 new mode 100644 similarity index 96% rename from AutomatedTesting/Gem/PythonTests/physics/C17411467_AddPhysxRagdollComponent.py rename to AutomatedTesting/Gem/PythonTests/physics/ragdoll/C17411467_AddPhysxRagdollComponent.py index ea58f84dad..9c02239d73 --- a/AutomatedTesting/Gem/PythonTests/physics/C17411467_AddPhysxRagdollComponent.py +++ b/AutomatedTesting/Gem/PythonTests/physics/ragdoll/C17411467_AddPhysxRagdollComponent.py @@ -9,7 +9,6 @@ Test Case Title : Check that Physx Ragdoll component can be added without errors """ - # fmt: off class Tests(): create_test_entity = ("Entity created successfully", "Failed to create Entity") @@ -45,10 +44,6 @@ def C17411467_AddPhysxRagdollComponent(): :return: None """ - # Helper file Imports - import ImportPathHelper as imports - - imports.init() from editor_python_test_tools.utils import Report from editor_python_test_tools.editor_entity_utils import EditorEntity from editor_python_test_tools.utils import TestHelper as helper @@ -93,8 +88,5 @@ def C17411467_AddPhysxRagdollComponent(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C17411467_AddPhysxRagdollComponent) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C28978033_Ragdoll_WorldBodyBusTests.py b/AutomatedTesting/Gem/PythonTests/physics/ragdoll/C28978033_Ragdoll_WorldBodyBusTests.py old mode 100755 new mode 100644 similarity index 97% rename from AutomatedTesting/Gem/PythonTests/physics/C28978033_Ragdoll_WorldBodyBusTests.py rename to AutomatedTesting/Gem/PythonTests/physics/ragdoll/C28978033_Ragdoll_WorldBodyBusTests.py index b22bcf5a36..d917449daf --- a/AutomatedTesting/Gem/PythonTests/physics/C28978033_Ragdoll_WorldBodyBusTests.py +++ b/AutomatedTesting/Gem/PythonTests/physics/ragdoll/C28978033_Ragdoll_WorldBodyBusTests.py @@ -45,11 +45,6 @@ def C28978033_Ragdoll_WorldBodyBusTests(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - import azlmbr.legacy.general as general import azlmbr.bus from editor_python_test_tools.utils import Report @@ -116,8 +111,5 @@ def C28978033_Ragdoll_WorldBodyBusTests(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C28978033_Ragdoll_WorldBodyBusTests) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C13351703_COM_NotIncludeTriggerShapes.py b/AutomatedTesting/Gem/PythonTests/physics/rigid_body/C13351703_COM_NotIncludeTriggerShapes.py old mode 100755 new mode 100644 similarity index 96% rename from AutomatedTesting/Gem/PythonTests/physics/C13351703_COM_NotIncludeTriggerShapes.py rename to AutomatedTesting/Gem/PythonTests/physics/rigid_body/C13351703_COM_NotIncludeTriggerShapes.py index a9e7727890..56f44503ae --- a/AutomatedTesting/Gem/PythonTests/physics/C13351703_COM_NotIncludeTriggerShapes.py +++ b/AutomatedTesting/Gem/PythonTests/physics/rigid_body/C13351703_COM_NotIncludeTriggerShapes.py @@ -55,11 +55,6 @@ def C13351703_COM_NotIncludeTriggerShapes(): import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -93,8 +88,5 @@ def C13351703_COM_NotIncludeTriggerShapes(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C13351703_COM_NotIncludeTriggerShapes) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C13352089_RigidBodies_MaxAngularVelocity.py b/AutomatedTesting/Gem/PythonTests/physics/rigid_body/C13352089_RigidBodies_MaxAngularVelocity.py old mode 100755 new mode 100644 similarity index 99% rename from AutomatedTesting/Gem/PythonTests/physics/C13352089_RigidBodies_MaxAngularVelocity.py rename to AutomatedTesting/Gem/PythonTests/physics/rigid_body/C13352089_RigidBodies_MaxAngularVelocity.py index 2342545a87..41635ecc47 --- a/AutomatedTesting/Gem/PythonTests/physics/C13352089_RigidBodies_MaxAngularVelocity.py +++ b/AutomatedTesting/Gem/PythonTests/physics/rigid_body/C13352089_RigidBodies_MaxAngularVelocity.py @@ -123,9 +123,7 @@ def C13352089_RigidBodies_MaxAngularVelocity(): import math import time - import ImportPathHelper as imports - imports.init() from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -281,8 +279,5 @@ def C13352089_RigidBodies_MaxAngularVelocity(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C13352089_RigidBodies_MaxAngularVelocity) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976194_RigidBody_PhysXComponentIsValid.py b/AutomatedTesting/Gem/PythonTests/physics/rigid_body/C4976194_RigidBody_PhysXComponentIsValid.py old mode 100755 new mode 100644 similarity index 97% rename from AutomatedTesting/Gem/PythonTests/physics/C4976194_RigidBody_PhysXComponentIsValid.py rename to AutomatedTesting/Gem/PythonTests/physics/rigid_body/C4976194_RigidBody_PhysXComponentIsValid.py index 79c3e06814..b0b69d6d91 --- a/AutomatedTesting/Gem/PythonTests/physics/C4976194_RigidBody_PhysXComponentIsValid.py +++ b/AutomatedTesting/Gem/PythonTests/physics/rigid_body/C4976194_RigidBody_PhysXComponentIsValid.py @@ -54,9 +54,7 @@ def C4976194_RigidBody_PhysXComponentIsValid(): import os, sys - import ImportPathHelper as imports - imports.init() from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -110,8 +108,5 @@ def C4976194_RigidBody_PhysXComponentIsValid(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C4976194_RigidBody_PhysXComponentIsValid) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976195_RigidBodies_InitialLinearVelocity.py b/AutomatedTesting/Gem/PythonTests/physics/rigid_body/C4976195_RigidBodies_InitialLinearVelocity.py old mode 100755 new mode 100644 similarity index 97% rename from AutomatedTesting/Gem/PythonTests/physics/C4976195_RigidBodies_InitialLinearVelocity.py rename to AutomatedTesting/Gem/PythonTests/physics/rigid_body/C4976195_RigidBodies_InitialLinearVelocity.py index 6bddae76f4..f13a7232fa --- a/AutomatedTesting/Gem/PythonTests/physics/C4976195_RigidBodies_InitialLinearVelocity.py +++ b/AutomatedTesting/Gem/PythonTests/physics/rigid_body/C4976195_RigidBodies_InitialLinearVelocity.py @@ -58,11 +58,6 @@ def C4976195_RigidBodies_InitialLinearVelocity(): import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -132,8 +127,5 @@ def C4976195_RigidBodies_InitialLinearVelocity(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C4976195_RigidBodies_InitialLinearVelocity) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976197_RigidBodies_InitialAngularVelocity.py b/AutomatedTesting/Gem/PythonTests/physics/rigid_body/C4976197_RigidBodies_InitialAngularVelocity.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C4976197_RigidBodies_InitialAngularVelocity.py rename to AutomatedTesting/Gem/PythonTests/physics/rigid_body/C4976197_RigidBodies_InitialAngularVelocity.py index 73c1e88f79..7f400051ec --- a/AutomatedTesting/Gem/PythonTests/physics/C4976197_RigidBodies_InitialAngularVelocity.py +++ b/AutomatedTesting/Gem/PythonTests/physics/rigid_body/C4976197_RigidBodies_InitialAngularVelocity.py @@ -72,9 +72,7 @@ def C4976197_RigidBodies_InitialAngularVelocity(): import sys import math - import ImportPathHelper as imports - imports.init() from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -177,8 +175,5 @@ def C4976197_RigidBodies_InitialAngularVelocity(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C4976197_RigidBodies_InitialAngularVelocity) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976199_RigidBodies_LinearDampingObjectMotion.py b/AutomatedTesting/Gem/PythonTests/physics/rigid_body/C4976199_RigidBodies_LinearDampingObjectMotion.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C4976199_RigidBodies_LinearDampingObjectMotion.py rename to AutomatedTesting/Gem/PythonTests/physics/rigid_body/C4976199_RigidBodies_LinearDampingObjectMotion.py index 08b212d1e7..502478f13c --- a/AutomatedTesting/Gem/PythonTests/physics/C4976199_RigidBodies_LinearDampingObjectMotion.py +++ b/AutomatedTesting/Gem/PythonTests/physics/rigid_body/C4976199_RigidBodies_LinearDampingObjectMotion.py @@ -56,11 +56,6 @@ def C4976199_RigidBodies_LinearDampingObjectMotion(): # Setup path import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -270,8 +265,5 @@ def C4976199_RigidBodies_LinearDampingObjectMotion(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C4976199_RigidBodies_LinearDampingObjectMotion) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976200_RigidBody_AngularDampingObjectRotation.py b/AutomatedTesting/Gem/PythonTests/physics/rigid_body/C4976200_RigidBody_AngularDampingObjectRotation.py old mode 100755 new mode 100644 similarity index 99% rename from AutomatedTesting/Gem/PythonTests/physics/C4976200_RigidBody_AngularDampingObjectRotation.py rename to AutomatedTesting/Gem/PythonTests/physics/rigid_body/C4976200_RigidBody_AngularDampingObjectRotation.py index b889276554..77dfe4c483 --- a/AutomatedTesting/Gem/PythonTests/physics/C4976200_RigidBody_AngularDampingObjectRotation.py +++ b/AutomatedTesting/Gem/PythonTests/physics/rigid_body/C4976200_RigidBody_AngularDampingObjectRotation.py @@ -61,9 +61,7 @@ def C4976200_RigidBody_AngularDampingObjectRotation(): import sys import math - import ImportPathHelper as imports - imports.init() from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -285,8 +283,5 @@ def C4976200_RigidBody_AngularDampingObjectRotation(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C4976200_RigidBody_AngularDampingObjectRotation) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976201_RigidBody_MassIsAssigned.py b/AutomatedTesting/Gem/PythonTests/physics/rigid_body/C4976201_RigidBody_MassIsAssigned.py old mode 100755 new mode 100644 similarity index 99% rename from AutomatedTesting/Gem/PythonTests/physics/C4976201_RigidBody_MassIsAssigned.py rename to AutomatedTesting/Gem/PythonTests/physics/rigid_body/C4976201_RigidBody_MassIsAssigned.py index 17fd0827c1..54f589da1e --- a/AutomatedTesting/Gem/PythonTests/physics/C4976201_RigidBody_MassIsAssigned.py +++ b/AutomatedTesting/Gem/PythonTests/physics/rigid_body/C4976201_RigidBody_MassIsAssigned.py @@ -101,11 +101,6 @@ def C4976201_RigidBody_MassIsAssigned(): import os import sys - - import ImportPathHelper as imports - - imports.init() - import azlmbr.legacy.general as general import azlmbr.bus import azlmbr @@ -373,8 +368,5 @@ def C4976201_RigidBody_MassIsAssigned(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C4976201_RigidBody_MassIsAssigned) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976202_RigidBody_StopsWhenBelowKineticThreshold.py b/AutomatedTesting/Gem/PythonTests/physics/rigid_body/C4976202_RigidBody_StopsWhenBelowKineticThreshold.py old mode 100755 new mode 100644 similarity index 99% rename from AutomatedTesting/Gem/PythonTests/physics/C4976202_RigidBody_StopsWhenBelowKineticThreshold.py rename to AutomatedTesting/Gem/PythonTests/physics/rigid_body/C4976202_RigidBody_StopsWhenBelowKineticThreshold.py index 53415bf43a..655c33304d --- a/AutomatedTesting/Gem/PythonTests/physics/C4976202_RigidBody_StopsWhenBelowKineticThreshold.py +++ b/AutomatedTesting/Gem/PythonTests/physics/rigid_body/C4976202_RigidBody_StopsWhenBelowKineticThreshold.py @@ -124,11 +124,6 @@ def C4976202_RigidBody_StopsWhenBelowKineticThreshold(): import os import sys - - import ImportPathHelper as imports - - imports.init() - import azlmbr.legacy.general as general import azlmbr.bus @@ -326,8 +321,5 @@ def C4976202_RigidBody_StopsWhenBelowKineticThreshold(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C4976202_RigidBody_StopsWhenBelowKineticThreshold) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976204_Verify_Start_Asleep_Condition.py b/AutomatedTesting/Gem/PythonTests/physics/rigid_body/C4976204_Verify_Start_Asleep_Condition.py old mode 100755 new mode 100644 similarity index 97% rename from AutomatedTesting/Gem/PythonTests/physics/C4976204_Verify_Start_Asleep_Condition.py rename to AutomatedTesting/Gem/PythonTests/physics/rigid_body/C4976204_Verify_Start_Asleep_Condition.py index 6c21912d11..ff3111aa55 --- a/AutomatedTesting/Gem/PythonTests/physics/C4976204_Verify_Start_Asleep_Condition.py +++ b/AutomatedTesting/Gem/PythonTests/physics/rigid_body/C4976204_Verify_Start_Asleep_Condition.py @@ -62,11 +62,6 @@ def C4976204_Verify_Start_Asleep_Condition(): import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -112,8 +107,5 @@ def C4976204_Verify_Start_Asleep_Condition(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C4976204_Verify_Start_Asleep_Condition) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976206_RigidBodies_GravityEnabledActive.py b/AutomatedTesting/Gem/PythonTests/physics/rigid_body/C4976206_RigidBodies_GravityEnabledActive.py old mode 100755 new mode 100644 similarity index 97% rename from AutomatedTesting/Gem/PythonTests/physics/C4976206_RigidBodies_GravityEnabledActive.py rename to AutomatedTesting/Gem/PythonTests/physics/rigid_body/C4976206_RigidBodies_GravityEnabledActive.py index 96c62f26ea..e6b50eb2bf --- a/AutomatedTesting/Gem/PythonTests/physics/C4976206_RigidBodies_GravityEnabledActive.py +++ b/AutomatedTesting/Gem/PythonTests/physics/rigid_body/C4976206_RigidBodies_GravityEnabledActive.py @@ -64,11 +64,6 @@ def C4976206_RigidBodies_GravityEnabledActive(): import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -145,8 +140,5 @@ def C4976206_RigidBodies_GravityEnabledActive(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C4976206_RigidBodies_GravityEnabledActive) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976207_PhysXRigidBodies_KinematicBehavior.py b/AutomatedTesting/Gem/PythonTests/physics/rigid_body/C4976207_PhysXRigidBodies_KinematicBehavior.py old mode 100755 new mode 100644 similarity index 97% rename from AutomatedTesting/Gem/PythonTests/physics/C4976207_PhysXRigidBodies_KinematicBehavior.py rename to AutomatedTesting/Gem/PythonTests/physics/rigid_body/C4976207_PhysXRigidBodies_KinematicBehavior.py index 81bed2bbde..65814bd438 --- a/AutomatedTesting/Gem/PythonTests/physics/C4976207_PhysXRigidBodies_KinematicBehavior.py +++ b/AutomatedTesting/Gem/PythonTests/physics/rigid_body/C4976207_PhysXRigidBodies_KinematicBehavior.py @@ -59,11 +59,6 @@ def C4976207_PhysXRigidBodies_KinematicBehavior(): # Setup path import os import sys - import ImportPathHelper as imports - - imports.init() - - import azlmbr.legacy.general as general import azlmbr.bus from editor_python_test_tools.utils import Report @@ -132,8 +127,5 @@ def C4976207_PhysXRigidBodies_KinematicBehavior(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C4976207_PhysXRigidBodies_KinematicBehavior) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976209_RigidBody_ComputesCOM.py b/AutomatedTesting/Gem/PythonTests/physics/rigid_body/C4976209_RigidBody_ComputesCOM.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C4976209_RigidBody_ComputesCOM.py rename to AutomatedTesting/Gem/PythonTests/physics/rigid_body/C4976209_RigidBody_ComputesCOM.py index f3f57b2b65..27d4ea1356 --- a/AutomatedTesting/Gem/PythonTests/physics/C4976209_RigidBody_ComputesCOM.py +++ b/AutomatedTesting/Gem/PythonTests/physics/rigid_body/C4976209_RigidBody_ComputesCOM.py @@ -86,11 +86,6 @@ def C4976209_RigidBody_ComputesCOM(): # Setup path import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -173,8 +168,5 @@ def C4976209_RigidBody_ComputesCOM(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C4976209_RigidBody_ComputesCOM) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976210_COM_ManualSetting.py b/AutomatedTesting/Gem/PythonTests/physics/rigid_body/C4976210_COM_ManualSetting.py old mode 100755 new mode 100644 similarity index 99% rename from AutomatedTesting/Gem/PythonTests/physics/C4976210_COM_ManualSetting.py rename to AutomatedTesting/Gem/PythonTests/physics/rigid_body/C4976210_COM_ManualSetting.py index 9373f20850..cbbefb5a0e --- a/AutomatedTesting/Gem/PythonTests/physics/C4976210_COM_ManualSetting.py +++ b/AutomatedTesting/Gem/PythonTests/physics/rigid_body/C4976210_COM_ManualSetting.py @@ -69,9 +69,7 @@ def C4976210_COM_ManualSetting(): """ # internal editor imports - import ImportPathHelper as imports - imports.init() from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -298,8 +296,5 @@ def C4976210_COM_ManualSetting(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C4976210_COM_ManualSetting) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976218_RigidBodies_InertiaObjectsNotComputed.py b/AutomatedTesting/Gem/PythonTests/physics/rigid_body/C4976218_RigidBodies_InertiaObjectsNotComputed.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C4976218_RigidBodies_InertiaObjectsNotComputed.py rename to AutomatedTesting/Gem/PythonTests/physics/rigid_body/C4976218_RigidBodies_InertiaObjectsNotComputed.py index ef19a00042..eb87fd0c68 --- a/AutomatedTesting/Gem/PythonTests/physics/C4976218_RigidBodies_InertiaObjectsNotComputed.py +++ b/AutomatedTesting/Gem/PythonTests/physics/rigid_body/C4976218_RigidBodies_InertiaObjectsNotComputed.py @@ -39,11 +39,6 @@ def C4976218_RigidBodies_InertiaObjectsNotComputed(): # Setup path import os import sys - - import ImportPathHelper as imports - - imports.init() - import azlmbr.legacy.general as general import azlmbr.bus as bus import azlmbr.components @@ -161,8 +156,5 @@ def C4976218_RigidBodies_InertiaObjectsNotComputed(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C4976218_RigidBodies_InertiaObjectsNotComputed) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5340400_RigidBody_ManualMomentOfInertia.py b/AutomatedTesting/Gem/PythonTests/physics/rigid_body/C5340400_RigidBody_ManualMomentOfInertia.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C5340400_RigidBody_ManualMomentOfInertia.py rename to AutomatedTesting/Gem/PythonTests/physics/rigid_body/C5340400_RigidBody_ManualMomentOfInertia.py index 7daf9d3dc8..92d3945391 --- a/AutomatedTesting/Gem/PythonTests/physics/C5340400_RigidBody_ManualMomentOfInertia.py +++ b/AutomatedTesting/Gem/PythonTests/physics/rigid_body/C5340400_RigidBody_ManualMomentOfInertia.py @@ -67,11 +67,6 @@ def C5340400_RigidBody_ManualMomentOfInertia(): # Setup path import os import sys - - import ImportPathHelper as imports - - imports.init() - import azlmbr.legacy.general as general import azlmbr.bus from editor_python_test_tools.utils import Report @@ -160,8 +155,5 @@ def C5340400_RigidBody_ManualMomentOfInertia(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C5340400_RigidBody_ManualMomentOfInertia) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C12712452_ScriptCanvas_CollisionEvents.py b/AutomatedTesting/Gem/PythonTests/physics/script_canvas/C12712452_ScriptCanvas_CollisionEvents.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C12712452_ScriptCanvas_CollisionEvents.py rename to AutomatedTesting/Gem/PythonTests/physics/script_canvas/C12712452_ScriptCanvas_CollisionEvents.py index 3d3011ef26..6806d5acc8 --- a/AutomatedTesting/Gem/PythonTests/physics/C12712452_ScriptCanvas_CollisionEvents.py +++ b/AutomatedTesting/Gem/PythonTests/physics/script_canvas/C12712452_ScriptCanvas_CollisionEvents.py @@ -67,11 +67,6 @@ def C12712452_ScriptCanvas_CollisionEvents(): # Setup path import os import sys - - import ImportPathHelper as imports - - imports.init() - import azlmbr.legacy.general as general import azlmbr.bus import azlmbr.components @@ -201,8 +196,5 @@ def C12712452_ScriptCanvas_CollisionEvents(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C12712452_ScriptCanvas_CollisionEvents) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C12712453_ScriptCanvas_MultipleRaycastNode.py b/AutomatedTesting/Gem/PythonTests/physics/script_canvas/C12712453_ScriptCanvas_MultipleRaycastNode.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C12712453_ScriptCanvas_MultipleRaycastNode.py rename to AutomatedTesting/Gem/PythonTests/physics/script_canvas/C12712453_ScriptCanvas_MultipleRaycastNode.py index 2e4c0a3fe2..edbbde4c94 --- a/AutomatedTesting/Gem/PythonTests/physics/C12712453_ScriptCanvas_MultipleRaycastNode.py +++ b/AutomatedTesting/Gem/PythonTests/physics/script_canvas/C12712453_ScriptCanvas_MultipleRaycastNode.py @@ -75,11 +75,6 @@ def C12712453_ScriptCanvas_MultipleRaycastNode(): import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -199,8 +194,5 @@ def C12712453_ScriptCanvas_MultipleRaycastNode(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C12712453_ScriptCanvas_MultipleRaycastNode) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C12712454_ScriptCanvas_OverlapNodeVerification.py b/AutomatedTesting/Gem/PythonTests/physics/script_canvas/C12712454_ScriptCanvas_OverlapNodeVerification.py old mode 100755 new mode 100644 similarity index 99% rename from AutomatedTesting/Gem/PythonTests/physics/C12712454_ScriptCanvas_OverlapNodeVerification.py rename to AutomatedTesting/Gem/PythonTests/physics/script_canvas/C12712454_ScriptCanvas_OverlapNodeVerification.py index f741f0d019..5829e5850c --- a/AutomatedTesting/Gem/PythonTests/physics/C12712454_ScriptCanvas_OverlapNodeVerification.py +++ b/AutomatedTesting/Gem/PythonTests/physics/script_canvas/C12712454_ScriptCanvas_OverlapNodeVerification.py @@ -97,11 +97,6 @@ def C12712454_ScriptCanvas_OverlapNodeVerification(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -320,8 +315,5 @@ def C12712454_ScriptCanvas_OverlapNodeVerification(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C12712454_ScriptCanvas_OverlapNodeVerification) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C12712455_ScriptCanvas_ShapeCastVerification.py b/AutomatedTesting/Gem/PythonTests/physics/script_canvas/C12712455_ScriptCanvas_ShapeCastVerification.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C12712455_ScriptCanvas_ShapeCastVerification.py rename to AutomatedTesting/Gem/PythonTests/physics/script_canvas/C12712455_ScriptCanvas_ShapeCastVerification.py index 581c6033e9..8ce59d2b29 --- a/AutomatedTesting/Gem/PythonTests/physics/C12712455_ScriptCanvas_ShapeCastVerification.py +++ b/AutomatedTesting/Gem/PythonTests/physics/script_canvas/C12712455_ScriptCanvas_ShapeCastVerification.py @@ -67,11 +67,6 @@ def C12712455_ScriptCanvas_ShapeCastVerification(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -137,8 +132,5 @@ def C12712455_ScriptCanvas_ShapeCastVerification(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C12712455_ScriptCanvas_ShapeCastVerification) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C14195074_ScriptCanvas_PostUpdateEvent.py b/AutomatedTesting/Gem/PythonTests/physics/script_canvas/C14195074_ScriptCanvas_PostUpdateEvent.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C14195074_ScriptCanvas_PostUpdateEvent.py rename to AutomatedTesting/Gem/PythonTests/physics/script_canvas/C14195074_ScriptCanvas_PostUpdateEvent.py index 08adccfc60..2c833ba5f3 --- a/AutomatedTesting/Gem/PythonTests/physics/C14195074_ScriptCanvas_PostUpdateEvent.py +++ b/AutomatedTesting/Gem/PythonTests/physics/script_canvas/C14195074_ScriptCanvas_PostUpdateEvent.py @@ -61,11 +61,6 @@ def C14195074_ScriptCanvas_PostUpdateEvent(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -182,8 +177,5 @@ def C14195074_ScriptCanvas_PostUpdateEvent(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C14195074_ScriptCanvas_PostUpdateEvent) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C14902097_ScriptCanvas_PreUpdateEvent.py b/AutomatedTesting/Gem/PythonTests/physics/script_canvas/C14902097_ScriptCanvas_PreUpdateEvent.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C14902097_ScriptCanvas_PreUpdateEvent.py rename to AutomatedTesting/Gem/PythonTests/physics/script_canvas/C14902097_ScriptCanvas_PreUpdateEvent.py index 2a2ce3aaf6..4d48ce34a6 --- a/AutomatedTesting/Gem/PythonTests/physics/C14902097_ScriptCanvas_PreUpdateEvent.py +++ b/AutomatedTesting/Gem/PythonTests/physics/script_canvas/C14902097_ScriptCanvas_PreUpdateEvent.py @@ -64,9 +64,7 @@ def C14902097_ScriptCanvas_PreUpdateEvent(): import os import sys - import ImportPathHelper as imports - imports.init() from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -189,8 +187,5 @@ def C14902097_ScriptCanvas_PreUpdateEvent(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C14902097_ScriptCanvas_PreUpdateEvent) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C14902098_ScriptCanvas_PostPhysicsUpdate.py b/AutomatedTesting/Gem/PythonTests/physics/script_canvas/C14902098_ScriptCanvas_PostPhysicsUpdate.py old mode 100755 new mode 100644 similarity index 97% rename from AutomatedTesting/Gem/PythonTests/physics/C14902098_ScriptCanvas_PostPhysicsUpdate.py rename to AutomatedTesting/Gem/PythonTests/physics/script_canvas/C14902098_ScriptCanvas_PostPhysicsUpdate.py index b977b9ae10..5cb0b1431e --- a/AutomatedTesting/Gem/PythonTests/physics/C14902098_ScriptCanvas_PostPhysicsUpdate.py +++ b/AutomatedTesting/Gem/PythonTests/physics/script_canvas/C14902098_ScriptCanvas_PostPhysicsUpdate.py @@ -75,11 +75,6 @@ def C14902098_ScriptCanvas_PostPhysicsUpdate(): import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -110,8 +105,5 @@ def C14902098_ScriptCanvas_PostPhysicsUpdate(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C14902098_ScriptCanvas_PostPhysicsUpdate) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C14976308_ScriptCanvas_SetKinematicTargetTransform.py b/AutomatedTesting/Gem/PythonTests/physics/script_canvas/C14976308_ScriptCanvas_SetKinematicTargetTransform.py old mode 100755 new mode 100644 similarity index 99% rename from AutomatedTesting/Gem/PythonTests/physics/C14976308_ScriptCanvas_SetKinematicTargetTransform.py rename to AutomatedTesting/Gem/PythonTests/physics/script_canvas/C14976308_ScriptCanvas_SetKinematicTargetTransform.py index 2827ba5f16..9e8331f369 --- a/AutomatedTesting/Gem/PythonTests/physics/C14976308_ScriptCanvas_SetKinematicTargetTransform.py +++ b/AutomatedTesting/Gem/PythonTests/physics/script_canvas/C14976308_ScriptCanvas_SetKinematicTargetTransform.py @@ -91,11 +91,6 @@ def C14976308_ScriptCanvas_SetKinematicTargetTransform(): # Setup path import os import sys - - import ImportPathHelper as imports - - imports.init() - import azlmbr.legacy.general as general import azlmbr.bus import azlmbr.components @@ -220,8 +215,5 @@ def C14976308_ScriptCanvas_SetKinematicTargetTransform(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C14976308_ScriptCanvas_SetKinematicTargetTransform) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C6224408_ScriptCanvas_EntitySpawn.py b/AutomatedTesting/Gem/PythonTests/physics/script_canvas/C6224408_ScriptCanvas_EntitySpawn.py old mode 100755 new mode 100644 similarity index 97% rename from AutomatedTesting/Gem/PythonTests/physics/C6224408_ScriptCanvas_EntitySpawn.py rename to AutomatedTesting/Gem/PythonTests/physics/script_canvas/C6224408_ScriptCanvas_EntitySpawn.py index c458073799..12e4a25b4d --- a/AutomatedTesting/Gem/PythonTests/physics/C6224408_ScriptCanvas_EntitySpawn.py +++ b/AutomatedTesting/Gem/PythonTests/physics/script_canvas/C6224408_ScriptCanvas_EntitySpawn.py @@ -60,11 +60,6 @@ def C6224408_ScriptCanvas_EntitySpawn(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -144,8 +139,5 @@ def C6224408_ScriptCanvas_EntitySpawn(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C6224408_ScriptCanvas_EntitySpawn) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C6274125_ScriptCanvas_TriggerEvents.py b/AutomatedTesting/Gem/PythonTests/physics/script_canvas/C6274125_ScriptCanvas_TriggerEvents.py old mode 100755 new mode 100644 similarity index 97% rename from AutomatedTesting/Gem/PythonTests/physics/C6274125_ScriptCanvas_TriggerEvents.py rename to AutomatedTesting/Gem/PythonTests/physics/script_canvas/C6274125_ScriptCanvas_TriggerEvents.py index 0e7ca0c8d3..5fc4261607 --- a/AutomatedTesting/Gem/PythonTests/physics/C6274125_ScriptCanvas_TriggerEvents.py +++ b/AutomatedTesting/Gem/PythonTests/physics/script_canvas/C6274125_ScriptCanvas_TriggerEvents.py @@ -66,11 +66,6 @@ def C6274125_ScriptCanvas_TriggerEvents(): import os import sys - - import ImportPathHelper as imports - - imports.init() - import azlmbr.legacy.general as general import azlmbr.bus @@ -128,8 +123,5 @@ def C6274125_ScriptCanvas_TriggerEvents(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C6274125_ScriptCanvas_TriggerEvents) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C13508019_Terrain_TerrainTexturePainterWorks.py b/AutomatedTesting/Gem/PythonTests/physics/terrain/C13508019_Terrain_TerrainTexturePainterWorks.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C13508019_Terrain_TerrainTexturePainterWorks.py rename to AutomatedTesting/Gem/PythonTests/physics/terrain/C13508019_Terrain_TerrainTexturePainterWorks.py index 87534ffd58..9822b933d1 --- a/AutomatedTesting/Gem/PythonTests/physics/C13508019_Terrain_TerrainTexturePainterWorks.py +++ b/AutomatedTesting/Gem/PythonTests/physics/terrain/C13508019_Terrain_TerrainTexturePainterWorks.py @@ -40,9 +40,7 @@ def C13508019_Terrain_TerrainTexturePainterWorks(): # Setup path import os, sys - import ImportPathHelper as imports - imports.init() from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -137,8 +135,5 @@ def C13508019_Terrain_TerrainTexturePainterWorks(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C13508019_Terrain_TerrainTexturePainterWorks) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C15308217_NoCrash_LevelSwitch.py b/AutomatedTesting/Gem/PythonTests/physics/terrain/C15308217_NoCrash_LevelSwitch.py old mode 100755 new mode 100644 similarity index 96% rename from AutomatedTesting/Gem/PythonTests/physics/C15308217_NoCrash_LevelSwitch.py rename to AutomatedTesting/Gem/PythonTests/physics/terrain/C15308217_NoCrash_LevelSwitch.py index 0fc5c65db3..f3641b12bc --- a/AutomatedTesting/Gem/PythonTests/physics/C15308217_NoCrash_LevelSwitch.py +++ b/AutomatedTesting/Gem/PythonTests/physics/terrain/C15308217_NoCrash_LevelSwitch.py @@ -62,11 +62,6 @@ def C15308217_NoCrash_LevelSwitch(): import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -106,8 +101,5 @@ def C15308217_NoCrash_LevelSwitch(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C15308217_NoCrash_LevelSwitch) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C3510642_Terrain_NotCollideWithTerrain.py b/AutomatedTesting/Gem/PythonTests/physics/terrain/C3510642_Terrain_NotCollideWithTerrain.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C3510642_Terrain_NotCollideWithTerrain.py rename to AutomatedTesting/Gem/PythonTests/physics/terrain/C3510642_Terrain_NotCollideWithTerrain.py index c3e1ac018c..09522da31a --- a/AutomatedTesting/Gem/PythonTests/physics/C3510642_Terrain_NotCollideWithTerrain.py +++ b/AutomatedTesting/Gem/PythonTests/physics/terrain/C3510642_Terrain_NotCollideWithTerrain.py @@ -65,11 +65,6 @@ def C3510642_Terrain_NotCollideWithTerrain(): import os import sys - - import ImportPathHelper as imports - - imports.init() - import azlmbr.legacy.general as general import azlmbr.bus @@ -168,8 +163,5 @@ def C3510642_Terrain_NotCollideWithTerrain(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C3510642_Terrain_NotCollideWithTerrain) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5689518_PhysXTerrain_CollidesWithPhysXTerrain.py b/AutomatedTesting/Gem/PythonTests/physics/terrain/C5689518_PhysXTerrain_CollidesWithPhysXTerrain.py old mode 100755 new mode 100644 similarity index 97% rename from AutomatedTesting/Gem/PythonTests/physics/C5689518_PhysXTerrain_CollidesWithPhysXTerrain.py rename to AutomatedTesting/Gem/PythonTests/physics/terrain/C5689518_PhysXTerrain_CollidesWithPhysXTerrain.py index b586c0b096..a10cc72ed2 --- a/AutomatedTesting/Gem/PythonTests/physics/C5689518_PhysXTerrain_CollidesWithPhysXTerrain.py +++ b/AutomatedTesting/Gem/PythonTests/physics/terrain/C5689518_PhysXTerrain_CollidesWithPhysXTerrain.py @@ -47,11 +47,6 @@ def C5689518_PhysXTerrain_CollidesWithPhysXTerrain(): """ import os import sys - - import ImportPathHelper as imports - - imports.init() - import azlmbr.legacy.general as general import azlmbr.bus from editor_python_test_tools.utils import Report @@ -113,8 +108,5 @@ def C5689518_PhysXTerrain_CollidesWithPhysXTerrain(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C5689518_PhysXTerrain_CollidesWithPhysXTerrain) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5689522_Physxterrain_AddPhysxterrainNoEditorCrash.py b/AutomatedTesting/Gem/PythonTests/physics/terrain/C5689522_Physxterrain_AddPhysxterrainNoEditorCrash.py old mode 100755 new mode 100644 similarity index 96% rename from AutomatedTesting/Gem/PythonTests/physics/C5689522_Physxterrain_AddPhysxterrainNoEditorCrash.py rename to AutomatedTesting/Gem/PythonTests/physics/terrain/C5689522_Physxterrain_AddPhysxterrainNoEditorCrash.py index 0c1d0d4d1c..8e42f9f77c --- a/AutomatedTesting/Gem/PythonTests/physics/C5689522_Physxterrain_AddPhysxterrainNoEditorCrash.py +++ b/AutomatedTesting/Gem/PythonTests/physics/terrain/C5689522_Physxterrain_AddPhysxterrainNoEditorCrash.py @@ -58,11 +58,6 @@ def C5689522_Physxterrain_AddPhysxterrainNoEditorCrash(): import os import sys - - import ImportPathHelper as imports - - imports.init() - import azlmbr.legacy.general as general from editor_python_test_tools.utils import Report @@ -105,8 +100,5 @@ def C5689522_Physxterrain_AddPhysxterrainNoEditorCrash(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C5689522_Physxterrain_AddPhysxterrainNoEditorCrash) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5689524_MultipleTerrains_CheckWarningInConsole.py b/AutomatedTesting/Gem/PythonTests/physics/terrain/C5689524_MultipleTerrains_CheckWarningInConsole.py old mode 100755 new mode 100644 similarity index 96% rename from AutomatedTesting/Gem/PythonTests/physics/C5689524_MultipleTerrains_CheckWarningInConsole.py rename to AutomatedTesting/Gem/PythonTests/physics/terrain/C5689524_MultipleTerrains_CheckWarningInConsole.py index 04912dd401..ba74716544 --- a/AutomatedTesting/Gem/PythonTests/physics/C5689524_MultipleTerrains_CheckWarningInConsole.py +++ b/AutomatedTesting/Gem/PythonTests/physics/terrain/C5689524_MultipleTerrains_CheckWarningInConsole.py @@ -60,12 +60,6 @@ def C5689524_MultipleTerrains_CheckWarningInConsole(): import os import sys - - import ImportPathHelper as imports - - imports.init() - - import azlmbr.legacy.general as general from editor_python_test_tools.utils import Report @@ -107,8 +101,5 @@ def C5689524_MultipleTerrains_CheckWarningInConsole(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C5689524_MultipleTerrains_CheckWarningInConsole) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5689528_Terrain_MultipleTerrainComponents.py b/AutomatedTesting/Gem/PythonTests/physics/terrain/C5689528_Terrain_MultipleTerrainComponents.py old mode 100755 new mode 100644 similarity index 96% rename from AutomatedTesting/Gem/PythonTests/physics/C5689528_Terrain_MultipleTerrainComponents.py rename to AutomatedTesting/Gem/PythonTests/physics/terrain/C5689528_Terrain_MultipleTerrainComponents.py index a5a8d65788..fb1fd01724 --- a/AutomatedTesting/Gem/PythonTests/physics/C5689528_Terrain_MultipleTerrainComponents.py +++ b/AutomatedTesting/Gem/PythonTests/physics/terrain/C5689528_Terrain_MultipleTerrainComponents.py @@ -60,11 +60,6 @@ def C5689528_Terrain_MultipleTerrainComponents(): import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper from editor_python_test_tools.utils import Tracer @@ -103,8 +98,5 @@ def C5689528_Terrain_MultipleTerrainComponents(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C5689528_Terrain_MultipleTerrainComponents) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5689531_Warning_TerrainSliceTerrainComponent.py b/AutomatedTesting/Gem/PythonTests/physics/terrain/C5689531_Warning_TerrainSliceTerrainComponent.py old mode 100755 new mode 100644 similarity index 97% rename from AutomatedTesting/Gem/PythonTests/physics/C5689531_Warning_TerrainSliceTerrainComponent.py rename to AutomatedTesting/Gem/PythonTests/physics/terrain/C5689531_Warning_TerrainSliceTerrainComponent.py index 2eaa55eacf..68ddaba5ed --- a/AutomatedTesting/Gem/PythonTests/physics/C5689531_Warning_TerrainSliceTerrainComponent.py +++ b/AutomatedTesting/Gem/PythonTests/physics/terrain/C5689531_Warning_TerrainSliceTerrainComponent.py @@ -65,11 +65,6 @@ def C5689531_Warning_TerrainSliceTerrainComponent(): import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper from editor_python_test_tools.utils import Tracer @@ -115,8 +110,5 @@ def C5689531_Warning_TerrainSliceTerrainComponent(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C5689531_Warning_TerrainSliceTerrainComponent) diff --git a/AutomatedTesting/Gem/PythonTests/physics/C6032082_Terrain_MultipleResolutionsValid.py b/AutomatedTesting/Gem/PythonTests/physics/terrain/C6032082_Terrain_MultipleResolutionsValid.py old mode 100755 new mode 100644 similarity index 98% rename from AutomatedTesting/Gem/PythonTests/physics/C6032082_Terrain_MultipleResolutionsValid.py rename to AutomatedTesting/Gem/PythonTests/physics/terrain/C6032082_Terrain_MultipleResolutionsValid.py index 6bb44323a2..66615e1937 --- a/AutomatedTesting/Gem/PythonTests/physics/C6032082_Terrain_MultipleResolutionsValid.py +++ b/AutomatedTesting/Gem/PythonTests/physics/terrain/C6032082_Terrain_MultipleResolutionsValid.py @@ -80,11 +80,6 @@ def C6032082_Terrain_MultipleResolutionsValid(): import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -209,8 +204,5 @@ def C6032082_Terrain_MultipleResolutionsValid(): if __name__ == "__main__": - import ImportPathHelper as imports - imports.init() - from editor_python_test_tools.utils import Report Report.start_test(C6032082_Terrain_MultipleResolutionsValid) diff --git a/AutomatedTesting/Gem/PythonTests/physics/FileManagement.py b/AutomatedTesting/Gem/PythonTests/physics/utils/FileManagement.py old mode 100755 new mode 100644 similarity index 100% rename from AutomatedTesting/Gem/PythonTests/physics/FileManagement.py rename to AutomatedTesting/Gem/PythonTests/physics/utils/FileManagement.py diff --git a/AutomatedTesting/Gem/PythonTests/physics/UtilTest_Managed_Files.py b/AutomatedTesting/Gem/PythonTests/physics/utils/UtilTest_Managed_Files.py old mode 100755 new mode 100644 similarity index 89% rename from AutomatedTesting/Gem/PythonTests/physics/UtilTest_Managed_Files.py rename to AutomatedTesting/Gem/PythonTests/physics/utils/UtilTest_Managed_Files.py index 2e6e854c7d..49747da443 --- a/AutomatedTesting/Gem/PythonTests/physics/UtilTest_Managed_Files.py +++ b/AutomatedTesting/Gem/PythonTests/physics/utils/UtilTest_Managed_Files.py @@ -13,11 +13,6 @@ class Tests: def run(): import os import sys - - import ImportPathHelper as imports - - imports.init() - from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper diff --git a/AutomatedTesting/Gem/PythonTests/physics/UtilTest_Physmaterial_Editor.py b/AutomatedTesting/Gem/PythonTests/physics/utils/UtilTest_Physmaterial_Editor.py old mode 100755 new mode 100644 similarity index 99% rename from AutomatedTesting/Gem/PythonTests/physics/UtilTest_Physmaterial_Editor.py rename to AutomatedTesting/Gem/PythonTests/physics/utils/UtilTest_Physmaterial_Editor.py index ec870d12c4..27d670d1e8 --- a/AutomatedTesting/Gem/PythonTests/physics/UtilTest_Physmaterial_Editor.py +++ b/AutomatedTesting/Gem/PythonTests/physics/utils/UtilTest_Physmaterial_Editor.py @@ -50,9 +50,7 @@ def run(): """ import os import sys - import ImportPathHelper as imports - imports.init() from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper diff --git a/AutomatedTesting/Gem/PythonTests/physics/UtilTest_PhysxConfig_Default.py b/AutomatedTesting/Gem/PythonTests/physics/utils/UtilTest_PhysxConfig_Default.py old mode 100755 new mode 100644 similarity index 100% rename from AutomatedTesting/Gem/PythonTests/physics/UtilTest_PhysxConfig_Default.py rename to AutomatedTesting/Gem/PythonTests/physics/utils/UtilTest_PhysxConfig_Default.py diff --git a/AutomatedTesting/Gem/PythonTests/physics/UtilTest_PhysxConfig_Override.py b/AutomatedTesting/Gem/PythonTests/physics/utils/UtilTest_PhysxConfig_Override.py old mode 100755 new mode 100644 similarity index 100% rename from AutomatedTesting/Gem/PythonTests/physics/UtilTest_PhysxConfig_Override.py rename to AutomatedTesting/Gem/PythonTests/physics/utils/UtilTest_PhysxConfig_Override.py diff --git a/AutomatedTesting/Gem/PythonTests/physics/UtilTest_Tracer_PicksErrorsAndWarnings.py b/AutomatedTesting/Gem/PythonTests/physics/utils/UtilTest_Tracer_PicksErrorsAndWarnings.py old mode 100755 new mode 100644 similarity index 97% rename from AutomatedTesting/Gem/PythonTests/physics/UtilTest_Tracer_PicksErrorsAndWarnings.py rename to AutomatedTesting/Gem/PythonTests/physics/utils/UtilTest_Tracer_PicksErrorsAndWarnings.py index 92405498d2..136bcfc03d --- a/AutomatedTesting/Gem/PythonTests/physics/UtilTest_Tracer_PicksErrorsAndWarnings.py +++ b/AutomatedTesting/Gem/PythonTests/physics/utils/UtilTest_Tracer_PicksErrorsAndWarnings.py @@ -30,11 +30,6 @@ def run(): import os import sys - - import ImportPathHelper as imports - - imports.init() - import azlmbr.legacy.general as general from editor_python_test_tools.utils import Report diff --git a/AutomatedTesting/Gem/PythonTests/prefab/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/prefab/CMakeLists.txt index 1d9c54fa40..48c24d1ebf 100644 --- a/AutomatedTesting/Gem/PythonTests/prefab/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonTests/prefab/CMakeLists.txt @@ -13,7 +13,6 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) TEST_SUITE main TEST_SERIAL PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Main.py - TIMEOUT 1500 RUNTIME_DEPENDENCIES Legacy::Editor AZ::AssetProcessor diff --git a/AutomatedTesting/Gem/PythonTests/prefab/PrefabLevel_BasicWorkflow.py b/AutomatedTesting/Gem/PythonTests/prefab/PrefabLevel_BasicWorkflow.py new file mode 100644 index 0000000000..7a600f7976 --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/prefab/PrefabLevel_BasicWorkflow.py @@ -0,0 +1,108 @@ +""" +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_new_entity = ("'CreateNewEntity' passed", "'CreateNewEntity' failed") + create_prefab = ("'CreatePrefab' passed", "'CreatePrefab' failed") + instantiate_prefab = ("'InstantiatePrefab' passed", "'InstantiatePrefab' failed") + has_one_child = ("instantiated prefab contains only one child as expected", "instantiated prefab does *not* contain only one child as expected") + instantiated_prefab_position = ("instantiated prefab's position is at the expected position", "instantiated prefab's position is *not* at the expected position") + delete_prefab = ("'DeleteEntitiesAndAllDescendantsInInstance' passed", "'DeleteEntitiesAndAllDescendantsInInstance' failed") + instantiated_prefab_removed = ("instantiated prefab's container entity has been removed", "instantiated prefab's container entity has *not* been removed") + instantiated_child_removed = ("instantiated prefab's child entity has been removed", "instantiated prefab's child entity has *not* been removed") +# fmt:on + +def PrefabLevel_BasicWorkflow(): + """ + This test will help verify if the following functions related to Prefab work as expected: + - CreatePrefab + - InstantiatePrefab + - DeleteEntitiesAndAllDescendantsInInstance + """ + + import os + import sys + + from editor_python_test_tools.utils import Report + from editor_python_test_tools.utils import TestHelper as helper + import editor_python_test_tools.hydra_editor_utils as hydra + + import azlmbr.bus as bus + import azlmbr.entity as entity + from azlmbr.entity import EntityId + import azlmbr.editor as editor + import azlmbr.prefab as prefab + from azlmbr.math import Vector3 + import azlmbr.legacy.general as general + + NEW_PREFAB_NAME = "new_prefab" + NEW_PREFAB_FILE_NAME = NEW_PREFAB_NAME + ".prefab" + NEW_PREFAB_FILE_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), NEW_PREFAB_FILE_NAME) + INSTANTIATED_PREFAB_POSITION = Vector3(10.00, 20.0, 30.0) + INSTANTIATED_PREFAB_NAME = "instantiated_prefab" + INSTANTIATED_CHILD_ENTITY_NAME = "child_1" + TEST_LEVEL_FOLDER = "Prefab" + TEST_LEVEL_NAME = "Base" + + def find_entity_by_name(entity_name): + searchFilter = entity.SearchFilter() + searchFilter.names = [entity_name] + entityIds = entity.SearchBus(bus.Broadcast, 'SearchEntities', searchFilter) + if entityIds and entityIds[0].IsValid(): + return entityIds[0] + return None + + def print_error_if_failed(prefab_operation_result): + if not prefab_operation_result.IsSuccess(): + Report.info(f'Error message: {prefab_operation_result.GetError()}') + + +# Open the test level + helper.init_idle() + helper.open_level(TEST_LEVEL_FOLDER, TEST_LEVEL_NAME) + +# Create a new Entity at the root level + new_entity_id = editor.ToolsApplicationRequestBus(bus.Broadcast, 'CreateNewEntity', EntityId()) + Report.result(Tests.create_new_entity, new_entity_id.IsValid()) + +# Checks for prefab creation passed or not + create_prefab_result = prefab.PrefabPublicRequestBus(bus.Broadcast, 'CreatePrefabInMemory', [new_entity_id], NEW_PREFAB_FILE_PATH) + Report.result(Tests.create_prefab, create_prefab_result.IsSuccess()) + print_error_if_failed(create_prefab_result) + +# Checks for prefab instantiation passed or not + instantiate_prefab_result = prefab.PrefabPublicRequestBus(bus.Broadcast, 'InstantiatePrefab', NEW_PREFAB_FILE_PATH, EntityId(), INSTANTIATED_PREFAB_POSITION) + Report.result(Tests.instantiate_prefab, instantiate_prefab_result.IsSuccess() and instantiate_prefab_result.GetValue().IsValid()) + print_error_if_failed(instantiate_prefab_result) + + container_entity_id = instantiate_prefab_result.GetValue() + editor.EditorEntityAPIBus(bus.Event, 'SetName', container_entity_id, INSTANTIATED_PREFAB_NAME) + + children_entity_ids = editor.EditorEntityInfoRequestBus(bus.Event, 'GetChildren', container_entity_id) + Report.result(Tests.has_one_child, len(children_entity_ids) is 1) + + child_entity_id = children_entity_ids[0] + editor.EditorEntityAPIBus(bus.Event, 'SetName', child_entity_id, INSTANTIATED_CHILD_ENTITY_NAME) + +# Checks if the new prefab is at the correct position and if it fails, it will provide the expected postion and the actual postion of the entity in the Editor log + actual_prefab_position = azlmbr.components.TransformBus(azlmbr.bus.Event, "GetWorldTranslation", container_entity_id) + is_at_position = actual_prefab_position.IsClose(INSTANTIATED_PREFAB_POSITION) + Report.result(Tests.instantiated_prefab_position, is_at_position) + if not is_at_position: + Report.info(f'Expected position: {INSTANTIATED_PREFAB_POSITION.ToString()}, actual position: {actual_prefab_position.ToString()}') + +# Checks for prefab deletion passed or not + delete_prefab_result = prefab.PrefabPublicRequestBus(bus.Broadcast, 'DeleteEntitiesAndAllDescendantsInInstance', [container_entity_id]) + Report.result(Tests.delete_prefab, delete_prefab_result.IsSuccess()) + print_error_if_failed(delete_prefab_result) + Report.result(Tests.instantiated_prefab_removed, find_entity_by_name(INSTANTIATED_PREFAB_NAME) is None) + Report.result(Tests.instantiated_child_removed, find_entity_by_name(INSTANTIATED_CHILD_ENTITY_NAME) is None) + +if __name__ == "__main__": + from editor_python_test_tools.utils import Report + Report.start_test(PrefabLevel_BasicWorkflow) diff --git a/AutomatedTesting/Gem/PythonTests/prefab/TestSuite_Main.py b/AutomatedTesting/Gem/PythonTests/prefab/TestSuite_Main.py index acd8f60b07..4e3d6ba77f 100644 --- a/AutomatedTesting/Gem/PythonTests/prefab/TestSuite_Main.py +++ b/AutomatedTesting/Gem/PythonTests/prefab/TestSuite_Main.py @@ -16,6 +16,7 @@ from ly_test_tools import LAUNCHERS sys.path.append (os.path.dirname (os.path.abspath (__file__)) + '/../automatedtesting_shared') +import ly_test_tools.environment.file_system as file_system from base import TestAutomationBase @pytest.mark.SUITE_main @@ -29,3 +30,8 @@ class TestAutomation(TestAutomationBase): def test_PrefabLevel_OpensLevelWithEntities(self, request, workspace, editor, launcher_platform): from . import PrefabLevel_OpensLevelWithEntities as test_module self._run_prefab_test(request, workspace, editor, test_module) + + def test_PrefabLevel_BasicWorkflow(self, request, workspace, editor, launcher_platform): + from . import PrefabLevel_BasicWorkflow as test_module + self._run_prefab_test(request, workspace, editor, test_module) + diff --git a/AutomatedTesting/Gem/PythonTests/scripting/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/scripting/CMakeLists.txt index 80b6e9a54e..25988216b2 100644 --- a/AutomatedTesting/Gem/PythonTests/scripting/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonTests/scripting/CMakeLists.txt @@ -12,7 +12,6 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) TEST_SUITE periodic TEST_SERIAL PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Periodic.py - TIMEOUT 1500 RUNTIME_DEPENDENCIES Legacy::Editor AZ::AssetProcessor @@ -25,7 +24,6 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) TEST_SUITE sandbox TEST_SERIAL PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Sandbox.py - TIMEOUT 1500 RUNTIME_DEPENDENCIES Legacy::Editor AZ::AssetProcessor diff --git a/AutomatedTesting/Gem/PythonTests/scripting/Pane_PropertiesChanged_RetainsOnRestart.py b/AutomatedTesting/Gem/PythonTests/scripting/Pane_PropertiesChanged_RetainsOnRestart.py index 5c74754449..338389b1c4 100644 --- a/AutomatedTesting/Gem/PythonTests/scripting/Pane_PropertiesChanged_RetainsOnRestart.py +++ b/AutomatedTesting/Gem/PythonTests/scripting/Pane_PropertiesChanged_RetainsOnRestart.py @@ -52,7 +52,7 @@ def Pane_PropertiesChanged_RetainsOnRestart(): from utils import TestHelper as helper import pyside_utils - # Lumberyard Imports + # O3DE Imports import azlmbr.legacy.general as general # Pyside imports diff --git a/AutomatedTesting/Gem/PythonTests/scripting/ScriptCanvasComponent_OnEntityActivatedDeactivated_PrintMessage.py b/AutomatedTesting/Gem/PythonTests/scripting/ScriptCanvasComponent_OnEntityActivatedDeactivated_PrintMessage.py index b07a34dacd..097d3fb42d 100644 --- a/AutomatedTesting/Gem/PythonTests/scripting/ScriptCanvasComponent_OnEntityActivatedDeactivated_PrintMessage.py +++ b/AutomatedTesting/Gem/PythonTests/scripting/ScriptCanvasComponent_OnEntityActivatedDeactivated_PrintMessage.py @@ -93,11 +93,11 @@ def ScriptCanvasComponent_OnEntityActivatedDeactivated_PrintMessage(): if entity_dict["name"] == "Controller": sc_component.get_property_tree() sc_component.set_component_property_value( - "Properties|Variable Fields|Variables|[0]|Name,Value|Datum|Datum|EntityToActivate", + "Properties|Variables|EntityToActivate|Datum|Datum|value|EntityToActivate", entity_to_activate.id, ) sc_component.set_component_property_value( - "Properties|Variable Fields|Variables|[1]|Name,Value|Datum|Datum|EntityToDeactivate", + "Properties|Variables|EntityToDeactivate|Datum|Datum|value|EntityToDeactivate", entity_to_deactivate.id, ) return entity diff --git a/AutomatedTesting/Gem/PythonTests/smoke/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/smoke/CMakeLists.txt index 600911e9f1..3fc4f3db0e 100644 --- a/AutomatedTesting/Gem/PythonTests/smoke/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonTests/smoke/CMakeLists.txt @@ -11,7 +11,6 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) if (PAL_TRAIT_BUILD_SERIALIZECONTEXTTOOLS) list(APPEND additional_dependencies AZ::SerializeContextTools) # test_CLITool_SerializeContextTools depends on it endif() - list(APPEND additional_dependencies AZ::AssetBundlerBatch) # test_CLITool_AssetBundlerBatch_Works depends on it ly_add_pytest( NAME AutomatedTesting::SmokeTest @@ -19,33 +18,33 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) TEST_SERIAL PATH ${CMAKE_CURRENT_LIST_DIR} PYTEST_MARKS "SUITE_smoke" - TIMEOUT 1500 RUNTIME_DEPENDENCIES AZ::AssetProcessor AZ::PythonBindingsExample Legacy::Editor AutomatedTesting.GameLauncher AutomatedTesting.Assets - ${aditional_dependencies} + AZ::AzTestRunner + AZ::AssetBundlerBatch + ${additional_dependencies} COMPONENT Smoke ) ly_add_pytest( - NAME AutomatedTesting::SandboxTest - TEST_SUITE sandbox + NAME AutomatedTesting::LoadLevelGPU + TEST_SUITE smoke TEST_SERIAL - PATH ${CMAKE_CURRENT_LIST_DIR} - PYTEST_MARKS "SUITE_sandbox" - TIMEOUT 1500 + TEST_REQUIRES gpu + PATH ${CMAKE_CURRENT_LIST_DIR}/test_RemoteConsole_GPULoadLevel_Works.py + TIMEOUT 100 RUNTIME_DEPENDENCIES AZ::AssetProcessor AZ::PythonBindingsExample - Legacy::Editor AutomatedTesting.GameLauncher AutomatedTesting.Assets COMPONENT - Sandbox + Smoke ) ly_add_pytest( @@ -74,4 +73,5 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) AutomatedTesting.GameLauncher AutomatedTesting.Assets ) + endif() diff --git a/AutomatedTesting/Gem/PythonTests/smoke/Editor_NewExistingLevels_Works.py b/AutomatedTesting/Gem/PythonTests/smoke/Editor_NewExistingLevels_Works.py index 9a54de856c..71956488fc 100644 --- a/AutomatedTesting/Gem/PythonTests/smoke/Editor_NewExistingLevels_Works.py +++ b/AutomatedTesting/Gem/PythonTests/smoke/Editor_NewExistingLevels_Works.py @@ -53,7 +53,7 @@ def Editor_NewExistingLevels_Works(): 10) Save, Load and Export an existing level and close editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the O3DE Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/smoke/test_RemoteConsole_CPULoadLevel_Works.py b/AutomatedTesting/Gem/PythonTests/smoke/test_RemoteConsole_CPULoadLevel_Works.py new file mode 100644 index 0000000000..6522514f2f --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/smoke/test_RemoteConsole_CPULoadLevel_Works.py @@ -0,0 +1,44 @@ +""" +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 + + +UI Apps: AutomatedTesting.GameLauncher +Launch AutomatedTesting.GameLauncher with Simple level +Test should run in both gpu and non gpu +""" + +import pytest +import psutil + +import ly_test_tools.environment.waiter as waiter +import editor_python_test_tools.hydra_test_utils as editor_test_utils +from ly_remote_console.remote_console_commands import RemoteConsole as RemoteConsole +from ly_remote_console.remote_console_commands import ( + send_command_and_expect_response as send_command_and_expect_response, +) + + +@pytest.mark.parametrize("launcher_platform", ["windows"]) +@pytest.mark.parametrize("project", ["AutomatedTesting"]) +@pytest.mark.parametrize("level", ["Simple"]) +@pytest.mark.SUITE_smoke +class TestRemoteConsoleLoadLevelWorks(object): + @pytest.fixture + def remote_console_instance(self, request): + console = RemoteConsole() + + def teardown(): + if console.connected: + console.stop() + + request.addfinalizer(teardown) + + return console + + def test_RemoteConsole_LoadLevel_Works(self, launcher, level, remote_console_instance, launcher_platform): + expected_lines = ['Level system is loading "Simple"'] + + editor_test_utils.launch_and_validate_results_launcher(launcher, level, remote_console_instance, expected_lines, null_renderer=True) diff --git a/AutomatedTesting/Gem/PythonTests/smoke/test_RemoteConsole_GPULoadLevel_Works.py b/AutomatedTesting/Gem/PythonTests/smoke/test_RemoteConsole_GPULoadLevel_Works.py new file mode 100644 index 0000000000..7debcab938 --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/smoke/test_RemoteConsole_GPULoadLevel_Works.py @@ -0,0 +1,43 @@ +""" +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 + + +UI Apps: AutomatedTesting.GameLauncher +Launch AutomatedTesting.GameLauncher with Simple level +Test should run in both gpu and non gpu +""" + +import pytest +import psutil + +import ly_test_tools.environment.waiter as waiter +import editor_python_test_tools.hydra_test_utils as editor_test_utils +from ly_remote_console.remote_console_commands import RemoteConsole as RemoteConsole +from ly_remote_console.remote_console_commands import ( + send_command_and_expect_response as send_command_and_expect_response, +) + + +@pytest.mark.parametrize("launcher_platform", ["windows"]) +@pytest.mark.parametrize("project", ["AutomatedTesting"]) +@pytest.mark.parametrize("level", ["Simple"]) +class TestRemoteConsoleLoadLevelWorks(object): + @pytest.fixture + def remote_console_instance(self, request): + console = RemoteConsole() + + def teardown(): + if console.connected: + console.stop() + + request.addfinalizer(teardown) + + return console + + def test_RemoteConsole_LoadLevel_Works(self, launcher, level, remote_console_instance, launcher_platform): + expected_lines = ['Level system is loading "Simple"'] + + editor_test_utils.launch_and_validate_results_launcher(launcher, level, remote_console_instance, expected_lines, null_renderer=False) diff --git a/AutomatedTesting/Gem/PythonTests/smoke/test_RemoteConsole_LoadLevel_Works.py b/AutomatedTesting/Gem/PythonTests/smoke/test_RemoteConsole_LoadLevel_Works.py deleted file mode 100644 index b1606e1910..0000000000 --- a/AutomatedTesting/Gem/PythonTests/smoke/test_RemoteConsole_LoadLevel_Works.py +++ /dev/null @@ -1,105 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT - - -UI Apps: AutomatedTesting.GameLauncher -Launch AutomatedTesting.GameLauncher with Simple level -Test should run in both gpu and non gpu -""" - -import pytest -import psutil - -# Bail on the test if ly_test_tools doesn't exist. -pytest.importorskip("ly_test_tools") -import ly_test_tools.environment.waiter as waiter -from ly_remote_console.remote_console_commands import RemoteConsole as RemoteConsole -from ly_remote_console.remote_console_commands import ( - send_command_and_expect_response as send_command_and_expect_response, -) - - -@pytest.mark.parametrize("launcher_platform", ["windows"]) -@pytest.mark.parametrize("project", ["AutomatedTesting"]) -@pytest.mark.parametrize("level", ["Simple"]) -@pytest.mark.SUITE_sandbox -class TestRemoteConsoleLoadLevelWorks(object): - @pytest.fixture - def remote_console_instance(self, request): - console = RemoteConsole() - - def teardown(): - if console.connected: - console.stop() - - request.addfinalizer(teardown) - - return console - - def test_RemoteConsole_LoadLevel_Works(self, launcher, level, remote_console_instance, launcher_platform): - expected_lines = ['Level system is loading "Simple"'] - - self.launch_and_validate_results_launcher(launcher, level, remote_console_instance, expected_lines) - - def launch_and_validate_results_launcher( - self, - launcher, - level, - remote_console_instance, - expected_lines, - null_renderer=False, - port_listener_timeout=120, - log_monitor_timeout=300, - remote_console_port=4600, - ): - """ - Runs the launcher with the specified level, and monitors Game.log for expected lines. - :param launcher: Configured launcher object to run test against. - :param level: The level to load in the launcher. - :param remote_console_instance: Configured Remote Console object. - :param expected_lines: Expected lines to search log for. - :oaram null_renderer: Specifies the test does not require the renderer. Defaults to True. - :param port_listener_timeout: Timeout for verifying successful connection to Remote Console. - :param log_monitor_timeout: Timeout for monitoring for lines in Game.log - :param remote_console_port: The port used to communicate with the Remote Console. - """ - - def _check_for_listening_port(port): - """ - Checks to see if the connection to the designated port was established. - :param port: Port to listen to. - :return: True if port is listening. - """ - port_listening = False - for conn in psutil.net_connections(): - if "port={}".format(port) in str(conn): - port_listening = True - return port_listening - - if null_renderer: - launcher.args.extend(["-NullRenderer"]) - - # Start the Launcher - with launcher.start(): - - # Ensure Remote Console can be reached - waiter.wait_for( - lambda: _check_for_listening_port(remote_console_port), - port_listener_timeout, - exc=AssertionError("Port {} not listening.".format(remote_console_port)), - ) - remote_console_instance.start(timeout=30) - - # Load the specified level in the launcher - send_command_and_expect_response( - remote_console_instance, f"loadlevel {level}", "LEVEL_LOAD_END", timeout=30 - ) - - # Monitor the console for expected lines - for line in expected_lines: - assert remote_console_instance.expect_log_line( - line, log_monitor_timeout - ), f"Expected line not found: {line}" diff --git a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/Contents.json b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/Contents.json index 09621469c3..94e3dcd84d 100644 --- a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/Contents.json +++ b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/Contents.json @@ -1,17 +1,5 @@ { "images" : [ - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "iPhoneNotificationIcon40x40.png", - "scale" : "2x" - }, - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "iPhoneNotificationIcon60x60.png", - "scale" : "3x" - }, { "size" : "29x29", "idiom" : "iphone", @@ -48,18 +36,6 @@ "filename" : "iPhoneAppIcon180x180.png", "scale" : "3x" }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "iPadNotificationIcon20x20.png", - "scale" : "1x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "iPadNotificationIcon40x40.png", - "scale" : "2x" - }, { "size" : "29x29", "idiom" : "ipad", @@ -101,16 +77,10 @@ "idiom" : "ipad", "filename" : "iPadProAppIcon167x167.png", "scale" : "2x" - }, - { - "size" : "1024x1024", - "idiom" : "ios-marketing", - "filename" : "iOSAppStoreIcon1024x1024.png", - "scale" : "1x" } ], "info" : { "version" : 1, "author" : "xcode" } -} \ No newline at end of file +} diff --git a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/Contents.json b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/Contents.json index 09621469c3..94e3dcd84d 100644 --- a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/Contents.json +++ b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/Contents.json @@ -1,17 +1,5 @@ { "images" : [ - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "iPhoneNotificationIcon40x40.png", - "scale" : "2x" - }, - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "iPhoneNotificationIcon60x60.png", - "scale" : "3x" - }, { "size" : "29x29", "idiom" : "iphone", @@ -48,18 +36,6 @@ "filename" : "iPhoneAppIcon180x180.png", "scale" : "3x" }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "iPadNotificationIcon20x20.png", - "scale" : "1x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "iPadNotificationIcon40x40.png", - "scale" : "2x" - }, { "size" : "29x29", "idiom" : "ipad", @@ -101,16 +77,10 @@ "idiom" : "ipad", "filename" : "iPadProAppIcon167x167.png", "scale" : "2x" - }, - { - "size" : "1024x1024", - "idiom" : "ios-marketing", - "filename" : "iOSAppStoreIcon1024x1024.png", - "scale" : "1x" } ], "info" : { "version" : 1, "author" : "xcode" } -} \ No newline at end of file +} diff --git a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/Contents.json b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/Contents.json index f836f07ee7..67b253d091 100644 --- a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/Contents.json +++ b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -1,50 +1,5 @@ { "images" : [ - { - "extent" : "full-screen", - "idiom" : "iphone", - "subtype" : "2436h", - "filename" : "iPhoneLaunchImage1125x2436.png", - "minimum-system-version" : "11.0", - "orientation" : "portrait", - "scale" : "3x" - }, - { - "extent" : "full-screen", - "idiom" : "iphone", - "subtype" : "2436h", - "filename" : "iPhoneLaunchImage2436x1125.png", - "minimum-system-version" : "11.0", - "orientation" : "landscape", - "scale" : "3x" - }, - { - "extent" : "full-screen", - "idiom" : "iphone", - "subtype" : "736h", - "filename" : "iPhoneLaunchImage1242x2208.png", - "minimum-system-version" : "8.0", - "orientation" : "portrait", - "scale" : "3x" - }, - { - "extent" : "full-screen", - "idiom" : "iphone", - "subtype" : "736h", - "filename" : "iPhoneLaunchImage2208x1242.png", - "minimum-system-version" : "8.0", - "orientation" : "landscape", - "scale" : "3x" - }, - { - "extent" : "full-screen", - "idiom" : "iphone", - "subtype" : "667h", - "filename" : "iPhoneLaunchImage750x1334.png", - "minimum-system-version" : "8.0", - "orientation" : "portrait", - "scale" : "2x" - }, { "orientation" : "portrait", "idiom" : "iphone", @@ -166,4 +121,4 @@ "version" : 1, "author" : "xcode" } -} \ No newline at end of file +} diff --git a/AutomatedTesting/Levels/AWS/ClientAuth/ConitoAnonymousAuthorization.scriptcanvas b/AutomatedTesting/Levels/AWS/ClientAuth/ConitoAnonymousAuthorization.scriptcanvas index 6cbd951fae..c61953a7c1 100644 --- a/AutomatedTesting/Levels/AWS/ClientAuth/ConitoAnonymousAuthorization.scriptcanvas +++ b/AutomatedTesting/Levels/AWS/ClientAuth/ConitoAnonymousAuthorization.scriptcanvas @@ -1,2356 +1,1325 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +{ + "Type": "JsonSerialization", + "Version": 1, + "ClassName": "ScriptCanvasData", + "ClassData": { + "m_scriptCanvas": { + "Id": { + "id": 6706710049590 + }, + "Name": "ConitoAnonymousAuthorization", + "Components": { + "Component_[6686064357815538527]": { + "$type": "EditorGraphVariableManagerComponent", + "Id": 6686064357815538527, + "m_variableData": { + "m_nameVariableMap": [ + { + "Key": { + "m_id": "{FED50699-DBFE-442D-BB6C-5B0030818690}" + }, + "Value": { + "Datum": { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 4, + "m_azType": "{02FB32C4-B94E-4084-9049-3DF32F87BD76}" + }, + "isNullPointer": false, + "$type": "ClientAuthAWSCredentials", + "label": "Creds" + }, + "VariableId": { + "m_id": "{FED50699-DBFE-442D-BB6C-5B0030818690}" + }, + "VariableName": "Creds" + } + } + ] + } + }, + "Component_[8229254966989441794]": { + "$type": "{4D755CA9-AB92-462C-B24F-0B3376F19967} Graph", + "Id": 8229254966989441794, + "m_graphData": { + "m_nodes": [ + { + "Id": { + "id": 6732479853366 + }, + "Name": "EBusEventHandler", + "Components": { + "Component_[10018029241448660845]": { + "$type": "EBusEventHandler", + "Id": 10018029241448660845, + "Slots": [ + { + "id": { + "m_id": "{CA49F2CC-6D8D-4B79-A2EC-FC892B3080E0}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Connect", + "toolTip": "Connect this event handler to the specified entity.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{8B77E1C8-36A3-4DD7-8D8C-384CFA02F904}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Disconnect", + "toolTip": "Disconnect this event handler.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{A3CF94A0-43D2-4E1A-B9D4-7D142E125868}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnConnected", + "toolTip": "Signaled when a connection has taken place.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{FD5B4E69-23D5-45CE-94A4-5B8ADC51E068}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnDisconnected", + "toolTip": "Signaled when this event handler is disconnected.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{FBF58831-798C-49AF-AFE4-B667AAAFB80F}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnFailure", + "toolTip": "Signaled when it is not possible to connect this handler.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{4318D470-DC34-4453-884A-CA7321A49DDC}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Source", + "toolTip": "ID used to connect on a specific Event address (Type: EntityId)", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{A968DBCB-4507-4155-94FD-7D86AE794FAB}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "EntityID", + "DisplayDataType": { + "m_type": 1 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{154DF389-1BC0-440B-9D57-7C074EE8C94D}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnEntityActivated", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{96563FB8-2C6D-44CA-B9AA-5F07863BDE93}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "EntityID", + "DisplayDataType": { + "m_type": 1 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{436B24D6-79C7-4DDF-A73B-71D5F1953C07}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnEntityDeactivated", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + } + ], + "Datums": [ + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 1 + }, + "isNullPointer": false, + "$type": "EntityId", + "value": { + "id": 2901262558 + }, + "label": "Source" + } + ], + "m_eventMap": [ + { + "Key": { + "Value": 245425936 + }, + "Value": { + "m_eventName": "OnEntityActivated", + "m_eventId": { + "Value": 245425936 + }, + "m_eventSlotId": { + "m_id": "{154DF389-1BC0-440B-9D57-7C074EE8C94D}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{A968DBCB-4507-4155-94FD-7D86AE794FAB}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 4273369222 + }, + "Value": { + "m_eventName": "OnEntityDeactivated", + "m_eventId": { + "Value": 4273369222 + }, + "m_eventSlotId": { + "m_id": "{436B24D6-79C7-4DDF-A73B-71D5F1953C07}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{96563FB8-2C6D-44CA-B9AA-5F07863BDE93}" + } + ], + "m_numExpectedArguments": 1 + } + } + ], + "m_ebusName": "EntityBus", + "m_busId": { + "Value": 3358774020 + } + } + } + }, + { + "Id": { + "id": 6719594951478 + }, + "Name": "SC-Node(Initialize)", + "Components": { + "Component_[11437183238486970293]": { + "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", + "Id": 11437183238486970293, + "Slots": [ + { + "id": { + "m_id": "{2C1E3EE7-262F-418C-9861-7D459C415D3F}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{CB95F6C6-6F1C-4E95-88FA-940EF78C1EC9}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{6520B85D-1E4C-4ECC-B9E4-E12B2A3FD071}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Result: Boolean", + "DisplayDataType": { + "m_type": 0 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "methodType": 0, + "methodName": "Initialize", + "className": "AWSCognitoAuthorizationRequestBus", + "resultSlotIDs": [ + {} + ], + "prettyClassName": "AWSCognitoAuthorizationRequestBus" + } + } + }, + { + "Id": { + "id": 6736774820662 + }, + "Name": "EBusEventHandler", + "Components": { + "Component_[17018320061093636088]": { + "$type": "EBusEventHandler", + "Id": 17018320061093636088, + "Slots": [ + { + "id": { + "m_id": "{785E4FD0-16C5-4DA7-997F-790EE825762E}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Connect", + "toolTip": "Connect this event handler to the specified entity.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{EBC33745-F120-44A7-B00E-BB33CC4A4C70}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Disconnect", + "toolTip": "Disconnect this event handler.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{B3F4FB70-C354-46BE-9807-9FC7BB2C622E}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnConnected", + "toolTip": "Signaled when a connection has taken place.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{9AEA64C0-1654-45C1-9E34-C685BA5192A4}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnDisconnected", + "toolTip": "Signaled when this event handler is disconnected.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{2006558F-6EB5-4FD8-AAEC-B3207647E03D}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnFailure", + "toolTip": "Signaled when it is not possible to connect this handler.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{1F864171-3BF2-41B9-B798-30841004A63A}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ClientAuthAWSCredentials", + "DisplayDataType": { + "m_type": 4, + "m_azType": "{02FB32C4-B94E-4084-9049-3DF32F87BD76}" + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{42CC05C3-381B-422B-81E6-0A67DF343611}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnRequestAWSCredentialsSuccess", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{3F8CDA89-2FD1-438B-8874-A8F55A22BF5A}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{D4EA6ED9-60A0-4161-BDAC-734B83A2C360}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnRequestAWSCredentialsFail", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + } + ], + "m_eventMap": [ + { + "Key": { + "Value": 3736070646 + }, + "Value": { + "m_eventName": "OnRequestAWSCredentialsSuccess", + "m_eventId": { + "Value": 3736070646 + }, + "m_eventSlotId": { + "m_id": "{42CC05C3-381B-422B-81E6-0A67DF343611}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{1F864171-3BF2-41B9-B798-30841004A63A}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 4193877825 + }, + "Value": { + "m_eventName": "OnRequestAWSCredentialsFail", + "m_eventId": { + "Value": 4193877825 + }, + "m_eventSlotId": { + "m_id": "{D4EA6ED9-60A0-4161-BDAC-734B83A2C360}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{3F8CDA89-2FD1-438B-8874-A8F55A22BF5A}" + } + ], + "m_numExpectedArguments": 1 + } + } + ], + "m_ebusName": "AWSCognitoAuthorizationNotificationBus", + "m_busId": { + "Value": 1100345364 + } + } + } + }, + { + "Id": { + "id": 6715299984182 + }, + "Name": "SC-Node(Print)", + "Components": { + "Component_[285714280162783661]": { + "$type": "Print", + "Id": 285714280162783661, + "Slots": [ + { + "id": { + "m_id": "{C667893C-CB0F-455C-A49B-61C717DAC23E}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "Input signal", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{FEC13BF8-5A06-4962-953E-EB526BD14238}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "m_format": "Fail anonymous credentials", + "m_unresolvedString": [ + "Fail anonymous credentials" + ] + } + } + }, + { + "Id": { + "id": 6728184886070 + }, + "Name": "SC-Node(Print)", + "Components": { + "Component_[285714280162783661]": { + "$type": "Print", + "Id": 285714280162783661, + "Slots": [ + { + "id": { + "m_id": "{C667893C-CB0F-455C-A49B-61C717DAC23E}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "Input signal", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{FEC13BF8-5A06-4962-953E-EB526BD14238}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "m_format": "Success anonymous credentials", + "m_unresolvedString": [ + "Success anonymous credentials" + ] + } + } + }, + { + "Id": { + "id": 6711005016886 + }, + "Name": "SC-Node(RequestAWSCredentialsAsync)", + "Components": { + "Component_[3965816515223111262]": { + "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", + "Id": 3965816515223111262, + "Slots": [ + { + "id": { + "m_id": "{0BB643D4-3989-499E-B997-E51370B8D72D}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{2533A5E2-7A0D-429D-A970-FBF28240D574}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "methodType": 0, + "methodName": "RequestAWSCredentialsAsync", + "className": "AWSCognitoAuthorizationRequestBus", + "resultSlotIDs": [ + {} + ], + "prettyClassName": "AWSCognitoAuthorizationRequestBus" + } + } + }, + { + "Id": { + "id": 6723889918774 + }, + "Name": "EBusEventHandler", + "Components": { + "Component_[7309023392789275534]": { + "$type": "EBusEventHandler", + "Id": 7309023392789275534, + "Slots": [ + { + "id": { + "m_id": "{5E6F6747-9B5E-4A7F-9278-161F310CD5AD}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Connect", + "toolTip": "Connect this event handler to the specified entity.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{604545A7-C650-4BF6-BA05-EA468CDC7731}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Disconnect", + "toolTip": "Disconnect this event handler.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{F0140D4D-2DF2-42D6-83A9-6CC51C8C1E52}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnConnected", + "toolTip": "Signaled when a connection has taken place.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{A1A40AD6-9AA5-4C50-91C2-78B274BA6895}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnDisconnected", + "toolTip": "Signaled when this event handler is disconnected.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{BC5D0C52-CBDB-4778-9577-3CAD3F88B03B}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnFailure", + "toolTip": "Signaled when it is not possible to connect this handler.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{9EC2A72F-09F7-4DDE-8C5D-7EC489BA0401}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ClientAuthAWSCredentials", + "DisplayDataType": { + "m_type": 4, + "m_azType": "{02FB32C4-B94E-4084-9049-3DF32F87BD76}" + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{5E083227-4BC8-4DC0-A3D7-86F3C464FFCC}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnRequestAWSCredentialsSuccess", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{60D8497E-6879-4379-BAC3-271D25816B72}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{F4AF6BF6-2BBE-4B11-A548-C17935A41E46}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnRequestAWSCredentialsFail", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + } + ], + "m_eventMap": [ + { + "Key": { + "Value": 3736070646 + }, + "Value": { + "m_eventName": "OnRequestAWSCredentialsSuccess", + "m_eventId": { + "Value": 3736070646 + }, + "m_eventSlotId": { + "m_id": "{5E083227-4BC8-4DC0-A3D7-86F3C464FFCC}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{9EC2A72F-09F7-4DDE-8C5D-7EC489BA0401}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 4193877825 + }, + "Value": { + "m_eventName": "OnRequestAWSCredentialsFail", + "m_eventId": { + "Value": 4193877825 + }, + "m_eventSlotId": { + "m_id": "{F4AF6BF6-2BBE-4B11-A548-C17935A41E46}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{60D8497E-6879-4379-BAC3-271D25816B72}" + } + ], + "m_numExpectedArguments": 1 + } + } + ], + "m_ebusName": "AWSCognitoAuthorizationNotificationBus", + "m_busId": { + "Value": 1100345364 + } + } + } + } + ], + "m_connections": [ + { + "Id": { + "id": 6741069787958 + }, + "Name": "srcEndpoint=(Initialize: Out), destEndpoint=(RequestAWSCredentialsAsync: In)", + "Components": { + "Component_[9874477978239191526]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 9874477978239191526, + "sourceEndpoint": { + "nodeId": { + "id": 6719594951478 + }, + "slotId": { + "m_id": "{CB95F6C6-6F1C-4E95-88FA-940EF78C1EC9}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 6711005016886 + }, + "slotId": { + "m_id": "{0BB643D4-3989-499E-B997-E51370B8D72D}" + } + } + } + } + }, + { + "Id": { + "id": 6745364755254 + }, + "Name": "srcEndpoint=(AWSCognitoAuthorizationNotificationBus Handler: ExecutionSlot:OnRequestAWSCredentialsSuccess), destEndpoint=(Print: In)", + "Components": { + "Component_[7934553402512435877]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 7934553402512435877, + "sourceEndpoint": { + "nodeId": { + "id": 6723889918774 + }, + "slotId": { + "m_id": "{5E083227-4BC8-4DC0-A3D7-86F3C464FFCC}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 6728184886070 + }, + "slotId": { + "m_id": "{C667893C-CB0F-455C-A49B-61C717DAC23E}" + } + } + } + } + }, + { + "Id": { + "id": 6749659722550 + }, + "Name": "srcEndpoint=(AWSCognitoAuthorizationNotificationBus Handler: ExecutionSlot:OnRequestAWSCredentialsFail), destEndpoint=(Print: In)", + "Components": { + "Component_[2125665954450546710]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 2125665954450546710, + "sourceEndpoint": { + "nodeId": { + "id": 6736774820662 + }, + "slotId": { + "m_id": "{D4EA6ED9-60A0-4161-BDAC-734B83A2C360}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 6715299984182 + }, + "slotId": { + "m_id": "{C667893C-CB0F-455C-A49B-61C717DAC23E}" + } + } + } + } + }, + { + "Id": { + "id": 6753954689846 + }, + "Name": "srcEndpoint=(EntityBus Handler: ExecutionSlot:OnEntityActivated), destEndpoint=(Initialize: In)", + "Components": { + "Component_[4615127778717764315]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 4615127778717764315, + "sourceEndpoint": { + "nodeId": { + "id": 6732479853366 + }, + "slotId": { + "m_id": "{154DF389-1BC0-440B-9D57-7C074EE8C94D}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 6719594951478 + }, + "slotId": { + "m_id": "{2C1E3EE7-262F-418C-9861-7D459C415D3F}" + } + } + } + } + } + ] + }, + "m_assetType": "{3E2AC8CD-713F-453E-967F-29517F331784}", + "versionData": { + "_grammarVersion": 1, + "_runtimeVersion": 1 + }, + "m_variableCounter": 1, + "GraphCanvasData": [ + { + "Key": { + "id": 6706710049590 + }, + "Value": { + "ComponentData": { + "{5F84B500-8C45-40D1-8EFC-A5306B241444}": { + "$type": "SceneComponentSaveData", + "ViewParams": { + "Scale": 1.0784334878464947, + "AnchorX": -170.6178436279297, + "AnchorY": -28.745397567749023 + } + } + } + } + }, + { + "Key": { + "id": 6711005016886 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MethodNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 820.0, + 180.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{912ACE5E-70F5-43A7-A375-D763B26712FE}" + } + } + } + }, + { + "Key": { + "id": 6715299984182 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "StringNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 600.0, + 740.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{D2FFD8D1-A1C1-4C64-A87E-6A2366DC602C}" + } + } + } + }, + { + "Key": { + "id": 6719594951478 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MethodNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 420.0, + 180.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{E8A1C3CF-FD12-4D8E-8FB9-F9B678487CF8}" + } + } + } + }, + { + "Key": { + "id": 6723889918774 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 120.0, + 460.0 + ] + }, + "{9E81C95F-89C0-4476-8E82-63CCC4E52E04}": { + "$type": "EBusHandlerNodeDescriptorSaveData", + "EventIds": [ + { + "Value": 3736070646 + } + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{E6C8A974-2E4B-439F-94E2-FC9FB4A2ACD8}" + } + } + } + }, + { + "Key": { + "id": 6728184886070 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "StringNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 640.0, + 500.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{47352093-20A0-4352-8BE4-20A995063E83}" + } + } + } + }, + { + "Key": { + "id": 6732479853366 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 40.0, + 140.0 + ] + }, + "{9E81C95F-89C0-4476-8E82-63CCC4E52E04}": { + "$type": "EBusHandlerNodeDescriptorSaveData", + "EventIds": [ + { + "Value": 245425936 + } + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{24559DE7-5A79-40E8-BBAF-029A7D08F472}" + } + } + } + }, + { + "Key": { + "id": 6736774820662 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 120.0, + 740.0 + ] + }, + "{9E81C95F-89C0-4476-8E82-63CCC4E52E04}": { + "$type": "EBusHandlerNodeDescriptorSaveData", + "EventIds": [ + { + "Value": 4193877825 + } + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{D1C91A31-0031-4FF8-8E93-B10F8586B366}" + } + } + } + } + ], + "StatisticsHelper": { + "InstanceCounter": [ + { + "Key": 5842116761103598202, + "Value": 1 + }, + { + "Key": 5842117453459104876, + "Value": 1 + }, + { + "Key": 5842117453819001655, + "Value": 1 + }, + { + "Key": 10684225535275896474, + "Value": 2 + }, + { + "Key": 13774516386968943251, + "Value": 1 + }, + { + "Key": 13774516392820282243, + "Value": 1 + } + ] + } + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/PasswordSignIn.scriptcanvas b/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/PasswordSignIn.scriptcanvas index 1847f1f0ec..3c7cd836a1 100644 --- a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/PasswordSignIn.scriptcanvas +++ b/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/PasswordSignIn.scriptcanvas @@ -1,6573 +1,3675 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +{ + "Type": "JsonSerialization", + "Version": 1, + "ClassName": "ScriptCanvasData", + "ClassData": { + "m_scriptCanvas": { + "Id": { + "id": 22550844404534 + }, + "Name": "PasswordSignIn", + "Components": { + "Component_[6385465305444622263]": { + "$type": "EditorGraphVariableManagerComponent", + "Id": 6385465305444622263, + "m_variableData": { + "m_nameVariableMap": [ + { + "Key": { + "m_id": "{9E6C4595-2633-4312-B9AA-F49A0B90D7A0}" + }, + "Value": { + "Datum": { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 4, + "m_azType": "{99DAD0BC-740E-5E82-826B-8FC7968CC02C}" + }, + "isNullPointer": false, + "$type": "{99DAD0BC-740E-5E82-826B-8FC7968CC02C} AZStd::vector", + "value": [ + "AWSCognitoIDP" + ], + "label": "Array" + }, + "VariableId": { + "m_id": "{9E6C4595-2633-4312-B9AA-F49A0B90D7A0}" + }, + "VariableName": "AuthenticationProviders" + } + } + ] + } + }, + "Component_[8710839917828649136]": { + "$type": "{4D755CA9-AB92-462C-B24F-0B3376F19967} Graph", + "Id": 8710839917828649136, + "m_graphData": { + "m_nodes": [ + { + "Id": { + "id": 22606678979382 + }, + "Name": "SC-Node(Print)", + "Components": { + "Component_[10817928006900121599]": { + "$type": "Print", + "Id": 10817928006900121599, + "Slots": [ + { + "id": { + "m_id": "{269D4FDC-1137-45A3-8442-2A2DF98D6F6E}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "Input signal", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{F5EE89C0-AB89-4D06-BD4C-72CA40AB075B}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "m_format": "SignIn Success", + "m_unresolvedString": [ + "SignIn Success" + ] + } + } + }, + { + "Id": { + "id": 22610973946678 + }, + "Name": "SC-Node(Initialize)", + "Components": { + "Component_[1153097947988754865]": { + "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", + "Id": 1153097947988754865, + "Slots": [ + { + "id": { + "m_id": "{8C6FB06A-4A06-41E5-94E5-9D78671977C8}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Array: 0", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1, + "IsReference": true, + "VariableReference": { + "m_id": "{9E6C4595-2633-4312-B9AA-F49A0B90D7A0}" + } + }, + { + "id": { + "m_id": "{F4ED50C1-0694-4E9F-A4E6-83565E517C1E}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{4BB45954-74C5-4023-AFBE-C82638076FDD}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{F6930458-3515-45B6-BB6D-1217547A7401}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Result: Boolean", + "DisplayDataType": { + "m_type": 0 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 4, + "m_azType": "{99DAD0BC-740E-5E82-826B-8FC7968CC02C}" + }, + "isNullPointer": true, + "label": "Array: 0" + } + ], + "methodType": 0, + "methodName": "Initialize", + "className": "AuthenticationProviderRequestBus", + "resultSlotIDs": [ + {} + ], + "prettyClassName": "AuthenticationProviderRequestBus" + } + } + }, + { + "Id": { + "id": 22559434339126 + }, + "Name": "EBusEventHandler", + "Components": { + "Component_[15120484156765471501]": { + "$type": "EBusEventHandler", + "Id": 15120484156765471501, + "Slots": [ + { + "id": { + "m_id": "{55723136-4724-4749-8A1E-A0829EC4CB54}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Connect", + "toolTip": "Connect this event handler to the specified entity.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{01F5AE9F-BF74-41B1-A1F9-7782B707C013}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Disconnect", + "toolTip": "Disconnect this event handler.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{2D449731-3E45-489D-B7EA-586D3E87738C}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnConnected", + "toolTip": "Signaled when a connection has taken place.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{7FE6C340-B7A9-4ABD-B30E-FB78707A8042}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnDisconnected", + "toolTip": "Signaled when this event handler is disconnected.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{174FBA70-D39B-4FAD-8595-52A63CE855F4}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnFailure", + "toolTip": "Signaled when it is not possible to connect this handler.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{B4E8FA2A-6833-43A2-BF8D-E021B7F24C6C}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Source", + "toolTip": "ID used to connect on a specific Event address (Type: EntityId)", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{808F793B-E283-4872-B0C9-3BDE44FB0372}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "EntityID", + "DisplayDataType": { + "m_type": 1 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{1E81F46E-80CF-4CF6-8499-04539BBF244E}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnEntityActivated", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{7977990A-4416-494A-94F1-F2670A6E920B}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "EntityID", + "DisplayDataType": { + "m_type": 1 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{AB5A3F2D-D553-49A8-98A5-F99375431668}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnEntityDeactivated", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + } + ], + "Datums": [ + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 1 + }, + "isNullPointer": false, + "$type": "EntityId", + "value": { + "id": 2901262558 + }, + "label": "Source" + } + ], + "m_eventMap": [ + { + "Key": { + "Value": 245425936 + }, + "Value": { + "m_eventName": "OnEntityActivated", + "m_eventId": { + "Value": 245425936 + }, + "m_eventSlotId": { + "m_id": "{1E81F46E-80CF-4CF6-8499-04539BBF244E}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{808F793B-E283-4872-B0C9-3BDE44FB0372}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 4273369222 + }, + "Value": { + "m_eventName": "OnEntityDeactivated", + "m_eventId": { + "Value": 4273369222 + }, + "m_eventSlotId": { + "m_id": "{AB5A3F2D-D553-49A8-98A5-F99375431668}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{7977990A-4416-494A-94F1-F2670A6E920B}" + } + ], + "m_numExpectedArguments": 1 + } + } + ], + "m_ebusName": "EntityBus", + "m_busId": { + "Value": 3358774020 + } + } + } + }, + { + "Id": { + "id": 22580909175606 + }, + "Name": "EBusEventHandler", + "Components": { + "Component_[16042865177069512848]": { + "$type": "EBusEventHandler", + "Id": 16042865177069512848, + "Slots": [ + { + "id": { + "m_id": "{8503C0C0-DFA8-43AF-AE40-E2A48C9F77C5}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Connect", + "toolTip": "Connect this event handler to the specified entity.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{EE5F8D3F-CC56-400F-91F6-835A2A843D3E}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Disconnect", + "toolTip": "Disconnect this event handler.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{35490A45-17F4-444E-B4EB-443B4AC61D07}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnConnected", + "toolTip": "Signaled when a connection has taken place.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{FCCA77C5-AB2A-4BE7-BC46-99B74FDBEC7B}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnDisconnected", + "toolTip": "Signaled when this event handler is disconnected.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{F52BDF60-64FD-488B-8D5D-D996B9400986}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnFailure", + "toolTip": "Signaled when it is not possible to connect this handler.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{8C19381E-B495-4B42-880C-86399A055392}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ClientAuthAWSCredentials", + "DisplayDataType": { + "m_type": 4, + "m_azType": "{02FB32C4-B94E-4084-9049-3DF32F87BD76}" + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{BCA83F8F-E431-421D-8B01-A8B31C3C66B1}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnRequestAWSCredentialsSuccess", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{2EEBA254-1346-4866-80CA-3608BAF5B767}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{BB27DD72-E82E-4C67-8493-E3DF0AFCC093}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnRequestAWSCredentialsFail", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + } + ], + "m_eventMap": [ + { + "Key": { + "Value": 3736070646 + }, + "Value": { + "m_eventName": "OnRequestAWSCredentialsSuccess", + "m_eventId": { + "Value": 3736070646 + }, + "m_eventSlotId": { + "m_id": "{BCA83F8F-E431-421D-8B01-A8B31C3C66B1}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{8C19381E-B495-4B42-880C-86399A055392}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 4193877825 + }, + "Value": { + "m_eventName": "OnRequestAWSCredentialsFail", + "m_eventId": { + "Value": 4193877825 + }, + "m_eventSlotId": { + "m_id": "{BB27DD72-E82E-4C67-8493-E3DF0AFCC093}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{2EEBA254-1346-4866-80CA-3608BAF5B767}" + } + ], + "m_numExpectedArguments": 1 + } + } + ], + "m_ebusName": "AWSCognitoAuthorizationNotificationBus", + "m_busId": { + "Value": 1100345364 + } + } + } + }, + { + "Id": { + "id": 22585204142902 + }, + "Name": "EBusEventHandler", + "Components": { + "Component_[16607172582241819113]": { + "$type": "EBusEventHandler", + "Id": 16607172582241819113, + "Slots": [ + { + "id": { + "m_id": "{E55A09C6-5B87-4F4F-9EC4-7F602A5C02AC}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Connect", + "toolTip": "Connect this event handler to the specified entity.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{AC007706-2035-4888-AD7C-3C9AF6650FEC}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Disconnect", + "toolTip": "Disconnect this event handler.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{809A2C05-FB97-4C59-B1D8-C29A22F69097}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnConnected", + "toolTip": "Signaled when a connection has taken place.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{E3E053B8-37B7-4094-8974-BF0E13919943}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnDisconnected", + "toolTip": "Signaled when this event handler is disconnected.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{5BB6420D-1016-49B8-AC48-3C5C1EE647F5}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnFailure", + "toolTip": "Signaled when it is not possible to connect this handler.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{D79F252C-3D2A-4CC1-9A51-18B7827EB4CA}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "AuthenticationTokens", + "DisplayDataType": { + "m_type": 4, + "m_azType": "{F965D1B2-9DE3-4900-B44B-E58D9F083ACB}" + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{F3E407C4-9D91-4077-A730-C2463570A9FC}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnPasswordGrantSingleFactorSignInSuccess", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{5B6638B9-4F55-4CCB-A368-C83FED5C43F8}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{282E0463-9A13-4681-B69C-B6B30CA7CD01}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnPasswordGrantSingleFactorSignInFail", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{B088E163-C71A-417E-8D35-F0A29273F5D9}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnPasswordGrantMultiFactorSignInSuccess", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{C2EBAEB4-5ECA-441C-8202-0D2A80F1A776}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{79F39D7A-BFC2-4749-9631-575A6C63714D}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnPasswordGrantMultiFactorSignInFail", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{0CC24B35-F3D6-4E7B-B9D1-98CEB36059AE}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "AuthenticationTokens", + "DisplayDataType": { + "m_type": 4, + "m_azType": "{F965D1B2-9DE3-4900-B44B-E58D9F083ACB}" + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{3C544F9A-0137-4735-8484-0458246E4D52}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnPasswordGrantMultiFactorConfirmSignInSuccess", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{BEBDDB95-FBBA-4AE1-BA89-C3DAE042E9E1}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{FA8FE256-A70A-475E-A724-0E70C1099213}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnPasswordGrantMultiFactorConfirmSignInFail", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{919E73F9-6A2B-437B-867D-6723FFF8D29E}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{B494FB65-9082-4826-84B4-E2E6DB1803D1}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{7F2FE508-FCDB-45E5-BBEB-8A25E9D09C41}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Number", + "DisplayDataType": { + "m_type": 3 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{E8BA420E-FF66-4B13-94B9-2D96448542B0}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnDeviceCodeGrantSignInSuccess", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{4694A0AC-A400-47D0-A050-8B6AEDF65748}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{E03D10FB-C618-4260-870D-FA2B2B13FE0D}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnDeviceCodeGrantSignInFail", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{031D9648-B03B-42E3-8E6B-BF5F6FEF1937}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "AuthenticationTokens", + "DisplayDataType": { + "m_type": 4, + "m_azType": "{F965D1B2-9DE3-4900-B44B-E58D9F083ACB}" + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{98B96DAE-EC45-4F36-B39A-F4C91C56FF95}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnDeviceCodeGrantConfirmSignInSuccess", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{6958B465-4D41-4325-8A66-011E5BA281F2}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{526EE051-CABD-415C-99D1-D55ED0032E5E}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnDeviceCodeGrantConfirmSignInFail", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{A921FE09-C86A-4DE3-9976-0BCC3359CAF3}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "AuthenticationTokens", + "DisplayDataType": { + "m_type": 4, + "m_azType": "{F965D1B2-9DE3-4900-B44B-E58D9F083ACB}" + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{981C81CF-AED4-4535-A226-4BC19C718D73}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnRefreshTokensSuccess", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{1C060C05-4FE2-455A-BABA-4B86CE19F934}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{F20A8880-B22D-4FAA-8779-F51DE7DB2D21}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnRefreshTokensFail", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + } + ], + "m_eventMap": [ + { + "Key": { + "Value": 962116424 + }, + "Value": { + "m_eventName": "OnDeviceCodeGrantSignInSuccess", + "m_eventId": { + "Value": 962116424 + }, + "m_eventSlotId": { + "m_id": "{E8BA420E-FF66-4B13-94B9-2D96448542B0}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{919E73F9-6A2B-437B-867D-6723FFF8D29E}" + }, + { + "m_id": "{B494FB65-9082-4826-84B4-E2E6DB1803D1}" + }, + { + "m_id": "{7F2FE508-FCDB-45E5-BBEB-8A25E9D09C41}" + } + ], + "m_numExpectedArguments": 3 + } + }, + { + "Key": { + "Value": 1026494196 + }, + "Value": { + "m_eventName": "OnRefreshTokensFail", + "m_eventId": { + "Value": 1026494196 + }, + "m_eventSlotId": { + "m_id": "{F20A8880-B22D-4FAA-8779-F51DE7DB2D21}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{1C060C05-4FE2-455A-BABA-4B86CE19F934}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 1152314015 + }, + "Value": { + "m_eventName": "OnRefreshTokensSuccess", + "m_eventId": { + "Value": 1152314015 + }, + "m_eventSlotId": { + "m_id": "{981C81CF-AED4-4535-A226-4BC19C718D73}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{A921FE09-C86A-4DE3-9976-0BCC3359CAF3}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 1203288733 + }, + "Value": { + "m_eventName": "OnPasswordGrantMultiFactorConfirmSignInSuccess", + "m_eventId": { + "Value": 1203288733 + }, + "m_eventSlotId": { + "m_id": "{3C544F9A-0137-4735-8484-0458246E4D52}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{0CC24B35-F3D6-4E7B-B9D1-98CEB36059AE}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 1293959492 + }, + "Value": { + "m_eventName": "OnPasswordGrantSingleFactorSignInFail", + "m_eventId": { + "Value": 1293959492 + }, + "m_eventSlotId": { + "m_id": "{282E0463-9A13-4681-B69C-B6B30CA7CD01}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{5B6638B9-4F55-4CCB-A368-C83FED5C43F8}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 1722702500 + }, + "Value": { + "m_eventName": "OnPasswordGrantSingleFactorSignInSuccess", + "m_eventId": { + "Value": 1722702500 + }, + "m_eventSlotId": { + "m_id": "{F3E407C4-9D91-4077-A730-C2463570A9FC}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{D79F252C-3D2A-4CC1-9A51-18B7827EB4CA}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 1819337155 + }, + "Value": { + "m_eventName": "OnPasswordGrantMultiFactorConfirmSignInFail", + "m_eventId": { + "Value": 1819337155 + }, + "m_eventSlotId": { + "m_id": "{FA8FE256-A70A-475E-A724-0E70C1099213}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{BEBDDB95-FBBA-4AE1-BA89-C3DAE042E9E1}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 1908852787 + }, + "Value": { + "m_eventName": "OnPasswordGrantMultiFactorSignInFail", + "m_eventId": { + "Value": 1908852787 + }, + "m_eventSlotId": { + "m_id": "{79F39D7A-BFC2-4749-9631-575A6C63714D}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{C2EBAEB4-5ECA-441C-8202-0D2A80F1A776}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 2486714370 + }, + "Value": { + "m_eventName": "OnPasswordGrantMultiFactorSignInSuccess", + "m_eventId": { + "Value": 2486714370 + }, + "m_eventSlotId": { + "m_id": "{B088E163-C71A-417E-8D35-F0A29273F5D9}" + } + } + }, + { + "Key": { + "Value": 3091702945 + }, + "Value": { + "m_eventName": "OnDeviceCodeGrantSignInFail", + "m_eventId": { + "Value": 3091702945 + }, + "m_eventSlotId": { + "m_id": "{E03D10FB-C618-4260-870D-FA2B2B13FE0D}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{4694A0AC-A400-47D0-A050-8B6AEDF65748}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 3973214553 + }, + "Value": { + "m_eventName": "OnDeviceCodeGrantConfirmSignInFail", + "m_eventId": { + "Value": 3973214553 + }, + "m_eventSlotId": { + "m_id": "{526EE051-CABD-415C-99D1-D55ED0032E5E}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{6958B465-4D41-4325-8A66-011E5BA281F2}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 4272279525 + }, + "Value": { + "m_eventName": "OnDeviceCodeGrantConfirmSignInSuccess", + "m_eventId": { + "Value": 4272279525 + }, + "m_eventSlotId": { + "m_id": "{98B96DAE-EC45-4F36-B39A-F4C91C56FF95}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{031D9648-B03B-42E3-8E6B-BF5F6FEF1937}" + } + ], + "m_numExpectedArguments": 1 + } + } + ], + "m_ebusName": "AuthenticationProviderNotificationBus", + "m_busId": { + "Value": 3734230664 + } + } + } + }, + { + "Id": { + "id": 22602384012086 + }, + "Name": "SC-Node(Print)", + "Components": { + "Component_[17989474089224348440]": { + "$type": "Print", + "Id": 17989474089224348440, + "Slots": [ + { + "id": { + "m_id": "{C0E7856E-AE8E-4151-9109-2E3B2A810054}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "Input signal", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{36A6967B-AD9E-41C2-9BCC-2AF62F62C774}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "m_format": "Fail credentials", + "m_unresolvedString": [ + "Fail credentials" + ] + } + } + }, + { + "Id": { + "id": 22593794077494 + }, + "Name": "SC-Node(RequestAWSCredentialsAsync)", + "Components": { + "Component_[3213338170673989286]": { + "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", + "Id": 3213338170673989286, + "Slots": [ + { + "id": { + "m_id": "{EB37FB3D-48EB-4766-AD8C-7F03D100C7FA}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{E1160157-4FDD-4720-9EF1-995D0380C53D}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "methodType": 0, + "methodName": "RequestAWSCredentialsAsync", + "className": "AWSCognitoAuthorizationRequestBus", + "resultSlotIDs": [ + {} + ], + "prettyClassName": "AWSCognitoAuthorizationRequestBus" + } + } + }, + { + "Id": { + "id": 22563729306422 + }, + "Name": "EBusEventHandler", + "Components": { + "Component_[3639374038291845020]": { + "$type": "EBusEventHandler", + "Id": 3639374038291845020, + "Slots": [ + { + "id": { + "m_id": "{2A8157B6-1A5A-464C-B1A1-CC5067AC8872}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Connect", + "toolTip": "Connect this event handler to the specified entity.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{8DBCEE08-2A7F-4D3E-BF59-7FB3A34AD3B7}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Disconnect", + "toolTip": "Disconnect this event handler.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{D8FCBC44-E46B-4699-B1A2-AE2BFE61A132}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnConnected", + "toolTip": "Signaled when a connection has taken place.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{9E6AE222-55CE-48F1-A844-7DB53C07AB50}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnDisconnected", + "toolTip": "Signaled when this event handler is disconnected.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{0507AD01-1320-4210-9786-5F87063D301F}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnFailure", + "toolTip": "Signaled when it is not possible to connect this handler.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{6772D7F9-08BE-4D59-B410-7E6EC0FFEF2B}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "AuthenticationTokens", + "DisplayDataType": { + "m_type": 4, + "m_azType": "{F965D1B2-9DE3-4900-B44B-E58D9F083ACB}" + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{ED8A0C7D-9D75-45A7-BAE1-FD8B980DADE2}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnPasswordGrantSingleFactorSignInSuccess", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{64484918-D357-4B41-830D-CC9EEB6EC963}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{C042D8B9-D834-4A5A-85E7-F9C775EF9784}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnPasswordGrantSingleFactorSignInFail", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{FBBC04A8-2368-4B67-A48F-D7D33EDBC71F}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnPasswordGrantMultiFactorSignInSuccess", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{5873E80A-4E48-4B52-AB91-ACE8DC42EC86}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{DC0B9782-C4BB-49C0-8DE3-06933347FA20}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnPasswordGrantMultiFactorSignInFail", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{4EB602D7-C5D7-427C-B7D3-838CC4FFBA0D}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "AuthenticationTokens", + "DisplayDataType": { + "m_type": 4, + "m_azType": "{F965D1B2-9DE3-4900-B44B-E58D9F083ACB}" + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{B0F0A8E6-251E-4009-ADE7-8FA70422B1A3}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnPasswordGrantMultiFactorConfirmSignInSuccess", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{0E5E0F30-D4A3-4361-99DC-DFB03CDA26ED}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{DF4A4D97-D2A3-42C2-9F85-B79D0743B1DD}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnPasswordGrantMultiFactorConfirmSignInFail", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{58B429CF-B818-4CCB-8E31-84B04B65B704}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{4564C0EF-B526-4AB6-9564-0AE22B473EE5}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{6CD7C063-7118-4E55-AA6D-9EDF5B72F7E7}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Number", + "DisplayDataType": { + "m_type": 3 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{3F5A128D-5F74-4D09-9C12-425DCDDD8A71}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnDeviceCodeGrantSignInSuccess", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{D49C27E1-B1F7-4A70-8872-B4E6337F0334}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{E6EFD9E4-7CC8-4FBF-88DE-2FAAC4099AE2}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnDeviceCodeGrantSignInFail", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{92E26492-6278-4B46-8CD4-0B271B1BB21B}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "AuthenticationTokens", + "DisplayDataType": { + "m_type": 4, + "m_azType": "{F965D1B2-9DE3-4900-B44B-E58D9F083ACB}" + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{D39D72BA-6EC1-445C-93B7-CAD87B1ADC7D}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnDeviceCodeGrantConfirmSignInSuccess", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{7D66C081-777B-451E-B626-0DAEB39ECA5A}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{AE4AC27C-0EF0-4AFE-B8D2-80D6F1B35FAB}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnDeviceCodeGrantConfirmSignInFail", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{A2BFBF6C-4E19-4294-BDB8-5A191048C9DB}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "AuthenticationTokens", + "DisplayDataType": { + "m_type": 4, + "m_azType": "{F965D1B2-9DE3-4900-B44B-E58D9F083ACB}" + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{C2C30AB7-DACE-49FA-B7B3-04B9FFA5763F}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnRefreshTokensSuccess", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{9BD290CA-B00E-491D-855C-7BD084A0FF43}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{6660546E-CC9B-4951-AE9F-C1D45E6098DD}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnRefreshTokensFail", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + } + ], + "m_eventMap": [ + { + "Key": { + "Value": 962116424 + }, + "Value": { + "m_eventName": "OnDeviceCodeGrantSignInSuccess", + "m_eventId": { + "Value": 962116424 + }, + "m_eventSlotId": { + "m_id": "{3F5A128D-5F74-4D09-9C12-425DCDDD8A71}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{58B429CF-B818-4CCB-8E31-84B04B65B704}" + }, + { + "m_id": "{4564C0EF-B526-4AB6-9564-0AE22B473EE5}" + }, + { + "m_id": "{6CD7C063-7118-4E55-AA6D-9EDF5B72F7E7}" + } + ], + "m_numExpectedArguments": 3 + } + }, + { + "Key": { + "Value": 1026494196 + }, + "Value": { + "m_eventName": "OnRefreshTokensFail", + "m_eventId": { + "Value": 1026494196 + }, + "m_eventSlotId": { + "m_id": "{6660546E-CC9B-4951-AE9F-C1D45E6098DD}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{9BD290CA-B00E-491D-855C-7BD084A0FF43}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 1152314015 + }, + "Value": { + "m_eventName": "OnRefreshTokensSuccess", + "m_eventId": { + "Value": 1152314015 + }, + "m_eventSlotId": { + "m_id": "{C2C30AB7-DACE-49FA-B7B3-04B9FFA5763F}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{A2BFBF6C-4E19-4294-BDB8-5A191048C9DB}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 1203288733 + }, + "Value": { + "m_eventName": "OnPasswordGrantMultiFactorConfirmSignInSuccess", + "m_eventId": { + "Value": 1203288733 + }, + "m_eventSlotId": { + "m_id": "{B0F0A8E6-251E-4009-ADE7-8FA70422B1A3}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{4EB602D7-C5D7-427C-B7D3-838CC4FFBA0D}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 1293959492 + }, + "Value": { + "m_eventName": "OnPasswordGrantSingleFactorSignInFail", + "m_eventId": { + "Value": 1293959492 + }, + "m_eventSlotId": { + "m_id": "{C042D8B9-D834-4A5A-85E7-F9C775EF9784}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{64484918-D357-4B41-830D-CC9EEB6EC963}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 1722702500 + }, + "Value": { + "m_eventName": "OnPasswordGrantSingleFactorSignInSuccess", + "m_eventId": { + "Value": 1722702500 + }, + "m_eventSlotId": { + "m_id": "{ED8A0C7D-9D75-45A7-BAE1-FD8B980DADE2}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{6772D7F9-08BE-4D59-B410-7E6EC0FFEF2B}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 1819337155 + }, + "Value": { + "m_eventName": "OnPasswordGrantMultiFactorConfirmSignInFail", + "m_eventId": { + "Value": 1819337155 + }, + "m_eventSlotId": { + "m_id": "{DF4A4D97-D2A3-42C2-9F85-B79D0743B1DD}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{0E5E0F30-D4A3-4361-99DC-DFB03CDA26ED}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 1908852787 + }, + "Value": { + "m_eventName": "OnPasswordGrantMultiFactorSignInFail", + "m_eventId": { + "Value": 1908852787 + }, + "m_eventSlotId": { + "m_id": "{DC0B9782-C4BB-49C0-8DE3-06933347FA20}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{5873E80A-4E48-4B52-AB91-ACE8DC42EC86}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 2486714370 + }, + "Value": { + "m_eventName": "OnPasswordGrantMultiFactorSignInSuccess", + "m_eventId": { + "Value": 2486714370 + }, + "m_eventSlotId": { + "m_id": "{FBBC04A8-2368-4B67-A48F-D7D33EDBC71F}" + } + } + }, + { + "Key": { + "Value": 3091702945 + }, + "Value": { + "m_eventName": "OnDeviceCodeGrantSignInFail", + "m_eventId": { + "Value": 3091702945 + }, + "m_eventSlotId": { + "m_id": "{E6EFD9E4-7CC8-4FBF-88DE-2FAAC4099AE2}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{D49C27E1-B1F7-4A70-8872-B4E6337F0334}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 3973214553 + }, + "Value": { + "m_eventName": "OnDeviceCodeGrantConfirmSignInFail", + "m_eventId": { + "Value": 3973214553 + }, + "m_eventSlotId": { + "m_id": "{AE4AC27C-0EF0-4AFE-B8D2-80D6F1B35FAB}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{7D66C081-777B-451E-B626-0DAEB39ECA5A}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 4272279525 + }, + "Value": { + "m_eventName": "OnDeviceCodeGrantConfirmSignInSuccess", + "m_eventId": { + "Value": 4272279525 + }, + "m_eventSlotId": { + "m_id": "{D39D72BA-6EC1-445C-93B7-CAD87B1ADC7D}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{92E26492-6278-4B46-8CD4-0B271B1BB21B}" + } + ], + "m_numExpectedArguments": 1 + } + } + ], + "m_ebusName": "AuthenticationProviderNotificationBus", + "m_busId": { + "Value": 3734230664 + } + } + } + }, + { + "Id": { + "id": 22572319241014 + }, + "Name": "SC-Node(Initialize)", + "Components": { + "Component_[7405312649373835200]": { + "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", + "Id": 7405312649373835200, + "Slots": [ + { + "id": { + "m_id": "{FAF2B1D0-815D-476E-BE0A-3C5B0A7181E2}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{354BF6A8-150D-4A9A-A19F-1B92ADC44A43}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{1F13C9EB-941B-4AF1-B8DF-7549F7D6304E}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Result: Boolean", + "DisplayDataType": { + "m_type": 0 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "methodType": 0, + "methodName": "Initialize", + "className": "AWSCognitoAuthorizationRequestBus", + "resultSlotIDs": [ + {} + ], + "prettyClassName": "AWSCognitoAuthorizationRequestBus" + } + } + }, + { + "Id": { + "id": 22589499110198 + }, + "Name": "SC-Node(PasswordGrantSingleFactorSignInAsync)", + "Components": { + "Component_[7750292952156679363]": { + "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", + "Id": 7750292952156679363, + "Slots": [ + { + "id": { + "m_id": "{A5E60763-81A7-4A8A-B8DB-AF4F3DD7D044}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String: 0", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{CC3B7A6A-ABFF-4417-AB09-E010E9193CE0}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String: 1", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{ABB9039F-307D-4A8B-A4DC-2BAFADDF238B}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String: 2", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{F24D94B3-CD7D-4719-AEAB-58B6AA087480}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{E8DC5B43-1CB4-489C-AD04-D67C59BD9719}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "Datums": [ + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 5 + }, + "isNullPointer": false, + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "value": "AWSCognitoIDP", + "label": "String: 0" + }, + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 5 + }, + "isNullPointer": false, + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "value": "test1", + "label": "String: 1" + }, + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 5 + }, + "isNullPointer": false, + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "value": "Test1test1!", + "label": "String: 2" + } + ], + "methodType": 0, + "methodName": "PasswordGrantSingleFactorSignInAsync", + "className": "AuthenticationProviderRequestBus", + "resultSlotIDs": [ + {} + ], + "prettyClassName": "AuthenticationProviderRequestBus" + } + } + }, + { + "Id": { + "id": 22598089044790 + }, + "Name": "SC-Node(Print)", + "Components": { + "Component_[8044817584554102751]": { + "$type": "Print", + "Id": 8044817584554102751, + "Slots": [ + { + "id": { + "m_id": "{D3247169-ACA4-42FF-9CD9-7FC5D2888197}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "Input signal", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{F520F3E3-70BF-43EE-B133-65093AA8CCA8}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "m_format": "Success credentials", + "m_unresolvedString": [ + "Success credentials" + ] + } + } + }, + { + "Id": { + "id": 22576614208310 + }, + "Name": "SC-Node(Initialize)", + "Components": { + "Component_[8692474017847050528]": { + "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", + "Id": 8692474017847050528, + "Slots": [ + { + "id": { + "m_id": "{9EFCF33C-EFBB-44F8-BBD9-0E4AA96D45AF}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{04D08EB7-F20A-4CF7-8BB6-C79804F6EB59}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{2B827E49-A105-44B7-BF32-B0BB97AA0069}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Result: Boolean", + "DisplayDataType": { + "m_type": 0 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "methodType": 0, + "methodName": "Initialize", + "className": "AWSCognitoUserManagementRequestBus", + "resultSlotIDs": [ + {} + ], + "prettyClassName": "AWSCognitoUserManagementRequestBus" + } + } + }, + { + "Id": { + "id": 22555139371830 + }, + "Name": "SC-Node(Print)", + "Components": { + "Component_[8900676182846034623]": { + "$type": "Print", + "Id": 8900676182846034623, + "Slots": [ + { + "id": { + "m_id": "{9BB1F768-9D92-432C-9B8F-C99EB679CFB9}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "Input signal", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{880D8B51-8686-4D13-8AD3-0C9F43C9CC9F}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "m_format": "SignIn Fail", + "m_unresolvedString": [ + "SignIn Fail" + ] + } + } + }, + { + "Id": { + "id": 22568024273718 + }, + "Name": "EBusEventHandler", + "Components": { + "Component_[954102115830395541]": { + "$type": "EBusEventHandler", + "Id": 954102115830395541, + "Slots": [ + { + "id": { + "m_id": "{7CC34F95-FB5B-43EB-AD4D-72E916B326C3}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Connect", + "toolTip": "Connect this event handler to the specified entity.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{CF183A1F-260C-4BD6-8A1D-D1F1F6DA4D77}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Disconnect", + "toolTip": "Disconnect this event handler.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{B7010FF0-FFFF-401B-A97B-F64B6592D4AD}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnConnected", + "toolTip": "Signaled when a connection has taken place.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{E4952C80-F90E-4B2D-894C-D42C88ECD33B}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnDisconnected", + "toolTip": "Signaled when this event handler is disconnected.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{9F16F58B-1942-4841-9E7C-E797DFA9967D}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnFailure", + "toolTip": "Signaled when it is not possible to connect this handler.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{29C614BD-C1B3-4EA3-B6E5-9147AED55BC8}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ClientAuthAWSCredentials", + "DisplayDataType": { + "m_type": 4, + "m_azType": "{02FB32C4-B94E-4084-9049-3DF32F87BD76}" + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{C8DD4D15-0C2D-43BC-9158-2D7DD1A33BBC}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnRequestAWSCredentialsSuccess", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{F1BCDD2A-6F12-4E5F-A263-6237776FA727}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{5EEFCA6E-8B52-43A0-BFAF-512FDAB89E58}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnRequestAWSCredentialsFail", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + } + ], + "m_eventMap": [ + { + "Key": { + "Value": 3736070646 + }, + "Value": { + "m_eventName": "OnRequestAWSCredentialsSuccess", + "m_eventId": { + "Value": 3736070646 + }, + "m_eventSlotId": { + "m_id": "{C8DD4D15-0C2D-43BC-9158-2D7DD1A33BBC}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{29C614BD-C1B3-4EA3-B6E5-9147AED55BC8}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 4193877825 + }, + "Value": { + "m_eventName": "OnRequestAWSCredentialsFail", + "m_eventId": { + "Value": 4193877825 + }, + "m_eventSlotId": { + "m_id": "{5EEFCA6E-8B52-43A0-BFAF-512FDAB89E58}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{F1BCDD2A-6F12-4E5F-A263-6237776FA727}" + } + ], + "m_numExpectedArguments": 1 + } + } + ], + "m_ebusName": "AWSCognitoAuthorizationNotificationBus", + "m_busId": { + "Value": 1100345364 + } + } + } + } + ], + "m_connections": [ + { + "Id": { + "id": 22615268913974 + }, + "Name": "srcEndpoint=(Initialize: Out), destEndpoint=(Initialize: In)", + "Components": { + "Component_[14399681979807032845]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 14399681979807032845, + "sourceEndpoint": { + "nodeId": { + "id": 22610973946678 + }, + "slotId": { + "m_id": "{4BB45954-74C5-4023-AFBE-C82638076FDD}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 22576614208310 + }, + "slotId": { + "m_id": "{9EFCF33C-EFBB-44F8-BBD9-0E4AA96D45AF}" + } + } + } + } + }, + { + "Id": { + "id": 22619563881270 + }, + "Name": "srcEndpoint=(Initialize: Out), destEndpoint=(Initialize: In)", + "Components": { + "Component_[17573298986849197839]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 17573298986849197839, + "sourceEndpoint": { + "nodeId": { + "id": 22576614208310 + }, + "slotId": { + "m_id": "{04D08EB7-F20A-4CF7-8BB6-C79804F6EB59}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 22572319241014 + }, + "slotId": { + "m_id": "{FAF2B1D0-815D-476E-BE0A-3C5B0A7181E2}" + } + } + } + } + }, + { + "Id": { + "id": 22623858848566 + }, + "Name": "srcEndpoint=(Initialize: Out), destEndpoint=(PasswordGrantSingleFactorSignInAsync: In)", + "Components": { + "Component_[9852640775697931695]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 9852640775697931695, + "sourceEndpoint": { + "nodeId": { + "id": 22572319241014 + }, + "slotId": { + "m_id": "{354BF6A8-150D-4A9A-A19F-1B92ADC44A43}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 22589499110198 + }, + "slotId": { + "m_id": "{F24D94B3-CD7D-4719-AEAB-58B6AA087480}" + } + } + } + } + }, + { + "Id": { + "id": 22628153815862 + }, + "Name": "srcEndpoint=(Print: Out), destEndpoint=(RequestAWSCredentialsAsync: In)", + "Components": { + "Component_[12044830313862012006]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 12044830313862012006, + "sourceEndpoint": { + "nodeId": { + "id": 22606678979382 + }, + "slotId": { + "m_id": "{F5EE89C0-AB89-4D06-BD4C-72CA40AB075B}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 22593794077494 + }, + "slotId": { + "m_id": "{EB37FB3D-48EB-4766-AD8C-7F03D100C7FA}" + } + } + } + } + }, + { + "Id": { + "id": 22632448783158 + }, + "Name": "srcEndpoint=(AuthenticationProviderNotificationBus Handler: ExecutionSlot:OnPasswordGrantSingleFactorSignInSuccess), destEndpoint=(Print: In)", + "Components": { + "Component_[11544107396556720999]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 11544107396556720999, + "sourceEndpoint": { + "nodeId": { + "id": 22585204142902 + }, + "slotId": { + "m_id": "{F3E407C4-9D91-4077-A730-C2463570A9FC}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 22606678979382 + }, + "slotId": { + "m_id": "{269D4FDC-1137-45A3-8442-2A2DF98D6F6E}" + } + } + } + } + }, + { + "Id": { + "id": 22636743750454 + }, + "Name": "srcEndpoint=(AWSCognitoAuthorizationNotificationBus Handler: ExecutionSlot:OnRequestAWSCredentialsSuccess), destEndpoint=(Print: In)", + "Components": { + "Component_[16101269355489066265]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 16101269355489066265, + "sourceEndpoint": { + "nodeId": { + "id": 22580909175606 + }, + "slotId": { + "m_id": "{BCA83F8F-E431-421D-8B01-A8B31C3C66B1}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 22598089044790 + }, + "slotId": { + "m_id": "{D3247169-ACA4-42FF-9CD9-7FC5D2888197}" + } + } + } + } + }, + { + "Id": { + "id": 22641038717750 + }, + "Name": "srcEndpoint=(AWSCognitoAuthorizationNotificationBus Handler: ExecutionSlot:OnRequestAWSCredentialsFail), destEndpoint=(Print: In)", + "Components": { + "Component_[6840692313652679972]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 6840692313652679972, + "sourceEndpoint": { + "nodeId": { + "id": 22568024273718 + }, + "slotId": { + "m_id": "{5EEFCA6E-8B52-43A0-BFAF-512FDAB89E58}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 22602384012086 + }, + "slotId": { + "m_id": "{C0E7856E-AE8E-4151-9109-2E3B2A810054}" + } + } + } + } + }, + { + "Id": { + "id": 22645333685046 + }, + "Name": "srcEndpoint=(AuthenticationProviderNotificationBus Handler: ExecutionSlot:OnPasswordGrantSingleFactorSignInFail), destEndpoint=(Print: In)", + "Components": { + "Component_[72000609721937697]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 72000609721937697, + "sourceEndpoint": { + "nodeId": { + "id": 22563729306422 + }, + "slotId": { + "m_id": "{C042D8B9-D834-4A5A-85E7-F9C775EF9784}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 22555139371830 + }, + "slotId": { + "m_id": "{9BB1F768-9D92-432C-9B8F-C99EB679CFB9}" + } + } + } + } + }, + { + "Id": { + "id": 22649628652342 + }, + "Name": "srcEndpoint=(EntityBus Handler: ExecutionSlot:OnEntityActivated), destEndpoint=(Initialize: In)", + "Components": { + "Component_[15648358861411868133]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 15648358861411868133, + "sourceEndpoint": { + "nodeId": { + "id": 22559434339126 + }, + "slotId": { + "m_id": "{1E81F46E-80CF-4CF6-8499-04539BBF244E}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 22610973946678 + }, + "slotId": { + "m_id": "{F4ED50C1-0694-4E9F-A4E6-83565E517C1E}" + } + } + } + } + } + ] + }, + "m_assetType": "{3E2AC8CD-713F-453E-967F-29517F331784}", + "versionData": { + "_grammarVersion": 1, + "_runtimeVersion": 1 + }, + "m_variableCounter": 1, + "GraphCanvasData": [ + { + "Key": { + "id": 22550844404534 + }, + "Value": { + "ComponentData": { + "{5F84B500-8C45-40D1-8EFC-A5306B241444}": { + "$type": "SceneComponentSaveData", + "ViewParams": { + "Scale": 1.4170998772559926, + "AnchorX": 224.40196228027344, + "AnchorY": 163.7146453857422 + } + } + } + } + }, + { + "Key": { + "id": 22555139371830 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "StringNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 1720.0, + 820.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{2B3195F2-1430-43F8-9E98-821F79AE9168}" + } + } + } + }, + { + "Key": { + "id": 22559434339126 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 340.0, + 240.0 + ] + }, + "{9E81C95F-89C0-4476-8E82-63CCC4E52E04}": { + "$type": "EBusHandlerNodeDescriptorSaveData", + "EventIds": [ + { + "Value": 245425936 + } + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{571D5EB6-761E-4961-A9A8-47CEC16F8549}" + } + } + } + }, + { + "Key": { + "id": 22563729306422 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 1200.0, + 820.0 + ] + }, + "{9E81C95F-89C0-4476-8E82-63CCC4E52E04}": { + "$type": "EBusHandlerNodeDescriptorSaveData", + "EventIds": [ + { + "Value": 1293959492 + } + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{D64CFD59-5EB3-46F7-B778-B8C1B1BCE0F6}" + } + } + } + }, + { + "Key": { + "id": 22568024273718 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 1200.0, + 1360.0 + ] + }, + "{9E81C95F-89C0-4476-8E82-63CCC4E52E04}": { + "$type": "EBusHandlerNodeDescriptorSaveData", + "EventIds": [ + { + "Value": 4193877825 + } + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{897D9E34-AB55-4C02-B7CF-707DF3026F7A}" + } + } + } + }, + { + "Key": { + "id": 22572319241014 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MethodNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 300.0, + 620.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{86D69109-1347-4874-B913-DD03618254AA}" + } + } + } + }, + { + "Key": { + "id": 22576614208310 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MethodNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 1200.0, + 300.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{646FDAC6-AC92-436C-84D3-6C7C067F7662}" + } + } + } + }, + { + "Key": { + "id": 22580909175606 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 1200.0, + 1100.0 + ] + }, + "{9E81C95F-89C0-4476-8E82-63CCC4E52E04}": { + "$type": "EBusHandlerNodeDescriptorSaveData", + "EventIds": [ + { + "Value": 3736070646 + } + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{A7E33C5C-1567-4ACF-AA26-07DCF02A0C31}" + } + } + } + }, + { + "Key": { + "id": 22585204142902 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 1200.0, + 540.0 + ] + }, + "{9E81C95F-89C0-4476-8E82-63CCC4E52E04}": { + "$type": "EBusHandlerNodeDescriptorSaveData", + "EventIds": [ + { + "Value": 1722702500 + } + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{73A7B670-D516-477F-BAD2-AC948A0F30AF}" + } + } + } + }, + { + "Key": { + "id": 22589499110198 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MethodNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 700.0, + 620.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{8ED300CF-364B-4569-967D-2E1366510572}" + } + } + } + }, + { + "Key": { + "id": 22593794077494 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MethodNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 280.0, + 1120.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{59A81991-B4E6-48C4-9534-2DAF56ACE2EB}" + } + } + } + }, + { + "Key": { + "id": 22598089044790 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "StringNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 1720.0, + 1100.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{1FB84C5F-E453-4160-947F-CF32F5E2628A}" + } + } + } + }, + { + "Key": { + "id": 22602384012086 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "StringNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 1720.0, + 1360.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{3C3CA353-2C5F-4479-9FB5-BF089C18D90D}" + } + } + } + }, + { + "Key": { + "id": 22606678979382 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "StringNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 1720.0, + 580.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{8766AD8F-F6D5-4DAD-B56D-7B1542B9E2EF}" + } + } + } + }, + { + "Key": { + "id": 22610973946678 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MethodNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 680.0, + 300.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{FD8E5258-B0B2-47E4-AEC1-06E61DA50C70}" + } + } + } + } + ], + "StatisticsHelper": { + "InstanceCounter": [ + { + "Key": 5842116761103598202, + "Value": 1 + }, + { + "Key": 5842117366976109617, + "Value": 1 + }, + { + "Key": 5842117367539594961, + "Value": 1 + }, + { + "Key": 5842117453459104876, + "Value": 1 + }, + { + "Key": 5842117453819001655, + "Value": 1 + }, + { + "Key": 10684225535275896474, + "Value": 4 + }, + { + "Key": 13774516282682374181, + "Value": 1 + }, + { + "Key": 13774516283013331095, + "Value": 1 + }, + { + "Key": 13774516352051377806, + "Value": 1 + }, + { + "Key": 13774516386968943251, + "Value": 1 + }, + { + "Key": 13774516392820282243, + "Value": 1 + } + ] + } + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/PasswordSignUp.scriptcanvas b/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/PasswordSignUp.scriptcanvas index f630d4aba3..b86160e387 100644 --- a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/PasswordSignUp.scriptcanvas +++ b/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/PasswordSignUp.scriptcanvas @@ -1,4400 +1,2442 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +{ + "Type": "JsonSerialization", + "Version": 1, + "ClassName": "ScriptCanvasData", + "ClassData": { + "m_scriptCanvas": { + "Id": { + "id": 40366368748342 + }, + "Name": "PasswordSignUp", + "Components": { + "Component_[15293771356940612577]": { + "$type": "{4D755CA9-AB92-462C-B24F-0B3376F19967} Graph", + "Id": 15293771356940612577, + "m_graphData": { + "m_nodes": [ + { + "Id": { + "id": 40392138552118 + }, + "Name": "SC-Node(Initialize)", + "Components": { + "Component_[10218083367428942849]": { + "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", + "Id": 10218083367428942849, + "Slots": [ + { + "id": { + "m_id": "{399A9DE3-F888-4941-95ED-51DAA3577806}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{7E46FB7B-9FFF-49BE-8A8B-59A6144BB567}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{A3A7AA49-0362-4F3C-81D9-C673BDC4CB9D}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Result: Boolean", + "DisplayDataType": { + "m_type": 0 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "methodType": 0, + "methodName": "Initialize", + "className": "AWSCognitoAuthorizationRequestBus", + "resultSlotIDs": [ + {} + ], + "prettyClassName": "AWSCognitoAuthorizationRequestBus" + } + } + }, + { + "Id": { + "id": 40387843584822 + }, + "Name": "SC-Node(Initialize)", + "Components": { + "Component_[1064784280691017359]": { + "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", + "Id": 1064784280691017359, + "Slots": [ + { + "id": { + "m_id": "{3D4180D8-264F-40A6-B651-8AD9968800CD}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{12154F8B-6329-44B2-B220-25BBB4F4DA8C}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{65D3D1AD-0D98-48D0-9E6E-742535E78E15}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Result: Boolean", + "DisplayDataType": { + "m_type": 0 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "methodType": 0, + "methodName": "Initialize", + "className": "AWSCognitoUserManagementRequestBus", + "resultSlotIDs": [ + {} + ], + "prettyClassName": "AWSCognitoUserManagementRequestBus" + } + } + }, + { + "Id": { + "id": 40379253650230 + }, + "Name": "SC-Node(Print)", + "Components": { + "Component_[17066281136316039638]": { + "$type": "Print", + "Id": 17066281136316039638, + "Slots": [ + { + "id": { + "m_id": "{CE1EC1C9-479F-451E-BC7B-CF9A76C141B8}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "Input signal", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{6BFF8DF8-6D3B-47AD-8A6A-CCEAAC7B0B26}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "m_format": "Signup Fail", + "m_unresolvedString": [ + "Signup Fail" + ] + } + } + }, + { + "Id": { + "id": 40370663715638 + }, + "Name": "SC-Node(Print)", + "Components": { + "Component_[17066281136316039638]": { + "$type": "Print", + "Id": 17066281136316039638, + "Slots": [ + { + "id": { + "m_id": "{CE1EC1C9-479F-451E-BC7B-CF9A76C141B8}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "Input signal", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{6BFF8DF8-6D3B-47AD-8A6A-CCEAAC7B0B26}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "m_format": "Signup Success", + "m_unresolvedString": [ + "Signup Success" + ] + } + } + }, + { + "Id": { + "id": 40400728486710 + }, + "Name": "EBusEventHandler", + "Components": { + "Component_[3253175345351481273]": { + "$type": "EBusEventHandler", + "Id": 3253175345351481273, + "Slots": [ + { + "id": { + "m_id": "{1C7259B4-0505-48A2-B942-55CFBAE0F40D}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Connect", + "toolTip": "Connect this event handler to the specified entity.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{274A7EFC-3117-4533-9F4D-814BB5E3A28C}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Disconnect", + "toolTip": "Disconnect this event handler.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{37273EA1-C478-455A-8D8A-49BA9311B3D8}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnConnected", + "toolTip": "Signaled when a connection has taken place.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{F66434BA-1E32-412A-9045-A4331871112B}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnDisconnected", + "toolTip": "Signaled when this event handler is disconnected.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{69CD56BC-D598-4D76-83E1-1F1A9B6A9058}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnFailure", + "toolTip": "Signaled when it is not possible to connect this handler.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{1D2D3BD0-1165-45A6-8310-3AB4E58513F5}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{6AA62561-DA82-4797-9DC4-615AB767F828}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnEmailSignUpSuccess", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{6C1ECF44-14DE-4A96-A8BD-E317C80438C6}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{373F06F3-3019-469D-9668-B312D3E29617}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnEmailSignUpFail", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{526BB736-AF73-4874-AB1F-5A31E32599E0}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{B156FBD5-F8D1-4856-9ED4-B39C0C2F1FBE}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnPhoneSignUpSuccess", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{1CABB198-AE36-4929-A562-2C87F7A90946}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{BF5D1487-52AB-484E-B3A8-254126BCFBC8}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnPhoneSignUpFail", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{E1E14BF9-5FC4-46F7-9284-BD971D6FBC7B}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnConfirmSignUpSuccess", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{B3E9DEFA-DD55-495C-BCBD-BBB64C2F40E6}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{E8B771CC-6CB6-4A6F-9642-123E6A62BC39}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnConfirmSignUpFail", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{52C45020-B7A6-452C-9624-0BA2CE4675A8}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnForgotPasswordSuccess", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{61352C5D-E634-4E36-86AE-95B0AA0C67F1}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{C4F9C1F5-8CE0-4FAB-8068-2CDACDFBC7FB}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnForgotPasswordFail", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{5AB5FB72-2D60-45C6-B2F2-6509AF91DCAF}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnConfirmForgotPasswordSuccess", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{AA2660EA-141C-43E0-9B05-E233CF7637B9}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{6FF2A7E9-1716-47BC-97D6-77E7B108058A}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnConfirmForgotPasswordFail", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{D50F225E-0251-4E45-B261-D66E11F8E259}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnEnableMFASuccess", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{6926905E-56CF-424A-BD39-07CAC731CEE2}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{D8F3BE2B-E240-4AA3-BD3F-AECE3BA146B0}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnEnableMFAFail", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + } + ], + "m_eventMap": [ + { + "Key": { + "Value": 91595643 + }, + "Value": { + "m_eventName": "OnEnableMFAFail", + "m_eventId": { + "Value": 91595643 + }, + "m_eventSlotId": { + "m_id": "{D8F3BE2B-E240-4AA3-BD3F-AECE3BA146B0}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{6926905E-56CF-424A-BD39-07CAC731CEE2}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 263629761 + }, + "Value": { + "m_eventName": "OnPhoneSignUpSuccess", + "m_eventId": { + "Value": 263629761 + }, + "m_eventSlotId": { + "m_id": "{B156FBD5-F8D1-4856-9ED4-B39C0C2F1FBE}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{526BB736-AF73-4874-AB1F-5A31E32599E0}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 545635257 + }, + "Value": { + "m_eventName": "OnConfirmForgotPasswordFail", + "m_eventId": { + "Value": 545635257 + }, + "m_eventSlotId": { + "m_id": "{6FF2A7E9-1716-47BC-97D6-77E7B108058A}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{AA2660EA-141C-43E0-9B05-E233CF7637B9}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 613710915 + }, + "Value": { + "m_eventName": "OnEmailSignUpSuccess", + "m_eventId": { + "Value": 613710915 + }, + "m_eventSlotId": { + "m_id": "{6AA62561-DA82-4797-9DC4-615AB767F828}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{1D2D3BD0-1165-45A6-8310-3AB4E58513F5}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 885366379 + }, + "Value": { + "m_eventName": "OnForgotPasswordSuccess", + "m_eventId": { + "Value": 885366379 + }, + "m_eventSlotId": { + "m_id": "{52C45020-B7A6-452C-9624-0BA2CE4675A8}" + } + } + }, + { + "Key": { + "Value": 1053871188 + }, + "Value": { + "m_eventName": "OnEnableMFASuccess", + "m_eventId": { + "Value": 1053871188 + }, + "m_eventSlotId": { + "m_id": "{D50F225E-0251-4E45-B261-D66E11F8E259}" + } + } + }, + { + "Key": { + "Value": 1936419598 + }, + "Value": { + "m_eventName": "OnConfirmSignUpFail", + "m_eventId": { + "Value": 1936419598 + }, + "m_eventSlotId": { + "m_id": "{E8B771CC-6CB6-4A6F-9642-123E6A62BC39}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{B3E9DEFA-DD55-495C-BCBD-BBB64C2F40E6}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 2472403994 + }, + "Value": { + "m_eventName": "OnConfirmForgotPasswordSuccess", + "m_eventId": { + "Value": 2472403994 + }, + "m_eventSlotId": { + "m_id": "{5AB5FB72-2D60-45C6-B2F2-6509AF91DCAF}" + } + } + }, + { + "Key": { + "Value": 2512783036 + }, + "Value": { + "m_eventName": "OnConfirmSignUpSuccess", + "m_eventId": { + "Value": 2512783036 + }, + "m_eventSlotId": { + "m_id": "{E1E14BF9-5FC4-46F7-9284-BD971D6FBC7B}" + } + } + }, + { + "Key": { + "Value": 3917632075 + }, + "Value": { + "m_eventName": "OnForgotPasswordFail", + "m_eventId": { + "Value": 3917632075 + }, + "m_eventSlotId": { + "m_id": "{C4F9C1F5-8CE0-4FAB-8068-2CDACDFBC7FB}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{61352C5D-E634-4E36-86AE-95B0AA0C67F1}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 4207060091 + }, + "Value": { + "m_eventName": "OnEmailSignUpFail", + "m_eventId": { + "Value": 4207060091 + }, + "m_eventSlotId": { + "m_id": "{373F06F3-3019-469D-9668-B312D3E29617}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{6C1ECF44-14DE-4A96-A8BD-E317C80438C6}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 4239863912 + }, + "Value": { + "m_eventName": "OnPhoneSignUpFail", + "m_eventId": { + "Value": 4239863912 + }, + "m_eventSlotId": { + "m_id": "{BF5D1487-52AB-484E-B3A8-254126BCFBC8}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{1CABB198-AE36-4929-A562-2C87F7A90946}" + } + ], + "m_numExpectedArguments": 1 + } + } + ], + "m_ebusName": "AWSCognitoUserManagementNotificationBus", + "m_busId": { + "Value": 447348268 + } + } + } + }, + { + "Id": { + "id": 40383548617526 + }, + "Name": "SC-Node(EmailSignUpAsync)", + "Components": { + "Component_[3828998640319414642]": { + "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", + "Id": 3828998640319414642, + "Slots": [ + { + "id": { + "m_id": "{E27599AA-ECCC-479A-98BF-48AEE61B2555}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + null + ], + "slotName": "String: 0", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{402E454D-087A-4B52-8559-0B4094339424}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + null + ], + "slotName": "String: 1", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{37232683-A75B-40D3-BD2C-ACBF718622AC}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + null + ], + "slotName": "String: 2", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{A0AF5A68-C8DD-4219-894A-4D7AF713FDFE}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{49E3F422-E17F-4540-8C55-CDDB3F8AB04D}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "Datums": [ + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 5 + }, + "isNullPointer": false, + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "value": "test1", + "label": "String: 0" + }, + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 5 + }, + "isNullPointer": false, + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "value": "Test1test1!", + "label": "String: 1" + }, + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 5 + }, + "isNullPointer": false, + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "value": "test@test.com", + "label": "String: 2" + } + ], + "methodType": 0, + "methodName": "EmailSignUpAsync", + "className": "AWSCognitoUserManagementRequestBus", + "resultSlotIDs": [ + {} + ], + "prettyClassName": "AWSCognitoUserManagementRequestBus" + } + } + }, + { + "Id": { + "id": 40374958682934 + }, + "Name": "EBusEventHandler", + "Components": { + "Component_[6190924263230371473]": { + "$type": "EBusEventHandler", + "Id": 6190924263230371473, + "Slots": [ + { + "id": { + "m_id": "{0D5A6F1C-B9DA-4B49-8A54-1E6C2A959643}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Connect", + "toolTip": "Connect this event handler to the specified entity.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{6F93EEBD-6EE6-4204-8B56-4D3F17FC74AD}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Disconnect", + "toolTip": "Disconnect this event handler.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{41DFB9B0-EDFA-4DE6-B0EB-E6C8F6A9ED89}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnConnected", + "toolTip": "Signaled when a connection has taken place.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{556C7487-6211-4173-8284-51479E4C8EF7}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnDisconnected", + "toolTip": "Signaled when this event handler is disconnected.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{FC800E36-B7D5-46AE-920A-0A18A2D17EB2}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnFailure", + "toolTip": "Signaled when it is not possible to connect this handler.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{5F4DB496-438B-4ED5-96A0-904FE5FAC305}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{B24F20EF-0119-4BF3-86DF-AD101B534F6C}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnEmailSignUpSuccess", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{BA735BFB-DE2B-429A-BEE9-59BA712F5F9F}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{7EC15743-5DA5-4F9F-BF26-318CFAD73C48}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnEmailSignUpFail", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{4A63B81E-A64D-448A-AAC5-F232393F3239}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{694A22A4-0218-40EB-BC46-91F14C7A5691}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnPhoneSignUpSuccess", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{E5EA8BAC-6706-4E56-868A-60EB944EEF59}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{F1DA9F8C-99A5-4604-A2EF-36AA7E2F29D8}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnPhoneSignUpFail", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{2A9AD20F-7C0F-4BCD-AE49-59763368ADF3}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnConfirmSignUpSuccess", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{708EA595-441A-4BED-B753-D612F9D8D48C}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{7AA88F7B-82B5-4EB6-BD6F-67C7662A5E53}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnConfirmSignUpFail", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{2E3F658E-D482-49EA-9F96-C7421D85E490}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnForgotPasswordSuccess", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{72F9D996-4A42-4740-A1F1-40CF2A922558}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{16098C3C-67EF-456D-8CEC-3E447D25FBE9}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnForgotPasswordFail", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{3DA27A98-45AF-4A95-87CE-65D7A2C415A5}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnConfirmForgotPasswordSuccess", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{593C97CF-5549-4E7B-8303-4FC61575BDD8}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{CE9ED266-ACD3-4182-A63A-D989B204781B}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnConfirmForgotPasswordFail", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{C1BC60F1-4BE6-425D-AB01-B500171F095D}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnEnableMFASuccess", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{B884A8B1-7037-46A9-8C62-0E2D46737C90}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{1A8274FB-20C8-42B3-B220-098EBEBCA53B}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnEnableMFAFail", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + } + ], + "m_eventMap": [ + { + "Key": { + "Value": 91595643 + }, + "Value": { + "m_eventName": "OnEnableMFAFail", + "m_eventId": { + "Value": 91595643 + }, + "m_eventSlotId": { + "m_id": "{1A8274FB-20C8-42B3-B220-098EBEBCA53B}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{B884A8B1-7037-46A9-8C62-0E2D46737C90}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 263629761 + }, + "Value": { + "m_eventName": "OnPhoneSignUpSuccess", + "m_eventId": { + "Value": 263629761 + }, + "m_eventSlotId": { + "m_id": "{694A22A4-0218-40EB-BC46-91F14C7A5691}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{4A63B81E-A64D-448A-AAC5-F232393F3239}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 545635257 + }, + "Value": { + "m_eventName": "OnConfirmForgotPasswordFail", + "m_eventId": { + "Value": 545635257 + }, + "m_eventSlotId": { + "m_id": "{CE9ED266-ACD3-4182-A63A-D989B204781B}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{593C97CF-5549-4E7B-8303-4FC61575BDD8}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 613710915 + }, + "Value": { + "m_eventName": "OnEmailSignUpSuccess", + "m_eventId": { + "Value": 613710915 + }, + "m_eventSlotId": { + "m_id": "{B24F20EF-0119-4BF3-86DF-AD101B534F6C}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{5F4DB496-438B-4ED5-96A0-904FE5FAC305}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 885366379 + }, + "Value": { + "m_eventName": "OnForgotPasswordSuccess", + "m_eventId": { + "Value": 885366379 + }, + "m_eventSlotId": { + "m_id": "{2E3F658E-D482-49EA-9F96-C7421D85E490}" + } + } + }, + { + "Key": { + "Value": 1053871188 + }, + "Value": { + "m_eventName": "OnEnableMFASuccess", + "m_eventId": { + "Value": 1053871188 + }, + "m_eventSlotId": { + "m_id": "{C1BC60F1-4BE6-425D-AB01-B500171F095D}" + } + } + }, + { + "Key": { + "Value": 1936419598 + }, + "Value": { + "m_eventName": "OnConfirmSignUpFail", + "m_eventId": { + "Value": 1936419598 + }, + "m_eventSlotId": { + "m_id": "{7AA88F7B-82B5-4EB6-BD6F-67C7662A5E53}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{708EA595-441A-4BED-B753-D612F9D8D48C}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 2472403994 + }, + "Value": { + "m_eventName": "OnConfirmForgotPasswordSuccess", + "m_eventId": { + "Value": 2472403994 + }, + "m_eventSlotId": { + "m_id": "{3DA27A98-45AF-4A95-87CE-65D7A2C415A5}" + } + } + }, + { + "Key": { + "Value": 2512783036 + }, + "Value": { + "m_eventName": "OnConfirmSignUpSuccess", + "m_eventId": { + "Value": 2512783036 + }, + "m_eventSlotId": { + "m_id": "{2A9AD20F-7C0F-4BCD-AE49-59763368ADF3}" + } + } + }, + { + "Key": { + "Value": 3917632075 + }, + "Value": { + "m_eventName": "OnForgotPasswordFail", + "m_eventId": { + "Value": 3917632075 + }, + "m_eventSlotId": { + "m_id": "{16098C3C-67EF-456D-8CEC-3E447D25FBE9}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{72F9D996-4A42-4740-A1F1-40CF2A922558}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 4207060091 + }, + "Value": { + "m_eventName": "OnEmailSignUpFail", + "m_eventId": { + "Value": 4207060091 + }, + "m_eventSlotId": { + "m_id": "{7EC15743-5DA5-4F9F-BF26-318CFAD73C48}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{BA735BFB-DE2B-429A-BEE9-59BA712F5F9F}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 4239863912 + }, + "Value": { + "m_eventName": "OnPhoneSignUpFail", + "m_eventId": { + "Value": 4239863912 + }, + "m_eventSlotId": { + "m_id": "{F1DA9F8C-99A5-4604-A2EF-36AA7E2F29D8}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{E5EA8BAC-6706-4E56-868A-60EB944EEF59}" + } + ], + "m_numExpectedArguments": 1 + } + } + ], + "m_ebusName": "AWSCognitoUserManagementNotificationBus", + "m_busId": { + "Value": 447348268 + } + } + } + }, + { + "Id": { + "id": 40396433519414 + }, + "Name": "EBusEventHandler", + "Components": { + "Component_[9562653061197598154]": { + "$type": "EBusEventHandler", + "Id": 9562653061197598154, + "Slots": [ + { + "id": { + "m_id": "{C7C58DC9-B78B-42B9-B2B5-478782DF46CC}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Connect", + "toolTip": "Connect this event handler to the specified entity.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{FA026675-B1BE-491C-8EBF-E69CC1DE4C55}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Disconnect", + "toolTip": "Disconnect this event handler.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{3C98E6EB-3C18-4068-B823-DB58C576DD78}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnConnected", + "toolTip": "Signaled when a connection has taken place.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{57A45446-FFB1-4C50-8AAE-B8ECA6972D6E}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnDisconnected", + "toolTip": "Signaled when this event handler is disconnected.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{A58F08C9-B5EF-4B7B-9CA0-D7971A0433F8}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnFailure", + "toolTip": "Signaled when it is not possible to connect this handler.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{725CF674-BE9B-46C9-97A9-F479446C0229}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Source", + "toolTip": "ID used to connect on a specific Event address (Type: EntityId)", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{3CBA71E9-D536-4236-9663-EB756D317B5C}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "EntityID", + "DisplayDataType": { + "m_type": 1 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{69BC10FD-BF05-4377-91D0-88540202AEAB}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnEntityActivated", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{B715798E-51A1-4A13-8597-D0FED7A84D64}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "EntityID", + "DisplayDataType": { + "m_type": 1 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{0D15697C-1B42-4F19-BD0D-3A19CB516B61}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnEntityDeactivated", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + } + ], + "Datums": [ + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 1 + }, + "isNullPointer": false, + "$type": "EntityId", + "value": { + "id": 2901262558 + }, + "label": "Source" + } + ], + "m_eventMap": [ + { + "Key": { + "Value": 245425936 + }, + "Value": { + "m_eventName": "OnEntityActivated", + "m_eventId": { + "Value": 245425936 + }, + "m_eventSlotId": { + "m_id": "{69BC10FD-BF05-4377-91D0-88540202AEAB}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{3CBA71E9-D536-4236-9663-EB756D317B5C}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 4273369222 + }, + "Value": { + "m_eventName": "OnEntityDeactivated", + "m_eventId": { + "Value": 4273369222 + }, + "m_eventSlotId": { + "m_id": "{0D15697C-1B42-4F19-BD0D-3A19CB516B61}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{B715798E-51A1-4A13-8597-D0FED7A84D64}" + } + ], + "m_numExpectedArguments": 1 + } + } + ], + "m_ebusName": "EntityBus", + "m_busId": { + "Value": 3358774020 + } + } + } + } + ], + "m_connections": [ + { + "Id": { + "id": 40405023454006 + }, + "Name": "srcEndpoint=(Initialize: Out), destEndpoint=(Initialize: In)", + "Components": { + "Component_[2481873747935739489]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 2481873747935739489, + "sourceEndpoint": { + "nodeId": { + "id": 40387843584822 + }, + "slotId": { + "m_id": "{12154F8B-6329-44B2-B220-25BBB4F4DA8C}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 40392138552118 + }, + "slotId": { + "m_id": "{399A9DE3-F888-4941-95ED-51DAA3577806}" + } + } + } + } + }, + { + "Id": { + "id": 40409318421302 + }, + "Name": "srcEndpoint=(Initialize: Out), destEndpoint=(EmailSignUpAsync: In)", + "Components": { + "Component_[7194362106206674212]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 7194362106206674212, + "sourceEndpoint": { + "nodeId": { + "id": 40392138552118 + }, + "slotId": { + "m_id": "{7E46FB7B-9FFF-49BE-8A8B-59A6144BB567}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 40383548617526 + }, + "slotId": { + "m_id": "{A0AF5A68-C8DD-4219-894A-4D7AF713FDFE}" + } + } + } + } + }, + { + "Id": { + "id": 40413613388598 + }, + "Name": "srcEndpoint=(AWSCognitoUserManagementNotificationBus Handler: ExecutionSlot:OnEmailSignUpSuccess), destEndpoint=(Print: In)", + "Components": { + "Component_[16780678604896909105]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 16780678604896909105, + "sourceEndpoint": { + "nodeId": { + "id": 40400728486710 + }, + "slotId": { + "m_id": "{6AA62561-DA82-4797-9DC4-615AB767F828}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 40370663715638 + }, + "slotId": { + "m_id": "{CE1EC1C9-479F-451E-BC7B-CF9A76C141B8}" + } + } + } + } + }, + { + "Id": { + "id": 40417908355894 + }, + "Name": "srcEndpoint=(AWSCognitoUserManagementNotificationBus Handler: ExecutionSlot:OnEmailSignUpFail), destEndpoint=(Print: In)", + "Components": { + "Component_[10089558926172181947]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 10089558926172181947, + "sourceEndpoint": { + "nodeId": { + "id": 40374958682934 + }, + "slotId": { + "m_id": "{7EC15743-5DA5-4F9F-BF26-318CFAD73C48}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 40379253650230 + }, + "slotId": { + "m_id": "{CE1EC1C9-479F-451E-BC7B-CF9A76C141B8}" + } + } + } + } + }, + { + "Id": { + "id": 40422203323190 + }, + "Name": "srcEndpoint=(EntityBus Handler: ExecutionSlot:OnEntityActivated), destEndpoint=(Initialize: In)", + "Components": { + "Component_[4722263728953193176]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 4722263728953193176, + "sourceEndpoint": { + "nodeId": { + "id": 40396433519414 + }, + "slotId": { + "m_id": "{69BC10FD-BF05-4377-91D0-88540202AEAB}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 40387843584822 + }, + "slotId": { + "m_id": "{3D4180D8-264F-40A6-B651-8AD9968800CD}" + } + } + } + } + } + ] + }, + "m_assetType": "{3E2AC8CD-713F-453E-967F-29517F331784}", + "versionData": { + "_grammarVersion": 1, + "_runtimeVersion": 1 + }, + "m_variableCounter": 1, + "GraphCanvasData": [ + { + "Key": { + "id": 40366368748342 + }, + "Value": { + "ComponentData": { + "{5F84B500-8C45-40D1-8EFC-A5306B241444}": { + "$type": "SceneComponentSaveData", + "ViewParams": { + "Scale": 1.6678291666562495, + "AnchorX": -1140.404541015625, + "AnchorY": -510.2441101074219 + } + } + } + } + }, + { + "Key": { + "id": 40370663715638 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "StringNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 360.0, + -100.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{EE80C02E-C46C-4F8B-9ED1-F455EAA1A180}" + } + } + } + }, + { + "Key": { + "id": 40374958682934 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + -140.0, + 120.0 + ] + }, + "{9E81C95F-89C0-4476-8E82-63CCC4E52E04}": { + "$type": "EBusHandlerNodeDescriptorSaveData", + "EventIds": [ + { + "Value": 4207060091 + } + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{0CF6BEC2-1C77-4588-9E0D-46E669A885D2}" + } + } + } + }, + { + "Key": { + "id": 40379253650230 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "StringNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 360.0, + 120.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{7D65DC37-A004-4B96-B546-3AA21955B483}" + } + } + } + }, + { + "Key": { + "id": 40383548617526 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MethodNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + -480.0, + -20.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{0A62049A-7A6F-49C4-8941-2FFE8C3C3D64}" + } + } + } + }, + { + "Key": { + "id": 40387843584822 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MethodNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + -520.0, + -360.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{F194EF69-4648-4E48-8E09-0BA9D7CFEFAB}" + } + } + } + }, + { + "Key": { + "id": 40392138552118 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MethodNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + -880.0, + -20.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{64AC1AA7-3D00-49C8-B721-FD8FA1F12974}" + } + } + } + }, + { + "Key": { + "id": 40396433519414 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + -840.0, + -420.0 + ] + }, + "{9E81C95F-89C0-4476-8E82-63CCC4E52E04}": { + "$type": "EBusHandlerNodeDescriptorSaveData", + "EventIds": [ + { + "Value": 245425936 + } + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{BE098530-CD45-403F-A8E6-19B1AF955998}" + } + } + } + }, + { + "Key": { + "id": 40400728486710 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + -140.0, + -120.0 + ] + }, + "{9E81C95F-89C0-4476-8E82-63CCC4E52E04}": { + "$type": "EBusHandlerNodeDescriptorSaveData", + "EventIds": [ + { + "Value": 613710915 + } + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{30CAA4F3-6D33-487A-AA24-5A0FDB7E44F7}" + } + } + } + } + ], + "StatisticsHelper": { + "InstanceCounter": [ + { + "Key": 5842116761103598202, + "Value": 1 + }, + { + "Key": 5842117047185225035, + "Value": 1 + }, + { + "Key": 5842117058899013251, + "Value": 1 + }, + { + "Key": 10684225535275896474, + "Value": 2 + }, + { + "Key": 13774516312719521631, + "Value": 1 + }, + { + "Key": 13774516352051377806, + "Value": 1 + }, + { + "Key": 13774516392820282243, + "Value": 1 + } + ] + } + }, + "Component_[2611898449683772344]": { + "$type": "EditorGraphVariableManagerComponent", + "Id": 2611898449683772344, + "m_variableData": { + "m_nameVariableMap": [ + { + "Key": { + "m_id": "{B26AAA33-F9F0-4CC4-81B2-E7D666AD6AD7}" + }, + "Value": { + "Datum": { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 4, + "m_azType": "{99DAD0BC-740E-5E82-826B-8FC7968CC02C}" + }, + "isNullPointer": false, + "$type": "{99DAD0BC-740E-5E82-826B-8FC7968CC02C} AZStd::vector", + "value": [ + "AWSCognitoIDP" + ], + "label": "Array" + }, + "VariableId": { + "m_id": "{B26AAA33-F9F0-4CC4-81B2-E7D666AD6AD7}" + }, + "VariableName": "AuthenitcationProviders" + } + } + ] + } + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Levels/Prefab/Base/Base.prefab b/AutomatedTesting/Levels/Prefab/Base/Base.prefab new file mode 100644 index 0000000000..f7e42e7731 --- /dev/null +++ b/AutomatedTesting/Levels/Prefab/Base/Base.prefab @@ -0,0 +1,53 @@ +{ + "ContainerEntity": { + "Id": "Entity_[1146574390643]", + "Name": "Level", + "Components": { + "Component_[10641544592923449938]": { + "$type": "EditorInspectorComponent", + "Id": 10641544592923449938 + }, + "Component_[12039882709170782873]": { + "$type": "EditorOnlyEntityComponent", + "Id": 12039882709170782873 + }, + "Component_[12265484671603697631]": { + "$type": "EditorPendingCompositionComponent", + "Id": 12265484671603697631 + }, + "Component_[14126657869720434043]": { + "$type": "EditorEntitySortComponent", + "Id": 14126657869720434043 + }, + "Component_[15230859088967841193]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 15230859088967841193, + "Parent Entity": "" + }, + "Component_[16239496886950819870]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 16239496886950819870 + }, + "Component_[5688118765544765547]": { + "$type": "EditorEntityIconComponent", + "Id": 5688118765544765547 + }, + "Component_[6545738857812235305]": { + "$type": "SelectionComponent", + "Id": 6545738857812235305 + }, + "Component_[7247035804068349658]": { + "$type": "EditorPrefabComponent", + "Id": 7247035804068349658 + }, + "Component_[9307224322037797205]": { + "$type": "EditorLockComponent", + "Id": 9307224322037797205 + }, + "Component_[9562516168917670048]": { + "$type": "EditorVisibilityComponent", + "Id": 9562516168917670048 + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Objects/Characters/Jack/Jack.fbx b/AutomatedTesting/Objects/Characters/Jack/Jack.fbx index bccd5cce24..2e55fdd1e7 100644 --- a/AutomatedTesting/Objects/Characters/Jack/Jack.fbx +++ b/AutomatedTesting/Objects/Characters/Jack/Jack.fbx @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ba9a2cd047a5ee696aaeed882869017a02fd4f5eeee91b6b2bfb830ad1e5ee15 -size 10927631 +oid sha256:c285cdf72ebe4c274f8d1fbab6ff558f9344d4fa62fb9d07cf11f7511ffaaac9 +size 2177072 diff --git a/AutomatedTesting/Objects/Characters/Jack/Jack.fbx.assetinfo b/AutomatedTesting/Objects/Characters/Jack/Jack.fbx.assetinfo new file mode 100644 index 0000000000..2de6d987d7 --- /dev/null +++ b/AutomatedTesting/Objects/Characters/Jack/Jack.fbx.assetinfo @@ -0,0 +1,328 @@ +{ + "values": [ + { + "$type": "ActorGroup", + "name": "Jack", + "selectedRootBone": "RootNode.jack_root", + "id": "{B7194F91-D8A1-5D5D-AC6D-DDEBC087D80D}", + "rules": { + "rules": [ + { + "$type": "MetaDataRule", + "metaData": "AdjustActor -actorID $(ACTORID) -name \"Jack\"\nActorSetCollisionMeshes -actorID $(ACTORID) -lod 0 -nodeList \"\"\nAdjustActor -actorID $(ACTORID) -nodesExcludedFromBounds \"\" -nodeAction \"select\"\nAdjustActor -actorID $(ACTORID) -nodeAction \"replace\" -attachmentNodes \"\"\nAdjustActor -actorID $(ACTORID) -motionExtractionNodeName \"jack_root\"\nAdjustActor -actorID $(ACTORID) -mirrorSetup \"\"\n" + } + ] + } + }, + { + "$type": "{5B03C8E6-8CEE-4DA0-A7FA-CD88689DD45B} MeshGroup", + "id": "{BF2CCF49-9BE0-5103-987A-84649A974991}", + "name": "Jack", + "NodeSelectionList": { + "unselectedNodes": [ + "RootNode", + "RootNode.jack_root", + "RootNode.jack_meshZUp", + "RootNode.jack_root.Bip01__pelvis", + "RootNode.jack_meshZUp.jack_meshZUp_1", + "RootNode.jack_meshZUp.jack_meshZUp_2", + "RootNode.jack_root.Bip01__pelvis.transform", + "RootNode.jack_root.Bip01__pelvis.l_upLeg", + "RootNode.jack_root.Bip01__pelvis.r_upLeg", + "RootNode.jack_root.Bip01__pelvis.spine1", + "RootNode.jack_meshZUp.jack_meshZUp_1.Bitangent", + "RootNode.jack_meshZUp.jack_meshZUp_1.SkinWeight_", + "RootNode.jack_meshZUp.jack_meshZUp_1.transform", + "RootNode.jack_meshZUp.jack_meshZUp_1.Tangent", + "RootNode.jack_meshZUp.jack_meshZUp_1.map1", + "RootNode.jack_meshZUp.jack_meshZUp_1.jack", + "RootNode.jack_meshZUp.jack_meshZUp_2.Bitangent", + "RootNode.jack_meshZUp.jack_meshZUp_2.SkinWeight_", + "RootNode.jack_meshZUp.jack_meshZUp_2.transform", + "RootNode.jack_meshZUp.jack_meshZUp_2.Tangent", + "RootNode.jack_meshZUp.jack_meshZUp_2.map1", + "RootNode.jack_meshZUp.jack_meshZUp_2.jack", + "RootNode.jack_root.Bip01__pelvis.l_upLeg.transform", + "RootNode.jack_root.Bip01__pelvis.l_upLeg.l_upLegRoll", + "RootNode.jack_root.Bip01__pelvis.l_upLeg.l_loLeg", + "RootNode.jack_root.Bip01__pelvis.r_upLeg.transform", + "RootNode.jack_root.Bip01__pelvis.r_upLeg.r_upLegRoll", + "RootNode.jack_root.Bip01__pelvis.r_upLeg.r_loLeg", + "RootNode.jack_root.Bip01__pelvis.spine1.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2", + "RootNode.jack_root.Bip01__pelvis.l_upLeg.l_upLegRoll.transform", + "RootNode.jack_root.Bip01__pelvis.l_upLeg.l_loLeg.transform", + "RootNode.jack_root.Bip01__pelvis.l_upLeg.l_loLeg.l_ankle", + "RootNode.jack_root.Bip01__pelvis.r_upLeg.r_upLegRoll.transform", + "RootNode.jack_root.Bip01__pelvis.r_upLeg.r_loLeg.transform", + "RootNode.jack_root.Bip01__pelvis.r_upLeg.r_loLeg.r_ankle", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3", + "RootNode.jack_root.Bip01__pelvis.l_upLeg.l_loLeg.l_ankle.transform", + "RootNode.jack_root.Bip01__pelvis.l_upLeg.l_loLeg.l_ankle.l_ball", + "RootNode.jack_root.Bip01__pelvis.r_upLeg.r_loLeg.r_ankle.transform", + "RootNode.jack_root.Bip01__pelvis.r_upLeg.r_loLeg.r_ankle.r_ball", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.neck", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr", + "RootNode.jack_root.Bip01__pelvis.l_upLeg.l_loLeg.l_ankle.l_ball.transform", + "RootNode.jack_root.Bip01__pelvis.r_upLeg.r_loLeg.r_ankle.r_ball.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.neck.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.neck.head", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.neck.head.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_upArmRoll", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_upArmRoll", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_upArmRoll.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_loArmRoll", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_upArmRoll.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_loArmRoll", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_loArmRoll.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_thumb1", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_index1", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_mid1", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_handProp", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_loArmRoll.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_thumb1", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_index1", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_mid1", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_handProp", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_thumb1.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_thumb1.l_thumb2", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_index1.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_index1.l_index2", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_mid1.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_mid1.l_mid2", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_ring1", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_pinky1", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_handProp.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_thumb1.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_thumb1.r_thumb2", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_index1.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_index1.r_index2", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_mid1.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_mid1.r_mid2", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_ring1", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_pinky1", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_handProp.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_thumb1.l_thumb2.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_thumb1.l_thumb2.l_thumb3", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_index1.l_index2.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_index1.l_index2.l_index3", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_mid1.l_mid2.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_mid1.l_mid2.l_mid3", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_ring1.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_ring1.l_ring2", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_pinky1.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_pinky1.l_pinky2", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_thumb1.r_thumb2.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_thumb1.r_thumb2.r_thumb3", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_index1.r_index2.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_index1.r_index2.r_index3", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_mid1.r_mid2.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_mid1.r_mid2.r_mid3", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_ring1.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_ring1.r_ring2", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_pinky1.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_pinky1.r_pinky2", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_thumb1.l_thumb2.l_thumb3.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_index1.l_index2.l_index3.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_mid1.l_mid2.l_mid3.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_ring1.l_ring2.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_ring1.l_ring2.l_ring3", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_pinky1.l_pinky2.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_pinky1.l_pinky2.l_pinky3", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_thumb1.r_thumb2.r_thumb3.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_index1.r_index2.r_index3.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_mid1.r_mid2.r_mid3.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_ring1.r_ring2.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_ring1.r_ring2.r_ring3", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_pinky1.r_pinky2.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_pinky1.r_pinky2.r_pinky3", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_ring1.l_ring2.l_ring3.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_pinky1.l_pinky2.l_pinky3.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_ring1.r_ring2.r_ring3.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_pinky1.r_pinky2.r_pinky3.transform" + ] + } + }, + { + "$type": "{07B356B7-3635-40B5-878A-FAC4EFD5AD86} MeshGroup", + "name": "Jack", + "nodeSelectionList": { + "selectedNodes": [ + "RootNode", + "RootNode.jack_root", + "RootNode.jack_meshZUp", + "RootNode.jack_root.Bip01__pelvis", + "RootNode.jack_meshZUp.jack_meshZUp_1", + "RootNode.jack_meshZUp.jack_meshZUp_2", + "RootNode.jack_root.Bip01__pelvis.transform", + "RootNode.jack_root.Bip01__pelvis.l_upLeg", + "RootNode.jack_root.Bip01__pelvis.r_upLeg", + "RootNode.jack_root.Bip01__pelvis.spine1", + "RootNode.jack_meshZUp.jack_meshZUp_1.Bitangent", + "RootNode.jack_meshZUp.jack_meshZUp_1.SkinWeight_", + "RootNode.jack_meshZUp.jack_meshZUp_1.transform", + "RootNode.jack_meshZUp.jack_meshZUp_1.Tangent", + "RootNode.jack_meshZUp.jack_meshZUp_1.map1", + "RootNode.jack_meshZUp.jack_meshZUp_1.jack", + "RootNode.jack_meshZUp.jack_meshZUp_2.Bitangent", + "RootNode.jack_meshZUp.jack_meshZUp_2.SkinWeight_", + "RootNode.jack_meshZUp.jack_meshZUp_2.transform", + "RootNode.jack_meshZUp.jack_meshZUp_2.Tangent", + "RootNode.jack_meshZUp.jack_meshZUp_2.map1", + "RootNode.jack_meshZUp.jack_meshZUp_2.jack", + "RootNode.jack_root.Bip01__pelvis.l_upLeg.transform", + "RootNode.jack_root.Bip01__pelvis.l_upLeg.l_upLegRoll", + "RootNode.jack_root.Bip01__pelvis.l_upLeg.l_loLeg", + "RootNode.jack_root.Bip01__pelvis.r_upLeg.transform", + "RootNode.jack_root.Bip01__pelvis.r_upLeg.r_upLegRoll", + "RootNode.jack_root.Bip01__pelvis.r_upLeg.r_loLeg", + "RootNode.jack_root.Bip01__pelvis.spine1.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2", + "RootNode.jack_root.Bip01__pelvis.l_upLeg.l_upLegRoll.transform", + "RootNode.jack_root.Bip01__pelvis.l_upLeg.l_loLeg.transform", + "RootNode.jack_root.Bip01__pelvis.l_upLeg.l_loLeg.l_ankle", + "RootNode.jack_root.Bip01__pelvis.r_upLeg.r_upLegRoll.transform", + "RootNode.jack_root.Bip01__pelvis.r_upLeg.r_loLeg.transform", + "RootNode.jack_root.Bip01__pelvis.r_upLeg.r_loLeg.r_ankle", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3", + "RootNode.jack_root.Bip01__pelvis.l_upLeg.l_loLeg.l_ankle.transform", + "RootNode.jack_root.Bip01__pelvis.l_upLeg.l_loLeg.l_ankle.l_ball", + "RootNode.jack_root.Bip01__pelvis.r_upLeg.r_loLeg.r_ankle.transform", + "RootNode.jack_root.Bip01__pelvis.r_upLeg.r_loLeg.r_ankle.r_ball", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.neck", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr", + "RootNode.jack_root.Bip01__pelvis.l_upLeg.l_loLeg.l_ankle.l_ball.transform", + "RootNode.jack_root.Bip01__pelvis.r_upLeg.r_loLeg.r_ankle.r_ball.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.neck.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.neck.head", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.neck.head.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_upArmRoll", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_upArmRoll", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_upArmRoll.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_loArmRoll", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_upArmRoll.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_loArmRoll", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_loArmRoll.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_thumb1", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_index1", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_mid1", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_handProp", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_loArmRoll.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_thumb1", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_index1", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_mid1", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_handProp", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_thumb1.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_thumb1.l_thumb2", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_index1.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_index1.l_index2", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_mid1.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_mid1.l_mid2", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_ring1", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_pinky1", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_handProp.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_thumb1.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_thumb1.r_thumb2", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_index1.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_index1.r_index2", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_mid1.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_mid1.r_mid2", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_ring1", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_pinky1", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_handProp.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_thumb1.l_thumb2.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_thumb1.l_thumb2.l_thumb3", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_index1.l_index2.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_index1.l_index2.l_index3", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_mid1.l_mid2.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_mid1.l_mid2.l_mid3", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_ring1.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_ring1.l_ring2", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_pinky1.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_pinky1.l_pinky2", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_thumb1.r_thumb2.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_thumb1.r_thumb2.r_thumb3", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_index1.r_index2.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_index1.r_index2.r_index3", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_mid1.r_mid2.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_mid1.r_mid2.r_mid3", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_ring1.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_ring1.r_ring2", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_pinky1.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_pinky1.r_pinky2", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_thumb1.l_thumb2.l_thumb3.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_index1.l_index2.l_index3.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_mid1.l_mid2.l_mid3.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_ring1.l_ring2.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_ring1.l_ring2.l_ring3", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_pinky1.l_pinky2.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_pinky1.l_pinky2.l_pinky3", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_thumb1.r_thumb2.r_thumb3.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_index1.r_index2.r_index3.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_mid1.r_mid2.r_mid3.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_ring1.r_ring2.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_ring1.r_ring2.r_ring3", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_pinky1.r_pinky2.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_pinky1.r_pinky2.r_pinky3", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_ring1.l_ring2.l_ring3.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_pinky1.l_pinky2.l_pinky3.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_ring1.r_ring2.r_ring3.transform", + "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_pinky1.r_pinky2.r_pinky3.transform" + ] + }, + "rules": { + "rules": [ + { + "$type": "SkinRule" + }, + { + "$type": "MaterialRule" + } + ] + }, + "id": "{59B1DB76-5B27-5569-8DF6-55296FD0E5D8}" + } + ] +} \ No newline at end of file diff --git a/AutomatedTesting/Objects/Characters/Jack/Jack.mtl b/AutomatedTesting/Objects/Characters/Jack/Jack.mtl deleted file mode 100644 index 2af23cc798..0000000000 --- a/AutomatedTesting/Objects/Characters/Jack/Jack.mtl +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/AutomatedTesting/Objects/Characters/Jack/attachments/arm_plates_lower_01.cgf b/AutomatedTesting/Objects/Characters/Jack/attachments/arm_plates_lower_01.cgf deleted file mode 100644 index a9530b6d1b..0000000000 --- a/AutomatedTesting/Objects/Characters/Jack/attachments/arm_plates_lower_01.cgf +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:bb1c97394454a0a0c3b4aaf8380878aac3f7bedc9091ec920963932ad6ad2290 -size 30484 diff --git a/AutomatedTesting/Objects/Characters/Jack/attachments/arm_plates_upper_01.cgf b/AutomatedTesting/Objects/Characters/Jack/attachments/arm_plates_upper_01.cgf deleted file mode 100644 index 781ff1fe50..0000000000 --- a/AutomatedTesting/Objects/Characters/Jack/attachments/arm_plates_upper_01.cgf +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d090219fc20e7c1d9f0c187f976a7cb55e5b27b39e087aa8281ac794f314cb32 -size 22364 diff --git a/AutomatedTesting/Objects/Characters/Jack/attachments/back_pack_01.cgf b/AutomatedTesting/Objects/Characters/Jack/attachments/back_pack_01.cgf deleted file mode 100644 index 0e59a1393d..0000000000 --- a/AutomatedTesting/Objects/Characters/Jack/attachments/back_pack_01.cgf +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8fa78264ca46a2f201e24c3ba6a543e713bf9fd984df0a10f52b191d21077227 -size 106676 diff --git a/AutomatedTesting/Objects/Characters/Jack/attachments/head_aerial_01.cgf b/AutomatedTesting/Objects/Characters/Jack/attachments/head_aerial_01.cgf deleted file mode 100644 index cc54ba4b64..0000000000 --- a/AutomatedTesting/Objects/Characters/Jack/attachments/head_aerial_01.cgf +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ebf610eecec9a4da2d5c9260c48b81f6a04eaf7686d69850ad9f5d06fdbcf183 -size 12940 diff --git a/AutomatedTesting/Objects/Characters/Jack/attachments/jack_matGroup.mtl b/AutomatedTesting/Objects/Characters/Jack/attachments/jack_matGroup.mtl deleted file mode 100644 index ebade464ec..0000000000 --- a/AutomatedTesting/Objects/Characters/Jack/attachments/jack_matGroup.mtl +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/AutomatedTesting/Objects/Characters/Jack/attachments/leg_plate_l_01.cgf b/AutomatedTesting/Objects/Characters/Jack/attachments/leg_plate_l_01.cgf deleted file mode 100644 index 3ffabb1464..0000000000 --- a/AutomatedTesting/Objects/Characters/Jack/attachments/leg_plate_l_01.cgf +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:30afe8cf6e4aca846b07ef81747607afb47c0ff88283f363aca29ded9818c3db -size 8148 diff --git a/AutomatedTesting/Objects/Characters/Jack/attachments/leg_plate_r_01.cgf b/AutomatedTesting/Objects/Characters/Jack/attachments/leg_plate_r_01.cgf deleted file mode 100644 index e98083d030..0000000000 --- a/AutomatedTesting/Objects/Characters/Jack/attachments/leg_plate_r_01.cgf +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:dba25dd8b3840d01aefb69007919b07befc5365fff714493c87cf1eff644d5dc -size 8148 diff --git a/AutomatedTesting/Objects/Characters/Jack/dummyPlane_mat_group.mtl b/AutomatedTesting/Objects/Characters/Jack/dummyPlane_mat_group.mtl deleted file mode 100644 index 4545010b7e..0000000000 --- a/AutomatedTesting/Objects/Characters/Jack/dummyPlane_mat_group.mtl +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/AutomatedTesting/Objects/Characters/Jack/enemy_matGroup.mtl b/AutomatedTesting/Objects/Characters/Jack/enemy_matGroup.mtl deleted file mode 100644 index 523dac897f..0000000000 --- a/AutomatedTesting/Objects/Characters/Jack/enemy_matGroup.mtl +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/AutomatedTesting/Objects/Characters/Jack/enemy_runner_matGroup.mtl b/AutomatedTesting/Objects/Characters/Jack/enemy_runner_matGroup.mtl deleted file mode 100644 index 95c40eeb65..0000000000 --- a/AutomatedTesting/Objects/Characters/Jack/enemy_runner_matGroup.mtl +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/AutomatedTesting/Objects/Characters/Jack/enemy_tank_matGroup.mtl b/AutomatedTesting/Objects/Characters/Jack/enemy_tank_matGroup.mtl deleted file mode 100644 index e0f18e9f69..0000000000 --- a/AutomatedTesting/Objects/Characters/Jack/enemy_tank_matGroup.mtl +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/AutomatedTesting/Objects/Characters/Jack/jack_matGroup.mtl b/AutomatedTesting/Objects/Characters/Jack/jack_matGroup.mtl deleted file mode 100644 index 3927661f97..0000000000 --- a/AutomatedTesting/Objects/Characters/Jack/jack_matGroup.mtl +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_01_ddna.tif b/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_01_ddna.tif deleted file mode 100644 index 378e0ea6ed..0000000000 --- a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_01_ddna.tif +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ca5c900fabf8b5c8c9313a0144886f4da3f812c82e8cffd652d9c61b9bb5b953 -size 4221960 diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_01_ddna.tif.exportsettings b/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_01_ddna.tif.exportsettings deleted file mode 100644 index 10f3182ac9..0000000000 --- a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_01_ddna.tif.exportsettings +++ /dev/null @@ -1 +0,0 @@ -/autooptimizefile=0 /preset=NormalsWithSmoothness /reduce=0 \ No newline at end of file diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_White_diff.tif b/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_White_diff.tif deleted file mode 100644 index 5b4a3c3518..0000000000 --- a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_White_diff.tif +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:80f40a78e4b21dd27f5ddf34337e7d0e2119b7cfa08f0eea38d4b1d63808821f -size 3178996 diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_White_diff.tif.exportsettings b/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_White_diff.tif.exportsettings deleted file mode 100644 index 2d1dccbf99..0000000000 --- a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_White_diff.tif.exportsettings +++ /dev/null @@ -1 +0,0 @@ -/autooptimizefile=0 /preset=Albedo /reduce=0 \ No newline at end of file diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_White_emis.tif b/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_White_emis.tif deleted file mode 100644 index a85ac62f6c..0000000000 --- a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_White_emis.tif +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e5f5e327624e0f1fd35fac141019941b12ad0642c25853be9f7fd5b9b6f91bc5 -size 3168212 diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_White_emis.tif.exportsettings b/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_White_emis.tif.exportsettings deleted file mode 100644 index 2d1dccbf99..0000000000 --- a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_White_emis.tif.exportsettings +++ /dev/null @@ -1 +0,0 @@ -/autooptimizefile=0 /preset=Albedo /reduce=0 \ No newline at end of file diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_black_diff.tif b/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_black_diff.tif deleted file mode 100644 index c861056eea..0000000000 --- a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_black_diff.tif +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:089e74ca9a41967038e16a9107099a73f8e93d39c487ff5bacdde18f418bf761 -size 3176732 diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_emis.tif b/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_emis.tif deleted file mode 100644 index 6909252726..0000000000 --- a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_emis.tif +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d45cd564d2b52575d1ad37b907a7d378871f05f6c9e5569ec73d7973d56599c9 -size 3167984 diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_emis.tif.exportsettings b/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_emis.tif.exportsettings deleted file mode 100644 index 2d1dccbf99..0000000000 --- a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_emis.tif.exportsettings +++ /dev/null @@ -1 +0,0 @@ -/autooptimizefile=0 /preset=Albedo /reduce=0 \ No newline at end of file diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_green_diff.tif b/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_green_diff.tif deleted file mode 100644 index 3254f98355..0000000000 --- a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_green_diff.tif +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:83a872c07f7cbbcb868903429dd8d5a71e8c0b7b0e2cb16cb08b5cb26b02251c -size 3177492 diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_green_diff.tif.exportsettings b/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_green_diff.tif.exportsettings deleted file mode 100644 index 2d1dccbf99..0000000000 --- a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_green_diff.tif.exportsettings +++ /dev/null @@ -1 +0,0 @@ -/autooptimizefile=0 /preset=Albedo /reduce=0 \ No newline at end of file diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_red_diff.tif b/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_red_diff.tif deleted file mode 100644 index b00a8cd13b..0000000000 --- a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_red_diff.tif +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:81c1bc9545a17232523fd97561013534221b3bf8927feefa52bdc757e294c2e2 -size 3179140 diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_red_diff.tif.exportsettings b/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_red_diff.tif.exportsettings deleted file mode 100644 index 2d1dccbf99..0000000000 --- a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_red_diff.tif.exportsettings +++ /dev/null @@ -1 +0,0 @@ -/autooptimizefile=0 /preset=Albedo /reduce=0 \ No newline at end of file diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_spec.tif b/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_spec.tif deleted file mode 100644 index 3e2fb9a003..0000000000 --- a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_spec.tif +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:99f476a56205c80878be7472857a6430ce6dc40f2eb1558de4933a5b79fa2420 -size 814244 diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_spec.tif.exportsettings b/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_spec.tif.exportsettings deleted file mode 100644 index aaaf14a9fe..0000000000 --- a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_spec.tif.exportsettings +++ /dev/null @@ -1 +0,0 @@ -/autooptimizefile=0 /preset=Reflectance /reduce=0 \ No newline at end of file diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_yellow_diff.tif b/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_yellow_diff.tif deleted file mode 100644 index 2c44044576..0000000000 --- a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_yellow_diff.tif +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:366959c8a31356669d47f58d07157171ed369b3e7549b3b65a8b8d153a1477a6 -size 3179956 diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_yellow_diff.tif.exportsettings b/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_yellow_diff.tif.exportsettings deleted file mode 100644 index 2d1dccbf99..0000000000 --- a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_yellow_diff.tif.exportsettings +++ /dev/null @@ -1 +0,0 @@ -/autooptimizefile=0 /preset=Albedo /reduce=0 \ No newline at end of file diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_yellow_emis.tif b/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_yellow_emis.tif deleted file mode 100644 index 4dea311abb..0000000000 --- a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_yellow_emis.tif +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e839924e03ba99459547df1cf5334de3bdad75b18e76176e430e343a979d9f05 -size 3168472 diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_yellow_emis.tif.exportsettings b/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_yellow_emis.tif.exportsettings deleted file mode 100644 index 2d1dccbf99..0000000000 --- a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_yellow_emis.tif.exportsettings +++ /dev/null @@ -1 +0,0 @@ -/autooptimizefile=0 /preset=Albedo /reduce=0 \ No newline at end of file diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/jack_ddna.tif b/AutomatedTesting/Objects/Characters/Jack/textures/jack_ddna.tif deleted file mode 100644 index 57d61f505a..0000000000 --- a/AutomatedTesting/Objects/Characters/Jack/textures/jack_ddna.tif +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:36f537bb5be89fccba1502e9e8f8dfffbf05ea8aa82ac439305e8c2502b01691 -size 16804800 diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/jack_ddna.tif.exportsettings b/AutomatedTesting/Objects/Characters/Jack/textures/jack_ddna.tif.exportsettings deleted file mode 100644 index a90d724812..0000000000 --- a/AutomatedTesting/Objects/Characters/Jack/textures/jack_ddna.tif.exportsettings +++ /dev/null @@ -1 +0,0 @@ -/autooptimizefile=0 /M=50,50,0,50,50,50 /preset=NormalsWithSmoothness /reduce=0 \ No newline at end of file diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/jack_diff.tif b/AutomatedTesting/Objects/Characters/Jack/textures/jack_diff.tif deleted file mode 100644 index a8f5db9a96..0000000000 --- a/AutomatedTesting/Objects/Characters/Jack/textures/jack_diff.tif +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b0457cbbbe1fe7e52fdb9af7ee2bc32df96a453fe248738b35ffe0b8087a28c5 -size 12615988 diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/jack_diff.tif.exportsettings b/AutomatedTesting/Objects/Characters/Jack/textures/jack_diff.tif.exportsettings deleted file mode 100644 index f35416077f..0000000000 --- a/AutomatedTesting/Objects/Characters/Jack/textures/jack_diff.tif.exportsettings +++ /dev/null @@ -1 +0,0 @@ -/autooptimizefile=0 /M=50,50,50,0,50,50 /preset=Albedo /reduce=0 \ No newline at end of file diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/jack_emis.tif b/AutomatedTesting/Objects/Characters/Jack/textures/jack_emis.tif deleted file mode 100644 index f5ee4b43b2..0000000000 --- a/AutomatedTesting/Objects/Characters/Jack/textures/jack_emis.tif +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4ba741103d039bddf72d4834c92a5e069285e31b8be2e7f4e8103f9c5c81694f -size 3167864 diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/jack_emis.tif.exportsettings b/AutomatedTesting/Objects/Characters/Jack/textures/jack_emis.tif.exportsettings deleted file mode 100644 index 8177b5abe6..0000000000 --- a/AutomatedTesting/Objects/Characters/Jack/textures/jack_emis.tif.exportsettings +++ /dev/null @@ -1 +0,0 @@ -/autooptimizefile=0 /M=50,50,0,50,50,50 /preset=Albedo /reduce=0 \ No newline at end of file diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/jack_spec.tif b/AutomatedTesting/Objects/Characters/Jack/textures/jack_spec.tif deleted file mode 100644 index 20fb2114c0..0000000000 --- a/AutomatedTesting/Objects/Characters/Jack/textures/jack_spec.tif +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4d7cb58f48e4df76214509fc01d5170fd38bc447d56af61f008c04a1653c2d20 -size 12614884 diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/jack_spec.tif.exportsettings b/AutomatedTesting/Objects/Characters/Jack/textures/jack_spec.tif.exportsettings deleted file mode 100644 index 7fbb585758..0000000000 --- a/AutomatedTesting/Objects/Characters/Jack/textures/jack_spec.tif.exportsettings +++ /dev/null @@ -1 +0,0 @@ -/autooptimizefile=0 /M=50,50,50,0,50,50 /preset=Reflectance /reduce=0 \ No newline at end of file diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/jack_spec_02_spec.tif b/AutomatedTesting/Objects/Characters/Jack/textures/jack_spec_02_spec.tif deleted file mode 100644 index 3334a5c39b..0000000000 --- a/AutomatedTesting/Objects/Characters/Jack/textures/jack_spec_02_spec.tif +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:80a2c56bfcb8c98bf5a72ec9fdb5fcc6eae28ba1c3c26efad5c8a36e6105f1d0 -size 3173936 diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/jack_spec_02_spec.tif.exportsettings b/AutomatedTesting/Objects/Characters/Jack/textures/jack_spec_02_spec.tif.exportsettings deleted file mode 100644 index aaaf14a9fe..0000000000 --- a/AutomatedTesting/Objects/Characters/Jack/textures/jack_spec_02_spec.tif.exportsettings +++ /dev/null @@ -1 +0,0 @@ -/autooptimizefile=0 /preset=Reflectance /reduce=0 \ No newline at end of file diff --git a/AutomatedTesting/Registry/C15556261_PhysXMaterials_CharacterControllerMaterialAssignment.setreg_override b/AutomatedTesting/Registry/C15556261_PhysXMaterials_CharacterControllerMaterialAssignment.setreg_override index a329434623..aa82265c98 100644 --- a/AutomatedTesting/Registry/C15556261_PhysXMaterials_CharacterControllerMaterialAssignment.setreg_override +++ b/AutomatedTesting/Registry/C15556261_PhysXMaterials_CharacterControllerMaterialAssignment.setreg_override @@ -69,7 +69,7 @@ {}, {}, {}, - "TouchBend" + {} ] }, "Groups": { diff --git a/AutomatedTesting/Registry/C18977601_Material_FrictionCombinePriority.setreg_override b/AutomatedTesting/Registry/C18977601_Material_FrictionCombinePriority.setreg_override index 44a91c67cb..7050a57206 100644 --- a/AutomatedTesting/Registry/C18977601_Material_FrictionCombinePriority.setreg_override +++ b/AutomatedTesting/Registry/C18977601_Material_FrictionCombinePriority.setreg_override @@ -69,7 +69,7 @@ {}, {}, {}, - "TouchBend" + {} ] }, "Groups": { diff --git a/AutomatedTesting/Registry/C18981526_Material_RestitutionCombinePriority.setreg_override b/AutomatedTesting/Registry/C18981526_Material_RestitutionCombinePriority.setreg_override index 8de10787f1..c78018bdbb 100644 --- a/AutomatedTesting/Registry/C18981526_Material_RestitutionCombinePriority.setreg_override +++ b/AutomatedTesting/Registry/C18981526_Material_RestitutionCombinePriority.setreg_override @@ -69,7 +69,7 @@ {}, {}, {}, - "TouchBend" + {} ] }, "Groups": { diff --git a/AutomatedTesting/Registry/C3510644_Collider_CollisionGroups.setreg_override b/AutomatedTesting/Registry/C3510644_Collider_CollisionGroups.setreg_override index e4ea71f652..b82acaf0ae 100644 --- a/AutomatedTesting/Registry/C3510644_Collider_CollisionGroups.setreg_override +++ b/AutomatedTesting/Registry/C3510644_Collider_CollisionGroups.setreg_override @@ -69,7 +69,7 @@ {}, {}, {}, - "TouchBend" + {} ] }, "Groups": { diff --git a/AutomatedTesting/Registry/C4044456_Material_FrictionCombine.setreg_override b/AutomatedTesting/Registry/C4044456_Material_FrictionCombine.setreg_override index 83f7079e1f..806d71a158 100644 --- a/AutomatedTesting/Registry/C4044456_Material_FrictionCombine.setreg_override +++ b/AutomatedTesting/Registry/C4044456_Material_FrictionCombine.setreg_override @@ -69,7 +69,7 @@ {}, {}, {}, - "TouchBend" + {} ] }, "Groups": { diff --git a/AutomatedTesting/Registry/C4044457_Material_RestitutionCombine.setreg_override b/AutomatedTesting/Registry/C4044457_Material_RestitutionCombine.setreg_override index 96836b6ae4..fa77daac9f 100644 --- a/AutomatedTesting/Registry/C4044457_Material_RestitutionCombine.setreg_override +++ b/AutomatedTesting/Registry/C4044457_Material_RestitutionCombine.setreg_override @@ -69,7 +69,7 @@ {}, {}, {}, - "TouchBend" + {} ] }, "Groups": { diff --git a/AutomatedTesting/Registry/C4044459_Material_DynamicFriction.setreg_override b/AutomatedTesting/Registry/C4044459_Material_DynamicFriction.setreg_override index 88a7b5c309..5deb5635d1 100644 --- a/AutomatedTesting/Registry/C4044459_Material_DynamicFriction.setreg_override +++ b/AutomatedTesting/Registry/C4044459_Material_DynamicFriction.setreg_override @@ -69,7 +69,7 @@ {}, {}, {}, - "TouchBend" + {} ] }, "Groups": { diff --git a/AutomatedTesting/Registry/C4044461_Material_Restitution.setreg_override b/AutomatedTesting/Registry/C4044461_Material_Restitution.setreg_override index 21b285506b..b70e0f1326 100644 --- a/AutomatedTesting/Registry/C4044461_Material_Restitution.setreg_override +++ b/AutomatedTesting/Registry/C4044461_Material_Restitution.setreg_override @@ -69,7 +69,7 @@ {}, {}, {}, - "TouchBend" + {} ] }, "Groups": { diff --git a/AutomatedTesting/Registry/C4044697_Material_PerfaceMaterialValidation.setreg_override b/AutomatedTesting/Registry/C4044697_Material_PerfaceMaterialValidation.setreg_override index d585a4c468..5a93ae2314 100644 --- a/AutomatedTesting/Registry/C4044697_Material_PerfaceMaterialValidation.setreg_override +++ b/AutomatedTesting/Registry/C4044697_Material_PerfaceMaterialValidation.setreg_override @@ -69,7 +69,7 @@ {}, {}, {}, - "TouchBend" + {} ] }, "Groups": { diff --git a/AutomatedTesting/Registry/C4976227_Collider_NewGroup.setreg_override b/AutomatedTesting/Registry/C4976227_Collider_NewGroup.setreg_override index e53d3893f8..7065f0dfeb 100644 --- a/AutomatedTesting/Registry/C4976227_Collider_NewGroup.setreg_override +++ b/AutomatedTesting/Registry/C4976227_Collider_NewGroup.setreg_override @@ -69,7 +69,7 @@ {}, {}, {}, - "TouchBend" + {} ] }, "Groups": { diff --git a/AutomatedTesting/Registry/C4976244_Collider_SameGroupSameLayerCollision.setreg_override b/AutomatedTesting/Registry/C4976244_Collider_SameGroupSameLayerCollision.setreg_override index e4ea71f652..b82acaf0ae 100644 --- a/AutomatedTesting/Registry/C4976244_Collider_SameGroupSameLayerCollision.setreg_override +++ b/AutomatedTesting/Registry/C4976244_Collider_SameGroupSameLayerCollision.setreg_override @@ -69,7 +69,7 @@ {}, {}, {}, - "TouchBend" + {} ] }, "Groups": { diff --git a/AutomatedTesting/Registry/C4976245_PhysXCollider_CollisionLayerTest.setreg_override b/AutomatedTesting/Registry/C4976245_PhysXCollider_CollisionLayerTest.setreg_override index e4ea71f652..b82acaf0ae 100644 --- a/AutomatedTesting/Registry/C4976245_PhysXCollider_CollisionLayerTest.setreg_override +++ b/AutomatedTesting/Registry/C4976245_PhysXCollider_CollisionLayerTest.setreg_override @@ -69,7 +69,7 @@ {}, {}, {}, - "TouchBend" + {} ] }, "Groups": { diff --git a/AutomatedTesting/Registry/C4982593_PhysXCollider_CollisionLayer.setreg_override b/AutomatedTesting/Registry/C4982593_PhysXCollider_CollisionLayer.setreg_override index e4ea71f652..b82acaf0ae 100644 --- a/AutomatedTesting/Registry/C4982593_PhysXCollider_CollisionLayer.setreg_override +++ b/AutomatedTesting/Registry/C4982593_PhysXCollider_CollisionLayer.setreg_override @@ -69,7 +69,7 @@ {}, {}, {}, - "TouchBend" + {} ] }, "Groups": { diff --git a/AutomatedTesting/ScriptCanvas/dynamodbdemo.scriptcanvas b/AutomatedTesting/ScriptCanvas/dynamodbdemo.scriptcanvas index 286ac12551..d2c67b44d4 100644 --- a/AutomatedTesting/ScriptCanvas/dynamodbdemo.scriptcanvas +++ b/AutomatedTesting/ScriptCanvas/dynamodbdemo.scriptcanvas @@ -1,3449 +1,2296 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +{ + "Type": "JsonSerialization", + "Version": 1, + "ClassName": "ScriptCanvasData", + "ClassData": { + "m_scriptCanvas": { + "Id": { + "id": 25003641416736 + }, + "Name": "dynamodbdemo", + "Components": { + "Component_[12786284990698687901]": { + "$type": "EditorGraphVariableManagerComponent", + "Id": 12786284990698687901, + "m_variableData": { + "m_nameVariableMap": [ + { + "Key": { + "m_id": "{2B4769A0-AA75-4F68-8D20-0AD04D6A1BA9}" + }, + "Value": { + "Datum": { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 5 + }, + "isNullPointer": false, + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "value": "AWSCore.ExampleDynamoTableOutput", + "label": "String" + }, + "VariableId": { + "m_id": "{2B4769A0-AA75-4F68-8D20-0AD04D6A1BA9}" + }, + "VariableName": "table_name_key" + } + }, + { + "Key": { + "m_id": "{DEACAA6F-08F8-4938-A260-434B5A54B410}" + }, + "Value": { + "Datum": { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 4, + "m_azType": "{F8A7460C-2CC2-5755-AFDA-49B1109A751E}" + }, + "isNullPointer": false, + "$type": "{F8A7460C-2CC2-5755-AFDA-49B1109A751E} AZStd::unordered_map", + "value": { + "id": "{\"S\":\"Item1\"}" + }, + "label": "Map" + }, + "VariableId": { + "m_id": "{DEACAA6F-08F8-4938-A260-434B5A54B410}" + }, + "VariableName": "key_map" + } + } + ] + } + }, + "Component_[7996788827269998313]": { + "$type": "{4D755CA9-AB92-462C-B24F-0B3376F19967} Graph", + "Id": 7996788827269998313, + "m_graphData": { + "m_nodes": [ + { + "Id": { + "id": 25025116253216 + }, + "Name": "EBusEventHandler", + "Components": { + "Component_[10578822574531029496]": { + "$type": "EBusEventHandler", + "Id": 10578822574531029496, + "Slots": [ + { + "id": { + "m_id": "{0DFB0301-EE5F-48AC-BBD2-25837DA49111}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Connect", + "toolTip": "Connect this event handler to the specified entity.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{79098ED5-37E6-4C63-B1A5-D78083283A20}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Disconnect", + "toolTip": "Disconnect this event handler.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{EE099D12-FC92-4A08-87E2-02D818FD52E2}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnConnected", + "toolTip": "Signaled when a connection has taken place.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{92B219B0-ADC0-4461-A355-0DC9166961A8}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnDisconnected", + "toolTip": "Signaled when this event handler is disconnected.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{63FEE16A-8E8B-4A66-AC05-39AC3B68CA70}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnFailure", + "toolTip": "Signaled when it is not possible to connect this handler.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{96E24F07-C49C-47FD-8933-77A4DD3782D6}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Map", + "DisplayDataType": { + "m_type": 4, + "m_azType": "{F8A7460C-2CC2-5755-AFDA-49B1109A751E}" + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{34979410-5B6E-4BEF-9A46-48FF67F4D19D}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnGetItemSuccess", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{00E8811F-BC79-4E6A-A324-813F7BF2ECE9}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{ADCC15B8-DAA0-4640-8B18-B8F2A20902F4}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnGetItemError", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + } + ], + "m_eventMap": [ + { + "Key": { + "Value": 1385231939 + }, + "Value": { + "m_eventName": "OnGetItemSuccess", + "m_eventId": { + "Value": 1385231939 + }, + "m_eventSlotId": { + "m_id": "{34979410-5B6E-4BEF-9A46-48FF67F4D19D}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{96E24F07-C49C-47FD-8933-77A4DD3782D6}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 1405981398 + }, + "Value": { + "m_eventName": "OnGetItemError", + "m_eventId": { + "Value": 1405981398 + }, + "m_eventSlotId": { + "m_id": "{ADCC15B8-DAA0-4640-8B18-B8F2A20902F4}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{00E8811F-BC79-4E6A-A324-813F7BF2ECE9}" + } + ], + "m_numExpectedArguments": 1 + } + } + ], + "m_ebusName": "AWSDynamoDBBehaviorNotificationBus", + "m_busId": { + "Value": 3574293420 + } + } + } + }, + { + "Id": { + "id": 25046591089696 + }, + "Name": "SC-Node(Print)", + "Components": { + "Component_[12835504459049783614]": { + "$type": "Print", + "Id": 12835504459049783614, + "Slots": [ + { + "id": { + "m_id": "{4AC9E45B-5710-46B1-9255-DAC034603396}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "Input signal", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{8EB7444E-C872-45C0-A1C4-6D40B0DE58FC}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "m_format": "[DynamoDB] Results finished", + "m_unresolvedString": [ + "[DynamoDB] Results finished" + ] + } + } + }, + { + "Id": { + "id": 25033706187808 + }, + "Name": "EBusEventHandler", + "Components": { + "Component_[13226838068173099848]": { + "$type": "EBusEventHandler", + "Id": 13226838068173099848, + "Slots": [ + { + "id": { + "m_id": "{9AE4F6B5-2537-4CB0-A138-EFEBF3E686BB}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Connect", + "toolTip": "Connect this event handler to the specified entity.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{69F56189-B639-4B3F-8007-10E06B25306B}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Disconnect", + "toolTip": "Disconnect this event handler.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{BFC17F2C-0B66-4CE8-9333-EDD20AD25AAE}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnConnected", + "toolTip": "Signaled when a connection has taken place.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{CB2E6E03-4D7C-43F4-87E0-A4B859C7F9BD}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnDisconnected", + "toolTip": "Signaled when this event handler is disconnected.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{B165F16F-AE65-4FB3-B59E-5D76A116DF17}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnFailure", + "toolTip": "Signaled when it is not possible to connect this handler.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{8C1C768C-177A-4145-B28C-8992C3AF567A}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Map", + "DisplayDataType": { + "m_type": 4, + "m_azType": "{F8A7460C-2CC2-5755-AFDA-49B1109A751E}" + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{6C1B44FB-914A-48F0-8A51-16260B1FF1AC}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnGetItemSuccess", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{C2325175-BC9A-4015-994F-708E943FD08A}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{ED0836C9-1CE1-4F90-9515-AEA304BA439D}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnGetItemError", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + } + ], + "m_eventMap": [ + { + "Key": { + "Value": 1385231939 + }, + "Value": { + "m_eventName": "OnGetItemSuccess", + "m_eventId": { + "Value": 1385231939 + }, + "m_eventSlotId": { + "m_id": "{6C1B44FB-914A-48F0-8A51-16260B1FF1AC}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{8C1C768C-177A-4145-B28C-8992C3AF567A}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 1405981398 + }, + "Value": { + "m_eventName": "OnGetItemError", + "m_eventId": { + "Value": 1405981398 + }, + "m_eventSlotId": { + "m_id": "{ED0836C9-1CE1-4F90-9515-AEA304BA439D}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{C2325175-BC9A-4015-994F-708E943FD08A}" + } + ], + "m_numExpectedArguments": 1 + } + } + ], + "m_ebusName": "AWSDynamoDBBehaviorNotificationBus", + "m_busId": { + "Value": 3574293420 + } + } + } + }, + { + "Id": { + "id": 25029411220512 + }, + "Name": "SC-Node(Print)", + "Components": { + "Component_[13444839192692766618]": { + "$type": "Print", + "Id": 13444839192692766618, + "Slots": [ + { + "id": { + "m_id": "{725A6880-59C3-4965-9BEA-713C21960C6E}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "Input signal", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{6156DD7F-94E1-410B-8580-673E865DF025}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "m_format": "[DynamoDB] Get item completed", + "m_unresolvedString": [ + "[DynamoDB] Get item completed" + ] + } + } + }, + { + "Id": { + "id": 25038001155104 + }, + "Name": "SC Node(GetVariable)", + "Components": { + "Component_[17700179894112153065]": { + "$type": "GetVariableNode", + "Id": 17700179894112153065, + "Slots": [ + { + "id": { + "m_id": "{E50EF36D-58B3-4C76-AB5D-D25703D5E820}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "When signaled sends the property referenced by this node to a Data Output slot", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{9A669D64-DA34-4D0C-8BF1-D898D5943023}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "toolTip": "Signaled after the referenced property has been pushed to the Data Output slot", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{360DF30D-C247-4E89-80B0-8E1D6D5350A9}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Map", + "DisplayDataType": { + "m_type": 4, + "m_azType": "{F8A7460C-2CC2-5755-AFDA-49B1109A751E}" + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "m_variableId": { + "m_id": "{DEACAA6F-08F8-4938-A260-434B5A54B410}" + }, + "m_variableDataOutSlotId": { + "m_id": "{360DF30D-C247-4E89-80B0-8E1D6D5350A9}" + } + } + } + }, + { + "Id": { + "id": 25050886056992 + }, + "Name": "SC-Node(GetItem)", + "Components": { + "Component_[2045201123947147066]": { + "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", + "Id": 2045201123947147066, + "Slots": [ + { + "id": { + "m_id": "{B432784A-0BFF-4407-BA12-03331DBC5D25}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + null + ], + "slotName": "Table Resource KeyName", + "toolTip": "The name of the table containing the requested item.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1, + "IsReference": true, + "VariableReference": { + "m_id": "{2B4769A0-AA75-4F68-8D20-0AD04D6A1BA9}" + } + }, + { + "id": { + "m_id": "{DCFA66C5-6976-41ED-BE3D-5691B925F0EB}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + null + ], + "slotName": "Key Map", + "toolTip": "A map of attribute names to AttributeValue objects, representing the primary key of the item to retrieve.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{92E2E9A5-2605-45DA-9058-5616BF32649F}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{CEF34783-6020-4ABF-B10B-758CF1576805}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "Datums": [ + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 5 + }, + "isNullPointer": false, + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "value": "ExampleDynamoTableOutput", + "label": "Table Resource KeyName" + }, + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 4, + "m_azType": "{F8A7460C-2CC2-5755-AFDA-49B1109A751E}" + }, + "isNullPointer": true, + "label": "Key Map" + } + ], + "methodType": 2, + "methodName": "GetItem", + "className": "AWSScriptBehaviorDynamoDB", + "resultSlotIDs": [ + {} + ], + "prettyClassName": "AWSScriptBehaviorDynamoDB" + } + } + }, + { + "Id": { + "id": 25016526318624 + }, + "Name": "SC-Node(ReloadConfigFile)", + "Components": { + "Component_[4821100336024757285]": { + "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", + "Id": 4821100336024757285, + "Slots": [ + { + "id": { + "m_id": "{25D3CEFF-AFA5-4275-BCD2-893A6D0C285B}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + null + ], + "slotName": "Is Reloading Config FileName", + "toolTip": "Whether reload resource mapping config file name from AWS core configuration settings registry file.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{1AA65429-3605-41C6-99A4-829A11D859D7}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{5D5F5BE8-68D5-4533-8D40-FA5F3D2F4A0E}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "Datums": [ + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 0 + }, + "isNullPointer": false, + "$type": "bool", + "value": true, + "label": "Is Reloading Config FileName" + } + ], + "methodType": 0, + "methodName": "ReloadConfigFile", + "className": "AWSResourceMappingRequestBus", + "resultSlotIDs": [ + {} + ], + "prettyClassName": "AWSResourceMappingRequestBus" + } + } + }, + { + "Id": { + "id": 25020821285920 + }, + "Name": "SC-Node(ForEach)", + "Components": { + "Component_[8848962104837464421]": { + "$type": "ForEach", + "Id": 8848962104837464421, + "Slots": [ + { + "id": { + "m_id": "{D76E259C-CE63-478B-ACF8-83018378034E}" + }, + "DynamicTypeOverride": 2, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + null + ], + "slotName": "Source", + "DisplayDataType": { + "m_type": 4, + "m_azType": "{F8A7460C-2CC2-5755-AFDA-49B1109A751E}" + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DynamicGroup": { + "Value": 3089028177 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{1AC44C40-E18B-4297-B6BF-13A5CB07AFDD}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "Signaled upon node entry", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{4A657F68-4B8B-48DE-808F-D2040FB2E314}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Break", + "toolTip": "Stops the iteration when signaled", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{EE086437-7A08-4369-8E38-83866AD22DAE}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Each", + "toolTip": "Signalled after each element of the container", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{E6CD3DE4-70BB-4876-B944-5255E997A2C0}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Finished", + "toolTip": "The container has been fully iterated over", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{67F86833-7B8B-4EB8-952B-33BA2E99F17F}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{831A40AE-767D-45B8-BE36-4FB432D37A02}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 4, + "m_azType": "{F8A7460C-2CC2-5755-AFDA-49B1109A751E}" + }, + "isNullPointer": true, + "label": "Source" + } + ], + "m_sourceSlot": { + "m_id": "{D76E259C-CE63-478B-ACF8-83018378034E}" + }, + "m_previousTypeId": "{F8A7460C-2CC2-5755-AFDA-49B1109A751E}", + "m_propertySlots": [ + { + "m_propertySlotId": { + "m_id": "{67F86833-7B8B-4EB8-952B-33BA2E99F17F}" + }, + "m_propertyType": { + "m_type": 5 + }, + "m_propertyName": "String" + }, + { + "m_propertySlotId": { + "m_id": "{831A40AE-767D-45B8-BE36-4FB432D37A02}" + }, + "m_propertyType": { + "m_type": 5 + }, + "m_propertyName": "String" + } + ] + } + } + }, + { + "Id": { + "id": 25012231351328 + }, + "Name": "SC-Node(Print)", + "Components": { + "Component_[9330046059516327092]": { + "$type": "Print", + "Id": 9330046059516327092, + "Slots": [ + { + "id": { + "m_id": "{DF1E0DDB-6E1C-49E1-833C-D77642B634B9}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "Input signal", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{886F934E-F03B-458C-9624-27948F9BE968}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + null + ], + "slotName": "Value", + "toolTip": "Value which replaces instances of {Value} in the resulting string.", + "DisplayDataType": { + "m_type": 5 + }, + "DisplayGroup": { + "Value": 1015031923 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{3753E1B8-D99A-4F25-8C3A-899A9E84742A}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "Datums": [ + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 5 + }, + "isNullPointer": false, + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "value": "", + "label": "Value" + } + ], + "m_format": "[DynamoDB] Error: {Value}", + "m_arrayBindingMap": [ + { + "Key": 1, + "Value": { + "m_id": "{886F934E-F03B-458C-9624-27948F9BE968}" + } + } + ], + "m_unresolvedString": [ + "[DynamoDB] Error: ", + {} + ], + "m_formatSlotMap": { + "Value": { + "m_id": "{886F934E-F03B-458C-9624-27948F9BE968}" + } + } + } + } + }, + { + "Id": { + "id": 25007936384032 + }, + "Name": "SC-Node(Print)", + "Components": { + "Component_[9330046059516327092]": { + "$type": "Print", + "Id": 9330046059516327092, + "Slots": [ + { + "id": { + "m_id": "{DF1E0DDB-6E1C-49E1-833C-D77642B634B9}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "Input signal", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{886F934E-F03B-458C-9624-27948F9BE968}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + null + ], + "slotName": "Value", + "toolTip": "Value which replaces instances of {Value} in the resulting string.", + "DisplayDataType": { + "m_type": 5 + }, + "DisplayGroup": { + "Value": 1015031923 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{D725EFD5-970D-4182-8913-F8BD005843FF}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + null + ], + "slotName": "Value_1", + "toolTip": "Value which replaces instances of {Value_1} in the resulting string.", + "DisplayDataType": { + "m_type": 5 + }, + "DisplayGroup": { + "Value": 1015031923 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{3753E1B8-D99A-4F25-8C3A-899A9E84742A}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "Datums": [ + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 5 + }, + "isNullPointer": false, + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "value": "", + "label": "Value" + }, + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 5 + }, + "isNullPointer": false, + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "value": "", + "label": "Value_1" + } + ], + "m_format": "{Value}: {Value_1}", + "m_arrayBindingMap": [ + { + "Key": 1, + "Value": { + "m_id": "{886F934E-F03B-458C-9624-27948F9BE968}" + } + }, + { + "Key": 3, + "Value": { + "m_id": "{D725EFD5-970D-4182-8913-F8BD005843FF}" + } + } + ], + "m_unresolvedString": [ + {}, + {}, + ": ", + {} + ], + "m_formatSlotMap": { + "Value": { + "m_id": "{886F934E-F03B-458C-9624-27948F9BE968}" + }, + "Value_1": { + "m_id": "{D725EFD5-970D-4182-8913-F8BD005843FF}" + } + } + } + } + }, + { + "Id": { + "id": 25042296122400 + }, + "Name": "EBusEventHandler", + "Components": { + "Component_[9609589719561271825]": { + "$type": "EBusEventHandler", + "Id": 9609589719561271825, + "Slots": [ + { + "id": { + "m_id": "{B93CBA9F-469B-4C6F-BD79-50375AD3C27F}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Connect", + "toolTip": "Connect this event handler to the specified entity.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{610D578A-D6C6-43E0-944F-719383606327}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Disconnect", + "toolTip": "Disconnect this event handler.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{CD898A2F-56E2-40E5-B3EA-EAB098334C08}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnConnected", + "toolTip": "Signaled when a connection has taken place.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{F8727284-7903-4074-935E-36F7885A0248}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnDisconnected", + "toolTip": "Signaled when this event handler is disconnected.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{E93B874F-2AE3-4E1D-AA68-59B1C1EE4933}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnFailure", + "toolTip": "Signaled when it is not possible to connect this handler.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{C4CAFE95-89EB-401F-89EF-C25307ACF59A}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Source", + "toolTip": "ID used to connect on a specific Event address (Type: EntityId)", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{462005BF-42CE-433D-ADC6-8B5699DEFD82}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "EntityID", + "DisplayDataType": { + "m_type": 1 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{A8CD4D6B-660C-4D19-9498-D802AB4AD958}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnEntityActivated", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{132B287B-5DB7-4D1F-B98E-D22D000474CC}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "EntityID", + "DisplayDataType": { + "m_type": 1 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{979491D8-D45E-4477-9728-2F8EC559BAE4}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnEntityDeactivated", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + } + ], + "Datums": [ + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 1 + }, + "isNullPointer": false, + "$type": "EntityId", + "value": { + "id": 2901262558 + }, + "label": "Source" + } + ], + "m_eventMap": [ + { + "Key": { + "Value": 245425936 + }, + "Value": { + "m_eventName": "OnEntityActivated", + "m_eventId": { + "Value": 245425936 + }, + "m_eventSlotId": { + "m_id": "{A8CD4D6B-660C-4D19-9498-D802AB4AD958}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{462005BF-42CE-433D-ADC6-8B5699DEFD82}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 4273369222 + }, + "Value": { + "m_eventName": "OnEntityDeactivated", + "m_eventId": { + "Value": 4273369222 + }, + "m_eventSlotId": { + "m_id": "{979491D8-D45E-4477-9728-2F8EC559BAE4}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{132B287B-5DB7-4D1F-B98E-D22D000474CC}" + } + ], + "m_numExpectedArguments": 1 + } + } + ], + "m_ebusName": "EntityBus", + "m_busId": { + "Value": 3358774020 + } + } + } + } + ], + "m_connections": [ + { + "Id": { + "id": 25055181024288 + }, + "Name": "srcEndpoint=(For Each: Each), destEndpoint=(Print: In)", + "Components": { + "Component_[5981589240511962073]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 5981589240511962073, + "sourceEndpoint": { + "nodeId": { + "id": 25020821285920 + }, + "slotId": { + "m_id": "{EE086437-7A08-4369-8E38-83866AD22DAE}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 25007936384032 + }, + "slotId": { + "m_id": "{DF1E0DDB-6E1C-49E1-833C-D77642B634B9}" + } + } + } + } + }, + { + "Id": { + "id": 25059475991584 + }, + "Name": "srcEndpoint=(AWSDynamoDBBehaviorNotificationBus Handler: Map), destEndpoint=(For Each: Source)", + "Components": { + "Component_[5561798385961633452]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 5561798385961633452, + "sourceEndpoint": { + "nodeId": { + "id": 25025116253216 + }, + "slotId": { + "m_id": "{96E24F07-C49C-47FD-8933-77A4DD3782D6}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 25020821285920 + }, + "slotId": { + "m_id": "{D76E259C-CE63-478B-ACF8-83018378034E}" + } + } + } + } + }, + { + "Id": { + "id": 25063770958880 + }, + "Name": "srcEndpoint=(AWSDynamoDBBehaviorNotificationBus Handler: ExecutionSlot:OnGetItemSuccess), destEndpoint=(For Each: In)", + "Components": { + "Component_[4777785631376877414]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 4777785631376877414, + "sourceEndpoint": { + "nodeId": { + "id": 25025116253216 + }, + "slotId": { + "m_id": "{34979410-5B6E-4BEF-9A46-48FF67F4D19D}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 25020821285920 + }, + "slotId": { + "m_id": "{1AC44C40-E18B-4297-B6BF-13A5CB07AFDD}" + } + } + } + } + }, + { + "Id": { + "id": 25068065926176 + }, + "Name": "srcEndpoint=(For Each: String), destEndpoint=(Print: Value)", + "Components": { + "Component_[4288056568853910529]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 4288056568853910529, + "sourceEndpoint": { + "nodeId": { + "id": 25020821285920 + }, + "slotId": { + "m_id": "{67F86833-7B8B-4EB8-952B-33BA2E99F17F}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 25007936384032 + }, + "slotId": { + "m_id": "{886F934E-F03B-458C-9624-27948F9BE968}" + } + } + } + } + }, + { + "Id": { + "id": 25072360893472 + }, + "Name": "srcEndpoint=(For Each: Finished), destEndpoint=(Print: In)", + "Components": { + "Component_[6176670532939452292]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 6176670532939452292, + "sourceEndpoint": { + "nodeId": { + "id": 25020821285920 + }, + "slotId": { + "m_id": "{E6CD3DE4-70BB-4876-B944-5255E997A2C0}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 25046591089696 + }, + "slotId": { + "m_id": "{4AC9E45B-5710-46B1-9255-DAC034603396}" + } + } + } + } + }, + { + "Id": { + "id": 25076655860768 + }, + "Name": "srcEndpoint=(AWSDynamoDBBehaviorNotificationBus Handler: ExecutionSlot:OnGetItemError), destEndpoint=(Print: In)", + "Components": { + "Component_[16360665037994631473]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 16360665037994631473, + "sourceEndpoint": { + "nodeId": { + "id": 25033706187808 + }, + "slotId": { + "m_id": "{ED0836C9-1CE1-4F90-9515-AEA304BA439D}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 25012231351328 + }, + "slotId": { + "m_id": "{DF1E0DDB-6E1C-49E1-833C-D77642B634B9}" + } + } + } + } + }, + { + "Id": { + "id": 25080950828064 + }, + "Name": "srcEndpoint=(AWSDynamoDBBehaviorNotificationBus Handler: String), destEndpoint=(Print: Value)", + "Components": { + "Component_[10819323363841801505]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 10819323363841801505, + "sourceEndpoint": { + "nodeId": { + "id": 25033706187808 + }, + "slotId": { + "m_id": "{C2325175-BC9A-4015-994F-708E943FD08A}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 25012231351328 + }, + "slotId": { + "m_id": "{886F934E-F03B-458C-9624-27948F9BE968}" + } + } + } + } + }, + { + "Id": { + "id": 25085245795360 + }, + "Name": "srcEndpoint=(For Each: String), destEndpoint=(Print: Value_1)", + "Components": { + "Component_[13063015828816681184]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 13063015828816681184, + "sourceEndpoint": { + "nodeId": { + "id": 25020821285920 + }, + "slotId": { + "m_id": "{831A40AE-767D-45B8-BE36-4FB432D37A02}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 25007936384032 + }, + "slotId": { + "m_id": "{D725EFD5-970D-4182-8913-F8BD005843FF}" + } + } + } + } + }, + { + "Id": { + "id": 25089540762656 + }, + "Name": "srcEndpoint=(ReloadConfigFile: Out), destEndpoint=(Get Variable: In)", + "Components": { + "Component_[18422701704926868421]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 18422701704926868421, + "sourceEndpoint": { + "nodeId": { + "id": 25016526318624 + }, + "slotId": { + "m_id": "{5D5F5BE8-68D5-4533-8D40-FA5F3D2F4A0E}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 25038001155104 + }, + "slotId": { + "m_id": "{E50EF36D-58B3-4C76-AB5D-D25703D5E820}" + } + } + } + } + }, + { + "Id": { + "id": 25093835729952 + }, + "Name": "srcEndpoint=(GetItem: Out), destEndpoint=(Print: In)", + "Components": { + "Component_[11329868553246834497]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 11329868553246834497, + "sourceEndpoint": { + "nodeId": { + "id": 25050886056992 + }, + "slotId": { + "m_id": "{CEF34783-6020-4ABF-B10B-758CF1576805}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 25029411220512 + }, + "slotId": { + "m_id": "{725A6880-59C3-4965-9BEA-713C21960C6E}" + } + } + } + } + }, + { + "Id": { + "id": 25098130697248 + }, + "Name": "srcEndpoint=(Get Variable: Out), destEndpoint=(GetItem: In)", + "Components": { + "Component_[296789729353182089]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 296789729353182089, + "sourceEndpoint": { + "nodeId": { + "id": 25038001155104 + }, + "slotId": { + "m_id": "{9A669D64-DA34-4D0C-8BF1-D898D5943023}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 25050886056992 + }, + "slotId": { + "m_id": "{92E2E9A5-2605-45DA-9058-5616BF32649F}" + } + } + } + } + }, + { + "Id": { + "id": 25102425664544 + }, + "Name": "srcEndpoint=(Get Variable: Map), destEndpoint=(GetItem: Key Map)", + "Components": { + "Component_[10402484137467106144]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 10402484137467106144, + "sourceEndpoint": { + "nodeId": { + "id": 25038001155104 + }, + "slotId": { + "m_id": "{360DF30D-C247-4E89-80B0-8E1D6D5350A9}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 25050886056992 + }, + "slotId": { + "m_id": "{DCFA66C5-6976-41ED-BE3D-5691B925F0EB}" + } + } + } + } + }, + { + "Id": { + "id": 25106720631840 + }, + "Name": "srcEndpoint=(EntityBus Handler: ExecutionSlot:OnEntityActivated), destEndpoint=(ReloadConfigFile: In)", + "Components": { + "Component_[16720125412018333818]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 16720125412018333818, + "sourceEndpoint": { + "nodeId": { + "id": 25042296122400 + }, + "slotId": { + "m_id": "{A8CD4D6B-660C-4D19-9498-D802AB4AD958}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 25016526318624 + }, + "slotId": { + "m_id": "{1AA65429-3605-41C6-99A4-829A11D859D7}" + } + } + } + } + } + ] + }, + "m_assetType": "{3E2AC8CD-713F-453E-967F-29517F331784}", + "versionData": { + "_grammarVersion": 1, + "_runtimeVersion": 1 + }, + "m_variableCounter": 5, + "GraphCanvasData": [ + { + "Key": { + "id": 25003641416736 + }, + "Value": { + "ComponentData": { + "{5F84B500-8C45-40D1-8EFC-A5306B241444}": { + "$type": "SceneComponentSaveData", + "ViewParams": { + "Scale": 0.7826294, + "AnchorX": -546.8744506835938, + "AnchorY": -167.38446044921875 + } + } + } + } + }, + { + "Key": { + "id": 25007936384032 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "StringNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 480.0, + 680.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{C481D523-9BFE-4FEB-ADFC-5EE73734E510}" + } + } + } + }, + { + "Key": { + "id": 25012231351328 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "StringNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 160.0, + 400.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{A1019F85-E1ED-4A76-A5F2-D18B69A3F7C8}" + } + } + } + }, + { + "Key": { + "id": 25016526318624 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MethodNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + -20.0, + 160.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{BCD5F6D2-6A82-47D9-8C02-D02C298C22A5}" + } + } + } + }, + { + "Key": { + "id": 25020821285920 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "DefaultNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 160.0, + 680.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{13F6FDDB-D161-4587-9F30-F617D012A062}" + } + } + } + }, + { + "Key": { + "id": 25025116253216 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + -140.0, + 640.0 + ] + }, + "{9E81C95F-89C0-4476-8E82-63CCC4E52E04}": { + "$type": "EBusHandlerNodeDescriptorSaveData", + "EventIds": [ + { + "Value": 1385231939 + } + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{21DC5FA5-0109-4A1B-8350-50A25A09290A}" + } + } + } + }, + { + "Key": { + "id": 25029411220512 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "StringNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 1120.0, + 80.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{7F310716-7DCD-4C1F-8B62-88E907179D89}" + } + } + } + }, + { + "Key": { + "id": 25033706187808 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + -140.0, + 380.0 + ] + }, + "{9E81C95F-89C0-4476-8E82-63CCC4E52E04}": { + "$type": "EBusHandlerNodeDescriptorSaveData", + "EventIds": [ + { + "Value": 1405981398 + } + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{4AC68669-891A-48EA-93D3-1C210C117298}" + } + } + } + }, + { + "Key": { + "id": 25038001155104 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "GetVariableNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 320.0, + 120.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".getVariable" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{B6D7974B-646A-4089-A530-7F6EB3C28328}" + } + } + } + }, + { + "Key": { + "id": 25042296122400 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + -360.0, + 100.0 + ] + }, + "{9E81C95F-89C0-4476-8E82-63CCC4E52E04}": { + "$type": "EBusHandlerNodeDescriptorSaveData", + "EventIds": [ + { + "Value": 245425936 + } + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{9D1121A0-707F-47A8-A1D9-6C3FF54ED9F8}" + } + } + } + }, + { + "Key": { + "id": 25046591089696 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "StringNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 480.0, + 960.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{58E0C332-FAA1-419E-8F67-A0D057D90EF3}" + } + } + } + }, + { + "Key": { + "id": 25050886056992 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MethodNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 660.0, + 80.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{4238CE68-6891-45AF-880D-C6D8317A5506}" + } + } + } + } + ], + "StatisticsHelper": { + "InstanceCounter": [ + { + "Key": 5842116704362436814, + "Value": 1 + }, + { + "Key": 5842116704509535651, + "Value": 1 + }, + { + "Key": 5842116761103598202, + "Value": 1 + }, + { + "Key": 10181512461692697578, + "Value": 1 + }, + { + "Key": 10684225535275896474, + "Value": 4 + }, + { + "Key": 12348245020530250771, + "Value": 1 + }, + { + "Key": 13774516555319876501, + "Value": 1 + }, + { + "Key": 16512335735722000926, + "Value": 1 + } + ] + } + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/ScriptCanvas/instance_counter.scriptcanvas b/AutomatedTesting/ScriptCanvas/instance_counter.scriptcanvas index 0ccd364da5..0e5524273c 100644 --- a/AutomatedTesting/ScriptCanvas/instance_counter.scriptcanvas +++ b/AutomatedTesting/ScriptCanvas/instance_counter.scriptcanvas @@ -1,1241 +1,786 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +{ + "Type": "JsonSerialization", + "Version": 1, + "ClassName": "ScriptCanvasData", + "ClassData": { + "m_scriptCanvas": { + "Id": { + "id": 3744110453276 + }, + "Name": "instance_counter", + "Components": { + "Component_[12097559167852379075]": { + "$type": "EditorGraphVariableManagerComponent", + "Id": 12097559167852379075 + }, + "Component_[2729072015511887582]": { + "$type": "{4D755CA9-AB92-462C-B24F-0B3376F19967} Graph", + "Id": 2729072015511887582, + "m_graphData": { + "m_nodes": [ + { + "Id": { + "id": 3752700387868 + }, + "Name": "SC-Node(Print)", + "Components": { + "Component_[10726023654468379779]": { + "$type": "Print", + "Id": 10726023654468379779, + "Slots": [ + { + "id": { + "m_id": "{14259C44-C324-4F72-93E7-FA49B061F2C7}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "Input signal", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{4DE18FB9-E6F3-47B2-B721-AE0A35FC9C5F}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + null + ], + "slotName": "Value", + "toolTip": "Value which replaces instances of {Value} in the resulting string.", + "DisplayDataType": { + "m_type": 3 + }, + "DisplayGroup": { + "Value": 1015031923 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{BDE3D585-DDD2-4B5E-AB8E-738F07B89A00}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "Datums": [ + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 0.0, + "label": "Value" + } + ], + "m_format": "Instances found in area = {Value}", + "m_numericPrecision": 0, + "m_arrayBindingMap": [ + { + "Key": 1, + "Value": { + "m_id": "{4DE18FB9-E6F3-47B2-B721-AE0A35FC9C5F}" + } + } + ], + "m_unresolvedString": [ + "Instances found in area = ", + {} + ], + "m_formatSlotMap": { + "Value": { + "m_id": "{4DE18FB9-E6F3-47B2-B721-AE0A35FC9C5F}" + } + } + } + } + }, + { + "Id": { + "id": 3756995355164 + }, + "Name": "SC-Node(Start)", + "Components": { + "Component_[1402832180862211598]": { + "$type": "Start", + "Id": 1402832180862211598, + "Slots": [ + { + "id": { + "m_id": "{66363B00-927B-4B9C-AF21-C9DDC4BA528D}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "toolTip": "Signaled when the entity that owns this graph is fully activated.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ] + } + } + }, + { + "Id": { + "id": 3765585289756 + }, + "Name": "SC-Node(GetAreaProductCount)", + "Components": { + "Component_[14710093371558461612]": { + "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", + "Id": 14710093371558461612, + "Slots": [ + { + "id": { + "m_id": "{32D2E25A-834E-48FE-B868-7AB5D78D3A3B}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + null + ], + "slotName": "EntityID: 0", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{9D282D11-1630-4247-BCA7-001953C7AAEA}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{DDBA739C-F8A3-4307-8BEF-494B499DA0DC}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{64B972F8-C880-4BB2-8482-E5F0FDBB692D}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Result: Number", + "DisplayDataType": { + "m_type": 3 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 1 + }, + "isNullPointer": false, + "$type": "EntityId", + "value": { + "id": 2901262558 + }, + "label": "Source" + } + ], + "methodType": 0, + "methodName": "GetAreaProductCount", + "className": "VegetationSpawnerRequestBus", + "resultSlotIDs": [ + {} + ], + "prettyClassName": "VegetationSpawnerRequestBus" + } + } + }, + { + "Id": { + "id": 3748405420572 + }, + "Name": "SC-Node(TimeDelayNodeableNode)", + "Components": { + "Component_[4183258099933897606]": { + "$type": "TimeDelayNodeableNode", + "Id": 4183258099933897606, + "Slots": [ + { + "id": { + "m_id": "{5B850958-5026-4659-B6C7-0EB4E55205E6}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Start", + "DisplayGroup": { + "Value": 2675529103 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{DB2A2300-A20D-4DB7-A31B-F4F1B040BB62}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + null + ], + "slotName": "Delay", + "toolTip": "The amount of time to delay before the Done is signalled.", + "DisplayGroup": { + "Value": 2675529103 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{27714BA0-DFD3-4813-94BF-12B0ADF2B89F}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "On Start", + "DisplayGroup": { + "Value": 2675529103 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{34BAE377-8B62-4E33-B9AB-0819643950A1}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Done", + "toolTip": "Signaled after waiting for the specified amount of times.", + "DisplayGroup": { + "Value": 271442091 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + } + ], + "Datums": [ + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 5.0, + "label": "Delay" + } + ], + "nodeable": { + "m_timeUnits": 2 + }, + "slotExecutionMap": { + "ins": [ + { + "_slotId": { + "m_id": "{5B850958-5026-4659-B6C7-0EB4E55205E6}" + }, + "_inputs": [ + { + "_slotId": { + "m_id": "{DB2A2300-A20D-4DB7-A31B-F4F1B040BB62}" + } + } + ], + "_outs": [ + { + "_slotId": { + "m_id": "{27714BA0-DFD3-4813-94BF-12B0ADF2B89F}" + }, + "_name": "On Start", + "_interfaceSourceId": "{00E45DAC-D501-0000-A050-B80244000000}" + } + ], + "_interfaceSourceId": "{9CCBADAB-917D-0000-0400-000000000000}" + } + ], + "latents": [ + { + "_slotId": { + "m_id": "{34BAE377-8B62-4E33-B9AB-0819643950A1}" + }, + "_name": "Done", + "_interfaceSourceId": "{9CCBADAB-917D-0000-0400-000000000000}" + } + ] + } + } + } + }, + { + "Id": { + "id": 3761290322460 + }, + "Name": "SC-Node(Print)", + "Components": { + "Component_[6291714103869491290]": { + "$type": "Print", + "Id": 6291714103869491290, + "Slots": [ + { + "id": { + "m_id": "{69A4391E-F7BE-4E2E-8FED-474227D660F3}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "Input signal", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{5D263368-0096-424D-ACEE-1D658417E00D}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "m_format": "Delaying for 5 seconds", + "m_unresolvedString": [ + "Delaying for 5 seconds" + ] + } + } + } + ], + "m_connections": [ + { + "Id": { + "id": 3769880257052 + }, + "Name": "srcEndpoint=(On Graph Start: Out), destEndpoint=(TimeDelay: Start)", + "Components": { + "Component_[17168700535869642649]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 17168700535869642649, + "sourceEndpoint": { + "nodeId": { + "id": 3756995355164 + }, + "slotId": { + "m_id": "{66363B00-927B-4B9C-AF21-C9DDC4BA528D}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 3748405420572 + }, + "slotId": { + "m_id": "{5B850958-5026-4659-B6C7-0EB4E55205E6}" + } + } + } + } + }, + { + "Id": { + "id": 3774175224348 + }, + "Name": "srcEndpoint=(TimeDelay: On Start), destEndpoint=(Print: In)", + "Components": { + "Component_[447639101916656835]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 447639101916656835, + "sourceEndpoint": { + "nodeId": { + "id": 3748405420572 + }, + "slotId": { + "m_id": "{27714BA0-DFD3-4813-94BF-12B0ADF2B89F}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 3761290322460 + }, + "slotId": { + "m_id": "{69A4391E-F7BE-4E2E-8FED-474227D660F3}" + } + } + } + } + }, + { + "Id": { + "id": 3778470191644 + }, + "Name": "srcEndpoint=(TimeDelay: Done), destEndpoint=(GetAreaProductCount: In)", + "Components": { + "Component_[13322673526483611656]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 13322673526483611656, + "sourceEndpoint": { + "nodeId": { + "id": 3748405420572 + }, + "slotId": { + "m_id": "{34BAE377-8B62-4E33-B9AB-0819643950A1}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 3765585289756 + }, + "slotId": { + "m_id": "{9D282D11-1630-4247-BCA7-001953C7AAEA}" + } + } + } + } + }, + { + "Id": { + "id": 3782765158940 + }, + "Name": "srcEndpoint=(GetAreaProductCount: Result: Number), destEndpoint=(Print: Value)", + "Components": { + "Component_[17896973599438945144]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 17896973599438945144, + "sourceEndpoint": { + "nodeId": { + "id": 3765585289756 + }, + "slotId": { + "m_id": "{64B972F8-C880-4BB2-8482-E5F0FDBB692D}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 3752700387868 + }, + "slotId": { + "m_id": "{4DE18FB9-E6F3-47B2-B721-AE0A35FC9C5F}" + } + } + } + } + }, + { + "Id": { + "id": 3787060126236 + }, + "Name": "srcEndpoint=(GetAreaProductCount: Out), destEndpoint=(Print: In)", + "Components": { + "Component_[3309014461387913721]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 3309014461387913721, + "sourceEndpoint": { + "nodeId": { + "id": 3765585289756 + }, + "slotId": { + "m_id": "{DDBA739C-F8A3-4307-8BEF-494B499DA0DC}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 3752700387868 + }, + "slotId": { + "m_id": "{14259C44-C324-4F72-93E7-FA49B061F2C7}" + } + } + } + } + } + ] + }, + "m_assetType": "{3E2AC8CD-713F-453E-967F-29517F331784}", + "versionData": { + "_grammarVersion": 1, + "_runtimeVersion": 1 + }, + "GraphCanvasData": [ + { + "Key": { + "id": 3744110453276 + }, + "Value": { + "ComponentData": { + "{5F84B500-8C45-40D1-8EFC-A5306B241444}": { + "$type": "SceneComponentSaveData", + "ViewParams": { + "Scale": 0.9218543514249998, + "AnchorX": 50.98419189453125, + "AnchorY": -272.27728271484375 + } + } + } + } + }, + { + "Key": { + "id": 3748405420572 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "TimeNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 380.0, + 20.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{DB8CFC70-AD18-45D5-8C6C-A39648059134}" + } + } + } + }, + { + "Key": { + "id": 3752700387868 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "StringNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 1220.0, + 180.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{1811B851-23B5-43C8-B654-9822174090CC}" + } + } + } + }, + { + "Key": { + "id": 3756995355164 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "TimeNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 160.0, + 60.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{483C126F-701F-492F-8375-15B40F8D0178}" + } + } + } + }, + { + "Key": { + "id": 3761290322460 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "StringNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 700.0, + -160.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{DF1AB898-208E-4EA4-B3A9-202A4DB725EB}" + } + } + } + }, + { + "Key": { + "id": 3765585289756 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MethodNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 700.0, + 200.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{5724716B-5E80-4BB2-AA9C-3E4916A40BAE}" + } + } + } + } + ], + "StatisticsHelper": { + "InstanceCounter": [ + { + "Key": 4199610336680704683, + "Value": 1 + }, + { + "Key": 6462358712820489356, + "Value": 1 + }, + { + "Key": 10684225535275896474, + "Value": 2 + }, + { + "Key": 13774516461288748354, + "Value": 1 + } + ] + } + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/ScriptCanvas/lambdademo.scriptcanvas b/AutomatedTesting/ScriptCanvas/lambdademo.scriptcanvas index ec4b161711..630d28f0da 100644 --- a/AutomatedTesting/ScriptCanvas/lambdademo.scriptcanvas +++ b/AutomatedTesting/ScriptCanvas/lambdademo.scriptcanvas @@ -1,2463 +1,1686 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +{ + "Type": "JsonSerialization", + "Version": 1, + "ClassName": "ScriptCanvasData", + "ClassData": { + "m_scriptCanvas": { + "Id": { + "id": 10426522414112 + }, + "Name": "lambdademo", + "Components": { + "Component_[5582017548010627717]": { + "$type": "EditorGraphVariableManagerComponent", + "Id": 5582017548010627717, + "m_variableData": { + "m_nameVariableMap": [ + { + "Key": { + "m_id": "{13AF5E48-B750-479D-8D27-9D79B382B29C}" + }, + "Value": { + "Datum": { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 5 + }, + "isNullPointer": false, + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "value": "AWSCore.ExampleLambdaOutput", + "label": "String" + }, + "VariableId": { + "m_id": "{13AF5E48-B750-479D-8D27-9D79B382B29C}" + }, + "VariableName": "function_key" + } + }, + { + "Key": { + "m_id": "{DCB889AA-7504-42E7-9D57-5D96C37ACFF0}" + }, + "Value": { + "Datum": { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 5 + }, + "isNullPointer": false, + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "value": "", + "label": "String" + }, + "VariableId": { + "m_id": "{DCB889AA-7504-42E7-9D57-5D96C37ACFF0}" + }, + "VariableName": "payload" + } + } + ] + } + }, + "Component_[9407870129852956697]": { + "$type": "{4D755CA9-AB92-462C-B24F-0B3376F19967} Graph", + "Id": 9407870129852956697, + "m_graphData": { + "m_nodes": [ + { + "Id": { + "id": 10435112348704 + }, + "Name": "SC-Node(ReloadConfigFile)", + "Components": { + "Component_[11167148136039722527]": { + "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", + "Id": 11167148136039722527, + "Slots": [ + { + "id": { + "m_id": "{8AA5E0B5-F92E-42A5-AFA5-D73825783200}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + null + ], + "slotName": "Is Reloading Config FileName", + "toolTip": "Whether reload resource mapping config file name from AWS core configuration settings registry file.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{7D577F2E-978C-4523-9FDF-6BCEFF0D1F4E}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{DD5508D7-F1D1-451B-93CC-03DC448C03E7}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "Datums": [ + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 0 + }, + "isNullPointer": false, + "$type": "bool", + "value": true, + "label": "Is Reloading Config FileName" + } + ], + "methodType": 0, + "methodName": "ReloadConfigFile", + "className": "AWSResourceMappingRequestBus", + "resultSlotIDs": [ + {} + ], + "prettyClassName": "AWSResourceMappingRequestBus" + } + } + }, + { + "Id": { + "id": 10460882152480 + }, + "Name": "EBusEventHandler", + "Components": { + "Component_[12603515743535039255]": { + "$type": "EBusEventHandler", + "Id": 12603515743535039255, + "Slots": [ + { + "id": { + "m_id": "{45AA6102-92E2-458B-B269-231D05863FDA}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Connect", + "toolTip": "Connect this event handler to the specified entity.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{4424B64A-299D-4164-A4D4-A275A1C2AB3D}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Disconnect", + "toolTip": "Disconnect this event handler.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{92EB485B-1B25-4D3B-95F4-7FF7E2BCFB80}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnConnected", + "toolTip": "Signaled when a connection has taken place.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{F12D1B7B-A26B-4CE3-A10C-FB510F8E0199}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnDisconnected", + "toolTip": "Signaled when this event handler is disconnected.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{9265F022-057D-4464-AE9B-64458D51E2D6}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnFailure", + "toolTip": "Signaled when it is not possible to connect this handler.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{34292C47-96F8-401B-8902-5F7FF32FF4C0}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Source", + "toolTip": "ID used to connect on a specific Event address (Type: EntityId)", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{7CCBDF78-CA73-40ED-A996-EBCA723286CB}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "EntityID", + "DisplayDataType": { + "m_type": 1 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{7587D651-DBD8-49B8-8CCC-BFD0E9C890A7}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnEntityActivated", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{838A95D3-7F90-489E-87D2-05930C7C4F05}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "EntityID", + "DisplayDataType": { + "m_type": 1 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{6CBCAAE3-3ABE-4E3B-919D-271D943BAEB4}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnEntityDeactivated", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + } + ], + "Datums": [ + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 1 + }, + "isNullPointer": false, + "$type": "EntityId", + "value": { + "id": 2901262558 + }, + "label": "Source" + } + ], + "m_eventMap": [ + { + "Key": { + "Value": 245425936 + }, + "Value": { + "m_eventName": "OnEntityActivated", + "m_eventId": { + "Value": 245425936 + }, + "m_eventSlotId": { + "m_id": "{7587D651-DBD8-49B8-8CCC-BFD0E9C890A7}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{7CCBDF78-CA73-40ED-A996-EBCA723286CB}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 4273369222 + }, + "Value": { + "m_eventName": "OnEntityDeactivated", + "m_eventId": { + "Value": 4273369222 + }, + "m_eventSlotId": { + "m_id": "{6CBCAAE3-3ABE-4E3B-919D-271D943BAEB4}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{838A95D3-7F90-489E-87D2-05930C7C4F05}" + } + ], + "m_numExpectedArguments": 1 + } + } + ], + "m_ebusName": "EntityBus", + "m_busId": { + "Value": 3358774020 + } + } + } + }, + { + "Id": { + "id": 10447997250592 + }, + "Name": "EBusEventHandler", + "Components": { + "Component_[13302482777442065739]": { + "$type": "EBusEventHandler", + "Id": 13302482777442065739, + "Slots": [ + { + "id": { + "m_id": "{382E9758-3981-48FF-8E20-FD99C1561DC3}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Connect", + "toolTip": "Connect this event handler to the specified entity.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{86069A40-A7CE-4BD1-BD52-F7AA915085FA}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Disconnect", + "toolTip": "Disconnect this event handler.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{D486C753-CC73-48FE-9E89-970AB98C4EA8}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnConnected", + "toolTip": "Signaled when a connection has taken place.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{A549915E-EB3D-4E21-AF1B-3A9C6D9488A0}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnDisconnected", + "toolTip": "Signaled when this event handler is disconnected.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{38628508-1F11-4B20-AB8D-42A8E4656375}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnFailure", + "toolTip": "Signaled when it is not possible to connect this handler.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{C9F7A7D4-83F3-4393-9E47-3805627BBDBB}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{08D01109-BA01-4422-88FF-1E562C4A28D8}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnInvokeSuccess", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{FF44C72A-CB92-4873-B5D3-43198DC06AC2}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{FCE32A95-1CDD-4330-8E94-85CF51731276}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnInvokeError", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + } + ], + "m_eventMap": [ + { + "Key": { + "Value": 1275872951 + }, + "Value": { + "m_eventName": "OnInvokeSuccess", + "m_eventId": { + "Value": 1275872951 + }, + "m_eventSlotId": { + "m_id": "{08D01109-BA01-4422-88FF-1E562C4A28D8}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{C9F7A7D4-83F3-4393-9E47-3805627BBDBB}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 3274092371 + }, + "Value": { + "m_eventName": "OnInvokeError", + "m_eventId": { + "Value": 3274092371 + }, + "m_eventSlotId": { + "m_id": "{FCE32A95-1CDD-4330-8E94-85CF51731276}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{FF44C72A-CB92-4873-B5D3-43198DC06AC2}" + } + ], + "m_numExpectedArguments": 1 + } + } + ], + "m_ebusName": "AWSLambdaBehaviorNotificationBus", + "m_busId": { + "Value": 179676616 + } + } + } + }, + { + "Id": { + "id": 10456587185184 + }, + "Name": "EBusEventHandler", + "Components": { + "Component_[14277639653836430450]": { + "$type": "EBusEventHandler", + "Id": 14277639653836430450, + "Slots": [ + { + "id": { + "m_id": "{DB69AA96-AE16-4D06-B579-7DD0EFD529A2}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Connect", + "toolTip": "Connect this event handler to the specified entity.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{FEB09F66-0727-4C28-A499-ECE1774945C9}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Disconnect", + "toolTip": "Disconnect this event handler.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{0F23E212-E397-47CF-9941-530AEB2F8882}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnConnected", + "toolTip": "Signaled when a connection has taken place.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{7679B464-A5AB-4CCC-9E18-176F9D98DBFB}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnDisconnected", + "toolTip": "Signaled when this event handler is disconnected.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{185DDE19-CC78-467D-A776-05794E8D0DD1}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnFailure", + "toolTip": "Signaled when it is not possible to connect this handler.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{70838AFF-91F4-417E-A253-41ED6C3AAB7D}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{387915AE-E556-43E3-B3A7-9176370D129C}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnInvokeSuccess", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{4CC527B1-A85A-42F0-A806-FB19668F22E2}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{E8F2D62B-EFCE-4F85-A1DE-C158079F79EB}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnInvokeError", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + } + ], + "m_eventMap": [ + { + "Key": { + "Value": 1275872951 + }, + "Value": { + "m_eventName": "OnInvokeSuccess", + "m_eventId": { + "Value": 1275872951 + }, + "m_eventSlotId": { + "m_id": "{387915AE-E556-43E3-B3A7-9176370D129C}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{70838AFF-91F4-417E-A253-41ED6C3AAB7D}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 3274092371 + }, + "Value": { + "m_eventName": "OnInvokeError", + "m_eventId": { + "Value": 3274092371 + }, + "m_eventSlotId": { + "m_id": "{E8F2D62B-EFCE-4F85-A1DE-C158079F79EB}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{4CC527B1-A85A-42F0-A806-FB19668F22E2}" + } + ], + "m_numExpectedArguments": 1 + } + } + ], + "m_ebusName": "AWSLambdaBehaviorNotificationBus", + "m_busId": { + "Value": 179676616 + } + } + } + }, + { + "Id": { + "id": 10452292217888 + }, + "Name": "SC-Node(Print)", + "Components": { + "Component_[15632666580273613138]": { + "$type": "Print", + "Id": 15632666580273613138, + "Slots": [ + { + "id": { + "m_id": "{2219BD38-0808-4D6D-9623-9560BCD8235D}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "Input signal", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{59EABC9A-5EA1-4E43-98CD-909870677390}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "m_format": "[Lambda] Completed Invoke", + "m_unresolvedString": [ + "[Lambda] Completed Invoke" + ] + } + } + }, + { + "Id": { + "id": 10443702283296 + }, + "Name": "SC-Node(Print)", + "Components": { + "Component_[15632666580273613138]": { + "$type": "Print", + "Id": 15632666580273613138, + "Slots": [ + { + "id": { + "m_id": "{2219BD38-0808-4D6D-9623-9560BCD8235D}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "Input signal", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{0972A320-2B33-4F31-AC0F-46C4E0CE539B}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + null + ], + "slotName": "Value", + "toolTip": "Value which replaces instances of {Value} in the resulting string.", + "DisplayDataType": { + "m_type": 5 + }, + "DisplayGroup": { + "Value": 1015031923 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{59EABC9A-5EA1-4E43-98CD-909870677390}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "Datums": [ + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 5 + }, + "isNullPointer": false, + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "value": "", + "label": "Value" + } + ], + "m_format": "[Lambda] Invoke error: {Value}", + "m_arrayBindingMap": [ + { + "Key": 1, + "Value": { + "m_id": "{0972A320-2B33-4F31-AC0F-46C4E0CE539B}" + } + } + ], + "m_unresolvedString": [ + "[Lambda] Invoke error: ", + {} + ], + "m_formatSlotMap": { + "Value": { + "m_id": "{0972A320-2B33-4F31-AC0F-46C4E0CE539B}" + } + } + } + } + }, + { + "Id": { + "id": 10439407316000 + }, + "Name": "SC-Node(Print)", + "Components": { + "Component_[15632666580273613138]": { + "$type": "Print", + "Id": 15632666580273613138, + "Slots": [ + { + "id": { + "m_id": "{2219BD38-0808-4D6D-9623-9560BCD8235D}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "Input signal", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{0972A320-2B33-4F31-AC0F-46C4E0CE539B}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + null + ], + "slotName": "Value", + "toolTip": "Value which replaces instances of {Value} in the resulting string.", + "DisplayDataType": { + "m_type": 5 + }, + "DisplayGroup": { + "Value": 1015031923 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{59EABC9A-5EA1-4E43-98CD-909870677390}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "Datums": [ + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 5 + }, + "isNullPointer": false, + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "value": "", + "label": "Value" + } + ], + "m_format": "[Lambda] Invoke success: {Value}", + "m_arrayBindingMap": [ + { + "Key": 1, + "Value": { + "m_id": "{0972A320-2B33-4F31-AC0F-46C4E0CE539B}" + } + } + ], + "m_unresolvedString": [ + "[Lambda] Invoke success: ", + {} + ], + "m_formatSlotMap": { + "Value": { + "m_id": "{0972A320-2B33-4F31-AC0F-46C4E0CE539B}" + } + } + } + } + }, + { + "Id": { + "id": 10430817381408 + }, + "Name": "SC-Node(Invoke)", + "Components": { + "Component_[5709396067277168591]": { + "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", + "Id": 5709396067277168591, + "Slots": [ + { + "id": { + "m_id": "{5DA0BEDE-72C0-4DD7-977D-FF25974FC704}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + null + ], + "slotName": "Function Resource KeyName", + "toolTip": "The resource key name of the lambda function in resource mapping config file.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1, + "IsReference": true, + "VariableReference": { + "m_id": "{13AF5E48-B750-479D-8D27-9D79B382B29C}" + } + }, + { + "id": { + "m_id": "{9BA842F4-68D5-442E-BF67-8182284396C0}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + null + ], + "slotName": "Payload", + "toolTip": "The JSON that you want to provide to your Lambda function as input.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1, + "IsReference": true, + "VariableReference": { + "m_id": "{DCB889AA-7504-42E7-9D57-5D96C37ACFF0}" + } + }, + { + "id": { + "m_id": "{6DB4AD78-A00C-42D9-BEC9-04B98BFBA2B2}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{069560CB-28C5-499F-88D3-5CC178EB4824}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "Datums": [ + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 5 + }, + "isNullPointer": false, + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "value": "", + "label": "Function Resource KeyName" + }, + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 5 + }, + "isNullPointer": false, + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "value": "", + "label": "Payload" + } + ], + "methodType": 2, + "methodName": "Invoke", + "className": "AWSScriptBehaviorLambda", + "resultSlotIDs": [ + {} + ], + "prettyClassName": "AWSScriptBehaviorLambda" + } + } + } + ], + "m_connections": [ + { + "Id": { + "id": 10465177119776 + }, + "Name": "srcEndpoint=(ReloadConfigFile: Out), destEndpoint=(Invoke: In)", + "Components": { + "Component_[13136233722544432016]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 13136233722544432016, + "sourceEndpoint": { + "nodeId": { + "id": 10435112348704 + }, + "slotId": { + "m_id": "{DD5508D7-F1D1-451B-93CC-03DC448C03E7}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 10430817381408 + }, + "slotId": { + "m_id": "{6DB4AD78-A00C-42D9-BEC9-04B98BFBA2B2}" + } + } + } + } + }, + { + "Id": { + "id": 10469472087072 + }, + "Name": "srcEndpoint=(Invoke: Out), destEndpoint=(Print: In)", + "Components": { + "Component_[2618571426139838363]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 2618571426139838363, + "sourceEndpoint": { + "nodeId": { + "id": 10430817381408 + }, + "slotId": { + "m_id": "{069560CB-28C5-499F-88D3-5CC178EB4824}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 10452292217888 + }, + "slotId": { + "m_id": "{2219BD38-0808-4D6D-9623-9560BCD8235D}" + } + } + } + } + }, + { + "Id": { + "id": 10473767054368 + }, + "Name": "srcEndpoint=(AWSLambdaBehaviorNotificationBus Handler: ExecutionSlot:OnInvokeError), destEndpoint=(Print: In)", + "Components": { + "Component_[10492730210717605288]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 10492730210717605288, + "sourceEndpoint": { + "nodeId": { + "id": 10456587185184 + }, + "slotId": { + "m_id": "{E8F2D62B-EFCE-4F85-A1DE-C158079F79EB}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 10443702283296 + }, + "slotId": { + "m_id": "{2219BD38-0808-4D6D-9623-9560BCD8235D}" + } + } + } + } + }, + { + "Id": { + "id": 10478062021664 + }, + "Name": "srcEndpoint=(AWSLambdaBehaviorNotificationBus Handler: String), destEndpoint=(Print: Value)", + "Components": { + "Component_[7692047505820357673]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 7692047505820357673, + "sourceEndpoint": { + "nodeId": { + "id": 10456587185184 + }, + "slotId": { + "m_id": "{4CC527B1-A85A-42F0-A806-FB19668F22E2}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 10443702283296 + }, + "slotId": { + "m_id": "{0972A320-2B33-4F31-AC0F-46C4E0CE539B}" + } + } + } + } + }, + { + "Id": { + "id": 10482356988960 + }, + "Name": "srcEndpoint=(AWSLambdaBehaviorNotificationBus Handler: ExecutionSlot:OnInvokeSuccess), destEndpoint=(Print: In)", + "Components": { + "Component_[8999881801271525198]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 8999881801271525198, + "sourceEndpoint": { + "nodeId": { + "id": 10447997250592 + }, + "slotId": { + "m_id": "{08D01109-BA01-4422-88FF-1E562C4A28D8}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 10439407316000 + }, + "slotId": { + "m_id": "{2219BD38-0808-4D6D-9623-9560BCD8235D}" + } + } + } + } + }, + { + "Id": { + "id": 10486651956256 + }, + "Name": "srcEndpoint=(AWSLambdaBehaviorNotificationBus Handler: String), destEndpoint=(Print: Value)", + "Components": { + "Component_[5244143619937759473]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 5244143619937759473, + "sourceEndpoint": { + "nodeId": { + "id": 10447997250592 + }, + "slotId": { + "m_id": "{C9F7A7D4-83F3-4393-9E47-3805627BBDBB}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 10439407316000 + }, + "slotId": { + "m_id": "{0972A320-2B33-4F31-AC0F-46C4E0CE539B}" + } + } + } + } + }, + { + "Id": { + "id": 10490946923552 + }, + "Name": "srcEndpoint=(EntityBus Handler: ExecutionSlot:OnEntityActivated), destEndpoint=(ReloadConfigFile: In)", + "Components": { + "Component_[6075242503823085865]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 6075242503823085865, + "sourceEndpoint": { + "nodeId": { + "id": 10460882152480 + }, + "slotId": { + "m_id": "{7587D651-DBD8-49B8-8CCC-BFD0E9C890A7}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 10435112348704 + }, + "slotId": { + "m_id": "{7D577F2E-978C-4523-9FDF-6BCEFF0D1F4E}" + } + } + } + } + } + ] + }, + "m_assetType": "{3E2AC8CD-713F-453E-967F-29517F331784}", + "versionData": { + "_grammarVersion": 1, + "_runtimeVersion": 1 + }, + "m_variableCounter": 2, + "GraphCanvasData": [ + { + "Key": { + "id": 10426522414112 + }, + "Value": { + "ComponentData": { + "{5F84B500-8C45-40D1-8EFC-A5306B241444}": { + "$type": "SceneComponentSaveData", + "ViewParams": { + "Scale": 1.3385585, + "AnchorX": -277.910888671875, + "AnchorY": -378.0185852050781 + } + } + } + } + }, + { + "Key": { + "id": 10430817381408 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MethodNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 460.0, + -240.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{81C52F38-D73E-41E1-B0AB-D90267ECE76F}" + } + } + } + }, + { + "Key": { + "id": 10435112348704 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MethodNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 140.0, + -240.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{C501C00F-0E1D-4EC2-A2C1-F5B910826F40}" + } + } + } + }, + { + "Key": { + "id": 10439407316000 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "StringNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 360.0, + 380.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{7711815B-6518-4F40-8A20-F5081EE5423D}" + } + } + } + }, + { + "Key": { + "id": 10443702283296 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "StringNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 360.0, + 120.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{C0461745-3ABD-49F0-B805-0D9C07061D11}" + } + } + } + }, + { + "Key": { + "id": 10447997250592 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 60.0, + 360.0 + ] + }, + "{9E81C95F-89C0-4476-8E82-63CCC4E52E04}": { + "$type": "EBusHandlerNodeDescriptorSaveData", + "EventIds": [ + { + "Value": 1275872951 + } + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{074D28ED-E23D-47EF-9F44-4FCE2E810905}" + } + } + } + }, + { + "Key": { + "id": 10452292217888 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "StringNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 900.0, + -240.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{AF52E352-83AE-4F8B-BB92-CC08893B49CE}" + } + } + } + }, + { + "Key": { + "id": 10456587185184 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 60.0, + 120.0 + ] + }, + "{9E81C95F-89C0-4476-8E82-63CCC4E52E04}": { + "$type": "EBusHandlerNodeDescriptorSaveData", + "EventIds": [ + { + "Value": 3274092371 + } + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{31A0049B-49B9-41FD-A487-30A747F9B700}" + } + } + } + }, + { + "Key": { + "id": 10460882152480 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + -200.0, + -300.0 + ] + }, + "{9E81C95F-89C0-4476-8E82-63CCC4E52E04}": { + "$type": "EBusHandlerNodeDescriptorSaveData", + "EventIds": [ + { + "Value": 245425936 + } + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{C4712614-EB76-4E3B-9FF5-3A4A6593EE2C}" + } + } + } + } + ], + "StatisticsHelper": { + "InstanceCounter": [ + { + "Key": 5842116761103598202, + "Value": 1 + }, + { + "Key": 5842117099792962512, + "Value": 1 + }, + { + "Key": 5842117100734473396, + "Value": 1 + }, + { + "Key": 10684225535275896474, + "Value": 3 + }, + { + "Key": 13774516555319876501, + "Value": 1 + }, + { + "Key": 14402610758592020379, + "Value": 1 + } + ] + } + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/ScriptCanvas/s3demo.scriptcanvas b/AutomatedTesting/ScriptCanvas/s3demo.scriptcanvas index 925cc9da26..30a7d0ee0f 100644 --- a/AutomatedTesting/ScriptCanvas/s3demo.scriptcanvas +++ b/AutomatedTesting/ScriptCanvas/s3demo.scriptcanvas @@ -1,5317 +1,3334 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +{ + "Type": "JsonSerialization", + "Version": 1, + "ClassName": "ScriptCanvasData", + "ClassData": { + "m_scriptCanvas": { + "Id": { + "id": 43214302751776 + }, + "Name": "s3demo", + "Components": { + "Component_[10482302595531409814]": { + "$type": "EditorGraphVariableManagerComponent", + "Id": 10482302595531409814, + "m_variableData": { + "m_nameVariableMap": [ + { + "Key": { + "m_id": "{41203CA6-2B79-4EBD-A738-18A4E001CD22}" + }, + "Value": { + "Datum": { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 5 + }, + "isNullPointer": false, + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "value": "example.txt", + "label": "String" + }, + "VariableId": { + "m_id": "{41203CA6-2B79-4EBD-A738-18A4E001CD22}" + }, + "VariableName": "object key" + } + }, + { + "Key": { + "m_id": "{54D3DD1A-F7A1-4B90-80FF-E83F0C4F3C05}" + }, + "Value": { + "Datum": { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 5 + }, + "isNullPointer": false, + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "value": "@user@/s3_download/output.txt", + "label": "String" + }, + "VariableId": { + "m_id": "{54D3DD1A-F7A1-4B90-80FF-E83F0C4F3C05}" + }, + "VariableName": "outfile" + } + }, + { + "Key": { + "m_id": "{F3CCFFCC-1206-4817-91C6-AC42CA8D5A70}" + }, + "Value": { + "Datum": { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 5 + }, + "isNullPointer": false, + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "value": "AWSCore.ExampleBucketOutput", + "label": "String" + }, + "VariableId": { + "m_id": "{F3CCFFCC-1206-4817-91C6-AC42CA8D5A70}" + }, + "VariableName": "bucket resource key" + } + } + ] + } + }, + "Component_[4689937780747115490]": { + "$type": "{4D755CA9-AB92-462C-B24F-0B3376F19967} Graph", + "Id": 4689937780747115490, + "m_graphData": { + "m_nodes": [ + { + "Id": { + "id": 43231482620960 + }, + "Name": "SC-Node(HeadObject)", + "Components": { + "Component_[11559916401303020459]": { + "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", + "Id": 11559916401303020459, + "Slots": [ + { + "id": { + "m_id": "{0173ADEB-F3B5-4CF6-8DB1-FD99AA146CFC}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + null + ], + "slotName": "Bucket Resource KeyName", + "toolTip": "The resource key name of the bucket in resource mapping config file.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1, + "IsReference": true, + "VariableReference": { + "m_id": "{F3CCFFCC-1206-4817-91C6-AC42CA8D5A70}" + } + }, + { + "id": { + "m_id": "{9E1DAF70-48F9-4A1E-892C-1A22BD7D7DEA}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + null + ], + "slotName": "Object KeyName", + "toolTip": "The object key.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1, + "IsReference": true, + "VariableReference": { + "m_id": "{41203CA6-2B79-4EBD-A738-18A4E001CD22}" + } + }, + { + "id": { + "m_id": "{1042005D-18F7-4B53-9546-2ACCDCCCC9E5}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{6C587F91-F656-4ADC-B03B-88B137B12BDF}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "Datums": [ + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 5 + }, + "isNullPointer": false, + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "value": "", + "label": "Bucket Resource KeyName" + }, + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 5 + }, + "isNullPointer": false, + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "value": "", + "label": "Object KeyName" + } + ], + "methodType": 2, + "methodName": "HeadObject", + "className": "AWSScriptBehaviorS3", + "resultSlotIDs": [ + {} + ], + "prettyClassName": "AWSScriptBehaviorS3" + } + } + }, + { + "Id": { + "id": 43257252424736 + }, + "Name": "EBusEventHandler", + "Components": { + "Component_[11561522857340259242]": { + "$type": "EBusEventHandler", + "Id": 11561522857340259242, + "Slots": [ + { + "id": { + "m_id": "{06B1CC9B-9265-4188-BB5E-B837B7266A8C}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Connect", + "toolTip": "Connect this event handler to the specified entity.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{0E2EB357-2F5A-4C59-8843-1DADE32B4E24}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Disconnect", + "toolTip": "Disconnect this event handler.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{159BD7EF-639F-404C-8B8F-68BD1ABA20C7}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnConnected", + "toolTip": "Signaled when a connection has taken place.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{2A92BDF7-5546-43F1-ABC2-DB1023F368C9}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnDisconnected", + "toolTip": "Signaled when this event handler is disconnected.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{A65AB85E-8F8E-4A66-AF1A-FFB4EC26434C}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnFailure", + "toolTip": "Signaled when it is not possible to connect this handler.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{1A07C91E-56B9-4929-B557-245F839A4A9D}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{E71AFDE4-483A-439D-AF2E-9BA12B1B9A9E}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnHeadObjectSuccess", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{12EF30C9-9A3E-42F5-982B-AD0C050D66C5}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{59125007-F1BC-4618-A04C-C96B4BAC3071}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnHeadObjectError", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{3155816E-2FB1-4C8A-918C-40D4A5F91B49}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{A02F140B-1EDA-4E15-AFAC-CB319F84CA9C}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnGetObjectSuccess", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{849B4270-F66F-4420-9D27-1E8FB3F179B4}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{C2389D75-02AA-4368-A9C2-C6F5B14711AD}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnGetObjectError", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + } + ], + "m_eventMap": [ + { + "Key": { + "Value": 1667438543 + }, + "Value": { + "m_eventName": "OnHeadObjectSuccess", + "m_eventId": { + "Value": 1667438543 + }, + "m_eventSlotId": { + "m_id": "{E71AFDE4-483A-439D-AF2E-9BA12B1B9A9E}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{1A07C91E-56B9-4929-B557-245F839A4A9D}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 3580584090 + }, + "Value": { + "m_eventName": "OnGetObjectSuccess", + "m_eventId": { + "Value": 3580584090 + }, + "m_eventSlotId": { + "m_id": "{A02F140B-1EDA-4E15-AFAC-CB319F84CA9C}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{3155816E-2FB1-4C8A-918C-40D4A5F91B49}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 3753331652 + }, + "Value": { + "m_eventName": "OnGetObjectError", + "m_eventId": { + "Value": 3753331652 + }, + "m_eventSlotId": { + "m_id": "{C2389D75-02AA-4368-A9C2-C6F5B14711AD}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{849B4270-F66F-4420-9D27-1E8FB3F179B4}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 4007236435 + }, + "Value": { + "m_eventName": "OnHeadObjectError", + "m_eventId": { + "Value": 4007236435 + }, + "m_eventSlotId": { + "m_id": "{59125007-F1BC-4618-A04C-C96B4BAC3071}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{12EF30C9-9A3E-42F5-982B-AD0C050D66C5}" + } + ], + "m_numExpectedArguments": 1 + } + } + ], + "m_ebusName": "AWSS3BehaviorNotificationBus", + "m_busId": { + "Value": 1833099679 + } + } + } + }, + { + "Id": { + "id": 43222892686368 + }, + "Name": "EBusEventHandler", + "Components": { + "Component_[15552716946630136054]": { + "$type": "EBusEventHandler", + "Id": 15552716946630136054, + "Slots": [ + { + "id": { + "m_id": "{EC8B94FE-E310-4CAB-B7F3-7116130F3722}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Connect", + "toolTip": "Connect this event handler to the specified entity.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{600A5FC3-5554-4296-B225-38A219D004F3}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Disconnect", + "toolTip": "Disconnect this event handler.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{A0B1BB90-55CF-435A-990D-EDCB1A154DBC}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnConnected", + "toolTip": "Signaled when a connection has taken place.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{CA35C08F-BD47-484E-9A18-3363BF55813F}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnDisconnected", + "toolTip": "Signaled when this event handler is disconnected.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{DEFFE837-932D-4C86-A218-2491EAA0C40A}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnFailure", + "toolTip": "Signaled when it is not possible to connect this handler.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{287A31DA-DB54-4C44-A88A-46B05D8C7410}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{113A79E3-0BB3-49A4-B131-4B4CB28B53E0}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnHeadObjectSuccess", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{076938D3-8BBB-4784-8A7B-15CCAAEC3C29}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{4581870C-A1CF-49C1-A963-E86E73E1C874}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnHeadObjectError", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{D06466C8-B9B4-4712-87C7-E8F034F64396}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{EDA3336F-D744-431D-927B-C5657911532F}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnGetObjectSuccess", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{5367B4E4-AD4A-4851-A027-F7F5E4947D14}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{088A6BB7-701D-4CD4-B647-89E0C373E984}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnGetObjectError", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + } + ], + "m_eventMap": [ + { + "Key": { + "Value": 1667438543 + }, + "Value": { + "m_eventName": "OnHeadObjectSuccess", + "m_eventId": { + "Value": 1667438543 + }, + "m_eventSlotId": { + "m_id": "{113A79E3-0BB3-49A4-B131-4B4CB28B53E0}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{287A31DA-DB54-4C44-A88A-46B05D8C7410}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 3580584090 + }, + "Value": { + "m_eventName": "OnGetObjectSuccess", + "m_eventId": { + "Value": 3580584090 + }, + "m_eventSlotId": { + "m_id": "{EDA3336F-D744-431D-927B-C5657911532F}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{D06466C8-B9B4-4712-87C7-E8F034F64396}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 3753331652 + }, + "Value": { + "m_eventName": "OnGetObjectError", + "m_eventId": { + "Value": 3753331652 + }, + "m_eventSlotId": { + "m_id": "{088A6BB7-701D-4CD4-B647-89E0C373E984}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{5367B4E4-AD4A-4851-A027-F7F5E4947D14}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 4007236435 + }, + "Value": { + "m_eventName": "OnHeadObjectError", + "m_eventId": { + "Value": 4007236435 + }, + "m_eventSlotId": { + "m_id": "{4581870C-A1CF-49C1-A963-E86E73E1C874}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{076938D3-8BBB-4784-8A7B-15CCAAEC3C29}" + } + ], + "m_numExpectedArguments": 1 + } + } + ], + "m_ebusName": "AWSS3BehaviorNotificationBus", + "m_busId": { + "Value": 1833099679 + } + } + } + }, + { + "Id": { + "id": 43218597719072 + }, + "Name": "SC-Node(GetObject)", + "Components": { + "Component_[16208640162035618090]": { + "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", + "Id": 16208640162035618090, + "Slots": [ + { + "id": { + "m_id": "{3DA0B7C1-F06D-489D-B71E-61AF70D6F83E}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + null + ], + "slotName": "Bucket Resource KeyName", + "toolTip": "The resource key name of the bucket in resource mapping config file.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1, + "IsReference": true, + "VariableReference": { + "m_id": "{F3CCFFCC-1206-4817-91C6-AC42CA8D5A70}" + } + }, + { + "id": { + "m_id": "{6DFD6A41-83C0-4F66-894A-81F24E5483B5}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + null + ], + "slotName": "Object KeyName", + "toolTip": "The object key.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1, + "IsReference": true, + "VariableReference": { + "m_id": "{41203CA6-2B79-4EBD-A738-18A4E001CD22}" + } + }, + { + "id": { + "m_id": "{FA7CA3E5-73AA-4BC2-B865-4B10FCF37615}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + null + ], + "slotName": "Outfile Name", + "toolTip": "Filename where the content will be saved.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1, + "IsReference": true, + "VariableReference": { + "m_id": "{54D3DD1A-F7A1-4B90-80FF-E83F0C4F3C05}" + } + }, + { + "id": { + "m_id": "{C93A1797-9A7C-4B04-BF26-583058F75A99}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{F3E487A8-9C6E-4774-A6BB-4638AF1E895B}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "Datums": [ + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 5 + }, + "isNullPointer": false, + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "value": "", + "label": "Bucket Resource KeyName" + }, + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 5 + }, + "isNullPointer": false, + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "value": "", + "label": "Object KeyName" + }, + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 5 + }, + "isNullPointer": false, + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "value": "", + "label": "Outfile Name" + } + ], + "methodType": 2, + "methodName": "GetObject", + "className": "AWSScriptBehaviorS3", + "resultSlotIDs": [ + {} + ], + "prettyClassName": "AWSScriptBehaviorS3" + } + } + }, + { + "Id": { + "id": 43235777588256 + }, + "Name": "EBusEventHandler", + "Components": { + "Component_[16531379412549504774]": { + "$type": "EBusEventHandler", + "Id": 16531379412549504774, + "Slots": [ + { + "id": { + "m_id": "{A059B37C-D151-4700-9477-060A5EDAB8FD}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Connect", + "toolTip": "Connect this event handler to the specified entity.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{2E2CEF9B-6B52-421D-B6EE-A3BA359E2E50}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Disconnect", + "toolTip": "Disconnect this event handler.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{F5C1E1D6-5B8B-4792-959A-20DE4BCA91F5}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnConnected", + "toolTip": "Signaled when a connection has taken place.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{0B64327E-FC0C-434A-BB3A-478CC5579389}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnDisconnected", + "toolTip": "Signaled when this event handler is disconnected.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{D544DFF1-6A24-4087-82C1-55D2596A066B}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnFailure", + "toolTip": "Signaled when it is not possible to connect this handler.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{7EC4DFDD-0097-4A33-9978-15E8215EA7E4}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Source", + "toolTip": "ID used to connect on a specific Event address (Type: EntityId)", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{C75FC969-A2BB-478D-A697-68194823E00F}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "EntityID", + "DisplayDataType": { + "m_type": 1 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{96132FCD-AE62-4841-9913-86B6FA7F702F}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnEntityActivated", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{D461D2D9-2F50-4C54-B478-598A65DA146D}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "EntityID", + "DisplayDataType": { + "m_type": 1 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{F56C8572-06CA-42A6-BFCF-BF23D93882A1}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnEntityDeactivated", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + } + ], + "Datums": [ + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 1 + }, + "isNullPointer": false, + "$type": "EntityId", + "value": { + "id": 2901262558 + }, + "label": "Source" + } + ], + "m_eventMap": [ + { + "Key": { + "Value": 245425936 + }, + "Value": { + "m_eventName": "OnEntityActivated", + "m_eventId": { + "Value": 245425936 + }, + "m_eventSlotId": { + "m_id": "{96132FCD-AE62-4841-9913-86B6FA7F702F}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{C75FC969-A2BB-478D-A697-68194823E00F}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 4273369222 + }, + "Value": { + "m_eventName": "OnEntityDeactivated", + "m_eventId": { + "Value": 4273369222 + }, + "m_eventSlotId": { + "m_id": "{F56C8572-06CA-42A6-BFCF-BF23D93882A1}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{D461D2D9-2F50-4C54-B478-598A65DA146D}" + } + ], + "m_numExpectedArguments": 1 + } + } + ], + "m_ebusName": "EntityBus", + "m_busId": { + "Value": 3358774020 + } + } + } + }, + { + "Id": { + "id": 43227187653664 + }, + "Name": "SC-Node(Print)", + "Components": { + "Component_[17130675518735369413]": { + "$type": "Print", + "Id": 17130675518735369413, + "Slots": [ + { + "id": { + "m_id": "{F20B6702-B739-412A-9FA5-7FE4BBDCD7BA}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "Input signal", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{42D58EFD-404D-4C73-A3A0-0CC8FA4E1A9D}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "m_format": "[S3] Get object request is done", + "m_unresolvedString": [ + "[S3] Get object request is done" + ] + } + } + }, + { + "Id": { + "id": 43270137326624 + }, + "Name": "EBusEventHandler", + "Components": { + "Component_[17252511747753189875]": { + "$type": "EBusEventHandler", + "Id": 17252511747753189875, + "Slots": [ + { + "id": { + "m_id": "{F1B6F60F-4147-4668-B223-E79476027DF3}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Connect", + "toolTip": "Connect this event handler to the specified entity.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{A4278B10-16CF-4D74-AD0B-31341CFDB51A}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Disconnect", + "toolTip": "Disconnect this event handler.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{2FB99DE6-7735-48B6-A3AE-BF172BE15A44}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnConnected", + "toolTip": "Signaled when a connection has taken place.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{48130C37-5219-4815-8BBF-61024581E76F}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnDisconnected", + "toolTip": "Signaled when this event handler is disconnected.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{E972E432-913D-4B69-AFAC-471AF421DB91}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnFailure", + "toolTip": "Signaled when it is not possible to connect this handler.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{22E6A22A-8471-41AC-AAE5-25E4546EA7EB}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{0B510179-CCCA-4F39-A4A3-A06358F98949}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnHeadObjectSuccess", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{8AC14310-1B94-45CB-9D66-3ACA519A0738}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{88DF506C-3993-4F7E-A7A7-C5E22D403AC3}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnHeadObjectError", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{FE344DAB-ADA7-4BC3-95C7-887D8E48FC02}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{F81BAA46-01E0-448F-861A-338FD98BE040}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnGetObjectSuccess", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{C5CD70CA-0D7C-4871-9DDA-839F50C2001E}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{14D416B3-1A25-4850-BF2B-1B26A0EBFB3D}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnGetObjectError", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + } + ], + "m_eventMap": [ + { + "Key": { + "Value": 1667438543 + }, + "Value": { + "m_eventName": "OnHeadObjectSuccess", + "m_eventId": { + "Value": 1667438543 + }, + "m_eventSlotId": { + "m_id": "{0B510179-CCCA-4F39-A4A3-A06358F98949}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{22E6A22A-8471-41AC-AAE5-25E4546EA7EB}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 3580584090 + }, + "Value": { + "m_eventName": "OnGetObjectSuccess", + "m_eventId": { + "Value": 3580584090 + }, + "m_eventSlotId": { + "m_id": "{F81BAA46-01E0-448F-861A-338FD98BE040}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{FE344DAB-ADA7-4BC3-95C7-887D8E48FC02}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 3753331652 + }, + "Value": { + "m_eventName": "OnGetObjectError", + "m_eventId": { + "Value": 3753331652 + }, + "m_eventSlotId": { + "m_id": "{14D416B3-1A25-4850-BF2B-1B26A0EBFB3D}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{C5CD70CA-0D7C-4871-9DDA-839F50C2001E}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 4007236435 + }, + "Value": { + "m_eventName": "OnHeadObjectError", + "m_eventId": { + "Value": 4007236435 + }, + "m_eventSlotId": { + "m_id": "{88DF506C-3993-4F7E-A7A7-C5E22D403AC3}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{8AC14310-1B94-45CB-9D66-3ACA519A0738}" + } + ], + "m_numExpectedArguments": 1 + } + } + ], + "m_ebusName": "AWSS3BehaviorNotificationBus", + "m_busId": { + "Value": 1833099679 + } + } + } + }, + { + "Id": { + "id": 43252957457440 + }, + "Name": "SC-Node(Print)", + "Components": { + "Component_[2501234731758928832]": { + "$type": "Print", + "Id": 2501234731758928832, + "Slots": [ + { + "id": { + "m_id": "{02869715-99BB-4D3C-8F7A-1462CA96731D}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "Input signal", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{00E106ED-3EEA-4CB5-8112-7CD221D6B5AC}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + null + ], + "slotName": "Value", + "toolTip": "Value which replaces instances of {Value} in the resulting string.", + "DisplayDataType": { + "m_type": 5 + }, + "DisplayGroup": { + "Value": 1015031923 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{D9C850A0-2C03-47D1-B9E5-BA78FB24AD8B}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "Datums": [ + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 5 + }, + "isNullPointer": false, + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "value": "", + "label": "Value" + } + ], + "m_format": "[S3] Get object success: {Value}", + "m_arrayBindingMap": [ + { + "Key": 1, + "Value": { + "m_id": "{00E106ED-3EEA-4CB5-8112-7CD221D6B5AC}" + } + } + ], + "m_unresolvedString": [ + "[S3] Get object success: ", + {} + ], + "m_formatSlotMap": { + "Value": { + "m_id": "{00E106ED-3EEA-4CB5-8112-7CD221D6B5AC}" + } + } + } + } + }, + { + "Id": { + "id": 43244367522848 + }, + "Name": "EBusEventHandler", + "Components": { + "Component_[5737311846476161362]": { + "$type": "EBusEventHandler", + "Id": 5737311846476161362, + "Slots": [ + { + "id": { + "m_id": "{A2C22B56-F88F-45C3-BB08-2DCA89E0A78C}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Connect", + "toolTip": "Connect this event handler to the specified entity.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{242CB789-E4B0-4A58-A1BA-65EE0B383A19}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Disconnect", + "toolTip": "Disconnect this event handler.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{3512B770-50F3-450C-B1DE-C834D75D6426}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnConnected", + "toolTip": "Signaled when a connection has taken place.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{CB8CC02E-F39A-49F2-B0D4-AAA79A305E38}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnDisconnected", + "toolTip": "Signaled when this event handler is disconnected.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{0B743445-0102-4606-A4C8-37E19FD0E7AD}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnFailure", + "toolTip": "Signaled when it is not possible to connect this handler.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{3D2D7D19-C7C1-4C2E-8543-5848C8A69A18}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{4D4EC3D0-FD4C-441C-B154-340A529C8ECB}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnHeadObjectSuccess", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{CEA17C8D-B5D1-4BFC-A2A5-255E400E0CBB}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{6C74517A-866E-49F5-A40F-789824D17513}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnHeadObjectError", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{95CE49C3-4F0A-4965-B5C3-913513569320}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{FDE03B1F-652D-4CDA-A206-31A26CA41AC3}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnGetObjectSuccess", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{9B140702-0E62-4F33-A078-552BF9697528}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{1A667A27-E9D8-44E0-8ACF-EDE596B226FE}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnGetObjectError", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + } + ], + "m_eventMap": [ + { + "Key": { + "Value": 1667438543 + }, + "Value": { + "m_eventName": "OnHeadObjectSuccess", + "m_eventId": { + "Value": 1667438543 + }, + "m_eventSlotId": { + "m_id": "{4D4EC3D0-FD4C-441C-B154-340A529C8ECB}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{3D2D7D19-C7C1-4C2E-8543-5848C8A69A18}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 3580584090 + }, + "Value": { + "m_eventName": "OnGetObjectSuccess", + "m_eventId": { + "Value": 3580584090 + }, + "m_eventSlotId": { + "m_id": "{FDE03B1F-652D-4CDA-A206-31A26CA41AC3}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{95CE49C3-4F0A-4965-B5C3-913513569320}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 3753331652 + }, + "Value": { + "m_eventName": "OnGetObjectError", + "m_eventId": { + "Value": 3753331652 + }, + "m_eventSlotId": { + "m_id": "{1A667A27-E9D8-44E0-8ACF-EDE596B226FE}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{9B140702-0E62-4F33-A078-552BF9697528}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 4007236435 + }, + "Value": { + "m_eventName": "OnHeadObjectError", + "m_eventId": { + "Value": 4007236435 + }, + "m_eventSlotId": { + "m_id": "{6C74517A-866E-49F5-A40F-789824D17513}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{CEA17C8D-B5D1-4BFC-A2A5-255E400E0CBB}" + } + ], + "m_numExpectedArguments": 1 + } + } + ], + "m_ebusName": "AWSS3BehaviorNotificationBus", + "m_busId": { + "Value": 1833099679 + } + } + } + }, + { + "Id": { + "id": 43265842359328 + }, + "Name": "SC-Node(Print)", + "Components": { + "Component_[6038075997199437353]": { + "$type": "Print", + "Id": 6038075997199437353, + "Slots": [ + { + "id": { + "m_id": "{47658951-971E-411F-9E31-B960D7F48DC8}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "Input signal", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{849AEBCF-3D93-486A-8A21-3461F96CBFAF}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + null + ], + "slotName": "Value", + "toolTip": "Value which replaces instances of {Value} in the resulting string.", + "DisplayDataType": { + "m_type": 5 + }, + "DisplayGroup": { + "Value": 1015031923 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{7B689681-8F86-4DD4-A271-9F1343C85751}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "Datums": [ + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 5 + }, + "isNullPointer": false, + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "value": "", + "label": "Value" + } + ], + "m_format": "[S3] Head object error: {Value}", + "m_arrayBindingMap": [ + { + "Key": 1, + "Value": { + "m_id": "{849AEBCF-3D93-486A-8A21-3461F96CBFAF}" + } + } + ], + "m_unresolvedString": [ + "[S3] Head object error: ", + {} + ], + "m_formatSlotMap": { + "Value": { + "m_id": "{849AEBCF-3D93-486A-8A21-3461F96CBFAF}" + } + } + } + } + }, + { + "Id": { + "id": 43274432293920 + }, + "Name": "SC-Node(Print)", + "Components": { + "Component_[7524644815559451168]": { + "$type": "Print", + "Id": 7524644815559451168, + "Slots": [ + { + "id": { + "m_id": "{230376C6-C66E-4820-806D-7DFD860B3E4E}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "Input signal", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{9D4AD3B1-5346-46BF-B41A-1E8DB0CFCEC0}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + null + ], + "slotName": "Value", + "toolTip": "Value which replaces instances of {Value} in the resulting string.", + "DisplayDataType": { + "m_type": 5 + }, + "DisplayGroup": { + "Value": 1015031923 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{25ED2874-445E-4A51-A67C-918642660FE6}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "Datums": [ + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 5 + }, + "isNullPointer": false, + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "value": "", + "label": "Value" + } + ], + "m_format": "[S3] Head object success: {Value}", + "m_arrayBindingMap": [ + { + "Key": 1, + "Value": { + "m_id": "{9D4AD3B1-5346-46BF-B41A-1E8DB0CFCEC0}" + } + } + ], + "m_unresolvedString": [ + "[S3] Head object success: ", + {} + ], + "m_formatSlotMap": { + "Value": { + "m_id": "{9D4AD3B1-5346-46BF-B41A-1E8DB0CFCEC0}" + } + } + } + } + }, + { + "Id": { + "id": 43248662490144 + }, + "Name": "SC-Node(Print)", + "Components": { + "Component_[8569132577613124023]": { + "$type": "Print", + "Id": 8569132577613124023, + "Slots": [ + { + "id": { + "m_id": "{8D6415DA-B0B8-49F1-885A-B95F974BF918}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "Input signal", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{2AF01FCE-39ED-4EF8-96EF-ABB1210CB96A}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "m_format": "[S3] Head object request is done", + "m_unresolvedString": [ + "[S3] Head object request is done" + ] + } + } + }, + { + "Id": { + "id": 43261547392032 + }, + "Name": "SC-Node(Print)", + "Components": { + "Component_[9427570285251689352]": { + "$type": "Print", + "Id": 9427570285251689352, + "Slots": [ + { + "id": { + "m_id": "{472018A5-91A3-420B-9A53-8C6C3BDB3B9A}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "Input signal", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{63318564-6CBD-48A0-A716-7EE608D79B9D}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + null + ], + "slotName": "Value", + "toolTip": "Value which replaces instances of {Value} in the resulting string.", + "DisplayDataType": { + "m_type": 5 + }, + "DisplayGroup": { + "Value": 1015031923 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{308C5FF1-B80E-40E1-A532-D29B9BFCD19A}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "Datums": [ + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 5 + }, + "isNullPointer": false, + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "value": "", + "label": "Value" + } + ], + "m_format": "[S3] Get object error: {Value}", + "m_arrayBindingMap": [ + { + "Key": 1, + "Value": { + "m_id": "{63318564-6CBD-48A0-A716-7EE608D79B9D}" + } + } + ], + "m_unresolvedString": [ + "[S3] Get object error: ", + {} + ], + "m_formatSlotMap": { + "Value": { + "m_id": "{63318564-6CBD-48A0-A716-7EE608D79B9D}" + } + } + } + } + }, + { + "Id": { + "id": 43240072555552 + }, + "Name": "SC-Node(ReloadConfigFile)", + "Components": { + "Component_[9465828106765719444]": { + "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", + "Id": 9465828106765719444, + "Slots": [ + { + "id": { + "m_id": "{9DB59CFA-EB53-4A27-BA02-C0449B9D4E85}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + null + ], + "slotName": "Is Reloading Config FileName", + "toolTip": "Whether reload resource mapping config file name from AWS core configuration settings registry file.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{DEE8C121-E96B-440D-A2DE-9BD38D2BED44}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{5B7C73DF-E637-4E11-A0A4-683B5A0DDC19}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "Datums": [ + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 0 + }, + "isNullPointer": false, + "$type": "bool", + "value": true, + "label": "Is Reloading Config FileName" + } + ], + "methodType": 0, + "methodName": "ReloadConfigFile", + "className": "AWSResourceMappingRequestBus", + "resultSlotIDs": [ + {} + ], + "prettyClassName": "AWSResourceMappingRequestBus" + } + } + } + ], + "m_connections": [ + { + "Id": { + "id": 43278727261216 + }, + "Name": "srcEndpoint=(AWSS3BehaviorNotificationBus Handler: String), destEndpoint=(Print: Value)", + "Components": { + "Component_[10778518234367908860]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 10778518234367908860, + "sourceEndpoint": { + "nodeId": { + "id": 43270137326624 + }, + "slotId": { + "m_id": "{8AC14310-1B94-45CB-9D66-3ACA519A0738}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 43265842359328 + }, + "slotId": { + "m_id": "{849AEBCF-3D93-486A-8A21-3461F96CBFAF}" + } + } + } + } + }, + { + "Id": { + "id": 43283022228512 + }, + "Name": "srcEndpoint=(AWSS3BehaviorNotificationBus Handler: ExecutionSlot:OnHeadObjectError), destEndpoint=(Print: In)", + "Components": { + "Component_[7890841757728312462]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 7890841757728312462, + "sourceEndpoint": { + "nodeId": { + "id": 43270137326624 + }, + "slotId": { + "m_id": "{88DF506C-3993-4F7E-A7A7-C5E22D403AC3}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 43265842359328 + }, + "slotId": { + "m_id": "{47658951-971E-411F-9E31-B960D7F48DC8}" + } + } + } + } + }, + { + "Id": { + "id": 43287317195808 + }, + "Name": "srcEndpoint=(AWSS3BehaviorNotificationBus Handler: String), destEndpoint=(Print: Value)", + "Components": { + "Component_[6865970583966228885]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 6865970583966228885, + "sourceEndpoint": { + "nodeId": { + "id": 43222892686368 + }, + "slotId": { + "m_id": "{287A31DA-DB54-4C44-A88A-46B05D8C7410}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 43274432293920 + }, + "slotId": { + "m_id": "{9D4AD3B1-5346-46BF-B41A-1E8DB0CFCEC0}" + } + } + } + } + }, + { + "Id": { + "id": 43291612163104 + }, + "Name": "srcEndpoint=(AWSS3BehaviorNotificationBus Handler: ExecutionSlot:OnHeadObjectSuccess), destEndpoint=(Print: In)", + "Components": { + "Component_[15391746362756122553]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 15391746362756122553, + "sourceEndpoint": { + "nodeId": { + "id": 43222892686368 + }, + "slotId": { + "m_id": "{113A79E3-0BB3-49A4-B131-4B4CB28B53E0}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 43274432293920 + }, + "slotId": { + "m_id": "{230376C6-C66E-4820-806D-7DFD860B3E4E}" + } + } + } + } + }, + { + "Id": { + "id": 43295907130400 + }, + "Name": "srcEndpoint=(AWSS3BehaviorNotificationBus Handler: String), destEndpoint=(Print: Value)", + "Components": { + "Component_[10039585713229296427]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 10039585713229296427, + "sourceEndpoint": { + "nodeId": { + "id": 43244367522848 + }, + "slotId": { + "m_id": "{9B140702-0E62-4F33-A078-552BF9697528}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 43261547392032 + }, + "slotId": { + "m_id": "{63318564-6CBD-48A0-A716-7EE608D79B9D}" + } + } + } + } + }, + { + "Id": { + "id": 43300202097696 + }, + "Name": "srcEndpoint=(AWSS3BehaviorNotificationBus Handler: ExecutionSlot:OnGetObjectError), destEndpoint=(Print: In)", + "Components": { + "Component_[8537998926774803273]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 8537998926774803273, + "sourceEndpoint": { + "nodeId": { + "id": 43244367522848 + }, + "slotId": { + "m_id": "{1A667A27-E9D8-44E0-8ACF-EDE596B226FE}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 43261547392032 + }, + "slotId": { + "m_id": "{472018A5-91A3-420B-9A53-8C6C3BDB3B9A}" + } + } + } + } + }, + { + "Id": { + "id": 43304497064992 + }, + "Name": "srcEndpoint=(AWSS3BehaviorNotificationBus Handler: String), destEndpoint=(Print: Value)", + "Components": { + "Component_[7088318236002637260]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 7088318236002637260, + "sourceEndpoint": { + "nodeId": { + "id": 43257252424736 + }, + "slotId": { + "m_id": "{3155816E-2FB1-4C8A-918C-40D4A5F91B49}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 43252957457440 + }, + "slotId": { + "m_id": "{00E106ED-3EEA-4CB5-8112-7CD221D6B5AC}" + } + } + } + } + }, + { + "Id": { + "id": 43308792032288 + }, + "Name": "srcEndpoint=(AWSS3BehaviorNotificationBus Handler: ExecutionSlot:OnGetObjectSuccess), destEndpoint=(Print: In)", + "Components": { + "Component_[6349865987641866384]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 6349865987641866384, + "sourceEndpoint": { + "nodeId": { + "id": 43257252424736 + }, + "slotId": { + "m_id": "{A02F140B-1EDA-4E15-AFAC-CB319F84CA9C}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 43252957457440 + }, + "slotId": { + "m_id": "{02869715-99BB-4D3C-8F7A-1462CA96731D}" + } + } + } + } + }, + { + "Id": { + "id": 43313086999584 + }, + "Name": "srcEndpoint=(ReloadConfigFile: Out), destEndpoint=(HeadObject: In)", + "Components": { + "Component_[755160556781400310]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 755160556781400310, + "sourceEndpoint": { + "nodeId": { + "id": 43240072555552 + }, + "slotId": { + "m_id": "{5B7C73DF-E637-4E11-A0A4-683B5A0DDC19}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 43231482620960 + }, + "slotId": { + "m_id": "{1042005D-18F7-4B53-9546-2ACCDCCCC9E5}" + } + } + } + } + }, + { + "Id": { + "id": 43317381966880 + }, + "Name": "srcEndpoint=(HeadObject: Out), destEndpoint=(Print: In)", + "Components": { + "Component_[17407727815180487561]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 17407727815180487561, + "sourceEndpoint": { + "nodeId": { + "id": 43231482620960 + }, + "slotId": { + "m_id": "{6C587F91-F656-4ADC-B03B-88B137B12BDF}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 43248662490144 + }, + "slotId": { + "m_id": "{8D6415DA-B0B8-49F1-885A-B95F974BF918}" + } + } + } + } + }, + { + "Id": { + "id": 43321676934176 + }, + "Name": "srcEndpoint=(Print: Out), destEndpoint=(GetObject: In)", + "Components": { + "Component_[8583709945803435033]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 8583709945803435033, + "sourceEndpoint": { + "nodeId": { + "id": 43274432293920 + }, + "slotId": { + "m_id": "{25ED2874-445E-4A51-A67C-918642660FE6}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 43218597719072 + }, + "slotId": { + "m_id": "{C93A1797-9A7C-4B04-BF26-583058F75A99}" + } + } + } + } + }, + { + "Id": { + "id": 43325971901472 + }, + "Name": "srcEndpoint=(GetObject: Out), destEndpoint=(Print: In)", + "Components": { + "Component_[3235938356873265601]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 3235938356873265601, + "sourceEndpoint": { + "nodeId": { + "id": 43218597719072 + }, + "slotId": { + "m_id": "{F3E487A8-9C6E-4774-A6BB-4638AF1E895B}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 43227187653664 + }, + "slotId": { + "m_id": "{F20B6702-B739-412A-9FA5-7FE4BBDCD7BA}" + } + } + } + } + }, + { + "Id": { + "id": 43330266868768 + }, + "Name": "srcEndpoint=(EntityBus Handler: ExecutionSlot:OnEntityActivated), destEndpoint=(ReloadConfigFile: In)", + "Components": { + "Component_[1671079381113308163]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 1671079381113308163, + "sourceEndpoint": { + "nodeId": { + "id": 43235777588256 + }, + "slotId": { + "m_id": "{96132FCD-AE62-4841-9913-86B6FA7F702F}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 43240072555552 + }, + "slotId": { + "m_id": "{DEE8C121-E96B-440D-A2DE-9BD38D2BED44}" + } + } + } + } + } + ] + }, + "m_assetType": "{3E2AC8CD-713F-453E-967F-29517F331784}", + "versionData": { + "_grammarVersion": 1, + "_runtimeVersion": 1 + }, + "m_variableCounter": 1, + "GraphCanvasData": [ + { + "Key": { + "id": 43214302751776 + }, + "Value": { + "ComponentData": { + "{5F84B500-8C45-40D1-8EFC-A5306B241444}": { + "$type": "SceneComponentSaveData", + "ViewParams": { + "Scale": 1.2767297, + "AnchorX": -135.50244140625, + "AnchorY": 99.47289276123047 + } + } + } + } + }, + { + "Key": { + "id": 43218597719072 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MethodNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 620.0, + 700.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{BB84AD11-429D-471E-BE7B-2931F9C332D5}" + } + } + } + }, + { + "Key": { + "id": 43222892686368 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 0.0, + 680.0 + ] + }, + "{9E81C95F-89C0-4476-8E82-63CCC4E52E04}": { + "$type": "EBusHandlerNodeDescriptorSaveData", + "EventIds": [ + { + "Value": 1667438543 + } + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{EF2D56C8-CFAA-41F0-9C07-8CE818D86AA1}" + } + } + } + }, + { + "Key": { + "id": 43227187653664 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "StringNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 1060.0, + 700.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{06BFB417-3B96-40F3-9D42-21AB0293D4DA}" + } + } + } + }, + { + "Key": { + "id": 43231482620960 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MethodNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 480.0, + 140.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{740DBD99-C319-404C-A3D7-450E64613B73}" + } + } + } + }, + { + "Key": { + "id": 43235777588256 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + -140.0, + 60.0 + ] + }, + "{9E81C95F-89C0-4476-8E82-63CCC4E52E04}": { + "$type": "EBusHandlerNodeDescriptorSaveData", + "EventIds": [ + { + "Value": 245425936 + } + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{93CC9E2D-86CD-4FB5-95E4-961F6ABF9B39}" + } + } + } + }, + { + "Key": { + "id": 43240072555552 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MethodNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 180.0, + 140.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{CD3D6D5F-F274-4592-A15D-01422CA3EBE7}" + } + } + } + }, + { + "Key": { + "id": 43244367522848 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 0.0, + 980.0 + ] + }, + "{9E81C95F-89C0-4476-8E82-63CCC4E52E04}": { + "$type": "EBusHandlerNodeDescriptorSaveData", + "EventIds": [ + { + "Value": 3753331652 + } + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{DCBCA7D8-58C9-4C2C-8BF8-04EFD44F0988}" + } + } + } + }, + { + "Key": { + "id": 43248662490144 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "StringNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 920.0, + 140.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{FE6ECEDF-A83B-4A89-A8DB-2166A3C8319E}" + } + } + } + }, + { + "Key": { + "id": 43252957457440 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "StringNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 980.0, + 1000.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{F441C1CA-A02D-45D0-BB4F-D32F5B797464}" + } + } + } + }, + { + "Key": { + "id": 43257252424736 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 640.0, + 980.0 + ] + }, + "{9E81C95F-89C0-4476-8E82-63CCC4E52E04}": { + "$type": "EBusHandlerNodeDescriptorSaveData", + "EventIds": [ + { + "Value": 3580584090 + } + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{5B28E54D-DC62-4358-9DA6-EA8B9CE006F9}" + } + } + } + }, + { + "Key": { + "id": 43261547392032 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "StringNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 320.0, + 1000.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{EEDD65F5-EF45-458F-BF74-751F981F726B}" + } + } + } + }, + { + "Key": { + "id": 43265842359328 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "StringNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 320.0, + 380.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{251706A4-3954-4D6D-A2BA-E69653339775}" + } + } + } + }, + { + "Key": { + "id": 43270137326624 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 0.0, + 340.0 + ] + }, + "{9E81C95F-89C0-4476-8E82-63CCC4E52E04}": { + "$type": "EBusHandlerNodeDescriptorSaveData", + "EventIds": [ + { + "Value": 4007236435 + } + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{BBAC49E9-7973-4856-8679-3062BDC02E15}" + } + } + } + }, + { + "Key": { + "id": 43274432293920 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "StringNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 320.0, + 700.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{6F86C19E-C1CB-48E9-A07E-E5530C0EB249}" + } + } + } + } + ], + "StatisticsHelper": { + "InstanceCounter": [ + { + "Key": 150571302584609517, + "Value": 1 + }, + { + "Key": 2868561716899956608, + "Value": 1 + }, + { + "Key": 5842116761103598202, + "Value": 1 + }, + { + "Key": 5842117502542734531, + "Value": 1 + }, + { + "Key": 5842117502822853940, + "Value": 1 + }, + { + "Key": 5842117516270952429, + "Value": 1 + }, + { + "Key": 5842117517645097144, + "Value": 1 + }, + { + "Key": 10684225535275896474, + "Value": 6 + }, + { + "Key": 13774516555319876501, + "Value": 1 + } + ] + } + } + } + } + } +} \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 0a38177714..7a668af6a1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,8 +28,8 @@ include(cmake/FileUtil.cmake) include(cmake/PAL.cmake) include(cmake/PALTools.cmake) include(cmake/RuntimeDependencies.cmake) -include(cmake/Install.cmake) include(cmake/Configurations.cmake) # Requires to be after PAL so we get platform variable definitions +include(cmake/Install.cmake) include(cmake/Dependencies.cmake) include(cmake/Deployment.cmake) include(cmake/3rdParty.cmake) @@ -64,14 +64,13 @@ include(cmake/Projects.cmake) if(NOT INSTALLED_ENGINE) # Add the rest of the targets + add_subdirectory(Assets) add_subdirectory(Code) + add_subdirectory(python) + add_subdirectory(Registry) add_subdirectory(scripts) - - # SPEC-1417 will investigate and fix this - if(NOT PAL_PLATFORM_NAME STREQUAL "Mac") - add_subdirectory(Tools/LyTestTools/tests/) - add_subdirectory(Tools/RemoteConsole/ly_remote_console/tests/) - endif() + add_subdirectory(Templates) + add_subdirectory(Tools) # Add external subdirectories listed in the engine.json. LY_EXTERNAL_SUBDIRS is a cache variable so the user can add extra # external subdirectories diff --git a/Code/Editor/2DViewport.cpp b/Code/Editor/2DViewport.cpp index 56f2e7bdf5..ed810aea29 100644 --- a/Code/Editor/2DViewport.cpp +++ b/Code/Editor/2DViewport.cpp @@ -70,9 +70,9 @@ static void OnMenuGrid() inline Vec3 SnapToSize(Vec3 v, double size) { Vec3 snapped; - snapped.x = floor((v.x / size) + 0.5) * size; - snapped.y = floor((v.y / size) + 0.5) * size; - snapped.z = floor((v.z / size) + 0.5) * size; + snapped.x = static_cast(floor((v.x / size) + 0.5) * size); + snapped.y = static_cast(floor((v.y / size) + 0.5) * size); + snapped.z = static_cast(floor((v.z / size) + 0.5) * size); return snapped; } @@ -479,8 +479,8 @@ void Q2DViewport::SetZoom(float fZoomFactor, const QPoint& center) SetZoomFactor(fZoomFactor); // Calculate new offset to center zoom on mouse. - float x2 = center.x(); - float y2 = m_rcClient.height() - center.y(); + float x2 = static_cast(center.x()); + float y2 = static_cast(m_rcClient.height() - center.y()); ofsx = -(x2 / s2 - x2 / s1 - ofsx); ofsy = -(y2 / s2 - y2 / s1 - ofsy); SetScrollOffset(ofsx, ofsy, true); @@ -544,21 +544,21 @@ void Q2DViewport::Update() QPoint Q2DViewport::WorldToView(const Vec3& wp) const { Vec3 sp = m_screenTM.TransformPoint(wp); - QPoint p = QPoint(sp.x, sp.y); + QPoint p = QPoint(static_cast(sp.x), static_cast(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(sp.x, sp.y); + QPoint p = QPoint(static_cast(sp.x), static_cast(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 { - Vec3 wp = m_screenTM_Inverted.TransformPoint(Vec3(vp.x(), vp.y(), 0)); + Vec3 wp = m_screenTM_Inverted.TransformPoint(Vec3(static_cast(vp.x()), static_cast(vp.y()), 0.0f)); switch (m_axis) { case VPA_XY: @@ -694,10 +694,10 @@ void Q2DViewport::DrawGrid(DisplayContext& dc, bool bNoXNumbers) Matrix34 viewTM = GetViewTM().GetInverted() * m_screenTM_Inverted; Matrix34 viewTM_Inv = m_screenTM * GetViewTM(); - Vec3 viewP0 = viewTM.TransformPoint(Vec3(0, 0, 0)); - Vec3 viewP1 = viewTM.TransformPoint(Vec3(m_rcClient.width(), m_rcClient.height(), 0)); + Vec3 viewP0 = viewTM.TransformPoint(Vec3(0.0f, 0.0f, 0.0f)); + Vec3 viewP1 = viewTM.TransformPoint(Vec3(static_cast(m_rcClient.width()), static_cast(m_rcClient.height()), 0.0f)); - Vec3 viewP_Text = viewTM.TransformPoint(Vec3(0, m_rcClient.height(), 0)); + Vec3 viewP_Text = viewTM.TransformPoint(Vec3(0.0f, static_cast(m_rcClient.height()), 0.0f)); if (m_bShowMinorGridLines && (!m_bAutoAdjustGrids || pixelsPerGrid > 5)) { @@ -806,8 +806,8 @@ void Q2DViewport::DrawGrid(DisplayContext& dc, bool bNoXNumbers) { Vec3 org = m_screenTM.TransformPoint(Vec3(0, 0, 0)); dc.SetColor(AXIS_GRID_COLOR); - dc.DrawLine(Vec3(org.x, 0, fZ), Vec3(org.x, height, fZ)); - dc.DrawLine(Vec3(0, org.y, fZ), Vec3(width, org.y, fZ)); + dc.DrawLine(Vec3(org.x, 0.0f, fZ), Vec3(org.x, static_cast(height), fZ)); + dc.DrawLine(Vec3(0.0f, org.y, fZ), Vec3(static_cast(width), org.y, fZ)); } ////////////////////////////////////////////////////////////////////////// } @@ -860,18 +860,18 @@ void Q2DViewport::DrawAxis(DisplayContext& dc) int height = m_rcClient.height(); int size = 25; - Vec3 pos(30, height - 15, 1); + Vec3 pos(30.0f, static_cast(height - 15), 1.0f); dc.SetColor(colx.x, colx.y, colx.z, 1); - dc.DrawLine(pos, pos + Vec3(size, 0, 0)); + dc.DrawLine(pos, pos + Vec3(static_cast(size), 0.0f, 0.0f)); - dc.SetColor(coly.x, coly.y, coly.z, 1); - dc.DrawLine(pos, pos - Vec3(0, size, 0)); + dc.SetColor(coly.x, coly.y, coly.z, 1.0f); + dc.DrawLine(pos, pos - Vec3(0.0f, static_cast(size), 0.0f)); dc.SetColor(m_colorAxisText); - pos.x -= 3; - pos.y -= 4; - pos.z = 2; + pos.x -= 3.0f; + pos.y -= 4.0f; + pos.z = 2.0f; dc.Draw2dTextLabel(pos.x + size + 4, pos.y - 2, 1, xstr); dc.Draw2dTextLabel(pos.x + 3, pos.y - size, 1, ystr); dc.Draw2dTextLabel(pos.x - 5, pos.y + 5, 1, zstr); @@ -910,10 +910,14 @@ void Q2DViewport::DrawSelection(DisplayContext& dc) dc.SetColor(SELECTION_RECT_COLOR.x, SELECTION_RECT_COLOR.y, SELECTION_RECT_COLOR.z, 1); QPoint p1(m_selectedRect.left(), m_selectedRect.top()); QPoint p2(m_selectedRect.right() + 1, m_selectedRect.bottom() +1); - dc.DrawLine(Vec3(p1.x(), p1.y(), 0), Vec3(p2.x(), p1.y(), 0)); - dc.DrawLine(Vec3(p1.x(), p2.y(), 0), Vec3(p2.x(), p2.y(), 0)); - dc.DrawLine(Vec3(p1.x(), p1.y(), 0), Vec3(p1.x(), p2.y(), 0)); - dc.DrawLine(Vec3(p2.x(), p1.y(), 0), Vec3(p2.x(), p2.y(), 0)); + dc.DrawLine( + Vec3(static_cast(p1.x()), static_cast(p1.y()), 0.0f), Vec3(static_cast(p2.x()), static_cast(p1.y()), 0.0f)); + dc.DrawLine( + Vec3(static_cast(p1.x()), static_cast(p2.y()), 0.0f), Vec3(static_cast(p2.x()), static_cast(p2.y()), 0.0f)); + dc.DrawLine( + Vec3(static_cast(p1.x()), static_cast(p1.y()), 0.0f), Vec3(static_cast(p1.x()), static_cast(p2.y()), 0.0f)); + dc.DrawLine( + Vec3(static_cast(p2.x()), static_cast(p1.y()), 0.0f), Vec3(static_cast(p2.x()), static_cast(p2.y()), 0.0f)); } } @@ -952,7 +956,8 @@ void Q2DViewport::DrawViewerMarker(DisplayContext& dc) dc.SetColor(QColor(0, 0, 255)); // blue dc.DrawWireBox(-dim * noScale, dim * noScale); - float fov = GetIEditor()->GetSystem()->GetViewCamera().GetFov(); + constexpr float DefaultFov = 60.f; + float fov = DefaultFov; Vec3 q[4]; float dist = 30; @@ -1037,16 +1042,16 @@ AABB Q2DViewport::GetWorldBounds(const QPoint& pnt1, const QPoint& pnt2) { case VPA_XY: case VPA_YX: - box.min.z = -maxSize; - box.max.z = maxSize; + box.min.z = static_cast(-maxSize); + box.max.z = static_cast(maxSize); break; case VPA_XZ: - box.min.y = -maxSize; - box.max.y = maxSize; + box.min.y = static_cast(-maxSize); + box.max.y = static_cast(maxSize); break; case VPA_YZ: - box.min.x = -maxSize; - box.max.x = maxSize; + box.min.x = static_cast(-maxSize); + box.max.x = static_cast(maxSize); break; } return box; @@ -1075,32 +1080,32 @@ void Q2DViewport::OnDragSelectRectangle(const QRect &rect, [[maybe_unused]] bool switch (m_axis) { case VPA_XY: - box.min.z = -maxSize; - box.max.z = maxSize; + box.min.z = static_cast(-maxSize); + box.max.z = static_cast(maxSize); w = box.max.x - box.min.x; h = box.max.y - box.min.y; sprintf_s(szNewStatusText, "X:%g Y:%g W:%g H:%g", org.x, org.y, w, h); break; case VPA_YX: - box.min.z = -maxSize; - box.max.z = maxSize; + box.min.z = static_cast(-maxSize); + box.max.z = static_cast(maxSize); w = box.max.y - box.min.y; h = box.max.x - box.min.x; sprintf_s(szNewStatusText, "X:%g Y:%g W:%g H:%g", org.x, org.y, w, h); break; case VPA_XZ: - box.min.y = -maxSize; - box.max.y = maxSize; + box.min.y = static_cast(-maxSize); + box.max.y = static_cast(maxSize); w = box.max.x - box.min.x; h = box.max.z - box.min.z; sprintf_s(szNewStatusText, "X:%g Z:%g W:%g H:%g", org.x, org.z, w, h); break; case VPA_YZ: - box.min.x = -maxSize; - box.max.x = maxSize; + box.min.x = static_cast(-maxSize); + box.max.x = static_cast(maxSize); w = box.max.y - box.min.y; h = box.max.z - box.min.z; diff --git a/Code/Editor/AboutDialog.cpp b/Code/Editor/AboutDialog.cpp index 8429e86553..f8abe67376 100644 --- a/Code/Editor/AboutDialog.cpp +++ b/Code/Editor/AboutDialog.cpp @@ -25,7 +25,7 @@ AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING #include AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING -CAboutDialog::CAboutDialog(QString versionText, QString richTextCopyrightNotice, QWidget* pParent /*=NULL*/) +CAboutDialog::CAboutDialog(QString versionText, QString richTextCopyrightNotice, QWidget* pParent /*=nullptr*/) : QDialog(pParent) , m_ui(new Ui::CAboutDialog) { diff --git a/Code/Editor/ActionManager.cpp b/Code/Editor/ActionManager.cpp index 390dbbc1bd..ff74a2c208 100644 --- a/Code/Editor/ActionManager.cpp +++ b/Code/Editor/ActionManager.cpp @@ -326,6 +326,7 @@ ActionManager::MenuWrapper ActionManager::FindMenu(const QString& menuId) return *menuIt; } + AZ_UNUSED(menuId); // Prevent unused warning in release builds AZ_Warning("ActionManager", false, "Did not find menu with menuId %s", menuId.toUtf8().data()); return nullptr; }(); diff --git a/Code/Editor/Animation/SkeletonHierarchy.cpp b/Code/Editor/Animation/SkeletonHierarchy.cpp deleted file mode 100644 index d1cc44b31d..0000000000 --- a/Code/Editor/Animation/SkeletonHierarchy.cpp +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#include "EditorDefs.h" -#include "SkeletonHierarchy.h" - -using namespace Skeleton; - -/* - - CHierarchy - -*/ - -CHierarchy::CHierarchy() -{ -} - -CHierarchy::~CHierarchy() -{ -} - -// - -uint32 CHierarchy::AddNode(const char* name, const QuatT& pose, int32 parent) -{ - int32 index = FindNodeIndexByName(name); - - if (index < 0) - { - m_nodes.push_back(SNode()); - index = int32(m_nodes.size() - 1); - } - - m_nodes[index].name = name; - m_nodes[index].pose = pose; - m_nodes[index].parent = parent; - return uint32(index); -} - -int32 CHierarchy::FindNodeIndexByName(const char* name) const -{ - uint32 count = uint32(m_nodes.size()); - for (uint32 i = 0; i < count; ++i) - { - if (::_stricmp(m_nodes[i].name, name)) - { - continue; - } - - return i; - } - - return -1; -} - -const CHierarchy::SNode* CHierarchy::FindNode(const char* name) const -{ - int32 index = FindNodeIndexByName(name); - return index < 0 ? nullptr : &m_nodes[index]; -} - -void CHierarchy::CreateFrom(IDefaultSkeleton* pIDefaultSkeleton) -{ - const uint32 jointCount = pIDefaultSkeleton->GetJointCount(); - - m_nodes.clear(); - m_nodes.reserve(jointCount); - for (uint32 i = 0; i < jointCount; ++i) - { - m_nodes.push_back(SNode()); - - m_nodes.back().name = pIDefaultSkeleton->GetJointNameByID(int32(i)); - m_nodes.back().pose = pIDefaultSkeleton->GetDefaultAbsJointByID(int32(i)); - - m_nodes.back().parent = pIDefaultSkeleton->GetJointParentIDByID(int32(i)); - } - - ValidateReferences(); -} - -void CHierarchy::ValidateReferences() -{ - uint32 nodeCount = m_nodes.size(); - if (!nodeCount) - { - return; - } - - for (uint32 i = 0; i < nodeCount; ++i) - { - if (m_nodes[i].parent < nodeCount) - { - continue; - } - - m_nodes[i].parent = -1; - } -} - -void CHierarchy::AbsoluteToRelative(const QuatT* pSource, QuatT* pDestination) -{ - uint32 count = uint32(m_nodes.size()); - std::vector absolutes(count); - for (uint32 i = 0; i < count; ++i) - { - absolutes[i] = pSource[i]; - } - - for (uint32 i = 0; i < count; ++i) - { - int32 parent = m_nodes[i].parent; - if (parent < 0) - { - pDestination[i] = absolutes[i]; - continue; - } - - pDestination[i].t = (absolutes[i].t - absolutes[parent].t) * absolutes[parent].q; - pDestination[i].q = absolutes[parent].q.GetInverted() * absolutes[i].q; - } -} - -bool CHierarchy::SerializeTo(XmlNodeRef& node) -{ - XmlNodeRef hierarchy = node->newChild("Hierarchy"); - - uint32 nodeCount = uint32(m_nodes.size()); - std::vector nodes(nodeCount); - for (uint32 i = 0; i < nodeCount; ++i) - { - XmlNodeRef parent = hierarchy; - if (m_nodes[i].parent > -1) - { - parent = nodes[m_nodes[i].parent]; - } - - nodes[i] = parent->newChild("Node"); - nodes[i]->setAttr("name", m_nodes[i].name); - } - - return true; -} diff --git a/Code/Editor/Animation/SkeletonHierarchy.h b/Code/Editor/Animation/SkeletonHierarchy.h deleted file mode 100644 index ad0d8fc7fc..0000000000 --- a/Code/Editor/Animation/SkeletonHierarchy.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#ifndef CRYINCLUDE_EDITOR_ANIMATION_SKELETONHIERARCHY_H -#define CRYINCLUDE_EDITOR_ANIMATION_SKELETONHIERARCHY_H -#pragma once - -namespace Skeleton { - class CHierarchy - : public _reference_target_t - { - public: - struct SNode - { - string name; - QuatT pose; - - int32 parent; - - /* TODO: Implement - uint32 childrenIndex; - uint32 childrenCount; - */ - }; - - public: - CHierarchy(); - ~CHierarchy(); - - public: - uint32 AddNode(const char* name, const QuatT& pose, int32 parent = -1); - uint32 GetNodeCount() const { return uint32(m_nodes.size()); } - SNode* GetNode(uint32 index) { return &m_nodes[index]; } - const SNode* GetNode(uint32 index) const { return &m_nodes[index]; } - int32 FindNodeIndexByName(const char* name) const; - const SNode* FindNode(const char* name) const; - void ClearNodes() { m_nodes.clear(); } - - void CreateFrom(IDefaultSkeleton* rIDefaultSkeleton); - void ValidateReferences(); - - void AbsoluteToRelative(const QuatT* pSource, QuatT* pDestination); - - bool SerializeTo(XmlNodeRef& node); - - private: - std::vector m_nodes; - }; -} // namespace Skeleton - -#endif // CRYINCLUDE_EDITOR_ANIMATION_SKELETONHIERARCHY_H diff --git a/Code/Editor/Animation/SkeletonMapper.cpp b/Code/Editor/Animation/SkeletonMapper.cpp deleted file mode 100644 index 24f01f56ad..0000000000 --- a/Code/Editor/Animation/SkeletonMapper.cpp +++ /dev/null @@ -1,368 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#include "EditorDefs.h" - -#include "SkeletonMapper.h" - -using namespace Skeleton; - -/* - - CMapper - -*/ - -CMapper::CMapper() -{ -} - -CMapper::~CMapper() -{ -} - -// - -void CMapper::CreateFromHierarchy() -{ - m_nodes.clear(); - - uint32 nodeCount = m_hierarchy.GetNodeCount(); - m_nodes.resize(nodeCount); -} - -// - -uint32 CMapper::CreateLocation(const char* name) -{ - int32 index = FindLocation(name); - if (index < 1) - { - CMapperLocation* pLocation = new CMapperLocation(); - pLocation->SetName(name); - m_locations.push_back(pLocation); - } - return uint32(m_locations.size() - 1); -} - -void CMapper::ClearLocations() -{ - uint32 count = uint32(m_nodes.size()); - for (uint32 i = 0; i < count; ++i) - { - m_nodes[i].position = nullptr; - m_nodes[i].orientation = nullptr; - } - - m_locations.clear(); -} - -int32 CMapper::FindLocation(const char* name) const -{ - uint32 count = uint32(m_locations.size()); - for (uint32 i = 0; i < count; ++i) - { - if (::_stricmp(m_locations[i]->GetName(), name)) - { - continue; - } - - return int32(i); - } - - return -1; -} - -void CMapper::SetLocation(CMapperLocation& location) -{ - int32 index = FindLocation(location.GetName()); - if (index < 0) - { - m_locations.push_back(&location); - return; - } - - m_locations[index] = &location; -} - -// - -bool CMapper::CreateLocationsHierarchy(uint32 index, CHierarchy& hierarchy, int32 hierarchyParent) -{ - if (NodeHasLocation(index)) - { - const CHierarchy::SNode* pNode = m_hierarchy.GetNode(index); - uint32 nodeIndex = hierarchy.AddNode(pNode->name, pNode->pose, hierarchyParent); - hierarchyParent = uint32(nodeIndex); - } - - std::vector children; - GetChildrenIndices(index, children); - uint32 childCount = uint32(children.size()); - for (uint32 i = 0; i < childCount; ++i) - { - CreateLocationsHierarchy(children[i], hierarchy, hierarchyParent); - } - - return hierarchy.GetNodeCount() != 0; -} - -bool CMapper::CreateLocationsHierarchy(CHierarchy& hierarchy) -{ - hierarchy.ClearNodes(); - if (!CreateLocationsHierarchy(0, hierarchy, -1)) - { - return false; - } - - hierarchy.ValidateReferences(); - return true; -} - -void CMapper::Map(QuatT* pResult) -{ - uint32 outputCount = m_hierarchy.GetNodeCount(); - std::vector absolutes(outputCount); - for (uint32 i = 0; i < outputCount; ++i) - { - pResult[i].SetIdentity(); - absolutes[i].SetIdentity(); - - CHierarchy::SNode* pNode = m_hierarchy.GetNode(i); - if (!pNode) - { - continue; - } - - CHierarchy::SNode* pParent = pNode->parent < 0 ? - nullptr : m_hierarchy.GetNode(pNode->parent); - if (pParent) - { - pResult[i].t = - (pNode->pose.t - pParent->pose.t) * pParent->pose.q; - } - - if (m_nodes[i].position) - { - pResult[i].t = m_nodes[i].position->Compute().t; - } - - if (m_nodes[i].orientation) - { - absolutes[i] = m_nodes[i].orientation->Compute().q; - } - else if (pParent) - { - Quat relative = pParent->pose.q.GetInverted() * pNode->pose.q; - absolutes[i] = absolutes[pNode->parent] * relative; - } - } - - for (uint32 i = 0; i < outputCount; ++i) - { - CHierarchy::SNode* pNode = m_hierarchy.GetNode(i); - if (!pNode) - { - continue; - } - - CHierarchy::SNode* pParent = pNode->parent < 0 ? - nullptr : m_hierarchy.GetNode(pNode->parent); - if (!pParent) - { - pResult[i].q = absolutes[i]; - continue; - } - - pResult[i].q = absolutes[i]; - if (!m_nodes[i].position) - { - pResult[i].t = pResult[pNode->parent].t + - pResult[i].t * absolutes[pNode->parent].GetInverted(); - } - } -} - -// - -bool CMapper::NodeHasLocation(uint32 index) -{ - if (CMapperOperator* pOperator = m_nodes[index].position) - { - if (pOperator->IsOfClass("Location")) - { - return true; - } - if (pOperator->HasLinksOfClass("Location")) - { - return true; - } - } - - if (CMapperOperator* pOperator = m_nodes[index].orientation) - { - if (pOperator->IsOfClass("Location")) - { - return true; - } - if (pOperator->HasLinksOfClass("Location")) - { - return true; - } - } - - return false; -} - -void CMapper::GetChildrenIndices(uint32 parent, std::vector& children) -{ - uint32 nodeCount = m_hierarchy.GetNodeCount(); - for (uint32 i = 0; i < nodeCount; ++i) - { - if (m_hierarchy.GetNode(i)->parent != parent) - { - continue; - } - - children.push_back(i); - } -} - -bool CMapper::ChildrenHaveLocation(uint32 index) -{ - std::vector children; - GetChildrenIndices(index, children); - - uint32 childrenCount = uint32(children.size()); - for (uint32 i = 0; i < childrenCount; ++i) - { - if (ChildrenHaveLocation(children[i])) - { - return true; - } - } - - return false; -} - -bool CMapper::NodeOrChildrenHaveLocation(uint32 index) -{ - if (NodeHasLocation(index)) - { - return true; - } - - std::vector children; - GetChildrenIndices(index, children); - - uint32 childrenCount = uint32(children.size()); - for (uint32 i = 0; i < childrenCount; ++i) - { - if (NodeOrChildrenHaveLocation(children[i])) - { - return true; - } - } - - return false; -} - -bool CMapper::SerializeTo(XmlNodeRef& node) -{ - XmlNodeRef hierarchy = node->newChild("Hierarchy"); - - uint32 nodeCount = GetNodeCount(); - std::vector nodes(nodeCount); - for (uint32 i = 0; i < nodeCount; ++i) - { - if (!NodeOrChildrenHaveLocation(i)) - { - continue; - } - - CHierarchy::SNode* pNode = m_hierarchy.GetNode(i); - if (!pNode) - { - return false; - } - - XmlNodeRef xmlParent = hierarchy; - int32 parent = pNode->parent; - if (parent > -1) - { - xmlParent = nodes[parent]; - } - - nodes[i] = xmlParent->newChild("Node"); - nodes[i]->setAttr("name", pNode->name); - - if (CMapperOperator* pOperator = m_nodes[i].position) - { - XmlNodeRef position = nodes[i]->newChild("Position"); - XmlNodeRef child = position->newChild("Operator"); - if (!pOperator->SerializeWithLinksTo(child)) - { - return false; - } - } - - if (CMapperOperator* pOperator = m_nodes[i].orientation) - { - XmlNodeRef orientation = nodes[i]->newChild("Orientation"); - XmlNodeRef child = orientation->newChild("Operator"); - if (!pOperator->SerializeWithLinksTo(child)) - { - return false; - } - } - } - - return true; -} - -bool CMapper::SerializeFrom(XmlNodeRef& node, int32 parent) -{ - int childCount = uint32(node->getChildCount()); - for (int i = 0; i < childCount; ++i) - { - XmlNodeRef child = node->getChild(i); - if (::_stricmp(child->getTag(), "Node")) - { - continue; - } - - uint32 index = m_hierarchy.AddNode(child->getAttr("name"), QuatT(IDENTITY), parent); - if (!SerializeFrom(child, int32(index))) - { - return false; - } - } - - return true; -} - -bool CMapper::SerializeFrom(XmlNodeRef& node) -{ - XmlNodeRef hierarchy = node->findChild("Hierarchy"); - if (!hierarchy) - { - return false; - } - - m_hierarchy.ClearNodes(); - - if (!SerializeFrom(hierarchy, -1)) - { - return false; - } - - m_nodes.resize(m_hierarchy.GetNodeCount()); - - return true; -} diff --git a/Code/Editor/Animation/SkeletonMapper.h b/Code/Editor/Animation/SkeletonMapper.h deleted file mode 100644 index 159b019396..0000000000 --- a/Code/Editor/Animation/SkeletonMapper.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#ifndef CRYINCLUDE_EDITOR_ANIMATION_SKELETONMAPPER_H -#define CRYINCLUDE_EDITOR_ANIMATION_SKELETONMAPPER_H -#pragma once - - -#include "SkeletonHierarchy.h" -#include "SkeletonMapperOperator.h" - -namespace Skeleton { - class CMapper - { - public: - struct SNode - { - _smart_ptr position; - _smart_ptr orientation; - }; - - public: - CMapper(); - ~CMapper(); - - public: - CHierarchy& GetHierarchy() { return m_hierarchy; } - void CreateFromHierarchy(); - - uint32 GetNodeCount() const { return uint32(m_nodes.size()); } - SNode* GetNode(uint32 index) { return &m_nodes[index]; } - const SNode* GetNode(uint32 index) const { return &m_nodes[index]; } - - uint32 CreateLocation(const char* name); - void ClearLocations(); - int32 FindLocation(const char* name) const; - - uint32 GetLocationCount() const { return uint32(m_locations.size()); } - void SetLocation(CMapperLocation& location); - CMapperLocation* GetLocation(uint32 index) { return m_locations[index]; } - const CMapperLocation* GetLocation(uint32 index) const { return m_locations[index]; } - - bool CreateLocationsHierarchy(CHierarchy& hierarchy); - - void Map(QuatT* pResult); - - bool SerializeTo(XmlNodeRef& node); - bool SerializeFrom(XmlNodeRef& node); - - private: - bool NodeHasLocation(uint32 index); - bool ChildrenHaveLocation(uint32 index); - bool NodeOrChildrenHaveLocation(uint32 index); - - bool SerializeFrom(XmlNodeRef& node, int32 parent); - - bool CreateLocationsHierarchy(uint32 index, CHierarchy& hierarchy, int32 hierarchyParent = -1); - - // TEMP - void GetChildrenIndices(uint32 parent, std::vector& children); - - private: - CHierarchy m_hierarchy; - std::vector<_smart_ptr > m_locations; - - std::vector m_nodes; - }; -} // namespace Skeleton - -#endif // CRYINCLUDE_EDITOR_ANIMATION_SKELETONMAPPER_H diff --git a/Code/Editor/Animation/SkeletonMapperOperator.cpp b/Code/Editor/Animation/SkeletonMapperOperator.cpp deleted file mode 100644 index cc53957115..0000000000 --- a/Code/Editor/Animation/SkeletonMapperOperator.cpp +++ /dev/null @@ -1,284 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#include "EditorDefs.h" - -#include "SkeletonMapperOperator.h" - -using namespace Skeleton; - -/* - - CMapperOperatorDesc - -*/ - -std::vector CMapperOperatorDesc::s_descs; - -// - -CMapperOperatorDesc::CMapperOperatorDesc(const char* name) -{ - s_descs.push_back(this); -} - -/* - - CMapperOperator - -*/ - -CMapperOperator::CMapperOperator(const char* className, uint32 positionCount, uint32 orientationCount) -{ - m_className = className; - m_position.resize(positionCount, nullptr); - m_orientation.resize(orientationCount, nullptr); -} - -CMapperOperator::~CMapperOperator() -{ -} - -// - -bool CMapperOperator::IsOfClass(const char* className) -{ - if (::_stricmp(m_className, className)) - { - return false; - } - - return true; -} - -uint32 CMapperOperator::HasLinksOfClass(const char* className) -{ - uint32 count = 0; - - uint32 positionCount = m_position.size(); - for (uint32 i = 0; i < positionCount; ++i) - { - CMapperOperator* pOperator = m_position[i]; - if (!pOperator) - { - continue; - } - - if (pOperator->IsOfClass(className)) - { - ++count; - } - } - - uint32 orientationCount = m_orientation.size(); - for (uint32 i = 0; i < orientationCount; ++i) - { - CMapperOperator* pOperator = m_orientation[i]; - if (!pOperator) - { - continue; - } - - if (pOperator->IsOfClass(className)) - { - ++count; - } - } - - return count; -} - -// - -bool CMapperOperator::SerializeTo(XmlNodeRef& node) -{ - node->setAttr("class", m_className); - - uint32 parameterCount = uint32(m_parameters.size()); - for (uint32 i = 0; i < parameterCount; ++i) - { - m_parameters[i]->Serialize(node, false); - } - - return true; -} - -bool CMapperOperator::SerializeFrom(XmlNodeRef& node) -{ - uint32 parameterCount = uint32(m_parameters.size()); - for (uint32 i = 0; i < parameterCount; ++i) - { - m_parameters[i]->Serialize(node, true); - } - - return true; -} - -bool CMapperOperator::SerializeWithLinksTo(XmlNodeRef& node) -{ - if (!SerializeTo(node)) - { - return false; - } - - uint32 positionCount = uint32(m_position.size()); - for (uint32 i = 0; i < positionCount; ++i) - { - CMapperOperator* pOperator = m_position[i]; - if (!pOperator) - { - continue; - } - - XmlNodeRef position = node->newChild("Position"); - position->setAttr("index", i); - - XmlNodeRef child = position->newChild("Operator"); - if (!pOperator->SerializeWithLinksTo(child)) - { - return false; - } - } - - uint32 orientationCount = uint32(m_orientation.size()); - for (uint32 i = 0; i < orientationCount; ++i) - { - CMapperOperator* pOperator = m_orientation[i]; - if (!pOperator) - { - continue; - } - - XmlNodeRef orientation = node->newChild("Orientation"); - orientation->setAttr("index", i); - - XmlNodeRef child = orientation->newChild("Operator"); - if (!pOperator->SerializeWithLinksTo(child)) - { - return false; - } - } - - return true; -} - -bool CMapperOperator::SerializeWithLinksFrom(XmlNodeRef& node) -{ - if (!SerializeFrom(node)) - { - return false; - } - - return true; -} -/* - - CMapperOperator_Transform - -*/ - -class CMapperOperator_Transform - : public CMapperOperator -{ -public: - CMapperOperator_Transform() - : CMapperOperator("Transform", 1, 1) - { - m_pAngles = new CVariable(); - m_pAngles->SetName("rotation"); - m_pAngles->Set(Vec3(0.0f, 0.0f, 0.0f)); - m_pAngles->SetLimits(-180.0f, 180.0f); - AddParameter(*m_pAngles); - - m_pVector = new CVariable(); - m_pVector->SetName("vector"); - m_pVector->Set(Vec3(0.0f, 0.0f, 0.0f)); - AddParameter(*m_pVector); - - m_pScale = new CVariable(); - m_pScale->SetName("scale"); - m_pScale->Set(Vec3(1.0f, 1.0f, 1.0f)); - AddParameter(*m_pScale); - } - - // CMapperOperator -public: - virtual QuatT CMapperOperator_Transform::Compute() - { - QuatT result(IDENTITY); - m_pVector->Get(result.t); - - Vec3 scale; - m_pScale->Get(scale); - - Vec3 angles; - m_pAngles->Get(angles); - - result.q = Quat::CreateRotationXYZ( - Ang3(DEG2RAD(angles.x), DEG2RAD(angles.y), DEG2RAD(angles.z))); - - if (CMapperOperator* pOperator = GetPosition(0)) - { - result.t = pOperator->Compute().t.CompMul(scale) + result.t; - } - if (CMapperOperator* pOperator = GetOrientation(0)) - { - result.q = pOperator->Compute().q * result.q; - } - return result; - } - -private: - CVariable* m_pVector; - CVariable* m_pAngles; - CVariable* m_pScale; -}; - -SkeletonMapperOperatorRegister(Transform, CMapperOperator_Transform) - -class CMapperOperator_PositionsToOrientation - : public CMapperOperator -{ -public: - CMapperOperator_PositionsToOrientation() - : CMapperOperator("PositionsToOrientation", 3, 0) - { - } - - // CMapperOperator -public: - virtual QuatT Compute() - { - CMapperOperator* pOperator0 = GetPosition(0); - CMapperOperator* pOperator1 = GetPosition(1); - CMapperOperator* pOperator2 = GetPosition(2); - if (!pOperator0 || !pOperator1 || !pOperator2) - { - return QuatT(IDENTITY); - } - - Vec3 p0 = pOperator0->Compute().t; - Vec3 p1 = pOperator1->Compute().t; - Vec3 p2 = pOperator2->Compute().t; - - Vec3 m = (p1 + p2) * 0.5f; - Vec3 y = (m - p0).GetNormalized(); - Vec3 z = (p1 - p2).GetNormalized(); - Vec3 x = y % z; - z = x % y; - - Matrix33 m33; - m33.SetFromVectors(x, y, z); - QuatT result(IDENTITY); - result.q = Quat(m33); - return result; - } -}; - -SkeletonMapperOperatorRegister(PositionsToOrientation, CMapperOperator_PositionsToOrientation) diff --git a/Code/Editor/Animation/SkeletonMapperOperator.h b/Code/Editor/Animation/SkeletonMapperOperator.h deleted file mode 100644 index 68bbb84ac7..0000000000 --- a/Code/Editor/Animation/SkeletonMapperOperator.h +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#ifndef CRYINCLUDE_EDITOR_ANIMATION_SKELETONMAPPEROPERATOR_H -#define CRYINCLUDE_EDITOR_ANIMATION_SKELETONMAPPEROPERATOR_H -#pragma once - - -#include "../Util/Variable.h" - -#undef GetClassName - -#define SkeletonMapperOperatorRegister(name, className) \ - class CMapperOperatorDesc_##name \ - : public CMapperOperatorDesc \ - { \ - public: \ - CMapperOperatorDesc_##name() \ - : CMapperOperatorDesc(#name) { } \ - protected: \ - virtual const char* GetName() { return #name; } \ - virtual CMapperOperator* Create() { return new className(); } \ - } mapperOperatorDesc__##name; - -namespace Skeleton { - class CMapperOperator; - - class CMapperOperatorDesc - { - public: - static uint32 GetCount() { return uint32(s_descs.size()); } - static const char* GetName(uint32 index) { return s_descs[index]->GetName(); } - static CMapperOperator* Create(uint32 index) { return s_descs[index]->Create(); } - - private: - static std::vector s_descs; - - public: - CMapperOperatorDesc(const char* name); - - protected: - virtual const char* GetName() = 0; - virtual CMapperOperator* Create() = 0; - }; - - class CMapperOperator - : public _reference_target_t - { - protected: - CMapperOperator(const char* className, uint32 positionCount, uint32 orientationCount); - ~CMapperOperator(); - - public: - const char* GetClassName() { return m_className; } - - uint32 GetPositionCount() const { return uint32(m_position.size()); } - void SetPosition(uint32 index, CMapperOperator* pOperator) { m_position[index] = pOperator; } - CMapperOperator* GetPosition(uint32 index) { return m_position[index]; } - - uint32 GetOrientationCount() const { return uint32(m_orientation.size()); } - void SetOrientation(uint32 index, CMapperOperator* pOperator) { m_orientation[index] = pOperator; } - CMapperOperator* GetOrientation(uint32 index) { return m_orientation[index]; } - - uint32 GetParameterCount() { return uint32(m_parameters.size()); } - IVariable* GetParameter(uint32 index) { return m_parameters[index]; } - - bool IsOfClass(const char* className); - uint32 HasLinksOfClass(const char* className); - - bool SerializeTo(XmlNodeRef& node); - bool SerializeFrom(XmlNodeRef& node); - - bool SerializeWithLinksTo(XmlNodeRef& node); - bool SerializeWithLinksFrom(XmlNodeRef& node); - - protected: - void AddParameter(IVariable& variable) { m_parameters.push_back(&variable); } - - public: - virtual QuatT Compute() = 0; - - private: - const char* m_className; - std::vector<_smart_ptr > m_position; - std::vector<_smart_ptr > m_orientation; - - std::vector m_parameters; - }; - - class CMapperLocation - : public CMapperOperator - { - public: - CMapperLocation() - : CMapperOperator("Location", 0, 0) - { - m_pName = new CVariable(); - m_pName->SetName("name"); - m_pName->SetFlags(m_pName->GetFlags() | IVariable::UI_INVISIBLE); - AddParameter(*m_pName); - - m_pAxis = new CVariable(); - m_pAxis->SetName("axis"); - m_pAxis->SetLimits(-3.0f, +3.0f); - m_pAxis->Set(Vec3(1.0f, 2.0f, 3.0f)); - AddParameter(*m_pAxis); - - m_location = QuatT(IDENTITY); - } - - public: - void SetName(const char* name) { m_pName->Set(name); } - CString GetName() const { CString s; m_pName->Get(s); return s; } - - void SetLocation(const QuatT& location) { m_location = location; } - const QuatT& GetLocation() const { return m_location; } - - // CMapperOperator - public: - virtual QuatT Compute() - { - Vec3 axis; - m_pAxis->Get(axis); - - uint32 x = fabs_tpl(axis.x); - uint32 y = fabs_tpl(axis.y); - uint32 z = fabs_tpl(axis.z); - if (x < 1 || y < 1 || z < 1 || - x > 3 || y > 3 || y > 3 || - x == y || x == z || y == z) - { - return QuatT(IDENTITY); - } - - Matrix33 matrix; - matrix.SetFromVectors( - m_location.q.GetColumn(x - 1) * f32(::sgn(axis.x)), - m_location.q.GetColumn(y - 1) * f32(::sgn(axis.y)), - m_location.q.GetColumn(z - 1) * f32(::sgn(axis.z))); - if (!matrix.IsOrthonormalRH(0.01f)) - { - return QuatT(IDENTITY); - } - - QuatT result = m_location; - result.q = Quat(matrix); - return result; - } - - private: - CVariable* m_pName; - CVariable* m_pAxis; - - QuatT m_location; - }; -} // namespace Skeleton - -#endif // CRYINCLUDE_EDITOR_ANIMATION_SKELETONMAPPEROPERATOR_H diff --git a/Code/Editor/AnimationContext.cpp b/Code/Editor/AnimationContext.cpp index debe5e3b01..fce1150878 100644 --- a/Code/Editor/AnimationContext.cpp +++ b/Code/Editor/AnimationContext.cpp @@ -16,7 +16,6 @@ // Editor #include "TrackView/TrackViewDialog.h" -#include "RenderViewport.h" #include "ViewManager.h" #include "Objects/SelectionGroup.h" #include "Include/IObjectManager.h" @@ -29,7 +28,7 @@ class CMovieCallback : public IMovieCallback { protected: - virtual void OnMovieCallback(ECallbackReason reason, [[maybe_unused]] IAnimNode* pNode) + void OnMovieCallback(ECallbackReason reason, [[maybe_unused]] IAnimNode* pNode) override { switch (reason) { @@ -49,7 +48,7 @@ protected: } } - void OnSetCamera(const SCameraParams& Params) + void OnSetCamera(const SCameraParams& Params) override { // Only switch camera when in Play mode. GUID camObjId = GUID_NULL; @@ -61,15 +60,6 @@ protected: { camObjId = pEditorEntity->GetId(); } - - CViewport* pViewport = GetIEditor()->GetViewManager()->GetSelectedViewport(); - if (CRenderViewport* rvp = viewport_cast(pViewport)) - { - if (!rvp->IsSequenceCamera()) - { - return; - } - } } // Switch camera in active rendering view. @@ -79,14 +69,14 @@ protected: } }; - bool IsSequenceCamUsed() const + bool IsSequenceCamUsed() const override { if (gEnv->IsEditorGameMode() == true) { return true; } - if (GetIEditor()->GetViewManager() == NULL) + if (GetIEditor()->GetViewManager() == nullptr) { return false; } @@ -113,7 +103,7 @@ public: CAnimationContextPostRender(CAnimationContext* pAC) : m_pAC(pAC){} - void OnPostRender() const { assert(m_pAC); m_pAC->OnPostRender(); } + void OnPostRender() const override { assert(m_pAC); m_pAC->OnPostRender(); } protected: CAnimationContext* m_pAC; @@ -231,7 +221,7 @@ void CAnimationContext::SetSequence(CTrackViewSequence* sequence, bool force, bo m_pSequence->UnBindFromEditorObjects(); } m_pSequence = sequence; - + // Notify a new sequence was just selected. Maestro::EditorSequenceNotificationBus::Broadcast(&Maestro::EditorSequenceNotificationBus::Events::OnSequenceSelected, m_pSequence ? m_pSequence->GetSequenceComponentEntityId() : AZ::EntityId()); @@ -347,7 +337,7 @@ void CAnimationContext::OnSequenceActivated(AZ::EntityId entityId) { // Hang onto this because SetSequence() will reset it. float lastTime = m_mostRecentSequenceTime; - + SetSequence(sequence, false, false); // Restore the current time. @@ -638,7 +628,7 @@ void CAnimationContext::GoToFrameCmd(IConsoleCmdArgs* pArgs) float targetFrame = (float)atof(pArgs->GetArg(1)); if (pSeq->GetTimeRange().start > targetFrame || targetFrame > pSeq->GetTimeRange().end) { - gEnv->pLog->LogError("GoToFrame: requested time %f is outside the range of sequence %s (%f, %f)", targetFrame, pSeq->GetName(), pSeq->GetTimeRange().start, pSeq->GetTimeRange().end); + gEnv->pLog->LogError("GoToFrame: requested time %f is outside the range of sequence %s (%f, %f)", targetFrame, pSeq->GetName().c_str(), pSeq->GetTimeRange().start, pSeq->GetTimeRange().end); return; } GetIEditor()->GetAnimation()->m_currTime = targetFrame; diff --git a/Code/Editor/AzAssetBrowser/AzAssetBrowserRequestHandler.cpp b/Code/Editor/AzAssetBrowser/AzAssetBrowserRequestHandler.cpp index cb97632e07..1c2be16a3d 100644 --- a/Code/Editor/AzAssetBrowser/AzAssetBrowserRequestHandler.cpp +++ b/Code/Editor/AzAssetBrowser/AzAssetBrowserRequestHandler.cpp @@ -327,7 +327,7 @@ void AzAssetBrowserRequestHandler::AddContextMenuActions(QWidget* caller, QMenu* if (!vetoOpenerFound) { // if we found no valid openers and no veto openers then just allow it to be opened with the operating system itself. - menu->addAction(QObject::tr("Open with associated application..."), [this, fullFilePath]() + menu->addAction(QObject::tr("Open with associated application..."), [fullFilePath]() { OpenWithOS(fullFilePath); }); @@ -675,14 +675,14 @@ void AzAssetBrowserRequestHandler::OpenAssetInAssociatedEditor(const AZ::Data::A firstValidOpener = &openerDetails; } // bind a callback such that when the menu item is clicked, it sets that as the opener to use. - menu.addAction(openerDetails.m_iconToUse, QObject::tr(openerDetails.m_displayText.c_str()), mainWindow, AZStd::bind(switchToOpener, &openerDetails)); + menu.addAction(openerDetails.m_iconToUse, QObject::tr(openerDetails.m_displayText.c_str()), mainWindow, [switchToOpener, details = &openerDetails] { return switchToOpener(details); }); } } if (numValidOpeners > 1) // more than one option was added { menu.addSeparator(); - menu.addAction(QObject::tr("Cancel"), AZStd::bind(switchToOpener, nullptr)); // just something to click on to avoid doing anything. + menu.addAction(QObject::tr("Cancel"), [switchToOpener] { return switchToOpener(nullptr); }); // just something to click on to avoid doing anything. menu.exec(QCursor::pos()); } else if (numValidOpeners == 1) diff --git a/Code/Editor/AzAssetBrowser/AzAssetBrowserWindow.cpp b/Code/Editor/AzAssetBrowser/AzAssetBrowserWindow.cpp index c93ad087ce..c54fe60c4d 100644 --- a/Code/Editor/AzAssetBrowser/AzAssetBrowserWindow.cpp +++ b/Code/Editor/AzAssetBrowser/AzAssetBrowserWindow.cpp @@ -82,6 +82,7 @@ AzAssetBrowserWindow::AzAssetBrowserWindow(QWidget* parent) m_ui->m_assetBrowserTableViewWidget->setVisible(false); m_ui->m_toggleDisplayViewBtn->setVisible(false); + m_ui->m_searchWidget->SetFilterInputInterval(AZStd::chrono::milliseconds(250)); if (ed_useNewAssetBrowserTableView) { m_ui->m_toggleDisplayViewBtn->setVisible(true); diff --git a/Code/Editor/BaseLibrary.cpp b/Code/Editor/BaseLibrary.cpp index ee1c85756d..9f26630c2c 100644 --- a/Code/Editor/BaseLibrary.cpp +++ b/Code/Editor/BaseLibrary.cpp @@ -24,10 +24,10 @@ class CUndoBaseLibrary : public IUndoObject { public: - CUndoBaseLibrary(CBaseLibrary* pLib, const QString& description, const QString& selectedItem = 0) + CUndoBaseLibrary(CBaseLibrary* pLib, const QString& description, const QString& selectedItem = QString()) : m_pLib(pLib) , m_description(description) - , m_redo(0) + , m_redo(nullptr) , m_selectedItem(selectedItem) { assert(m_pLib); @@ -36,16 +36,16 @@ public: m_pLib->Serialize(m_undo, false); } - virtual QString GetEditorObjectName() + QString GetEditorObjectName() override { return m_selectedItem; } protected: - virtual int GetSize() { return sizeof(CUndoBaseLibrary); } - virtual QString GetDescription() { return m_description; }; + int GetSize() override { return sizeof(CUndoBaseLibrary); } + QString GetDescription() override { return m_description; }; - virtual void Undo(bool bUndo) + void Undo(bool bUndo) override { if (bUndo) { @@ -57,7 +57,7 @@ protected: GetIEditor()->Notify(eNotify_OnDataBaseUpdate); } - virtual void Redo() + void Redo() override { m_pLib->Serialize(m_redo, true); m_pLib->SetModified(); @@ -107,7 +107,7 @@ void CBaseLibrary::RemoveAllItems() // Unregister item in case it was registered. It is ok if it wasn't. This is still safe to call. m_pManager->UnregisterItem(m_items[i]); // Clear library item. - m_items[i]->m_library = NULL; + m_items[i]->m_library = nullptr; } m_items.clear(); Release(); @@ -216,7 +216,7 @@ IDataBaseItem* CBaseLibrary::FindItem(const QString& name) return m_items[i]; } } - return NULL; + return nullptr; } bool CBaseLibrary::AddLibraryToSourceControl(const QString& fullPathName) const @@ -233,8 +233,8 @@ bool CBaseLibrary::AddLibraryToSourceControl(const QString& fullPathName) const bool CBaseLibrary::SaveLibrary(const char* name, bool saveEmptyLibrary) { - assert(name != NULL); - if (name == NULL) + assert(name != nullptr); + if (name == nullptr) { CryFatalError("The library you are attempting to save has no name specified."); return false; @@ -258,9 +258,8 @@ bool CBaseLibrary::SaveLibrary(const char* name, bool saveEmptyLibrary) } if (!bRes) { - string strMessage; QByteArray filenameUtf8 = fileName.toUtf8(); - strMessage.Format("The file %s is read-only and the save of the library couldn't be performed. Try to remove the \"read-only\" flag or check-out the file and then try again.", filenameUtf8.data()); + AZStd::string strMessage = AZStd::string::format("The file %s is read-only and the save of the library couldn't be performed. Try to remove the \"read-only\" flag or check-out the file and then try again.", filenameUtf8.data()); CryMessageBox(strMessage.c_str(), "Saving Error", MB_OK | MB_ICONWARNING); } return bRes; diff --git a/Code/Editor/BaseLibraryItem.cpp b/Code/Editor/BaseLibraryItem.cpp index fd310eaf9f..b1fba91fad 100644 --- a/Code/Editor/BaseLibraryItem.cpp +++ b/Code/Editor/BaseLibraryItem.cpp @@ -16,7 +16,7 @@ #include -//undo object for multi-changes inside library item. such as set all variables to default values. +//undo object for multi-changes inside library item. such as set all variables to default values. //For example: change particle emitter shape will lead to multiple variable changes class CUndoBaseLibraryItem : public IUndoObject @@ -43,7 +43,7 @@ public: //evaluate size XmlString xmlStr = m_undoCtx.node->getXML(); m_size = sizeof(CUndoBaseLibraryItem); - m_size += xmlStr.GetAllocatedMemory(); + m_size += static_cast(xmlStr.GetAllocatedMemory()); m_size += m_itemPath.length(); m_size += m_description.length(); } @@ -54,24 +54,24 @@ public: } protected: - virtual int GetSize() - { + int GetSize() override + { return m_size; } QString GetDescription() override - { - return m_description; + { + return m_description; } - virtual void Undo(bool bUndo) + void Undo(bool bUndo) override { //find the libItem IDataBaseItem *libItem = m_libMgr->FindItemByName(m_itemPath); if (libItem == nullptr) { //the undo stack is not reliable any more.. - assert(false); + assert(false); return; } @@ -87,7 +87,7 @@ protected: libItem->Serialize(m_redoCtx); XmlString xmlStr = m_redoCtx.node->getXML(); - m_size += xmlStr.GetAllocatedMemory(); + m_size += static_cast(xmlStr.GetAllocatedMemory()); } //load previous saved data @@ -95,7 +95,7 @@ protected: libItem->Serialize(m_undoCtx); } - virtual void Redo() + void Redo() override { //find the libItem IDataBaseItem *libItem = m_libMgr->FindItemByName(m_itemPath); @@ -124,7 +124,7 @@ private: ////////////////////////////////////////////////////////////////////////// CBaseLibraryItem::CBaseLibraryItem() { - m_library = 0; + m_library = nullptr; GenerateId(); m_bModified = false; } @@ -266,7 +266,7 @@ void CBaseLibraryItem::SetLibrary(CBaseLibrary* pLibrary) void CBaseLibraryItem::SetModified(bool bModified) { m_bModified = bModified; - if (m_bModified && m_library != NULL) + if (m_bModified && m_library != nullptr) { m_library->SetModified(bModified); } diff --git a/Code/Editor/BaseLibraryManager.cpp b/Code/Editor/BaseLibraryManager.cpp index 8e555cae8c..7346ffaf8c 100644 --- a/Code/Editor/BaseLibraryManager.cpp +++ b/Code/Editor/BaseLibraryManager.cpp @@ -26,7 +26,7 @@ class CUndoBaseLibraryManager : public IUndoObject { public: - CUndoBaseLibraryManager(CBaseLibraryManager* pMngr, const QString& description, const QString& modifiedManager = 0) + CUndoBaseLibraryManager(CBaseLibraryManager* pMngr, const QString& description, const QString& modifiedManager = nullptr) : m_pMngr(pMngr) , m_description(description) , m_editorObject(modifiedManager) @@ -35,16 +35,16 @@ public: SerializeTo(m_undos); } - virtual QString GetEditorObjectName() + QString GetEditorObjectName() override { return m_editorObject; } protected: - virtual int GetSize() { return sizeof(CUndoBaseLibraryManager); } - virtual QString GetDescription() { return m_description; }; + int GetSize() override { return sizeof(CUndoBaseLibraryManager); } + QString GetDescription() override { return m_description; }; - virtual void Undo(bool bUndo) + void Undo(bool bUndo) override { if (bUndo) { @@ -55,7 +55,7 @@ protected: GetIEditor()->Notify(eNotify_OnDataBaseUpdate); } - virtual void Redo() + void Redo() override { m_pMngr->ClearAll(); UnserializeFrom(m_redos); @@ -84,7 +84,7 @@ private: for (int i = 0; i < m_pMngr->GetLibraryCount(); i++) { IDataBaseLibrary* library = m_pMngr->GetLibrary(i); - + const char* tag = library->IsLevelLibrary() ? LEVEL_LIBRARY_TAG : LIBRARY_TAG; XmlNodeRef node = GetIEditor()->GetSystem()->CreateXmlNode(tag); QString file = library->GetFilename().isEmpty() ? library->GetFilename() : library->GetName(); @@ -203,7 +203,7 @@ int CBaseLibraryManager::FindLibraryIndex(const QString& library) ////////////////////////////////////////////////////////////////////////// IDataBaseItem* CBaseLibraryManager::FindItem(REFGUID guid) const { - CBaseLibraryItem* pMtl = stl::find_in_map(m_itemsGuidMap, guid, (CBaseLibraryItem*)0); + CBaseLibraryItem* pMtl = stl::find_in_map(m_itemsGuidMap, guid, nullptr); return pMtl; } @@ -226,7 +226,7 @@ void CBaseLibraryManager::SplitFullItemName(const QString& fullItemName, QString IDataBaseItem* CBaseLibraryManager::FindItemByName(const QString& fullItemName) { AZStd::lock_guard lock(m_itemsNameMapMutex); - return stl::find_in_map(m_itemsNameMap, fullItemName, 0); + return stl::find_in_map(m_itemsNameMap, fullItemName, nullptr); } ////////////////////////////////////////////////////////////////////////// @@ -398,7 +398,7 @@ void CBaseLibraryManager::DeleteLibrary(const QString& library, bool forceDelete UnregisterItem((CBaseLibraryItem*)pLibrary->GetItem(j)); } pLibrary->RemoveAllItems(); - + if (pLibrary->IsLevelLibrary()) { m_pLevelLibrary = nullptr; @@ -420,7 +420,7 @@ IDataBaseLibrary* CBaseLibraryManager::GetLibrary(int index) const ////////////////////////////////////////////////////////////////////////// IDataBaseLibrary* CBaseLibraryManager::GetLevelLibrary() const { - IDataBaseLibrary* pLevelLib = NULL; + IDataBaseLibrary* pLevelLib = nullptr; for (int i = 0; i < GetLibraryCount(); i++) { @@ -526,14 +526,14 @@ void CBaseLibraryManager::Serialize(XmlNodeRef& node, bool bLoading) QString CBaseLibraryManager::MakeUniqueItemName(const QString& srcName, const QString& libName) { // unlikely we'll ever encounter more than 16 - std::vector possibleDuplicates; + std::vector possibleDuplicates; possibleDuplicates.reserve(16); // search for strings in the database that might have a similar name (ignore case) IDataBaseItemEnumerator* pEnum = GetItemEnumerator(); - for (IDataBaseItem* pItem = pEnum->GetFirst(); pItem != NULL; pItem = pEnum->GetNext()) + for (IDataBaseItem* pItem = pEnum->GetFirst(); pItem != nullptr; pItem = pEnum->GetNext()) { - //Check if the item is in the target library first. + //Check if the item is in the target library first. IDataBaseLibrary* itemLibrary = pItem->GetLibrary(); QString itemLibraryName; if (itemLibrary) @@ -550,7 +550,7 @@ QString CBaseLibraryManager::MakeUniqueItemName(const QString& srcName, const QS const QString& name = pItem->GetName(); if (name.startsWith(srcName, Qt::CaseInsensitive)) { - possibleDuplicates.push_back(string(name.toUtf8().data())); + possibleDuplicates.push_back(AZStd::string(name.toUtf8().data())); } } pEnum->Release(); @@ -560,7 +560,7 @@ QString CBaseLibraryManager::MakeUniqueItemName(const QString& srcName, const QS return srcName; } - std::sort(possibleDuplicates.begin(), possibleDuplicates.end(), [](const string& strOne, const string& strTwo) + std::sort(possibleDuplicates.begin(), possibleDuplicates.end(), [](const AZStd::string& strOne, const AZStd::string& strTwo) { // I can assume size sorting since if the length is different, either one of the two strings doesn't // closely match the string we are trying to duplicate, or it's a bigger number (X1 vs X10) @@ -590,7 +590,7 @@ QString CBaseLibraryManager::MakeUniqueItemName(const QString& srcName, const QS void CBaseLibraryManager::Validate() { IDataBaseItemEnumerator* pEnum = GetItemEnumerator(); - for (IDataBaseItem* pItem = pEnum->GetFirst(); pItem != NULL; pItem = pEnum->GetNext()) + for (IDataBaseItem* pItem = pEnum->GetFirst(); pItem != nullptr; pItem = pEnum->GetNext()) { pItem->Validate(); } @@ -617,7 +617,7 @@ void CBaseLibraryManager::RegisterItem(CBaseLibraryItem* pItem, REFGUID newGuid) { return; } - CBaseLibraryItem* pOldItem = stl::find_in_map(m_itemsGuidMap, newGuid, (CBaseLibraryItem*)0); + CBaseLibraryItem* pOldItem = stl::find_in_map(m_itemsGuidMap, newGuid, nullptr); if (!pOldItem) { pItem->m_guid = newGuid; @@ -677,7 +677,7 @@ void CBaseLibraryManager::RegisterItem(CBaseLibraryItem* pItem) { return; } - CBaseLibraryItem* pOldItem = stl::find_in_map(m_itemsGuidMap, pItem->GetGUID(), (CBaseLibraryItem*)0); + CBaseLibraryItem* pOldItem = stl::find_in_map(m_itemsGuidMap, pItem->GetGUID(), nullptr); if (!pOldItem) { m_itemsGuidMap[pItem->GetGUID()] = pItem; @@ -789,7 +789,7 @@ QString CBaseLibraryManager::MakeFullItemName(IDataBaseLibrary* pLibrary, const void CBaseLibraryManager::GatherUsedResources(CUsedResources& resources) { IDataBaseItemEnumerator* pEnum = GetItemEnumerator(); - for (IDataBaseItem* pItem = pEnum->GetFirst(); pItem != NULL; pItem = pEnum->GetNext()) + for (IDataBaseItem* pItem = pEnum->GetFirst(); pItem != nullptr; pItem = pEnum->GetNext()) { pItem->GatherUsedResources(resources); } @@ -815,15 +815,15 @@ void CBaseLibraryManager::OnEditorNotifyEvent(EEditorNotifyEvent event) switch (event) { case eNotify_OnBeginNewScene: - SetSelectedItem(0); + SetSelectedItem(nullptr); ClearAll(); break; case eNotify_OnBeginSceneOpen: - SetSelectedItem(0); + SetSelectedItem(nullptr); ClearAll(); break; case eNotify_OnCloseScene: - SetSelectedItem(0); + SetSelectedItem(nullptr); ClearAll(); break; } @@ -913,7 +913,7 @@ void CBaseLibraryManager::ChangeLibraryOrder(IDataBaseLibrary* lib, unsigned int { return; } - + for (int i = 0; i < m_libs.size(); i++) { if (lib == m_libs[i]) diff --git a/Code/Editor/BaseLibraryManager.h b/Code/Editor/BaseLibraryManager.h index 05f370e632..6f0b905760 100644 --- a/Code/Editor/BaseLibraryManager.h +++ b/Code/Editor/BaseLibraryManager.h @@ -73,7 +73,7 @@ public: virtual IDataBaseLibrary* AddLibrary(const QString& library, bool bIsLevelLibrary = false, bool bIsLoading = true) override; virtual void DeleteLibrary(const QString& library, bool forceDeleteLevel = false) override; //! Get number of libraries. - virtual int GetLibraryCount() const override { return m_libs.size(); }; + virtual int GetLibraryCount() const override { return static_cast(m_libs.size()); }; //! Get number of modified libraries. virtual int GetModifiedLibraryCount() const override; diff --git a/Code/Editor/CMakeLists.txt b/Code/Editor/CMakeLists.txt index fca16a2093..9256fd041f 100644 --- a/Code/Editor/CMakeLists.txt +++ b/Code/Editor/CMakeLists.txt @@ -238,9 +238,14 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) 3rdParty::Qt::Core 3rdParty::Qt::Gui 3rdParty::Qt::Widgets + 3rdParty::Qt::Test Legacy::CryCommon AZ::AzToolsFramework + AZ::AzToolsFramework.Tests + AZ::AzFrameworkTestShared + AZ::AzToolsFrameworkTestCommon Legacy::EditorLib + Gem::AtomToolsFramework.Static RUNTIME_DEPENDENCIES Gem::LmbrCentral ) diff --git a/Code/Editor/CheckOutDialog.h b/Code/Editor/CheckOutDialog.h index 7e7054ccdf..9ad64c57cf 100644 --- a/Code/Editor/CheckOutDialog.h +++ b/Code/Editor/CheckOutDialog.h @@ -34,7 +34,7 @@ public: CANCEL = QDialog::Rejected }; - CCheckOutDialog(const QString& file, QWidget* pParent = NULL); // standard constructor + CCheckOutDialog(const QString& file, QWidget* pParent = nullptr); // standard constructor virtual ~CCheckOutDialog(); // Dialog Data diff --git a/Code/Editor/Commands/CommandManager.cpp b/Code/Editor/Commands/CommandManager.cpp index 0712e35e79..5f194971f5 100644 --- a/Code/Editor/Commands/CommandManager.cpp +++ b/Code/Editor/Commands/CommandManager.cpp @@ -79,9 +79,9 @@ CEditorCommandManager::~CEditorCommandManager() m_uiCommands.clear(); } -string CEditorCommandManager::GetFullCommandName(const string& module, const string& name) +AZStd::string CEditorCommandManager::GetFullCommandName(const AZStd::string& module, const AZStd::string& name) { - string fullName = module; + AZStd::string fullName = module; fullName += "."; fullName += name; return fullName; @@ -91,10 +91,10 @@ bool CEditorCommandManager::AddCommand(CCommand* pCommand, TPfnDeleter deleter) { assert(pCommand); - string module = pCommand->GetModule(); - string name = pCommand->GetName(); + AZStd::string module = pCommand->GetModule(); + AZStd::string name = pCommand->GetName(); - if (IsRegistered(module, name) && m_bWarnDuplicate) + if (IsRegistered(module.c_str(), name.c_str()) && m_bWarnDuplicate) { QString errMsg; @@ -118,7 +118,7 @@ bool CEditorCommandManager::AddCommand(CCommand* pCommand, TPfnDeleter deleter) bool CEditorCommandManager::UnregisterCommand(const char* module, const char* name) { - string fullName = GetFullCommandName(module, name); + AZStd::string fullName = GetFullCommandName(module, name); CommandTable::iterator itr = m_commands.find(fullName); if (itr != m_commands.end()) @@ -154,7 +154,7 @@ bool CEditorCommandManager::RegisterUICommand( return false; } - return AttachUIInfo(GetFullCommandName(module, name), uiInfo); + return AttachUIInfo(GetFullCommandName(module, name).c_str(), uiInfo); } bool CEditorCommandManager::AttachUIInfo(const char* fullCmdName, const CCommand0::SUIInfo& uiInfo) @@ -190,14 +190,14 @@ bool CEditorCommandManager::AttachUIInfo(const char* fullCmdName, const CCommand return true; } -bool CEditorCommandManager::GetUIInfo(const string& module, const string& name, CCommand0::SUIInfo& uiInfo) const +bool CEditorCommandManager::GetUIInfo(const AZStd::string& module, const AZStd::string& name, CCommand0::SUIInfo& uiInfo) const { - string fullName = GetFullCommandName(module, name); + AZStd::string fullName = GetFullCommandName(module, name); return GetUIInfo(fullName, uiInfo); } -bool CEditorCommandManager::GetUIInfo(const string& fullCmdName, CCommand0::SUIInfo& uiInfo) const +bool CEditorCommandManager::GetUIInfo(const AZStd::string& fullCmdName, CCommand0::SUIInfo& uiInfo) const { CommandTable::const_iterator iter = m_commands.find(fullCmdName); @@ -223,9 +223,9 @@ int CEditorCommandManager::GenNewCommandId() return uniqueId++; } -QString CEditorCommandManager::Execute(const string& module, const string& name, const CCommand::CArgs& args) +QString CEditorCommandManager::Execute(const AZStd::string& module, const AZStd::string& name, const CCommand::CArgs& args) { - string fullName = GetFullCommandName(module, name); + AZStd::string fullName = GetFullCommandName(module, name); CommandTable::iterator iter = m_commands.find(fullName); if (iter != m_commands.end()) @@ -245,18 +245,18 @@ QString CEditorCommandManager::Execute(const string& module, const string& name, return ""; } -QString CEditorCommandManager::Execute(const string& cmdLine) +QString CEditorCommandManager::Execute(const AZStd::string& cmdLine) { - string cmdTxt, argsTxt; + AZStd::string cmdTxt, argsTxt; size_t argStart = cmdLine.find_first_of(' '); cmdTxt = cmdLine.substr(0, argStart); argsTxt = ""; - if (argStart != string::npos) + if (argStart != AZStd::string::npos) { argsTxt = cmdLine.substr(argStart + 1); - argsTxt.Trim(); + AZ::StringFunc::TrimWhiteSpace(argsTxt, true, true); } CommandTable::iterator itr = m_commands.find(cmdTxt); @@ -301,7 +301,7 @@ void CEditorCommandManager::Execute(int commandId) } } -void CEditorCommandManager::GetCommandList(std::vector& cmds) const +void CEditorCommandManager::GetCommandList(std::vector& cmds) const { cmds.clear(); cmds.reserve(m_commands.size()); @@ -315,9 +315,9 @@ void CEditorCommandManager::GetCommandList(std::vector& cmds) const std::sort(cmds.begin(), cmds.end()); } -string CEditorCommandManager::AutoComplete(const string& substr) const +AZStd::string CEditorCommandManager::AutoComplete(const AZStd::string& substr) const { - std::vector cmds; + std::vector cmds; GetCommandList(cmds); // If substring is empty return first command. @@ -358,7 +358,7 @@ string CEditorCommandManager::AutoComplete(const string& substr) const bool CEditorCommandManager::IsRegistered(const char* module, const char* name) const { - string fullName = GetFullCommandName(module, name); + AZStd::string fullName = GetFullCommandName(module, name); CommandTable::const_iterator iter = m_commands.find(fullName); if (iter != m_commands.end()) @@ -373,7 +373,7 @@ bool CEditorCommandManager::IsRegistered(const char* module, const char* name) c bool CEditorCommandManager::IsRegistered(const char* cmdLine_) const { - string cmdTxt, argsTxt, cmdLine(cmdLine_); + AZStd::string cmdTxt, argsTxt, cmdLine(cmdLine_); size_t argStart = cmdLine.find_first_of(' '); cmdTxt = cmdLine.substr(0, argStart); CommandTable::const_iterator iter = m_commands.find(cmdTxt); @@ -402,9 +402,9 @@ bool CEditorCommandManager::IsRegistered(int commandId) const return false; } -void CEditorCommandManager::SetCommandAvailableInScripting(const string& module, const string& name) +void CEditorCommandManager::SetCommandAvailableInScripting(const AZStd::string& module, const AZStd::string& name) { - string fullName = GetFullCommandName(module, name); + AZStd::string fullName = GetFullCommandName(module, name); CommandTable::iterator iter = m_commands.find(fullName); if (iter != m_commands.end()) @@ -413,7 +413,7 @@ void CEditorCommandManager::SetCommandAvailableInScripting(const string& module, } } -bool CEditorCommandManager::IsCommandAvailableInScripting(const string& fullCmdName) const +bool CEditorCommandManager::IsCommandAvailableInScripting(const AZStd::string& fullCmdName) const { CommandTable::const_iterator iter = m_commands.find(fullCmdName); @@ -425,16 +425,16 @@ bool CEditorCommandManager::IsCommandAvailableInScripting(const string& fullCmdN return false; } -bool CEditorCommandManager::IsCommandAvailableInScripting(const string& module, const string& name) const +bool CEditorCommandManager::IsCommandAvailableInScripting(const AZStd::string& module, const AZStd::string& name) const { - string fullName = GetFullCommandName(module, name); + AZStd::string fullName = GetFullCommandName(module, name); return IsCommandAvailableInScripting(fullName); } -void CEditorCommandManager::LogCommand(const string& fullCmdName, const CCommand::CArgs& args) const +void CEditorCommandManager::LogCommand(const AZStd::string& fullCmdName, const CCommand::CArgs& args) const { - string cmdLine = fullCmdName; + AZStd::string cmdLine = fullCmdName; for (int i = 0; i < args.GetArgCount(); ++i) { @@ -509,7 +509,7 @@ void CEditorCommandManager::LogCommand(const string& fullCmdName, const CCommand if (pScriptTermDialog) { - string text = "> "; + AZStd::string text = "> "; text += cmdLine; text += "\r\n"; pScriptTermDialog->AppendText(text.c_str()); @@ -526,14 +526,14 @@ QString CEditorCommandManager::ExecuteAndLogReturn(CCommand* pCommand, const CCo return result; } -void CEditorCommandManager::GetArgsFromString(const string& argsTxt, CCommand::CArgs& argList) +void CEditorCommandManager::GetArgsFromString(const AZStd::string& argsTxt, CCommand::CArgs& argList) { const char quoteSymbol = '\''; - int curPos = 0; - int prevPos = 0; - string arg = argsTxt.Tokenize(" ", curPos); - - while (!arg.empty()) + size_t curPos = 0; + size_t prevPos = 0; + AZStd::vector tokens; + AZ::StringFunc::Tokenize(argsTxt, tokens, ' '); + for(AZStd::string& arg : tokens) { if (arg[0] == quoteSymbol) // A special consideration for a quoted string { @@ -542,11 +542,11 @@ void CEditorCommandManager::GetArgsFromString(const string& argsTxt, CCommand::C size_t openingQuotePos = argsTxt.find(quoteSymbol, prevPos); size_t closingQuotePos = argsTxt.find(quoteSymbol, curPos); - if (closingQuotePos != string::npos) + if (closingQuotePos != AZStd::string::npos) { arg = argsTxt.substr(openingQuotePos + 1, closingQuotePos - openingQuotePos - 1); size_t nextArgPos = argsTxt.find(' ', closingQuotePos + 1); - curPos = nextArgPos != string::npos ? nextArgPos + 1 : argsTxt.length(); + curPos = nextArgPos != AZStd::string::npos ? nextArgPos + 1 : argsTxt.length(); for (; curPos < argsTxt.length(); ++curPos) // Skip spaces. { @@ -565,6 +565,5 @@ void CEditorCommandManager::GetArgsFromString(const string& argsTxt, CCommand::C argList.Add(arg.c_str()); prevPos = curPos; - arg = argsTxt.Tokenize(" ", curPos); } } diff --git a/Code/Editor/Commands/CommandManager.h b/Code/Editor/Commands/CommandManager.h index 761c79f79c..599754c5d9 100644 --- a/Code/Editor/Commands/CommandManager.h +++ b/Code/Editor/Commands/CommandManager.h @@ -48,20 +48,20 @@ public: const AZStd::function& functor, const CCommand0::SUIInfo& uiInfo); bool AttachUIInfo(const char* fullCmdName, const CCommand0::SUIInfo& uiInfo); - bool GetUIInfo(const string& module, const string& name, CCommand0::SUIInfo& uiInfo) const; - bool GetUIInfo(const string& fullCmdName, CCommand0::SUIInfo& uiInfo) const; - QString Execute(const string& cmdLine); - QString Execute(const string& module, const string& name, const CCommand::CArgs& args); + bool GetUIInfo(const AZStd::string& module, const AZStd::string& name, CCommand0::SUIInfo& uiInfo) const; + bool GetUIInfo(const AZStd::string& fullCmdName, CCommand0::SUIInfo& uiInfo) const; + QString Execute(const AZStd::string& cmdLine); + QString Execute(const AZStd::string& module, const AZStd::string& name, const CCommand::CArgs& args); void Execute(int commandId); - void GetCommandList(std::vector& cmds) const; + void GetCommandList(std::vector& cmds) const; //! Used in the console dialog - string AutoComplete(const string& substr) const; + AZStd::string AutoComplete(const AZStd::string& substr) const; bool IsRegistered(const char* module, const char* name) const; bool IsRegistered(const char* cmdLine) const; bool IsRegistered(int commandId) const; - void SetCommandAvailableInScripting(const string& module, const string& name); - bool IsCommandAvailableInScripting(const string& module, const string& name) const; - bool IsCommandAvailableInScripting(const string& fullCmdName) const; + void SetCommandAvailableInScripting(const AZStd::string& module, const AZStd::string& name); + bool IsCommandAvailableInScripting(const AZStd::string& module, const AZStd::string& name) const; + bool IsCommandAvailableInScripting(const AZStd::string& fullCmdName) const; //! Turning off the warning is needed for reloading the ribbon bar. void TurnDuplicateWarningOn() { m_bWarnDuplicate = true; } void TurnDuplicateWarningOff() { m_bWarnDuplicate = false; } @@ -74,7 +74,7 @@ protected: }; //! A full command name to an actual command mapping - typedef std::map CommandTable; + typedef std::map CommandTable; AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING CommandTable m_commands; @@ -86,9 +86,9 @@ protected: bool m_bWarnDuplicate; static int GenNewCommandId(); - static string GetFullCommandName(const string& module, const string& name); - static void GetArgsFromString(const string& argsTxt, CCommand::CArgs& argList); - void LogCommand(const string& fullCmdName, const CCommand::CArgs& args) const; + static AZStd::string GetFullCommandName(const AZStd::string& module, const AZStd::string& name); + static void GetArgsFromString(const AZStd::string& argsTxt, CCommand::CArgs& argList); + void LogCommand(const AZStd::string& fullCmdName, const CCommand::CArgs& args) const; QString ExecuteAndLogReturn(CCommand* pCommand, const CCommand::CArgs& args); }; diff --git a/Code/Editor/ConfigGroup.cpp b/Code/Editor/ConfigGroup.cpp index 4e61c38f4b..74fe6f7b5c 100644 --- a/Code/Editor/ConfigGroup.cpp +++ b/Code/Editor/ConfigGroup.cpp @@ -33,7 +33,7 @@ namespace Config uint32 CConfigGroup::GetVarCount() { - return m_vars.size(); + return static_cast(m_vars.size()); } IConfigVar* CConfigGroup::GetVar(const char* szName) @@ -48,7 +48,7 @@ namespace Config } } - return NULL; + return nullptr; } const IConfigVar* CConfigGroup::GetVar(const char* szName) const @@ -63,7 +63,7 @@ namespace Config } } - return NULL; + return nullptr; } IConfigVar* CConfigGroup::GetVar(uint index) @@ -73,7 +73,7 @@ namespace Config return m_vars[index]; } - return NULL; + return nullptr; } const IConfigVar* CConfigGroup::GetVar(uint index) const @@ -83,7 +83,7 @@ namespace Config return m_vars[index]; } - return NULL; + return nullptr; } void CConfigGroup::SaveToXML(XmlNodeRef node) @@ -127,9 +127,9 @@ namespace Config case IConfigVar::eType_STRING: { - string currentValue = 0; + AZStd::string currentValue; var->Get(¤tValue); - node->setAttr(szName, currentValue); + node->setAttr(szName, currentValue.c_str()); break; } } @@ -186,7 +186,7 @@ namespace Config case IConfigVar::eType_STRING: { - string currentValue = 0; + AZStd::string currentValue; var->GetDefault(¤tValue); QString readValue(currentValue.c_str()); if (node->getAttr(szName, readValue)) diff --git a/Code/Editor/ConfigGroup.h b/Code/Editor/ConfigGroup.h index 35c0b8e47f..769a29ba8a 100644 --- a/Code/Editor/ConfigGroup.h +++ b/Code/Editor/ConfigGroup.h @@ -37,22 +37,22 @@ namespace Config , m_description(szDescription) , m_type(varType) , m_flags(flags) - , m_ptr(NULL) + , m_ptr(nullptr) {}; virtual ~IConfigVar() = default; - + ILINE EType GetType() const { return m_type; } - ILINE const string& GetName() const + ILINE const AZStd::string& GetName() const { return m_name; } - ILINE const string& GetDescription() const + ILINE const AZStd::string& GetDescription() const { return m_description; } @@ -71,13 +71,13 @@ namespace Config static EType TranslateType(const bool&) { return eType_BOOL; } static EType TranslateType(const int&) { return eType_INT; } static EType TranslateType(const float&) { return eType_FLOAT; } - static EType TranslateType(const string&) { return eType_STRING; } + static EType TranslateType(const AZStd::string&) { return eType_STRING; } protected: EType m_type; uint8 m_flags; - string m_name; - string m_description; + AZStd::string m_name; + AZStd::string m_description; void* m_ptr; ICVar* m_pCVar; }; diff --git a/Code/Editor/ControlMRU.cpp b/Code/Editor/ControlMRU.cpp deleted file mode 100644 index 47de13950f..0000000000 --- a/Code/Editor/ControlMRU.cpp +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#include "EditorDefs.h" -#include "ControlMRU.h" - -IMPLEMENT_XTP_CONTROL(CControlMRU, CXTPControlRecentFileList) - -bool CControlMRU::DoesFileExist(CString& sFileName) -{ - return (_access(sFileName.GetBuffer(), 0) == 0); -} - -void CControlMRU::OnCalcDynamicSize(DWORD dwMode) -{ - CRecentFileList* pRecentFileList = GetRecentFileList(); - - if (!pRecentFileList) - { - return; - } - - CString* pArrNames = pRecentFileList->m_arrNames; - - assert(pArrNames != NULL); - if (!pArrNames) - { - return; - } - - while (m_nIndex + 1 < m_pControls->GetCount()) - { - CXTPControl* pControl = m_pControls->GetAt(m_nIndex + 1); - assert(pControl); - if (pControl->GetID() >= GetFirstMruID() - && pControl->GetID() <= GetFirstMruID() + pRecentFileList->m_nSize) - { - m_pControls->Remove(pControl); - } - else - { - break; - } - } - - if (m_pParent->IsCustomizeMode()) - { - m_dwHideFlags = 0; - SetEnabled(TRUE); - return; - } - - if (pArrNames[0].IsEmpty()) - { - SetCaption(CString(MAKEINTRESOURCE(IDS_NORECENTFILE_CAPTION))); - SetDescription("No recently opened files"); - m_dwHideFlags = 0; - SetEnabled(FALSE); - - return; - } - else - { - SetCaption(CString(MAKEINTRESOURCE(IDS_RECENTFILE_CAPTION))); - SetDescription("Open this document"); - } - - m_dwHideFlags |= xtpHideGeneric; - - CString sCurDir = (Path::GetEditingGameDataFolder() + "\\").c_str(); - int nCurDir = sCurDir.GetLength(); - - CString strName; - CString strTemp; - int iLastValidMRU = 0; - - for (int iMRU = 0; iMRU < pRecentFileList->m_nSize; iMRU++) - { - if (!pRecentFileList->GetDisplayName(strName, iMRU, sCurDir.GetBuffer(), nCurDir)) - { - break; - } - - if (DoesFileExist(pArrNames[iMRU])) - { - CString sCurEntryDir = pArrNames[iMRU].Left(nCurDir); - - if (sCurEntryDir.CompareNoCase(sCurDir) != 0) - { - //unavailable entry (wrong directory) - continue; - } - } - else - { - //invalid entry (not existing) - continue; - } - - int nId = iMRU + GetFirstMruID(); - - CXTPControl* pControl = m_pControls->Add(xtpControlButton, nId, _T(""), m_nIndex + iLastValidMRU + 1, TRUE); - assert(pControl); - - pControl->SetCaption(CXTPControlWindowList::ConstructCaption(strName, iLastValidMRU + 1)); - pControl->SetFlags(xtpFlagManualUpdate); - pControl->SetBeginGroup(iLastValidMRU == 0 && m_nIndex != 0); - pControl->SetParameter(pArrNames[iMRU]); - - CString sDescription = "Open file: " + pArrNames[iMRU]; - pControl->SetDescription(sDescription); - - if ((GetFlags() & xtpFlagWrapRow) && iMRU == 0) - { - pControl->SetFlags(pControl->GetFlags() | xtpFlagWrapRow); - } - - ++iLastValidMRU; - } - - //if no entry was valid, treat as none would exist - if (iLastValidMRU == 0) - { - SetCaption(CString(MAKEINTRESOURCE(IDS_NORECENTFILE_CAPTION))); - SetDescription("No recently opened files"); - m_dwHideFlags = 0; - SetEnabled(FALSE); - } -} diff --git a/Code/Editor/ControlMRU.h b/Code/Editor/ControlMRU.h deleted file mode 100644 index 4ca6562589..0000000000 --- a/Code/Editor/ControlMRU.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#pragma once -#ifndef CRYINCLUDE_EDITOR_CONTROLMRU_H -#define CRYINCLUDE_EDITOR_CONTROLMRU_H - -class CControlMRU - : public CXTPControlRecentFileList -{ -protected: - virtual void OnCalcDynamicSize(DWORD dwMode); - -private: - DECLARE_XTP_CONTROL(CControlMRU) - bool DoesFileExist(CString& sFileName); -}; -#endif // CRYINCLUDE_EDITOR_CONTROLMRU_H diff --git a/Code/Editor/Controls/ColorGradientCtrl.cpp b/Code/Editor/Controls/ColorGradientCtrl.cpp index 3bd3b11690..446e5810c5 100644 --- a/Code/Editor/Controls/ColorGradientCtrl.cpp +++ b/Code/Editor/Controls/ColorGradientCtrl.cpp @@ -72,7 +72,7 @@ void CColorGradientCtrl::resizeEvent(QResizeEvent* event) m_grid.rect = m_rcGradient; if (m_bNoZoom) { - m_grid.zoom.x = m_grid.rect.width(); + m_grid.zoom.x = static_cast(m_grid.rect.width()); } m_rcKeys = rc; @@ -106,11 +106,6 @@ QPoint CColorGradientCtrl::KeyToPoint(int nKey) QPoint CColorGradientCtrl::TimeToPoint(float time) { return QPoint(m_grid.WorldToClient(Vec2(time, 0)).x(), m_rcGradient.height() / 2); - - QPoint point; - point.rx() = (time - m_fMinTime) * (m_rcGradient.width() / (m_fMaxTime - m_fMinTime)) + m_rcGradient.left(); - point.ry() = m_rcGradient.height() / 2; - return point; } ////////////////////////////////////////////////////////////////////////// diff --git a/Code/Editor/Controls/ColorGradientCtrl.h b/Code/Editor/Controls/ColorGradientCtrl.h index 80d8b966f4..a3f95fcd8c 100644 --- a/Code/Editor/Controls/ColorGradientCtrl.h +++ b/Code/Editor/Controls/ColorGradientCtrl.h @@ -130,7 +130,6 @@ private: private: ISplineInterpolator* m_pSpline; - bool m_bAutoDelete; bool m_bNoZoom; QRect m_rcClipRect; diff --git a/Code/Editor/Controls/ConsoleSCB.cpp b/Code/Editor/Controls/ConsoleSCB.cpp index 7f018e0286..6b12348880 100644 --- a/Code/Editor/Controls/ConsoleSCB.cpp +++ b/Code/Editor/Controls/ConsoleSCB.cpp @@ -180,7 +180,7 @@ bool ConsoleLineEdit::event(QEvent* ev) if (newStr.isEmpty()) { - newStr = GetIEditor()->GetCommandManager()->AutoComplete(cstring.toUtf8().data()); + newStr = GetIEditor()->GetCommandManager()->AutoComplete(cstring.toUtf8().data()).c_str(); } } @@ -211,7 +211,7 @@ void ConsoleLineEdit::keyPressEvent(QKeyEvent* ev) { if (commandManager->IsRegistered(str.toUtf8().data())) { - commandManager->Execute(QtUtil::ToString(str)); + commandManager->Execute(str.toUtf8().data()); } else { @@ -220,7 +220,7 @@ void ConsoleLineEdit::keyPressEvent(QKeyEvent* ev) } // If a history command was reused directly via up arrow enter, do not reset history index - if (m_history.size() > 0 && m_historyIndex < m_history.size() && m_history[m_historyIndex] == str) + if (m_history.size() > 0 && m_historyIndex < static_cast(m_history.size()) && m_history[m_historyIndex] == str) { m_bReusedHistory = true; } @@ -298,7 +298,6 @@ Lines CConsoleSCB::s_pendingLines; CConsoleSCB::CConsoleSCB(QWidget* parent) : QWidget(parent) , ui(new Ui::Console()) - , m_richEditTextLength(0) , m_backgroundTheme(gSettings.consoleBackgroundColorTheme) { m_lines = s_pendingLines; @@ -566,15 +565,19 @@ static void OnVariableUpdated([[maybe_unused]] int row, ICVar* pCVar) static CVarBlock* VarBlockFromConsoleVars() { IConsole* console = GetIEditor()->GetSystem()->GetIConsole(); - std::vector cmds; + AZStd::vector cmds; cmds.resize(console->GetNumVars()); - size_t cmdCount = console->GetSortedVars(&cmds[0], cmds.size()); + size_t cmdCount = console->GetSortedVars(cmds); CVarBlock* vb = new CVarBlock; IVariable* pVariable = nullptr; for (int i = 0; i < cmdCount; i++) { - ICVar* pCVar = console->GetCVar(cmds[i]); + if (!cmds[i].data()) + { + continue; + } + ICVar* pCVar = console->GetCVar(cmds[i].data()); if (!pCVar) { continue; @@ -606,7 +609,7 @@ static CVarBlock* VarBlockFromConsoleVars() pCVar->AddOnChangeFunctor(onChange); pVariable->SetDescription(pCVar->GetHelp()); - pVariable->SetName(cmds[i]); + pVariable->SetName(cmds[i].data()); // Transfer the custom limits have they have been set for this variable if (pCVar->HasCustomLimits()) @@ -833,15 +836,15 @@ static void SetEditorRange(EditorType* editor, IVariable* var) // If this variable has custom limits set, then use that as the min/max // Otherwise, the min/max for the input box will be bounded by the type // limit, but the slider will be constricted to a smaller default range - static const double defaultMin = -100.0f; - static const double defaultMax = 100.0f; + static const float defaultMin = -100.0f; + static const float defaultMax = 100.0f; if (var->HasCustomLimits()) { - editor->setRange(min, max); + editor->setRange(static_cast(min), static_cast(max)); } else { - editor->setSoftRange(defaultMin, defaultMax); + editor->setSoftRange(static_cast(defaultMin), static_cast(defaultMax)); } // Set the step size. The default variable step is 0, so if it's @@ -850,7 +853,7 @@ static void SetEditorRange(EditorType* editor, IVariable* var) // use that for the int values if (step > 0) { - editor->spinbox()->setSingleStep(step); + editor->spinbox()->setSingleStep(static_cast(step)); } else if (auto doubleSpinBox = qobject_cast(editor->spinbox())) { diff --git a/Code/Editor/Controls/ConsoleSCB.h b/Code/Editor/Controls/ConsoleSCB.h index f51786e2a5..051f3ea4e7 100644 --- a/Code/Editor/Controls/ConsoleSCB.h +++ b/Code/Editor/Controls/ConsoleSCB.h @@ -191,7 +191,6 @@ private: void OnEditorNotifyEvent(EEditorNotifyEvent event) override; QScopedPointer ui; - int m_richEditTextLength; Lines m_lines; static Lines s_pendingLines; diff --git a/Code/Editor/Controls/ConsoleSCBMFC.cpp b/Code/Editor/Controls/ConsoleSCBMFC.cpp deleted file mode 100644 index 3337997811..0000000000 --- a/Code/Editor/Controls/ConsoleSCBMFC.cpp +++ /dev/null @@ -1,543 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#include "EditorDefs.h" -#include "ConsoleSCBMFC.h" -#include "PropertiesDialog.h" -#include "QtViewPaneManager.h" -#include "Core/QtEditorApplication.h" - -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -namespace MFC -{ - -static CPropertiesDialog* gPropertiesDlg = nullptr; -static CString mfc_popup_helper(HWND hwnd, int x, int y); -static CConsoleSCB* s_consoleSCB = nullptr; - -static QString RemoveColorCode(const QString& text, int& iColorCode) -{ - QString cleanString; - cleanString.reserve(text.size()); - - const int textSize = text.size(); - for (int i = 0; i < textSize; ++i) - { - QChar c = text.at(i); - bool isLast = i == textSize - 1; - if (c == '$' && !isLast && text.at(i + 1).isDigit()) - { - if (iColorCode == 0) - { - iColorCode = text.at(i + 1).digitValue(); - } - ++i; - continue; - } - - if (c == '\r' || c == '\n') - { - ++i; - continue; - } - - cleanString.append(c); - } - - return cleanString; -} - -ConsoleLineEdit::ConsoleLineEdit(QWidget* parent) - : QLineEdit(parent) - , m_historyIndex(0) - , m_bReusedHistory(false) -{ -} - -void ConsoleLineEdit::mousePressEvent(QMouseEvent* ev) -{ - if (ev->type() == QEvent::MouseButtonPress && ev->button() & Qt::RightButton) - { - Q_EMIT variableEditorRequested(); - } - - QLineEdit::mousePressEvent(ev); -} - -void ConsoleLineEdit::mouseDoubleClickEvent(QMouseEvent* ev) -{ - Q_EMIT variableEditorRequested(); -} - -bool ConsoleLineEdit::event(QEvent* ev) -{ - // Tab key doesn't go to keyPressEvent(), must be processed here - - if (ev->type() != QEvent::KeyPress) - { - return QLineEdit::event(ev); - } - - QKeyEvent* ke = static_cast(ev); - if (ke->key() != Qt::Key_Tab) - { - return QLineEdit::event(ev); - } - - QString inputStr = text(); - QString newStr; - - QStringList tokens = inputStr.split(" "); - inputStr = tokens.isEmpty() ? QString() : tokens.first(); - IConsole* console = GetIEditor()->GetSystem()->GetIConsole(); - - const bool ctrlPressed = ke->modifiers() & Qt::ControlModifier; - CString cstring = QtUtil::ToCString(inputStr); // TODO: Use QString once the backend stops using QString - if (ctrlPressed) - { - newStr = QtUtil::ToString(console->AutoCompletePrev(cstring)); - } - else - { - newStr = QtUtil::ToString(console->ProcessCompletion(cstring)); - newStr = QtUtil::ToString(console->AutoComplete(cstring)); - - if (newStr.isEmpty()) - { - newStr = QtUtil::ToQString(GetIEditor()->GetCommandManager()->AutoComplete(QtUtil::ToString(newStr))); - } - } - - if (!newStr.isEmpty()) - { - newStr += " "; - setText(newStr); - } - - deselect(); - return true; -} - -void ConsoleLineEdit::keyPressEvent(QKeyEvent* ev) -{ - IConsole* console = GetIEditor()->GetSystem()->GetIConsole(); - auto commandManager = GetIEditor()->GetCommandManager(); - - console->ResetAutoCompletion(); - - switch (ev->key()) - { - case Qt::Key_Enter: - case Qt::Key_Return: - { - QString str = text().trimmed(); - if (!str.isEmpty()) - { - if (commandManager->IsRegistered(QtUtil::ToCString(str))) - { - commandManager->Execute(QtUtil::ToString(str)); - } - else - { - CLogFile::WriteLine(QtUtil::ToCString(str)); - GetIEditor()->GetSystem()->GetIConsole()->ExecuteString(QtUtil::ToCString(str)); - } - - // If a history command was reused directly via up arrow enter, do not reset history index - if (m_history.size() > 0 && m_historyIndex < m_history.size() && m_history[m_historyIndex] == str) - { - m_bReusedHistory = true; - } - else - { - m_historyIndex = m_history.size(); - } - - // Do not add the same string if it is the top of the stack, but allow duplicate entries otherwise - if (m_history.isEmpty() || m_history.back() != str) - { - m_history.push_back(str); - if (!m_bReusedHistory) - { - m_historyIndex = m_history.size(); - } - } - } - else - { - m_historyIndex = m_history.size(); - } - - setText(QString()); - break; - } - case Qt::Key_AsciiTilde: // ~ - case Qt::Key_Agrave: // ` - // disable log. - GetIEditor()->ShowConsole(false); - setText(QString()); - m_historyIndex = m_history.size(); - break; - case Qt::Key_Escape: - setText(QString()); - m_historyIndex = m_history.size(); - break; - case Qt::Key_Up: - DisplayHistory(false /*bForward*/); - break; - case Qt::Key_Down: - DisplayHistory(true /*bForward*/); - break; - default: - QLineEdit::keyPressEvent(ev); - } -} - -void ConsoleLineEdit::DisplayHistory(bool bForward) -{ - if (m_history.isEmpty()) - { - return; - } - - // Immediately after reusing a history entry, ensure up arrow re-displays command just used - if (!m_bReusedHistory || bForward) - { - m_historyIndex = static_cast(clamp_tpl(static_cast(m_historyIndex) + (bForward ? 1 : -1), 0, m_history.size() - 1)); - } - m_bReusedHistory = false; - - setText(m_history[m_historyIndex]); -} - -ConsoleTextEdit::ConsoleTextEdit(QWidget* parent) - : QTextEdit(parent) -{ -} - - -Lines CConsoleSCB::s_pendingLines; - -CConsoleSCB::CConsoleSCB(QWidget* parent) - : QWidget(parent) - , ui(new Ui::ConsoleMFC()) - , m_richEditTextLength(0) - , m_backgroundTheme(gSettings.consoleBackgroundColorTheme) -{ - m_lines = s_pendingLines; - s_pendingLines.clear(); - s_consoleSCB = this; - ui->setupUi(this); - setMinimumHeight(120); - - // Setup the color table for the default (light) theme - m_colorTable << QColor(0, 0, 0) - << QColor(0, 0, 0) - << QColor(0, 0, 200) // blue - << QColor(0, 200, 0) // green - << QColor(200, 0, 0) // red - << QColor(0, 200, 200) // cyan - << QColor(128, 112, 0) // yellow - << QColor(200, 0, 200) // red+blue - << QColor(0x000080ff) - << QColor(0x008f8f8f); - OnStyleSettingsChanged(); - - connect(ui->button, &QPushButton::clicked, this, &CConsoleSCB::showVariableEditor); - connect(ui->lineEdit, &MFC::ConsoleLineEdit::variableEditorRequested, this, &MFC::CConsoleSCB::showVariableEditor); - connect(Editor::EditorQtApplication::instance(), &Editor::EditorQtApplication::skinChanged, this, &MFC::CConsoleSCB::OnStyleSettingsChanged); - - if (GetIEditor()->IsInConsolewMode()) - { - // Attach / register edit box - //CLogFile::AttachEditBox(m_edit.GetSafeHwnd()); // FIXME - } -} - -CConsoleSCB::~CConsoleSCB() -{ - s_consoleSCB = nullptr; - delete gPropertiesDlg; - gPropertiesDlg = nullptr; - CLogFile::AttachEditBox(nullptr); -} - -void CConsoleSCB::RegisterViewClass() -{ - QtViewOptions opts; - opts.preferedDockingArea = Qt::BottomDockWidgetArea; - opts.isDeletable = false; - opts.isStandard = true; - opts.showInMenu = true; - opts.builtInActionId = ID_VIEW_CONSOLEWINDOW; - opts.sendViewPaneNameBackToAmazonAnalyticsServers = true; - RegisterQtViewPane(GetIEditor(), LyViewPane::Console, LyViewPane::CategoryTools, opts); -} - -void CConsoleSCB::OnStyleSettingsChanged() -{ - ui->button->setIcon(QIcon(QString(":/controls/img/cvar_dark.bmp"))); - - // Set the debug/warning text colors appropriately for the background theme - // (e.g. not have black text on black background) - QColor textColor = Qt::black; - m_backgroundTheme = gSettings.consoleBackgroundColorTheme; - if (m_backgroundTheme == SEditorSettings::ConsoleColorTheme::Dark) - { - textColor = Qt::white; - } - m_colorTable[0] = textColor; - m_colorTable[1] = textColor; - - QColor bgColor; - if (!GetIEditor()->IsInConsolewMode() && CConsoleSCB::GetCreatedInstance() && m_backgroundTheme == SEditorSettings::ConsoleColorTheme::Dark) - { - bgColor = Qt::black; - } - else - { - bgColor = Qt::white; - } - - ui->textEdit->setStyleSheet(QString("QTextEdit{ background: %1 }").arg(bgColor.name(QColor::HexRgb))); - - // Clear out the console text when we change our background color since - // some of the previous text colors may not be appropriate for the - // new background color - ui->textEdit->clear(); -} - -void CConsoleSCB::showVariableEditor() -{ - const QPoint cursorPos = QCursor::pos(); - CString str = mfc_popup_helper(0, cursorPos.x(), cursorPos.y()); - if (!str.IsEmpty()) - { - ui->lineEdit->setText(QtUtil::ToQString(str)); - } -} - -void CConsoleSCB::SetInputFocus() -{ - ui->lineEdit->setFocus(); - ui->lineEdit->setText(QString()); -} - -void CConsoleSCB::AddToConsole(const QString& text, bool bNewLine) -{ - m_lines.push_back({ text, bNewLine }); - FlushText(); -} - -void CConsoleSCB::FlushText() -{ - if (m_lines.empty()) - { - return; - } - - // Store our current cursor in case we need to restore it, and check if - // the user has scrolled the text edit away from the bottom - const QTextCursor oldCursor = ui->textEdit->textCursor(); - QScrollBar* scrollBar = ui->textEdit->verticalScrollBar(); - const int oldScrollValue = scrollBar->value(); - bool scrolledOffBottom = oldScrollValue != scrollBar->maximum(); - - ui->textEdit->moveCursor(QTextCursor::End); - QTextCursor textCursor = ui->textEdit->textCursor(); - - while (!m_lines.empty()) - { - ConsoleLine line = m_lines.front(); - m_lines.pop_front(); - - int iColor = 0; - QString text = MFC::RemoveColorCode(line.text, iColor); - if (iColor < 0 || iColor >= m_colorTable.size()) - { - iColor = 0; - } - - if (line.newLine) - { - text = QtUtil::trimRight(text); - text = "\r\n" + text; - } - - QTextCharFormat format; - const QColor color(m_colorTable[iColor]); - format.setForeground(color); - - if (iColor != 0) - { - format.setFontWeight(QFont::Bold); - } - - textCursor.setCharFormat(format); - textCursor.insertText(text); - } - - // If the user has selected some text in the text edit area or has scrolled - // away from the bottom, then restore the previous cursor and keep the scroll - // bar in the same location - if (oldCursor.hasSelection() || scrolledOffBottom) - { - ui->textEdit->setTextCursor(oldCursor); - scrollBar->setValue(oldScrollValue); - } - // Otherwise scroll to the bottom so the latest text can be seen - else - { - scrollBar->setValue(scrollBar->maximum()); - } -} - -QSize CConsoleSCB::minimumSizeHint() const -{ - return QSize(-1, -1); -} - -QSize CConsoleSCB::sizeHint() const -{ - return QSize(100, 100); -} - -/** static */ -void CConsoleSCB::AddToPendingLines(const QString& text, bool bNewLine) -{ - s_pendingLines.push_back({ text, bNewLine }); -} - -static CVarBlock* VarBlockFromConsoleVars() -{ - IConsole* console = GetIEditor()->GetSystem()->GetIConsole(); - std::vector cmds; - cmds.resize(console->GetNumVars()); - size_t cmdCount = console->GetSortedVars(&cmds[0], cmds.size()); - - CVarBlock* vb = new CVarBlock; - IVariable* pVariable = 0; - for (int i = 0; i < cmdCount; i++) - { - ICVar* pCVar = console->GetCVar(cmds[i]); - if (!pCVar) - { - continue; - } - int varType = pCVar->GetType(); - - switch (varType) - { - case CVAR_INT: - pVariable = new CVariable(); - pVariable->Set(pCVar->GetIVal()); - break; - case CVAR_FLOAT: - pVariable = new CVariable(); - pVariable->Set(pCVar->GetFVal()); - break; - case CVAR_STRING: - pVariable = new CVariable(); - pVariable->Set(pCVar->GetString()); - break; - default: - assert(0); - } - - pVariable->SetDescription(pCVar->GetHelp()); - pVariable->SetName(cmds[i]); - - if (pVariable) - { - vb->AddVariable(pVariable); - } - } - return vb; -} - -static void OnConsoleVariableUpdated(IVariable* pVar) -{ - if (!pVar) - { - return; - } - CString varName = pVar->GetName(); - ICVar* pCVar = GetIEditor()->GetSystem()->GetIConsole()->GetCVar(varName); - if (!pCVar) - { - return; - } - if (pVar->GetType() == IVariable::INT) - { - int val; - pVar->Get(val); - pCVar->Set(val); - } - else if (pVar->GetType() == IVariable::FLOAT) - { - float val; - pVar->Get(val); - pCVar->Set(val); - } - else if (pVar->GetType() == IVariable::STRING) - { - CString val; - pVar->Get(val); - pCVar->Set(val); - } -} - -static CString mfc_popup_helper(HWND hwnd, int x, int y) -{ - IConsole* console = GetIEditor()->GetSystem()->GetIConsole(); - - TSmartPtr vb = VarBlockFromConsoleVars(); - XmlNodeRef node; - if (!gPropertiesDlg) - { - gPropertiesDlg = new CPropertiesDialog("Console Variables", node, AfxGetMainWnd(), true); - } - if (!gPropertiesDlg->m_hWnd) - { - gPropertiesDlg->Create(CPropertiesDialog::IDD, AfxGetMainWnd()); - gPropertiesDlg->SetUpdateCallback(AZStd::bind(OnConsoleVariableUpdated, AZStd::placeholders::_1)); - } - gPropertiesDlg->ShowWindow(SW_SHOW); - gPropertiesDlg->BringWindowToTop(); - gPropertiesDlg->GetPropertyCtrl()->AddVarBlock(vb); - - return ""; -} - -CConsoleSCB* CConsoleSCB::GetCreatedInstance() -{ - return s_consoleSCB; -} - -} // namespace MFC - -#include diff --git a/Code/Editor/Controls/FolderTreeCtrl.cpp b/Code/Editor/Controls/FolderTreeCtrl.cpp index 17b6dccac7..b1cbb9414e 100644 --- a/Code/Editor/Controls/FolderTreeCtrl.cpp +++ b/Code/Editor/Controls/FolderTreeCtrl.cpp @@ -400,7 +400,7 @@ void CFolderTreeCtrl::RemoveEmptyFolderItems(const QString& folder) void CFolderTreeCtrl::Edit(const QString& path) { - CFileUtil::EditTextFile(QtUtil::ToString(path), 0, IFileUtil::FILE_TYPE_SCRIPT); + CFileUtil::EditTextFile(path.toUtf8().data(), 0, IFileUtil::FILE_TYPE_SCRIPT); } void CFolderTreeCtrl::ShowInExplorer(const QString& path) diff --git a/Code/Editor/Controls/ImageHistogramCtrl.cpp b/Code/Editor/Controls/ImageHistogramCtrl.cpp index 7218c0cd38..bdb81e3655 100644 --- a/Code/Editor/Controls/ImageHistogramCtrl.cpp +++ b/Code/Editor/Controls/ImageHistogramCtrl.cpp @@ -30,12 +30,6 @@ namespace ImageHistogram const QColor kGreenSectionColor = QColor(220, 255, 220); const QColor kBlueSectionColor = QColor(220, 220, 255); const QColor kSplitSeparatorColor = QColor(100, 100, 0); - const QColor kButtonBackColor = QColor(20, 20, 20); - const QColor kBtnLightColor(200, 200, 200); - const QColor kBtnShadowColor(50, 50, 50); - const int kButtonWidth = 40; - const QColor kButtonTextColor(255, 255, 0); - const int kTextLeftSpacing = 4; const int kTextFontSize = 70; const char* kTextFontFace = "Arial"; const QColor kTextColor(255, 255, 255); @@ -175,7 +169,7 @@ void CImageHistogramDisplay::paintEvent([[maybe_unused]] QPaintEvent* event) penSpikes = penColor; painter.setPen(Qt::black); painter.setBrush(Qt::white); - rcGraph = QRect(QPoint(m_graphMargin, m_graphMargin), QPoint(abs(rc.width() - m_graphMargin), abs(rc.height() * m_graphHeightPercent))); + rcGraph = QRect(QPoint(m_graphMargin, m_graphMargin), QPoint(abs(rc.width() - m_graphMargin), static_cast(abs(rc.height() * m_graphHeightPercent)))); painter.drawRect(rcGraph); painter.setPen(penSpikes); @@ -193,8 +187,8 @@ void CImageHistogramDisplay::paintEvent([[maybe_unused]] QPaintEvent* event) { float scale = 0; - i = ((float)x / graphWidth) * (kNumColorLevels - 1); - i = CLAMP(i, 0, kNumColorLevels - 1); + i = static_cast(((float)x / graphWidth) * (kNumColorLevels - 1)); + i = AZStd::clamp(i, 0, kNumColorLevels - 1); switch (m_drawMode) { @@ -244,8 +238,8 @@ void CImageHistogramDisplay::paintEvent([[maybe_unused]] QPaintEvent* event) } } - crtX = rcGraph.left() + x + 1; - painter.drawLine(crtX, graphBottom, crtX, graphBottom - scale * graphHeight); + crtX = static_cast(rcGraph.left() + x + 1); + painter.drawLine(crtX, graphBottom, crtX, static_cast(graphBottom - scale * graphHeight)); } } else @@ -258,9 +252,9 @@ void CImageHistogramDisplay::paintEvent([[maybe_unused]] QPaintEvent* event) for (size_t x = 0, xCount = abs(rcGraph.width()); x < xCount; ++x) { - i = ((float)x / graphWidth) * (kNumColorLevels - 1); - i = CLAMP(i, 0, kNumColorLevels - 1); - crtX = rcGraph.left() + x + 1; + i = static_cast(((float)x / graphWidth) * (kNumColorLevels - 1)); + i = AZStd::clamp(i, 0, kNumColorLevels - 1); + crtX = static_cast(rcGraph.left() + x + 1); scaleR = scaleG = scaleB = scaleA = 0; if (m_maxCount[0]) @@ -283,10 +277,10 @@ void CImageHistogramDisplay::paintEvent([[maybe_unused]] QPaintEvent* event) scaleA = (float)m_count[3][i] / m_maxCount[3]; } - heightR = graphBottom - scaleR * graphHeight; - heightG = graphBottom - scaleG * graphHeight; - heightB = graphBottom - scaleB * graphHeight; - heightA = graphBottom - scaleA * graphHeight; + heightR = static_cast(graphBottom - scaleR * graphHeight); + heightG = static_cast(graphBottom - scaleG * graphHeight); + heightB = static_cast(graphBottom - scaleB * graphHeight); + heightA = static_cast(graphBottom - scaleA * graphHeight); if (lastHeight[0] == INT_MAX) { @@ -350,8 +344,8 @@ void CImageHistogramDisplay::paintEvent([[maybe_unused]] QPaintEvent* event) for (size_t x = 0, xCount = abs(rcGraph.width()); x < xCount; ++x) { pos = (float)x / graphWidth; - i = (float)((int)(pos * kNumColorLevels) % aThirdOfNumColorLevels) / aThirdOfNumColorLevels * kNumColorLevels; - i = CLAMP(i, 0, kNumColorLevels - 1); + i = static_cast((float)((int)(pos * kNumColorLevels) % aThirdOfNumColorLevels) / aThirdOfNumColorLevels * kNumColorLevels); + i = AZStd::clamp(i, 0, kNumColorLevels - 1); scale = 0; // R @@ -385,7 +379,7 @@ void CImageHistogramDisplay::paintEvent([[maybe_unused]] QPaintEvent* event) } painter.setPen(pPen); - painter.drawLine(rcGraph.left() + x + 1, graphBottom, rcGraph.left() + x + 1, graphBottom - scale * graphHeight); + painter.drawLine(rcGraph.left() + static_cast(x) + 1, graphBottom, rcGraph.left() + static_cast(x) + 1, static_cast(graphBottom - scale * graphHeight)); } // then draw 3 lines so we separate the channels diff --git a/Code/Editor/Controls/QBitmapPreviewDialogImp.cpp b/Code/Editor/Controls/QBitmapPreviewDialogImp.cpp index c438858e81..b47a535d2a 100644 --- a/Code/Editor/Controls/QBitmapPreviewDialogImp.cpp +++ b/Code/Editor/Controls/QBitmapPreviewDialogImp.cpp @@ -422,7 +422,7 @@ void QBitmapPreviewDialogImp::paintEvent(QPaintEvent* e) curr_x = histogramRect.left() + x + 1; - int i = ((float)x / (graphWidth - 1)) * (CImageHistogram::kNumColorLevels - 1); + int i = static_cast(((float)x / (graphWidth - 1)) * (CImageHistogram::kNumColorLevels - 1)); if (m_histrogramMode == eHistogramMode_SplitRGB) { // Filter out to area which we are interested @@ -446,7 +446,7 @@ void QBitmapPreviewDialogImp::paintEvent(QPaintEvent* e) scale = (float)m_histogram.m_count[c][i] / m_histogram.m_maxCount[c]; } - int height = graphBottom - graphHeight * scale; + int height = static_cast(graphBottom - graphHeight * scale); if (last_height == INT_MAX) { last_height = height; diff --git a/Code/Editor/Controls/ReflectedPropertyControl/PropertyAnimationCtrl.cpp b/Code/Editor/Controls/ReflectedPropertyControl/PropertyAnimationCtrl.cpp index fde5642b05..4fb18e438c 100644 --- a/Code/Editor/Controls/ReflectedPropertyControl/PropertyAnimationCtrl.cpp +++ b/Code/Editor/Controls/ReflectedPropertyControl/PropertyAnimationCtrl.cpp @@ -56,8 +56,8 @@ CReflectedVarAnimation AnimationPropertyCtrl::value() const void AnimationPropertyCtrl::OnApplyClicked() { QStringList cSelectedAnimations; - size_t nTotalAnimations(0); - size_t nCurrentAnimation(0); + int nTotalAnimations(0); + int nCurrentAnimation(0); QString combinedString = GetIEditor()->GetResourceSelectorHost()->GetGlobalSelection("animation"); SplitString(combinedString, cSelectedAnimations, ','); diff --git a/Code/Editor/Controls/ReflectedPropertyControl/PropertyCtrl.cpp b/Code/Editor/Controls/ReflectedPropertyControl/PropertyCtrl.cpp index bf87f2017d..c228fbda09 100644 --- a/Code/Editor/Controls/ReflectedPropertyControl/PropertyCtrl.cpp +++ b/Code/Editor/Controls/ReflectedPropertyControl/PropertyCtrl.cpp @@ -10,7 +10,6 @@ // Editor #include "PropertyCtrl.h" -#include "PropertyAnimationCtrl.h" #include "PropertyResourceCtrl.h" #include "PropertyGenericCtrl.h" #include "PropertyMiscCtrl.h" @@ -22,9 +21,7 @@ void RegisterReflectedVarHandlers() if (!registered) { registered = true; - EBUS_EVENT(AzToolsFramework::PropertyTypeRegistrationMessages::Bus, RegisterPropertyType, aznew AnimationPropertyWidgetHandler()); EBUS_EVENT(AzToolsFramework::PropertyTypeRegistrationMessages::Bus, RegisterPropertyType, aznew FileResourceSelectorWidgetHandler()); - EBUS_EVENT(AzToolsFramework::PropertyTypeRegistrationMessages::Bus, RegisterPropertyType, aznew ReverbPresetPropertyHandler()); EBUS_EVENT(AzToolsFramework::PropertyTypeRegistrationMessages::Bus, RegisterPropertyType, aznew SequencePropertyHandler()); EBUS_EVENT(AzToolsFramework::PropertyTypeRegistrationMessages::Bus, RegisterPropertyType, aznew SequenceIdPropertyHandler()); EBUS_EVENT(AzToolsFramework::PropertyTypeRegistrationMessages::Bus, RegisterPropertyType, aznew LocalStringPropertyHandler()); diff --git a/Code/Editor/Controls/ReflectedPropertyControl/PropertyGenericCtrl.cpp b/Code/Editor/Controls/ReflectedPropertyControl/PropertyGenericCtrl.cpp index 1916ce5e16..8ff83dd894 100644 --- a/Code/Editor/Controls/ReflectedPropertyControl/PropertyGenericCtrl.cpp +++ b/Code/Editor/Controls/ReflectedPropertyControl/PropertyGenericCtrl.cpp @@ -73,16 +73,6 @@ void GenericPopupPropertyEditor::SetPropertyType(PropertyType type) m_propertyType = type; } -void ReverbPresetPropertyEditor::onEditClicked() -{ - CSelectEAXPresetDlg PresetDlg(this); - PresetDlg.SetCurrPreset(GetValue()); - if (PresetDlg.exec() == QDialog::Accepted) - { - SetValue(PresetDlg.GetCurrPreset()); - } -} - void SequencePropertyEditor::onEditClicked() { CSelectSequenceDialog gtDlg(this); @@ -132,7 +122,9 @@ void LocalStringPropertyEditor::onEditClicked() if (pMgr->GetLocalizedInfoByIndex(i, sInfo)) { item.desc = tr("English Text:\r\n"); - item.desc += QString::fromWCharArray(Unicode::Convert(sInfo.sUtf8TranslatedText).c_str()); + AZStd::wstring utf8TranslatedTextW; + AZStd::to_wstring(utf8TranslatedTextW, sInfo.sUtf8TranslatedText); + item.desc += QString::fromWCharArray(utf8TranslatedTextW.c_str()); item.name = sInfo.sKey; items.push_back(item); } diff --git a/Code/Editor/Controls/ReflectedPropertyControl/PropertyGenericCtrl.h b/Code/Editor/Controls/ReflectedPropertyControl/PropertyGenericCtrl.h index 2296773f0a..b6b14cf125 100644 --- a/Code/Editor/Controls/ReflectedPropertyControl/PropertyGenericCtrl.h +++ b/Code/Editor/Controls/ReflectedPropertyControl/PropertyGenericCtrl.h @@ -96,15 +96,6 @@ public: } }; -class ReverbPresetPropertyEditor - : public GenericPopupPropertyEditor -{ -public: - ReverbPresetPropertyEditor(QWidget* pParent = nullptr) - : GenericPopupPropertyEditor(pParent){} - void onEditClicked() override; -}; - class MissionObjPropertyEditor : public GenericPopupPropertyEditor { @@ -155,7 +146,6 @@ public: // So we use our own #define CONST_AZ_CRC(name, value) AZ::u32(value) -using ReverbPresetPropertyHandler = GenericPopupWidgetHandler; using MissionObjPropertyHandler = GenericPopupWidgetHandler; using SequencePropertyHandler = GenericPopupWidgetHandler; using SequenceIdPropertyHandler = GenericPopupWidgetHandler; diff --git a/Code/Editor/Controls/ReflectedPropertyControl/PropertyMiscCtrl.cpp b/Code/Editor/Controls/ReflectedPropertyControl/PropertyMiscCtrl.cpp index 92c33aefc2..b9f7e12e95 100644 --- a/Code/Editor/Controls/ReflectedPropertyControl/PropertyMiscCtrl.cpp +++ b/Code/Editor/Controls/ReflectedPropertyControl/PropertyMiscCtrl.cpp @@ -145,7 +145,7 @@ bool UserPopupWidgetHandler::ReadValuesIntoGUI(size_t index, UserPropertyEditor* QWidget* FloatCurveHandler::CreateGUI(QWidget *pParent) { CSplineCtrl *cSpline = new CSplineCtrl(pParent); - cSpline->SetUpdateCallback(AZStd::bind(&FloatCurveHandler::OnSplineChange, this, AZStd::placeholders::_1)); + cSpline->SetUpdateCallback([this](CSplineCtrl* spl) { OnSplineChange(spl); }); cSpline->SetTimeRange(0, 1); cSpline->SetValueRange(0, 1); cSpline->SetGrid(12, 12); diff --git a/Code/Editor/Controls/ReflectedPropertyControl/PropertyResourceCtrl.cpp b/Code/Editor/Controls/ReflectedPropertyControl/PropertyResourceCtrl.cpp index d3ae6aaecf..c5ccc599d6 100644 --- a/Code/Editor/Controls/ReflectedPropertyControl/PropertyResourceCtrl.cpp +++ b/Code/Editor/Controls/ReflectedPropertyControl/PropertyResourceCtrl.cpp @@ -17,9 +17,9 @@ // AzToolsFramework #include #include +#include // Editor -#include "IResourceSelectorHost.h" #include "Controls/QToolTipWidget.h" #include "Controls/BitmapToolTip.h" @@ -35,8 +35,8 @@ BrowseButton::BrowseButton(PropertyType type, QWidget* parent /*= nullptr*/) void BrowseButton::SetPathAndEmit(const QString& path) { - //only emit if path changes, except for ePropertyGeomCache. Old property control - if (path != m_path || m_propertyType == ePropertyGeomCache) + //only emit if path changes. Old property control + if (path != m_path) { m_path = path; emit PathChanged(m_path); @@ -78,21 +78,6 @@ private: // Filters for texture. selection = AssetSelectionModel::AssetGroupSelection("Texture"); } - else if (m_propertyType == ePropertyModel) - { - // Filters for models. - selection = AssetSelectionModel::AssetGroupSelection("Geometry"); - } - else if (m_propertyType == ePropertyGeomCache) - { - // Filters for geom caches. - selection = AssetSelectionModel::AssetTypeSelection("Geom Cache"); - } - else if (m_propertyType == ePropertyFile) - { - // Filters for files. - selection = AssetSelectionModel::AssetTypeSelection("File"); - } else { return; @@ -106,14 +91,7 @@ private: switch (m_propertyType) { case ePropertyTexture: - case ePropertyModel: newPath.replace("\\\\", "/"); - } - switch (m_propertyType) - { - case ePropertyTexture: - case ePropertyModel: - case ePropertyFile: if (newPath.size() > MAX_PATH) { newPath.resize(MAX_PATH); @@ -125,26 +103,51 @@ private: } }; -class ResourceSelectorButton +class AudioControlSelectorButton : public BrowseButton { public: - AZ_CLASS_ALLOCATOR(ResourceSelectorButton, AZ::SystemAllocator, 0); + AZ_CLASS_ALLOCATOR(AudioControlSelectorButton, AZ::SystemAllocator, 0); - ResourceSelectorButton(PropertyType type, QWidget* pParent = nullptr) + AudioControlSelectorButton(PropertyType type, QWidget* pParent = nullptr) : BrowseButton(type, pParent) { - setToolTip(tr("Select resource")); + setToolTip(tr("Select Audio Control")); } private: void OnClicked() override { - SResourceSelectorContext x; - x.parentWidget = this; - x.typeName = Prop::GetPropertyTypeToResourceType(m_propertyType); - QString newPath = GetIEditor()->GetResourceSelectorHost()->SelectResource(x, m_path); - SetPathAndEmit(newPath); + AZStd::string resourceResult; + auto ConvertLegacyAudioPropertyType = [](const PropertyType type) -> AzToolsFramework::AudioPropertyType + { + switch (type) + { + case ePropertyAudioTrigger: + return AzToolsFramework::AudioPropertyType::Trigger; + case ePropertyAudioRTPC: + return AzToolsFramework::AudioPropertyType::Rtpc; + case ePropertyAudioSwitch: + return AzToolsFramework::AudioPropertyType::Switch; + case ePropertyAudioSwitchState: + return AzToolsFramework::AudioPropertyType::SwitchState; + case ePropertyAudioEnvironment: + return AzToolsFramework::AudioPropertyType::Environment; + case ePropertyAudioPreloadRequest: + return AzToolsFramework::AudioPropertyType::Preload; + default: + return AzToolsFramework::AudioPropertyType::NumTypes; + } + }; + + auto propType = ConvertLegacyAudioPropertyType(m_propertyType); + if (propType != AzToolsFramework::AudioPropertyType::NumTypes) + { + AzToolsFramework::AudioControlSelectorRequestBus::EventResult( + resourceResult, propType, &AzToolsFramework::AudioControlSelectorRequestBus::Events::SelectResource, + AZStd::string_view{ m_path.toUtf8().constData() }); + SetPathAndEmit(QString{ resourceResult.c_str() }); + } } }; @@ -235,18 +238,13 @@ void FileResourceSelectorWidget::SetPropertyType(PropertyType type) AddButton(new TextureEditButton); m_previewToolTip.reset(new CBitmapToolTip); break; - case ePropertyModel: - case ePropertyGeomCache: case ePropertyAudioTrigger: case ePropertyAudioSwitch: case ePropertyAudioSwitchState: case ePropertyAudioRTPC: case ePropertyAudioEnvironment: case ePropertyAudioPreloadRequest: - AddButton(new ResourceSelectorButton(type)); - break; - case ePropertyFile: - AddButton(new FileBrowseButton(type)); + AddButton(new AudioControlSelectorButton(type)); break; default: break; diff --git a/Code/Editor/Controls/ReflectedPropertyControl/ReflectedPropertiesPanel.cpp b/Code/Editor/Controls/ReflectedPropertyControl/ReflectedPropertiesPanel.cpp deleted file mode 100644 index 8651db7e96..0000000000 --- a/Code/Editor/Controls/ReflectedPropertyControl/ReflectedPropertiesPanel.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -// Description : implementation file - -#include "EditorDefs.h" - -#include "ReflectedPropertiesPanel.h" - -///////////////////////////////////////////////////////////////////////////// -// ReflectedPropertiesPanel dialog - - -ReflectedPropertiesPanel::ReflectedPropertiesPanel(QWidget* pParent) - : ReflectedPropertyControl(pParent) -{ -} - -////////////////////////////////////////////////////////////////////////// -void ReflectedPropertiesPanel::DeleteVars() -{ - ClearVarBlock(); - m_updateCallbacks.clear(); - m_varBlock = nullptr; -} - -////////////////////////////////////////////////////////////////////////// -void ReflectedPropertiesPanel::SetVarBlock(class CVarBlock* vb, ReflectedPropertyControl::UpdateVarCallback* updCallback, const char* category) -{ - assert(vb); - - m_varBlock = vb; - - RemoveAllItems(); - m_varBlock = vb; - AddVarBlock(m_varBlock, category); - - SetUpdateCallback(AZStd::bind(&ReflectedPropertiesPanel::OnPropertyChanged, this, AZStd::placeholders::_1)); - - // When new object set all previous callbacks freed. - m_updateCallbacks.clear(); - if (updCallback) - { - stl::push_back_unique(m_updateCallbacks, updCallback); - } -} - -////////////////////////////////////////////////////////////////////////// -void ReflectedPropertiesPanel::AddVars(CVarBlock* vb, ReflectedPropertyControl::UpdateVarCallback* updCallback, const char* category) -{ - assert(vb); - - bool bNewBlock = false; - // Make a clone of properties. - if (!m_varBlock) - { - RemoveAllItems(); - m_varBlock = vb->Clone(true); - AddVarBlock(m_varBlock, category); - bNewBlock = true; - } - m_varBlock->Wire(vb); - - if (bNewBlock) - { - SetUpdateCallback(AZStd::bind(&ReflectedPropertiesPanel::OnPropertyChanged, this, AZStd::placeholders::_1)); - - // When new object set all previous callbacks freed. - m_updateCallbacks.clear(); - } - - if (updCallback) - { - stl::push_back_unique(m_updateCallbacks, updCallback); - } -} - -void ReflectedPropertiesPanel::OnPropertyChanged(IVariable* pVar) -{ - std::list::iterator iter; - for (iter = m_updateCallbacks.begin(); iter != m_updateCallbacks.end(); ++iter) - { - (*iter)->operator()(pVar); - } -} - - diff --git a/Code/Editor/Controls/ReflectedPropertyControl/ReflectedPropertiesPanel.h b/Code/Editor/Controls/ReflectedPropertyControl/ReflectedPropertiesPanel.h deleted file mode 100644 index cd551c63e2..0000000000 --- a/Code/Editor/Controls/ReflectedPropertyControl/ReflectedPropertiesPanel.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#ifndef CRYINCLUDE_EDITOR_REFLECTEDPROPERTIESPANEL_H -#define CRYINCLUDE_EDITOR_REFLECTEDPROPERTIESPANEL_H - -#pragma once - -#include "Controls/ReflectedPropertyControl/ReflectedPropertyCtrl.h" -#include "Util/Variable.h" - -///////////////////////////////////////////////////////////////////////////// -// ReflectedPropertiesPanel dialog - -AZ_PUSH_DISABLE_DLL_EXPORT_BASECLASS_WARNING -//This class is a port of ReflectedPropertiesPanel to use the ReflectedPropertyControl -class SANDBOX_API ReflectedPropertiesPanel - : public ReflectedPropertyControl -{ -AZ_POP_DISABLE_DLL_EXPORT_BASECLASS_WARNING -public: - ReflectedPropertiesPanel(QWidget* pParent = nullptr); // standard constructor - - void DeleteVars(); - void AddVars(class CVarBlock* vb, ReflectedPropertyControl::UpdateVarCallback* func = nullptr, const char* category = nullptr); - - void SetVarBlock(class CVarBlock* vb, ReflectedPropertyControl::UpdateVarCallback* func = nullptr, const char* category = nullptr); - -protected: - void OnPropertyChanged(IVariable* pVar); - -protected: - AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING - TSmartPtr m_varBlock; - - std::list m_updateCallbacks; - AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING -}; - - -#endif // CRYINCLUDE_EDITOR_REFLECTEDPROPERTIESPANEL_H diff --git a/Code/Editor/Controls/ReflectedPropertyControl/ReflectedPropertyCtrl.cpp b/Code/Editor/Controls/ReflectedPropertyControl/ReflectedPropertyCtrl.cpp index 1a7060aa8d..40ea71f577 100644 --- a/Code/Editor/Controls/ReflectedPropertyControl/ReflectedPropertyCtrl.cpp +++ b/Code/Editor/Controls/ReflectedPropertyControl/ReflectedPropertyCtrl.cpp @@ -203,7 +203,7 @@ void ReflectedPropertyControl::CreateItems(XmlNodeRef node, CVarBlockPtr& outBlo outBlockPtr = new CVarBlock; for (size_t i = 0, iGroupCount(node->getChildCount()); i < iGroupCount; ++i) { - XmlNodeRef groupNode = node->getChild(i); + XmlNodeRef groupNode = node->getChild(static_cast(i)); if (groupNode->haveAttr("hidden")) { @@ -308,7 +308,7 @@ void ReflectedPropertyControl::CreateItems(XmlNodeRef node, CVarBlockPtr& outBlo int nMin(0), nMax(0); if (child->getAttr("min", nMin) && child->getAttr("max", nMax)) { - intVar->SetLimits(nMin, nMax); + intVar->SetLimits(static_cast(nMin), static_cast(nMax)); } } else if (!azstricmp(type, "float")) @@ -560,7 +560,7 @@ void ReflectedPropertyControl::RequestPropertyContextMenu(AzToolsFramework::Inst // Popup Menu with Event selection. QMenu menu; - UINT i = 0; + unsigned int i = 0; const int ePPA_CustomItemBase = 10; // reserved from 10 to 99 const int ePPA_CustomPopupBase = 100; // reserved from 100 to x*100+100 where x is size of m_customPopupMenuPopups @@ -595,12 +595,12 @@ void ReflectedPropertyControl::RequestPropertyContextMenu(AzToolsFramework::Inst action->setData(ePPA_CustomItemBase + i); } - for (UINT j = 0; j < m_customPopupMenuPopups.size(); ++j) + for (unsigned int j = 0; j < m_customPopupMenuPopups.size(); ++j) { SCustomPopupMenu* pMenuInfo = &m_customPopupMenuPopups[j]; QMenu* pSubMenu = menu.addMenu(pMenuInfo->m_text); - for (UINT k = 0; k < pMenuInfo->m_subMenuText.size(); ++k) + for (UINT k = 0; k < static_cast(pMenuInfo->m_subMenuText.size()); ++k) { const UINT uID = ePPA_CustomPopupBase + ePPA_CustomPopupBase * j + k; QAction *action = pSubMenu->addAction(pMenuInfo->m_subMenuText[k]); diff --git a/Code/Editor/Controls/ReflectedPropertyControl/ReflectedPropertyItem.cpp b/Code/Editor/Controls/ReflectedPropertyControl/ReflectedPropertyItem.cpp index 5a9d61be42..af418c6e0d 100644 --- a/Code/Editor/Controls/ReflectedPropertyControl/ReflectedPropertyItem.cpp +++ b/Code/Editor/Controls/ReflectedPropertyControl/ReflectedPropertyItem.cpp @@ -172,8 +172,8 @@ ReflectedPropertyItem::ReflectedPropertyItem(ReflectedPropertyControl *control, if (parent) parent->AddChild(this); - m_onSetCallback = AZStd::bind(&ReflectedPropertyItem::OnVariableChange, this, AZStd::placeholders::_1); - m_onSetEnumCallback = AZStd::bind(&ReflectedPropertyItem::OnVariableEnumChange, this, AZStd::placeholders::_1); + m_onSetCallback = [this](IVariable* var) { OnVariableChange(var); }; + m_onSetEnumCallback = [this](IVariable* var) { OnVariableEnumChange(var); }; } ReflectedPropertyItem::~ReflectedPropertyItem() @@ -255,9 +255,6 @@ void ReflectedPropertyItem::SetVariable(IVariable *var) case ePropertySelection: m_reflectedVarAdapter = new ReflectedVarEnumAdapter; break; - case ePropertyAnimation: - m_reflectedVarAdapter = new ReflectedVarAnimationAdapter; - break; case ePropertyColor: m_reflectedVarAdapter = new ReflectedVarColorAdapter; break; @@ -265,7 +262,6 @@ void ReflectedPropertyItem::SetVariable(IVariable *var) m_reflectedVarAdapter = new ReflectedVarUserAdapter; break; case ePropertyEquip: - case ePropertyReverbPreset: case ePropertyGameToken: case ePropertyMissionObj: case ePropertySequence: @@ -276,15 +272,12 @@ void ReflectedPropertyItem::SetVariable(IVariable *var) m_reflectedVarAdapter = new ReflectedVarGenericPropertyAdapter(desc.m_type); break; case ePropertyTexture: - case ePropertyModel: - case ePropertyGeomCache: case ePropertyAudioTrigger: case ePropertyAudioSwitch: case ePropertyAudioSwitchState: case ePropertyAudioRTPC: case ePropertyAudioEnvironment: case ePropertyAudioPreloadRequest: - case ePropertyFile: m_reflectedVarAdapter = new ReflectedVarResourceAdapter; break; case ePropertyFloatCurve: @@ -569,7 +562,6 @@ void ReflectedPropertyItem::SetValue(const QString& sValue, bool bRecordUndo, bo break; case ePropertyTexture: - case ePropertyModel: value.replace('\\', '/'); break; } @@ -578,8 +570,6 @@ void ReflectedPropertyItem::SetValue(const QString& sValue, bool bRecordUndo, bo switch (m_type) { case ePropertyTexture: - case ePropertyModel: - case ePropertyFile: if (value.length() >= MAX_PATH) { value = value.left(MAX_PATH); diff --git a/Code/Editor/Controls/ReflectedPropertyControl/ReflectedVar.cpp b/Code/Editor/Controls/ReflectedPropertyControl/ReflectedVar.cpp index 5b9c5b8063..263c17a8bb 100644 --- a/Code/Editor/Controls/ReflectedPropertyControl/ReflectedVar.cpp +++ b/Code/Editor/Controls/ReflectedPropertyControl/ReflectedVar.cpp @@ -31,12 +31,6 @@ void ReflectedVarInit::setupReflection(AZ::SerializeContext* serializeContext) ->Field("description", &CReflectedVar::m_description) ->Field("varName", &CReflectedVar::m_varName); - serializeContext->Class () - ->Version(1) - ->Field("animation", &CReflectedVarAnimation::m_animation) - ->Field("entityID", &CReflectedVarAnimation::m_entityID) - ; - serializeContext->Class () ->Version(1) ->Field("path", &CReflectedVarResource::m_path) @@ -76,12 +70,6 @@ void ReflectedVarInit::setupReflection(AZ::SerializeContext* serializeContext) AZ::EditContext* ec = serializeContext->GetEditContext(); if (ec) { - ec->Class< CReflectedVarAnimation >("VarAnimation", "Animation") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::NameLabelOverride, &CReflectedVarAnimation::varName) - ->Attribute(AZ::Edit::Attributes::DescriptionTextOverride, &CReflectedVarAnimation::description) - ; - ec->Class< CReflectedVarResource >("VarResource", "Resource") ->ClassElement(AZ::Edit::ClassElements::EditorData, "") ->Attribute(AZ::Edit::Attributes::NameLabelOverride, &CReflectedVarResource::varName) @@ -284,8 +272,6 @@ AZ::u32 CReflectedVarGenericProperty::handler() return AZ_CRC("ePropertyShader", 0xc40932f1); case ePropertyEquip: return AZ_CRC("ePropertyEquip", 0x66ffd290); - case ePropertyReverbPreset: - return AZ_CRC("ePropertyReverbPreset", 0x51469f38); case ePropertyDeprecated0: return AZ_CRC("ePropertyCustomAction", 0x4ffa5ba5); case ePropertyGameToken: diff --git a/Code/Editor/Controls/ReflectedPropertyControl/ReflectedVar.h b/Code/Editor/Controls/ReflectedPropertyControl/ReflectedVar.h index 634f2efd3a..a15f8326d1 100644 --- a/Code/Editor/Controls/ReflectedPropertyControl/ReflectedVar.h +++ b/Code/Editor/Controls/ReflectedPropertyControl/ReflectedVar.h @@ -265,32 +265,8 @@ public: AZ::Vector3 m_color; }; -//Class to hold ePropertyAnimation (IVariable::DT_ANIMATION ) -class CReflectedVarAnimation - : public CReflectedVar -{ -public: - AZ_RTTI(CReflectedVarAnimation, "{635D982E-23EC-463F-8F33-4FC2C19D5673}", CReflectedVar) - - CReflectedVarAnimation(const AZStd::string& name) - : CReflectedVar(name) - , m_entityID(0) - {} - CReflectedVarAnimation() - : m_entityID(0){} - - AZStd::string varName() const { return m_varName; } - AZStd::string description() const { return m_description; } - - AZStd::string m_animation; - AZ::EntityId m_entityID; -}; - //Class to hold: // ePropertyTexture (IVariable::DT_TEXTURE) -// ePropertyMaterial (IVariable::DT_MATERIAL) -// ePropertyModel (IVariable::DT_OBJECT) -// ePropertyGeomCache (IVariable::DT_GEOM_CACHE) // ePropertyAudioTrigger (IVariable::DT_AUDIO_TRIGGER) // ePropertyAudioSwitch (IVariable::DT_AUDIO_SWITCH ) // ePropertyAudioSwitchState (IVariable::DT_AUDIO_SWITCH_STATE) @@ -344,7 +320,6 @@ public: AZStd::vector m_itemDescriptions; }; -//Class to hold ePropertyAnimation (IVariable::DT_ANIMATION ) class CReflectedVarSpline : public CReflectedVar { diff --git a/Code/Editor/Controls/ReflectedPropertyControl/ReflectedVarWrapper.cpp b/Code/Editor/Controls/ReflectedPropertyControl/ReflectedVarWrapper.cpp index 5639fa95b0..b3f1b35461 100644 --- a/Code/Editor/Controls/ReflectedPropertyControl/ReflectedVarWrapper.cpp +++ b/Code/Editor/Controls/ReflectedPropertyControl/ReflectedVarWrapper.cpp @@ -39,20 +39,20 @@ namespace { hardMin = desc.m_bHardMin; hardMax = desc.m_bHardMax; } - reflectedVar->m_softMinVal = min; - reflectedVar->m_softMaxVal = max; + reflectedVar->m_softMinVal = static_cast(min); + reflectedVar->m_softMaxVal = static_cast(max); if (hardMin) { - reflectedVar->m_minVal = min; + reflectedVar->m_minVal = static_cast(min); } else { - reflectedVar->m_minVal = std::numeric_limits::lowest(); + reflectedVar->m_minVal = std::numeric_limits::lowest(); } if (hardMax) { - reflectedVar->m_maxVal = max; + reflectedVar->m_maxVal = static_cast(max); } else { @@ -64,9 +64,9 @@ namespace { ../Code/Editor/Controls/ReflectedPropertyControl/ReflectedVarWrapper.cpp:59:38: error: implicit conversion from 'int' to 'float' changes value from 2147483647 to 2147483648 [-Werror,-Wimplicit-int-float-conversion] reflectedVar->m_maxVal = std::numeric_limits::max(); */ - reflectedVar->m_maxVal = static_cast(std::numeric_limits::max()); + reflectedVar->m_maxVal = static_cast(std::numeric_limits::max()); } - reflectedVar->m_stepSize = step; + reflectedVar->m_stepSize = static_cast(step); } } @@ -95,9 +95,9 @@ void ReflectedVarIntAdapter::SyncReflectedVarToIVar(IVariable *pVariable) { int intValue; pVariable->Get(intValue); - value = intValue; + value = static_cast(intValue); } - m_reflectedVar->m_value = std::round(value * m_valueMultiplier); + m_reflectedVar->m_value = static_cast(std::round(value * m_valueMultiplier)); } void ReflectedVarIntAdapter::SyncIVarToReflectedVar(IVariable *pVariable) @@ -362,14 +362,14 @@ void ReflectedVarColorAdapter::SyncReflectedVarToIVar(IVariable *pVariable) Vec3 v(0, 0, 0); pVariable->Get(v); const QColor col = ColorLinearToGamma(ColorF(v.x, v.y, v.z)); - m_reflectedVar->m_color.Set(col.redF(), col.greenF(), col.blueF()); + m_reflectedVar->m_color.Set(static_cast(col.redF()), static_cast(col.greenF()), static_cast(col.blueF())); } else { int col(0); pVariable->Get(col); const QColor qcolor = ColorToQColor((uint32)col); - m_reflectedVar->m_color.Set(qcolor.redF(), qcolor.greenF(), qcolor.blueF()); + m_reflectedVar->m_color.Set(static_cast(qcolor.redF()), static_cast(qcolor.greenF()), static_cast(qcolor.blueF())); } } @@ -382,9 +382,9 @@ void ReflectedVarColorAdapter::SyncIVarToReflectedVar(IVariable *pVariable) } else { - int ir = m_reflectedVar->m_color.GetX() * 255.0f; - int ig = m_reflectedVar->m_color.GetY() * 255.0f; - int ib = m_reflectedVar->m_color.GetZ() * 255.0f; + int ir = static_cast(m_reflectedVar->m_color.GetX() * 255.0f); + int ig = static_cast(m_reflectedVar->m_color.GetY() * 255.0f); + int ib = static_cast(m_reflectedVar->m_color.GetZ() * 255.0f); pVariable->Set(static_cast(RGB(ir, ig, ib))); } @@ -392,25 +392,6 @@ void ReflectedVarColorAdapter::SyncIVarToReflectedVar(IVariable *pVariable) -void ReflectedVarAnimationAdapter::SetVariable(IVariable *pVariable) -{ - m_reflectedVar.reset(new CReflectedVarAnimation(pVariable->GetHumanName().toUtf8().data())); - m_reflectedVar->m_description = pVariable->GetDescription().toUtf8().data(); -} - -void ReflectedVarAnimationAdapter::SyncReflectedVarToIVar(IVariable *pVariable) -{ - m_reflectedVar->m_entityID = static_cast(pVariable->GetUserData().value()); - m_reflectedVar->m_animation = pVariable->GetDisplayValue().toUtf8().data(); -} - -void ReflectedVarAnimationAdapter::SyncIVarToReflectedVar(IVariable *pVariable) -{ - pVariable->SetUserData(static_cast(m_reflectedVar->m_entityID)); - pVariable->SetDisplayValue(m_reflectedVar->m_animation.c_str()); - -} - void ReflectedVarResourceAdapter::SetVariable(IVariable *pVariable) { m_reflectedVar.reset(new CReflectedVarResource(pVariable->GetHumanName().toUtf8().data())); @@ -429,7 +410,7 @@ void ReflectedVarResourceAdapter::SyncReflectedVarToIVar(IVariable *pVariable) void ReflectedVarResourceAdapter::SyncIVarToReflectedVar(IVariable *pVariable) { - const bool bForceModified = (m_reflectedVar->m_propertyType == ePropertyGeomCache); + const bool bForceModified = false; pVariable->SetForceModified(bForceModified); pVariable->SetDisplayValue(m_reflectedVar->m_path.c_str()); diff --git a/Code/Editor/Controls/ReflectedPropertyControl/ReflectedVarWrapper.h b/Code/Editor/Controls/ReflectedPropertyControl/ReflectedVarWrapper.h index 07bb72413a..9c49f1ae1a 100644 --- a/Code/Editor/Controls/ReflectedPropertyControl/ReflectedVarWrapper.h +++ b/Code/Editor/Controls/ReflectedPropertyControl/ReflectedVarWrapper.h @@ -218,20 +218,6 @@ AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING }; -class EDITOR_CORE_API ReflectedVarAnimationAdapter - : public ReflectedVarAdapter -{ -public: - void SetVariable(IVariable* pVariable) override; - void SyncReflectedVarToIVar(IVariable* pVariable) override; - void SyncIVarToReflectedVar(IVariable* pVariable) override; - CReflectedVar* GetReflectedVar() override { return m_reflectedVar.data(); } -private: -AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING - QScopedPointer m_reflectedVar; -AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING -}; - class EDITOR_CORE_API ReflectedVarResourceAdapter : public ReflectedVarAdapter { diff --git a/Code/Editor/Controls/SplineCtrl.cpp b/Code/Editor/Controls/SplineCtrl.cpp index d66fc16ade..73264274b7 100644 --- a/Code/Editor/Controls/SplineCtrl.cpp +++ b/Code/Editor/Controls/SplineCtrl.cpp @@ -86,13 +86,13 @@ QPoint CSplineCtrl::KeyToPoint(int nKey) QPoint CSplineCtrl::TimeToPoint(float time) { QPoint point; - point.setX((time - m_fMinTime) * (m_rcSpline.width() / (m_fMaxTime - m_fMinTime)) + m_rcSpline.left()); + point.setX(static_cast((time - m_fMinTime) * (m_rcSpline.width() / (m_fMaxTime - m_fMinTime)) + m_rcSpline.left())); float val = 0; if (m_pSpline) { m_pSpline->InterpolateFloat(time, val); } - point.setY((floor((m_fMaxValue - val) * (m_rcSpline.height() / (m_fMaxValue - m_fMinValue)) + 0.5f) + m_rcSpline.top())); + point.setY(static_cast((floor((m_fMaxValue - val) * (m_rcSpline.height() / (m_fMaxValue - m_fMinValue)) + 0.5f) + m_rcSpline.top()))); return point; } @@ -101,7 +101,7 @@ void CSplineCtrl::PointToTimeValue(const QPoint& point, float& time, float& valu { time = XOfsToTime(point.x()); float t = float(m_rcSpline.bottom() - point.y()) / m_rcSpline.height(); - value = LERP(m_fMinValue, m_fMaxValue, t); + value = AZ::Lerp(m_fMinValue, m_fMaxValue, t); } ////////////////////////////////////////////////////////////////////////// @@ -109,7 +109,7 @@ float CSplineCtrl::XOfsToTime(int x) { // m_fMinTime to m_fMaxTime time range. float t = float(x - m_rcSpline.left()) / m_rcSpline.width(); - return LERP(m_fMinTime, m_fMaxTime, t); + return AZ::Lerp(m_fMinTime, m_fMaxTime, t); } ////////////////////////////////////////////////////////////////////////// @@ -123,8 +123,6 @@ void CSplineCtrl::paintEvent(QPaintEvent* event) { QPainter painter(this); - QRect rcClient = rect(); - if (m_pSpline) { m_bSelectedKeys.resize(m_pSpline->GetKeyCount()); diff --git a/Code/Editor/Controls/SplineCtrlEx.cpp b/Code/Editor/Controls/SplineCtrlEx.cpp index 36a9d8afef..9e0a954c79 100644 --- a/Code/Editor/Controls/SplineCtrlEx.cpp +++ b/Code/Editor/Controls/SplineCtrlEx.cpp @@ -127,7 +127,7 @@ private: std::vector keySelectionFlags; _smart_ptr undo; _smart_ptr redo; - string id; + AZStd::string id; ISplineInterpolator* pSpline; }; @@ -641,7 +641,7 @@ QPoint AbstractSplineWidget::TimeToPoint(float time, ISplineInterpolator* pSplin ////////////////////////////////////////////////////////////////////////// float AbstractSplineWidget::TimeToXOfs(float x) { - return WorldToClient(Vec2(float(x), 0.0f)).x(); + return static_cast(WorldToClient(Vec2(float(x), 0.0f)).x()); } ////////////////////////////////////////////////////////////////////////// @@ -819,8 +819,6 @@ void SplineWidget::DrawSpline(QPainter* painter, SSplineInfo& splineInfo, float { const QPen pOldPen = painter->pen(); - const QRect rcClip = painter->clipBoundingRect().intersected(m_rcSpline).toRect(); - ////////////////////////////////////////////////////////////////////////// ISplineInterpolator* pSpline = splineInfo.pSpline; ISplineInterpolator* pDetailSpline = splineInfo.pDetailSpline; @@ -832,8 +830,8 @@ void SplineWidget::DrawSpline(QPainter* painter, SSplineInfo& splineInfo, float int nTotalNumberOfDimensions(0); int nCurrentDimension(0); - int left = TimeToXOfs(startTime);//rcClip.left; - int right = TimeToXOfs(endTime);//rcClip.right; + int left = static_cast(TimeToXOfs(startTime));//rcClip.left; + int right = static_cast(TimeToXOfs(endTime));//rcClip.right; QPoint p0 = TimeToPoint(pSpline->GetKeyTime(0), pSpline); QPoint p1 = TimeToPoint(pSpline->GetKeyTime(pSpline->GetKeyCount() - 1), pSpline); @@ -898,7 +896,7 @@ void SplineWidget::DrawSpline(QPainter* painter, SSplineInfo& splineInfo, float if ((x == right && pointsInLine >= 0) || (pointsInLine > 0 && fabs(lineStart.y() + gradient * (pt.x() - lineStart.x()) - pt.y()) > 1.0f)) { - lineStart = QPoint(pt.x() - 1, lineStart.y() + gradient * (pt.x() - 1 - lineStart.x())); + lineStart = QPoint(pt.x() - 1, static_cast(lineStart.y() + gradient * (pt.x() - 1 - lineStart.x()))); path.lineTo(lineStart); gradient = float(pt.y() - lineStart.y()) / (pt.x() - lineStart.x()); pointsInLine = 1; @@ -1063,7 +1061,7 @@ void SplineWidget::DrawTimeMarker(QPainter* painter) float x = TimeToXOfs(m_fTimeMarker); if (x >= m_rcSpline.left() && x <= m_rcSpline.right() + 1) { - painter->drawLine(x, m_rcSpline.top(), x, m_rcSpline.bottom() + 1); + painter->drawLine(static_cast(x), m_rcSpline.top(), static_cast(x), m_rcSpline.bottom() + 1); } painter->setPen(pOldPen); } @@ -1583,7 +1581,7 @@ bool AbstractSplineWidget::IsKeySelected(ISplineInterpolator* pSpline, int nKey, int AbstractSplineWidget::GetNumSelected() { int nSelected = 0; - for (int splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex) + for (size_t splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex) { if (ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline) { @@ -1818,7 +1816,7 @@ AbstractSplineWidget::EHitCode AbstractSplineWidget::HitTest(const QPoint& point } // For each Spline... - for (int splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex) + for (size_t splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex) { ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline; ISplineInterpolator* pDetailSpline = m_splines[splineIndex].pDetailSpline; @@ -1856,7 +1854,7 @@ AbstractSplineWidget::EHitCode AbstractSplineWidget::HitTest(const QPoint& point // Check tangent handles first. { QPoint incomingHandlePt, outgoingHandlePt, pt; - if (GetTangentHandlePts(incomingHandlePt, pt, outgoingHandlePt, splineIndex, i, nCurrentDimension)) + if (GetTangentHandlePts(incomingHandlePt, pt, outgoingHandlePt, static_cast(splineIndex), static_cast(i), nCurrentDimension)) { // For the incoming handle if (abs(incomingHandlePt.x() - point.x()) < 4 && abs(incomingHandlePt.y() - point.y()) < 4) @@ -1973,7 +1971,7 @@ void AbstractSplineWidget::ScaleAmplitudeKeys(float time, float startValue, floa m_nHitKeyIndex = -1; m_nHitDimension = -1; - for (int splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex) + for (size_t splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex) { ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline; @@ -2077,7 +2075,7 @@ void AbstractSplineWidget::TimeScaleKeys(float time, float startTime, float endT float affectedRangeMin = FLT_MAX; float affectedRangeMax = -FLT_MAX; - for (int splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex) + for (size_t splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex) { ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline; @@ -2145,8 +2143,8 @@ void AbstractSplineWidget::TimeScaleKeys(float time, float startTime, float endT } } - int rangeMin = TimeToXOfs(affectedRangeMin); - int rangeMax = TimeToXOfs(affectedRangeMax); + int rangeMin = static_cast(TimeToXOfs(affectedRangeMin)); + int rangeMax = static_cast(TimeToXOfs(affectedRangeMax)); if (m_timeRange.start == affectedRangeMin) { @@ -2184,7 +2182,7 @@ void AbstractSplineWidget::ValueScaleKeys(float startValue, float endValue) m_nHitKeyIndex = -1; m_nHitDimension = -1; - for (int splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex) + for (size_t splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex) { ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline; @@ -2223,7 +2221,7 @@ void AbstractSplineWidget::MoveSelectedKeys(Vec2 offset, bool copyKeys) } // For each spline... - for (int splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex) + for (size_t splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex) { ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline; @@ -2298,7 +2296,7 @@ void AbstractSplineWidget::RemoveSelectedKeys() m_pHitDetailSpline = nullptr; m_nHitKeyIndex = -1; - for (int splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex) + for (size_t splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex) { ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline; @@ -2338,7 +2336,7 @@ void AbstractSplineWidget::RemoveSelectedKeyTimesImpl() StoreUndo(); SendNotifyEvent(SPLN_BEFORE_CHANGE); - for (int splineIndex = 0, end = m_splines.size(); splineIndex < end; ++splineIndex) + for (size_t splineIndex = 0, end = m_splines.size(); splineIndex < end; ++splineIndex) { std::vector::iterator itTime = m_keyTimes.begin(), endTime = m_keyTimes.end(); for (int keyIndex = 0, endIndex = m_splines[splineIndex].pSpline->GetKeyCount(); keyIndex < endIndex; ) @@ -2376,9 +2374,9 @@ void AbstractSplineWidget::RedrawWindowAroundMarker() { UpdateKeyTimes(); std::vector::iterator itKeyTime = std::lower_bound(m_keyTimes.begin(), m_keyTimes.end(), KeyTime(m_fTimeMarker, 0)); - int keyTimeIndex = (itKeyTime != m_keyTimes.end() ? itKeyTime - m_keyTimes.begin() : m_keyTimes.size()); - int redrawRangeStart = (keyTimeIndex >= 2 ? TimeToXOfs(m_keyTimes[keyTimeIndex - 2].time) : m_rcSpline.left()); - int redrawRangeEnd = (keyTimeIndex < int(m_keyTimes.size()) - 2 ? TimeToXOfs(m_keyTimes[keyTimeIndex + 2].time) : m_rcSpline.right() + 1); + size_t keyTimeIndex = (itKeyTime != m_keyTimes.end() ? itKeyTime - m_keyTimes.begin() : m_keyTimes.size()); + int redrawRangeStart = (keyTimeIndex >= 2 ? static_cast(TimeToXOfs(m_keyTimes[keyTimeIndex - 2].time)) : m_rcSpline.left()); + int redrawRangeEnd = (keyTimeIndex < m_keyTimes.size() - 2 ? static_cast(TimeToXOfs(m_keyTimes[keyTimeIndex + 2].time)) : m_rcSpline.right() + 1); QRect rc(QPoint(redrawRangeStart, m_rcSpline.top()), QPoint(redrawRangeEnd, m_rcSpline.bottom() + 1) - QPoint(1, 1)); rc = rc.normalized().intersected(m_rcSpline); @@ -2478,7 +2476,7 @@ void AbstractSplineWidget::ClearSelection() { ConditionalStoreUndo(); - for (int splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex) + for (size_t splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex) { ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline; @@ -2521,7 +2519,7 @@ void AbstractSplineWidget::StoreUndo() if (CUndo::IsRecording() && !m_pCurrentUndo) { std::vector splines(m_splines.size()); - for (int splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex) + for (size_t splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex) { splines[splineIndex] = m_splines[splineIndex].pSpline; } @@ -2564,7 +2562,7 @@ void AbstractSplineWidget::DuplicateSelectedKeys() using KeysToAddContainer = std::vector; KeysToAddContainer keysToInsert; - for (int splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex) + for (size_t splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex) { ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline; @@ -2664,7 +2662,7 @@ void AbstractSplineWidget::KeyAll() ////////////////////////////////////////////////////////////////////////// void AbstractSplineWidget::SelectAll() { - for (int splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex) + for (size_t splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex) { ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline; @@ -2815,7 +2813,7 @@ void AbstractSplineWidget::SelectRectangle(const QRect& rc, bool bSelect) { std::swap(t0, t1); } - for (int splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex) + for (size_t splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex) { ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline; ISplineInterpolator* pDetailSpline = m_splines[splineIndex].pDetailSpline; @@ -3031,7 +3029,7 @@ void AbstractSplineWidget::ModifySelectedKeysFlags(int nRemoveFlags, int nAddFla SendNotifyEvent(SPLN_BEFORE_CHANGE); - for (int splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex) + for (size_t splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex) { ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline; @@ -3188,7 +3186,7 @@ void AbstractSplineWidget::GotoNextKey(bool previousKey) { bool boFoundTheSelectedKey(false); - for (int splineIndex = 0, endSpline = m_splines.size(); splineIndex < endSpline; ++splineIndex) + for (size_t splineIndex = 0, endSpline = m_splines.size(); splineIndex < endSpline; ++splineIndex) { ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline; for (int i = 0; i < pSpline->GetKeyCount(); i++) @@ -3230,7 +3228,7 @@ void AbstractSplineWidget::GotoNextKey(bool previousKey) } else { - for (int splineIndex = 0, endSpline = m_splines.size(); splineIndex < endSpline; ++splineIndex) + for (size_t splineIndex = 0, endSpline = m_splines.size(); splineIndex < endSpline; ++splineIndex) { ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline; @@ -3281,7 +3279,7 @@ void AbstractSplineWidget::RemoveAllKeysButThis() { std::vector keys; - for (int splineIndex = 0, endSpline = m_splines.size(); splineIndex < endSpline; ++splineIndex) + for (size_t splineIndex = 0, endSpline = m_splines.size(); splineIndex < endSpline; ++splineIndex) { ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline; diff --git a/Code/Editor/Controls/SplineCtrlEx.h b/Code/Editor/Controls/SplineCtrlEx.h index 8592febf88..711cbcf8d4 100644 --- a/Code/Editor/Controls/SplineCtrlEx.h +++ b/Code/Editor/Controls/SplineCtrlEx.h @@ -53,8 +53,8 @@ class QRubberBand; class ISplineSet { public: - virtual ISplineInterpolator* GetSplineFromID(const string& id) = 0; - virtual string GetIDFromSpline(ISplineInterpolator* pSpline) = 0; + virtual ISplineInterpolator* GetSplineFromID(const AZStd::string& id) = 0; + virtual AZStd::string GetIDFromSpline(ISplineInterpolator* pSpline) = 0; virtual int GetSplineCount() const = 0; virtual int GetKeyCountAtTime(float time, float threshold) const = 0; }; @@ -98,7 +98,7 @@ public: void AddSpline(ISplineInterpolator * pSpline, ISplineInterpolator * pDetailSpline, QColor anColorArray[4]); void RemoveSpline(ISplineInterpolator* pSpline); void RemoveAllSplines(); - int GetSplineCount() const { return m_splines.size(); } + int GetSplineCount() const { return static_cast(m_splines.size()); } ISplineInterpolator* GetSpline(int nIndex) const { return m_splines[nIndex].pSpline; } void SetTimeMarker(float fTime); diff --git a/Code/Editor/Controls/TextEditorCtrl.cpp b/Code/Editor/Controls/TextEditorCtrl.cpp index 5961c9d9a3..c372138d80 100644 --- a/Code/Editor/Controls/TextEditorCtrl.cpp +++ b/Code/Editor/Controls/TextEditorCtrl.cpp @@ -53,7 +53,7 @@ void CTextEditorCtrl::LoadFile(const QString& sFileName) size_t length = file.GetLength(); QByteArray text; - text.resize(length); + text.resize(static_cast(length)); file.ReadRaw(text.data(), length); setPlainText(text); diff --git a/Code/Editor/Controls/TimelineCtrl.cpp b/Code/Editor/Controls/TimelineCtrl.cpp index a5a941fc78..aa30c326ac 100644 --- a/Code/Editor/Controls/TimelineCtrl.cpp +++ b/Code/Editor/Controls/TimelineCtrl.cpp @@ -18,16 +18,11 @@ #include "ScopedVariableSetter.h" #include "GridUtils.h" - -static const QColor timeMarkerCol = QColor(255, 0, 255); -static const QColor textCol = QColor(0, 0, 0); -static const QColor ltgrayCol = QColor(110, 110, 110); - QColor InterpolateColor(const QColor& c1, const QColor& c2, float fraction) { - const int r = (c2.red() - c1.red()) * fraction + c1.red(); - const int g = (c2.green() - c1.green()) * fraction + c1.green(); - const int b = (c2.blue() - c1.blue()) * fraction + c1.blue(); + const int r = static_cast(static_cast(c2.red() - c1.red()) * fraction + c1.red()); + const int g = static_cast(static_cast(c2.green() - c1.green()) * fraction + c1.green()); + const int b = static_cast(static_cast(c2.blue() - c1.blue()) * fraction + c1.blue()); return QColor(r, g, b); } @@ -120,7 +115,7 @@ float TimelineWidget::SnapTime(float time) { double t = floor((double)time * m_ticksStep + 0.5); t = t / m_ticksStep; - return t; + return static_cast(t); } ////////////////////////////////////////////////////////////////////////// @@ -153,10 +148,10 @@ void TimelineWidget::DrawTicks(QPainter* painter) painter->setPen(redpen); int x = TimeToClient(m_fTimeMarker); painter->setBrush(Qt::NoBrush); - painter->drawRect(QRect(QPoint(x - 3, rc.top()), QPoint(x + 2, rc.bottom()))); + painter->drawRect(QRect(QPoint(x - 3, static_cast(rc.top())), QPoint(x + 2, static_cast(rc.bottom())))); painter->setPen(redpen); - painter->drawLine(x, rc.top(), x, rc.bottom()); + painter->drawLine(x, static_cast(rc.top()), x, static_cast(rc.bottom())); painter->setBrush(Qt::NoBrush); // Draw vertical line showing current time. @@ -190,7 +185,7 @@ void TimelineWidget::DrawTicks(QPainter* painter) float keyTime = (m_pKeyTimeSet ? m_pKeyTimeSet->GetKeyTime(keyTimeIndex) : 0.0f); int x2 = TimeToClient(keyTime); - painter->drawRect(QRect(QPoint(x2 - 1, rc.top()), QPoint(x2 + 2, rc.bottom()))); + painter->drawRect(QRect(QPoint(x2 - 1, static_cast(rc.top())), QPoint(x2 + 2, static_cast(rc.bottom())))); } painter->setPen(pOldPen); diff --git a/Code/Editor/Controls/TimelineCtrl.h b/Code/Editor/Controls/TimelineCtrl.h index 015704460a..f87bdf3410 100644 --- a/Code/Editor/Controls/TimelineCtrl.h +++ b/Code/Editor/Controls/TimelineCtrl.h @@ -136,7 +136,6 @@ protected: void DrawFrameTicks(QPainter* dc); private: - bool m_bAutoDelete; QRect m_rcClient; QRect m_rcTimeline; float m_fTimeMarker; diff --git a/Code/Editor/Controls/WndGridHelper.h b/Code/Editor/Controls/WndGridHelper.h index 158ffca508..e983c69192 100644 --- a/Code/Editor/Controls/WndGridHelper.h +++ b/Code/Editor/Controls/WndGridHelper.h @@ -14,6 +14,7 @@ #include #include #include "Cry_Vector2.h" +#include ////////////////////////////////////////////////////////////////////////// class CWndGridHelper @@ -81,8 +82,6 @@ public: newzoom.y = 0.01f; } - Vec2 prevz = zoom; - // Zoom to mouse position. float ofsx = origin.x; float ofsy = origin.y; diff --git a/Code/Editor/Core/LevelEditorMenuHandler.cpp b/Code/Editor/Core/LevelEditorMenuHandler.cpp index 3724993604..e568f05167 100644 --- a/Code/Editor/Core/LevelEditorMenuHandler.cpp +++ b/Code/Editor/Core/LevelEditorMenuHandler.cpp @@ -41,8 +41,6 @@ using namespace AZ; using namespace AzToolsFramework; static const char* const s_LUAEditorName = "Lua Editor"; -static const char* const s_shortTimeInterval = "debug"; -static const char* const s_assetImporterMetricsIdentifier = "AssetImporter"; // top level menu ids static const char* const s_fileMenuId = "FileMenu"; @@ -50,7 +48,6 @@ static const char* const s_editMenuId = "EditMenu"; static const char* const s_gameMenuId = "GameMenu"; static const char* const s_toolMenuId = "ToolMenu"; static const char* const s_viewMenuId = "ViewMenu"; -static const char* const s_awsMenuId = "AwsMenu"; static const char* const s_helpMenuId = "HelpMenu"; static bool CompareLayoutNames(const QString& name1, const QString& name2) @@ -157,13 +154,11 @@ namespace } } -LevelEditorMenuHandler::LevelEditorMenuHandler( - MainWindow* mainWindow, QtViewPaneManager* const viewPaneManager, QSettings& settings) +LevelEditorMenuHandler::LevelEditorMenuHandler(MainWindow* mainWindow, QtViewPaneManager* const viewPaneManager) : QObject(mainWindow) , m_mainWindow(mainWindow) , m_viewPaneManager(viewPaneManager) , m_actionManager(mainWindow->GetActionManager()) - , m_settings(settings) { #if defined(AZ_PLATFORM_MAC) // Hide the non-native toolbar, then setNativeMenuBar to ensure it is always visible on macOS. diff --git a/Code/Editor/Core/LevelEditorMenuHandler.h b/Code/Editor/Core/LevelEditorMenuHandler.h index 4cf1569c59..5ac8e63786 100644 --- a/Code/Editor/Core/LevelEditorMenuHandler.h +++ b/Code/Editor/Core/LevelEditorMenuHandler.h @@ -33,7 +33,7 @@ class LevelEditorMenuHandler { Q_OBJECT public: - LevelEditorMenuHandler(MainWindow* mainWindow, QtViewPaneManager* const viewPaneManager, QSettings& settings); + LevelEditorMenuHandler(MainWindow* mainWindow, QtViewPaneManager* const viewPaneManager); ~LevelEditorMenuHandler(); void Initialize(); @@ -106,7 +106,6 @@ private: ActionManager::MenuWrapper m_toolsMenu; QMenu* m_mostRecentLevelsMenu = nullptr; - QMenu* m_mostRecentProjectsMenu = nullptr; QMenu* m_editmenu = nullptr; ActionManager::MenuWrapper m_viewPanesMenu; @@ -117,7 +116,6 @@ private: int m_viewPaneVersion = 0; QList m_topLevelMenus; - QSettings& m_settings; }; #endif // LEVELEDITORMENUHANDLER_H diff --git a/Code/Editor/Core/QtEditorApplication.cpp b/Code/Editor/Core/QtEditorApplication.cpp index 0776a96a4d..a4aab24be4 100644 --- a/Code/Editor/Core/QtEditorApplication.cpp +++ b/Code/Editor/Core/QtEditorApplication.cpp @@ -206,11 +206,8 @@ namespace static void LogToDebug([[maybe_unused]] QtMsgType Type, [[maybe_unused]] const QMessageLogContext& Context, const QString& message) { -#if defined(WIN32) || defined(WIN64) - OutputDebugStringW(L"Qt: "); - OutputDebugStringW(reinterpret_cast(message.utf16())); - OutputDebugStringW(L"\n"); -#endif + AZ::Debug::Platform::OutputToDebugger("Qt", message.toUtf8().data()); + AZ::Debug::Platform::OutputToDebugger(nullptr, "\n"); } } @@ -428,7 +425,7 @@ namespace Editor AZStd::array rawInputBytesArray; LPBYTE rawInputBytes = rawInputBytesArray.data(); - const UINT bytesCopied = GetRawInputData((HRAWINPUT)msg->lParam, RID_INPUT, rawInputBytes, &rawInputSize, rawInputHeaderSize); + [[maybe_unused]] const UINT bytesCopied = GetRawInputData((HRAWINPUT)msg->lParam, RID_INPUT, rawInputBytes, &rawInputSize, rawInputHeaderSize); CRY_ASSERT(bytesCopied == rawInputSize); RAWINPUT* rawInput = (RAWINPUT*)rawInputBytes; diff --git a/Code/Editor/Core/Tests/test_Main.cpp b/Code/Editor/Core/Tests/test_Main.cpp index 6acedb6e57..3d3e286f18 100644 --- a/Code/Editor/Core/Tests/test_Main.cpp +++ b/Code/Editor/Core/Tests/test_Main.cpp @@ -52,7 +52,7 @@ protected: } private: - AZ::AllocatorScope m_allocatorScope; + AZ::AllocatorScope m_allocatorScope; SSystemGlobalEnvironment m_stubEnv; AZ::IO::LocalFileIO m_fileIO; NiceMock* m_cryPak; diff --git a/Code/Editor/CrtDebug.cpp b/Code/Editor/CrtDebug.cpp index a37b3d26e9..f9335373da 100644 --- a/Code/Editor/CrtDebug.cpp +++ b/Code/Editor/CrtDebug.cpp @@ -62,7 +62,7 @@ int crtAllocHook(int nAllocType, void* pvData, { if (nBlockUse == _CRT_BLOCK) { - return(TRUE); + return TRUE; } static int total_cnt = 0; diff --git a/Code/Editor/CryEdit.cpp b/Code/Editor/CryEdit.cpp index cd1dd4fe47..fe7b0a06be 100644 --- a/Code/Editor/CryEdit.cpp +++ b/Code/Editor/CryEdit.cpp @@ -78,7 +78,6 @@ AZ_POP_DISABLE_WARNING // CryCommon #include -#include #include // Editor @@ -266,13 +265,13 @@ CCrySingleDocTemplate* CCryDocManager::SetDefaultTemplate(CCrySingleDocTemplate* // Copied from MFC to get rid of the silly ugly unoverridable doc-type pick dialog void CCryDocManager::OnFileNew() { - assert(m_pDefTemplate != NULL); + assert(m_pDefTemplate != nullptr); - m_pDefTemplate->OpenDocumentFile(NULL); + m_pDefTemplate->OpenDocumentFile(nullptr); // if returns NULL, the user has already been alerted } -BOOL CCryDocManager::DoPromptFileName(QString& fileName, [[maybe_unused]] UINT nIDSTitle, - [[maybe_unused]] DWORD lFlags, BOOL bOpenFileDialog, [[maybe_unused]] CDocTemplate* pTemplate) +bool CCryDocManager::DoPromptFileName(QString& fileName, [[maybe_unused]] UINT nIDSTitle, + [[maybe_unused]] DWORD lFlags, bool bOpenFileDialog, [[maybe_unused]] CDocTemplate* pTemplate) { CLevelFileDialog levelFileDialog(bOpenFileDialog); levelFileDialog.show(); @@ -286,15 +285,15 @@ BOOL CCryDocManager::DoPromptFileName(QString& fileName, [[maybe_unused]] UINT n return false; } -CCryEditDoc* CCryDocManager::OpenDocumentFile(LPCTSTR lpszFileName, BOOL bAddToMRU) +CCryEditDoc* CCryDocManager::OpenDocumentFile(const char* lpszFileName, bool bAddToMRU) { - assert(lpszFileName != NULL); + assert(lpszFileName != nullptr); // find the highest confidence auto pos = m_templateList.begin(); CCrySingleDocTemplate::Confidence bestMatch = CCrySingleDocTemplate::noAttempt; - CCrySingleDocTemplate* pBestTemplate = NULL; - CCryEditDoc* pOpenDocument = NULL; + CCrySingleDocTemplate* pBestTemplate = nullptr; + CCryEditDoc* pOpenDocument = nullptr; if (lpszFileName[0] == '\"') { @@ -311,7 +310,7 @@ CCryEditDoc* CCryDocManager::OpenDocumentFile(LPCTSTR lpszFileName, BOOL bAddToM auto pTemplate = *(pos++); CCrySingleDocTemplate::Confidence match; - assert(pOpenDocument == NULL); + assert(pOpenDocument == nullptr); match = pTemplate->MatchDocType(szPath.toUtf8().data(), pOpenDocument); if (match > bestMatch) { @@ -324,18 +323,18 @@ CCryEditDoc* CCryDocManager::OpenDocumentFile(LPCTSTR lpszFileName, BOOL bAddToM } } - if (pOpenDocument != NULL) + if (pOpenDocument != nullptr) { return pOpenDocument; } - if (pBestTemplate == NULL) + if (pBestTemplate == nullptr) { QMessageBox::critical(AzToolsFramework::GetActiveWindow(), QString(), QObject::tr("Failed to open document.")); - return NULL; + return nullptr; } - return pBestTemplate->OpenDocumentFile(szPath.toUtf8().data(), bAddToMRU, FALSE); + return pBestTemplate->OpenDocumentFile(szPath.toUtf8().data(), bAddToMRU, false); } ////////////////////////////////////////////////////////////////////////////// @@ -448,19 +447,12 @@ void CCryEditApp::RegisterActionHandlers() ON_COMMAND(ID_OPEN_TRACKVIEW, OnOpenTrackView) ON_COMMAND(ID_OPEN_UICANVASEDITOR, OnOpenUICanvasEditor) -#if defined(AZ_TOOLS_EXPAND_FOR_RESTRICTED_PLATFORMS) -#define AZ_RESTRICTED_PLATFORM_EXPANSION(CodeName, CODENAME, codename, PrivateName, PRIVATENAME, privatename, PublicName, PUBLICNAME, publicname, PublicAuxName1, PublicAuxName2, PublicAuxName3)\ - ON_COMMAND_RANGE(ID_GAME_##CODENAME##_ENABLELOWSPEC, ID_GAME_##CODENAME##_ENABLEHIGHSPEC, OnChangeGameSpec) - AZ_TOOLS_EXPAND_FOR_RESTRICTED_PLATFORMS -#undef AZ_RESTRICTED_PLATFORM_EXPANSION -#endif - ON_COMMAND(ID_OPEN_QUICK_ACCESS_BAR, OnOpenQuickAccessBar) ON_COMMAND(ID_FILE_SAVE_LEVEL, OnFileSave) ON_COMMAND(ID_FILE_EXPORTOCCLUSIONMESH, OnFileExportOcclusionMesh) - // Project Manager + // Project Manager ON_COMMAND(ID_FILE_PROJECT_MANAGER_SETTINGS, OnOpenProjectManagerSettings) ON_COMMAND(ID_FILE_PROJECT_MANAGER_NEW, OnOpenProjectManagerNew) ON_COMMAND(ID_FILE_PROJECT_MANAGER_OPEN, OnOpenProjectManager) @@ -559,7 +551,9 @@ public: { "NSDocumentRevisionsDebugMode", nsDocumentRevisionsDebugMode}, { "skipWelcomeScreenDialog", m_bSkipWelcomeScreenDialog}, { "autotest_mode", m_bAutotestMode}, - { "regdumpall", dummy } + { "regdumpall", dummy }, + { "attach-debugger", dummy }, // Attaches a debugger for the current application + { "wait-for-debugger", dummy }, // Waits until a debugger is attached to the current application }; QString dummyString; @@ -613,7 +607,7 @@ public: } // Get boolean options - const int numOptions = options.size(); + const int numOptions = static_cast(options.size()); for (int i = 0; i < numOptions; ++i) { options[i].second = parser.isSet(options[i].first); @@ -653,7 +647,7 @@ struct SharedData // // This function uses a technique similar to that described in KB // article Q141752 to locate the previous instance of the application. . -BOOL CCryEditApp::FirstInstance(bool bForceNewInstance) +bool CCryEditApp::FirstInstance(bool bForceNewInstance) { QSystemSemaphore sem(QString(O3DEApplicationName) + "_sem", 1); sem.acquire(); @@ -801,12 +795,12 @@ void CCryEditApp::InitDirectory() // Needed to work with custom memory manager. ////////////////////////////////////////////////////////////////////////// -CCryEditDoc* CCrySingleDocTemplate::OpenDocumentFile(LPCTSTR lpszPathName, BOOL bMakeVisible /*= true*/) +CCryEditDoc* CCrySingleDocTemplate::OpenDocumentFile(const char* lpszPathName, bool bMakeVisible /*= true*/) { return OpenDocumentFile(lpszPathName, true, bMakeVisible); } -CCryEditDoc* CCrySingleDocTemplate::OpenDocumentFile(LPCTSTR lpszPathName, BOOL bAddToMRU, [[maybe_unused]] BOOL bMakeVisible) +CCryEditDoc* CCrySingleDocTemplate::OpenDocumentFile(const char* lpszPathName, bool bAddToMRU, [[maybe_unused]] bool bMakeVisible) { CCryEditDoc* pCurDoc = GetIEditor()->GetDocument(); @@ -845,10 +839,10 @@ CCryEditDoc* CCrySingleDocTemplate::OpenDocumentFile(LPCTSTR lpszPathName, BOOL return pCurDoc; } -CCrySingleDocTemplate::Confidence CCrySingleDocTemplate::MatchDocType(LPCTSTR lpszPathName, CCryEditDoc*& rpDocMatch) +CCrySingleDocTemplate::Confidence CCrySingleDocTemplate::MatchDocType(const char* lpszPathName, CCryEditDoc*& rpDocMatch) { - assert(lpszPathName != NULL); - rpDocMatch = NULL; + assert(lpszPathName != nullptr); + rpDocMatch = nullptr; // go through all documents CCryEditDoc* pDoc = GetIEditor()->GetDocument(); @@ -891,8 +885,7 @@ CCrySingleDocTemplate::Confidence CCrySingleDocTemplate::MatchDocType(LPCTSTR lp ///////////////////////////////////////////////////////////////////////////// namespace { - CryMutex g_splashScreenStateLock; - CryConditionVariable g_splashScreenStateChange; + AZStd::mutex g_splashScreenStateLock; enum ESplashScreenState { eSplashScreenState_Init, eSplashScreenState_Started, eSplashScreenState_Destroy @@ -923,7 +916,7 @@ QString FormatRichTextCopyrightNotice() ///////////////////////////////////////////////////////////////////////////// void CCryEditApp::ShowSplashScreen(CCryEditApp* app) { - g_splashScreenStateLock.Lock(); + g_splashScreenStateLock.lock(); CStartupLogoDialog* splashScreen = new CStartupLogoDialog(FormatVersion(app->m_pEditor->GetFileVersion()), FormatRichTextCopyrightNotice()); @@ -931,8 +924,7 @@ void CCryEditApp::ShowSplashScreen(CCryEditApp* app) g_splashScreen = splashScreen; g_splashScreenState = eSplashScreenState_Started; - g_splashScreenStateLock.Unlock(); - g_splashScreenStateChange.Notify(); + g_splashScreenStateLock.unlock(); splashScreen->show(); // Make sure the initial paint of the splash screen occurs so we dont get stuck with a blank window @@ -940,10 +932,9 @@ void CCryEditApp::ShowSplashScreen(CCryEditApp* app) QObject::connect(splashScreen, &QObject::destroyed, splashScreen, [=] { - g_splashScreenStateLock.Lock(); + AZStd::scoped_lock lock(g_splashScreenStateLock); g_pInitializeUIInfo = nullptr; g_splashScreen = nullptr; - g_splashScreenStateLock.Unlock(); }); } @@ -973,9 +964,9 @@ void CCryEditApp::CloseSplashScreen() if (CStartupLogoDialog::instance()) { delete CStartupLogoDialog::instance(); - g_splashScreenStateLock.Lock(); + g_splashScreenStateLock.lock(); g_splashScreenState = eSplashScreenState_Destroy; - g_splashScreenStateLock.Unlock(); + g_splashScreenStateLock.unlock(); } GetIEditor()->Notify(eNotify_OnSplashScreenDestroyed); @@ -984,12 +975,12 @@ void CCryEditApp::CloseSplashScreen() ///////////////////////////////////////////////////////////////////////////// void CCryEditApp::OutputStartupMessage(QString str) { - g_splashScreenStateLock.Lock(); + g_splashScreenStateLock.lock(); if (g_pInitializeUIInfo) { g_pInitializeUIInfo->SetInfoText(str.toUtf8().data()); } - g_splashScreenStateLock.Unlock(); + g_splashScreenStateLock.unlock(); } ////////////////////////////////////////////////////////////////////////// @@ -1055,7 +1046,7 @@ AZ::Outcome CCryEditApp::InitGameSystem(HWND hwndForInputSy } ///////////////////////////////////////////////////////////////////////////// -BOOL CCryEditApp::CheckIfAlreadyRunning() +bool CCryEditApp::CheckIfAlreadyRunning() { bool bForceNewInstance = false; @@ -1299,7 +1290,7 @@ void CCryEditApp::InitLevel(const CEditCommandLineInfo& cmdInfo) } ///////////////////////////////////////////////////////////////////////////// -BOOL CCryEditApp::InitConsole() +bool CCryEditApp::InitConsole() { // Execute command from cmdline -exec_line if applicable if (!m_execLineCmd.isEmpty()) @@ -1431,7 +1422,7 @@ struct CCryEditApp::PythonOutputHandler AzToolsFramework::EditorPythonConsoleNotificationBus::Handler::BusConnect(); } - virtual ~PythonOutputHandler() + ~PythonOutputHandler() override { AzToolsFramework::EditorPythonConsoleNotificationBus::Handler::BusDisconnect(); } @@ -1463,7 +1454,7 @@ struct PythonTestOutputHandler final : public CCryEditApp::PythonOutputHandler { PythonTestOutputHandler() = default; - virtual ~PythonTestOutputHandler() = default; + ~PythonTestOutputHandler() override = default; void OnTraceMessage(AZStd::string_view message) override { @@ -1589,7 +1580,7 @@ void CCryEditApp::RunInitPythonScript(CEditCommandLineInfo& cmdInfo) ///////////////////////////////////////////////////////////////////////////// // CCryEditApp initialization -BOOL CCryEditApp::InitInstance() +bool CCryEditApp::InitInstance() { QElapsedTimer startupTimer; startupTimer.start(); @@ -1616,7 +1607,7 @@ BOOL CCryEditApp::InitInstance() { CAboutDialog aboutDlg(FormatVersion(m_pEditor->GetFileVersion()), FormatRichTextCopyrightNotice()); aboutDlg.exec(); - return FALSE; + return false; } // Reflect property control classes to the serialize context... @@ -1626,9 +1617,6 @@ BOOL CCryEditApp::InitInstance() ReflectedVarInit::setupReflection(serializeContext); RegisterReflectedVarHandlers(); - - QLocale::setDefault(QLocale(QLocale::English, QLocale::UnitedStates)); - CreateSplashScreen(); // Register the application's document templates. Document templates @@ -1759,7 +1747,7 @@ BOOL CCryEditApp::InitInstance() } } - SetEditorWindowTitle(0, AZ::Utils::GetProjectName().c_str(), 0); + SetEditorWindowTitle(nullptr, AZ::Utils::GetProjectName().c_str(), nullptr); if (!GetIEditor()->IsInMatEditMode()) { m_pEditor->InitFinished(); @@ -1844,8 +1832,8 @@ void CCryEditApp::RegisterEventLoopHook(IEventLoopHook* pHook) void CCryEditApp::UnregisterEventLoopHook(IEventLoopHook* pHookToRemove) { - IEventLoopHook* pPrevious = 0; - for (IEventLoopHook* pHook = m_pEventLoopHook; pHook != 0; pHook = pHook->pNextHook) + IEventLoopHook* pPrevious = nullptr; + for (IEventLoopHook* pHook = m_pEventLoopHook; pHook != nullptr; pHook = pHook->pNextHook) { if (pHook == pHookToRemove) { @@ -1858,7 +1846,7 @@ void CCryEditApp::UnregisterEventLoopHook(IEventLoopHook* pHookToRemove) m_pEventLoopHook = pHookToRemove->pNextHook; } - pHookToRemove->pNextHook = 0; + pHookToRemove->pNextHook = nullptr; return; } } @@ -1867,11 +1855,6 @@ void CCryEditApp::UnregisterEventLoopHook(IEventLoopHook* pHookToRemove) ////////////////////////////////////////////////////////////////////////// void CCryEditApp::LoadFile(QString fileName) { - //CEditCommandLineInfo cmdLine; - //ProcessCommandLine(cmdinfo); - - //bool bBuilding = false; - //CString file = cmdLine.SpanExcluding() if (GetIEditor()->GetViewManager()->GetViewCount() == 0) { return; @@ -1881,7 +1864,7 @@ void CCryEditApp::LoadFile(QString fileName) if (MainWindow::instance() || m_pConsoleDialog) { - SetEditorWindowTitle(0, AZ::Utils::GetProjectName().c_str(), GetIEditor()->GetGameEngine()->GetLevelName()); + SetEditorWindowTitle(nullptr, AZ::Utils::GetProjectName().c_str(), GetIEditor()->GetGameEngine()->GetLevelName()); } GetIEditor()->SetModifiedFlag(false); @@ -1922,7 +1905,7 @@ void CCryEditApp::EnableAccelerator([[maybe_unused]] bool bEnable) CMainFrame *mainFrame = (CMainFrame*)m_pMainWnd; if (mainFrame->m_hAccelTable) DestroyAcceleratorTable( mainFrame->m_hAccelTable ); - mainFrame->m_hAccelTable = NULL; + mainFrame->m_hAccelTable = nullptr; mainFrame->LoadAccelTable( MAKEINTRESOURCE(IDR_GAMEACCELERATOR) ); CLogFile::WriteLine( "Disable Accelerators" ); } @@ -2259,7 +2242,7 @@ void CCryEditApp::EnableIdleProcessing() AZ_Assert(m_disableIdleProcessingCounter >= 0, "m_disableIdleProcessingCounter must be nonnegative"); } -BOOL CCryEditApp::OnIdle([[maybe_unused]] LONG lCount) +bool CCryEditApp::OnIdle([[maybe_unused]] LONG lCount) { if (0 == m_disableIdleProcessingCounter) { @@ -2267,7 +2250,7 @@ BOOL CCryEditApp::OnIdle([[maybe_unused]] LONG lCount) } else { - return 0; + return false; } } @@ -2309,7 +2292,7 @@ int CCryEditApp::IdleProcessing(bool bBackgroundUpdate) int res = 0; if (bIsAppWindow || m_bForceProcessIdle || m_bKeepEditorActive // Automated tests must always keep the editor active, or they can get stuck - || m_bAutotestMode) + || m_bAutotestMode || m_bRunPythonTestScript) { res = 1; bActive = true; @@ -3142,7 +3125,7 @@ void CCryEditApp::OnCreateLevel() ////////////////////////////////////////////////////////////////////////// bool CCryEditApp::CreateLevel(bool& wasCreateLevelOperationCancelled) { - BOOL bIsDocModified = GetIEditor()->GetDocument()->IsModified(); + bool bIsDocModified = GetIEditor()->GetDocument()->IsModified(); if (GetIEditor()->GetDocument()->IsDocumentReady() && bIsDocModified) { QString str = QObject::tr("Level %1 has been changed. Save Level?").arg(GetIEditor()->GetGameEngine()->GetLevelName()); @@ -3196,7 +3179,7 @@ bool CCryEditApp::CreateLevel(bool& wasCreateLevelOperationCancelled) GetIEditor()->GetDocument()->DeleteTemporaryLevel(); } - if (levelName.length() == 0 || !CryStringUtils::IsValidFileName(levelName.toUtf8().data())) + if (levelName.length() == 0 || !AZ::StringFunc::Path::IsValid(levelName.toUtf8().data())) { QMessageBox::critical(AzToolsFramework::GetActiveWindow(), QString(), QObject::tr("Level name is invalid, please choose another name.")); return false; @@ -3229,13 +3212,16 @@ bool CCryEditApp::CreateLevel(bool& wasCreateLevelOperationCancelled) DWORD dw = GetLastError(); #ifdef WIN32 - FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, + wchar_t windowsErrorMessageW[ERROR_LEN]; + windowsErrorMessageW[0] = L'\0'; + FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, + nullptr, dw, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - windowsErrorMessage.data(), - windowsErrorMessage.length(), NULL); + windowsErrorMessageW, + ERROR_LEN, nullptr); _getcwd(cwd.data(), cwd.length()); + AZStd::to_string(windowsErrorMessage.data(), ERROR_LEN, windowsErrorMessageW); #else windowsErrorMessage = strerror(dw); cwd = QDir::currentPath().toUtf8(); @@ -3248,7 +3234,7 @@ bool CCryEditApp::CreateLevel(bool& wasCreateLevelOperationCancelled) { QFileInfo info(fullyQualifiedLevelName); const AZStd::string rawProjectDirectory = Path::GetEditingGameDataFolder(); - const QString projectDirectory = QDir::toNativeSeparators(QString::fromUtf8(rawProjectDirectory.data(), rawProjectDirectory.size())); + const QString projectDirectory = QDir::toNativeSeparators(QString::fromUtf8(rawProjectDirectory.data(), static_cast(rawProjectDirectory.size()))); const QString elidedLevelName = QStringLiteral("%1...%2").arg(levelName.left(10)).arg(levelName.right(10)); const QString elidedLevelFileName = QStringLiteral("%1...%2").arg(info.fileName().left(10)).arg(info.fileName().right(10)); const QString message = QObject::tr( @@ -3309,7 +3295,7 @@ void CCryEditApp::OnOpenSlice() } ////////////////////////////////////////////////////////////////////////// -CCryEditDoc* CCryEditApp::OpenDocumentFile(LPCTSTR lpszFileName) +CCryEditDoc* CCryEditApp::OpenDocumentFile(const char* lpszFileName) { if (m_openingLevel) { @@ -3388,7 +3374,7 @@ CCryEditDoc* CCryEditApp::OpenDocumentFile(LPCTSTR lpszFileName) void CCryEditApp::OnResourcesReduceworkingset() { #ifdef WIN32 // no such thing on macOS - SetProcessWorkingSetSize(GetCurrentProcess(), -1, -1); + SetProcessWorkingSetSize(GetCurrentProcess(), std::numeric_limits::max(), std::numeric_limits::max()); #endif } @@ -3644,24 +3630,12 @@ void CCryEditApp::OnToolsPreferences() ////////////////////////////////////////////////////////////////////////// void CCryEditApp::OnSwitchToDefaultCamera() { - CViewport* vp = GetIEditor()->GetViewManager()->GetSelectedViewport(); - if (CRenderViewport* rvp = viewport_cast(vp)) - { - rvp->SetDefaultCamera(); - } } ////////////////////////////////////////////////////////////////////////// void CCryEditApp::OnUpdateSwitchToDefaultCamera(QAction* action) { Q_ASSERT(action->isCheckable()); - CViewport* pViewport = GetIEditor()->GetViewManager()->GetSelectedViewport(); - if (CRenderViewport* rvp = viewport_cast(pViewport)) - { - action->setEnabled(true); - action->setChecked(rvp->IsDefaultCamera()); - } - else { action->setEnabled(false); } @@ -3670,39 +3644,12 @@ void CCryEditApp::OnUpdateSwitchToDefaultCamera(QAction* action) ////////////////////////////////////////////////////////////////////////// void CCryEditApp::OnSwitchToSequenceCamera() { - CViewport* vp = GetIEditor()->GetViewManager()->GetSelectedViewport(); - if (CRenderViewport* rvp = viewport_cast(vp)) - { - rvp->SetSequenceCamera(); - } } ////////////////////////////////////////////////////////////////////////// void CCryEditApp::OnUpdateSwitchToSequenceCamera(QAction* action) { Q_ASSERT(action->isCheckable()); - - CViewport* pViewport = GetIEditor()->GetViewManager()->GetSelectedViewport(); - - if (CRenderViewport* rvp = viewport_cast(pViewport)) - { - bool enableAction = false; - - // only enable if we're editing a sequence in Track View and have cameras in the level - if (GetIEditor()->GetAnimation()->GetSequence()) - { - - AZ::EBusAggregateResults componentCameras; - Camera::CameraBus::BroadcastResult(componentCameras, &Camera::CameraRequests::GetCameras); - - const int numCameras = componentCameras.values.size(); - enableAction = (numCameras > 0); - } - - action->setEnabled(enableAction); - action->setChecked(rvp->IsSequenceCamera()); - } - else { action->setEnabled(false); } @@ -3711,31 +3658,12 @@ void CCryEditApp::OnUpdateSwitchToSequenceCamera(QAction* action) ////////////////////////////////////////////////////////////////////////// void CCryEditApp::OnSwitchToSelectedcamera() { - CViewport* vp = GetIEditor()->GetViewManager()->GetSelectedViewport(); - if (CRenderViewport* rvp = viewport_cast(vp)) - { - rvp->SetSelectedCamera(); - } } ////////////////////////////////////////////////////////////////////////// void CCryEditApp::OnUpdateSwitchToSelectedCamera(QAction* action) { Q_ASSERT(action->isCheckable()); - AzToolsFramework::EntityIdList selectedEntityList; - AzToolsFramework::ToolsApplicationRequests::Bus::BroadcastResult(selectedEntityList, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntities); - AZ::EBusAggregateResults cameras; - Camera::CameraBus::BroadcastResult(cameras, &Camera::CameraRequests::GetCameras); - bool isCameraComponentSelected = selectedEntityList.size() > 0 ? AZStd::find(cameras.values.begin(), cameras.values.end(), *selectedEntityList.begin()) != cameras.values.end() : false; - - CViewport* pViewport = GetIEditor()->GetViewManager()->GetSelectedViewport(); - CRenderViewport* rvp = viewport_cast(pViewport); - if (isCameraComponentSelected && rvp) - { - action->setEnabled(true); - action->setChecked(rvp->IsSelectedCamera()); - } - else { action->setEnabled(false); } @@ -3744,11 +3672,7 @@ void CCryEditApp::OnUpdateSwitchToSelectedCamera(QAction* action) ////////////////////////////////////////////////////////////////////////// void CCryEditApp::OnSwitchcameraNext() { - CViewport* vp = GetIEditor()->GetActiveView(); - if (CRenderViewport* rvp = viewport_cast(vp)) - { - rvp->CycleCamera(); - } + } ////////////////////////////////////////////////////////////////////////// @@ -3821,7 +3745,7 @@ bool CCryEditApp::IsInRegularEditorMode() void CCryEditApp::OnOpenQuickAccessBar() { - if (m_pQuickAccessBar == NULL) + if (m_pQuickAccessBar == nullptr) { return; } @@ -3980,11 +3904,19 @@ void CCryEditApp::OpenLUAEditor(const char* files) AZStd::string_view exePath; AZ::ComponentApplicationBus::BroadcastResult(exePath, &AZ::ComponentApplicationRequests::GetExecutableFolder); - AZStd::string process = AZStd::string::format("\"%.*s" AZ_CORRECT_FILESYSTEM_SEPARATOR_STRING "LuaIDE" +#if defined(AZ_PLATFORM_LINUX) + // On Linux platforms, launching a process is not done through a shell and its arguments are passed in + // separately. There is no need to wrap the process path in case of spaces in the path + constexpr const char* argumentQuoteString = ""; +#else + constexpr const char* argumentQuoteString = "\""; +#endif + + AZStd::string process = AZStd::string::format("%s%.*s" AZ_CORRECT_FILESYSTEM_SEPARATOR_STRING "LuaIDE" #if defined(AZ_PLATFORM_WINDOWS) ".exe" #endif - "\"", aznumeric_cast(exePath.size()), exePath.data()); + "%s", argumentQuoteString, aznumeric_cast(exePath.size()), exePath.data(), argumentQuoteString); AZStd::string processArgs = AZStd::string::format("%s -engine-path \"%s\"", args.c_str(), engineRoot); StartProcessDetached(process.c_str(), processArgs.c_str()); @@ -3992,7 +3924,7 @@ void CCryEditApp::OpenLUAEditor(const char* files) void CCryEditApp::PrintAlways(const AZStd::string& output) { - m_stdoutRedirection.WriteBypassingRedirect(output.c_str(), output.size()); + m_stdoutRedirection.WriteBypassingRedirect(output.c_str(), static_cast(output.size())); } QString CCryEditApp::GetRootEnginePath() const @@ -4066,15 +3998,12 @@ struct CryAllocatorsRAII CryAllocatorsRAII() { AZ_Assert(!AZ::AllocatorInstance::IsReady(), "Expected allocator to not be initialized, hunt down the static that is initializing it"); - AZ_Assert(!AZ::AllocatorInstance::IsReady(), "Expected allocator to not be initialized, hunt down the static that is initializing it"); AZ::AllocatorInstance::Create(); - AZ::AllocatorInstance::Create(); } ~CryAllocatorsRAII() { - AZ::AllocatorInstance::Destroy(); AZ::AllocatorInstance::Destroy(); } }; @@ -4084,6 +4013,19 @@ extern "C" int AZ_DLL_EXPORT CryEditMain(int argc, char* argv[]) { CryAllocatorsRAII cryAllocatorsRAII; + // Debugging utilities + for (int i = 1; i < argc; ++i) + { + if (azstricmp(argv[i], "--attach-debugger") == 0) + { + AZ::Debug::Trace::AttachDebugger(); + } + else if (azstricmp(argv[i], "--wait-for-debugger") == 0) + { + AZ::Debug::Trace::WaitForDebugger(); + } + } + // ensure the EditorEventsBus context gets created inside EditorLib [[maybe_unused]] const auto& editorEventsContext = AzToolsFramework::EditorEvents::Bus::GetOrCreateContext(); @@ -4169,7 +4111,7 @@ extern "C" int AZ_DLL_EXPORT CryEditMain(int argc, char* argv[]) int exitCode = 0; - BOOL didCryEditStart = CCryEditApp::instance()->InitInstance(); + bool didCryEditStart = CCryEditApp::instance()->InitInstance(); AZ_Error("Editor", didCryEditStart, "O3DE Editor did not initialize correctly, and will close." "\nThis could be because of incorrectly configured components, or missing required gems." "\nSee other errors for more details."); diff --git a/Code/Editor/CryEdit.h b/Code/Editor/CryEdit.h index 9406b37ea2..4ab37ac1e5 100644 --- a/Code/Editor/CryEdit.h +++ b/Code/Editor/CryEdit.h @@ -135,16 +135,16 @@ public: virtual void AddToRecentFileList(const QString& lpszPathName); ECreateLevelResult CreateLevel(const QString& levelName, QString& fullyQualifiedLevelName); static void InitDirectory(); - BOOL FirstInstance(bool bForceNewInstance = false); + bool FirstInstance(bool bForceNewInstance = false); void InitFromCommandLine(CEditCommandLineInfo& cmdInfo); - BOOL CheckIfAlreadyRunning(); + bool CheckIfAlreadyRunning(); //! @return successful outcome if initialization succeeded. or failed outcome with error message. AZ::Outcome InitGameSystem(HWND hwndForInputSystem); void CreateSplashScreen(); void InitPlugins(); bool InitGame(); - BOOL InitConsole(); + bool InitConsole(); int IdleProcessing(bool bBackground); bool IsWindowInForeground(); void RunInitPythonScript(CEditCommandLineInfo& cmdInfo); @@ -171,10 +171,10 @@ public: // Overrides // ClassWizard generated virtual function overrides public: - virtual BOOL InitInstance(); + virtual bool InitInstance(); virtual int ExitInstance(int exitCode = 0); - virtual BOOL OnIdle(LONG lCount); - virtual CCryEditDoc* OpenDocumentFile(LPCTSTR lpszFileName); + virtual bool OnIdle(LONG lCount); + virtual CCryEditDoc* OpenDocumentFile(const char* lpszFileName); CCryDocManager* GetDocManager() { return m_pDocManager; } @@ -347,7 +347,7 @@ private: // Disable warning for dll export since this member won't be used outside this class AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING AZ::IO::FileDescriptorRedirector m_stdoutRedirection = AZ::IO::FileDescriptorRedirector(1); // < 1 for STDOUT -AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING +AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING private: static inline constexpr const char* DefaultLevelTemplateName = "Prefabs/Default_Level.prefab"; @@ -420,7 +420,7 @@ public: }; ////////////////////////////////////////////////////////////////////////// -class CCrySingleDocTemplate +class CCrySingleDocTemplate : public QObject { private: @@ -448,9 +448,9 @@ public: ~CCrySingleDocTemplate() {}; // avoid creating another CMainFrame // close other type docs before opening any things - virtual CCryEditDoc* OpenDocumentFile(LPCTSTR lpszPathName, BOOL bAddToMRU, BOOL bMakeVisible); - virtual CCryEditDoc* OpenDocumentFile(LPCTSTR lpszPathName, BOOL bMakeVisible = TRUE); - virtual Confidence MatchDocType(LPCTSTR lpszPathName, CCryEditDoc*& rpDocMatch); + virtual CCryEditDoc* OpenDocumentFile(const char* lpszPathName, bool bAddToMRU, bool bMakeVisible); + virtual CCryEditDoc* OpenDocumentFile(const char* lpszPathName, bool bMakeVisible = TRUE); + virtual Confidence MatchDocType(const char* lpszPathName, CCryEditDoc*& rpDocMatch); private: const QMetaObject* m_documentClass = nullptr; @@ -465,9 +465,9 @@ public: CCrySingleDocTemplate* SetDefaultTemplate(CCrySingleDocTemplate* pNew); // Copied from MFC to get rid of the silly ugly unoverridable doc-type pick dialog virtual void OnFileNew(); - virtual BOOL DoPromptFileName(QString& fileName, UINT nIDSTitle, - DWORD lFlags, BOOL bOpenFileDialog, CDocTemplate* pTemplate); - virtual CCryEditDoc* OpenDocumentFile(LPCTSTR lpszFileName, BOOL bAddToMRU); + virtual bool DoPromptFileName(QString& fileName, UINT nIDSTitle, + DWORD lFlags, bool bOpenFileDialog, CDocTemplate* pTemplate); + virtual CCryEditDoc* OpenDocumentFile(const char* lpszFileName, bool bAddToMRU); QVector m_templateList; }; diff --git a/Code/Editor/CryEditDoc.cpp b/Code/Editor/CryEditDoc.cpp index 9421198de7..9a7e7cc846 100644 --- a/Code/Editor/CryEditDoc.cpp +++ b/Code/Editor/CryEditDoc.cpp @@ -19,6 +19,7 @@ #include #include #include +#include // AzFramework #include @@ -31,9 +32,6 @@ #include #include -// CryCommon -#include - // Editor #include "Settings.h" @@ -53,11 +51,13 @@ #include "MainWindow.h" #include "LevelFileDialog.h" #include "StatObjBus.h" +#include "Undo/Undo.h" #include #include // LmbrCentral +#include #include // for LmbrCentral::EditorLightComponentRequestBus //#define PROFILE_LOADING_WITH_VTUNE @@ -95,7 +95,7 @@ namespace Internal { bool SaveLevel() { - if (!GetIEditor()->GetDocument()->DoSave(GetIEditor()->GetDocument()->GetActivePathName(), TRUE)) + if (!GetIEditor()->GetDocument()->DoSave(GetIEditor()->GetDocument()->GetActivePathName(), true)) { return false; } @@ -261,26 +261,13 @@ void CCryEditDoc::DeleteContents() GetIEditor()->GetObjectManager()->DeleteAllObjects(); // Load scripts data - SetModifiedFlag(FALSE); + SetModifiedFlag(false); SetModifiedModules(eModifiedNothing); // Clear error reports if open. CErrorReportDialog::Clear(); // Unload level specific audio binary data. - Audio::SAudioManagerRequestData oAMData(Audio::eADS_LEVEL_SPECIFIC); - Audio::SAudioRequest oAudioRequestData; - oAudioRequestData.nFlags = (Audio::eARF_PRIORITY_HIGH | Audio::eARF_EXECUTE_BLOCKING); - oAudioRequestData.pData = &oAMData; - Audio::AudioSystemRequestBus::Broadcast(&Audio::AudioSystemRequestBus::Events::PushRequestBlocking, oAudioRequestData); - - // Now unload level specific audio config data. - Audio::SAudioManagerRequestData oAMData2(Audio::eADS_LEVEL_SPECIFIC); - oAudioRequestData.pData = &oAMData2; - Audio::AudioSystemRequestBus::Broadcast(&Audio::AudioSystemRequestBus::Events::PushRequestBlocking, oAudioRequestData); - - Audio::SAudioManagerRequestData oAMData3(Audio::eADS_LEVEL_SPECIFIC); - oAudioRequestData.pData = &oAMData3; - Audio::AudioSystemRequestBus::Broadcast(&Audio::AudioSystemRequestBus::Events::PushRequestBlocking, oAudioRequestData); + LmbrCentral::AudioSystemComponentRequestBus::Broadcast(&LmbrCentral::AudioSystemComponentRequestBus::Events::LevelUnloadAudio); GetIEditor()->Notify(eNotify_OnSceneClosed); CrySystemEventBus::Broadcast(&CrySystemEventBus::Events::OnCryEditorSceneClosed); @@ -303,7 +290,7 @@ void CCryEditDoc::Save(TDocMultiArchive& arrXmlAr) { CAutoDocNotReady autoDocNotReady; - if (arrXmlAr[DMAS_GENERAL] != NULL) + if (arrXmlAr[DMAS_GENERAL] != nullptr) { (*arrXmlAr[DMAS_GENERAL]).root = XmlHelpers::CreateXmlNode("Level"); (*arrXmlAr[DMAS_GENERAL]).root->setAttr("WaterColor", m_waterColor); @@ -355,7 +342,7 @@ void CCryEditDoc::Load(TDocMultiArchive& arrXmlAr, const QString& szFilename) // Register this level and its content hash as version GetIEditor()->GetSettingsManager()->AddToolVersion(fileName, levelHash); GetIEditor()->GetSettingsManager()->RegisterEvent(loadEvent); - LOADING_TIME_PROFILE_SECTION(gEnv->pSystem); + CAutoDocNotReady autoDocNotReady; HEAP_CHECK @@ -411,32 +398,11 @@ void CCryEditDoc::Load(TDocMultiArchive& arrXmlAr, const QString& szFilename) #ifdef PROFILE_LOADING_WITH_VTUNE VTResume(); #endif - // Parse level specific config data. - const char* controlsPath = nullptr; - Audio::AudioSystemRequestBus::BroadcastResult(controlsPath, &Audio::AudioSystemRequestBus::Events::GetControlsPath); - QString sAudioLevelPath(controlsPath); - sAudioLevelPath += "levels/"; - string const sLevelNameOnly = PathUtil::GetFileName(fileName.toUtf8().data()); - sAudioLevelPath += sLevelNameOnly; - QByteArray path = sAudioLevelPath.toUtf8(); - Audio::SAudioManagerRequestData oAMData(path, Audio::eADS_LEVEL_SPECIFIC); - Audio::SAudioRequest oAudioRequestData; - oAudioRequestData.nFlags = (Audio::eARF_PRIORITY_HIGH | Audio::eARF_EXECUTE_BLOCKING); // Needs to be blocking so data is available for next preloading request! - oAudioRequestData.pData = &oAMData; - Audio::AudioSystemRequestBus::Broadcast(&Audio::AudioSystemRequestBus::Events::PushRequestBlocking, oAudioRequestData); - - Audio::SAudioManagerRequestData oAMData2(path, Audio::eADS_LEVEL_SPECIFIC); - oAudioRequestData.pData = &oAMData2; - Audio::AudioSystemRequestBus::Broadcast(&Audio::AudioSystemRequestBus::Events::PushRequestBlocking, oAudioRequestData); - - Audio::TAudioPreloadRequestID nPreloadRequestID = INVALID_AUDIO_PRELOAD_REQUEST_ID; - Audio::AudioSystemRequestBus::BroadcastResult(nPreloadRequestID, &Audio::AudioSystemRequestBus::Events::GetAudioPreloadRequestID, sLevelNameOnly.c_str()); - if (nPreloadRequestID != INVALID_AUDIO_PRELOAD_REQUEST_ID) - { - Audio::SAudioManagerRequestData oAMData3(nPreloadRequestID); - oAudioRequestData.pData = &oAMData3; - Audio::AudioSystemRequestBus::Broadcast(&Audio::AudioSystemRequestBus::Events::PushRequestBlocking, oAudioRequestData); - } + // Load level-specific audio data. + AZStd::string levelFileName{ fileName.toUtf8().constData() }; + AZStd::to_lower(levelFileName.begin(), levelFileName.end()); + LmbrCentral::AudioSystemComponentRequestBus::Broadcast( + &LmbrCentral::AudioSystemComponentRequestBus::Events::LevelLoadAudio, AZStd::string_view{ levelFileName }); { CAutoLogTime logtime("Game Engine level load"); @@ -481,7 +447,7 @@ void CCryEditDoc::Load(TDocMultiArchive& arrXmlAr, const QString& szFilename) if (!pObj) { - pObj = GetIEditor()->GetObjectManager()->NewObject("SequenceObject", 0, fullname); + pObj = GetIEditor()->GetObjectManager()->NewObject("SequenceObject", nullptr, fullname); } } } @@ -665,7 +631,7 @@ int CCryEditDoc::GetModifiedModule() return m_modifiedModuleFlags; } -BOOL CCryEditDoc::CanCloseFrame() +bool CCryEditDoc::CanCloseFrame() { // Ask the base class to ask for saving, which also includes the save // status of the plugins. Additionaly we query if all the plugins can exit @@ -674,21 +640,21 @@ BOOL CCryEditDoc::CanCloseFrame() // are not serialized in the project file if (!SaveModified()) { - return FALSE; + return false; } if (!GetIEditor()->GetPluginManager()->CanAllPluginsExitNow()) { - return FALSE; + return false; } // If there is an export in process, exiting will corrupt it if (CGameExporter::GetCurrentExporter() != nullptr) { - return FALSE; + return false; } - return TRUE; + return true; } bool CCryEditDoc::SaveModified() @@ -733,7 +699,7 @@ bool CCryEditDoc::OnOpenDocument(const QString& lpszPathName) TOpenDocContext context; if (!BeforeOpenDocument(lpszPathName, context)) { - return FALSE; + return false; } return DoOpenDocument(context); } @@ -776,7 +742,7 @@ bool CCryEditDoc::BeforeOpenDocument(const QString& lpszPathName, TOpenDocContex context.absoluteLevelPath = absolutePath; context.absoluteSlicePath = ""; } - return TRUE; + return true; } bool CCryEditDoc::DoOpenDocument(TOpenDocContext& context) @@ -813,7 +779,7 @@ bool CCryEditDoc::DoOpenDocument(TOpenDocContext& context) if (!LoadXmlArchiveArray(arrXmlAr, levelFilePath, levelFolderAbsolutePath)) { m_bLoadFailed = true; - return FALSE; + return false; } } if (!LoadLevel(arrXmlAr, context.absoluteLevelPath)) @@ -825,7 +791,7 @@ bool CCryEditDoc::DoOpenDocument(TOpenDocContext& context) if (m_bLoadFailed) { - return FALSE; + return false; } // Load AZ entities for the editor. @@ -846,7 +812,7 @@ bool CCryEditDoc::DoOpenDocument(TOpenDocContext& context) if (m_bLoadFailed) { - return FALSE; + return false; } StartStreamingLoad(); @@ -863,7 +829,7 @@ bool CCryEditDoc::DoOpenDocument(TOpenDocContext& context) // level. SetLevelExported(true); - return TRUE; + return true; } bool CCryEditDoc::OnNewDocument() @@ -959,7 +925,7 @@ bool CCryEditDoc::BeforeSaveDocument(const QString& lpszPathName, TSaveDocContex bool bSaved(true); context.bSaved = bSaved; - return TRUE; + return true; } bool CCryEditDoc::HasLayerNameConflicts() const @@ -1044,7 +1010,7 @@ bool CCryEditDoc::AfterSaveDocument([[maybe_unused]] const QString& lpszPathName else { CLogFile::WriteLine("$3Document successfully saved"); - SetModifiedFlag(FALSE); + SetModifiedFlag(false); SetModifiedModules(eModifiedNothing); MainWindow::instance()->ResetAutoSaveTimers(); } @@ -1052,14 +1018,6 @@ bool CCryEditDoc::AfterSaveDocument([[maybe_unused]] const QString& lpszPathName return bSaved; } - -static void GetUserSettingsFile(const QString& levelFolder, QString& userSettings) -{ - const char* pUserName = GetISystem()->GetUserName(); - QString fileName = QStringLiteral("%1_usersettings.editor_xml").arg(pUserName); - userSettings = Path::Make(levelFolder, fileName); -} - static bool TryRenameFile(const QString& oldPath, const QString& newPath, int retryAttempts=10) { QFile(newPath).setPermissions(QFile::ReadOther | QFile::WriteOther); @@ -1081,7 +1039,7 @@ static bool TryRenameFile(const QString& oldPath, const QString& newPath, int re bool CCryEditDoc::SaveLevel(const QString& filename) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(Editor); QWaitCursor wait; CAutoCheckOutDialogEnableForAll enableForAll; @@ -1101,7 +1059,7 @@ bool CCryEditDoc::SaveLevel(const QString& filename) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "CCryEditDoc::SaveLevel BackupBeforeSave"); + AZ_PROFILE_SCOPE(Editor, "CCryEditDoc::SaveLevel BackupBeforeSave"); BackupBeforeSave(); } @@ -1212,7 +1170,7 @@ bool CCryEditDoc::SaveLevel(const QString& filename) CPakFile pakFile; { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "CCryEditDoc::SaveLevel Open PakFile"); + AZ_PROFILE_SCOPE(Editor, "CCryEditDoc::SaveLevel Open PakFile"); if (!pakFile.Open(tempSaveFile.toUtf8().data(), false)) { gEnv->pLog->LogWarning("Unable to open pack file %s for writing", tempSaveFile.toUtf8().data()); @@ -1243,7 +1201,7 @@ bool CCryEditDoc::SaveLevel(const QString& filename) AZ::IO::ByteContainerStream> entitySaveStream(&entitySaveBuffer); { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "CCryEditDoc::SaveLevel Save Entities To Stream"); + AZ_PROFILE_SCOPE(Editor, "CCryEditDoc::SaveLevel Save Entities To Stream"); EBUS_EVENT_RESULT( savedEntities, AzToolsFramework::EditorEntityContextRequestBus, SaveToStreamForEditor, entitySaveStream, layerEntities, instancesInLayers); @@ -1257,8 +1215,8 @@ bool CCryEditDoc::SaveLevel(const QString& filename) if (savedEntities) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "CCryEditDoc::SaveLevel Updated PakFile levelEntities.editor_xml"); - pakFile.UpdateFile("LevelEntities.editor_xml", entitySaveBuffer.begin(), entitySaveBuffer.size()); + AZ_PROFILE_SCOPE(AzToolsFramework, "CCryEditDoc::SaveLevel Updated PakFile levelEntities.editor_xml"); + pakFile.UpdateFile("LevelEntities.editor_xml", entitySaveBuffer.begin(), static_cast(entitySaveBuffer.size())); // Save XML archive to pak file. bool bSaved = xmlAr.SaveToPak(Path::GetPath(tempSaveFile), pakFile); @@ -1596,7 +1554,7 @@ bool CCryEditDoc::LoadLevel(TDocMultiArchive& arrXmlAr, const QString& absoluteC // Set level path directly *after* DeleteContents(), since that will unload the previous level and clear the level path. GetIEditor()->GetGameEngine()->SetLevelPath(folderPath); - SetModifiedFlag(TRUE); // dirty during de-serialize + SetModifiedFlag(true); // dirty during de-serialize SetModifiedModules(eModifiedAll); Load(arrXmlAr, absoluteCryFilePath); @@ -1606,7 +1564,7 @@ bool CCryEditDoc::LoadLevel(TDocMultiArchive& arrXmlAr, const QString& absoluteC { pIPak->GetResourceList(AZ::IO::IArchive::RFOM_NextLevel)->Clear(); } - SetModifiedFlag(FALSE); // start off with unmodified + SetModifiedFlag(false); // start off with unmodified SetModifiedModules(eModifiedNothing); SetDocumentReady(true); GetIEditor()->Notify(eNotify_OnEndLoad); @@ -1907,7 +1865,7 @@ void CCryEditDoc::LogLoadTime(int time) const CLogFile::FormatLine("[LevelLoadTime] Level %s loaded in %d seconds", level.toUtf8().data(), time / 1000); #if defined(AZ_PLATFORM_WINDOWS) - SetFileAttributes(filename.toUtf8().data(), FILE_ATTRIBUTE_ARCHIVE); + SetFileAttributesW(filename.toStdWString().c_str(), FILE_ATTRIBUTE_ARCHIVE); #endif QFile file(filename); @@ -1982,7 +1940,7 @@ void CCryEditDoc::OnStartLevelResourceList() gEnv->pCryPak->GetResourceList(AZ::IO::IArchive::RFOM_Level)->Clear(); } -BOOL CCryEditDoc::DoFileSave() +bool CCryEditDoc::DoFileSave() { if (GetEditMode() == CCryEditDoc::DocumentEditingMode::LevelEdit) { @@ -2000,15 +1958,15 @@ BOOL CCryEditDoc::DoFileSave() QString newLevelPath = filename.left(filename.lastIndexOf('/') + 1); GetIEditor()->GetDocument()->SetPathName(filename); GetIEditor()->GetGameEngine()->SetLevelPath(newLevelPath); - return TRUE; + return true; } } - return FALSE; + return false; } } if (!IsDocumentReady()) { - return FALSE; + return false; } return Internal::SaveLevel(); @@ -2063,7 +2021,7 @@ void CCryEditDoc::InitEmptyLevel(int /*resolution*/, int /*unitSize*/, bool /*bU GetISystem()->GetISystemEventDispatcher()->OnSystemEvent(ESYSTEM_EVENT_LEVEL_LOAD_END, 0, 0); GetIEditor()->Notify(eNotify_OnEndNewScene); - SetModifiedFlag(FALSE); + SetModifiedFlag(false); SetLevelExported(false); SetModifiedModules(eModifiedNothing); @@ -2077,19 +2035,19 @@ void CCryEditDoc::CreateDefaultLevelAssets([[maybe_unused]] int resolution, [[ma void CCryEditDoc::OnEnvironmentPropertyChanged(IVariable* pVar) { - if (pVar == NULL) + if (pVar == nullptr) { return; } XmlNodeRef node = GetEnvironmentTemplate(); - if (node == NULL) + if (node == nullptr) { return; } // QVariant will not convert a void * to int, so do it manually. - int nKey = reinterpret_cast(pVar->GetUserData().value()); + int nKey = static_cast(reinterpret_cast(pVar->GetUserData().value())); int nGroup = (nKey & 0xFFFF0000) >> 16; int nChild = (nKey & 0x0000FFFF); @@ -2101,7 +2059,7 @@ void CCryEditDoc::OnEnvironmentPropertyChanged(IVariable* pVar) XmlNodeRef groupNode = node->getChild(nGroup); - if (groupNode == NULL) + if (groupNode == nullptr) { return; } @@ -2112,7 +2070,7 @@ void CCryEditDoc::OnEnvironmentPropertyChanged(IVariable* pVar) } XmlNodeRef childNode = groupNode->getChild(nChild); - if (childNode == NULL) + if (childNode == nullptr) { return; } @@ -2132,14 +2090,14 @@ void CCryEditDoc::OnEnvironmentPropertyChanged(IVariable* pVar) childNode->setAttr("value", childValue.toUtf8().data()); } -QString CCryEditDoc::GetCryIndexPath(const LPCTSTR levelFilePath) const +QString CCryEditDoc::GetCryIndexPath(const char* levelFilePath) const { QString levelPath = Path::GetPath(levelFilePath); QString levelName = Path::GetFileName(levelFilePath); return Path::AddPathSlash(levelPath + levelName + "_editor"); } -BOOL CCryEditDoc::LoadXmlArchiveArray(TDocMultiArchive& arrXmlAr, const QString& absoluteLevelPath, const QString& levelPath) +bool CCryEditDoc::LoadXmlArchiveArray(TDocMultiArchive& arrXmlAr, const QString& absoluteLevelPath, const QString& levelPath) { auto pIPak = GetIEditor()->GetSystem()->GetIPak(); @@ -2148,7 +2106,7 @@ BOOL CCryEditDoc::LoadXmlArchiveArray(TDocMultiArchive& arrXmlAr, const QString& CXmlArchive* pXmlAr = new CXmlArchive(); if (!pXmlAr) { - return FALSE; + return false; } CXmlArchive& xmlAr = *pXmlAr; @@ -2159,7 +2117,7 @@ BOOL CCryEditDoc::LoadXmlArchiveArray(TDocMultiArchive& arrXmlAr, const QString& bool openLevelPakFileSuccess = pIPak->OpenPack(levelPath.toUtf8().data(), absoluteLevelPath.toUtf8().data()); if (!openLevelPakFileSuccess) { - return FALSE; + return false; } CPakFile pakFile; @@ -2167,13 +2125,13 @@ BOOL CCryEditDoc::LoadXmlArchiveArray(TDocMultiArchive& arrXmlAr, const QString& pIPak->ClosePack(absoluteLevelPath.toUtf8().data()); if (!loadFromPakSuccess) { - return FALSE; + return false; } FillXmlArArray(arrXmlAr, &xmlAr); } - return TRUE; + return true; } void CCryEditDoc::ReleaseXmlArchiveArray(TDocMultiArchive& arrXmlAr) diff --git a/Code/Editor/CryEditDoc.h b/Code/Editor/CryEditDoc.h index d32e8e5bb1..a96e9428b6 100644 --- a/Code/Editor/CryEditDoc.h +++ b/Code/Editor/CryEditDoc.h @@ -26,7 +26,7 @@ struct ICVar; // Filename of the temporary file used for the hold / fetch operation // conform to the "$tmp[0-9]_" naming convention -#define HOLD_FETCH_FILE "$tmp_hold" +#define HOLD_FETCH_FILE "$tmp_hold" class CCryEditDoc : public QObject @@ -36,7 +36,7 @@ class CCryEditDoc Q_PROPERTY(bool modified READ IsModified WRITE SetModifiedFlag); Q_PROPERTY(QString pathName READ GetLevelPathName WRITE SetPathName); Q_PROPERTY(QString title READ GetTitle WRITE SetTitle); - + public: // Create from serialization only enum DocumentEditingMode { @@ -82,7 +82,7 @@ public: // Create from serialization only bool DoSave(const QString& pathName, bool replace); SANDBOX_API bool Save(); - virtual BOOL DoFileSave(); + virtual bool DoFileSave(); bool SaveModified(); virtual bool BackupBeforeSave(bool bForce = false); @@ -102,7 +102,7 @@ public: // Create from serialization only bool IsLevelExported() const; void SetLevelExported(bool boExported = true); - BOOL CanCloseFrame(); + bool CanCloseFrame(); enum class FetchPolicy { @@ -144,7 +144,7 @@ protected: }; bool BeforeOpenDocument(const QString& lpszPathName, TOpenDocContext& context); bool DoOpenDocument(TOpenDocContext& context); - virtual BOOL LoadXmlArchiveArray(TDocMultiArchive& arrXmlAr, const QString& absoluteLevelPath, const QString& levelPath); + virtual bool LoadXmlArchiveArray(TDocMultiArchive& arrXmlAr, const QString& absoluteLevelPath, const QString& levelPath); virtual void ReleaseXmlArchiveArray(TDocMultiArchive& arrXmlAr); virtual void Load(TDocMultiArchive& arrXmlAr, const QString& szFilename); @@ -180,7 +180,7 @@ protected: void OnStartLevelResourceList(); static void OnValidateSurfaceTypesChanged(ICVar*); - QString GetCryIndexPath(const LPCTSTR levelFilePath) const; + QString GetCryIndexPath(const char* levelFilePath) const; ////////////////////////////////////////////////////////////////////////// // SliceEditorEntityOwnershipServiceNotificationBus::Handler diff --git a/Code/Editor/CryEditPy.cpp b/Code/Editor/CryEditPy.cpp index e65af3a19b..7a407aac37 100644 --- a/Code/Editor/CryEditPy.cpp +++ b/Code/Editor/CryEditPy.cpp @@ -97,11 +97,6 @@ namespace } } - const char* PyGetGameFolder() - { - return Path::GetEditingGameDataFolder().c_str(); - } - AZStd::string PyGetGameFolderAsString() { return Path::GetEditingGameDataFolder(); @@ -210,7 +205,7 @@ namespace const char* PyGetCurrentLevelName() { // Using static member to capture temporary data - static string tempLevelName; + static AZ::IO::FixedMaxPathString tempLevelName; tempLevelName = GetIEditor()->GetGameEngine()->GetLevelName().toUtf8().data(); return tempLevelName.c_str(); } @@ -218,7 +213,7 @@ namespace const char* PyGetCurrentLevelPath() { // Using static member to capture temporary data - static string tempLevelPath; + static AZ::IO::FixedMaxPathString tempLevelPath; tempLevelPath = GetIEditor()->GetGameEngine()->GetLevelPath().toUtf8().data(); return tempLevelPath.c_str(); } @@ -359,7 +354,7 @@ namespace { AZ::TickBus::Handler::BusConnect(); } - ~Ticker() + ~Ticker() override { AZ::TickBus::Handler::BusDisconnect(); } @@ -406,6 +401,16 @@ inline namespace Commands { return static_cast(GetIEditor()->GetEditorConfigPlatform()); } + + bool PyAttachDebugger() + { + return AZ::Debug::Trace::AttachDebugger(); + } + + bool PyWaitForDebugger(float timeoutSeconds = -1.f) + { + return AZ::Debug::Trace::WaitForDebugger(timeoutSeconds); + } } namespace AzToolsFramework @@ -453,6 +458,9 @@ namespace AzToolsFramework addLegacyGeneral(behaviorContext->Method("start_process_detached", PyStartProcessDetached, nullptr, "Launches a detached process with an optional space separated list of arguments.")); addLegacyGeneral(behaviorContext->Method("launch_lua_editor", PyLaunchLUAEditor, nullptr, "Launches the Lua editor, may receive a list of space separate file paths, or an empty string to only open the editor.")); + addLegacyGeneral(behaviorContext->Method("attach_debugger", PyAttachDebugger, nullptr, "Prompts for attaching the debugger")); + addLegacyGeneral(behaviorContext->Method("wait_for_debugger", PyWaitForDebugger, behaviorContext->MakeDefaultValues(-1.f), "Pauses this thread execution until the debugger has been attached")); + // this will put these methods into the 'azlmbr.legacy.checkout_dialog' module auto addCheckoutDialog = [](AZ::BehaviorContext::GlobalMethodBuilder methodBuilder) { diff --git a/Code/Editor/CustomAspectRatioDlg.cpp b/Code/Editor/CustomAspectRatioDlg.cpp index 16f50601d1..f24ff9ccdb 100644 --- a/Code/Editor/CustomAspectRatioDlg.cpp +++ b/Code/Editor/CustomAspectRatioDlg.cpp @@ -22,7 +22,7 @@ AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING #define MIN_ASPECT 1 #define MAX_ASPECT 16384 -CCustomAspectRatioDlg::CCustomAspectRatioDlg(int x, int y, QWidget* pParent /*=NULL*/) +CCustomAspectRatioDlg::CCustomAspectRatioDlg(int x, int y, QWidget* pParent /*=nullptr*/) : QDialog(pParent) , m_xDefault(x) , m_yDefault(y) diff --git a/Code/Editor/CustomResolutionDlg.cpp b/Code/Editor/CustomResolutionDlg.cpp index b970b80fe7..9e0e11e2e4 100644 --- a/Code/Editor/CustomResolutionDlg.cpp +++ b/Code/Editor/CustomResolutionDlg.cpp @@ -25,7 +25,7 @@ AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING #define MIN_RES 64 #define MAX_RES 8192 -CCustomResolutionDlg::CCustomResolutionDlg(int w, int h, QWidget* pParent /*=NULL*/) +CCustomResolutionDlg::CCustomResolutionDlg(int w, int h, QWidget* pParent /*=nullptr*/) : QDialog(pParent) , m_wDefault(w) , m_hDefault(h) @@ -50,12 +50,12 @@ void CCustomResolutionDlg::OnInitDialog() m_ui->m_height->setValue(m_hDefault); QString maxDimensionString; - QTextStream(&maxDimensionString) - << "Maximum Dimension: " << MAX_RES << Qt::endl + QTextStream(&maxDimensionString) + << "Maximum Dimension: " << MAX_RES << Qt::endl << Qt::endl << "Note: Dimensions over 8K may be" << Qt::endl << "unstable depending on hardware."; - + m_ui->m_maxDimension->setText(maxDimensionString); } diff --git a/Code/Editor/CustomizeKeyboardDialog.cpp b/Code/Editor/CustomizeKeyboardDialog.cpp index d6bea6860f..ce09f8d878 100644 --- a/Code/Editor/CustomizeKeyboardDialog.cpp +++ b/Code/Editor/CustomizeKeyboardDialog.cpp @@ -87,7 +87,7 @@ public: : QAbstractListModel(parent) { } - virtual ~MenuActionsModel() {} + ~MenuActionsModel() override {} int rowCount([[maybe_unused]] const QModelIndex& parent = QModelIndex()) const override { @@ -134,7 +134,7 @@ public: , m_action(nullptr) { } - virtual ~ActionShortcutsModel() {} + ~ActionShortcutsModel() override {} int rowCount([[maybe_unused]] const QModelIndex& parent = QModelIndex()) const override { diff --git a/Code/Editor/DisplaySettings.cpp b/Code/Editor/DisplaySettings.cpp index dc4cf083a9..ed4ca180b4 100644 --- a/Code/Editor/DisplaySettings.cpp +++ b/Code/Editor/DisplaySettings.cpp @@ -46,7 +46,7 @@ void CDisplaySettings::SaveRegistry() SaveValue("Settings", "RenderFlags", m_renderFlags); SaveValue("Settings", "DisplayFlags", m_flags & SETTINGS_SERIALIZABLE_FLAGS_MASK); SaveValue("Settings", "DebugFlags", m_debugFlags); - SaveValue("Settings", "LabelsDistance", m_labelsDistance); + SaveValue("Settings", "LabelsDistance", static_cast(m_labelsDistance)); } void CDisplaySettings::LoadRegistry() @@ -56,9 +56,9 @@ void CDisplaySettings::LoadRegistry() LoadValue("Settings", "DisplayFlags", m_flags); m_flags &= SETTINGS_SERIALIZABLE_FLAGS_MASK; LoadValue("Settings", "DebugFlags", m_debugFlags); - int temp = m_labelsDistance; + int temp = static_cast(m_labelsDistance); LoadValue("Settings", "LabelsDistance", temp); - m_labelsDistance = temp; + m_labelsDistance = static_cast(temp); gSettings.objectHideMask = m_objectHideMask; } diff --git a/Code/Editor/EditMode/SubObjectSelectionReferenceFrameCalculator.cpp b/Code/Editor/EditMode/SubObjectSelectionReferenceFrameCalculator.cpp deleted file mode 100644 index cf7cf5e959..0000000000 --- a/Code/Editor/EditMode/SubObjectSelectionReferenceFrameCalculator.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -// Description : Calculate the reference frame for sub-object selections. - -#include "EditorDefs.h" - -#include "SubObjectSelectionReferenceFrameCalculator.h" - -SubObjectSelectionReferenceFrameCalculator::SubObjectSelectionReferenceFrameCalculator(ESubObjElementType selectionType) - : m_anySelected(false) - , pos(0.0f, 0.0f, 0.0f) - , normal(0.0f, 0.0f, 0.0f) - , nNormals(0) - , selectionType(selectionType) - , bUseExplicitFrame(false) - , bExplicitAnySelected(false) -{ -} - -void SubObjectSelectionReferenceFrameCalculator::SetExplicitFrame(bool bAnySelected, const Matrix34& refFrame) -{ - this->m_refFrame = refFrame; - this->bUseExplicitFrame = true; - this->bExplicitAnySelected = bAnySelected; -} - -bool SubObjectSelectionReferenceFrameCalculator::GetFrame(Matrix34& refFrame) -{ - if (this->bUseExplicitFrame) - { - refFrame = this->m_refFrame; - return this->bExplicitAnySelected; - } - else - { - refFrame.SetIdentity(); - - if (this->nNormals > 0) - { - this->normal = this->normal / this->nNormals; - if (!this->normal.IsZero()) - { - this->normal.Normalize(); - } - - // Average position. - this->pos = this->pos / this->nNormals; - refFrame.SetTranslation(this->pos); - } - - if (this->m_anySelected) - { - if (!this->normal.IsZero()) - { - Vec3 xAxis(1, 0, 0), yAxis(0, 1, 0), zAxis(0, 0, 1); - if (this->normal.IsEquivalent(zAxis) || normal.IsEquivalent(-zAxis)) - { - zAxis = xAxis; - } - xAxis = this->normal.Cross(zAxis).GetNormalized(); - yAxis = xAxis.Cross(this->normal).GetNormalized(); - refFrame.SetFromVectors(xAxis, yAxis, normal, pos); - } - } - - return m_anySelected; - } -} diff --git a/Code/Editor/EditMode/SubObjectSelectionReferenceFrameCalculator.h b/Code/Editor/EditMode/SubObjectSelectionReferenceFrameCalculator.h deleted file mode 100644 index 7c0d6f40c6..0000000000 --- a/Code/Editor/EditMode/SubObjectSelectionReferenceFrameCalculator.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -// Description : Calculate the reference frame for sub-object selections. - - -#ifndef CRYINCLUDE_EDITOR_EDITMODE_SUBOBJECTSELECTIONREFERENCEFRAMECALCULATOR_H -#define CRYINCLUDE_EDITOR_EDITMODE_SUBOBJECTSELECTIONREFERENCEFRAMECALCULATOR_H -#pragma once - - -#include "ISubObjectSelectionReferenceFrameCalculator.h" -#include "Objects/SubObjSelection.h" - -class SubObjectSelectionReferenceFrameCalculator - : public ISubObjectSelectionReferenceFrameCalculator -{ -public: - SubObjectSelectionReferenceFrameCalculator(ESubObjElementType selectionType); - - virtual void SetExplicitFrame(bool bAnySelected, const Matrix34& refFrame); - bool GetFrame(Matrix34& refFrame); - -private: - bool m_anySelected; - Vec3 pos; - Vec3 normal; - int nNormals; - ESubObjElementType selectionType; - std::vector positions; - Matrix34 m_refFrame; - bool bUseExplicitFrame; - bool bExplicitAnySelected; -}; - -#endif // CRYINCLUDE_EDITOR_EDITMODE_SUBOBJECTSELECTIONREFERENCEFRAMECALCULATOR_H diff --git a/Code/Editor/EditorDefs.h b/Code/Editor/EditorDefs.h index c98209befe..4115e8433a 100644 --- a/Code/Editor/EditorDefs.h +++ b/Code/Editor/EditorDefs.h @@ -8,8 +8,6 @@ #pragma once -#ifndef CRYINCLUDE_EDITOR_EDITORDEFS_H -#define CRYINCLUDE_EDITOR_EDITORDEFS_H #include @@ -33,19 +31,6 @@ #include #include -// Warnings in STL -#pragma warning (disable : 4786) // identifier was truncated to 'number' characters in the debug information. -#pragma warning (disable : 4244) // conversion from 'long' to 'float', possible loss of data -#pragma warning (disable : 4018) // signed/unsigned mismatch -#pragma warning (disable : 4800) // BOOL bool conversion - -// Disable warning when a function returns a value inside an __asm block -#pragma warning (disable : 4035) - -////////////////////////////////////////////////////////////////////////// -// 64-bits related warnings. -#pragma warning (disable : 4267) // conversion from 'size_t' to 'int', possible loss of data - ////////////////////////////////////////////////////////////////////////// // Simple type definitions. ////////////////////////////////////////////////////////////////////////// @@ -85,17 +70,17 @@ #endif #ifndef SAFE_DELETE -#define SAFE_DELETE(p) { if (p) { delete (p); (p) = NULL; } \ +#define SAFE_DELETE(p) { if (p) { delete (p); (p) = nullptr; } \ } #endif #ifndef SAFE_DELETE_ARRAY -#define SAFE_DELETE_ARRAY(p) { if (p) { delete[] (p); (p) = NULL; } \ +#define SAFE_DELETE_ARRAY(p) { if (p) { delete[] (p); (p) = nullptr; } \ } #endif #ifndef SAFE_RELEASE -#define SAFE_RELEASE(p) { if (p) { (p)->Release(); (p) = NULL; } \ +#define SAFE_RELEASE(p) { if (p) { (p)->Release(); (p) = nullptr; } \ } #endif @@ -199,5 +184,3 @@ #endif #endif - -#endif // CRYINCLUDE_EDITOR_EDITORDEFS_H diff --git a/Code/Editor/EditorFileMonitor.cpp b/Code/Editor/EditorFileMonitor.cpp index 96dc883ab0..7feb9d32a8 100644 --- a/Code/Editor/EditorFileMonitor.cpp +++ b/Code/Editor/EditorFileMonitor.cpp @@ -55,10 +55,10 @@ bool CEditorFileMonitor::RegisterListener(IFileChangeListener* pListener, const ////////////////////////////////////////////////////////////////////////// -static string CanonicalizePath(const char* path) +static AZStd::string CanonicalizePath(const char* path) { auto canon = QFileInfo(path).canonicalFilePath(); - return canon.isEmpty() ? string(path) : string(canon.toUtf8()); + return canon.isEmpty() ? AZStd::string(path) : AZStd::string(canon.toUtf8()); } ////////////////////////////////////////////////////////////////////////// @@ -66,8 +66,8 @@ bool CEditorFileMonitor::RegisterListener(IFileChangeListener* pListener, const { bool success = true; - string gameFolder = Path::GetEditingGameDataFolder().c_str(); - string naivePath; + AZStd::string gameFolder = Path::GetEditingGameDataFolder().c_str(); + AZStd::string naivePath; CFileChangeMonitor* fileChangeMonitor = CFileChangeMonitor::Instance(); AZ_Assert(fileChangeMonitor, "CFileChangeMonitor singleton missing."); @@ -75,12 +75,12 @@ bool CEditorFileMonitor::RegisterListener(IFileChangeListener* pListener, const // Append slash in preparation for appending the second part. naivePath = PathUtil::AddSlash(naivePath); naivePath += sFolderRelativeToGame; - naivePath.replace('/', '\\'); + AZ::StringFunc::Replace(naivePath, '/', '\\'); // Remove the final slash if the given item is a folder so the file change monitor correctly picks up on it. naivePath = PathUtil::RemoveSlash(naivePath); - string canonicalizedPath = CanonicalizePath(naivePath.c_str()); + AZStd::string canonicalizedPath = CanonicalizePath(naivePath.c_str()); if (fileChangeMonitor->IsDirectory(canonicalizedPath.c_str()) || fileChangeMonitor->IsFile(canonicalizedPath.c_str())) { @@ -162,7 +162,7 @@ QString RemoveGameName(const QString &filename) void CEditorFileMonitor::OnFileMonitorChange(const SFileChangeInfo& rChange) { CCryEditApp* app = CCryEditApp::instance(); - if (app == NULL || app->IsExiting()) + if (app == nullptr || app->IsExiting()) { return; } diff --git a/Code/Editor/EditorFileMonitor.h b/Code/Editor/EditorFileMonitor.h index ac33fee9f4..7474d5e43a 100644 --- a/Code/Editor/EditorFileMonitor.h +++ b/Code/Editor/EditorFileMonitor.h @@ -42,7 +42,7 @@ private: QString extension; SFileChangeCallback() - : pListener(NULL) + : pListener(nullptr) {} SFileChangeCallback(IFileChangeListener* pListener, const char* item, const char* extension) diff --git a/Code/Editor/EditorModularViewportCameraComposer.cpp b/Code/Editor/EditorModularViewportCameraComposer.cpp new file mode 100644 index 0000000000..498d6f3353 --- /dev/null +++ b/Code/Editor/EditorModularViewportCameraComposer.cpp @@ -0,0 +1,286 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include + +#include +#include +#include +#include +#include + +namespace SandboxEditor +{ + static AzFramework::TranslateCameraInputChannelIds BuildTranslateCameraInputChannelIds() + { + AzFramework::TranslateCameraInputChannelIds translateCameraInputChannelIds; + translateCameraInputChannelIds.m_leftChannelId = SandboxEditor::CameraTranslateLeftChannelId(); + translateCameraInputChannelIds.m_rightChannelId = SandboxEditor::CameraTranslateRightChannelId(); + translateCameraInputChannelIds.m_forwardChannelId = SandboxEditor::CameraTranslateForwardChannelId(); + translateCameraInputChannelIds.m_backwardChannelId = SandboxEditor::CameraTranslateBackwardChannelId(); + translateCameraInputChannelIds.m_upChannelId = SandboxEditor::CameraTranslateUpChannelId(); + translateCameraInputChannelIds.m_downChannelId = SandboxEditor::CameraTranslateDownChannelId(); + translateCameraInputChannelIds.m_boostChannelId = SandboxEditor::CameraTranslateBoostChannelId(); + + return translateCameraInputChannelIds; + } + + EditorModularViewportCameraComposer::EditorModularViewportCameraComposer(const AzFramework::ViewportId viewportId) + : m_viewportId(viewportId) + { + EditorModularViewportCameraComposerNotificationBus::Handler::BusConnect(viewportId); + } + + EditorModularViewportCameraComposer::~EditorModularViewportCameraComposer() + { + EditorModularViewportCameraComposerNotificationBus::Handler::BusDisconnect(); + } + + AZStd::shared_ptr EditorModularViewportCameraComposer:: + CreateModularViewportCameraController() + { + SetupCameras(); + + auto controller = AZStd::make_shared(); + + controller->SetCameraViewportContextBuilderCallback( + [viewportId = m_viewportId](AZStd::unique_ptr& cameraViewportContext) + { + cameraViewportContext = AZStd::make_unique(viewportId); + }); + + controller->SetCameraPriorityBuilderCallback( + [](AtomToolsFramework::CameraControllerPriorityFn& cameraControllerPriorityFn) + { + cameraControllerPriorityFn = AtomToolsFramework::DefaultCameraControllerPriority; + }); + + controller->SetCameraPropsBuilderCallback( + [](AzFramework::CameraProps& cameraProps) + { + cameraProps.m_rotateSmoothnessFn = [] + { + return SandboxEditor::CameraRotateSmoothness(); + }; + + cameraProps.m_translateSmoothnessFn = [] + { + return SandboxEditor::CameraTranslateSmoothness(); + }; + + cameraProps.m_rotateSmoothingEnabledFn = [] + { + return SandboxEditor::CameraRotateSmoothingEnabled(); + }; + + cameraProps.m_translateSmoothingEnabledFn = [] + { + return SandboxEditor::CameraTranslateSmoothingEnabled(); + }; + }); + + controller->SetCameraListBuilderCallback( + [this](AzFramework::Cameras& cameras) + { + cameras.AddCamera(m_firstPersonRotateCamera); + cameras.AddCamera(m_firstPersonPanCamera); + cameras.AddCamera(m_firstPersonTranslateCamera); + cameras.AddCamera(m_firstPersonScrollCamera); + cameras.AddCamera(m_orbitCamera); + }); + + return controller; + } + + void EditorModularViewportCameraComposer::SetupCameras() + { + const auto hideCursor = [viewportId = m_viewportId] + { + if (SandboxEditor::CameraCaptureCursorForLook()) + { + AzToolsFramework::ViewportInteraction::ViewportMouseCursorRequestBus::Event( + viewportId, &AzToolsFramework::ViewportInteraction::ViewportMouseCursorRequestBus::Events::BeginCursorCapture); + } + }; + const auto showCursor = [viewportId = m_viewportId] + { + if (SandboxEditor::CameraCaptureCursorForLook()) + { + AzToolsFramework::ViewportInteraction::ViewportMouseCursorRequestBus::Event( + viewportId, &AzToolsFramework::ViewportInteraction::ViewportMouseCursorRequestBus::Events::EndCursorCapture); + } + }; + + m_firstPersonRotateCamera = AZStd::make_shared(SandboxEditor::CameraFreeLookChannelId()); + + m_firstPersonRotateCamera->m_rotateSpeedFn = [] + { + return SandboxEditor::CameraRotateSpeed(); + }; + + // 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); + m_firstPersonRotateCamera->SetActivationEndedFn(showCursor); + + m_firstPersonPanCamera = + AZStd::make_shared(SandboxEditor::CameraFreePanChannelId(), AzFramework::LookPan); + + m_firstPersonPanCamera->m_panSpeedFn = [] + { + return SandboxEditor::CameraPanSpeed(); + }; + + m_firstPersonPanCamera->m_invertPanXFn = [] + { + return SandboxEditor::CameraPanInvertedX(); + }; + + m_firstPersonPanCamera->m_invertPanYFn = [] + { + return SandboxEditor::CameraPanInvertedY(); + }; + + const auto translateCameraInputChannelIds = BuildTranslateCameraInputChannelIds(); + + m_firstPersonTranslateCamera = + AZStd::make_shared(AzFramework::LookTranslation, translateCameraInputChannelIds); + + m_firstPersonTranslateCamera->m_translateSpeedFn = [] + { + return SandboxEditor::CameraTranslateSpeed(); + }; + + m_firstPersonTranslateCamera->m_boostMultiplierFn = [] + { + return SandboxEditor::CameraBoostMultiplier(); + }; + + m_firstPersonScrollCamera = AZStd::make_shared(); + + m_firstPersonScrollCamera->m_scrollSpeedFn = [] + { + return SandboxEditor::CameraScrollSpeed(); + }; + + m_orbitCamera = AZStd::make_shared(SandboxEditor::CameraOrbitChannelId()); + + m_orbitCamera->SetLookAtFn( + [viewportId = m_viewportId](const AZ::Vector3& position, const AZ::Vector3& direction) -> AZStd::optional + { + AZStd::optional lookAtAfterInterpolation; + AtomToolsFramework::ModularViewportCameraControllerRequestBus::EventResult( + lookAtAfterInterpolation, viewportId, + &AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::LookAtAfterInterpolation); + + // initially attempt to use the last set look at point after an interpolation has finished + if (lookAtAfterInterpolation.has_value()) + { + return *lookAtAfterInterpolation; + } + + const float RayDistance = 1000.0f; + AzFramework::RenderGeometry::RayRequest ray; + ray.m_startWorldPosition = position; + ray.m_endWorldPosition = position + direction * RayDistance; + ray.m_onlyVisible = true; + + AzFramework::RenderGeometry::RayResult renderGeometryIntersectionResult; + AzFramework::RenderGeometry::IntersectorBus::EventResult( + renderGeometryIntersectionResult, AzToolsFramework::GetEntityContextId(), + &AzFramework::RenderGeometry::IntersectorBus::Events::RayIntersect, ray); + + // attempt a ray intersection with any visible mesh and return the intersection position if successful + if (renderGeometryIntersectionResult) + { + return renderGeometryIntersectionResult.m_worldPosition; + } + + // if there is no selection or no intersection, fallback to default camera orbit behavior (ground plane + // intersection) + return {}; + }); + + m_orbitRotateCamera = AZStd::make_shared(SandboxEditor::CameraOrbitLookChannelId()); + + m_orbitRotateCamera->m_rotateSpeedFn = [] + { + return SandboxEditor::CameraRotateSpeed(); + }; + + m_orbitRotateCamera->m_invertYawFn = [] + { + return SandboxEditor::CameraOrbitYawRotationInverted(); + }; + + m_orbitTranslateCamera = + AZStd::make_shared(AzFramework::OrbitTranslation, translateCameraInputChannelIds); + + m_orbitTranslateCamera->m_translateSpeedFn = [] + { + return SandboxEditor::CameraTranslateSpeed(); + }; + + m_orbitTranslateCamera->m_boostMultiplierFn = [] + { + return SandboxEditor::CameraBoostMultiplier(); + }; + + m_orbitDollyScrollCamera = AZStd::make_shared(); + + m_orbitDollyScrollCamera->m_scrollSpeedFn = [] + { + return SandboxEditor::CameraScrollSpeed(); + }; + + m_orbitDollyMoveCamera = + AZStd::make_shared(SandboxEditor::CameraOrbitDollyChannelId()); + + m_orbitDollyMoveCamera->m_cursorSpeedFn = [] + { + return SandboxEditor::CameraDollyMotionSpeed(); + }; + + m_orbitPanCamera = AZStd::make_shared(SandboxEditor::CameraOrbitPanChannelId(), AzFramework::OrbitPan); + + m_orbitPanCamera->m_panSpeedFn = [] + { + return SandboxEditor::CameraPanSpeed(); + }; + + m_orbitPanCamera->m_invertPanXFn = [] + { + return SandboxEditor::CameraPanInvertedX(); + }; + + m_orbitPanCamera->m_invertPanYFn = [] + { + return SandboxEditor::CameraPanInvertedY(); + }; + + m_orbitCamera->m_orbitCameras.AddCamera(m_orbitRotateCamera); + m_orbitCamera->m_orbitCameras.AddCamera(m_orbitTranslateCamera); + m_orbitCamera->m_orbitCameras.AddCamera(m_orbitDollyScrollCamera); + m_orbitCamera->m_orbitCameras.AddCamera(m_orbitDollyMoveCamera); + m_orbitCamera->m_orbitCameras.AddCamera(m_orbitPanCamera); + } + + void EditorModularViewportCameraComposer::OnEditorModularViewportCameraComposerSettingsChanged() + { + const auto translateCameraInputChannelIds = BuildTranslateCameraInputChannelIds(); + m_firstPersonTranslateCamera->SetTranslateCameraInputChannelIds(translateCameraInputChannelIds); + m_orbitTranslateCamera->SetTranslateCameraInputChannelIds(translateCameraInputChannelIds); + + m_firstPersonPanCamera->SetPanInputChannelId(SandboxEditor::CameraFreePanChannelId()); + m_orbitPanCamera->SetPanInputChannelId(SandboxEditor::CameraOrbitPanChannelId()); + m_firstPersonRotateCamera->SetRotateInputChannelId(SandboxEditor::CameraFreeLookChannelId()); + m_orbitRotateCamera->SetRotateInputChannelId(SandboxEditor::CameraOrbitLookChannelId()); + m_orbitCamera->SetOrbitInputChannelId(SandboxEditor::CameraOrbitChannelId()); + m_orbitDollyMoveCamera->SetDollyInputChannelId(SandboxEditor::CameraOrbitDollyChannelId()); + } +} // namespace SandboxEditor diff --git a/Code/Editor/EditorModularViewportCameraComposer.h b/Code/Editor/EditorModularViewportCameraComposer.h new file mode 100644 index 0000000000..cb223d39e6 --- /dev/null +++ b/Code/Editor/EditorModularViewportCameraComposer.h @@ -0,0 +1,48 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include +#include +#include + +namespace SandboxEditor +{ + //! Type responsible for building the editor's modular viewport camera controller. + class EditorModularViewportCameraComposer : private EditorModularViewportCameraComposerNotificationBus::Handler + { + public: + SANDBOX_API explicit EditorModularViewportCameraComposer(AzFramework::ViewportId viewportId); + SANDBOX_API ~EditorModularViewportCameraComposer(); + + //! Build a ModularViewportCameraController from the associated camera inputs. + SANDBOX_API AZStd::shared_ptr CreateModularViewportCameraController(); + + private: + //! Setup all internal camera inputs. + void SetupCameras(); + + // EditorModularViewportCameraComposerNotificationBus overrides ... + void OnEditorModularViewportCameraComposerSettingsChanged() override; + + AZStd::shared_ptr m_firstPersonRotateCamera; + AZStd::shared_ptr m_firstPersonPanCamera; + AZStd::shared_ptr m_firstPersonTranslateCamera; + AZStd::shared_ptr m_firstPersonScrollCamera; + AZStd::shared_ptr m_orbitCamera; + AZStd::shared_ptr m_orbitRotateCamera; + AZStd::shared_ptr m_orbitTranslateCamera; + AZStd::shared_ptr m_orbitDollyScrollCamera; + AZStd::shared_ptr m_orbitDollyMoveCamera; + AZStd::shared_ptr m_orbitPanCamera; + + AzFramework::ViewportId m_viewportId; + }; +} // namespace SandboxEditor diff --git a/Code/Editor/EditorModularViewportCameraComposerBus.h b/Code/Editor/EditorModularViewportCameraComposerBus.h new file mode 100644 index 0000000000..ac760b8a9a --- /dev/null +++ b/Code/Editor/EditorModularViewportCameraComposerBus.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include +#include + +namespace SandboxEditor +{ + //! Notifications for changes to the editor modular viewport camera controller. + class EditorModularViewportCameraComposerNotifications + { + public: + //! Notify any listeners when changes have been made to the modular viewport camera settings. + //! @note This is used to update any cached input channels when controls are modified. + virtual void OnEditorModularViewportCameraComposerSettingsChanged() = 0; + + protected: + ~EditorModularViewportCameraComposerNotifications() = default; + }; + + using EditorModularViewportCameraComposerNotificationBus = + AZ::EBus; +} // namespace SandboxEditor diff --git a/Code/Editor/EditorPanelUtils.cpp b/Code/Editor/EditorPanelUtils.cpp index 9091bb4c2f..12e9457474 100644 --- a/Code/Editor/EditorPanelUtils.cpp +++ b/Code/Editor/EditorPanelUtils.cpp @@ -49,7 +49,7 @@ class CEditorPanelUtils_Impl { #pragma region Drag & Drop public: - virtual void SetViewportDragOperation(void(* dropCallback)(CViewport* viewport, int dragPointX, int dragPointY, void* custom), void* custom) override + void SetViewportDragOperation(void(* dropCallback)(CViewport* viewport, int dragPointX, int dragPointY, void* custom), void* custom) override { for (int i = 0; i < GetIEditor()->GetViewManager()->GetViewCount(); i++) { @@ -60,13 +60,13 @@ public: #pragma region Preview Window public: - virtual int PreviewWindow_GetDisplaySettingsDebugFlags(CDisplaySettings* settings) + int PreviewWindow_GetDisplaySettingsDebugFlags(CDisplaySettings* settings) override { CRY_ASSERT(settings); return settings->GetDebugFlags(); } - virtual void PreviewWindow_SetDisplaySettingsDebugFlags(CDisplaySettings* settings, int flags) + void PreviewWindow_SetDisplaySettingsDebugFlags(CDisplaySettings* settings, int flags) override { CRY_ASSERT(settings); settings->SetDebugFlags(flags); @@ -79,7 +79,7 @@ protected: bool m_hotkeysAreEnabled; public: - virtual bool HotKey_Import() override + bool HotKey_Import() override { QVector > keys; QString filepath = QFileDialog::getOpenFileName(nullptr, "Select shortcut configuration to load", @@ -130,7 +130,7 @@ public: HotKey_BuildDefaults(); for (QPair key : keys) { - for (unsigned int j = 0; j < hotkeys.count(); j++) + for (int j = 0; j < hotkeys.count(); j++) { if (hotkeys[j].path.compare(key.first, Qt::CaseInsensitive) == 0) { @@ -143,7 +143,7 @@ public: return result; } - virtual void HotKey_Export() override + void HotKey_Export() override { auto settingDir = AZ::IO::FixedMaxPath(AZ::Utils::GetEnginePath()) / "Editor" / "Plugins" / "ParticleEditorPlugin" / "settings"; QString filepath = QFileDialog::getSaveFileName(nullptr, "Select shortcut configuration to load", settingDir.c_str(), "HotKey Config Files (*.hkxml)"); @@ -170,7 +170,7 @@ public: file.close(); } - virtual QKeySequence HotKey_GetShortcut(const char* path) override + QKeySequence HotKey_GetShortcut(const char* path) override { for (HotKey combo : hotkeys) { @@ -182,7 +182,7 @@ public: return QKeySequence(); } - virtual bool HotKey_IsPressed(const QKeyEvent* event, const char* path) override + bool HotKey_IsPressed(const QKeyEvent* event, const char* path) override { if (!m_hotkeysAreEnabled) { @@ -221,7 +221,7 @@ public: return false; } - virtual bool HotKey_IsPressed(const QShortcutEvent* event, const char* path) override + bool HotKey_IsPressed(const QShortcutEvent* event, const char* path) override { if (!m_hotkeysAreEnabled) { @@ -239,7 +239,7 @@ public: return false; } - virtual bool HotKey_LoadExisting() override + bool HotKey_LoadExisting() override { QSettings settings("O3DE", "O3DE"); QString group = "Hotkeys/"; @@ -256,7 +256,7 @@ public: hotkey.second = settings.value("keySequence").toString(); if (!hotkey.first.isEmpty()) { - for (unsigned int j = 0; j < hotkeys.count(); j++) + for (int j = 0; j < hotkeys.count(); j++) { if (hotkeys[j].path.compare(hotkey.first, Qt::CaseInsensitive) == 0) { @@ -275,7 +275,7 @@ public: return true; } - virtual void HotKey_SaveCurrent() override + void HotKey_SaveCurrent() override { QSettings settings("O3DE", "O3DE"); QString group = "Hotkeys/"; @@ -296,7 +296,7 @@ public: settings.sync(); } - virtual void HotKey_BuildDefaults() override + void HotKey_BuildDefaults() override { m_hotkeysAreEnabled = true; QVector > keys; @@ -356,17 +356,17 @@ public: } } - virtual void HotKey_SetKeys(QVector keys) override + void HotKey_SetKeys(QVector keys) override { hotkeys = keys; } - virtual QVector HotKey_GetKeys() override + QVector HotKey_GetKeys() override { return hotkeys; } - virtual QString HotKey_GetPressedHotkey(const QKeyEvent* event) override + QString HotKey_GetPressedHotkey(const QKeyEvent* event) override { if (!m_hotkeysAreEnabled) { @@ -381,7 +381,7 @@ public: } return ""; } - virtual QString HotKey_GetPressedHotkey(const QShortcutEvent* event) override + QString HotKey_GetPressedHotkey(const QShortcutEvent* event) override { if (!m_hotkeysAreEnabled) { @@ -398,12 +398,12 @@ public: } //building the default hotkey list re-enables hotkeys //do not use this when rebuilding the default list is a possibility. - virtual void HotKey_SetEnabled(bool val) override + void HotKey_SetEnabled(bool val) override { m_hotkeysAreEnabled = val; } - virtual bool HotKey_IsEnabled() const override + bool HotKey_IsEnabled() const override { return m_hotkeysAreEnabled; } @@ -457,13 +457,13 @@ protected: } public: - virtual void ToolTip_LoadConfigXML(QString filepath) override + void ToolTip_LoadConfigXML(QString filepath) override { XmlNodeRef node = GetIEditor()->GetSystem()->LoadXmlFromFile(filepath.toStdString().c_str()); ToolTip_ParseNode(node); } - virtual void ToolTip_BuildFromConfig(IQToolTip* tooltip, QString path, QString option, QString optionalData = "", bool isEnabled = true) + void ToolTip_BuildFromConfig(IQToolTip* tooltip, QString path, QString option, QString optionalData = "", bool isEnabled = true) override { AZ_Assert(tooltip, "tooltip cannot be null"); @@ -488,7 +488,7 @@ public: } } - virtual QString ToolTip_GetTitle(QString path, QString option) override + QString ToolTip_GetTitle(QString path, QString option) override { if (!option.isEmpty() && GetToolTip(path + "." + option).isValid) { @@ -501,7 +501,7 @@ public: return GetToolTip(path).title; } - virtual QString ToolTip_GetContent(QString path, QString option) override + QString ToolTip_GetContent(QString path, QString option) override { if (!option.isEmpty() && GetToolTip(path + "." + option).isValid) { @@ -514,7 +514,7 @@ public: return GetToolTip(path).content; } - virtual QString ToolTip_GetSpecialContentType(QString path, QString option) override + QString ToolTip_GetSpecialContentType(QString path, QString option) override { if (!option.isEmpty() && GetToolTip(path + "." + option).isValid) { @@ -527,7 +527,7 @@ public: return GetToolTip(path).specialContent; } - virtual QString ToolTip_GetDisabledContent(QString path, QString option) override + QString ToolTip_GetDisabledContent(QString path, QString option) override { if (!option.isEmpty() && GetToolTip(path + "." + option).isValid) { diff --git a/Code/Editor/EditorPreferencesDialog.cpp b/Code/Editor/EditorPreferencesDialog.cpp index 893b36b40c..c3fc4139f6 100644 --- a/Code/Editor/EditorPreferencesDialog.cpp +++ b/Code/Editor/EditorPreferencesDialog.cpp @@ -282,7 +282,7 @@ void EditorPreferencesDialog::CreatePages() { auto pUnknown = classes[i]; - IPreferencesPageCreator* pPageCreator = 0; + IPreferencesPageCreator* pPageCreator = nullptr; if (FAILED(pUnknown->QueryInterface(&pPageCreator))) { continue; diff --git a/Code/Editor/EditorPreferencesPageFiles.cpp b/Code/Editor/EditorPreferencesPageFiles.cpp index aa84c7075c..4be3269d42 100644 --- a/Code/Editor/EditorPreferencesPageFiles.cpp +++ b/Code/Editor/EditorPreferencesPageFiles.cpp @@ -43,11 +43,16 @@ void CEditorPreferencesPage_Files::Reflect(AZ::SerializeContext& serialize) ->Field("MaxCount", &AutoBackup::m_maxCount) ->Field("RemindTime", &AutoBackup::m_remindTime); + serialize.Class() + ->Version(1) + ->Field("Max number of items displayed", &AssetBrowserSearch::m_maxNumberOfItemsShownInSearch); + serialize.Class() ->Version(1) ->Field("Files", &CEditorPreferencesPage_Files::m_files) ->Field("Editors", &CEditorPreferencesPage_Files::m_editors) - ->Field("AutoBackup", &CEditorPreferencesPage_Files::m_autoBackup); + ->Field("AutoBackup", &CEditorPreferencesPage_Files::m_autoBackup) + ->Field("AssetBrowserSearch", &CEditorPreferencesPage_Files::m_assetBrowserSearch); AZ::EditContext* editContext = serialize.GetEditContext(); @@ -80,12 +85,19 @@ void CEditorPreferencesPage_Files::Reflect(AZ::SerializeContext& serialize) ->Attribute(AZ::Edit::Attributes::Max, 100) ->DataElement(AZ::Edit::UIHandlers::SpinBox, &AutoBackup::m_remindTime, "Remind Time", "Auto Remind Every (Minutes)"); + editContext->Class("Asset Browser Search View", "Asset Browser Search View") + ->DataElement(AZ::Edit::UIHandlers::SpinBox, &AssetBrowserSearch::m_maxNumberOfItemsShownInSearch, "Maximum number of displayed items", + "Maximum number of displayed items displayed in the Search View") + ->Attribute(AZ::Edit::Attributes::Min, 50) + ->Attribute(AZ::Edit::Attributes::Max, 5000); + editContext->Class("File Preferences", "Class for handling File Preferences") ->ClassElement(AZ::Edit::ClassElements::EditorData, "") ->Attribute(AZ::Edit::Attributes::Visibility, AZ_CRC("PropertyVisibility_ShowChildrenOnly", 0xef428f20)) ->DataElement(AZ::Edit::UIHandlers::Default, &CEditorPreferencesPage_Files::m_files, "Files", "File Preferences") ->DataElement(AZ::Edit::UIHandlers::Default, &CEditorPreferencesPage_Files::m_editors, "External Editors", "External Editors") - ->DataElement(AZ::Edit::UIHandlers::Default, &CEditorPreferencesPage_Files::m_autoBackup, "Auto Backup", "Auto Backup"); + ->DataElement(AZ::Edit::UIHandlers::Default, &CEditorPreferencesPage_Files::m_autoBackup, "Auto Backup", "Auto Backup") + ->DataElement(AZ::Edit::UIHandlers::Default, &CEditorPreferencesPage_Files::m_assetBrowserSearch, "Asset Browser Search", "Asset Browser Search"); } } @@ -124,6 +136,8 @@ void CEditorPreferencesPage_Files::OnApply() gSettings.autoBackupTime = m_autoBackup.m_timeInterval; gSettings.autoBackupMaxCount = m_autoBackup.m_maxCount; gSettings.autoRemindTime = m_autoBackup.m_remindTime; + + gSettings.maxNumberOfItemsShownInSearch = m_assetBrowserSearch.m_maxNumberOfItemsShownInSearch; } void CEditorPreferencesPage_Files::InitializeSettings() @@ -148,4 +162,6 @@ void CEditorPreferencesPage_Files::InitializeSettings() m_autoBackup.m_timeInterval = gSettings.autoBackupTime; m_autoBackup.m_maxCount = gSettings.autoBackupMaxCount; m_autoBackup.m_remindTime = gSettings.autoRemindTime; + + m_assetBrowserSearch.m_maxNumberOfItemsShownInSearch = gSettings.maxNumberOfItemsShownInSearch; } diff --git a/Code/Editor/EditorPreferencesPageFiles.h b/Code/Editor/EditorPreferencesPageFiles.h index 2bb806a73e..368cd91fc3 100644 --- a/Code/Editor/EditorPreferencesPageFiles.h +++ b/Code/Editor/EditorPreferencesPageFiles.h @@ -69,10 +69,17 @@ private: int m_remindTime; }; + struct AssetBrowserSearch + { + AZ_TYPE_INFO(AssetBrowserSearch, "{9FBFCD24-9452-49DF-99F4-2711443CEAAE}") + + int m_maxNumberOfItemsShownInSearch; + }; Files m_files; ExternalEditors m_editors; AutoBackup m_autoBackup; + AssetBrowserSearch m_assetBrowserSearch; QIcon m_icon; }; diff --git a/Code/Editor/EditorPreferencesPageViewportGeneral.cpp b/Code/Editor/EditorPreferencesPageViewportGeneral.cpp index 1fc0d14988..a9eec22e69 100644 --- a/Code/Editor/EditorPreferencesPageViewportGeneral.cpp +++ b/Code/Editor/EditorPreferencesPageViewportGeneral.cpp @@ -201,20 +201,24 @@ void CEditorPreferencesPage_ViewportGeneral::OnApply() ds->SetLabelsDistance(m_textLabels.m_labelsDistance); gSettings.objectColorSettings.fChildGeomAlpha = m_selectionPreviewColor.m_childObjectGeomAlpha; - gSettings.objectColorSettings.entityHighlight = QColor(m_selectionPreviewColor.m_colorEntityBBox.GetR() * 255.0f, - m_selectionPreviewColor.m_colorEntityBBox.GetG() * 255.0f, - m_selectionPreviewColor.m_colorEntityBBox.GetB() * 255.0f); - gSettings.objectColorSettings.groupHighlight = QColor(m_selectionPreviewColor.m_colorGroupBBox.GetR() * 255.0f, - m_selectionPreviewColor.m_colorGroupBBox.GetG() * 255.0f, - m_selectionPreviewColor.m_colorGroupBBox.GetB() * 255.0f); + gSettings.objectColorSettings.entityHighlight = QColor( + static_cast(m_selectionPreviewColor.m_colorEntityBBox.GetR() * 255.0f), + static_cast(m_selectionPreviewColor.m_colorEntityBBox.GetG() * 255.0f), + static_cast(m_selectionPreviewColor.m_colorEntityBBox.GetB() * 255.0f)); + gSettings.objectColorSettings.groupHighlight = QColor( + static_cast(m_selectionPreviewColor.m_colorGroupBBox.GetR() * 255.0f), + static_cast(m_selectionPreviewColor.m_colorGroupBBox.GetG() * 255.0f), + static_cast(m_selectionPreviewColor.m_colorGroupBBox.GetB() * 255.0f)); gSettings.objectColorSettings.fBBoxAlpha = m_selectionPreviewColor.m_fBBoxAlpha; gSettings.objectColorSettings.fGeomAlpha = m_selectionPreviewColor.m_fgeomAlpha; - gSettings.objectColorSettings.geometryHighlightColor = QColor(m_selectionPreviewColor.m_geometryHighlightColor.GetR() * 255.0f, - m_selectionPreviewColor.m_geometryHighlightColor.GetG() * 255.0f, - m_selectionPreviewColor.m_geometryHighlightColor.GetB() * 255.0f); - gSettings.objectColorSettings.solidBrushGeometryColor = QColor(m_selectionPreviewColor.m_solidBrushGeometryColor.GetR() * 255.0f, - m_selectionPreviewColor.m_solidBrushGeometryColor.GetG() * 255.0f, - m_selectionPreviewColor.m_solidBrushGeometryColor.GetB() * 255.0f); + gSettings.objectColorSettings.geometryHighlightColor = QColor( + static_cast(m_selectionPreviewColor.m_geometryHighlightColor.GetR() * 255.0f), + static_cast(m_selectionPreviewColor.m_geometryHighlightColor.GetG() * 255.0f), + static_cast(m_selectionPreviewColor.m_geometryHighlightColor.GetB() * 255.0f)); + gSettings.objectColorSettings.solidBrushGeometryColor = QColor( + static_cast(m_selectionPreviewColor.m_solidBrushGeometryColor.GetR() * 255.0f), + static_cast(m_selectionPreviewColor.m_solidBrushGeometryColor.GetG() * 255.0f), + static_cast(m_selectionPreviewColor.m_solidBrushGeometryColor.GetB() * 255.0f)); } void CEditorPreferencesPage_ViewportGeneral::InitializeSettings() @@ -252,10 +256,10 @@ void CEditorPreferencesPage_ViewportGeneral::InitializeSettings() m_textLabels.m_labelsDistance = ds->GetLabelsDistance(); m_selectionPreviewColor.m_childObjectGeomAlpha = gSettings.objectColorSettings.fChildGeomAlpha; - m_selectionPreviewColor.m_colorEntityBBox.Set(gSettings.objectColorSettings.entityHighlight.redF(), gSettings.objectColorSettings.entityHighlight.greenF(), gSettings.objectColorSettings.entityHighlight.blueF(), 1.0f); - m_selectionPreviewColor.m_colorGroupBBox.Set(gSettings.objectColorSettings.groupHighlight.redF(), gSettings.objectColorSettings.groupHighlight.greenF(), gSettings.objectColorSettings.groupHighlight.blueF(), 1.0f); + m_selectionPreviewColor.m_colorEntityBBox.Set(static_cast(gSettings.objectColorSettings.entityHighlight.redF()), static_cast(gSettings.objectColorSettings.entityHighlight.greenF()), static_cast(gSettings.objectColorSettings.entityHighlight.blueF()), 1.0f); + m_selectionPreviewColor.m_colorGroupBBox.Set(static_cast(gSettings.objectColorSettings.groupHighlight.redF()), static_cast(gSettings.objectColorSettings.groupHighlight.greenF()), static_cast(gSettings.objectColorSettings.groupHighlight.blueF()), 1.0f); m_selectionPreviewColor.m_fBBoxAlpha = gSettings.objectColorSettings.fBBoxAlpha; m_selectionPreviewColor.m_fgeomAlpha = gSettings.objectColorSettings.fGeomAlpha; - m_selectionPreviewColor.m_geometryHighlightColor.Set(gSettings.objectColorSettings.geometryHighlightColor.redF(), gSettings.objectColorSettings.geometryHighlightColor.greenF(), gSettings.objectColorSettings.geometryHighlightColor.blueF(), 1.0f); - m_selectionPreviewColor.m_solidBrushGeometryColor.Set(gSettings.objectColorSettings.solidBrushGeometryColor.redF(), gSettings.objectColorSettings.solidBrushGeometryColor.greenF(), gSettings.objectColorSettings.solidBrushGeometryColor.blueF(), 1.0f); + m_selectionPreviewColor.m_geometryHighlightColor.Set(static_cast(gSettings.objectColorSettings.geometryHighlightColor.redF()), static_cast(gSettings.objectColorSettings.geometryHighlightColor.greenF()), static_cast(gSettings.objectColorSettings.geometryHighlightColor.blueF()), 1.0f); + m_selectionPreviewColor.m_solidBrushGeometryColor.Set(static_cast(gSettings.objectColorSettings.solidBrushGeometryColor.redF()), static_cast(gSettings.objectColorSettings.solidBrushGeometryColor.greenF()), static_cast(gSettings.objectColorSettings.solidBrushGeometryColor.blueF()), 1.0f); } diff --git a/Code/Editor/EditorPreferencesPageViewportMovement.cpp b/Code/Editor/EditorPreferencesPageViewportMovement.cpp index 1efe64488d..74abb3f207 100644 --- a/Code/Editor/EditorPreferencesPageViewportMovement.cpp +++ b/Code/Editor/EditorPreferencesPageViewportMovement.cpp @@ -5,51 +5,220 @@ * SPDX-License-Identifier: Apache-2.0 OR MIT * */ + #include "EditorDefs.h" #include "EditorPreferencesPageViewportMovement.h" +#include +#include +#include +#include #include +#include // Editor -#include "Settings.h" #include "EditorViewportSettings.h" +#include "Settings.h" + +static AZStd::vector GetInputNamesByDevice(const AzFramework::InputDeviceId inputDeviceId) +{ + AzFramework::InputDeviceRequests::InputChannelIdSet availableInputChannelIds; + AzFramework::InputDeviceRequestBus::Event( + inputDeviceId, &AzFramework::InputDeviceRequests::GetInputChannelIds, availableInputChannelIds); + + AZStd::vector inputChannelNames; + for (const AzFramework::InputChannelId& inputChannelId : availableInputChannelIds) + { + inputChannelNames.push_back(inputChannelId.GetName()); + } + + AZStd::sort(inputChannelNames.begin(), inputChannelNames.end()); + + return inputChannelNames; +} + +static AZStd::vector GetEditorInputNames() +{ + // function static to defer having to call GetInputNamesByDevice for every CameraInputSettings member + static bool inputNamesGenerated = false; + static AZStd::vector inputNames; + + if (!inputNamesGenerated) + { + AZStd::vector keyboardInputNames = GetInputNamesByDevice(AzFramework::InputDeviceKeyboard::Id); + AZStd::vector mouseInputNames = GetInputNamesByDevice(AzFramework::InputDeviceMouse::Id); + + inputNames.insert(inputNames.end(), mouseInputNames.begin(), mouseInputNames.end()); + inputNames.insert(inputNames.end(), keyboardInputNames.begin(), keyboardInputNames.end()); + + inputNamesGenerated = true; + } + + return inputNames; +} void CEditorPreferencesPage_ViewportMovement::Reflect(AZ::SerializeContext& serialize) { serialize.Class() - ->Version(1) - ->Field("MoveSpeed", &CameraMovementSettings::m_moveSpeed) + ->Version(2) + ->Field("TranslateSpeed", &CameraMovementSettings::m_translateSpeed) ->Field("RotateSpeed", &CameraMovementSettings::m_rotateSpeed) - ->Field("FastMoveSpeed", &CameraMovementSettings::m_fastMoveSpeed) - ->Field("WheelZoomSpeed", &CameraMovementSettings::m_wheelZoomSpeed) - ->Field("InvertYAxis", &CameraMovementSettings::m_invertYRotation) - ->Field("InvertPan", &CameraMovementSettings::m_invertPan); + ->Field("BoostMultiplier", &CameraMovementSettings::m_boostMultiplier) + ->Field("ScrollSpeed", &CameraMovementSettings::m_scrollSpeed) + ->Field("DollySpeed", &CameraMovementSettings::m_dollySpeed) + ->Field("PanSpeed", &CameraMovementSettings::m_panSpeed) + ->Field("RotateSmoothing", &CameraMovementSettings::m_rotateSmoothing) + ->Field("RotateSmoothness", &CameraMovementSettings::m_rotateSmoothness) + ->Field("TranslateSmoothing", &CameraMovementSettings::m_translateSmoothing) + ->Field("TranslateSmoothness", &CameraMovementSettings::m_translateSmoothness) + ->Field("CaptureCursorLook", &CameraMovementSettings::m_captureCursorLook) + ->Field("OrbitYawRotationInverted", &CameraMovementSettings::m_orbitYawRotationInverted) + ->Field("PanInvertedX", &CameraMovementSettings::m_panInvertedX) + ->Field("PanInvertedY", &CameraMovementSettings::m_panInvertedY); + + serialize.Class() + ->Version(1) + ->Field("TranslateForward", &CameraInputSettings::m_translateForwardChannelId) + ->Field("TranslateBackward", &CameraInputSettings::m_translateBackwardChannelId) + ->Field("TranslateLeft", &CameraInputSettings::m_translateLeftChannelId) + ->Field("TranslateRight", &CameraInputSettings::m_translateRightChannelId) + ->Field("TranslateUp", &CameraInputSettings::m_translateUpChannelId) + ->Field("TranslateDown", &CameraInputSettings::m_translateDownChannelId) + ->Field("Boost", &CameraInputSettings::m_boostChannelId) + ->Field("Orbit", &CameraInputSettings::m_orbitChannelId) + ->Field("FreeLook", &CameraInputSettings::m_freeLookChannelId) + ->Field("FreePan", &CameraInputSettings::m_freePanChannelId) + ->Field("OrbitLook", &CameraInputSettings::m_orbitLookChannelId) + ->Field("OrbitDolly", &CameraInputSettings::m_orbitDollyChannelId) + ->Field("OrbitPan", &CameraInputSettings::m_orbitPanChannelId); serialize.Class() ->Version(1) - ->Field("CameraMovementSettings", &CEditorPreferencesPage_ViewportMovement::m_cameraMovementSettings); + ->Field("CameraMovementSettings", &CEditorPreferencesPage_ViewportMovement::m_cameraMovementSettings) + ->Field("CameraInputSettings", &CEditorPreferencesPage_ViewportMovement::m_cameraInputSettings); - - AZ::EditContext* editContext = serialize.GetEditContext(); - if (editContext) + if (AZ::EditContext* editContext = serialize.GetEditContext()) { editContext->Class("Camera Movement Settings", "") - ->DataElement(AZ::Edit::UIHandlers::SpinBox, &CameraMovementSettings::m_moveSpeed, "Camera Movement Speed", "Camera Movement Speed") - ->DataElement(AZ::Edit::UIHandlers::SpinBox, &CameraMovementSettings::m_rotateSpeed, "Camera Rotation Speed", "Camera Rotation Speed") - ->DataElement(AZ::Edit::UIHandlers::SpinBox, &CameraMovementSettings::m_fastMoveSpeed, "Fast Movement Scale", "Fast Movement Scale (holding shift") - ->DataElement(AZ::Edit::UIHandlers::SpinBox, &CameraMovementSettings::m_wheelZoomSpeed, "Wheel Zoom Speed", "Wheel Zoom Speed") - ->DataElement(AZ::Edit::UIHandlers::CheckBox, &CameraMovementSettings::m_invertYRotation, "Invert Y Axis", "Invert Y Rotation (holding RMB)") - ->DataElement(AZ::Edit::UIHandlers::CheckBox, &CameraMovementSettings::m_invertPan, "Invert Pan", "Invert Pan (holding MMB)"); + ->DataElement( + AZ::Edit::UIHandlers::SpinBox, &CameraMovementSettings::m_translateSpeed, "Camera Movement Speed", "Camera movement speed") + ->Attribute(AZ::Edit::Attributes::Min, 0.01f) + ->DataElement( + AZ::Edit::UIHandlers::SpinBox, &CameraMovementSettings::m_rotateSpeed, "Camera Rotation Speed", "Camera rotation speed") + ->Attribute(AZ::Edit::Attributes::Min, 0.01f) + ->DataElement( + AZ::Edit::UIHandlers::SpinBox, &CameraMovementSettings::m_boostMultiplier, "Camera Boost Multiplier", + "Camera boost multiplier to apply to movement speed") + ->Attribute(AZ::Edit::Attributes::Min, 0.01f) + ->DataElement( + AZ::Edit::UIHandlers::SpinBox, &CameraMovementSettings::m_scrollSpeed, "Camera Scroll Speed", + "Camera movement speed while using scroll/wheel input") + ->Attribute(AZ::Edit::Attributes::Min, 0.01f) + ->DataElement( + AZ::Edit::UIHandlers::SpinBox, &CameraMovementSettings::m_dollySpeed, "Camera Dolly Speed", + "Camera movement speed while using mouse motion to move in and out") + ->Attribute(AZ::Edit::Attributes::Min, 0.01f) + ->DataElement( + AZ::Edit::UIHandlers::SpinBox, &CameraMovementSettings::m_panSpeed, "Camera Pan Speed", + "Camera movement speed while panning using the mouse") + ->Attribute(AZ::Edit::Attributes::Min, 0.01f) + ->DataElement( + AZ::Edit::UIHandlers::CheckBox, &CameraMovementSettings::m_rotateSmoothing, "Camera Rotate Smoothing", + "Is camera rotation smoothing enabled or disabled") + ->Attribute(AZ::Edit::Attributes::ChangeNotify, AZ::Edit::PropertyRefreshLevels::EntireTree) + ->DataElement( + AZ::Edit::UIHandlers::SpinBox, &CameraMovementSettings::m_rotateSmoothness, "Camera Rotate Smoothness", + "Amount of camera smoothing to apply while rotating the camera") + ->Attribute(AZ::Edit::Attributes::Min, 0.01f) + ->Attribute(AZ::Edit::Attributes::Visibility, &CameraMovementSettings::RotateSmoothingVisibility) + ->DataElement( + AZ::Edit::UIHandlers::CheckBox, &CameraMovementSettings::m_translateSmoothing, "Camera Translate Smoothing", + "Is camera translation smoothing enabled or disabled") + ->Attribute(AZ::Edit::Attributes::ChangeNotify, AZ::Edit::PropertyRefreshLevels::EntireTree) + ->DataElement( + AZ::Edit::UIHandlers::SpinBox, &CameraMovementSettings::m_translateSmoothness, "Camera Translate Smoothness", + "Amount of camera smoothing to apply while translating the camera") + ->Attribute(AZ::Edit::Attributes::Min, 0.01f) + ->Attribute(AZ::Edit::Attributes::Visibility, &CameraMovementSettings::TranslateSmoothingVisibility) + ->DataElement( + AZ::Edit::UIHandlers::CheckBox, &CameraMovementSettings::m_orbitYawRotationInverted, "Camera Orbit Yaw Inverted", + "Inverted yaw rotation while orbiting") + ->DataElement( + AZ::Edit::UIHandlers::CheckBox, &CameraMovementSettings::m_panInvertedX, "Invert Pan X", + "Invert direction of pan in local X axis") + ->DataElement( + AZ::Edit::UIHandlers::CheckBox, &CameraMovementSettings::m_panInvertedY, "Invert Pan Y", + "Invert direction of pan in local Y axis") + ->DataElement( + AZ::Edit::UIHandlers::CheckBox, &CameraMovementSettings::m_captureCursorLook, "Camera Capture Look Cursor", + "Should the cursor be captured (hidden) while performing free look"); - editContext->Class("Gizmo Movement Preferences", "Gizmo Movement Preferences") + editContext->Class("Camera Input Settings", "") + ->DataElement( + AZ::Edit::UIHandlers::ComboBox, &CameraInputSettings::m_translateForwardChannelId, "Translate Forward", + "Key/button to move the camera forward") + ->Attribute(AZ::Edit::Attributes::StringList, &GetEditorInputNames) + ->DataElement( + AZ::Edit::UIHandlers::ComboBox, &CameraInputSettings::m_translateBackwardChannelId, "Translate Backward", + "Key/button to move the camera backward") + ->Attribute(AZ::Edit::Attributes::StringList, &GetEditorInputNames) + ->DataElement( + AZ::Edit::UIHandlers::ComboBox, &CameraInputSettings::m_translateLeftChannelId, "Translate Left", + "Key/button to move the camera left") + ->Attribute(AZ::Edit::Attributes::StringList, &GetEditorInputNames) + ->DataElement( + AZ::Edit::UIHandlers::ComboBox, &CameraInputSettings::m_translateRightChannelId, "Translate Right", + "Key/button to move the camera right") + ->Attribute(AZ::Edit::Attributes::StringList, &GetEditorInputNames) + ->DataElement( + AZ::Edit::UIHandlers::ComboBox, &CameraInputSettings::m_translateUpChannelId, "Translate Up", + "Key/button to move the camera up") + ->Attribute(AZ::Edit::Attributes::StringList, &GetEditorInputNames) + ->DataElement( + AZ::Edit::UIHandlers::ComboBox, &CameraInputSettings::m_translateDownChannelId, "Translate Down", + "Key/button to move the camera down") + ->Attribute(AZ::Edit::Attributes::StringList, &GetEditorInputNames) + ->DataElement( + AZ::Edit::UIHandlers::ComboBox, &CameraInputSettings::m_boostChannelId, "Boost", + "Key/button to move the camera more quickly") + ->Attribute(AZ::Edit::Attributes::StringList, &GetEditorInputNames) + ->DataElement( + AZ::Edit::UIHandlers::ComboBox, &CameraInputSettings::m_orbitChannelId, "Orbit", + "Key/button to begin the camera orbit behavior") + ->Attribute(AZ::Edit::Attributes::StringList, &GetEditorInputNames) + ->DataElement( + AZ::Edit::UIHandlers::ComboBox, &CameraInputSettings::m_freeLookChannelId, "Free Look", + "Key/button to begin camera free look") + ->Attribute(AZ::Edit::Attributes::StringList, &GetEditorInputNames) + ->DataElement( + AZ::Edit::UIHandlers::ComboBox, &CameraInputSettings::m_freePanChannelId, "Free Pan", "Key/button to begin camera free pan") + ->Attribute(AZ::Edit::Attributes::StringList, &GetEditorInputNames) + ->DataElement( + AZ::Edit::UIHandlers::ComboBox, &CameraInputSettings::m_orbitLookChannelId, "Orbit Look", + "Key/button to begin camera orbit look") + ->Attribute(AZ::Edit::Attributes::StringList, &GetEditorInputNames) + ->DataElement( + AZ::Edit::UIHandlers::ComboBox, &CameraInputSettings::m_orbitDollyChannelId, "Orbit Dolly", + "Key/button to begin camera orbit dolly") + ->Attribute(AZ::Edit::Attributes::StringList, &GetEditorInputNames) + ->DataElement( + AZ::Edit::UIHandlers::ComboBox, &CameraInputSettings::m_orbitPanChannelId, "Orbit Pan", + "Key/button to begin camera orbit pan") + ->Attribute(AZ::Edit::Attributes::StringList, &GetEditorInputNames); + + editContext->Class("Viewport Preferences", "Viewport Preferences") ->ClassElement(AZ::Edit::ClassElements::EditorData, "") ->Attribute(AZ::Edit::Attributes::Visibility, AZ_CRC("PropertyVisibility_ShowChildrenOnly", 0xef428f20)) - ->DataElement(AZ::Edit::UIHandlers::Default, &CEditorPreferencesPage_ViewportMovement::m_cameraMovementSettings, "Camera Movement Settings", "Camera Movement Settings"); + ->DataElement( + AZ::Edit::UIHandlers::Default, &CEditorPreferencesPage_ViewportMovement::m_cameraMovementSettings, + "Camera Movement Settings", "Camera Movement Settings") + ->DataElement( + AZ::Edit::UIHandlers::Default, &CEditorPreferencesPage_ViewportMovement::m_cameraInputSettings, "Camera Input Settings", + "Camera Input Settings"); } } - CEditorPreferencesPage_ViewportMovement::CEditorPreferencesPage_ViewportMovement() { InitializeSettings(); @@ -68,45 +237,67 @@ QIcon& CEditorPreferencesPage_ViewportMovement::GetIcon() void CEditorPreferencesPage_ViewportMovement::OnApply() { - if (SandboxEditor::UsingNewCameraSystem()) - { - SandboxEditor::SetCameraTranslateSpeed(m_cameraMovementSettings.m_moveSpeed); - SandboxEditor::SetCameraRotateSpeed(m_cameraMovementSettings.m_rotateSpeed); - SandboxEditor::SetCameraBoostMultiplier(m_cameraMovementSettings.m_fastMoveSpeed); - SandboxEditor::SetCameraScrollSpeed(m_cameraMovementSettings.m_wheelZoomSpeed); - SandboxEditor::SetCameraOrbitYawRotationInverted(m_cameraMovementSettings.m_invertYRotation); - SandboxEditor::SetCameraPanInvertedX(m_cameraMovementSettings.m_invertPan); - SandboxEditor::SetCameraPanInvertedY(m_cameraMovementSettings.m_invertPan); - } - else - { - gSettings.cameraMoveSpeed = m_cameraMovementSettings.m_moveSpeed; - gSettings.cameraRotateSpeed = m_cameraMovementSettings.m_rotateSpeed; - gSettings.cameraFastMoveSpeed = m_cameraMovementSettings.m_fastMoveSpeed; - gSettings.wheelZoomSpeed = m_cameraMovementSettings.m_wheelZoomSpeed; - gSettings.invertYRotation = m_cameraMovementSettings.m_invertYRotation; - gSettings.invertPan = m_cameraMovementSettings.m_invertPan; - } + SandboxEditor::SetCameraTranslateSpeed(m_cameraMovementSettings.m_translateSpeed); + SandboxEditor::SetCameraRotateSpeed(m_cameraMovementSettings.m_rotateSpeed); + SandboxEditor::SetCameraBoostMultiplier(m_cameraMovementSettings.m_boostMultiplier); + SandboxEditor::SetCameraScrollSpeed(m_cameraMovementSettings.m_scrollSpeed); + SandboxEditor::SetCameraDollyMotionSpeed(m_cameraMovementSettings.m_dollySpeed); + SandboxEditor::SetCameraPanSpeed(m_cameraMovementSettings.m_panSpeed); + SandboxEditor::SetCameraRotateSmoothness(m_cameraMovementSettings.m_rotateSmoothness); + SandboxEditor::SetCameraRotateSmoothingEnabled(m_cameraMovementSettings.m_rotateSmoothing); + SandboxEditor::SetCameraTranslateSmoothness(m_cameraMovementSettings.m_translateSmoothness); + SandboxEditor::SetCameraTranslateSmoothingEnabled(m_cameraMovementSettings.m_translateSmoothing); + SandboxEditor::SetCameraCaptureCursorForLook(m_cameraMovementSettings.m_captureCursorLook); + SandboxEditor::SetCameraOrbitYawRotationInverted(m_cameraMovementSettings.m_orbitYawRotationInverted); + SandboxEditor::SetCameraPanInvertedX(m_cameraMovementSettings.m_panInvertedX); + SandboxEditor::SetCameraPanInvertedY(m_cameraMovementSettings.m_panInvertedY); + + SandboxEditor::SetCameraTranslateForwardChannelId(m_cameraInputSettings.m_translateForwardChannelId); + SandboxEditor::SetCameraTranslateBackwardChannelId(m_cameraInputSettings.m_translateBackwardChannelId); + SandboxEditor::SetCameraTranslateLeftChannelId(m_cameraInputSettings.m_translateLeftChannelId); + SandboxEditor::SetCameraTranslateRightChannelId(m_cameraInputSettings.m_translateRightChannelId); + SandboxEditor::SetCameraTranslateUpChannelId(m_cameraInputSettings.m_translateUpChannelId); + SandboxEditor::SetCameraTranslateDownChannelId(m_cameraInputSettings.m_translateDownChannelId); + SandboxEditor::SetCameraTranslateBoostChannelId(m_cameraInputSettings.m_boostChannelId); + SandboxEditor::SetCameraOrbitChannelId(m_cameraInputSettings.m_orbitChannelId); + SandboxEditor::SetCameraFreeLookChannelId(m_cameraInputSettings.m_freeLookChannelId); + SandboxEditor::SetCameraFreePanChannelId(m_cameraInputSettings.m_freePanChannelId); + SandboxEditor::SetCameraOrbitLookChannelId(m_cameraInputSettings.m_orbitLookChannelId); + SandboxEditor::SetCameraOrbitDollyChannelId(m_cameraInputSettings.m_orbitDollyChannelId); + SandboxEditor::SetCameraOrbitPanChannelId(m_cameraInputSettings.m_orbitPanChannelId); + + SandboxEditor::EditorModularViewportCameraComposerNotificationBus::Broadcast( + &SandboxEditor::EditorModularViewportCameraComposerNotificationBus::Events::OnEditorModularViewportCameraComposerSettingsChanged); } void CEditorPreferencesPage_ViewportMovement::InitializeSettings() { - if (SandboxEditor::UsingNewCameraSystem()) - { - m_cameraMovementSettings.m_moveSpeed = SandboxEditor::CameraTranslateSpeed(); - m_cameraMovementSettings.m_rotateSpeed = SandboxEditor::CameraRotateSpeed(); - m_cameraMovementSettings.m_fastMoveSpeed = SandboxEditor::CameraBoostMultiplier(); - m_cameraMovementSettings.m_wheelZoomSpeed = SandboxEditor::CameraScrollSpeed(); - m_cameraMovementSettings.m_invertYRotation = SandboxEditor::CameraOrbitYawRotationInverted(); - m_cameraMovementSettings.m_invertPan = SandboxEditor::CameraPanInvertedX() && SandboxEditor::CameraPanInvertedY(); - } - else - { - m_cameraMovementSettings.m_moveSpeed = gSettings.cameraMoveSpeed; - m_cameraMovementSettings.m_rotateSpeed = gSettings.cameraRotateSpeed; - m_cameraMovementSettings.m_fastMoveSpeed = gSettings.cameraFastMoveSpeed; - m_cameraMovementSettings.m_wheelZoomSpeed = gSettings.wheelZoomSpeed; - m_cameraMovementSettings.m_invertYRotation = gSettings.invertYRotation; - m_cameraMovementSettings.m_invertPan = gSettings.invertPan; - } + m_cameraMovementSettings.m_translateSpeed = SandboxEditor::CameraTranslateSpeed(); + m_cameraMovementSettings.m_rotateSpeed = SandboxEditor::CameraRotateSpeed(); + m_cameraMovementSettings.m_boostMultiplier = SandboxEditor::CameraBoostMultiplier(); + m_cameraMovementSettings.m_scrollSpeed = SandboxEditor::CameraScrollSpeed(); + m_cameraMovementSettings.m_dollySpeed = SandboxEditor::CameraDollyMotionSpeed(); + m_cameraMovementSettings.m_panSpeed = SandboxEditor::CameraPanSpeed(); + m_cameraMovementSettings.m_rotateSmoothness = SandboxEditor::CameraRotateSmoothness(); + m_cameraMovementSettings.m_rotateSmoothing = SandboxEditor::CameraRotateSmoothingEnabled(); + m_cameraMovementSettings.m_translateSmoothness = SandboxEditor::CameraTranslateSmoothness(); + m_cameraMovementSettings.m_translateSmoothing = SandboxEditor::CameraTranslateSmoothingEnabled(); + m_cameraMovementSettings.m_captureCursorLook = SandboxEditor::CameraCaptureCursorForLook(); + m_cameraMovementSettings.m_orbitYawRotationInverted = SandboxEditor::CameraOrbitYawRotationInverted(); + m_cameraMovementSettings.m_panInvertedX = SandboxEditor::CameraPanInvertedX(); + m_cameraMovementSettings.m_panInvertedY = SandboxEditor::CameraPanInvertedY(); + + m_cameraInputSettings.m_translateForwardChannelId = SandboxEditor::CameraTranslateForwardChannelId().GetName(); + m_cameraInputSettings.m_translateBackwardChannelId = SandboxEditor::CameraTranslateBackwardChannelId().GetName(); + m_cameraInputSettings.m_translateLeftChannelId = SandboxEditor::CameraTranslateLeftChannelId().GetName(); + m_cameraInputSettings.m_translateRightChannelId = SandboxEditor::CameraTranslateRightChannelId().GetName(); + m_cameraInputSettings.m_translateUpChannelId = SandboxEditor::CameraTranslateUpChannelId().GetName(); + m_cameraInputSettings.m_translateDownChannelId = SandboxEditor::CameraTranslateDownChannelId().GetName(); + m_cameraInputSettings.m_boostChannelId = SandboxEditor::CameraTranslateBoostChannelId().GetName(); + m_cameraInputSettings.m_orbitChannelId = SandboxEditor::CameraOrbitChannelId().GetName(); + m_cameraInputSettings.m_freeLookChannelId = SandboxEditor::CameraFreeLookChannelId().GetName(); + m_cameraInputSettings.m_freePanChannelId = SandboxEditor::CameraFreePanChannelId().GetName(); + m_cameraInputSettings.m_orbitLookChannelId = SandboxEditor::CameraOrbitLookChannelId().GetName(); + m_cameraInputSettings.m_orbitDollyChannelId = SandboxEditor::CameraOrbitDollyChannelId().GetName(); + m_cameraInputSettings.m_orbitPanChannelId = SandboxEditor::CameraOrbitPanChannelId().GetName(); } diff --git a/Code/Editor/EditorPreferencesPageViewportMovement.h b/Code/Editor/EditorPreferencesPageViewportMovement.h index 1373260e62..b7482fb048 100644 --- a/Code/Editor/EditorPreferencesPageViewportMovement.h +++ b/Code/Editor/EditorPreferencesPageViewportMovement.h @@ -5,17 +5,21 @@ * SPDX-License-Identifier: Apache-2.0 OR MIT * */ + #pragma once #include "Include/IPreferencesPage.h" -#include -#include #include +#include +#include #include +inline AZ::Crc32 EditorPropertyVisibility(const bool enabled) +{ + return enabled ? AZ::Edit::PropertyVisibility::Show : AZ::Edit::PropertyVisibility::Hide; +} -class CEditorPreferencesPage_ViewportMovement - : public IPreferencesPage +class CEditorPreferencesPage_ViewportMovement : public IPreferencesPage { public: AZ_RTTI(CEditorPreferencesPage_ViewportMovement, "{BC593332-7EAF-4171-8A35-1C5DE5B40909}", IPreferencesPage) @@ -25,12 +29,22 @@ public: CEditorPreferencesPage_ViewportMovement(); virtual ~CEditorPreferencesPage_ViewportMovement() = default; - virtual const char* GetCategory() override { return "Viewports"; } + virtual const char* GetCategory() override + { + return "Viewports"; + } + virtual const char* GetTitle(); virtual QIcon& GetIcon() override; virtual void OnApply() override; - virtual void OnCancel() override {} - virtual bool OnQueryCancel() override { return true; } + virtual void OnCancel() override + { + } + + virtual bool OnQueryCancel() override + { + return true; + } private: void InitializeSettings(); @@ -39,16 +53,53 @@ private: { AZ_TYPE_INFO(CameraMovementSettings, "{60B8C07E-5F48-4171-A50B-F45558B5CCA1}") - float m_moveSpeed; + float m_translateSpeed; float m_rotateSpeed; - float m_fastMoveSpeed; - float m_wheelZoomSpeed; - bool m_invertYRotation; - bool m_invertPan; + float m_scrollSpeed; + float m_dollySpeed; + float m_panSpeed; + float m_boostMultiplier; + float m_rotateSmoothness; + bool m_rotateSmoothing; + float m_translateSmoothness; + bool m_translateSmoothing; + bool m_captureCursorLook; + bool m_orbitYawRotationInverted; + bool m_panInvertedX; + bool m_panInvertedY; + + AZ::Crc32 RotateSmoothingVisibility() const + { + return EditorPropertyVisibility(m_rotateSmoothing); + } + + AZ::Crc32 TranslateSmoothingVisibility() const + { + return EditorPropertyVisibility(m_translateSmoothing); + } + }; + + struct CameraInputSettings + { + AZ_TYPE_INFO(struct CameraInputSettings, "{A250FAD4-662E-4896-B030-D4ED03679377}") + + AZStd::string m_translateForwardChannelId; + AZStd::string m_translateBackwardChannelId; + AZStd::string m_translateLeftChannelId; + AZStd::string m_translateRightChannelId; + AZStd::string m_translateUpChannelId; + AZStd::string m_translateDownChannelId; + AZStd::string m_boostChannelId; + AZStd::string m_orbitChannelId; + AZStd::string m_freeLookChannelId; + AZStd::string m_freePanChannelId; + AZStd::string m_orbitLookChannelId; + AZStd::string m_orbitDollyChannelId; + AZStd::string m_orbitPanChannelId; }; CameraMovementSettings m_cameraMovementSettings; + CameraInputSettings m_cameraInputSettings; + QIcon m_icon; }; - - diff --git a/Code/Editor/EditorViewportSettings.cpp b/Code/Editor/EditorViewportSettings.cpp index 680592a597..872454412d 100644 --- a/Code/Editor/EditorViewportSettings.cpp +++ b/Code/Editor/EditorViewportSettings.cpp @@ -31,6 +31,9 @@ namespace SandboxEditor constexpr AZStd::string_view CameraPanSpeedSetting = "/Amazon/Preferences/Editor/Camera/PanSpeed"; constexpr AZStd::string_view CameraRotateSmoothnessSetting = "/Amazon/Preferences/Editor/Camera/RotateSmoothness"; constexpr AZStd::string_view CameraTranslateSmoothnessSetting = "/Amazon/Preferences/Editor/Camera/TranslateSmoothness"; + constexpr AZStd::string_view CameraTranslateSmoothingSetting = "/Amazon/Preferences/Editor/Camera/TranslateSmoothing"; + constexpr AZStd::string_view CameraRotateSmoothingSetting = "/Amazon/Preferences/Editor/Camera/RotateSmoothing"; + constexpr AZStd::string_view CameraCaptureCursorLookSetting = "/Amazon/Preferences/Editor/Camera/CaptureCursorLook"; constexpr AZStd::string_view CameraTranslateForwardIdSetting = "/Amazon/Preferences/Editor/Camera/CameraTranslateForwardId"; constexpr AZStd::string_view CameraTranslateBackwardIdSetting = "/Amazon/Preferences/Editor/Camera/CameraTranslateBackwardId"; constexpr AZStd::string_view CameraTranslateLeftIdSetting = "/Amazon/Preferences/Editor/Camera/CameraTranslateLeftId"; @@ -58,9 +61,13 @@ namespace SandboxEditor AZStd::remove_cvref_t GetRegistry(const AZStd::string_view setting, T&& defaultValue) { AZStd::remove_cvref_t value = AZStd::forward(defaultValue); - if (auto* registry = AZ::SettingsRegistry::Get()) + if (const auto* registry = AZ::SettingsRegistry::Get()) { - registry->Get(value, setting); + T potentialValue; + if (registry->Get(potentialValue, setting)) + { + value = AZStd::move(potentialValue); + } } return value; @@ -259,6 +266,36 @@ namespace SandboxEditor SetRegistry(CameraTranslateSmoothnessSetting, smoothness); } + bool CameraRotateSmoothingEnabled() + { + return GetRegistry(CameraRotateSmoothingSetting, true); + } + + void SetCameraRotateSmoothingEnabled(const bool enabled) + { + SetRegistry(CameraRotateSmoothingSetting, enabled); + } + + bool CameraTranslateSmoothingEnabled() + { + return GetRegistry(CameraTranslateSmoothingSetting, true); + } + + void SetCameraTranslateSmoothingEnabled(const bool enabled) + { + SetRegistry(CameraTranslateSmoothingSetting, enabled); + } + + bool CameraCaptureCursorForLook() + { + return GetRegistry(CameraCaptureCursorLookSetting, true); + } + + void SetCameraCaptureCursorForLook(const bool capture) + { + SetRegistry(CameraCaptureCursorLookSetting, capture); + } + AzFramework::InputChannelId CameraTranslateForwardChannelId() { return AzFramework::InputChannelId( @@ -330,7 +367,7 @@ namespace SandboxEditor void SetCameraTranslateBoostChannelId(AZStd::string_view cameraTranslateBoostId) { - SetRegistry(CameraTranslateDownIdSetting, cameraTranslateBoostId); + SetRegistry(CameraTranslateBoostIdSetting, cameraTranslateBoostId); } AzFramework::InputChannelId CameraOrbitChannelId() @@ -338,7 +375,7 @@ namespace SandboxEditor return AzFramework::InputChannelId(GetRegistry(CameraOrbitIdSetting, AZStd::string("keyboard_key_modifier_alt_l")).c_str()); } - void SetCameraOrbitChannelChannelId(AZStd::string_view cameraOrbitId) + void SetCameraOrbitChannelId(AZStd::string_view cameraOrbitId) { SetRegistry(CameraOrbitIdSetting, cameraOrbitId); } diff --git a/Code/Editor/EditorViewportSettings.h b/Code/Editor/EditorViewportSettings.h index 1898cf642a..3da8c465fb 100644 --- a/Code/Editor/EditorViewportSettings.h +++ b/Code/Editor/EditorViewportSettings.h @@ -80,6 +80,15 @@ namespace SandboxEditor SANDBOX_API float CameraTranslateSmoothness(); SANDBOX_API void SetCameraTranslateSmoothness(float smoothness); + SANDBOX_API bool CameraRotateSmoothingEnabled(); + SANDBOX_API void SetCameraRotateSmoothingEnabled(bool enabled); + + SANDBOX_API bool CameraTranslateSmoothingEnabled(); + SANDBOX_API void SetCameraTranslateSmoothingEnabled(bool enabled); + + SANDBOX_API bool CameraCaptureCursorForLook(); + SANDBOX_API void SetCameraCaptureCursorForLook(bool capture); + SANDBOX_API AzFramework::InputChannelId CameraTranslateForwardChannelId(); SANDBOX_API void SetCameraTranslateForwardChannelId(AZStd::string_view cameraTranslateForwardId); @@ -102,7 +111,7 @@ namespace SandboxEditor SANDBOX_API void SetCameraTranslateBoostChannelId(AZStd::string_view cameraTranslateBoostId); SANDBOX_API AzFramework::InputChannelId CameraOrbitChannelId(); - SANDBOX_API void SetCameraOrbitChannelChannelId(AZStd::string_view cameraOrbitId); + SANDBOX_API void SetCameraOrbitChannelId(AZStd::string_view cameraOrbitId); SANDBOX_API AzFramework::InputChannelId CameraFreeLookChannelId(); SANDBOX_API void SetCameraFreeLookChannelId(AZStd::string_view cameraFreeLookId); @@ -118,8 +127,4 @@ namespace SandboxEditor SANDBOX_API AzFramework::InputChannelId CameraOrbitPanChannelId(); SANDBOX_API void SetCameraOrbitPanChannelId(AZStd::string_view cameraOrbitPanId); - - //! Return if the new editor camera system is enabled or not. - //! @note This is implemented in EditorViewportWidget.cpp - SANDBOX_API bool UsingNewCameraSystem(); } // namespace SandboxEditor diff --git a/Code/Editor/EditorViewportWidget.cpp b/Code/Editor/EditorViewportWidget.cpp index 4c638e1f82..5294ebbc7e 100644 --- a/Code/Editor/EditorViewportWidget.cpp +++ b/Code/Editor/EditorViewportWidget.cpp @@ -46,14 +46,14 @@ #include #include #include -#include +#include // AtomToolsFramework #include -#include // CryCommon #include +#include // AzFramework #include @@ -69,10 +69,9 @@ #include "Include/IDisplayViewport.h" #include "Objects/ObjectManager.h" #include "ProcessInfo.h" -#include "IPostEffectGroup.h" #include "EditorPreferencesPageGeneral.h" #include "ViewportManipulatorController.h" -#include "LegacyViewportCameraController.h" +#include "EditorViewportSettings.h" #include "ViewPane.h" #include "CustomResolutionDlg.h" @@ -91,27 +90,18 @@ // Atom #include #include +#include + #include #include #include #include -#include #include AZ_CVAR( bool, ed_visibility_logTiming, false, nullptr, AZ::ConsoleFunctorFlags::Null, "Output the timing of the new IVisibilitySystem query"); -AZ_CVAR(bool, ed_useNewCameraSystem, true, nullptr, AZ::ConsoleFunctorFlags::Null, "Use the new Editor camera system"); -AZ_CVAR(bool, ed_showCursorCameraLook, true, nullptr, AZ::ConsoleFunctorFlags::Null, "Show the cursor when using free look with the new camera system"); - -namespace SandboxEditor -{ - bool UsingNewCameraSystem() - { - return ed_useNewCameraSystem; - } -} // namespace SandboxEditor EditorViewportWidget* EditorViewportWidget::m_pPrimaryViewport = nullptr; @@ -139,12 +129,11 @@ namespace AZ::ViewportHelpers { static const char TextCantCreateCameraNoLevel[] = "Cannot create camera when no level is loaded."; - class EditorEntityNotifications - : public AzToolsFramework::EditorEntityContextNotificationBus::Handler + class EditorEntityNotifications : public AzToolsFramework::EditorEntityContextNotificationBus::Handler { public: - EditorEntityNotifications(EditorViewportWidget& renderViewport) - : m_renderViewport(renderViewport) + EditorEntityNotifications(EditorViewportWidget& editorViewportWidget) + : m_editorViewportWidget(editorViewportWidget) { AzToolsFramework::EditorEntityContextNotificationBus::Handler::BusConnect(); } @@ -154,18 +143,24 @@ namespace AZ::ViewportHelpers AzToolsFramework::EditorEntityContextNotificationBus::Handler::BusDisconnect(); } - // AzToolsFramework::EditorEntityContextNotificationBus + // AzToolsFramework::EditorEntityContextNotificationBus overrides ... void OnStartPlayInEditor() override { - m_renderViewport.OnStartPlayInEditor(); + m_editorViewportWidget.OnStartPlayInEditor(); } + void OnStopPlayInEditor() override { - m_renderViewport.OnStopPlayInEditor(); + m_editorViewportWidget.OnStopPlayInEditor(); + } + + void OnStartPlayInEditorBegin() override + { + m_editorViewportWidget.OnStartPlayInEditorBegin(); } private: - EditorViewportWidget& m_renderViewport; + EditorViewportWidget& m_editorViewportWidget; }; } // namespace AZ::ViewportHelpers @@ -175,16 +170,12 @@ namespace AZ::ViewportHelpers EditorViewportWidget::EditorViewportWidget(const QString& name, QWidget* parent) : QtViewport(parent) - , m_Camera(GetIEditor()->GetSystem()->GetViewCamera()) - , m_camFOV(gSettings.viewports.fDefaultFov) , m_defaultViewName(name) , m_renderViewport(nullptr) //m_renderViewport is initialized later, in SetViewportId { // need this to be set in order to allow for language switching on Windows setAttribute(Qt::WA_InputMethodEnabled); - LockCameraMovement(true); - EditorViewportWidget::SetViewTM(m_Camera.GetMatrix()); m_defaultViewTM.SetIdentity(); if (GetIEditor()->GetViewManager()->GetSelectedViewport() == nullptr) @@ -197,8 +188,6 @@ EditorViewportWidget::EditorViewportWidget(const QString& name, QWidget* parent) m_displayContext.pIconManager = GetIEditor()->GetIconManager(); GetIEditor()->GetUndoManager()->AddListener(this); - m_PhysicalLocation.SetIdentity(); - // The renderer requires something, so don't allow us to shrink to absolutely nothing // This won't in fact stop the viewport from being shrunk, when it's the centralWidget for // the MainWindow, but it will stop the viewport from getting resize events @@ -206,22 +195,14 @@ EditorViewportWidget::EditorViewportWidget(const QString& name, QWidget* parent) // to be the same thing. setMinimumSize(50, 50); - OnCreate(); - setMouseTracking(true); Camera::EditorCameraRequestBus::Handler::BusConnect(); + Camera::CameraNotificationBus::Handler::BusConnect(); + m_editorEntityNotifications = AZStd::make_unique(*this); AzFramework::AssetCatalogEventBus::Handler::BusConnect(); - auto handleCameraChange = [this](const AZ::Matrix4x4&) - { - UpdateCameraFromViewportContext(); - }; - - m_cameraViewMatrixChangeHandler = AZ::RPI::ViewportContext::MatrixChangedEvent::Handler(handleCameraChange); - m_cameraProjectionMatrixChangeHandler = AZ::RPI::ViewportContext::MatrixChangedEvent::Handler(handleCameraChange); - m_manipulatorManager = GetIEditor()->GetViewManager()->GetManipulatorManager(); if (!m_pPrimaryViewport) { @@ -240,28 +221,20 @@ EditorViewportWidget::~EditorViewportWidget() DisconnectViewportInteractionRequestBus(); m_editorEntityNotifications.reset(); Camera::EditorCameraRequestBus::Handler::BusDisconnect(); - OnDestroy(); + Camera::CameraNotificationBus::Handler::BusDisconnect(); GetIEditor()->GetUndoManager()->RemoveListener(this); GetIEditor()->UnregisterNotifyListener(this); } -////////////////////////////////////////////////////////////////////////// -// EditorViewportWidget message handlers -////////////////////////////////////////////////////////////////////////// -int EditorViewportWidget::OnCreate() -{ - CreateRenderContext(); - - return 0; -} - ////////////////////////////////////////////////////////////////////////// void EditorViewportWidget::resizeEvent(QResizeEvent* event) { + // Call base class resize event while not rendering PushDisableRendering(); QtViewport::resizeEvent(event); PopDisableRendering(); + // Emit Legacy system events about the viewport size change const QRect rcWindow = rect().translated(mapToGlobal(QPoint())); gEnv->pSystem->GetISystemEventDispatcher()->OnSystemEvent(ESYSTEM_EVENT_MOVE, rcWindow.left(), rcWindow.top()); @@ -271,10 +244,12 @@ void EditorViewportWidget::resizeEvent(QResizeEvent* event) gEnv->pSystem->GetISystemEventDispatcher()->OnSystemEvent(ESYSTEM_EVENT_RESIZE, width(), height()); - // We queue the window resize event because the render overlay may be hidden. - // If the render overlay is not visible, the native window that is backing it will - // also be hidden, and it will not resize until it becomes visible. - m_windowResizedEvent = true; + // In the case of the default viewport camera, we must re-set the FOV, which also updates the aspect ratio + // Component cameras hand this themselves + if (m_viewSourceType == ViewSourceType::None) + { + SetFOV(GetFOV()); + } } ////////////////////////////////////////////////////////////////////////// @@ -307,7 +282,7 @@ void EditorViewportWidget::paintEvent([[maybe_unused]] QPaintEvent* event) const char* kFontName = "Arial"; const QColor kTextColor(255, 255, 255); const QColor kTextShadowColor(0, 0, 0); - const QFont font(kFontName, kFontSize / 10.0); + const QFont font(kFontName, static_cast(kFontSize / 10.0f)); painter.setFont(font); QString friendlyName = QFileInfo(GetIEditor()->GetLevelName()).fileName(); @@ -383,15 +358,6 @@ AzToolsFramework::ViewportInteraction::MouseInteraction EditorViewportWidget::Bu BuildMousePick(WidgetToViewport(point))); } -void EditorViewportWidget::InjectFakeMouseMove(int deltaX, int deltaY, Qt::MouseButtons buttons) -{ - // this is required, otherwise the user will see the context menu - OnMouseMove(Qt::NoModifier, buttons, QCursor::pos() + QPoint(deltaX, deltaY)); - // we simply move the prev mouse position, so the change will be picked up - // by the next ProcessMouse call - m_prevMousePos -= QPoint(deltaX, deltaY); -} - ////////////////////////////////////////////////////////////////////////// bool EditorViewportWidget::event(QEvent* event) { @@ -403,19 +369,6 @@ bool EditorViewportWidget::event(QEvent* event) m_keyDown.clear(); break; - case QEvent::ShortcutOverride: - { - // Ensure we exit game mode on escape, even if something else would eat our escape key event. - if (static_cast(event)->key() == Qt::Key_Escape && GetIEditor()->IsInGameMode()) - { - GetIEditor()->SetInGameMode(false); - event->accept(); - return true; - } - break; - } - - case QEvent::Shortcut: // a shortcut should immediately clear us, otherwise the release event never gets sent m_keyDown.clear(); @@ -425,12 +378,6 @@ bool EditorViewportWidget::event(QEvent* event) return QtViewport::event(event); } -////////////////////////////////////////////////////////////////////////// -void EditorViewportWidget::ResetContent() -{ - QtViewport::ResetContent(); -} - ////////////////////////////////////////////////////////////////////////// void EditorViewportWidget::UpdateContent(int flags) { @@ -444,8 +391,6 @@ void EditorViewportWidget::UpdateContent(int flags) ////////////////////////////////////////////////////////////////////////// void EditorViewportWidget::Update() { - FUNCTION_PROFILER(GetIEditor()->GetSystem(), PROFILE_EDITOR); - if (Editor::EditorQtApplication::instance()->isMovingOrResizing()) { return; @@ -461,26 +406,6 @@ void EditorViewportWidget::Update() return; } - if (m_updateCameraPositionNextTick) - { - auto cameraState = GetCameraState(); - AZ::Matrix3x4 matrix; - matrix.SetBasisAndTranslation(cameraState.m_side, cameraState.m_forward, cameraState.m_up, cameraState.m_position); - auto m = AZMatrix3x4ToLYMatrix3x4(matrix); - - SetViewTM(m); - m_Camera.SetZRange(cameraState.m_nearClip, cameraState.m_farClip); - } - - // Ensure the FOV matches our internally stored setting if we're using the Editor camera - if (!m_viewEntityId.IsValid() && !GetIEditor()->IsInGameMode()) - { - SetFOV(GetFOV()); - } - - // Reset the camera update flag now that we're finished updating our viewport context - m_updateCameraPositionNextTick = false; - // Don't wait for changes to update the focused viewport. if (CheckRespondToInput()) { @@ -558,25 +483,13 @@ void EditorViewportWidget::Update() PushDisableRendering(); - m_viewTM = m_Camera.GetMatrix(); // synchronize. - // Render { // TODO: Move out this logic to a controller and refactor to work with Atom - - OnRender(); - ProcessRenderLisneters(m_displayContext); m_displayContext.Flush2D(); - // m_renderer->SwitchToNativeResolutionBackbuffer(); - - // 3D engine stats - - CCamera CurCamera = gEnv->pSystem->GetViewCamera(); - gEnv->pSystem->SetViewCamera(m_Camera); - // Post Render Callback { PostRenderers::iterator itr = m_postRenderers.begin(); @@ -586,8 +499,6 @@ void EditorViewportWidget::Update() (*itr)->OnPostRender(); } } - - gEnv->pSystem->SetViewCamera(CurCamera); } { @@ -609,35 +520,7 @@ void EditorViewportWidget::Update() m_bUpdateViewport = false; } -////////////////////////////////////////////////////////////////////////// -void EditorViewportWidget::SetViewEntity(const AZ::EntityId& viewEntityId, bool lockCameraMovement) -{ - // if they've picked the same camera, then that means they want to toggle - if (viewEntityId.IsValid() && viewEntityId != m_viewEntityId) - { - LockCameraMovement(lockCameraMovement); - m_viewEntityId = viewEntityId; - AZStd::string entityName; - AZ::ComponentApplicationBus::BroadcastResult(entityName, &AZ::ComponentApplicationRequests::GetEntityName, viewEntityId); - SetName(QString("Camera entity: %1").arg(entityName.c_str())); - } - else - { - SetDefaultCamera(); - } - PostCameraSet(); -} - -////////////////////////////////////////////////////////////////////////// -void EditorViewportWidget::ResetToViewSourceType(const ViewSourceType& viewSourceType) -{ - LockCameraMovement(true); - m_viewEntityId.SetInvalid(); - m_cameraObjectId = GUID_NULL; - m_viewSourceType = viewSourceType; - SetViewTM(GetViewTM()); -} ////////////////////////////////////////////////////////////////////////// void EditorViewportWidget::PostCameraSet() @@ -647,10 +530,28 @@ void EditorViewportWidget::PostCameraSet() m_viewPane->OnFOVChanged(GetFOV()); } + // CryLegacy notify GetIEditor()->Notify(eNotify_CameraChanged); - QScopedValueRollback rb(m_ignoreSetViewFromEntityPerspective, true); + + // Special case in the editor; if the camera is the default editor camera, + // notify that the active view changed. In game mode, it is a hard error to not have + // any cameras on the view stack! + if (m_viewSourceType == ViewSourceType::None) + { + m_sendingOnActiveChanged = true; + Camera::CameraNotificationBus::Broadcast( + &Camera::CameraNotificationBus::Events::OnActiveViewChanged, AZ::EntityId()); + m_sendingOnActiveChanged = false; + } + + // Notify about editor camera change Camera::EditorCameraNotificationBus::Broadcast( &Camera::EditorCameraNotificationBus::Events::OnViewportViewEntityChanged, m_viewEntityId); + + // The editor view entity ID has changed, and the editor camera component "Be This Camera" text needs to be updated + AzToolsFramework::PropertyEditorGUIMessages::Bus::Broadcast( + &AzToolsFramework::PropertyEditorGUIMessages::RequestRefresh, + AzToolsFramework::PropertyModificationRefreshLevel::Refresh_AttributesAndValues); } ////////////////////////////////////////////////////////////////////////// @@ -658,16 +559,7 @@ CBaseObject* EditorViewportWidget::GetCameraObject() const { CBaseObject* pCameraObject = nullptr; - if (m_viewSourceType == ViewSourceType::SequenceCamera) - { - m_cameraObjectId = GetViewManager()->GetCameraObjectId(); - } - if (m_cameraObjectId != GUID_NULL) - { - // Find camera object from id. - pCameraObject = GetIEditor()->GetObjectManager()->FindObject(m_cameraObjectId); - } - else if (m_viewSourceType == ViewSourceType::CameraComponent || m_viewSourceType == ViewSourceType::AZ_Entity) + if (m_viewSourceType == ViewSourceType::CameraComponent) { AzToolsFramework::ComponentEntityEditorRequestBus::EventResult( pCameraObject, m_viewEntityId, &AzToolsFramework::ComponentEntityEditorRequests::GetSandboxObject); @@ -723,10 +615,6 @@ void EditorViewportWidget::OnEditorNotifyEvent(EEditorNotifyEvent event) if (GetIEditor()->GetViewManager()->GetGameViewport() == this) { SetCurrentCursor(STD_CURSOR_DEFAULT); - m_bInRotateMode = false; - m_bInMoveMode = false; - m_bInOrbitMode = false; - m_bInZoomMode = false; if (m_inFullscreenPreview) { @@ -818,21 +706,6 @@ void EditorViewportWidget::OnEditorNotifyEvent(EEditorNotifyEvent event) } } -////////////////////////////////////////////////////////////////////////// -void EditorViewportWidget::OnRender() -{ - if (m_rcClient.isEmpty()) - { - // Even in null rendering, update the view camera. - // This is necessary so that automated editor tests using the null renderer to test systems like dynamic vegetation - // are still able to manipulate the current logical camera position, even if nothing is rendered. - GetIEditor()->GetSystem()->SetViewCamera(m_Camera); - return; - } - - FUNCTION_PROFILER(GetIEditor()->GetSystem(), PROFILE_EDITOR); -} - void EditorViewportWidget::OnBeginPrepareRender() { if (!m_debugDisplay) @@ -853,82 +726,6 @@ void EditorViewportWidget::OnBeginPrepareRender() Update(); m_isOnPaint = false; - float fNearZ = GetIEditor()->GetConsoleVar("cl_DefaultNearPlane"); - float fFarZ = m_Camera.GetFarPlane(); - - CBaseObject* cameraObject = GetCameraObject(); - if (cameraObject) - { - AZ::Matrix3x3 lookThroughEntityCorrection = AZ::Matrix3x3::CreateIdentity(); - if (m_viewEntityId.IsValid()) - { - Camera::CameraRequestBus::EventResult(fNearZ, m_viewEntityId, &Camera::CameraComponentRequests::GetNearClipDistance); - Camera::CameraRequestBus::EventResult(fFarZ, m_viewEntityId, &Camera::CameraComponentRequests::GetFarClipDistance); - LmbrCentral::EditorCameraCorrectionRequestBus::EventResult( - lookThroughEntityCorrection, m_viewEntityId, &LmbrCentral::EditorCameraCorrectionRequests::GetTransformCorrection); - } - - m_viewTM = cameraObject->GetWorldTM() * AZMatrix3x3ToLYMatrix3x3(lookThroughEntityCorrection); - m_viewTM.OrthonormalizeFast(); - - m_Camera.SetMatrix(m_viewTM); - - int w = m_rcClient.width(); - int h = m_rcClient.height(); - - m_Camera.SetFrustum(w, h, GetFOV(), fNearZ, fFarZ); - } - else if (m_viewEntityId.IsValid()) - { - Camera::CameraRequestBus::EventResult(fNearZ, m_viewEntityId, &Camera::CameraComponentRequests::GetNearClipDistance); - Camera::CameraRequestBus::EventResult(fFarZ, m_viewEntityId, &Camera::CameraComponentRequests::GetFarClipDistance); - int w = m_rcClient.width(); - int h = m_rcClient.height(); - - m_Camera.SetFrustum(w, h, GetFOV(), fNearZ, fFarZ); - } - else - { - // Normal camera. - m_cameraObjectId = GUID_NULL; - int w = m_rcClient.width(); - int h = m_rcClient.height(); - - // Don't bother doing an FOV calculation if we don't have a valid viewport - // This prevents frustum calculation bugs with a null viewport - if (w <= 1 || h <= 1) - { - return; - } - - float fov = gSettings.viewports.fDefaultFov; - - // match viewport fov to default / selected title menu fov - if (GetFOV() != fov) - { - if (m_viewPane) - { - m_viewPane->OnFOVChanged(fov); - SetFOV(fov); - } - } - - // Just for editor: Aspect ratio fix when changing the viewport - if (!GetIEditor()->IsInGameMode()) - { - float viewportAspectRatio = float( w ) / h; - float targetAspectRatio = GetAspectRatio(); - if (targetAspectRatio > viewportAspectRatio) - { - // Correct for vertical FOV change. - float maxTargetHeight = float( w ) / targetAspectRatio; - fov = 2 * atanf((h * tan(fov / 2)) / maxTargetHeight); - } - } - m_Camera.SetFrustum(w, h, fov, fNearZ); - } - - GetIEditor()->GetSystem()->SetViewCamera(m_Camera); if (GetIEditor()->IsInGameMode()) { @@ -940,9 +737,13 @@ void EditorViewportWidget::OnBeginPrepareRender() RenderAll(); // Draw 2D helpers. +#ifdef LYSHINE_ATOM_TODO TransformationMatrices backupSceneMatrices; +#endif m_debugDisplay->DepthTestOff(); - //m_renderer->Set2DMode(m_rcClient.right(), m_rcClient.bottom(), backupSceneMatrices); +#ifdef LYSHINE_ATOM_TODO + m_renderer->Set2DMode(m_rcClient.right(), m_rcClient.bottom(), backupSceneMatrices); +#endif auto prevState = m_debugDisplay->GetState(); m_debugDisplay->SetState(e_Mode3D | e_AlphaBlended | e_FillModeSolid | e_CullModeBack | e_DepthWriteOn | e_DepthTestOn); @@ -1014,29 +815,35 @@ void EditorViewportWidget::UpdateSafeFrame() float maxSafeFrameWidth = m_safeFrame.height() * targetAspectRatio; float widthDifference = m_safeFrame.width() - maxSafeFrameWidth; - m_safeFrame.setLeft(m_safeFrame.left() + widthDifference * 0.5); - m_safeFrame.setRight(m_safeFrame.right() - widthDifference * 0.5); + m_safeFrame.setLeft(static_cast(m_safeFrame.left() + widthDifference * 0.5f)); + m_safeFrame.setRight(static_cast(m_safeFrame.right() - widthDifference * 0.5f)); } else { float maxSafeFrameHeight = m_safeFrame.width() / targetAspectRatio; float heightDifference = m_safeFrame.height() - maxSafeFrameHeight; - m_safeFrame.setTop(m_safeFrame.top() + heightDifference * 0.5); - m_safeFrame.setBottom(m_safeFrame.bottom() - heightDifference * 0.5); + m_safeFrame.setTop(static_cast(m_safeFrame.top() + heightDifference * 0.5f)); + m_safeFrame.setBottom(static_cast(m_safeFrame.bottom() - heightDifference * 0.5f)); } m_safeFrame.adjust(0, 0, -1, -1); // <-- aesthetic improvement. const float SAFE_ACTION_SCALE_FACTOR = 0.05f; m_safeAction = m_safeFrame; - m_safeAction.adjust(m_safeFrame.width() * SAFE_ACTION_SCALE_FACTOR, m_safeFrame.height() * SAFE_ACTION_SCALE_FACTOR, - -m_safeFrame.width() * SAFE_ACTION_SCALE_FACTOR, -m_safeFrame.height() * SAFE_ACTION_SCALE_FACTOR); + m_safeAction.adjust( + static_cast(m_safeFrame.width() * SAFE_ACTION_SCALE_FACTOR), + static_cast(m_safeFrame.height() * SAFE_ACTION_SCALE_FACTOR), + static_cast(-m_safeFrame.width() * SAFE_ACTION_SCALE_FACTOR), + static_cast(-m_safeFrame.height() * SAFE_ACTION_SCALE_FACTOR)); const float SAFE_TITLE_SCALE_FACTOR = 0.1f; m_safeTitle = m_safeFrame; - m_safeTitle.adjust(m_safeFrame.width() * SAFE_TITLE_SCALE_FACTOR, m_safeFrame.height() * SAFE_TITLE_SCALE_FACTOR, - -m_safeFrame.width() * SAFE_TITLE_SCALE_FACTOR, -m_safeFrame.height() * SAFE_TITLE_SCALE_FACTOR); + m_safeTitle.adjust( + static_cast(m_safeFrame.width() * SAFE_TITLE_SCALE_FACTOR), + static_cast(m_safeFrame.height() * SAFE_TITLE_SCALE_FACTOR), + static_cast(-m_safeFrame.width() * SAFE_TITLE_SCALE_FACTOR), + static_cast(-m_safeFrame.height() * SAFE_TITLE_SCALE_FACTOR)); } ////////////////////////////////////////////////////////////////////////// @@ -1055,8 +862,8 @@ void EditorViewportWidget::RenderSafeFrame(const QRect& frame, float r, float g, const int LINE_WIDTH = 2; for (int i = 0; i < LINE_WIDTH; i++) { - AZ::Vector3 topLeft(frame.left() + i, frame.top() + i, 0); - AZ::Vector3 bottomRight(frame.right() - i, frame.bottom() - i, 0); + AZ::Vector3 topLeft(static_cast(frame.left() + i), static_cast(frame.top() + i), 0.0f); + AZ::Vector3 bottomRight(static_cast(frame.right() - i), static_cast(frame.bottom() - i), 0.0f); m_debugDisplay->DrawWireBox(topLeft, bottomRight); } } @@ -1144,31 +951,16 @@ void EditorViewportWidget::OnMenuSelectCurrentCamera() AzFramework::CameraState EditorViewportWidget::GetCameraState() { - if (m_viewEntityId.IsValid()) - { - bool cameraStateAcquired = false; - AzFramework::CameraState cameraState; - Camera::EditorCameraViewRequestBus::BroadcastResult(cameraStateAcquired, - &Camera::EditorCameraViewRequestBus::Events::GetCameraState, cameraState); - if (cameraStateAcquired) - { - return cameraState; - } - } return m_renderViewport->GetCameraState(); } AZ::Vector3 EditorViewportWidget::PickTerrain(const AzFramework::ScreenPoint& point) { - FUNCTION_PROFILER(GetIEditor()->GetSystem(), PROFILE_EDITOR); - return LYVec3ToAZVec3(ViewToWorld(AzToolsFramework::ViewportInteraction::QPointFromScreenPoint(point), nullptr, true)); } AZ::EntityId EditorViewportWidget::PickEntity(const AzFramework::ScreenPoint& point) { - FUNCTION_PROFILER(GetIEditor()->GetSystem(), PROFILE_EDITOR); - PreWidgetRendering(); AZ::EntityId entityId; @@ -1195,8 +987,6 @@ float EditorViewportWidget::TerrainHeight(const AZ::Vector2& position) void EditorViewportWidget::FindVisibleEntities(AZStd::vector& visibleEntitiesOut) { - FUNCTION_PROFILER(GetIEditor()->GetSystem(), PROFILE_EDITOR); - visibleEntitiesOut.assign(m_entityVisibilityQuery.Begin(), m_entityVisibilityQuery.End()); } @@ -1236,200 +1026,6 @@ bool EditorViewportWidget::ShowingWorldSpace() return BuildKeyboardModifiers(QGuiApplication::queryKeyboardModifiers()).Shift(); } -AZStd::shared_ptr CreateModularViewportCameraController( - AzFramework::ViewportId viewportId) -{ - auto controller = AZStd::make_shared(); - - controller->SetCameraPriorityBuilderCallback( - [](AtomToolsFramework::CameraControllerPriorityFn& cameraControllerPriorityFn) - { - cameraControllerPriorityFn = AtomToolsFramework::DefaultCameraControllerPriority; - }); - - controller->SetCameraPropsBuilderCallback( - [](AzFramework::CameraProps& cameraProps) - { - cameraProps.m_rotateSmoothnessFn = [] - { - return SandboxEditor::CameraRotateSmoothness(); - }; - - cameraProps.m_translateSmoothnessFn = [] - { - return SandboxEditor::CameraTranslateSmoothness(); - }; - }); - - controller->SetCameraListBuilderCallback( - [viewportId](AzFramework::Cameras& cameras) - { - const auto hideCursor = [viewportId] - { - AzToolsFramework::ViewportInteraction::ViewportMouseCursorRequestBus::Event( - viewportId, &AzToolsFramework::ViewportInteraction::ViewportMouseCursorRequestBus::Events::BeginCursorCapture); - }; - const auto showCursor = [viewportId] - { - AzToolsFramework::ViewportInteraction::ViewportMouseCursorRequestBus::Event( - viewportId, &AzToolsFramework::ViewportInteraction::ViewportMouseCursorRequestBus::Events::EndCursorCapture); - }; - - auto firstPersonRotateCamera = AZStd::make_shared(SandboxEditor::CameraFreeLookChannelId()); - firstPersonRotateCamera->m_rotateSpeedFn = [] - { - return SandboxEditor::CameraRotateSpeed(); - }; - - if (!ed_showCursorCameraLook) - { - // default behavior is to hide the cursor but this can be disabled (useful for remote desktop) - firstPersonRotateCamera->SetActivationBeganFn(hideCursor); - firstPersonRotateCamera->SetActivationEndedFn(showCursor); - } - - auto firstPersonPanCamera = - AZStd::make_shared(SandboxEditor::CameraFreePanChannelId(), AzFramework::LookPan); - firstPersonPanCamera->m_panSpeedFn = [] - { - return SandboxEditor::CameraPanSpeed(); - }; - firstPersonPanCamera->m_invertPanXFn = [] - { - return SandboxEditor::CameraPanInvertedX(); - }; - firstPersonPanCamera->m_invertPanYFn = [] - { - return SandboxEditor::CameraPanInvertedY(); - }; - - AzFramework::TranslateCameraInputChannels translateCameraInputChannels; - translateCameraInputChannels.m_leftChannelId = SandboxEditor::CameraTranslateLeftChannelId(); - translateCameraInputChannels.m_rightChannelId = SandboxEditor::CameraTranslateRightChannelId(); - translateCameraInputChannels.m_forwardChannelId = SandboxEditor::CameraTranslateForwardChannelId(); - translateCameraInputChannels.m_backwardChannelId = SandboxEditor::CameraTranslateBackwardChannelId(); - translateCameraInputChannels.m_upChannelId = SandboxEditor::CameraTranslateUpChannelId(); - translateCameraInputChannels.m_downChannelId = SandboxEditor::CameraTranslateDownChannelId(); - translateCameraInputChannels.m_boostChannelId = SandboxEditor::CameraTranslateBoostChannelId(); - - auto firstPersonTranslateCamera = - AZStd::make_shared(AzFramework::LookTranslation, translateCameraInputChannels); - firstPersonTranslateCamera->m_translateSpeedFn = [] - { - return SandboxEditor::CameraTranslateSpeed(); - }; - firstPersonTranslateCamera->m_boostMultiplierFn = [] - { - return SandboxEditor::CameraBoostMultiplier(); - }; - - auto firstPersonWheelCamera = AZStd::make_shared(); - firstPersonWheelCamera->m_scrollSpeedFn = [] - { - return SandboxEditor::CameraScrollSpeed(); - }; - - auto orbitCamera = AZStd::make_shared(SandboxEditor::CameraOrbitChannelId()); - orbitCamera->SetLookAtFn( - [viewportId](const AZ::Vector3& position, const AZ::Vector3& direction) -> AZStd::optional - { - AZStd::optional lookAtAfterInterpolation; - AtomToolsFramework::ModularViewportCameraControllerRequestBus::EventResult( - lookAtAfterInterpolation, viewportId, - &AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::LookAtAfterInterpolation); - - // initially attempt to use the last set look at point after an interpolation has finished - if (lookAtAfterInterpolation.has_value()) - { - return *lookAtAfterInterpolation; - } - - const float RayDistance = 1000.0f; - AzFramework::RenderGeometry::RayRequest ray; - ray.m_startWorldPosition = position; - ray.m_endWorldPosition = position + direction * RayDistance; - ray.m_onlyVisible = true; - - AzFramework::RenderGeometry::RayResult renderGeometryIntersectionResult; - AzFramework::RenderGeometry::IntersectorBus::EventResult( - renderGeometryIntersectionResult, AzToolsFramework::GetEntityContextId(), - &AzFramework::RenderGeometry::IntersectorBus::Events::RayIntersect, ray); - - // attempt a ray intersection with any visible mesh and return the intersection position if successful - if (renderGeometryIntersectionResult) - { - return renderGeometryIntersectionResult.m_worldPosition; - } - - // if there is no selection or no intersection, fallback to default camera orbit behavior (ground plane - // intersection) - return {}; - }); - - auto orbitRotateCamera = AZStd::make_shared(SandboxEditor::CameraOrbitLookChannelId()); - orbitRotateCamera->m_rotateSpeedFn = [] - { - return SandboxEditor::CameraRotateSpeed(); - }; - orbitRotateCamera->m_invertYawFn = [] - { - return SandboxEditor::CameraOrbitYawRotationInverted(); - }; - - auto orbitTranslateCamera = - AZStd::make_shared(AzFramework::OrbitTranslation, translateCameraInputChannels); - orbitTranslateCamera->m_translateSpeedFn = [] - { - return SandboxEditor::CameraTranslateSpeed(); - }; - orbitTranslateCamera->m_boostMultiplierFn = [] - { - return SandboxEditor::CameraBoostMultiplier(); - }; - - auto orbitDollyWheelCamera = AZStd::make_shared(); - orbitDollyWheelCamera->m_scrollSpeedFn = [] - { - return SandboxEditor::CameraScrollSpeed(); - }; - - auto orbitDollyMoveCamera = - AZStd::make_shared(SandboxEditor::CameraOrbitDollyChannelId()); - orbitDollyMoveCamera->m_cursorSpeedFn = [] - { - return SandboxEditor::CameraDollyMotionSpeed(); - }; - - auto orbitPanCamera = AZStd::make_shared(SandboxEditor::CameraOrbitPanChannelId(), AzFramework::OrbitPan); - orbitPanCamera->m_panSpeedFn = [] - { - return SandboxEditor::CameraPanSpeed(); - }; - orbitPanCamera->m_invertPanXFn = [] - { - return SandboxEditor::CameraPanInvertedX(); - }; - orbitPanCamera->m_invertPanYFn = [] - { - return SandboxEditor::CameraPanInvertedY(); - }; - - orbitCamera->m_orbitCameras.AddCamera(orbitRotateCamera); - orbitCamera->m_orbitCameras.AddCamera(orbitTranslateCamera); - orbitCamera->m_orbitCameras.AddCamera(orbitDollyWheelCamera); - orbitCamera->m_orbitCameras.AddCamera(orbitDollyMoveCamera); - orbitCamera->m_orbitCameras.AddCamera(orbitPanCamera); - - cameras.AddCamera(firstPersonRotateCamera); - cameras.AddCamera(firstPersonPanCamera); - cameras.AddCamera(firstPersonTranslateCamera); - cameras.AddCamera(firstPersonWheelCamera); - cameras.AddCamera(orbitCamera); - }); - - return controller; -} - void EditorViewportWidget::SetViewportId(int id) { CViewport::SetViewportId(id); @@ -1467,23 +1063,15 @@ void EditorViewportWidget::SetViewportId(int id) } auto viewportContext = m_renderViewport->GetViewportContext(); m_defaultViewportContextName = viewportContext->GetName(); + m_defaultView = viewportContext->GetDefaultView(); QBoxLayout* layout = new QBoxLayout(QBoxLayout::Direction::TopToBottom, this); layout->setContentsMargins(QMargins()); layout->addWidget(m_renderViewport); - viewportContext->ConnectViewMatrixChangedHandler(m_cameraViewMatrixChangeHandler); - viewportContext->ConnectProjectionMatrixChangedHandler(m_cameraProjectionMatrixChangeHandler); - m_renderViewport->GetControllerList()->Add(AZStd::make_shared()); - if (ed_useNewCameraSystem) - { - m_renderViewport->GetControllerList()->Add(CreateModularViewportCameraController(AzFramework::ViewportId(id))); - } - else - { - m_renderViewport->GetControllerList()->Add(AZStd::make_shared()); - } + m_editorModularViewportCameraComposer = AZStd::make_unique(AzFramework::ViewportId(id)); + m_renderViewport->GetControllerList()->Add(m_editorModularViewportCameraComposer->CreateModularViewportCameraController()); m_renderViewport->SetViewportSettings(&g_EditorViewportSettings); @@ -1682,7 +1270,6 @@ bool EditorViewportWidget::AddCameraMenuItems(QMenu* menu) menu->addSeparator(); } - AZ::ViewportHelpers::AddCheckbox(menu, "Lock Camera Movement", &m_bLockCameraMovement); menu->addSeparator(); // Camera Sub menu @@ -1696,19 +1283,8 @@ bool EditorViewportWidget::AddCameraMenuItems(QMenu* menu) AZ::EBusAggregateResults getCameraResults; Camera::CameraBus::BroadcastResult(getCameraResults, &Camera::CameraRequests::GetCameras); - const int numCameras = getCameraResults.values.size(); - - // only enable if we're editing a sequence in Track View and have cameras in the level - bool enableSequenceCameraMenu = (GetIEditor()->GetAnimation()->GetSequence() && numCameras); - - action = customCameraMenu->addAction(tr("Sequence Camera")); - action->setCheckable(true); - action->setChecked(m_viewSourceType == ViewSourceType::SequenceCamera); - action->setEnabled(enableSequenceCameraMenu); - connect(action, &QAction::triggered, this, &EditorViewportWidget::SetSequenceCamera); - QVector additionalCameras; - additionalCameras.reserve(getCameraResults.values.size()); + additionalCameras.reserve(static_cast(getCameraResults.values.size())); for (const AZ::EntityId& entityId : getCameraResults.values) { @@ -1740,28 +1316,6 @@ bool EditorViewportWidget::AddCameraMenuItems(QMenu* menu) customCameraMenu->addAction(cameraAction); } - action = customCameraMenu->addAction(tr("Look through entity")); - bool areAnyEntitiesSelected = false; - AzToolsFramework::ToolsApplicationRequestBus::BroadcastResult(areAnyEntitiesSelected, &AzToolsFramework::ToolsApplicationRequests::AreAnyEntitiesSelected); - action->setCheckable(areAnyEntitiesSelected || m_viewSourceType == ViewSourceType::AZ_Entity); - action->setEnabled(areAnyEntitiesSelected || m_viewSourceType == ViewSourceType::AZ_Entity); - action->setChecked(m_viewSourceType == ViewSourceType::AZ_Entity); - connect(action, &QAction::triggered, this, [this](bool isChecked) - { - if (isChecked) - { - AzToolsFramework::EntityIdList selectedEntityList; - AzToolsFramework::ToolsApplicationRequests::Bus::BroadcastResult(selectedEntityList, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntities); - if (selectedEntityList.size()) - { - SetEntityAsCamera(*selectedEntityList.begin()); - } - } - else - { - SetDefaultCamera(); - } - }); return true; } @@ -1790,28 +1344,6 @@ void EditorViewportWidget::ResizeView(int width, int height) } } -////////////////////////////////////////////////////////////////////////// -void EditorViewportWidget::ToggleCameraObject() -{ - if (m_viewSourceType == ViewSourceType::SequenceCamera) - { - ResetToViewSourceType(ViewSourceType::LegacyCamera); - } - else - { - ResetToViewSourceType(ViewSourceType::SequenceCamera); - } - PostCameraSet(); - GetIEditor()->GetAnimation()->ForceAnimation(); -} - -////////////////////////////////////////////////////////////////////////// -void EditorViewportWidget::SetCamera(const CCamera& camera) -{ - m_Camera = camera; - SetViewTM(m_Camera.GetMatrix()); -} - ////////////////////////////////////////////////////////////////////////// EditorViewportWidget* EditorViewportWidget::GetPrimaryViewport() { @@ -1865,64 +1397,64 @@ void EditorViewportWidget::keyPressEvent(QKeyEvent* event) #endif // defined(AZ_PLATFORM_WINDOWS) } -void EditorViewportWidget::SetViewTM(const Matrix34& viewTM, bool bMoveOnly) +void EditorViewportWidget::SetViewTM(const Matrix34& tm) { - Matrix34 camMatrix = viewTM; - - // If no collision flag set do not check for terrain elevation. - if (GetType() == ET_ViewportCamera) + if (m_viewSourceType == ViewSourceType::None) { - if ((GetIEditor()->GetDisplaySettings()->GetSettings() & SETTINGS_NOCOLLISION) == 0) - { - Vec3 p = camMatrix.GetTranslation(); - bool adjustCameraElevation = true; - auto terrain = AzFramework::Terrain::TerrainDataRequestBus::FindFirstHandler(); - if (terrain) - { - AZ::Aabb terrainAabb(terrain->GetTerrainAabb()); - - // Adjust the AABB to include all Z values. Since the goal here is to snap the camera to the terrain height if - // it's below the terrain, we only want to verify the camera is within the XY bounds of the terrain to adjust the elevation. - terrainAabb.SetMin(AZ::Vector3(terrainAabb.GetMin().GetX(), terrainAabb.GetMin().GetY(), -AZ::Constants::FloatMax)); - terrainAabb.SetMax(AZ::Vector3(terrainAabb.GetMax().GetX(), terrainAabb.GetMax().GetY(), AZ::Constants::FloatMax)); - - if (!terrainAabb.Contains(LYVec3ToAZVec3(p))) - { - adjustCameraElevation = false; - } - else if (terrain->GetIsHoleFromFloats(p.x, p.y)) - { - adjustCameraElevation = false; - } - } - - if (adjustCameraElevation) - { - float z = GetIEditor()->GetTerrainElevation(p.x, p.y); - if (p.z < z + 0.25) - { - p.z = z + 0.25; - camMatrix.SetTranslation(p); - } - } - } - - // Also force this position on game. - if (GetIEditor()->GetGameEngine()) - { - GetIEditor()->GetGameEngine()->SetPlayerViewMatrix(viewTM); - } + m_defaultViewTM = tm; } + SetViewTM(tm, false); +} +void EditorViewportWidget::SetViewTM(const Matrix34& camMatrix, bool bMoveOnly) +{ + AZ_Warning("EditorViewportWidget", !bMoveOnly, "'Move Only' mode is deprecated"); CBaseObject* cameraObject = GetCameraObject(); - if (cameraObject) + + // Check if the active view entity is the same as the entity having the current view + // Sometimes this isn't the case because the active view is in the process of changing + // If it isn't, then we're doing the wrong thing below: we end up copying data from one (seemingly random) + // camera to another (seemingly random) camera + enum class ShouldUpdateObject { - // Ignore camera movement if locked. - if (IsCameraMovementLocked() || (!GetIEditor()->GetAnimation()->IsRecordMode() && !IsCameraObjectMove())) + Yes, No, YesButViewsOutOfSync + }; + + const ShouldUpdateObject shouldUpdateObject = [&]() { + if (!cameraObject) { - return; + return ShouldUpdateObject::No; } + if (m_viewSourceType == ViewSourceType::CameraComponent) + { + if (!m_viewEntityId.IsValid()) + { + // Should be impossible anyways + AZ_Assert(false, "Internal logic error - view entity Id and view source type out of sync. Please report this as a bug"); + return ShouldUpdateObject::No; + } + + // Check that the current view is the same view as the view entity view + AZ::RPI::ViewPtr viewEntityView; + AZ::RPI::ViewProviderBus::EventResult( + viewEntityView, m_viewEntityId, + &AZ::RPI::ViewProviderBus::Events::GetView + ); + + return viewEntityView == GetCurrentAtomView() ? ShouldUpdateObject::Yes : ShouldUpdateObject::YesButViewsOutOfSync; + } + else + { + AZ_Assert(false, "Internal logic error - view source type is the default camera, but there is somehow a camera object. Please report this as a bug."); + + // For non-component cameras, can't do any complicated view-based checks + return ShouldUpdateObject::No; + } + }(); + + if (shouldUpdateObject == ShouldUpdateObject::Yes) + { AZ::Matrix3x3 lookThroughEntityCorrection = AZ::Matrix3x3::CreateIdentity(); if (m_viewEntityId.IsValid()) { @@ -1931,89 +1463,77 @@ void EditorViewportWidget::SetViewTM(const Matrix34& viewTM, bool bMoveOnly) &LmbrCentral::EditorCameraCorrectionRequests::GetInverseTransformCorrection); } - if (m_pressedKeyState != KeyPressedState::PressedInPreviousFrame) + int flags = 0; { - AzToolsFramework::ScopedUndoBatch undo("Move Camera"); + // It isn't clear what this logic is supposed to do (it's legacy code)... + // For now, instead of removing it, just assert if the m_pressedKeyState isn't as expected + // Do not touch unless you really know what you're doing! + AZ_Assert(m_pressedKeyState == KeyPressedState::AllUp, "Internal logic error - key pressed state got changed. Please report this as a bug"); + + AZStd::optional undo; + if (m_pressedKeyState != KeyPressedState::PressedInPreviousFrame) + { + flags = eObjectUpdateFlags_UserInput; + undo.emplace("Move Camera"); + } + if (bMoveOnly) { - // specify eObjectUpdateFlags_UserInput so that an undo command gets logged - cameraObject->SetWorldPos(camMatrix.GetTranslation(), eObjectUpdateFlags_UserInput); + cameraObject->SetWorldPos(camMatrix.GetTranslation(), flags); } else { - // specify eObjectUpdateFlags_UserInput so that an undo command gets logged - cameraObject->SetWorldTM(camMatrix * AZMatrix3x3ToLYMatrix3x3(lookThroughEntityCorrection), eObjectUpdateFlags_UserInput); - } - } - else - { - if (bMoveOnly) - { - // Do not specify eObjectUpdateFlags_UserInput, so that an undo command does not get logged; we covered it already when m_pressedKeyState was PressedThisFrame - cameraObject->SetWorldPos(camMatrix.GetTranslation()); - } - else - { - // Do not specify eObjectUpdateFlags_UserInput, so that an undo command does not get logged; we covered it already when m_pressedKeyState was PressedThisFrame - cameraObject->SetWorldTM(camMatrix * AZMatrix3x3ToLYMatrix3x3(lookThroughEntityCorrection)); + cameraObject->SetWorldTM(camMatrix * AZMatrix3x3ToLYMatrix3x3(lookThroughEntityCorrection), flags); } } } - else if (m_viewEntityId.IsValid()) + else if (shouldUpdateObject == ShouldUpdateObject::YesButViewsOutOfSync) { - // Ignore camera movement if locked. - if (IsCameraMovementLocked() || (!GetIEditor()->GetAnimation()->IsRecordMode() && !IsCameraObjectMove())) - { - return; - } - - if (m_pressedKeyState != KeyPressedState::PressedInPreviousFrame) - { - AzToolsFramework::ScopedUndoBatch undo("Move Camera"); - if (bMoveOnly) - { - AZ::TransformBus::Event( - m_viewEntityId, &AZ::TransformInterface::SetWorldTranslation, - LYVec3ToAZVec3(camMatrix.GetTranslation())); - } - else - { - AZ::TransformBus::Event( - m_viewEntityId, &AZ::TransformInterface::SetWorldTM, - LYTransformToAZTransform(camMatrix)); - } - - AzToolsFramework::ToolsApplicationRequestBus::Broadcast(&AzToolsFramework::ToolsApplicationRequests::AddDirtyEntity, m_viewEntityId); - } - else - { - if (bMoveOnly) - { - AZ::TransformBus::Event( - m_viewEntityId, &AZ::TransformInterface::SetWorldTranslation, - LYVec3ToAZVec3(camMatrix.GetTranslation())); - } - else - { - AZ::TransformBus::Event( - m_viewEntityId, &AZ::TransformInterface::SetWorldTM, - LYTransformToAZTransform(camMatrix)); - } - } - - AzToolsFramework::PropertyEditorGUIMessages::Bus::Broadcast( - &AzToolsFramework::PropertyEditorGUIMessages::RequestRefresh, - AzToolsFramework::PropertyModificationRefreshLevel::Refresh_AttributesAndValues); + // Technically this should not cause anything to go wrong, but may indicate some underlying bug by a caller + // of SetViewTm, for example, trying to set the view TM in the middle of a camera change. + // If this is an important case, it can potentially be supported by caching the requested view TM + // until the entity and view ptr become synchronized. + AZ_Error("EditorViewportWidget", + m_playInEditorState == PlayInEditorState::Editor, + "Viewport camera entity ID and view out of sync; request view transform will be ignored. " + "Please report this as a bug." + ); } if (m_pressedKeyState == KeyPressedState::PressedThisFrame) { m_pressedKeyState = KeyPressedState::PressedInPreviousFrame; } +} - QtViewport::SetViewTM(camMatrix); +const Matrix34& EditorViewportWidget::GetViewTM() const +{ + // `m_viewTmStorage' is only required because we must return a reference + m_viewTmStorage = AZTransformToLYTransform(GetCurrentAtomView()->GetCameraTransform()); + return m_viewTmStorage; +}; - m_Camera.SetMatrix(camMatrix); +AZ::EntityId EditorViewportWidget::GetCurrentViewEntityId() +{ + // Sanity check that this camera entity ID is actually the camera entity which owns the current active render view + if (m_viewSourceType == ViewSourceType::CameraComponent) + { + // Check that the current view is the same view as the view entity view + AZ::RPI::ViewPtr viewEntityView; + AZ::RPI::ViewProviderBus::EventResult( + viewEntityView, m_viewEntityId, + &AZ::RPI::ViewProviderBus::Events::GetView + ); + + [[maybe_unused]] const bool isViewEntityCorrect = viewEntityView == GetCurrentAtomView(); + AZ_Error("EditorViewportWidget", isViewEntityCorrect, + "GetCurrentViewEntityId called while the current view is being changed. " + "You may get inconsistent results if you make use of the returned entity ID. " + "This is an internal error, please report it as a bug." + ); + } + + return m_viewEntityId; } ////////////////////////////////////////////////////////////////////////// @@ -2186,7 +1706,7 @@ void EditorViewportWidget::RenderSelectedRegion() // Draw volume dc.DepthWriteOff(); dc.CullOff(); - dc.pRenderAuxGeom->DrawTriangles(&verts[0], verts.size(), &inds[0], numInds, &colors[0]); + dc.pRenderAuxGeom->DrawTriangles(&verts[0], static_cast(verts.size()), &inds[0], numInds, &colors[0]); dc.CullOn(); dc.DepthWriteOn(); } @@ -2202,8 +1722,8 @@ Vec3 EditorViewportWidget::WorldToView3D(const Vec3& wp, [[maybe_unused]] int nF { out.x = (x / 100) * m_rcClient.width(); out.y = (y / 100) * m_rcClient.height(); - out.x /= QHighDpiScaling::factor(windowHandle()->screen()); - out.y /= QHighDpiScaling::factor(windowHandle()->screen()); + out.x /= static_cast(QHighDpiScaling::factor(windowHandle()->screen())); + out.y /= static_cast(QHighDpiScaling::factor(windowHandle()->screen())); out.z = z; } return out; @@ -2223,8 +1743,8 @@ QPoint EditorViewportWidget::WorldToViewParticleEditor(const Vec3& wp, int width ProjectToScreen(wp.x, wp.y, wp.z, &x, &y, &z); if (_finite(x) || _finite(y)) { - p.rx() = (x / 100) * width; - p.ry() = (y / 100) * height; + p.rx() = static_cast((x / 100) * width); + p.ry() = static_cast((y / 100) * height); } else { @@ -2237,14 +1757,14 @@ QPoint EditorViewportWidget::WorldToViewParticleEditor(const Vec3& wp, int width Vec3 EditorViewportWidget::ViewToWorld( const QPoint& vp, bool* collideWithTerrain, bool onlyTerrain, bool bSkipVegetation, bool bTestRenderMesh, bool* collideWithObject) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor); + AZ_PROFILE_FUNCTION(Editor); - AZ_UNUSED(collideWithTerrain) - AZ_UNUSED(onlyTerrain) - AZ_UNUSED(bTestRenderMesh) - AZ_UNUSED(bSkipVegetation) - AZ_UNUSED(bSkipVegetation) - AZ_UNUSED(collideWithObject) + AZ_UNUSED(collideWithTerrain); + AZ_UNUSED(onlyTerrain); + AZ_UNUSED(bTestRenderMesh); + AZ_UNUSED(bSkipVegetation); + AZ_UNUSED(bSkipVegetation); + AZ_UNUSED(collideWithObject); auto ray = m_renderViewport->ViewportScreenToWorldRay(AzToolsFramework::ViewportInteraction::ScreenPointFromQPoint(vp)); if (!ray.has_value()) @@ -2268,82 +1788,15 @@ Vec3 EditorViewportWidget::ViewToWorld( ////////////////////////////////////////////////////////////////////////// Vec3 EditorViewportWidget::ViewToWorldNormal(const QPoint& vp, bool onlyTerrain, bool bTestRenderMesh) { - AZ_UNUSED(vp) - AZ_UNUSED(onlyTerrain) - AZ_UNUSED(bTestRenderMesh) + AZ_UNUSED(vp); + AZ_UNUSED(onlyTerrain); + AZ_UNUSED(bTestRenderMesh); - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor); + AZ_PROFILE_FUNCTION(Editor); return Vec3(0, 0, 1); } -////////////////////////////////////////////////////////////////////////// -bool EditorViewportWidget::AdjustObjectPosition(const ray_hit& hit, Vec3& outNormal, Vec3& outPos) const -{ - Matrix34A objMat, objMatInv; - Matrix33 objRot, objRotInv; - - if (hit.pCollider->GetiForeignData() != PHYS_FOREIGN_ID_STATIC) - { - return false; - } - - IRenderNode* pNode = (IRenderNode*) hit.pCollider->GetForeignData(PHYS_FOREIGN_ID_STATIC); - if (!pNode || !pNode->GetEntityStatObj()) - { - return false; - } - - IStatObj* pEntObject = pNode->GetEntityStatObj(hit.partid, 0, &objMat, false); - if (!pEntObject || !pEntObject->GetRenderMesh()) - { - return false; - } - - objRot = Matrix33(objMat); - objRot.NoScale(); // No scale. - objRotInv = objRot; - objRotInv.Invert(); - - float fWorldScale = objMat.GetColumn(0).GetLength(); // GetScale - float fWorldScaleInv = 1.0f / fWorldScale; - - // transform decal into object space - objMatInv = objMat; - objMatInv.Invert(); - - // put into normal object space hit direction of projection - Vec3 invhitn = -(hit.n); - Vec3 vOS_HitDir = objRotInv.TransformVector(invhitn).GetNormalized(); - - // put into position object space hit position - Vec3 vOS_HitPos = objMatInv.TransformPoint(hit.pt); - vOS_HitPos -= vOS_HitDir * RENDER_MESH_TEST_DISTANCE * fWorldScaleInv; - - IRenderMesh* pRM = pEntObject->GetRenderMesh(); - - AABB aabbRNode; - pRM->GetBBox(aabbRNode.min, aabbRNode.max); - Vec3 vOut(0, 0, 0); - if (!Intersect::Ray_AABB(Ray(vOS_HitPos, vOS_HitDir), aabbRNode, vOut)) - { - return false; - } - - if (!pRM || !pRM->GetVerticesCount()) - { - return false; - } - - if (RayRenderMeshIntersection(pRM, vOS_HitPos, vOS_HitDir, outPos, outNormal)) - { - outNormal = objRot.TransformVector(outNormal).GetNormalized(); - outPos = objMat.TransformPoint(outPos); - return true; - } - return false; -} - ////////////////////////////////////////////////////////////////////////// bool EditorViewportWidget::RayRenderMeshIntersection(IRenderMesh* pRenderMesh, const Vec3& vInPos, const Vec3& vInDir, Vec3& vOutPos, Vec3& vOutNormal) const { @@ -2378,8 +1831,8 @@ void EditorViewportWidget::UnProjectFromScreen(float sx, float sy, float sz, flo void EditorViewportWidget::ProjectToScreen(float ptx, float pty, float ptz, float* sx, float* sy, float* sz) const { AzFramework::ScreenPoint screenPosition = m_renderViewport->ViewportWorldToScreen(AZ::Vector3{ptx, pty, ptz}); - *sx = screenPosition.m_x; - *sy = screenPosition.m_y; + *sx = static_cast(screenPosition.m_x); + *sy = static_cast(screenPosition.m_y); *sz = 0.f; } @@ -2390,7 +1843,7 @@ void EditorViewportWidget::ViewToWorldRay(const QPoint& vp, Vec3& raySrc, Vec3& Vec3 pos0, pos1; float wx, wy, wz; - UnProjectFromScreen(vp.x(), rc.bottom() - vp.y(), 0, &wx, &wy, &wz); + UnProjectFromScreen(static_cast(vp.x()), static_cast(rc.bottom() - vp.y()), 0.0f, &wx, &wy, &wz); if (!_finite(wx) || !_finite(wy) || !_finite(wz)) { return; @@ -2400,7 +1853,7 @@ void EditorViewportWidget::ViewToWorldRay(const QPoint& vp, Vec3& raySrc, Vec3& return; } pos0(wx, wy, wz); - UnProjectFromScreen(vp.x(), rc.bottom() - vp.y(), 1, &wx, &wy, &wz); + UnProjectFromScreen(static_cast(vp.x()), static_cast(rc.bottom() - vp.y()), 1.0f, &wx, &wy, &wz); if (!_finite(wx) || !_finite(wy) || !_finite(wz)) { return; @@ -2419,14 +1872,10 @@ void EditorViewportWidget::ViewToWorldRay(const QPoint& vp, Vec3& raySrc, Vec3& } ////////////////////////////////////////////////////////////////////////// -float EditorViewportWidget::GetScreenScaleFactor(const Vec3& worldPoint) const +float EditorViewportWidget::GetScreenScaleFactor([[maybe_unused]] const Vec3& worldPoint) const { - float dist = m_Camera.GetPosition().GetDistance(worldPoint); - if (dist < m_Camera.GetNearPlane()) - { - dist = m_Camera.GetNearPlane(); - } - return dist; + AZ_Error("CryLegacy", false, "EditorViewportWidget::GetScreenScaleFactor not implemented"); + return 1.f; } ////////////////////////////////////////////////////////////////////////// float EditorViewportWidget::GetScreenScaleFactor(const CCamera& camera, const Vec3& object_position) @@ -2436,12 +1885,6 @@ float EditorViewportWidget::GetScreenScaleFactor(const CCamera& camera, const Ve return dist; } -////////////////////////////////////////////////////////////////////////// -void EditorViewportWidget::OnDestroy() -{ - DestroyRenderContext(); -} - ////////////////////////////////////////////////////////////////////////// bool EditorViewportWidget::CheckRespondToInput() const { @@ -2461,16 +1904,16 @@ bool EditorViewportWidget::CheckRespondToInput() const ////////////////////////////////////////////////////////////////////////// bool EditorViewportWidget::HitTest(const QPoint& point, HitContext& hitInfo) { - hitInfo.camera = &m_Camera; + hitInfo.camera = nullptr; hitInfo.pExcludedObject = GetCameraObject(); return QtViewport::HitTest(point, hitInfo); } ////////////////////////////////////////////////////////////////////////// -bool EditorViewportWidget::IsBoundsVisible(const AABB& box) const +bool EditorViewportWidget::IsBoundsVisible(const AABB&) const { - // If at least part of bbox is visible then its visible. - return m_Camera.IsAABBVisible_F(AABB(box.min, box.max)); + AZ_Assert(false, "Not supported"); + return false; } ////////////////////////////////////////////////////////////////////////// @@ -2515,11 +1958,10 @@ void EditorViewportWidget::CenterOnAABB(const AABB& aabb) Matrix34 newTM = Matrix34(rotationMatrix, newPosition); // Set new orbit distance - m_orbitDistance = distanceToTarget; - m_orbitDistance = fabs(m_orbitDistance); + float orbitDistance = distanceToTarget; + orbitDistance = fabs(orbitDistance); SetViewTM(newTM); - SandboxEditor::OrbitCameraControlsBus::Event(GetViewportId(), &SandboxEditor::OrbitCameraControlsBus::Events::SetOrbitDistance, m_orbitDistance); } void EditorViewportWidget::CenterOnSliceInstance() @@ -2569,130 +2011,121 @@ void EditorViewportWidget::SetFOV(float fov) { if (m_viewEntityId.IsValid()) { - Camera::CameraRequestBus::Event(m_viewEntityId, &Camera::CameraComponentRequests::SetFov, AZ::RadToDeg(fov)); + Camera::CameraRequestBus::Event(m_viewEntityId, &Camera::CameraComponentRequests::SetFovRadians, fov); } else { - m_camFOV = fov; - // Set the active camera's FOV - { - AZ::Matrix4x4 clipMatrix; - AZ::MakePerspectiveFovMatrixRH( - clipMatrix, - GetFOV(), - aznumeric_cast(width()) / aznumeric_cast(height()), - m_Camera.GetNearPlane(), - m_Camera.GetFarPlane(), - true - ); - m_renderViewport->GetViewportContext()->SetCameraProjectionMatrix(clipMatrix); - } - } - - if (m_viewPane) - { - m_viewPane->OnFOVChanged(fov); + auto m = m_defaultView->GetViewToClipMatrix(); + AZ::SetPerspectiveMatrixFOV(m, fov, aznumeric_cast(width()) / aznumeric_cast(height())); + m_defaultView->SetViewToClipMatrix(m); } } ////////////////////////////////////////////////////////////////////////// float EditorViewportWidget::GetFOV() const { - if (m_viewSourceType == ViewSourceType::SequenceCamera) - { - CBaseObject* cameraObject = GetCameraObject(); - - AZ::EntityId cameraEntityId; - AzToolsFramework::ComponentEntityObjectRequestBus::EventResult(cameraEntityId, cameraObject, &AzToolsFramework::ComponentEntityObjectRequestBus::Events::GetAssociatedEntityId); - if (cameraEntityId.IsValid()) - { - // component Camera - float fov = DEFAULT_FOV; - Camera::CameraRequestBus::EventResult(fov, cameraEntityId, &Camera::CameraComponentRequests::GetFov); - return AZ::DegToRad(fov); - } - } - if (m_viewEntityId.IsValid()) { - float fov = AZ::RadToDeg(m_camFOV); - Camera::CameraRequestBus::EventResult(fov, m_viewEntityId, &Camera::CameraComponentRequests::GetFov); - return AZ::DegToRad(fov); + float fov = 0.f; + Camera::CameraRequestBus::EventResult(fov, m_viewEntityId, &Camera::CameraComponentRequests::GetFovRadians); + return fov; + } + else + { + return AZ::GetPerspectiveMatrixFOV(m_defaultView->GetViewToClipMatrix()); + } +} + +void EditorViewportWidget::OnActiveViewChanged(const AZ::EntityId& viewEntityId) +{ + // Avoid re-entry + if (m_sendingOnActiveChanged) + { + return; } - return m_camFOV; -} + // Ignore any changes in simulation mode + if (m_playInEditorState != PlayInEditorState::Editor) + { + return; + } -////////////////////////////////////////////////////////////////////////// -bool EditorViewportWidget::CreateRenderContext() -{ - return true; -} + // if they've picked the same camera, then that means they want to toggle + if (viewEntityId.IsValid()) + { + // Any such events for game entities should be filtered out by the check above + AZ_Error( + "EditorViewportWidget", + Camera::EditorCameraViewRequestBus::FindFirstHandler(viewEntityId) != nullptr, + "Internal logic error - active view changed to an entity which is not an editor camera. " + "Please report this as a bug." + ); -////////////////////////////////////////////////////////////////////////// -void EditorViewportWidget::DestroyRenderContext() -{ + m_viewEntityId = viewEntityId; + m_viewSourceType = ViewSourceType::CameraComponent; + AZStd::string entityName; + AZ::ComponentApplicationBus::BroadcastResult(entityName, &AZ::ComponentApplicationRequests::GetEntityName, viewEntityId); + SetName(QString("Camera entity: %1").arg(entityName.c_str())); + + PostCameraSet(); + } + else + { + SetDefaultCamera(); + } } ////////////////////////////////////////////////////////////////////////// void EditorViewportWidget::SetDefaultCamera() { - if (IsDefaultCamera()) - { - return; - } - ResetToViewSourceType(ViewSourceType::None); - GetViewManager()->SetCameraObjectId(m_cameraObjectId); + m_viewEntityId.SetInvalid(); + m_viewSourceType = ViewSourceType::None; + GetViewManager()->SetCameraObjectId(GUID_NULL); SetName(m_defaultViewName); SetViewTM(m_defaultViewTM); + + // Synchronize the configured editor viewport FOV to the default camera + if (m_viewPane) + { + const float fov = gSettings.viewports.fDefaultFov; + m_viewPane->OnFOVChanged(fov); + SetFOV(fov); + } + + // Push the default view as the active view + auto atomViewportRequests = AZ::Interface::Get(); + if (atomViewportRequests) + { + const AZ::Name contextName = atomViewportRequests->GetDefaultViewportContextName(); + atomViewportRequests->PushView(contextName, m_defaultView); + } + PostCameraSet(); } ////////////////////////////////////////////////////////////////////////// -bool EditorViewportWidget::IsDefaultCamera() const +AZ::RPI::ViewPtr EditorViewportWidget::GetCurrentAtomView() const { - return m_viewSourceType == ViewSourceType::None; -} - -////////////////////////////////////////////////////////////////////////// -void EditorViewportWidget::SetSequenceCamera() -{ - if (m_viewSourceType == ViewSourceType::SequenceCamera) + if (m_renderViewport && m_renderViewport->GetViewportContext()) { - // Reset if we were checked before - SetDefaultCamera(); + return m_renderViewport->GetViewportContext()->GetDefaultView(); } else { - ResetToViewSourceType(ViewSourceType::SequenceCamera); - - SetName(tr("Sequence Camera")); - SetViewTM(GetViewTM()); - - GetViewManager()->SetCameraObjectId(m_cameraObjectId); - PostCameraSet(); - - // ForceAnimation() so Track View will set the Camera params - // if a camera is animated in the sequences. - if (GetIEditor() && GetIEditor()->GetAnimation()) - { - GetIEditor()->GetAnimation()->ForceAnimation(); - } + return nullptr; } } ////////////////////////////////////////////////////////////////////////// void EditorViewportWidget::SetComponentCamera(const AZ::EntityId& entityId) { - ResetToViewSourceType(ViewSourceType::CameraComponent); - SetViewEntity(entityId); + SetViewFromEntityPerspective(entityId); } ////////////////////////////////////////////////////////////////////////// void EditorViewportWidget::SetEntityAsCamera(const AZ::EntityId& entityId, bool lockCameraMovement) { - ResetToViewSourceType(ViewSourceType::AZ_Entity); - SetViewEntity(entityId, lockCameraMovement); + SetViewAndMovementLockFromEntityPerspective(entityId, lockCameraMovement); } void EditorViewportWidget::SetFirstComponentCamera() @@ -2740,7 +2173,7 @@ bool EditorViewportWidget::IsSelectedCamera() const AzToolsFramework::ToolsApplicationRequests::Bus::BroadcastResult( selectedEntityList, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntities); - if ((m_viewSourceType == ViewSourceType::CameraComponent || m_viewSourceType == ViewSourceType::AZ_Entity) + if ((m_viewSourceType == ViewSourceType::CameraComponent) && !selectedEntityList.empty() && AZStd::find(selectedEntityList.begin(), selectedEntityList.end(), m_viewEntityId) != selectedEntityList.end()) { @@ -2762,17 +2195,6 @@ void EditorViewportWidget::CycleCamera() SetFirstComponentCamera(); break; } - case EditorViewportWidget::ViewSourceType::SequenceCamera: - { - AZ_Error("EditorViewportWidget", false, "Legacy cameras no longer exist, unable to set sequence camera."); - break; - } - case EditorViewportWidget::ViewSourceType::LegacyCamera: - { - AZ_Warning("EditorViewportWidget", false, "Legacy cameras no longer exist, using first found component camera instead."); - SetFirstComponentCamera(); - break; - } case EditorViewportWidget::ViewSourceType::CameraComponent: { AZ::EBusAggregateResults results; @@ -2791,12 +2213,6 @@ void EditorViewportWidget::CycleCamera() SetDefaultCamera(); break; } - case EditorViewportWidget::ViewSourceType::AZ_Entity: - { - // we may decide to have this iterate over just selected entities - SetDefaultCamera(); - break; - } default: { SetDefaultCamera(); @@ -2810,11 +2226,28 @@ void EditorViewportWidget::SetViewFromEntityPerspective(const AZ::EntityId& enti SetViewAndMovementLockFromEntityPerspective(entityId, false); } -void EditorViewportWidget::SetViewAndMovementLockFromEntityPerspective(const AZ::EntityId& entityId, bool lockCameraMovement) +void EditorViewportWidget::SetViewAndMovementLockFromEntityPerspective(const AZ::EntityId& entityId, [[maybe_unused]] bool lockCameraMovement) { - if (!m_ignoreSetViewFromEntityPerspective) + // This is an editor event, so is only serviced during edit mode, not play game mode + // + if (m_playInEditorState != PlayInEditorState::Editor) { - SetEntityAsCamera(entityId, lockCameraMovement); + AZ_Warning("EditorViewportWidget", false, + "Tried to change the editor camera during play game in editor; this is currently unsupported" + ); + return; + } + + AZ_Assert(lockCameraMovement == false, "SetViewAndMovementLockFromEntityPerspective with lockCameraMovement == true not supported"); + + if (entityId.IsValid()) + { + Camera::CameraRequestBus::Event(entityId, &Camera::CameraRequestBus::Events::MakeActiveView); + } + else + { + // The default camera + SetDefaultCamera(); } } @@ -2829,7 +2262,7 @@ bool EditorViewportWidget::GetActiveCameraPosition(AZ::Vector3& cameraPos) else { // Use viewTM, which is synced with the camera and guaranteed to be up-to-date - cameraPos = LYVec3ToAZVec3(m_viewTM.GetTranslation()); + cameraPos = LYVec3ToAZVec3(GetViewTM().GetTranslation()); } return true; @@ -2843,17 +2276,26 @@ bool EditorViewportWidget::GetActiveCameraState(AzFramework::CameraState& camera if (m_pPrimaryViewport == this) { cameraState = GetCameraState(); - return true; } return false; } +void EditorViewportWidget::OnStartPlayInEditorBegin() +{ + m_playInEditorState = PlayInEditorState::Starting; +} + void EditorViewportWidget::OnStartPlayInEditor() { + m_playInEditorState = PlayInEditorState::Started; + if (m_viewEntityId.IsValid()) { + // Note that this is assuming that the Atom camera components will share the same view ptr + // in editor as in game mode + m_viewEntityIdCachedForEditMode = m_viewEntityId; AZ::EntityId runtimeEntityId; AzToolsFramework::EditorEntityContextRequestBus::Broadcast( @@ -2866,20 +2308,14 @@ void EditorViewportWidget::OnStartPlayInEditor() void EditorViewportWidget::OnStopPlayInEditor() { - if (m_viewEntityIdCachedForEditMode.IsValid()) - { - m_viewEntityId = m_viewEntityIdCachedForEditMode; - m_viewEntityIdCachedForEditMode.SetInvalid(); - } -} + m_playInEditorState = PlayInEditorState::Editor; -////////////////////////////////////////////////////////////////////////// -void EditorViewportWidget::OnCameraFOVVariableChanged([[maybe_unused]] IVariable* var) -{ - if (m_viewPane) - { - m_viewPane->OnFOVChanged(GetFOV()); - } + // Note that: + // - this is assuming that the Atom camera components will share the same view ptr in editor as in game mode. + // - if `m_viewEntityIdCachedForEditMode' is invalid, the camera before game mode was the default editor camera + // - we MUST set the camera again when exiting game mode, because when rendering with trackview, the editor camera gets set somehow + SetViewFromEntityPerspective(m_viewEntityIdCachedForEditMode); + m_viewEntityIdCachedForEditMode.SetInvalid(); } ////////////////////////////////////////////////////////////////////////// @@ -2912,15 +2348,9 @@ void EditorViewportWidget::ShowCursor() m_bCursorHidden = false; } -bool EditorViewportWidget::IsKeyDown(Qt::Key key) const -{ - return m_keyDown.contains(key); -} - ////////////////////////////////////////////////////////////////////////// void EditorViewportWidget::PushDisableRendering() { - assert(m_disableRenderingCount >= 0); ++m_disableRenderingCount; } @@ -2954,6 +2384,17 @@ QSize EditorViewportWidget::WidgetToViewport(const QSize& size) const return size * WidgetToViewportFactor(); } +////////////////////////////////////////////////////////////////////////// +double EditorViewportWidget::WidgetToViewportFactor() const +{ +#if defined(AZ_PLATFORM_WINDOWS) + // Needed for high DPI mode on windows + return devicePixelRatioF(); +#else + return 1.0; +#endif +} + ////////////////////////////////////////////////////////////////////////// void EditorViewportWidget::BeginUndoTransaction() { @@ -2967,12 +2408,6 @@ void EditorViewportWidget::EndUndoTransaction() Update(); } -void EditorViewportWidget::UpdateCurrentMousePos(const QPoint& newPosition) -{ - m_prevMousePos = m_mousePos; - m_mousePos = newPosition; -} - void* EditorViewportWidget::GetSystemCursorConstraintWindow() const { AzFramework::SystemCursorState systemCursorState = AzFramework::SystemCursorState::Unknown; @@ -3001,8 +2436,7 @@ void EditorViewportWidget::RestoreViewportAfterGameMode() QString( tr("When leaving \" Game Mode \" the engine will automatically restore your camera position to the default position before you " "had entered Game mode.

If you dislike this setting you can always change this anytime in the global " - "preferences.

")) - .arg(EditorPreferencesGeneralRestoreViewportCameraSettingName); + "preferences.

")); QString restoreOnExitGameModePopupDisabledRegKey("Editor/AutoHide/ViewportCameraRestoreOnExitGameMode"); // Read the popup disabled registry value @@ -3048,7 +2482,8 @@ void EditorViewportWidget::RestoreViewportAfterGameMode() } else { - SetViewTM(m_gameTM); + AZ_Error("CryLegacy", false, "Not restoring the editor viewport camera is currently unsupported"); + SetViewTM(preGameModeViewTM); } } @@ -3067,12 +2502,6 @@ void EditorViewportWidget::UpdateScene() } } -void EditorViewportWidget::UpdateCameraFromViewportContext() -{ - // Queue a sync for the next tick, to ensure the latest version of the viewport context transform is used - m_updateCameraPositionNextTick = true; -} - void EditorViewportWidget::SetAsActiveViewport() { auto viewportContextManager = AZ::Interface::Get(); diff --git a/Code/Editor/EditorViewportWidget.h b/Code/Editor/EditorViewportWidget.h index b682de1cc3..9da5e3f9a1 100644 --- a/Code/Editor/EditorViewportWidget.h +++ b/Code/Editor/EditorViewportWidget.h @@ -8,8 +8,6 @@ #pragma once -// RenderViewport.h : header file -// #if !defined(Q_MOC_RUN) #include @@ -21,6 +19,7 @@ #include "Undo/Undo.h" #include "Util/PredefinedAspectRatios.h" #include "EditorViewportSettings.h" +#include "EditorModularViewportCameraComposer.h" #include #include @@ -34,6 +33,7 @@ #include #include #include +#include #endif #include @@ -55,7 +55,8 @@ namespace AZ::ViewportHelpers namespace AtomToolsFramework { class RenderViewportWidget; -} + class ModularViewportCameraController; +} // namespace AtomToolsFramework namespace AzToolsFramework { @@ -65,130 +66,120 @@ namespace AzToolsFramework // EditorViewportWidget window AZ_PUSH_DISABLE_DLL_EXPORT_BASECLASS_WARNING AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING -class SANDBOX_API EditorViewportWidget +class SANDBOX_API EditorViewportWidget final : public QtViewport - , public IEditorNotifyListener - , public IUndoManagerListener - , public Camera::EditorCameraRequestBus::Handler - , public AzFramework::InputSystemCursorConstraintRequestBus::Handler - , public AzToolsFramework::ViewportInteraction::ViewportFreezeRequestBus::Handler - , public AzToolsFramework::ViewportInteraction::MainEditorViewportInteractionRequestBus::Handler - , public AzFramework::AssetCatalogEventBus::Handler - , public AZ::RPI::SceneNotificationBus::Handler + , private IEditorNotifyListener + , private IUndoManagerListener + , private Camera::EditorCameraRequestBus::Handler + , private Camera::CameraNotificationBus::Handler + , private AzFramework::InputSystemCursorConstraintRequestBus::Handler + , private AzToolsFramework::ViewportInteraction::ViewportFreezeRequestBus::Handler + , private AzToolsFramework::ViewportInteraction::MainEditorViewportInteractionRequestBus::Handler + , private AzFramework::AssetCatalogEventBus::Handler + , private AZ::RPI::SceneNotificationBus::Handler { AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING AZ_POP_DISABLE_DLL_EXPORT_BASECLASS_WARNING Q_OBJECT -public: - struct SResolution - { - SResolution() - : width(0) - , height(0) - { - } - - SResolution(int w, int h) - : width(w) - , height(h) - { - } - - int width; - int height; - }; public: EditorViewportWidget(const QString& name, QWidget* parent = nullptr); + ~EditorViewportWidget() override; static const GUID& GetClassID() { return QtViewport::GetClassID(); } - /** Get type of this viewport. - */ - virtual EViewportType GetType() const { return ET_ViewportCamera; } - virtual void SetType([[maybe_unused]] EViewportType type) { assert(type == ET_ViewportCamera); }; + static EditorViewportWidget* GetPrimaryViewport(); - virtual ~EditorViewportWidget(); + // Used by ViewPan in some circumstances + void ConnectViewportInteractionRequestBus(); + void DisconnectViewportInteractionRequestBus(); - Q_INVOKABLE void InjectFakeMouseMove(int deltaX, int deltaY, Qt::MouseButtons buttons); + // QtViewport/IDisplayViewport/CViewport + // These methods are made public in the derived class because they are called with an object whose static type is known to be this class type. + void SetFOV(float fov) override; + float GetFOV() const override; - // Replacement for still used CRenderer methods - 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; +private: + //////////////////////////////////////////////////////////////////////// + // Private types ... -public: - virtual void Update(); - - virtual void ResetContent(); - virtual void UpdateContent(int flags); - - void OnTitleMenu(QMenu* menu) override; - - void SetCamera(const CCamera& camera); - const CCamera& GetCamera() const { return m_Camera; }; - virtual void SetViewTM(const Matrix34& tm) + enum class ViewSourceType { - if (m_viewSourceType == ViewSourceType::None) - { - m_defaultViewTM = tm; - } - SetViewTM(tm, false); - } + None, + CameraComponent, + ViewSourceTypesCount, + }; + enum class PlayInEditorState + { + Editor, Starting, Started + }; + enum class KeyPressedState + { + AllUp, + PressedThisFrame, + PressedInPreviousFrame, + }; - //! Map world space position to viewport position. - virtual QPoint WorldToView(const Vec3& wp) const; - virtual QPoint WorldToViewParticleEditor(const Vec3& wp, int width, int height) const; - virtual Vec3 WorldToView3D(const Vec3& wp, int nFlags = 0) const; - - //! Map viewport position to world space position. - virtual Vec3 ViewToWorld(const QPoint& vp, bool* collideWithTerrain = nullptr, bool onlyTerrain = false, bool bSkipVegetation = false, bool bTestRenderMesh = false, bool* collideWithObject = nullptr) const override; - virtual void ViewToWorldRay(const QPoint& vp, Vec3& raySrc, Vec3& rayDir) const override; - virtual Vec3 ViewToWorldNormal(const QPoint& vp, bool onlyTerrain, bool bTestRenderMesh = false) override; - virtual float GetScreenScaleFactor(const Vec3& worldPoint) const; - virtual float GetScreenScaleFactor(const CCamera& camera, const Vec3& object_position); - virtual float GetAspectRatio() const; - virtual bool HitTest(const QPoint& point, HitContext& hitInfo); - virtual bool IsBoundsVisible(const AABB& box) const; - virtual void CenterOnSelection(); - virtual void CenterOnAABB(const AABB& aabb); - void CenterOnSliceInstance() override; + //////////////////////////////////////////////////////////////////////// + // Method overrides ... + // QWidget void focusOutEvent(QFocusEvent* event) override; void keyPressEvent(QKeyEvent* event) override; + bool event(QEvent* event) override; + void resizeEvent(QResizeEvent* event) override; + void paintEvent(QPaintEvent* event) override; + void mousePressEvent(QMouseEvent* event) override; - void SetFOV(float fov); - float GetFOV() const; + // QtViewport/IDisplayViewport/CViewport + EViewportType GetType() const override { return ET_ViewportCamera; } + void SetType([[maybe_unused]] EViewportType type) override { assert(type == ET_ViewportCamera); }; + AzToolsFramework::ViewportInteraction::MouseInteraction BuildMouseInteraction( + 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; + Vec3 ViewToWorldNormal(const QPoint& vp, bool onlyTerrain, bool bTestRenderMesh = false) override; + float GetScreenScaleFactor(const Vec3& worldPoint) const override; + float GetScreenScaleFactor(const CCamera& camera, const Vec3& object_position) override; + float GetAspectRatio() const override; + bool HitTest(const QPoint& point, HitContext& hitInfo) override; + bool IsBoundsVisible(const AABB& box) const override; + void CenterOnSelection() override; + void CenterOnAABB(const AABB& aabb) override; + void CenterOnSliceInstance() override; + void OnTitleMenu(QMenu* menu) override; + void SetViewTM(const Matrix34& tm) override; + const Matrix34& GetViewTM() const override; + void Update() override; + void UpdateContent(int flags) override; - void SetDefaultCamera(); - bool IsDefaultCamera() const; - void SetSequenceCamera(); - bool IsSequenceCamera() const { return m_viewSourceType == ViewSourceType::SequenceCamera; } - void SetSelectedCamera(); - bool IsSelectedCamera() const; - void SetComponentCamera(const AZ::EntityId& entityId); - void SetEntityAsCamera(const AZ::EntityId& entityId, bool lockCameraMovement = false); - void SetFirstComponentCamera(); - void SetViewEntity(const AZ::EntityId& cameraEntityId, bool lockCameraMovement = false); - void PostCameraSet(); - // This switches the active camera to the next one in the list of (default, all custom cams). - void CycleCamera(); + // SceneNotificationBus + void OnBeginPrepareRender() override; - // Camera::EditorCameraRequestBus - void SetViewFromEntityPerspective(const AZ::EntityId& entityId) override; - void SetViewAndMovementLockFromEntityPerspective(const AZ::EntityId& entityId, bool lockCameraMovement) override; - AZ::EntityId GetCurrentViewEntityId() override { return m_viewEntityId; } - bool GetActiveCameraPosition(AZ::Vector3& cameraPos) override; - bool GetActiveCameraState(AzFramework::CameraState& cameraState) override; + // Camera::CameraNotificationBus + void OnActiveViewChanged(const AZ::EntityId&) override; + + // IEditorEventListener + void OnEditorNotifyEvent(EEditorNotifyEvent event) override; // AzToolsFramework::EditorEntityContextNotificationBus (handler moved to cpp to resolve link issues in unity builds) - virtual void OnStartPlayInEditor(); - virtual void OnStopPlayInEditor(); + void OnStartPlayInEditor(); + void OnStopPlayInEditor(); + void OnStartPlayInEditorBegin(); - AzFramework::CameraState GetCameraState(); - AzFramework::ScreenPoint ViewportWorldToScreen(const AZ::Vector3& worldPosition); + // IUndoManagerListener + void BeginUndoTransaction() override; + void EndUndoTransaction() override; + + // AzFramework::InputSystemCursorConstraintRequestBus + void* GetSystemCursorConstraintWindow() const override; // AzToolsFramework::ViewportFreezeRequestBus bool IsViewportInputFrozen() override; @@ -204,142 +195,19 @@ public: void BeginWidgetContext() override; void EndWidgetContext() override; - // CViewport... - void SetViewportId(int id) override; - - void ConnectViewportInteractionRequestBus(); - void DisconnectViewportInteractionRequestBus(); - - void LockCameraMovement(bool bLock) { m_bLockCameraMovement = bLock; } - bool IsCameraMovementLocked() const { return m_bLockCameraMovement; } - - void EnableCameraObjectMove(bool bMove) { m_bMoveCameraObject = bMove; } - bool IsCameraObjectMove() const { return m_bMoveCameraObject; } - - void SetPlayerControl(uint32 i) { m_PlayerControl = i; }; - uint32 GetPlayerControl() { return m_PlayerControl; }; - - const DisplayContext& GetDisplayContext() const { return m_displayContext; } - CBaseObject* GetCameraObject() const; - - QPoint WidgetToViewport(const QPoint& point) const; - QPoint ViewportToWidget(const QPoint& point) const; - QSize WidgetToViewport(const QSize& size) const; - - AzToolsFramework::ViewportInteraction::MouseInteraction BuildMouseInteraction( - Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, const QPoint& point) override; - - void SetPlayerPos() - { - Matrix34 m = GetViewTM(); - m.SetTranslation(m.GetTranslation() - m_PhysicalLocation.t); - SetViewTM(m); - - m_AverageFrameTime = 0.14f; - - m_PhysicalLocation.SetIdentity(); - - m_LocalEntityMat.SetIdentity(); - m_PrevLocalEntityMat.SetIdentity(); - - m_absCameraHigh = 2.0f; - m_absCameraPos = Vec3(0, 3, 2); - m_absCameraPosVP = Vec3(0, -3, 1.5); - - m_absCurrentSlope = 0.0f; - - m_absLookDirectionXY = Vec2(0, 1); - - m_LookAt = Vec3(ZERO); - m_LookAtRate = Vec3(ZERO); - m_vCamPos = Vec3(ZERO); - m_vCamPosRate = Vec3(ZERO); - - m_relCameraRotX = 0; - m_relCameraRotZ = 0; - - uint32 numSample6 = static_cast(m_arrAnimatedCharacterPath.size()); - for (uint32 i = 0; i < numSample6; i++) - { - m_arrAnimatedCharacterPath[i] = Vec3(ZERO); - } - - numSample6 = static_cast(m_arrSmoothEntityPath.size()); - for (uint32 i = 0; i < numSample6; i++) - { - m_arrSmoothEntityPath[i] = Vec3(ZERO); - } - - uint32 numSample7 = static_cast(m_arrRunStrafeSmoothing.size()); - for (uint32 i = 0; i < numSample7; i++) - { - m_arrRunStrafeSmoothing[i] = 0; - } - - m_vWorldDesiredBodyDirection = Vec2(0, 1); - m_vWorldDesiredBodyDirectionSmooth = Vec2(0, 1); - m_vWorldDesiredBodyDirectionSmoothRate = Vec2(0, 1); - - m_vWorldDesiredBodyDirection2 = Vec2(0, 1); - - m_vWorldDesiredMoveDirection = Vec2(0, 1); - m_vWorldDesiredMoveDirectionSmooth = Vec2(0, 1); - m_vWorldDesiredMoveDirectionSmoothRate = Vec2(0, 1); - m_vLocalDesiredMoveDirection = Vec2(0, 1); - m_vLocalDesiredMoveDirectionSmooth = Vec2(0, 1); - m_vLocalDesiredMoveDirectionSmoothRate = Vec2(0, 1); - - m_vWorldAimBodyDirection = Vec2(0, 1); - - m_MoveSpeedMSec = 5.0f; - m_key_W = 0; - m_keyrcr_W = 0; - m_key_S = 0; - m_keyrcr_S = 0; - m_key_A = 0; - m_keyrcr_A = 0; - m_key_D = 0; - m_keyrcr_D = 0; - m_key_SPACE = 0; - m_keyrcr_SPACE = 0; - m_ControllMode = 0; - - m_State = -1; - m_Stance = 1; //combat - - m_udGround = 0.0f; - m_lrGround = 0.0f; - AABB aabb = AABB(Vec3(-40.0f, -40.0f, -0.25f), Vec3(+40.0f, +40.0f, +0.0f)); - m_GroundOBB = OBB::CreateOBBfromAABB(Matrix33(IDENTITY), aabb); - m_GroundOBBPos = Vec3(0, 0, -0.01f); - }; - - static EditorViewportWidget* GetPrimaryViewport(); - - AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING - CCamera m_Camera; - AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING - -protected: - struct SScopedCurrentContext; + // Camera::EditorCameraRequestBus + void SetViewFromEntityPerspective(const AZ::EntityId& entityId) override; + void SetViewAndMovementLockFromEntityPerspective(const AZ::EntityId& entityId, bool lockCameraMovement) override; + AZ::EntityId GetCurrentViewEntityId() override; + bool GetActiveCameraPosition(AZ::Vector3& cameraPos) override; + bool GetActiveCameraState(AzFramework::CameraState& cameraState) override; + //////////////////////////////////////////////////////////////////////// + // Private helpers... void SetViewTM(const Matrix34& tm, bool bMoveOnly); - - // Called to render stuff. - virtual void OnRender(); - - virtual void OnEditorNotifyEvent(EEditorNotifyEvent event); - - //! Get currently active camera object. - void ToggleCameraObject(); - - void RenderConstructionPlane(); void RenderSnapMarker(); - void RenderAll(); - void OnBeginPrepareRender() override; - // Update the safe frame, safe action, safe title, and borders rectangles based on // viewport size and target aspect ratio. void UpdateSafeFrame(); @@ -353,193 +221,40 @@ protected: // Draw a selected region if it has been selected void RenderSelectedRegion(); - virtual bool CreateRenderContext(); - virtual void DestroyRenderContext(); - - void OnMenuCommandChangeAspectRatio(unsigned int commandId); - - bool AdjustObjectPosition(const ray_hit& hit, Vec3& outNormal, Vec3& outPos) const; bool RayRenderMeshIntersection(IRenderMesh* pRenderMesh, const Vec3& vInPos, const Vec3& vInDir, Vec3& vOutPos, Vec3& vOutNormal) const; bool AddCameraMenuItems(QMenu* menu); void ResizeView(int width, int height); - void OnCameraFOVVariableChanged(IVariable* var); - void HideCursor(); void ShowCursor(); - bool IsKeyDown(Qt::Key key) const; - - enum class ViewSourceType - { - None, - SequenceCamera, - LegacyCamera, - CameraComponent, - AZ_Entity, - ViewSourceTypesCount, - }; - void ResetToViewSourceType(const ViewSourceType& viewSourType); + double WidgetToViewportFactor() const; bool ShouldPreviewFullscreen() const; void StartFullscreenPreview(); void StopFullscreenPreview(); - bool m_inFullscreenPreview = false; - bool m_bRenderContextCreated = false; - bool m_bInRotateMode = false; - bool m_bInMoveMode = false; - bool m_bInOrbitMode = false; - bool m_bInZoomMode = false; - - QPoint m_mousePos = QPoint(0, 0); - QPoint m_prevMousePos = QPoint(0, 0); // for tablets, you can't use SetCursorPos and need to remember the prior point and delta with that. - - - float m_moveSpeed = 1; - - float m_orbitDistance = 10.0f; - AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING - Vec3 m_orbitTarget; - - //------------------------------------------- - //--- player-control in CharEdit --- - //------------------------------------------- - f32 m_MoveSpeedMSec; - - uint32 m_key_W, m_keyrcr_W; - uint32 m_key_S, m_keyrcr_S; - uint32 m_key_A, m_keyrcr_A; - uint32 m_key_D, m_keyrcr_D; - - uint32 m_key_SPACE, m_keyrcr_SPACE; - uint32 m_ControllMode; - - int32 m_Stance; - int32 m_State; - f32 m_AverageFrameTime; - - uint32 m_PlayerControl = 0; - - f32 m_absCameraHigh; - Vec3 m_absCameraPos; - Vec3 m_absCameraPosVP; - - f32 m_absCurrentSlope; //in radiants - - Vec2 m_absLookDirectionXY; - - Vec3 m_LookAt; - Vec3 m_LookAtRate; - Vec3 m_vCamPos; - Vec3 m_vCamPosRate; - float m_camFOV; - - f32 m_relCameraRotX; - f32 m_relCameraRotZ; - - QuatTS m_PhysicalLocation; - - Matrix34 m_AnimatedCharacterMat; - - Matrix34 m_LocalEntityMat; //this is used for data-driven animations where the character is running on the spot - Matrix34 m_PrevLocalEntityMat; - - std::vector m_arrVerticesHF; - std::vector m_arrIndicesHF; - - std::vector m_arrAnimatedCharacterPath; - std::vector m_arrSmoothEntityPath; - std::vector m_arrRunStrafeSmoothing; - - Vec2 m_vWorldDesiredBodyDirection; - Vec2 m_vWorldDesiredBodyDirectionSmooth; - Vec2 m_vWorldDesiredBodyDirectionSmoothRate; - - Vec2 m_vWorldDesiredBodyDirection2; - - - Vec2 m_vWorldDesiredMoveDirection; - Vec2 m_vWorldDesiredMoveDirectionSmooth; - Vec2 m_vWorldDesiredMoveDirectionSmoothRate; - Vec2 m_vLocalDesiredMoveDirection; - Vec2 m_vLocalDesiredMoveDirectionSmooth; - Vec2 m_vLocalDesiredMoveDirectionSmoothRate; - Vec2 m_vWorldAimBodyDirection; - - f32 m_udGround; - f32 m_lrGround; - OBB m_GroundOBB; - Vec3 m_GroundOBBPos; - - // Index of camera objects. - mutable GUID m_cameraObjectId; - mutable AZ::EntityId m_viewEntityId; - mutable ViewSourceType m_viewSourceType = ViewSourceType::None; - AZ::EntityId m_viewEntityIdCachedForEditMode; - Matrix34 m_preGameModeViewTM; - uint m_disableRenderingCount = 0; - bool m_bLockCameraMovement; - bool m_bUpdateViewport = false; - bool m_bMoveCameraObject = true; - - enum class KeyPressedState - { - AllUp, - PressedThisFrame, - PressedInPreviousFrame, - }; - KeyPressedState m_pressedKeyState = KeyPressedState::AllUp; - - Matrix34 m_defaultViewTM; - const QString m_defaultViewName; - - DisplayContext m_displayContext; - - - bool m_isOnPaint = false; - static EditorViewportWidget* m_pPrimaryViewport; - - QRect m_safeFrame; - QRect m_safeAction; - QRect m_safeTitle; - - CPredefinedAspectRatios m_predefinedAspectRatios; - - bool m_bCursorHidden = false; - void OnMenuResolutionCustom(); void OnMenuCreateCameraEntityFromCurrentView(); void OnMenuSelectCurrentCamera(); - int OnCreate(); - void resizeEvent(QResizeEvent* event) override; - void paintEvent(QPaintEvent* event) override; - void mousePressEvent(QMouseEvent* event) override; - // From a series of input primitives, compose a complete mouse interaction. AzToolsFramework::ViewportInteraction::MouseInteraction BuildMouseInteractionInternal( AzToolsFramework::ViewportInteraction::MouseButtons buttons, AzToolsFramework::ViewportInteraction::KeyboardModifiers modifiers, const AzToolsFramework::ViewportInteraction::MousePick& mousePick) const; + // Given a point in the viewport, return the pick ray into the scene. // note: The argument passed to parameter **point**, originating // from a Qt event, must first be passed to WidgetToViewport before being // passed to BuildMousePick. AzToolsFramework::ViewportInteraction::MousePick BuildMousePick(const QPoint& point); - bool event(QEvent* event) override; - void OnDestroy(); - bool CheckRespondToInput() const; - // AzFramework::InputSystemCursorConstraintRequestBus - void* GetSystemCursorConstraintWindow() const override; - void BuildDragDropContext(AzQtComponents::ViewportDragContext& context, const QPoint& pt) override; -private: void SetAsActiveViewport(); void PushDisableRendering(); void PopDisableRendering(); @@ -547,48 +262,133 @@ private: AzToolsFramework::ViewportInteraction::MousePick BuildMousePickInternal(const QPoint& point) const; void RestoreViewportAfterGameMode(); - void UpdateCameraFromViewportContext(); - double WidgetToViewportFactor() const - { -#if defined(AZ_PLATFORM_WINDOWS) - // Needed for high DPI mode on windows - return devicePixelRatioF(); -#else - return 1.0f; -#endif - } - - void BeginUndoTransaction() override; - void EndUndoTransaction() override; - - void UpdateCurrentMousePos(const QPoint& newPosition); void UpdateScene(); + void SetDefaultCamera(); + void SetSelectedCamera(); + bool IsSelectedCamera() const; + void SetComponentCamera(const AZ::EntityId& entityId); + void SetEntityAsCamera(const AZ::EntityId& entityId, bool lockCameraMovement = false); + void SetFirstComponentCamera(); + void PostCameraSet(); + // This switches the active camera to the next one in the list of (default, all custom cams). + void CycleCamera(); + + AzFramework::CameraState GetCameraState(); + AzFramework::ScreenPoint ViewportWorldToScreen(const AZ::Vector3& worldPosition); + + QPoint WidgetToViewport(const QPoint& point) const; + QPoint ViewportToWidget(const QPoint& point) const; + QSize WidgetToViewport(const QSize& size) const; + + 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; + + AZ::RPI::ViewPtr GetCurrentAtomView() const; + + //////////////////////////////////////////////////////////////////////// + // Members ... + friend class AZ::ViewportHelpers::EditorEntityNotifications; + + AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING + + // Singleton for the primary viewport + static EditorViewportWidget* m_pPrimaryViewport; + + // The simulation (play-game in editor) state + PlayInEditorState m_playInEditorState = PlayInEditorState::Editor; + + // Whether we are doing a full screen game preview (play-game in editor) or a regular one + bool m_inFullscreenPreview = false; + + // The entity ID of the current camera for this viewport, or invalid if the default editor camera + AZ::EntityId m_viewEntityId; + + // Determines also if the current camera for this viewport is default editor camera + ViewSourceType m_viewSourceType = ViewSourceType::None; + + // During play game in editor, holds the editor entity ID of the last + AZ::EntityId m_viewEntityIdCachedForEditMode; + + // The editor camera TM before switching to game mode + Matrix34 m_preGameModeViewTM; + + // Disables rendering during some periods of time, e.g. undo/redo, resize events + uint m_disableRenderingCount = 0; + + // Determines if the viewport needs updating (false when out of focus for example) + bool m_bUpdateViewport = false; + + // Avoid re-entering PostCameraSet->OnActiveViewChanged->PostCameraSet + bool m_sendingOnActiveChanged = false; + + // Legacy... + KeyPressedState m_pressedKeyState = KeyPressedState::AllUp; + + // The last camera matrix of the default editor camera, used when switching back to editor camera to restore the right TM + Matrix34 m_defaultViewTM; + + // The name to use for the default editor camera + const QString m_defaultViewName; + + // Note that any attempts to draw anything with this object will crash. Exists here for legacy "reasons" + DisplayContext m_displayContext; + + // Re-entrency guard for on paint events + bool m_isOnPaint = false; + + // Shapes of various safe frame helpers which can be displayed in the editor + QRect m_safeFrame; + QRect m_safeAction; + QRect m_safeTitle; + + // Aspect ratios available in the title bar + CPredefinedAspectRatios m_predefinedAspectRatios; + + // Is the cursor hidden or displayed? + bool m_bCursorHidden = false; + + // Shim for QtViewport, which used to be responsible for visibility queries in the editor, + // these are now forwarded to EntityVisibilityQuery AzFramework::EntityVisibilityQuery m_entityVisibilityQuery; + // Handlers for grid snapping/editor event callbacks SandboxEditor::GridSnappingChangedEvent::Handler m_gridSnappingHandler; AZStd::unique_ptr m_editorViewportSettingsCallbacks; + // Used for some legacy logic which lets the widget release a grabbed keyboard at the right times + // Unclear if it's still necessary. QSet m_keyDown; + // State for ViewportFreezeRequestBus, currently does nothing bool m_freezeViewportInput = false; + // This widget holds a reference to the manipulator manage because its responsible for drawing manipulators AZStd::shared_ptr m_manipulatorManager; - // Used to prevent circular set camera events - bool m_ignoreSetViewFromEntityPerspective = false; - bool m_windowResizedEvent = false; + AZStd::unique_ptr m_editorModularViewportCameraComposer; + // Helper for getting EditorEntityNotificationBus events AZStd::unique_ptr m_editorEntityNotifications; + + // The widget to which Atom will actually render AtomToolsFramework::RenderViewportWidget* m_renderViewport = nullptr; - bool m_updateCameraPositionNextTick = false; - AZ::RPI::ViewportContext::MatrixChangedEvent::Handler m_cameraViewMatrixChangeHandler; - AZ::RPI::ViewportContext::MatrixChangedEvent::Handler m_cameraProjectionMatrixChangeHandler; + // Atom debug display AzFramework::DebugDisplayRequests* m_debugDisplay = nullptr; + // The default view created for the viewport context, which is used as the "Editor Camera" + AZ::RPI::ViewPtr m_defaultView; + + // The name to set on the viewport context when this viewport widget is set as the active one AZ::Name m_defaultViewportContextName; + // DO NOT USE THIS! It exists only to satisfy the signature of the base class method GetViewTm + mutable Matrix34 m_viewTmStorage; + AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING }; diff --git a/Code/Editor/ErrorReport.cpp b/Code/Editor/ErrorReport.cpp index e1b2b8b6e4..7914511fbe 100644 --- a/Code/Editor/ErrorReport.cpp +++ b/Code/Editor/ErrorReport.cpp @@ -136,11 +136,11 @@ void CErrorReport::ReportError(CErrorRecord& err) } else { - if (err.pObject == NULL && m_pObject != NULL) + if (err.pObject == nullptr && m_pObject != nullptr) { err.pObject = m_pObject; } - else if (err.pItem == NULL && m_pItem != NULL) + else if (err.pItem == nullptr && m_pItem != nullptr) { err.pItem = m_pItem; } diff --git a/Code/Editor/ErrorReportDialog.cpp b/Code/Editor/ErrorReportDialog.cpp index 8b007207d6..2d551d6c8b 100644 --- a/Code/Editor/ErrorReportDialog.cpp +++ b/Code/Editor/ErrorReportDialog.cpp @@ -39,7 +39,7 @@ AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING ////////////////////////////////////////////////////////////////////////// -CErrorReportDialog* CErrorReportDialog::m_instance = 0; +CErrorReportDialog* CErrorReportDialog::m_instance = nullptr; // CErrorReportDialog dialog @@ -88,12 +88,12 @@ CErrorReportDialog::CErrorReportDialog(QWidget* parent) m_instance = this; //CErrorReport *report, //m_pErrorReport = report; - m_pErrorReport = 0; + m_pErrorReport = nullptr; } CErrorReportDialog::~CErrorReportDialog() { - m_instance = 0; + m_instance = nullptr; } ////////////////////////////////////////////////////////////////////////// @@ -141,7 +141,7 @@ void CErrorReportDialog::Clear() { if (m_instance) { - m_instance->SetReport(0); + m_instance->SetReport(nullptr); m_instance->UpdateErrors(); } } @@ -500,7 +500,7 @@ void CErrorReportDialog::OnReportItemDblClick(const QModelIndex& index) { bool bDone = false; const CErrorRecord* pError = index.data(Qt::UserRole).value(); - if (pError && pError->pObject != NULL) + if (pError && pError->pObject != nullptr) { CUndo undo("Select Object(s)"); // Clear other selection. @@ -563,7 +563,7 @@ void CErrorReportDialog::OnReportHyperlink(const QModelIndex& index) { const CErrorRecord* pError = index.data(Qt::UserRole).value(); bool bDone = false; - if (pError && pError->pObject != NULL) + if (pError && pError->pObject != nullptr) { CUndo undo("Select Object(s)"); // Clear other selection. @@ -593,8 +593,8 @@ void CErrorReportDialog::OnShowFieldChooser() CMainFrm* pMainFrm = (CMainFrame*)AfxGetMainWnd(); if (pMainFrm) { - BOOL bShow = !pMainFrm->m_wndFieldChooser.IsVisible(); - pMainFrm->ShowControlBar(&pMainFrm->m_wndFieldChooser, bShow, FALSE); + bool bShow = !pMainFrm->m_wndFieldChooser.IsVisible(); + pMainFrm->ShowControlBar(&pMainFrm->m_wndFieldChooser, bShow, false); } } */ diff --git a/Code/Editor/ErrorReportTableModel.cpp b/Code/Editor/ErrorReportTableModel.cpp index e7a1048a09..f5dce1a86d 100644 --- a/Code/Editor/ErrorReportTableModel.cpp +++ b/Code/Editor/ErrorReportTableModel.cpp @@ -45,7 +45,7 @@ bool GetPositionFromString(QString er, float* x, float* y, float* z) } if (ind > 0) { - *x = er.mid(0, ind).toDouble(); + *x = er.mid(0, ind).toFloat(); er = er.mid(ind); er.remove(QRegExp("^[ ,]*")); @@ -57,12 +57,12 @@ bool GetPositionFromString(QString er, float* x, float* y, float* z) } if (ind > 0) { - *y = er.mid(0, ind).toDouble(); + *y = er.mid(0, ind).toFloat(); er = er.mid(ind); er.remove(QRegExp("^[ ,]*")); if (er.length()) { - *z = er.toDouble(); + *z = er.toFloat(); return true; } } @@ -105,7 +105,7 @@ void CErrorReportTableModel::setErrorReport(CErrorReport* report) { m_errorRecords.clear(); } - if (report != 0) + if (report != nullptr) { const int count = report->GetErrorCount(); m_errorRecords.reserve(count); @@ -119,7 +119,7 @@ void CErrorReportTableModel::setErrorReport(CErrorReport* report) int CErrorReportTableModel::rowCount(const QModelIndex& parent) const { - return parent.isValid() ? 0 : m_errorRecords.size(); + return parent.isValid() ? 0 : static_cast(m_errorRecords.size()); } int CErrorReportTableModel::columnCount(const QModelIndex& parent) const diff --git a/Code/Editor/Export/ExportManager.cpp b/Code/Editor/Export/ExportManager.cpp index 10f96ce71b..5527aa6ce6 100644 --- a/Code/Editor/Export/ExportManager.cpp +++ b/Code/Editor/Export/ExportManager.cpp @@ -22,7 +22,6 @@ #include "OBJExporter.h" #include "OCMExporter.h" #include "FBXExporterDialog.h" -#include "RenderViewport.h" #include "TrackViewExportKeyTimeDlg.h" #include "AnimationContext.h" #include "TrackView/DirectorNodeAnimator.h" @@ -41,15 +40,6 @@ namespace { - void SetTexture(Export::TPath& outName, IRenderShaderResources* pRes, int nSlot) - { - SEfResTexture* pTex = pRes->GetTextureResource(nSlot); - if (pTex) - { - cry_strcat(outName, Path::GamePathToFullPath(pTex->m_Name.c_str()).toUtf8().data()); - } - } - inline Export::Vector3D Vec3ToVector3D(const Vec3& vec) { Export::Vector3D ret; @@ -88,7 +78,7 @@ Export::CObject::CObject(const char* pName) nParent = -1; - cry_strcpy(name, pName); + azstrcpy(name, AZ_ARRAY_SIZE(name), pName); materialName[0] = '\0'; @@ -102,7 +92,7 @@ Export::CObject::CObject(const char* pName) void Export::CObject::SetMaterialName(const char* pName) { - cry_strcpy(materialName, pName); + azstrcpy(materialName, AZ_ARRAY_SIZE(materialName), pName); } @@ -303,7 +293,7 @@ void CExportManager::ProcessEntityAnimationTrack( return; } - for (int trackNumber = 0; trackNumber < pEntityTrack->GetChildCount(); ++trackNumber) + for (unsigned int trackNumber = 0; trackNumber < pEntityTrack->GetChildCount(); ++trackNumber) { CTrackViewTrack* pSubTrack = static_cast(pEntityTrack->GetChild(trackNumber)); @@ -366,10 +356,9 @@ void CExportManager::AddMesh(Export::CObject* pObj, const IIndexedMesh* pIndMesh for (int v = 0; v < meshDesc.m_nCoorCount; ++v) { - Export::UV tc; - meshDesc.m_pTexCoord[v].ExportTo(tc.u, tc.v); - tc.v = 1.0f - tc.v; - pObj->m_texCoords.push_back(tc); + Vec2 uv = meshDesc.m_pTexCoord[v].GetUV(); + uv.y = 1.0f - uv.y; + pObj->m_texCoords.push_back({uv.x,uv.y}); } if (pIndMesh->GetSubSetCount() && !(pIndMesh->GetSubSetCount() == 1 && pIndMesh->GetSubSet(0).nNumIndices == 0)) @@ -632,7 +621,7 @@ bool CExportManager::ShowFBXExportDialog() if (pivotObjectNode && !pivotObjectNode->IsGroupNode()) { - m_pivotEntityObject = static_cast(GetIEditor()->GetObjectManager()->FindObject(pivotObjectNode->GetName())); + m_pivotEntityObject = static_cast(GetIEditor()->GetObjectManager()->FindObject(pivotObjectNode->GetName().c_str())); if (m_pivotEntityObject) { @@ -662,12 +651,6 @@ bool CExportManager::ProcessObjectsForExport() GetIEditor()->GetAnimation()->SetRecording(false); GetIEditor()->GetAnimation()->SetPlaying(false); - CViewport* vp = GetIEditor()->GetViewManager()->GetSelectedViewport(); - if (CRenderViewport* rvp = viewport_cast(vp)) - { - rvp->SetSequenceCamera(); - } - int startFrame = 0; timeValue = startFrame * fpsTimeInterval; @@ -823,7 +806,7 @@ void CExportManager::FillAnimTimeNode(XmlNodeRef writeNode, CTrackViewAnimNode* if (numAllTracks > 0) { - XmlNodeRef objNode = writeNode->createNode(CleanXMLText(pObjectNode->GetName()).toUtf8().data()); + XmlNodeRef objNode = writeNode->createNode(CleanXMLText(pObjectNode->GetName().c_str()).toUtf8().data()); writeNode->setAttr("time", m_animTimeExportPrimarySequenceCurrentTime); for (unsigned int trackID = 0; trackID < numAllTracks; ++trackID) @@ -834,7 +817,7 @@ void CExportManager::FillAnimTimeNode(XmlNodeRef writeNode, CTrackViewAnimNode* if (trackType == AnimParamType::Animation || trackType == AnimParamType::Sound) { - QString childName = CleanXMLText(childTrack->GetName()); + QString childName = CleanXMLText(childTrack->GetName().c_str()); if (childName.isEmpty()) { @@ -971,7 +954,7 @@ bool CExportManager::AddObjectsFromSequence(CTrackViewSequence* pSequence, XmlNo } const uint numKeys = pSequenceTrack->GetKeyCount(); - for (int keyIndex = 0; keyIndex < numKeys; ++keyIndex) + for (uint keyIndex = 0; keyIndex < numKeys; ++keyIndex) { const CTrackViewKeyHandle& keyHandle = pSequenceTrack->GetKey(keyIndex); ISequenceKey sequenceKey; @@ -992,7 +975,7 @@ bool CExportManager::AddObjectsFromSequence(CTrackViewSequence* pSequence, XmlNo else { // In case of exporting animation/sound times data - const QString sequenceName = pSubSequence->GetName(); + const QString sequenceName = QString::fromUtf8(pSubSequence->GetName().c_str()); XmlNodeRef subSeqNode2 = seqNode->createNode(sequenceName.toUtf8().data()); if (sequenceName == m_animTimeExportPrimarySequenceName) @@ -1050,7 +1033,7 @@ bool CExportManager::AddSelectedRegionObjects() std::vector objects; GetIEditor()->GetObjectManager()->FindObjectsInAABB(box, objects); - int numObjects = objects.size(); + const size_t numObjects = objects.size(); if (numObjects > m_data.m_objects.size()) { m_data.m_objects.reserve(numObjects + 1); // +1 for terrain @@ -1171,7 +1154,7 @@ bool CExportManager::Export(const char* defaultName, const char* defaultExt, con // Export the whole sequence with baked keys if (ShowFBXExportDialog()) { - m_numberOfExportFrames = pSequence->GetTimeRange().end * m_FBXBakedExportFPS; + m_numberOfExportFrames = static_cast(pSequence->GetTimeRange().end * m_FBXBakedExportFPS); if (!m_bExportOnlyPrimaryCamera) { @@ -1269,14 +1252,14 @@ void CExportManager::SaveNodeKeysTimeToXML() m_soundKeyTimeExport = exportDialog.IsSoundExportChecked(); QString filters = "All files (*.xml)"; - QString defaultName = QString(pSequence->GetName()) + ".xml"; + QString defaultName = QString::fromUtf8(pSequence->GetName().c_str()) + ".xml"; QtUtil::QtMFCScopedHWNDCapture cap; CAutoDirectoryRestoreFileDialog dlg(QFileDialog::AcceptSave, QFileDialog::AnyFile, "xml", defaultName, filters, {}, {}, cap); if (dlg.exec()) { - m_animTimeNode = XmlHelpers::CreateXmlNode(pSequence->GetName()); - m_animTimeExportPrimarySequenceName = pSequence->GetName(); + m_animTimeNode = XmlHelpers::CreateXmlNode(pSequence->GetName().c_str()); + m_animTimeExportPrimarySequenceName = QString::fromUtf8(pSequence->GetName().c_str()); m_data.Clear(); m_animTimeExportPrimarySequenceCurrentTime = 0.0; diff --git a/Code/Editor/Export/ExportManager.h b/Code/Editor/Export/ExportManager.h index 698ad3ad5d..be81591e56 100644 --- a/Code/Editor/Export/ExportManager.h +++ b/Code/Editor/Export/ExportManager.h @@ -36,7 +36,7 @@ namespace Export public: CMesh(); - virtual int GetFaceCount() const { return m_faces.size(); } + virtual int GetFaceCount() const { return static_cast(m_faces.size()); } virtual const Face* GetFaceBuffer() const { return m_faces.size() ? &m_faces[0] : 0; } private: @@ -53,22 +53,22 @@ namespace Export public: CObject(const char* pName); - virtual int GetVertexCount() const { return m_vertices.size(); } - virtual const Vector3D* GetVertexBuffer() const{ return m_vertices.size() ? &m_vertices[0] : 0; } + int GetVertexCount() const override { return static_cast(m_vertices.size()); } + const Vector3D* GetVertexBuffer() const override { return m_vertices.size() ? &m_vertices[0] : nullptr; } - virtual int GetNormalCount() const { return m_normals.size(); } - virtual const Vector3D* GetNormalBuffer() const { return m_normals.size() ? &m_normals[0] : 0; } + int GetNormalCount() const override { return static_cast(m_normals.size()); } + const Vector3D* GetNormalBuffer() const override { return m_normals.size() ? &m_normals[0] : nullptr; } - virtual int GetTexCoordCount() const { return m_texCoords.size(); } - virtual const UV* GetTexCoordBuffer() const { return m_texCoords.size() ? &m_texCoords[0] : 0; } + int GetTexCoordCount() const override { return static_cast(m_texCoords.size()); } + const UV* GetTexCoordBuffer() const override { return m_texCoords.size() ? &m_texCoords[0] : nullptr; } - virtual int GetMeshCount() const { return m_meshes.size(); } - virtual Mesh* GetMesh(int index) const { return m_meshes[index]; } + int GetMeshCount() const override { return static_cast(m_meshes.size()); } + Mesh* GetMesh(int index) const override { return m_meshes[index]; } - virtual size_t MeshHash() const{return m_MeshHash; } + size_t MeshHash() const override{return m_MeshHash; } void SetMaterialName(const char* pName); - virtual int GetEntityAnimationDataCount() const {return m_entityAnimData.size(); } + virtual int GetEntityAnimationDataCount() const {return static_cast(m_entityAnimData.size()); } virtual const EntityAnimData* GetEntityAnimationData(int index) const {return &m_entityAnimData[index]; } virtual void SetEntityAnimationData(EntityAnimData entityData){ m_entityAnimData.push_back(entityData); }; void SetLastPtr(CBaseObject* pObject){m_pLastObject = pObject; }; @@ -92,7 +92,7 @@ namespace Export : public IData { public: - virtual int GetObjectCount() const { return m_objects.size(); } + virtual int GetObjectCount() const { return static_cast(m_objects.size()); } virtual Object* GetObject(int index) const { return m_objects[index]; } virtual Object* AddObject(const char* objectName); void Clear(); diff --git a/Code/Editor/Export/OBJExporter.cpp b/Code/Editor/Export/OBJExporter.cpp index bd2696090e..6ce40f8cd3 100644 --- a/Code/Editor/Export/OBJExporter.cpp +++ b/Code/Editor/Export/OBJExporter.cpp @@ -227,7 +227,7 @@ QString COBJExporter::MakeRelativePath(const char* pMainFileName, const char* pF const char* ch = strrchr(pMainFileName, '\\'); if (ch) { - if (strlen(pFileName) > ch - pMainFileName && !_strnicmp(pMainFileName, pFileName, ch - pMainFileName)) + if (strlen(pFileName) > static_cast(ch - pMainFileName) && !_strnicmp(pMainFileName, pFileName, ch - pMainFileName)) { return QString(pFileName + (ch - pMainFileName) + 1); } @@ -256,7 +256,7 @@ const char* COBJExporter::TrimFloat(float fValue) const ++nCurBuf; sprintf_s(pBuf, bufSize, "%f", fValue); - for (int i = strlen(pBuf) - 1; i > 0; --i) + for (int i = static_cast(strlen(pBuf)) - 1; i > 0; --i) { if (pBuf[i] == '0') { diff --git a/Code/Editor/Export/OCMExporter.cpp b/Code/Editor/Export/OCMExporter.cpp index 653dc28dd3..ba5c343d0d 100644 --- a/Code/Editor/Export/OCMExporter.cpp +++ b/Code/Editor/Export/OCMExporter.cpp @@ -215,7 +215,7 @@ bool COCMExporter::ExportToFile(const char* filename, const Export::IData* pExpo for (size_t a = 0; a < MeshCount; a++) { SOCMeshInfo MeshInfo; - MeshInfo.m_MeshHash = pExportData->GetObject(a)->MeshHash(); + MeshInfo.m_MeshHash = pExportData->GetObject(static_cast(a))->MeshHash(); const tdMeshOffset::iterator it = std::find(MeshOffsets.begin(), MeshOffsets.end(), MeshInfo); if (it != MeshOffsets.end()) { @@ -223,15 +223,15 @@ bool COCMExporter::ExportToFile(const char* filename, const Export::IData* pExpo } else { - MeshInfo.m_Offset = Offset; - Offset += SaveMesh(Writer, pExportData->GetObject(a), MeshInfo.m_OBBMat); + MeshInfo.m_Offset = static_cast(Offset); + Offset += SaveMesh(Writer, pExportData->GetObject(static_cast(a)), MeshInfo.m_OBBMat); } MeshOffsets.push_back(MeshInfo); } - OffsetInstances = Offset; + OffsetInstances = static_cast(Offset); for (size_t a = 0; a < InstCount; a++) { - SaveInstance(Writer, pExportData->GetObject(a), MeshOffsets[a]); + SaveInstance(Writer, pExportData->GetObject(static_cast(a)), MeshOffsets[a]); } Writer.Seek(4); Writer.Write(static_cast(MeshOffsets.size())); @@ -263,7 +263,7 @@ const char* COCMExporter::TrimFloat(float fValue) const ++nCurBuf; sprintf_s(pBuf, bufSize, "%f", fValue); - for (int i = strlen(pBuf) - 1; i > 0; --i) + for (int i = static_cast(strlen(pBuf)) - 1; i > 0; --i) { if (pBuf[i] == '0') { diff --git a/Code/Editor/FBXExporterDialog.cpp b/Code/Editor/FBXExporterDialog.cpp index 86e7843ca1..b080362b97 100644 --- a/Code/Editor/FBXExporterDialog.cpp +++ b/Code/Editor/FBXExporterDialog.cpp @@ -17,12 +17,6 @@ AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING #include AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING - -namespace -{ - const uint kDefaultFPS = 30.0f; -} - CFBXExporterDialog::CFBXExporterDialog(bool bDisplayOnlyFPSSetting, QWidget* pParent) : QDialog(pParent) , m_ui(new Ui::FBXExporterDialog) @@ -43,7 +37,7 @@ CFBXExporterDialog::~CFBXExporterDialog() float CFBXExporterDialog::GetFPS() const { - return m_ui->m_fpsCombo->currentText().toDouble(); + return m_ui->m_fpsCombo->currentText().toFloat(); } bool CFBXExporterDialog::GetExportCoordsLocalToTheSelectedObject() const diff --git a/Code/Editor/GameEngine.cpp b/Code/Editor/GameEngine.cpp index 173c13c235..4b463efe0a 100644 --- a/Code/Editor/GameEngine.cpp +++ b/Code/Editor/GameEngine.cpp @@ -57,12 +57,12 @@ struct SSystemUserCallback : public ISystemUserCallback { SSystemUserCallback(IInitializeUIInfo* logo) : m_threadErrorHandler(this) { m_pLogo = logo; }; - virtual void OnSystemConnect(ISystem* pSystem) + void OnSystemConnect(ISystem* pSystem) override { ModuleInitISystem(pSystem, "Editor"); } - virtual bool OnError(const char* szErrorString) + bool OnError(const char* szErrorString) override { // since we show a message box, we have to use the GUI thread if (QThread::currentThread() != qApp->thread()) @@ -95,7 +95,7 @@ struct SSystemUserCallback int res = IDNO; - ICVar* pCVar = gEnv->pConsole ? gEnv->pConsole->GetCVar("sys_no_crash_dialog") : NULL; + ICVar* pCVar = gEnv->pConsole ? gEnv->pConsole->GetCVar("sys_no_crash_dialog") : nullptr; if (!pCVar || pCVar->GetIVal() == 0) { @@ -116,7 +116,7 @@ struct SSystemUserCallback return true; } - virtual bool OnSaveDocument() + bool OnSaveDocument() override { bool success = false; @@ -133,7 +133,7 @@ struct SSystemUserCallback return success; } - virtual bool OnBackupDocument() + bool OnBackupDocument() override { CCryEditDoc* level = GetIEditor() ? GetIEditor()->GetDocument() : nullptr; if (level) @@ -144,7 +144,7 @@ struct SSystemUserCallback return false; } - virtual void OnProcessSwitch() + void OnProcessSwitch() override { if (GetIEditor()->IsInGameMode()) { @@ -152,7 +152,7 @@ struct SSystemUserCallback } } - virtual void OnInitProgress(const char* sProgressMsg) + void OnInitProgress(const char* sProgressMsg) override { if (m_pLogo) { @@ -160,7 +160,7 @@ struct SSystemUserCallback } } - virtual int ShowMessage(const char* text, const char* caption, unsigned int uType) + int ShowMessage(const char* text, const char* caption, unsigned int uType) override { if (CCryEditApp::instance()->IsInAutotestMode()) { @@ -176,7 +176,7 @@ struct SSystemUserCallback return CryMessageBox(text, caption, uType); } - virtual void GetMemoryUsage(ICrySizer* pSizer) + void GetMemoryUsage(ICrySizer* pSizer) override { GetIEditor()->GetMemoryUsage(pSizer); } @@ -215,7 +215,7 @@ public: { AzFramework::AssetSystemConnectionNotificationsBus::Handler::BusConnect(); }; - ~AssetProcessConnectionStatus() + ~AssetProcessConnectionStatus() override { AzFramework::AssetSystemConnectionNotificationsBus::Handler::BusDisconnect(); } @@ -247,18 +247,18 @@ private: AZ_PUSH_DISABLE_WARNING(4273, "-Wunknown-warning-option") CGameEngine::CGameEngine() - : m_gameDll(0) + : m_gameDll(nullptr) , m_bIgnoreUpdates(false) , m_ePendingGameMode(ePGM_NotPending) , m_modalWindowDismisser(nullptr) AZ_POP_DISABLE_WARNING { - m_pISystem = NULL; + m_pISystem = nullptr; m_bLevelLoaded = false; m_bInGameMode = false; m_bSimulationMode = false; m_bSyncPlayerPosition = true; - m_hSystemHandle = 0; + m_hSystemHandle = nullptr; m_bJustCreated = false; m_levelName = "Untitled"; m_levelExtension = EditorUtils::LevelFile::GetDefaultFileExtension(); @@ -271,7 +271,7 @@ CGameEngine::~CGameEngine() { AZ_POP_DISABLE_WARNING GetIEditor()->UnregisterNotifyListener(this); - m_pISystem->GetIMovieSystem()->SetCallback(NULL); + m_pISystem->GetIMovieSystem()->SetCallback(nullptr); if (m_gameDll) { @@ -279,7 +279,7 @@ AZ_POP_DISABLE_WARNING } delete m_pISystem; - m_pISystem = NULL; + m_pISystem = nullptr; if (m_hSystemHandle) { @@ -497,8 +497,7 @@ bool CGameEngine::LoadLevel( [[maybe_unused]] bool bDeleteAIGraph, bool bReleaseResources) { - LOADING_TIME_PROFILE_SECTION(GetIEditor()->GetSystem()); - m_bLevelLoaded = false; + m_bLevelLoaded = false; CLogFile::FormatLine("Loading map '%s' into engine...", m_levelPath.toUtf8().data()); // Switch the current directory back to the Primary CD folder first. // The engine might have trouble to find some files when the current @@ -572,8 +571,6 @@ void CGameEngine::SwitchToInGame() m_pISystem->GetIMovieSystem()->EnablePhysicsEvents(true); m_bInGameMode = true; - gEnv->pSystem->GetViewCamera().SetMatrix(m_playerViewTM); - // Disable accelerators. GetIEditor()->EnableAcceleratos(false); //! Send event to switch into game. @@ -627,13 +624,6 @@ void CGameEngine::SwitchToInEditor() m_bInGameMode = false; - // save the current gameView matrix for editor - if (pGameViewport) - { - Matrix34 gameView = gEnv->pSystem->GetViewCamera().GetMatrix(); - pGameViewport->SetGameTM(gameView); - } - // Out of game in Editor mode. if (pGameViewport) { @@ -875,7 +865,7 @@ void CGameEngine::OnEditorNotifyEvent(EEditorNotifyEvent event) { case eNotify_OnSplashScreenDestroyed: { - if (m_pSystemUserCallback != NULL) + if (m_pSystemUserCallback != nullptr) { m_pSystemUserCallback->OnSplashScreenDone(); } diff --git a/Code/Editor/GameEngine.h b/Code/Editor/GameEngine.h index 84df8bf002..4d183cc38e 100644 --- a/Code/Editor/GameEngine.h +++ b/Code/Editor/GameEngine.h @@ -116,11 +116,11 @@ public: //! mutex used by other threads to lock up the PAK modification, //! so only one thread can modify the PAK at once - static CryMutex& GetPakModifyMutex() + static AZStd::recursive_mutex& GetPakModifyMutex() { //! mutex used to halt copy process while the export to game //! or other pak operation is done in the main thread - static CryMutex s_pakModifyMutex; + static AZStd::recursive_mutex s_pakModifyMutex; return s_pakModifyMutex; } diff --git a/Code/Editor/GameExporter.cpp b/Code/Editor/GameExporter.cpp index 006eb9189c..1fc980fdac 100644 --- a/Code/Editor/GameExporter.cpp +++ b/Code/Editor/GameExporter.cpp @@ -63,7 +63,7 @@ void SGameExporterSettings::SetHiQuality() nApplySS = 1; } -CGameExporter* CGameExporter::m_pCurrentExporter = NULL; +CGameExporter* CGameExporter::m_pCurrentExporter = nullptr; ////////////////////////////////////////////////////////////////////////// // CGameExporter @@ -76,7 +76,7 @@ CGameExporter::CGameExporter() CGameExporter::~CGameExporter() { - m_pCurrentExporter = NULL; + m_pCurrentExporter = nullptr; } ////////////////////////////////////////////////////////////////////////// @@ -136,7 +136,7 @@ bool CGameExporter::Export(unsigned int flags, [[maybe_unused]] EEndian eExportE m_settings.SetHiQuality(); } - CryAutoLock autoLock(CGameEngine::GetPakModifyMutex()); + AZStd::scoped_lock autoLock(CGameEngine::GetPakModifyMutex()); // Close this pak file. if (!CloseLevelPack(m_levelPak, true)) @@ -252,11 +252,11 @@ void CGameExporter::ExportOcclusionMesh(const char* pszGamePath) { CMemoryBlock Temp; const size_t Size = FileIn.size(); - Temp.Allocate(Size); + Temp.Allocate(static_cast(Size)); FileIn.read(reinterpret_cast(Temp.GetBuffer()), Size); FileIn.close(); CCryMemFile FileOut; - FileOut.Write(Temp.GetBuffer(), Size); + FileOut.Write(Temp.GetBuffer(), static_cast(Size)); m_levelPak.m_pakFile.UpdateFile(levelDataFile.toUtf8().data(), FileOut); } } @@ -281,13 +281,13 @@ void CGameExporter::ExportLevelData(const QString& path, bool /*bExportMission*/ QString levelDataFile = path + "LevelData.xml"; XmlString xmlData = root->getXML(); CCryMemFile file; - file.Write(xmlData.c_str(), xmlData.length()); + file.Write(xmlData.c_str(), static_cast(xmlData.length())); m_levelPak.m_pakFile.UpdateFile(levelDataFile.toUtf8().data(), file); QString levelDataActionFile = path + "LevelDataAction.xml"; XmlString xmlDataAction = rootAction->getXML(); CCryMemFile fileAction; - fileAction.Write(xmlDataAction.c_str(), xmlDataAction.length()); + fileAction.Write(xmlDataAction.c_str(), static_cast(xmlDataAction.length())); m_levelPak.m_pakFile.UpdateFile(levelDataActionFile.toUtf8().data(), fileAction); AZStd::vector entitySaveBuffer; @@ -298,7 +298,7 @@ void CGameExporter::ExportLevelData(const QString& path, bool /*bExportMission*/ { QString entitiesFile; entitiesFile = QStringLiteral("%1%2.entities_xml").arg(path, "Mission0"); - m_levelPak.m_pakFile.UpdateFile(entitiesFile.toUtf8().data(), entitySaveBuffer.begin(), entitySaveBuffer.size()); + m_levelPak.m_pakFile.UpdateFile(entitiesFile.toUtf8().data(), entitySaveBuffer.begin(), static_cast(entitySaveBuffer.size())); } } @@ -329,7 +329,7 @@ void CGameExporter::ExportLevelInfo(const QString& path) XmlString xmlData = root->getXML(); CCryMemFile file; - file.Write(xmlData.c_str(), xmlData.length()); + file.Write(xmlData.c_str(), static_cast(xmlData.length())); m_levelPak.m_pakFile.UpdateFile(filename.toUtf8().data(), file); } @@ -342,7 +342,7 @@ void CGameExporter::ExportLevelResourceList(const QString& path) CCryMemFile memFile; for (const char* filename = pResList->GetFirst(); filename; filename = pResList->GetNext()) { - memFile.Write(filename, strlen(filename)); + memFile.Write(filename, static_cast(strlen(filename))); memFile.Write("\n", 1); } @@ -378,14 +378,14 @@ void CGameExporter::ExportFileList(const QString& path, const QString& levelName { // process the folder of the specified map name, producing a filelist.xml file // that can later be used for map downloads - string newpath; + AZStd::string newpath; - QString filename = levelName; - string mapname = (filename + ".dds").toUtf8().data(); - string metaname = (filename + ".xml").toUtf8().data(); + AZStd::string filename = levelName.toUtf8().data(); + AZStd::string mapname = (filename + ".dds"); + AZStd::string metaname = (filename + ".xml"); XmlNodeRef rootNode = gEnv->pSystem->CreateXmlNode("download"); - rootNode->setAttr("name", filename.toUtf8().data()); + rootNode->setAttr("name", filename.c_str()); rootNode->setAttr("type", "Map"); XmlNodeRef indexNode = rootNode->newChild("index"); if (indexNode) @@ -434,9 +434,9 @@ void CGameExporter::ExportFileList(const QString& path, const QString& levelName newFileNode->setAttr("size", handle.m_fileDesc.nSize); unsigned char md5[16]; - string filenameToHash = GetIEditor()->GetGameEngine()->GetLevelPath().toUtf8().data(); + AZStd::string filenameToHash = GetIEditor()->GetGameEngine()->GetLevelPath().toUtf8().data(); filenameToHash += "/"; - filenameToHash += string{ handle.m_filename.data(), handle.m_filename.size() }; + filenameToHash += AZStd::string{ handle.m_filename.data(), handle.m_filename.size() }; if (gEnv->pCryPak->ComputeMD5(filenameToHash.data(), md5)) { char md5string[33]; diff --git a/Code/Editor/GameExporter.h b/Code/Editor/GameExporter.h index 3e3c57fb4c..19ec601ff7 100644 --- a/Code/Editor/GameExporter.h +++ b/Code/Editor/GameExporter.h @@ -102,7 +102,6 @@ private: AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING bool m_bAutoExportMode; - int m_numExportedMaterials; static CGameExporter* m_pCurrentExporter; }; diff --git a/Code/Editor/GameResourcesExporter.cpp b/Code/Editor/GameResourcesExporter.cpp index dd16b2eca1..b47f8c63a6 100644 --- a/Code/Editor/GameResourcesExporter.cpp +++ b/Code/Editor/GameResourcesExporter.cpp @@ -97,7 +97,7 @@ void CGameResourcesExporter::Save(const QString& outputDirectory) { // Save this file in target folder. QString trgFilename = Path::Make(outputDirectory, srcFilename); - int fsize = file.GetLength(); + int fsize = static_cast(file.GetLength()); if (fsize > data.GetSize()) { data.Allocate(fsize + 16); @@ -123,23 +123,6 @@ void CGameResourcesExporter::Save(const QString& outputDirectory) m_files.clear(); } -#if defined(WIN64) || defined(APPLE) || defined(AZ_PLATFORM_LINUX) -template -void Append(Container1& a, const Container2& b) -{ - a.reserve (a.size() + b.size()); - for (auto it = b.begin(); it != b.end(); ++it) - { - a.insert(a.end(), *it); - } -} -#else -template -void Append(Container1& a, const Container2& b) -{ - a.insert (a.end(), b.begin(), b.end()); -} -#endif ////////////////////////////////////////////////////////////////////////// // // Go through all editor objects and gathers files from thier properties. @@ -150,5 +133,5 @@ void CGameResourcesExporter::GetFilesFromObjects() CUsedResources rs; GetIEditor()->GetObjectManager()->GatherUsedResources(rs); - Append(m_files, rs.files); + AZStd::copy(rs.files.begin(), rs.files.end(), AZStd::back_inserter(m_files)); } diff --git a/Code/Editor/GenericSelectItemDialog.cpp b/Code/Editor/GenericSelectItemDialog.cpp index ef109336ef..06f66c52eb 100644 --- a/Code/Editor/GenericSelectItemDialog.cpp +++ b/Code/Editor/GenericSelectItemDialog.cpp @@ -17,7 +17,7 @@ AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING // CGenericSelectItemDialog dialog -CGenericSelectItemDialog::CGenericSelectItemDialog(QWidget* pParent /*=NULL*/) +CGenericSelectItemDialog::CGenericSelectItemDialog(QWidget* pParent /*=nullptr*/) : QDialog(pParent) , ui(new Ui::CGenericSelectItemDialog) , m_initialized(false) @@ -91,20 +91,6 @@ void CGenericSelectItemDialog::ReloadTree() QTreeWidgetItem* hSelected = nullptr; - /* - std::vector::const_iterator iter = m_items.begin(); - while (iter != m_items.end()) - { - const CString& itemName = *iter; - HTREEITEM hItem = m_tree.InsertItem(itemName, 0, 0, TVI_ROOT, TVI_SORT); - if (!m_preselect.IsEmpty() && m_preselect.CompareNoCase(itemName) == 0) - { - hSelected = hItem; - } - ++iter; - } - */ - std::map items; QRegularExpression sep(QStringLiteral("[\\/.") + m_treeSeparator + QStringLiteral("]+")); diff --git a/Code/Editor/Geometry/TriMesh.cpp b/Code/Editor/Geometry/TriMesh.cpp index 737886cabc..efc201095d 100644 --- a/Code/Editor/Geometry/TriMesh.cpp +++ b/Code/Editor/Geometry/TriMesh.cpp @@ -161,61 +161,6 @@ void* CTriMesh::ReAllocElements(void* old_ptr, int new_elem_num, int size_of_ele return realloc(old_ptr, new_elem_num * size_of_element); } -////////////////////////////////////////////////////////////////////////// -// Unshare all vertices and split on 3 arrays, positions/texcoords. -////////////////////////////////////////////////////////////////////////// -void CTriMesh::SetFromMesh(CMesh& mesh) -{ - bbox = mesh.m_bbox; - - int maxVerts = mesh.GetIndexCount(); - - SetVertexCount(maxVerts); - SetUVCount(maxVerts); - if (mesh.m_pColor0) - { - SetColorsCount(maxVerts); - } - - SetFacesCount(mesh.GetIndexCount()); - - int numv = 0; - int numface = 0; - for (int nSubset = 0; nSubset < mesh.GetSubSetCount(); nSubset++) - { - SMeshSubset& subset = mesh.m_subsets[nSubset]; - for (int i = subset.nFirstIndexId; i < subset.nFirstIndexId + subset.nNumIndices; i += 3) - { - CTriFace& face = pFaces[numface++]; - for (int j = 0; j < 3; j++) - { - int idx = mesh.m_pIndices[i + j]; - pVertices[numv].pos = mesh.m_pPositions ? mesh.m_pPositions[idx] : mesh.m_pPositionsF16[idx].ToVec3(); - pWeights[numv] = 0.0f; - pUV[numv] = mesh.m_pTexCoord[idx]; - if (mesh.m_pColor0) - { - pColors[numv] = mesh.m_pColor0[idx]; - } - - face.v [j] = numv; - face.uv[j] = numv; - face.n [j] = mesh.m_pNorms[idx].GetN(); - face.MatID = subset.nMatID; - face.flags = 0; - - numv++; - } - } - } - SetFacesCount(numface); - SharePositions(); - ShareUV(); - UpdateEdges(); - - CalcFaceNormals(); -} - ///////////////////////////////////////////////////////////////////////////////////// inline int FindVertexInHash(const Vec3& vPosToFind, const CTriVertex* pVectors, std::vector& hash, float fEpsilon) { @@ -269,7 +214,7 @@ void CTriMesh::SharePositions() for (int i = 0; i < 3; i++) { const Vec3& v = pVertices[face.v[i]].pos; - uint8 nHash = RoundFloatToInt((v.x + v.y + v.z) * fHashScale); + uint8 nHash = static_cast(RoundFloatToInt((v.x + v.y + v.z) * fHashScale)); int find = FindVertexInHash(v, pNewVerts, arrHashTable[nHash], fEpsilon); if (find < 0) @@ -320,7 +265,7 @@ void CTriMesh::ShareUV() for (int i = 0; i < 3; i++) { const Vec2 uv = pUV[face.uv[i]].GetUV(); - uint8 nHash = RoundFloatToInt((uv.x + uv.y) * fHashScale); + uint8 nHash = static_cast(RoundFloatToInt((uv.x + uv.y) * fHashScale)); int find = FindTexCoordInHash(pUV[face.uv[i]], pNewUV, arrHashTable[nHash], fEpsilon); if (find < 0) @@ -360,76 +305,6 @@ void CTriMesh::CalcFaceNormals() #define TEX_EPS 0.001f #define VER_EPS 0.001f -////////////////////////////////////////////////////////////////////////// -void CTriMesh::UpdateIndexedMesh(IIndexedMesh* pIndexedMesh) const -{ - { - const int maxVerts = nFacesCount * 3; - - pIndexedMesh->SetVertexCount(maxVerts); - pIndexedMesh->SetTexCoordCount(maxVerts); - if (pColors) - { - pIndexedMesh->SetColorCount(maxVerts); - } - pIndexedMesh->SetIndexCount(0); - pIndexedMesh->SetFaceCount(nFacesCount); - } - - ////////////////////////////////////////////////////////////////////////// - // To find really used materials - std::vector usedMaterialIds; - uint16 MatIdToSubset[MAX_SUB_MATERIALS]; - int nLastSubsetId = 0; - memset(MatIdToSubset, 0, sizeof(MatIdToSubset)); - ////////////////////////////////////////////////////////////////////////// - - CMesh& mesh = *pIndexedMesh->GetMesh(); - AABB bb; - bb.Reset(); - for (int i = 0; i < nFacesCount; ++i) - { - const CTriFace& face = pFaces[i]; - SMeshFace& meshFace = mesh.m_pFaces[i]; - - // Remap new used material ID to index of chunk id. - if (!MatIdToSubset[face.MatID]) - { - MatIdToSubset[face.MatID] = 1 + nLastSubsetId++; - usedMaterialIds.push_back(face.MatID); // Order of material ids in usedMaterialIds correspond to the indices of chunks. - } - meshFace.nSubset = MatIdToSubset[face.MatID] - 1; - - for (int j = 0; j < 3; ++j) - { - const int dstVIdx = i * 3 + j; - - mesh.m_pPositions[dstVIdx] = pVertices[face.v[j]].pos; - mesh.m_pNorms[dstVIdx] = SMeshNormal(face.n[j]); - mesh.m_pTexCoord[dstVIdx] = pUV[face.uv[j]]; - if (pColors) - { - mesh.m_pColor0[dstVIdx] = pColors[face.v[j]]; - } - - meshFace.v[j] = dstVIdx; - - bb.Add(mesh.m_pPositions[dstVIdx]); - } - } - - pIndexedMesh->SetBBox(bb); - - pIndexedMesh->SetSubSetCount(usedMaterialIds.size()); - for (int i = 0; i < usedMaterialIds.size(); i++) - { - pIndexedMesh->SetSubsetMaterialId(i, usedMaterialIds[i]); - } - - pIndexedMesh->Optimize(); -} - - ////////////////////////////////////////////////////////////////////////// void CTriMesh::CopyStream(CTriMesh& fromMesh, int stream) { @@ -677,11 +552,11 @@ void CTriMesh::GetEdgesByVertex(MeshElementsArray& inVertices, MeshElementsArray std::sort(inVertices.begin(), inVertices.end()); for (int i = 0; i < GetEdgeCount(); i++) { - if (stl::binary_find(inVertices.begin(), inVertices.end(), pEdges[i].v[0]) != inVertices.end()) + if (stl::binary_find(inVertices.begin(), inVertices.end(), static_cast(pEdges[i].v[0])) != inVertices.end()) { outEdges.push_back(i); } - else if (stl::binary_find(inVertices.begin(), inVertices.end(), pEdges[i].v[1]) != inVertices.end()) + else if (stl::binary_find(inVertices.begin(), inVertices.end(), static_cast(pEdges[i].v[1])) != inVertices.end()) { outEdges.push_back(i); } @@ -696,15 +571,15 @@ void CTriMesh::GetFacesByVertex(MeshElementsArray& inVertices, MeshElementsArray std::sort(inVertices.begin(), inVertices.end()); for (int i = 0; i < GetFacesCount(); i++) { - if (stl::binary_find(inVertices.begin(), inVertices.end(), pFaces[i].v[0]) != inVertices.end()) + if (stl::binary_find(inVertices.begin(), inVertices.end(), static_cast(pFaces[i].v[0])) != inVertices.end()) { outFaces.push_back(i); } - else if (stl::binary_find(inVertices.begin(), inVertices.end(), pFaces[i].v[1]) != inVertices.end()) + else if (stl::binary_find(inVertices.begin(), inVertices.end(), static_cast(pFaces[i].v[1])) != inVertices.end()) { outFaces.push_back(i); } - else if (stl::binary_find(inVertices.begin(), inVertices.end(), pFaces[i].v[2]) != inVertices.end()) + else if (stl::binary_find(inVertices.begin(), inVertices.end(), static_cast(pFaces[i].v[2])) != inVertices.end()) { outFaces.push_back(i); } diff --git a/Code/Editor/Geometry/TriMesh.h b/Code/Editor/Geometry/TriMesh.h index 9bb73f945d..a6c58b8f9d 100644 --- a/Code/Editor/Geometry/TriMesh.h +++ b/Code/Editor/Geometry/TriMesh.h @@ -198,8 +198,6 @@ public: void GetStreamInfo(int stream, void*& pStream, int& nElementSize) const; int GetStreamSize(int stream) const { return m_streamSize[stream]; }; - void SetFromMesh(CMesh& mesh); - void UpdateIndexedMesh(IIndexedMesh* pIndexedMesh) const; // Calculate per face normal. void CalcFaceNormals(); diff --git a/Code/Editor/GotoPositionDlg.cpp b/Code/Editor/GotoPositionDlg.cpp index c1e64ed1a9..84d149de58 100644 --- a/Code/Editor/GotoPositionDlg.cpp +++ b/Code/Editor/GotoPositionDlg.cpp @@ -86,7 +86,7 @@ void GotoPositionDialog::OnChangeEdit() const QStringList parts = m_transform.split(QRegularExpression("[\\s,;\\t]"), Qt::SkipEmptyParts); for (int i = 0; i < argCount && i < parts.count(); ++i) { - transform[i] = parts[i].toDouble(); + transform[i] = parts[i].toFloat(); } m_ui->m_dymX->setValue(transform[0]); @@ -108,24 +108,12 @@ void GotoPositionDialog::OnUpdateNumbers() void GotoPositionDialog::accept() { - if (SandboxEditor::UsingNewCameraSystem()) - { - SandboxEditor::InterpolateDefaultViewportCameraToTransform( - AZ::Vector3( - aznumeric_cast(m_ui->m_dymX->value()), aznumeric_cast(m_ui->m_dymY->value()), - aznumeric_cast(m_ui->m_dymZ->value())), - AZ::DegToRad(aznumeric_cast(m_ui->m_dymAnglePitch->value())), - AZ::DegToRad(aznumeric_cast(m_ui->m_dymAngleYaw->value()))); - } - else - { - SandboxEditor::SetDefaultViewportCameraPosition(AZ::Vector3( + SandboxEditor::InterpolateDefaultViewportCameraToTransform( + AZ::Vector3( aznumeric_cast(m_ui->m_dymX->value()), aznumeric_cast(m_ui->m_dymY->value()), - aznumeric_cast(m_ui->m_dymZ->value()))); - SandboxEditor::SetDefaultViewportCameraRotation( - AZ::DegToRad(aznumeric_cast(m_ui->m_dymAnglePitch->value())), - AZ::DegToRad(aznumeric_cast(m_ui->m_dymAngleYaw->value()))); - } + aznumeric_cast(m_ui->m_dymZ->value())), + AZ::DegToRad(aznumeric_cast(m_ui->m_dymAnglePitch->value())), + AZ::DegToRad(aznumeric_cast(m_ui->m_dymAngleYaw->value()))); QDialog::accept(); } diff --git a/Code/Editor/IEditor.h b/Code/Editor/IEditor.h index a56c8e81e9..de7b0ec3f9 100644 --- a/Code/Editor/IEditor.h +++ b/Code/Editor/IEditor.h @@ -6,9 +6,6 @@ * */ - -#ifndef CRYINCLUDE_EDITOR_IEDITOR_H -#define CRYINCLUDE_EDITOR_IEDITOR_H #pragma once #ifdef PLUGIN_EXPORTS @@ -25,6 +22,7 @@ #include #include +#include class QMenu; @@ -68,7 +66,6 @@ class CDisplaySettings; struct SGizmoParameters; class CLevelIndependentFileMan; class CSelectionTreeManager; -struct IResourceSelectorHost; struct SEditorSettings; class CGameExporter; class IAWSResourceManager; @@ -570,7 +567,7 @@ struct IEditor ////////////////////////////////////////////////////////////////////////// virtual class CLevelIndependentFileMan* GetLevelIndependentFileMan() = 0; //! Notify all views that data is changed. - virtual void UpdateViews(int flags = 0xFFFFFFFF, const AABB* updateRegion = NULL) = 0; + virtual void UpdateViews(int flags = 0xFFFFFFFF, const AABB* updateRegion = nullptr) = 0; virtual void ResetViews() = 0; //! Update information in track view dialog. virtual void ReloadTrackView() = 0; @@ -589,7 +586,7 @@ struct IEditor //! if bShow is true also returns a valid ITransformManipulator pointer. virtual ITransformManipulator* ShowTransformManipulator(bool bShow) = 0; //! Return a pointer to a ITransformManipulator pointer if shown. - //! NULL is manipulator is not shown. + //! nullptr if manipulator is not shown. virtual ITransformManipulator* GetTransformManipulator() = 0; //! Set constrain on specified axis for objects construction and modifications. //! @param axis one of AxisConstrains enumerations. @@ -714,7 +711,6 @@ struct IEditor virtual ESystemConfigSpec GetEditorConfigSpec() const = 0; virtual ESystemConfigPlatform GetEditorConfigPlatform() const = 0; virtual void ReloadTemplates() = 0; - virtual IResourceSelectorHost* GetResourceSelectorHost() = 0; virtual void ShowStatusText(bool bEnable) = 0; // Provides a way to extend the context menu of an object. The function gets called every time the menu is opened. @@ -740,4 +736,5 @@ struct IInitializeUIInfo virtual void SetInfoText(const char* text) = 0; }; -#endif // CRYINCLUDE_EDITOR_IEDITOR_H +AZ_DECLARE_BUDGET(Editor); + diff --git a/Code/Editor/IEditorImpl.cpp b/Code/Editor/IEditorImpl.cpp index c09c0a8e62..8f4abae9dd 100644 --- a/Code/Editor/IEditorImpl.cpp +++ b/Code/Editor/IEditorImpl.cpp @@ -26,6 +26,7 @@ AZ_POP_DISABLE_WARNING #include #include #include +#include // AzFramework #include @@ -66,7 +67,6 @@ AZ_POP_DISABLE_WARNING #include "EditorFileMonitor.h" #include "MainStatusBar.h" -#include "ResourceSelectorHost.h" #include "Util/FileUtil_impl.h" #include "Util/ImageUtil_impl.h" #include "LogFileImpl.h" @@ -186,7 +186,6 @@ CEditorImpl::CEditorImpl() m_pAnimationContext = new CAnimationContext; m_pImageUtil = new CImageUtil_impl(); - m_pResourceSelectorHost.reset(CreateResourceSelectorHost()); m_selectedRegion.min = Vec3(0, 0, 0); m_selectedRegion.max = Vec3(0, 0, 0); DetectVersion(); @@ -251,7 +250,7 @@ void CEditorImpl::Uninitialize() void CEditorImpl::UnloadPlugins() { - CryAutoLock lock(m_pluginMutex); + AZStd::scoped_lock lock(m_pluginMutex); // Flush core buses. We're about to unload DLLs and need to ensure we don't have module-owned functions left behind. AZ::Data::AssetBus::ExecuteQueuedEvents(); @@ -272,7 +271,7 @@ void CEditorImpl::UnloadPlugins() void CEditorImpl::LoadPlugins() { - CryAutoLock lock(m_pluginMutex); + AZStd::scoped_lock lock(m_pluginMutex); static const QString editor_plugins_folder("EditorPlugins"); @@ -406,8 +405,6 @@ void CEditorImpl::Update() // Make sure this is not called recursively m_bUpdates = false; - FUNCTION_PROFILER(GetSystem(), PROFILE_EDITOR); - //@FIXME: Restore this latter. //if (GetGameEngine() && GetGameEngine()->IsLevelLoaded()) { @@ -415,7 +412,7 @@ void CEditorImpl::Update() } if (IsInPreviewMode()) { - SetModifiedFlag(FALSE); + SetModifiedFlag(false); SetModifiedModule(eModifiedNothing); } @@ -550,7 +547,7 @@ QString CEditorImpl::GetResolvedUserFolder() void CEditorImpl::SetDataModified() { - GetDocument()->SetModifiedFlag(TRUE); + GetDocument()->SetModifiedFlag(true); } void CEditorImpl::SetStatusText(const QString& pszString) @@ -597,9 +594,9 @@ ITransformManipulator* CEditorImpl::ShowTransformManipulator(bool bShow) GetObjectManager()->GetGizmoManager()->RemoveGizmo(m_pAxisGizmo); m_pAxisGizmo->Release(); } - m_pAxisGizmo = 0; + m_pAxisGizmo = nullptr; } - return 0; + return nullptr; } ITransformManipulator* CEditorImpl::GetTransformManipulator() @@ -614,7 +611,7 @@ void CEditorImpl::SetAxisConstraints(AxisConstrains axisFlags) SetTerrainAxisIgnoreObjects(false); // Update all views. - UpdateViews(eUpdateObjects, NULL); + UpdateViews(eUpdateObjects, nullptr); } AxisConstrains CEditorImpl::GetAxisConstrains() @@ -637,15 +634,15 @@ void CEditorImpl::SetReferenceCoordSys(RefCoordSys refCoords) m_refCoordsSys = refCoords; // Update all views. - UpdateViews(eUpdateObjects, NULL); + UpdateViews(eUpdateObjects, nullptr); // Update the construction plane infos. CViewport* pViewport = GetActiveView(); if (pViewport) { //Pre and Post widget rendering calls are made here to make sure that the proper camera state is set. - //MakeConstructionPlane will make a call to ViewToWorldRay which needs the correct camera state - //in the CRenderViewport to be set. + //MakeConstructionPlane will make a call to ViewToWorldRay which needs the correct camera state + //in the CRenderViewport to be set. pViewport->PreWidgetRendering(); pViewport->MakeConstructionPlane(GetIEditor()->GetAxisConstrains()); @@ -671,7 +668,7 @@ CBaseObject* CEditorImpl::NewObject(const char* typeName, const char* fileName, editor->SetModifiedFlag(); editor->SetModifiedModule(eModifiedBrushes); } - CBaseObject* object = editor->GetObjectManager()->NewObject(typeName, 0, fileName, name); + CBaseObject* object = editor->GetObjectManager()->NewObject(typeName, nullptr, fileName, name); if (!object) { return nullptr; @@ -932,7 +929,7 @@ void CEditorImpl::CloseView(const GUID& classId) IDataBaseManager* CEditorImpl::GetDBItemManager([[maybe_unused]] EDataBaseItemType itemType) { - return 0; + return nullptr; } bool CEditorImpl::SelectColor(QColor& color, QWidget* parent) @@ -1107,16 +1104,18 @@ void CEditorImpl::DetectVersion() DWORD dwHandle; UINT len; - char ver[1024 * 8]; + wchar_t ver[1024 * 8]; - GetModuleFileName(NULL, exe, _MAX_PATH); + AZ::Utils::GetExecutablePath(exe, _MAX_PATH); + AZStd::wstring exeW; + AZStd::to_wstring(exeW, exe); - int verSize = GetFileVersionInfoSize(exe, &dwHandle); + int verSize = GetFileVersionInfoSizeW(exeW.c_str(), &dwHandle); if (verSize > 0) { - GetFileVersionInfo(exe, dwHandle, 1024 * 8, ver); + GetFileVersionInfoW(exeW.c_str(), dwHandle, 1024 * 8, ver); VS_FIXEDFILEINFO* vinfo; - VerQueryValue(ver, "\\", (void**)&vinfo, &len); + VerQueryValueW(ver, L"\\", (void**)&vinfo, &len); m_fileVersion.v[0] = vinfo->dwFileVersionLS & 0xFFFF; m_fileVersion.v[1] = vinfo->dwFileVersionLS >> 16; @@ -1431,7 +1430,7 @@ void CEditorImpl::NotifyExcept(EEditorNotifyEvent event, IEditorNotifyListener* { m_pAxisGizmo->Release(); } - m_pAxisGizmo = 0; + m_pAxisGizmo = nullptr; } if (event == eNotify_OnInit) @@ -1457,7 +1456,7 @@ void CEditorImpl::UnregisterNotifyListener(IEditorNotifyListener* listener) ISourceControl* CEditorImpl::GetSourceControl() { - CryAutoLock lock(m_pluginMutex); + AZStd::scoped_lock lock(m_pluginMutex); if (m_pSourceControl) { @@ -1472,7 +1471,7 @@ ISourceControl* CEditorImpl::GetSourceControl() for (int i = 0; i < classes.size(); i++) { IClassDesc* pClass = classes[i]; - ISourceControl* pSCM = NULL; + ISourceControl* pSCM = nullptr; HRESULT hRes = pClass->QueryInterface(__uuidof(ISourceControl), (void**)&pSCM); if (!FAILED(hRes) && pSCM) { @@ -1482,7 +1481,7 @@ ISourceControl* CEditorImpl::GetSourceControl() } } - return 0; + return nullptr; } bool CEditorImpl::IsSourceControlAvailable() @@ -1557,31 +1556,31 @@ IExportManager* CEditorImpl::GetExportManager() void CEditorImpl::AddUIEnums() { // Spec settings for shadow casting lights - string SpecString[4]; + AZStd::string SpecString[4]; QStringList types; types.push_back("Never=0"); - SpecString[0].Format("VeryHigh Spec=%d", CONFIG_VERYHIGH_SPEC); + SpecString[0] = AZStd::string::format("VeryHigh Spec=%d", CONFIG_VERYHIGH_SPEC); types.push_back(SpecString[0].c_str()); - SpecString[1].Format("High Spec=%d", CONFIG_HIGH_SPEC); + SpecString[1] = AZStd::string::format("High Spec=%d", CONFIG_HIGH_SPEC); types.push_back(SpecString[1].c_str()); - SpecString[2].Format("Medium Spec=%d", CONFIG_MEDIUM_SPEC); + SpecString[2] = AZStd::string::format("Medium Spec=%d", CONFIG_MEDIUM_SPEC); types.push_back(SpecString[2].c_str()); - SpecString[3].Format("Low Spec=%d", CONFIG_LOW_SPEC); + SpecString[3] = AZStd::string::format("Low Spec=%d", CONFIG_LOW_SPEC); types.push_back(SpecString[3].c_str()); m_pUIEnumsDatabase->SetEnumStrings("CastShadows", types); // Power-of-two percentages - string percentStringPOT[5]; + AZStd::string percentStringPOT[5]; types.clear(); - percentStringPOT[0].Format("Default=%d", 0); + percentStringPOT[0] = AZStd::string::format("Default=%d", 0); types.push_back(percentStringPOT[0].c_str()); - percentStringPOT[1].Format("12.5=%d", 1); + percentStringPOT[1] = AZStd::string::format("12.5=%d", 1); types.push_back(percentStringPOT[1].c_str()); - percentStringPOT[2].Format("25=%d", 2); + percentStringPOT[2] = AZStd::string::format("25=%d", 2); types.push_back(percentStringPOT[2].c_str()); - percentStringPOT[3].Format("50=%d", 3); + percentStringPOT[3] = AZStd::string::format("50=%d", 3); types.push_back(percentStringPOT[3].c_str()); - percentStringPOT[4].Format("100=%d", 4); + percentStringPOT[4] = AZStd::string::format("100=%d", 4); types.push_back(percentStringPOT[4].c_str()); m_pUIEnumsDatabase->SetEnumStrings("ShadowMinResPercent", types); } diff --git a/Code/Editor/IEditorImpl.h b/Code/Editor/IEditorImpl.h index 65389a212e..2cf6c7805b 100644 --- a/Code/Editor/IEditorImpl.h +++ b/Code/Editor/IEditorImpl.h @@ -22,7 +22,7 @@ #include #include -#include "Commands/CommandManager.h" +#include "Commands/CommandManager.h" #include "Include/IErrorReport.h" #include "ErrorReport.h" @@ -63,7 +63,7 @@ namespace AssetDatabase class AssetDatabaseLocationListener; } -class CEditorImpl +class CEditorImpl : public IEditor { Q_DECLARE_TR_FUNCTIONS(CEditorImpl) @@ -176,7 +176,7 @@ public: { return m_pSystem->GetIMovieSystem(); } - return NULL; + return nullptr; }; CPluginManager* GetPluginManager() { return m_pPluginManager; } @@ -210,7 +210,7 @@ public: RefCoordSys GetReferenceCoordSys(); XmlNodeRef FindTemplate(const QString& templateName); void AddTemplate(const QString& templateName, XmlNodeRef& tmpl); - + const QtViewPane* OpenView(QString sViewClassName, bool reuseOpened = true) override; /** @@ -290,7 +290,6 @@ public: ESystemConfigPlatform GetEditorConfigPlatform() const; void ReloadTemplates(); void AddErrorMessage(const QString& text, const QString& caption); - IResourceSelectorHost* GetResourceSelectorHost() { return m_pResourceSelectorHost.get(); } virtual void ShowStatusText(bool bEnable); void OnObjectContextMenuOpened(QMenu* pMenu, const CBaseObject* pObject); @@ -374,7 +373,6 @@ protected: //! Export manager for exporting objects and a terrain from the game to DCC tools CExportManager* m_pExportManager; std::unique_ptr m_pEditorFileMonitor; - std::unique_ptr m_pResourceSelectorHost; QString m_selectFileBuffer; QString m_levelNameBuffer; @@ -401,7 +399,7 @@ protected: IImageUtil* m_pImageUtil; // Vladimir@conffx ILogFile* m_pLogFile; // Vladimir@conffx - CryMutex m_pluginMutex; // protect any pointers that come from plugins, such as the source control cached pointer. + AZStd::mutex m_pluginMutex; // protect any pointers that come from plugins, such as the source control cached pointer. static const char* m_crashLogFileName; }; diff --git a/Code/Editor/IEditorPanelUtils.h b/Code/Editor/IEditorPanelUtils.h index 5df15bd86b..4649213ae7 100644 --- a/Code/Editor/IEditorPanelUtils.h +++ b/Code/Editor/IEditorPanelUtils.h @@ -65,7 +65,7 @@ struct HotKey int size = (m_catSize < o_catSize) ? m_catSize : o_catSize; //sort categories to keep them together - for (unsigned int i = 0; i < size; i++) + for (int i = 0; i < size; i++) { if (m_categories[i] < o_categories[i]) { diff --git a/Code/Editor/IconManager.cpp b/Code/Editor/IconManager.cpp index 7f6f7cd0ab..7732ae8155 100644 --- a/Code/Editor/IconManager.cpp +++ b/Code/Editor/IconManager.cpp @@ -27,19 +27,6 @@ namespace { - // Object names in this array must correspond to EObject enumeration. - const char* g_ObjectNames[eStatObject_COUNT] = - { - "Objects/Arrow.cgf", - "Objects/Axis.cgf", - "Objects/Sphere.cgf", - "Objects/Anchor.cgf", - "Objects/entrypoint.cgf", - "Objects/hidepoint.cgf", - "Objects/hidepoint_sec.cgf", - "Objects/reinforcement_point.cgf", - }; - const char* g_IconNames[eIcon_COUNT] = { "Icons/ScaleWarning.png", @@ -81,7 +68,7 @@ void CIconManager::Reset() { m_objects[i]->Release(); } - m_objects[i] = 0; + m_objects[i] = nullptr; } for (i = 0; i < eIcon_COUNT; i++) { @@ -135,7 +122,7 @@ IStatObj* CIconManager::GetObject(EStatObject) ////////////////////////////////////////////////////////////////////////// QImage* CIconManager::GetIconBitmap(const char* filename, bool& bHaveAlpha, uint32 effects /*=0*/) { - QImage* pBitmap = 0; + QImage* pBitmap = nullptr; QString iconFilename = filename; @@ -160,11 +147,11 @@ QImage* CIconManager::GetIconBitmap(const char* filename, bool& bHaveAlpha, uint return pBitmap; } - BOOL bAlphaBitmap = FALSE; + bool bAlphaBitmap = false; QPixmap pm(iconFilename); bAlphaBitmap = pm.hasAlpha(); - bHaveAlpha = (bAlphaBitmap == TRUE); + bHaveAlpha = (bAlphaBitmap == true); if (!pm.isNull()) { pBitmap = new QImage; @@ -252,5 +239,5 @@ QImage* CIconManager::GetIconBitmap(const char* filename, bool& bHaveAlpha, uint return pBitmap; } - return NULL; + return nullptr; } diff --git a/Code/Editor/IconManager.h b/Code/Editor/IconManager.h index d6684f4cc3..7183f036ed 100644 --- a/Code/Editor/IconManager.h +++ b/Code/Editor/IconManager.h @@ -15,9 +15,6 @@ #pragma once -struct IStatObj; -struct IMaterial; - #include "Include/IIconManager.h" // for IIconManager #include "IEditor.h" // for IDocListener diff --git a/Code/Editor/Include/Command.h b/Code/Editor/Include/Command.h index 69853ddb4f..dfdcec78ef 100644 --- a/Code/Editor/Include/Command.h +++ b/Code/Editor/Include/Command.h @@ -8,29 +8,39 @@ // Description : Classes to deal with commands - - -#ifndef CRYINCLUDE_EDITOR_INCLUDE_COMMAND_H -#define CRYINCLUDE_EDITOR_INCLUDE_COMMAND_H #pragma once #include - +#include +#include +#include #include "Util/EditorUtils.h" -inline string ToString(const QString& s) +inline AZStd::string ToString(const QString& s) { return s.toUtf8().data(); } + class CCommand { + static inline bool FromString(int32 &val, const char* s) { + if(!s) + { + return false; + } + val = (int)strtol(s, nullptr, 10); + if(val==0 && errno!=0) { + return false; + } + return true; + } public: CCommand( - const string& module, - const string& name, - const string& description, - const string& example) + const AZStd::string& module, + const AZStd::string& name, + const AZStd::string& description, + const AZStd::string& example) : m_module(module) , m_name(name) , m_description(description) @@ -77,22 +87,22 @@ public: return false; } } - int GetArgCount() const + size_t GetArgCount() const { return m_args.size(); } - const string& GetArg(int i) const + const AZStd::string& GetArg(int i) const { assert(0 <= i && i < GetArgCount()); return m_args[i]; } private: - DynArray m_args; + AZStd::vector m_args; unsigned char m_stringFlags; // This is needed to quote string parameters when logging a command. }; - const string& GetName() const { return m_name; } - const string& GetModule() const { return m_module; } - const string& GetDescription() const { return m_description; } - const string& GetExample() const { return m_example; } + const AZStd::string& GetName() const { return m_name; } + const AZStd::string& GetModule() const { return m_module; } + const AZStd::string& GetDescription() const { return m_description; } + const AZStd::string& GetExample() const { return m_example; } void SetAvailableInScripting() { m_bAlsoAvailableInScripting = true; }; bool IsAvailableInScripting() const { return m_bAlsoAvailableInScripting; } @@ -104,18 +114,18 @@ public: protected: friend class CEditorCommandManager; - string m_module; - string m_name; - string m_description; - string m_example; + AZStd::string m_module; + AZStd::string m_name; + AZStd::string m_description; + AZStd::string m_example; bool m_bAlsoAvailableInScripting; template - static string ToString_(T t) { return ::ToString(t); } - static inline string ToString_(const char* val) + static AZStd::string ToString_(T t) { return ::ToString(t); } + static inline AZStd::string ToString_(const char* val) { return val; } template - static bool FromString_(T& t, const char* s) { return ::FromString(t, s); } + static bool FromString_(T& t, const char* s) { return FromString(t, s); } static inline bool FromString_(const char*& val, const char* s) { return (val = s) != 0; } @@ -137,8 +147,8 @@ class CCommand0 : public CCommand { public: - CCommand0(const string& module, const string& name, - const string& description, const string& example, + CCommand0(const AZStd::string& module, const AZStd::string& name, + const AZStd::string& description, const AZStd::string& example, const AZStd::function& functor) : CCommand(module, name, description, example) , m_functor(functor) {} @@ -146,10 +156,10 @@ public: // UI metadata for this command, if any struct SUIInfo { - string caption; - string tooltip; - string description; - string iconFilename; + AZStd::string caption; + AZStd::string tooltip; + AZStd::string description; + AZStd::string iconFilename; int iconIndex; int commandId; // Windows command id @@ -179,8 +189,8 @@ class CCommand0wRet : public CCommand { public: - CCommand0wRet(const string& module, const string& name, - const string& description, const string& example, + CCommand0wRet(const AZStd::string& module, const AZStd::string& name, + const AZStd::string& description, const AZStd::string& example, const AZStd::function& functor); QString Execute(const CArgs& args); @@ -195,8 +205,8 @@ class CCommand1 : public CCommand { public: - CCommand1(const string& module, const string& name, - const string& description, const string& example, + CCommand1(const AZStd::string& module, const AZStd::string& name, + const AZStd::string& description, const AZStd::string& example, const AZStd::function& functor); QString Execute(const CArgs& args); @@ -211,8 +221,8 @@ class CCommand1wRet : public CCommand { public: - CCommand1wRet(const string& module, const string& name, - const string& description, const string& example, + CCommand1wRet(const AZStd::string& module, const AZStd::string& name, + const AZStd::string& description, const AZStd::string& example, const AZStd::function& functor); QString Execute(const CArgs& args); @@ -227,8 +237,8 @@ class CCommand2 : public CCommand { public: - CCommand2(const string& module, const string& name, - const string& description, const string& example, + CCommand2(const AZStd::string& module, const AZStd::string& name, + const AZStd::string& description, const AZStd::string& example, const AZStd::function& functor); QString Execute(const CArgs& args); @@ -243,8 +253,8 @@ class CCommand2wRet : public CCommand { public: - CCommand2wRet(const string& module, const string& name, - const string& description, const string& example, + CCommand2wRet(const AZStd::string& module, const AZStd::string& name, + const AZStd::string& description, const AZStd::string& example, const AZStd::function& functor); QString Execute(const CArgs& args); @@ -259,8 +269,8 @@ class CCommand3 : public CCommand { public: - CCommand3(const string& module, const string& name, - const string& description, const string& example, + CCommand3(const AZStd::string& module, const AZStd::string& name, + const AZStd::string& description, const AZStd::string& example, const AZStd::function& functor); QString Execute(const CArgs& args); @@ -275,8 +285,8 @@ class CCommand3wRet : public CCommand { public: - CCommand3wRet(const string& module, const string& name, - const string& description, const string& example, + CCommand3wRet(const AZStd::string& module, const AZStd::string& name, + const AZStd::string& description, const AZStd::string& example, const AZStd::function& functor); QString Execute(const CArgs& args); @@ -291,8 +301,8 @@ class CCommand4 : public CCommand { public: - CCommand4(const string& module, const string& name, - const string& description, const string& example, + CCommand4(const AZStd::string& module, const AZStd::string& name, + const AZStd::string& description, const AZStd::string& example, const AZStd::function& functor); QString Execute(const CArgs& args); @@ -307,8 +317,8 @@ class CCommand4wRet : public CCommand { public: - CCommand4wRet(const string& module, const string& name, - const string& description, const string& example, + CCommand4wRet(const AZStd::string& module, const AZStd::string& name, + const AZStd::string& description, const AZStd::string& example, const AZStd::function& functor); QString Execute(const CArgs& args); @@ -323,8 +333,8 @@ class CCommand5 : public CCommand { public: - CCommand5(const string& module, const string& name, - const string& description, const string& example, + CCommand5(const AZStd::string& module, const AZStd::string& name, + const AZStd::string& description, const AZStd::string& example, const AZStd::function& functor); QString Execute(const CArgs& args); @@ -339,8 +349,8 @@ class CCommand6 : public CCommand { public: - CCommand6(const string& module, const string& name, - const string& description, const string& example, + CCommand6(const AZStd::string& module, const AZStd::string& name, + const AZStd::string& description, const AZStd::string& example, const AZStd::function& functor); QString Execute(const CArgs& args); @@ -353,8 +363,8 @@ protected: ////////////////////////////////////////////////////////////////////////// template -CCommand0wRet::CCommand0wRet(const string& module, const string& name, - const string& description, const string& example, +CCommand0wRet::CCommand0wRet(const AZStd::string& module, const AZStd::string& name, + const AZStd::string& description, const AZStd::string& example, const AZStd::function& functor) : CCommand(module, name, description, example) , m_functor(functor) @@ -373,8 +383,8 @@ QString CCommand0wRet::Execute(const CCommand::CArgs& args) ////////////////////////////////////////////////////////////////////////// template -CCommand1::CCommand1(const string& module, const string& name, - const string& description, const string& example, +CCommand1::CCommand1(const AZStd::string& module, const AZStd::string& name, + const AZStd::string& description, const AZStd::string& example, const AZStd::function& functor) : CCommand(module, name, description, example) , m_functor(functor) @@ -410,8 +420,8 @@ QString CCommand1::Execute(const CCommand::CArgs& args) ////////////////////////////////////////////////////////////////////////// template -CCommand1wRet::CCommand1wRet(const string& module, const string& name, - const string& description, const string& example, +CCommand1wRet::CCommand1wRet(const AZStd::string& module, const AZStd::string& name, + const AZStd::string& description, const AZStd::string& example, const AZStd::function& functor) : CCommand(module, name, description, example) , m_functor(functor) @@ -448,8 +458,8 @@ QString CCommand1wRet::Execute(const CCommand::CArgs& args) ////////////////////////////////////////////////////////////////////////// template -CCommand2::CCommand2(const string& module, const string& name, - const string& description, const string& example, +CCommand2::CCommand2(const AZStd::string& module, const AZStd::string& name, + const AZStd::string& description, const AZStd::string& example, const AZStd::function& functor) : CCommand(module, name, description, example) , m_functor(functor) @@ -487,8 +497,8 @@ QString CCommand2::Execute(const CCommand::CArgs& args) ////////////////////////////////////////////////////////////////////////// template -CCommand2wRet::CCommand2wRet(const string& module, const string& name, - const string& description, const string& example, +CCommand2wRet::CCommand2wRet(const AZStd::string& module, const AZStd::string& name, + const AZStd::string& description, const AZStd::string& example, const AZStd::function& functor) : CCommand(module, name, description, example) , m_functor(functor) @@ -527,8 +537,8 @@ QString CCommand2wRet::Execute(const CCommand::CArgs& args) ////////////////////////////////////////////////////////////////////////// template -CCommand3::CCommand3(const string& module, const string& name, - const string& description, const string& example, +CCommand3::CCommand3(const AZStd::string& module, const AZStd::string& name, + const AZStd::string& description, const AZStd::string& example, const AZStd::function& functor) : CCommand(module, name, description, example) , m_functor(functor) @@ -568,8 +578,8 @@ QString CCommand3::Execute(const CCommand::CArgs& args) ////////////////////////////////////////////////////////////////////////// template -CCommand3wRet::CCommand3wRet(const string& module, const string& name, - const string& description, const string& example, +CCommand3wRet::CCommand3wRet(const AZStd::string& module, const AZStd::string& name, + const AZStd::string& description, const AZStd::string& example, const AZStd::function& functor) : CCommand(module, name, description, example) , m_functor(functor) @@ -610,8 +620,8 @@ QString CCommand3wRet::Execute(const CCommand::CArgs& args) ////////////////////////////////////////////////////////////////////////// template -CCommand4::CCommand4(const string& module, const string& name, - const string& description, const string& example, +CCommand4::CCommand4(const AZStd::string& module, const AZStd::string& name, + const AZStd::string& description, const AZStd::string& example, const AZStd::function& functor) : CCommand(module, name, description, example) , m_functor(functor) @@ -654,8 +664,8 @@ QString CCommand4::Execute(const CCommand::CArgs& args) ////////////////////////////////////////////////////////////////////////// template -CCommand4wRet::CCommand4wRet(const string& module, const string& name, - const string& description, const string& example, +CCommand4wRet::CCommand4wRet(const AZStd::string& module, const AZStd::string& name, + const AZStd::string& description, const AZStd::string& example, const AZStd::function& functor) : CCommand(module, name, description, example) , m_functor(functor) @@ -699,8 +709,8 @@ QString CCommand4wRet::Execute(const CCommand::CArgs& args) ////////////////////////////////////////////////////////////////////////// template -CCommand5::CCommand5(const string& module, const string& name, - const string& description, const string& example, +CCommand5::CCommand5(const AZStd::string& module, const AZStd::string& name, + const AZStd::string& description, const AZStd::string& example, const AZStd::function& functor) : CCommand(module, name, description, example) , m_functor(functor) @@ -745,8 +755,8 @@ QString CCommand5::Execute(const CCommand::CArgs& args) ////////////////////////////////////////////////////////////////////////// template -CCommand6::CCommand6(const string& module, const string& name, - const string& description, const string& example, +CCommand6::CCommand6(const AZStd::string& module, const AZStd::string& name, + const AZStd::string& description, const AZStd::string& example, const AZStd::function& functor) : CCommand(module, name, description, example) , m_functor(functor) @@ -789,4 +799,3 @@ QString CCommand6::Execute(const CCommand::CArgs& args) } return ""; } -#endif // CRYINCLUDE_EDITOR_INCLUDE_COMMAND_H diff --git a/Code/Editor/Include/IEditorMaterial.h b/Code/Editor/Include/IEditorMaterial.h index a117020d19..487246eb60 100644 --- a/Code/Editor/Include/IEditorMaterial.h +++ b/Code/Editor/Include/IEditorMaterial.h @@ -6,8 +6,6 @@ * */ #pragma once -#ifndef CRYINCLUDE_EDITOR_INCLUDE_IEDITORMATERIAL_H -#define CRYINCLUDE_EDITOR_INCLUDE_IEDITORMATERIAL_H #include "BaseLibraryItem.h" @@ -20,5 +18,3 @@ struct IEditorMaterial virtual _smart_ptr GetMatInfo(bool bUseExistingEngineMaterial = false) = 0; virtual void DisableHighlightForFrame() = 0; }; - -#endif diff --git a/Code/Editor/Include/IFileUtil.h b/Code/Editor/Include/IFileUtil.h index f83c7e0d59..e179f892d9 100644 --- a/Code/Editor/Include/IFileUtil.h +++ b/Code/Editor/Include/IFileUtil.h @@ -8,8 +8,9 @@ #pragma once -#include "StringUtils.h" #include "../Include/SandboxAPI.h" +#include +#include class QWidget; @@ -103,7 +104,7 @@ struct IFileUtil } }; - typedef DynArray FileArray; + using FileArray = AZStd::vector; typedef bool (* ScanDirectoryUpdateCallBack)(const QString& msg); diff --git a/Code/Editor/Include/IObjectManager.h b/Code/Editor/Include/IObjectManager.h index ce9d69681b..fb99a50bb0 100644 --- a/Code/Editor/Include/IObjectManager.h +++ b/Code/Editor/Include/IObjectManager.h @@ -12,8 +12,10 @@ #pragma once #include +#include #include #include +#include // forward declarations. class CEntityObject; @@ -87,7 +89,7 @@ public: //! Get array of objects, managed by manager (not contain sub objects of groups). //! @param layer if 0 get objects for all layers, or layer to get objects from. virtual void GetObjects(CBaseObjectsArray& objects) const = 0; - virtual void GetObjects(DynArray& objects) const = 0; + //virtual void GetObjects(DynArray& objects) const = 0; //! Get array of objects that pass the filter. //! @param filter The filter functor, return true if you want to get the certain obj, return false if want to skip it. diff --git a/Code/Editor/Include/IResourceSelectorHost.h b/Code/Editor/Include/IResourceSelectorHost.h deleted file mode 100644 index 55ce4e15d3..0000000000 --- a/Code/Editor/Include/IResourceSelectorHost.h +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#pragma once -// The aim of IResourceSelectorHost is to unify resource selection dialogs in a one -// API that can be reused with plugins. It also makes possible to register new -// resource selectors dynamically, e.g. inside plugins. -// -// Here is how new selectors are created. In your implementation file you add handler function: -// -// #include "IResourceSelectorHost.h" -// -// QString SoundFileSelector(const SResourceSelectorContext& x, const QString& previousValue) -// { -// CMyModalDialog dialog(CWnd::FromHandle(x.parentWindow)); -// ... -// return previousValue; -// } -// REGISTER_RESOURCE_SELECTOR("Sound", SoundFileSelector, "Icons/sound_16x16.png") -// -// Here is how it can be invoked directly: -// -// SResourceSelectorContext x; -// x.parentWindow = parent.GetSafeHwnd(); -// x.typeName = "Sound"; -// string newValue = GetIEditor()->GetResourceSelector()->SelectResource(x, previousValue).c_str(); -// -// If you have your own resource selectors in the plugin you will need to run -// -// RegisterModuleResourceSelectors(GetIEditor()->GetResourceSelector()) -// -// during plugin initialization. -// -// If you want to be able to pass some custom context to the selector (e.g. source of the information for the -// list of items or something similar) then you can add a poitner argument to your selector function, i.e.: -// -// QString SoundFileSelector(const SResourceSelectorContext& x, const QString& previousValue, -// SoundFileList* list) // your context argument - -#include - -class QWidget; - -struct SResourceSelectorContext -{ - const char* typeName; - - // use either parentWidget or parentWindow (not both) until everything porting to QWidget. - QWidget* parentWidget; - - unsigned int entityId; - void* contextObject; - - SResourceSelectorContext() - : parentWidget(0) - , typeName(0) - , entityId(0) - , contextObject() - { - } -}; - -// TResourceSelecitonFunction is used to declare handlers for specific types. -// -// For canceled dialogs previousValue should be returned. -typedef QString (* TResourceSelectionFunction)(const SResourceSelectorContext& selectorContext, const QString& previousValue); -typedef QString (* TResourceSelectionFunctionWithContext)(const SResourceSelectorContext& selectorContext, const QString& previousValue, void* contextObject); - -struct SStaticResourceSelectorEntry; - -// See note at the beginning of the file. -struct IResourceSelectorHost -{ - virtual ~IResourceSelectorHost() = default; - virtual QString SelectResource(const SResourceSelectorContext& context, const QString& previousValue) = 0; - virtual const char* ResourceIconPath(const char* typeName) const = 0; - - virtual void RegisterResourceSelector(const SStaticResourceSelectorEntry* entry) = 0; - - // secondary responsibility of this class is to store global selections - virtual void SetGlobalSelection(const char* resourceType, const char* value) = 0; - virtual const char* GetGlobalSelection(const char* resourceType) const = 0; -}; - -// --------------------------------------------------------------------------- -#define INTERNAL_RSH_COMBINE_UTIL(A, B) A##B -#define INTERNAL_RSH_COMBINE(A, B) INTERNAL_RSH_COMBINE_UTIL(A, B) -#define REGISTER_RESOURCE_SELECTOR(name, function, icon) \ - static SStaticResourceSelectorEntry INTERNAL_RSH_COMBINE(selector_##function, __LINE__)((name), (function), (icon)); - -struct SStaticResourceSelectorEntry -{ - const char* typeName; - TResourceSelectionFunction function; - TResourceSelectionFunctionWithContext functionWithContext; - const char* iconPath; - - static SStaticResourceSelectorEntry*& GetFirst() { static SStaticResourceSelectorEntry* first; return first; } - SStaticResourceSelectorEntry* next; - - SStaticResourceSelectorEntry(const char* typeName, TResourceSelectionFunction function, const char* icon) - : typeName(typeName) - , function(function) - , functionWithContext() - , iconPath(icon) - { - next = GetFirst(); - GetFirst() = this; - } - - template - SStaticResourceSelectorEntry(const char* typeName, QString (*function)(const SResourceSelectorContext&, const QString& previousValue, T * context), const char* icon) - : typeName(typeName) - , function() - , functionWithContext(TResourceSelectionFunctionWithContext(function)) - , iconPath(icon) - { - next = GetFirst(); - GetFirst() = this; - } -}; - -inline void RegisterModuleResourceSelectors(IResourceSelectorHost* editorResourceSelector) -{ - for (SStaticResourceSelectorEntry* current = SStaticResourceSelectorEntry::GetFirst(); current != 0; current = current->next) - { - editorResourceSelector->RegisterResourceSelector(current); - } -} diff --git a/Code/Editor/Include/ISubObjectSelectionReferenceFrameCalculator.h b/Code/Editor/Include/ISubObjectSelectionReferenceFrameCalculator.h deleted file mode 100644 index ff82b57de1..0000000000 --- a/Code/Editor/Include/ISubObjectSelectionReferenceFrameCalculator.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -// Description : Calculate the reference frame for sub-object selections. - - -#ifndef CRYINCLUDE_EDITOR_INCLUDE_ISUBOBJECTSELECTIONREFERENCEFRAMECALCULATOR_H -#define CRYINCLUDE_EDITOR_INCLUDE_ISUBOBJECTSELECTIONREFERENCEFRAMECALCULATOR_H -#pragma once - - -class ISubObjectSelectionReferenceFrameCalculator -{ -public: - virtual void SetExplicitFrame(bool bAnySelected, const Matrix34& refFrame) = 0; -}; - -#endif // CRYINCLUDE_EDITOR_INCLUDE_ISUBOBJECTSELECTIONREFERENCEFRAMECALCULATOR_H diff --git a/Code/Editor/LayoutConfigDialog.cpp b/Code/Editor/LayoutConfigDialog.cpp index 6722a7d9d7..1074ebc23e 100644 --- a/Code/Editor/LayoutConfigDialog.cpp +++ b/Code/Editor/LayoutConfigDialog.cpp @@ -68,7 +68,7 @@ QVariant LayoutConfigModel::data(const QModelIndex& index, int role) const // CLayoutConfigDialog dialog -CLayoutConfigDialog::CLayoutConfigDialog(QWidget* pParent /*=NULL*/) +CLayoutConfigDialog::CLayoutConfigDialog(QWidget* pParent /*=nullptr*/) : QDialog(pParent) , m_model(new LayoutConfigModel(this)) , ui(new Ui::CLayoutConfigDialog) diff --git a/Code/Editor/LayoutWnd.cpp b/Code/Editor/LayoutWnd.cpp index a3550b39ba..aa2a008844 100644 --- a/Code/Editor/LayoutWnd.cpp +++ b/Code/Editor/LayoutWnd.cpp @@ -98,7 +98,7 @@ CLayoutWnd::CLayoutWnd(QSettings* settings, QWidget* parent) , m_settings(settings) { m_bMaximized = false; - m_maximizedView = 0; + m_maximizedView = nullptr; m_layout = (EViewLayout) - 1; m_maximizedViewId = 0; @@ -183,7 +183,6 @@ void CLayoutWnd::MaximizeViewport(int paneId) QString viewClass = m_viewType[paneId]; - const QRect rc = rect(); if (!m_bMaximized) { CLayoutViewPane* pViewPane = GetViewPane(paneId); @@ -729,7 +728,7 @@ void CLayoutWnd::OnDestroy() if (m_maximizedView) { delete m_maximizedView; - m_maximizedView = 0; + m_maximizedView = nullptr; } } diff --git a/Code/Editor/LegacyViewportCameraController.cpp b/Code/Editor/LegacyViewportCameraController.cpp deleted file mode 100644 index eb7323b423..0000000000 --- a/Code/Editor/LegacyViewportCameraController.cpp +++ /dev/null @@ -1,537 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#include "LegacyViewportCameraController.h" - -#include -#include -#include -#include -#include -#include - -#include -#include -#include "CryCommon/MathConversion.h" -#include "SandboxAPI.h" -#include "Settings.h" - -namespace SandboxEditor -{ - -LegacyViewportCameraControllerInstance::LegacyViewportCameraControllerInstance(AzFramework::ViewportId viewportId, LegacyViewportCameraController* controller) - : AzFramework::MultiViewportControllerInstanceInterface(viewportId, controller) -{ - OrbitCameraControlsBus::Handler::BusConnect(viewportId); -} - -LegacyViewportCameraControllerInstance::~LegacyViewportCameraControllerInstance() -{ - OrbitCameraControlsBus::Handler::BusDisconnect(); -} - -bool LegacyViewportCameraControllerInstance::JustAltHeld() const -{ - return (m_modifiers ^ Qt::AltModifier) == 0; -} - -bool LegacyViewportCameraControllerInstance::NoModifierHeld() const -{ - return !m_modifiers; -} - -bool LegacyViewportCameraControllerInstance::AllowDolly() const -{ - return JustAltHeld(); -} - -bool LegacyViewportCameraControllerInstance::AllowOrbit() const -{ - return JustAltHeld(); -} - -bool LegacyViewportCameraControllerInstance::AllowPan() const -{ - // begin pan with alt (inverted movement) or no modifiers - return JustAltHeld() || NoModifierHeld(); -} - -bool LegacyViewportCameraControllerInstance::InvertPan() const -{ - return JustAltHeld(); -} - -void LegacyViewportCameraControllerInstance::SetOrbitDistance(float orbitDistance) -{ - m_orbitDistance = orbitDistance; -} - - -AZ::RPI::ViewportContextPtr LegacyViewportCameraControllerInstance::GetViewportContext() -{ - // This could be cached, if needed - auto viewportContextManager = AZ::Interface::Get(); - if (!viewportContextManager) - { - return {}; - } - return viewportContextManager->GetViewportContextById(GetViewportId()); -} - -bool LegacyViewportCameraControllerInstance::HandleMouseMove( - int dx, int dy) -{ - if (dx == 0 && dy == 0) - { - return false; - } - - auto viewportContext = GetViewportContext(); - if (!viewportContext) - { - return false; - } - - float speedScale = gSettings.cameraMoveSpeed; - - if (m_modifiers & Qt::Key_Control) - { - speedScale *= gSettings.cameraFastMoveSpeed; - } - - if (m_inMoveMode || m_inOrbitMode || m_inRotateMode || m_inZoomMode) - { - m_totalMouseMoveDelta += AZStd::abs(dx) + AZStd::abs(dy); - } - - if ((m_inRotateMode && m_inMoveMode) || m_inZoomMode) - { - Matrix34 m = AZTransformToLYTransform(viewportContext->GetCameraTransform()); - - Vec3 ydir = m.GetColumn1().GetNormalized(); - Vec3 pos = m.GetTranslation(); - - const float posDelta = 0.2f * dy * speedScale; - pos = pos - ydir * posDelta; - m_orbitDistance = m_orbitDistance + posDelta; - m_orbitDistance = fabs(m_orbitDistance); - - m.SetTranslation(pos); - viewportContext->SetCameraTransform(LYTransformToAZTransform(m)); - return true; - } - else if (m_inRotateMode) - { - Ang3 angles(dy, 0, dx); - angles = angles * 0.002f * gSettings.cameraRotateSpeed; - if (gSettings.invertYRotation) - { - angles.x = -angles.x; - } - Matrix34 camtm = AZTransformToLYTransform(viewportContext->GetCameraTransform()); - Ang3 ypr = CCamera::CreateAnglesYPR(Matrix33(camtm)); - ypr.x += angles.z; - ypr.y += angles.x; - - ypr.y = AZStd::clamp(ypr.y, -1.5f, 1.5f); // to keep rotation in reasonable range - ypr.z = 0; // to have camera always upward - - camtm = Matrix34(CCamera::CreateOrientationYPR(ypr), camtm.GetTranslation()); - viewportContext->SetCameraTransform(LYTransformToAZTransform(camtm)); - return true; - } - else if (m_inMoveMode) - { - // Slide. - Matrix34 m = AZTransformToLYTransform(viewportContext->GetCameraTransform()); - Vec3 xdir = m.GetColumn0().GetNormalized(); - Vec3 zdir = m.GetColumn2().GetNormalized(); - - if (InvertPan()) - { - xdir = -xdir; - zdir = -zdir; - } - - Vec3 pos = m.GetTranslation(); - pos += 0.1f * xdir * dx * speedScale + 0.1f * zdir * dy * speedScale; - m.SetTranslation(pos); - - AZ::Transform transform = viewportContext->GetCameraTransform(); - transform.SetTranslation(LYVec3ToAZVec3(pos)); - viewportContext->SetCameraTransform(transform); - return true; - } - else if (m_inOrbitMode) - { - Ang3 angles(dy, 0, dx); - angles = angles * 0.002f * gSettings.cameraRotateSpeed; - - if (gSettings.invertPan) - { - angles.z = -angles.z; - } - - Matrix34 m = AZTransformToLYTransform(viewportContext->GetCameraTransform()); - Ang3 ypr = CCamera::CreateAnglesYPR(Matrix33(m)); - ypr.x += angles.z; - ypr.y = AZStd::clamp(ypr.y, -1.5f, 1.5f); // to keep rotation in reasonable range - ypr.y += angles.x; - - Matrix33 rotateTM = CCamera::CreateOrientationYPR(ypr); - - Vec3 src = m.GetTranslation(); - Vec3 trg(m_orbitTarget.GetX(), m_orbitTarget.GetY(), m_orbitTarget.GetZ()); - float fCameraRadius = (trg - src).GetLength(); - - // Calc new source. - src = trg - rotateTM * Vec3(0, 1, 0) * fCameraRadius; - Matrix34 camTM = rotateTM; - camTM.SetTranslation(src); - - viewportContext->SetCameraTransform(LYTransformToAZTransform(camTM)); - return true; - } - return false; -} - -bool LegacyViewportCameraControllerInstance::HandleMouseWheel(float zDelta) -{ - auto viewportContext = GetViewportContext(); - if (!viewportContext) - { - return false; - } - - Matrix34 m = AZTransformToLYTransform(viewportContext->GetCameraTransform()); - const Vec3 ydir = m.GetColumn1().GetNormalized(); - - Vec3 pos = m.GetTranslation(); - - const float posDelta = 0.01f * zDelta * gSettings.wheelZoomSpeed; - pos += ydir * posDelta; - m_orbitDistance = m_orbitDistance - posDelta; - m_orbitDistance = fabs(m_orbitDistance); - - m.SetTranslation(pos); - viewportContext->SetCameraTransform(LYTransformToAZTransform(m)); - return true; -} - -bool LegacyViewportCameraControllerInstance::IsKeyDown(Qt::Key key) const -{ - return m_pressedKeys.contains(key); -} - -Qt::Key LegacyViewportCameraControllerInstance::GetKeyboardKey(const AzFramework::InputChannel& inputChannel) -{ - using Key = AzFramework::InputDeviceKeyboard::Key; - const auto& id = inputChannel.GetInputChannelId(); - if (id == Key::AlphanumericW) - { - return Qt::Key_W; - } - else if (id == Key::AlphanumericA) - { - return Qt::Key_A; - } - else if (id == Key::AlphanumericS) - { - return Qt::Key_S; - } - else if (id == Key::AlphanumericD) - { - return Qt::Key_D; - } - else if (id == Key::AlphanumericQ) - { - return Qt::Key_Q; - } - else if (id == Key::AlphanumericE) - { - return Qt::Key_E; - } - else if (id == Key::NavigationArrowUp) - { - return Qt::Key_Up; - } - else if (id == Key::NavigationArrowUp) - { - return Qt::Key_Down; - } - else if (id == Key::NavigationArrowUp) - { - return Qt::Key_Left; - } - else if (id == Key::NavigationArrowUp) - { - return Qt::Key_Right; - } - return Qt::Key_unknown; -} - -Qt::KeyboardModifier LegacyViewportCameraControllerInstance::GetKeyboardModifier(const AzFramework::InputChannel& inputChannel) -{ - using Key = AzFramework::InputDeviceKeyboard::Key; - const auto& id = inputChannel.GetInputChannelId(); - if (id == Key::ModifierAltL || id == Key::ModifierAltR) - { - return Qt::KeyboardModifier::AltModifier; - } - if (id == Key::ModifierCtrlL || id == Key::ModifierCtrlR) - { - return Qt::KeyboardModifier::ControlModifier; - } - if (id == Key::ModifierShiftL || id == Key::ModifierShiftR) - { - return Qt::KeyboardModifier::ShiftModifier; - } - return Qt::KeyboardModifier::NoModifier; -} - -bool LegacyViewportCameraControllerInstance::HandleInputChannelEvent(const AzFramework::ViewportControllerInputEvent& event) -{ - using AzFramework::InputChannel; - using MouseButton = AzFramework::InputDeviceMouse::Button; - const auto& id = event.m_inputChannel.GetInputChannelId(); - const auto& state = event.m_inputChannel.GetState(); - bool shouldCaptureCursor = m_capturingCursor; - bool shouldConsumeEvent = false; - - if (id == AzFramework::InputDeviceMouse::Movement::X || id == AzFramework::InputDeviceMouse::Movement::Y) - { - int dx = 0; - int dy = 0; - if (id == AzFramework::InputDeviceMouse::Movement::X) - { - dx = -aznumeric_cast(event.m_inputChannel.GetValue()); - } - else - { - dy = -aznumeric_cast(event.m_inputChannel.GetValue()); - } - return HandleMouseMove(dx, dy); - } - else if (id == MouseButton::Left) - { - if (state == InputChannel::State::Began) - { - if (AllowOrbit()) - { - AzFramework::CameraState cameraState; - AzToolsFramework::ViewportInteraction::ViewportInteractionRequestBus::EventResult( - cameraState, event.m_viewportId, - &AzToolsFramework::ViewportInteraction::ViewportInteractionRequestBus::Events::GetCameraState); - - m_inOrbitMode = true; - m_orbitTarget = cameraState.m_position + cameraState.m_forward * m_orbitDistance; - - shouldConsumeEvent = true; - shouldCaptureCursor = true; - } - } - else if (state == InputChannel::State::Ended) - { - m_inOrbitMode = false; - shouldCaptureCursor = false; - } - } - else if (id == MouseButton::Right) - { - if (state == InputChannel::State::Began) - { - if (AllowDolly()) - { - m_inZoomMode = true; - } - else - { - m_inRotateMode = true; - } - - shouldCaptureCursor = true; - // Record how much the cursor has been moved to see if we should own the mouse up event. - m_totalMouseMoveDelta = 0; - } - else if (state == InputChannel::State::Ended) - { - m_inZoomMode = false; - m_inRotateMode = false; - // If we've moved the cursor more than a couple pixels, we should eat this mouse up event to prevent the context menu controller from seeing it. - shouldConsumeEvent = m_totalMouseMoveDelta > 2; - shouldCaptureCursor = false; - } - } - else if (id == MouseButton::Middle) - { - if (state == InputChannel::State::Began) - { - if (AllowPan()) - { - m_inMoveMode = true; - shouldConsumeEvent = true; - shouldCaptureCursor = true; - } - } - else if (state == InputChannel::State::Ended) - { - m_inMoveMode = false; - shouldCaptureCursor = false; - } - } - else if (auto modifier = GetKeyboardModifier(event.m_inputChannel); modifier != Qt::KeyboardModifier::NoModifier) - { - if (state == InputChannel::State::Ended) - { - m_modifiers &= ~modifier; - } - else - { - m_modifiers |= modifier; - } - } - else if (id == AzFramework::InputDeviceMouse::Movement::Z) - { - if (state == InputChannel::State::Began || state == InputChannel::State::Updated) - { - shouldConsumeEvent = HandleMouseWheel(event.m_inputChannel.GetValue()); - } - } - else if (auto key = GetKeyboardKey(event.m_inputChannel); key != Qt::Key_unknown) - { - if (!event.m_inputChannel.IsActive()) - { - m_pressedKeys.erase(key); - } - else - { - m_pressedKeys.insert(key); - shouldConsumeEvent = true; - } - } - - UpdateCursorCapture(shouldCaptureCursor); - - return shouldConsumeEvent; -} - -void LegacyViewportCameraControllerInstance::UpdateCursorCapture(bool shouldCaptureCursor) -{ - if (m_capturingCursor != shouldCaptureCursor) - { - if (shouldCaptureCursor) - { - AzToolsFramework::ViewportInteraction::ViewportMouseCursorRequestBus::Event( - GetViewportId(), - &AzToolsFramework::ViewportInteraction::ViewportMouseCursorRequestBus::Events::BeginCursorCapture - ); - } - else - { - AzToolsFramework::ViewportInteraction::ViewportMouseCursorRequestBus::Event( - GetViewportId(), - &AzToolsFramework::ViewportInteraction::ViewportMouseCursorRequestBus::Events::EndCursorCapture - ); - } - - m_capturingCursor = shouldCaptureCursor; - } -} - -void LegacyViewportCameraControllerInstance::ResetInputChannels() -{ - m_modifiers = 0; - m_pressedKeys.clear(); - UpdateCursorCapture(false); - m_inRotateMode = m_inMoveMode = m_inOrbitMode = m_inZoomMode = false; -} - -void LegacyViewportCameraControllerInstance::UpdateViewport(const AzFramework::ViewportControllerUpdateEvent& event) -{ - auto viewportContext = GetViewportContext(); - if (!viewportContext) - { - return; - } - - AZ::Transform transform = viewportContext->GetCameraTransform(); - AZ::Vector3 xdir = transform.GetBasisX(); - AZ::Vector3 ydir = transform.GetBasisY(); - AZ::Vector3 zdir = transform.GetBasisZ(); - - AZ::Vector3 pos = transform.GetTranslation(); - - float speedScale = AZStd::GetMin(30.0f * event.m_deltaTime.count(), 20.0f); - - // Use the global modifier keys instead of our keymap. It's more reliable. - const bool shiftPressed = m_modifiers & Qt::ShiftModifier; - const bool controlPressed = m_modifiers & Qt::ControlModifier; - - speedScale *= gSettings.cameraMoveSpeed; - if (controlPressed) - { - return; - } - - if (shiftPressed) - { - speedScale *= gSettings.cameraFastMoveSpeed; - } - - bool cameraMoved = false; - - if (IsKeyDown(Qt::Key_Up) || IsKeyDown(Qt::Key_W)) - { - // move forward - cameraMoved = true; - pos = pos + (speedScale * m_moveSpeed * ydir); - } - - if (IsKeyDown(Qt::Key_Down) || IsKeyDown(Qt::Key_S)) - { - // move backward - cameraMoved = true; - pos = pos - (speedScale * m_moveSpeed * ydir); - } - - if (IsKeyDown(Qt::Key_Left) || IsKeyDown(Qt::Key_A)) - { - // move left - cameraMoved = true; - pos = pos - (speedScale * m_moveSpeed * xdir); - } - - if (IsKeyDown(Qt::Key_Right) || IsKeyDown(Qt::Key_D)) - { - // move right - cameraMoved = true; - pos = pos + (speedScale * m_moveSpeed * xdir); - } - - if (IsKeyDown(Qt::Key_E)) - { - // move Up - cameraMoved = true; - pos = pos + (speedScale * m_moveSpeed * zdir); - } - - if (IsKeyDown(Qt::Key_Q)) - { - // move down - cameraMoved = true; - pos = pos - (speedScale * m_moveSpeed * zdir); - } - - if (cameraMoved) - { - transform.SetTranslation(pos); - viewportContext->SetCameraTransform(transform); - } -} - -} //namespace SandboxEditor diff --git a/Code/Editor/LegacyViewportCameraController.h b/Code/Editor/LegacyViewportCameraController.h deleted file mode 100644 index 6edd344f23..0000000000 --- a/Code/Editor/LegacyViewportCameraController.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#pragma once - -#include -#include -#include -#include - -#include - -#include -#include - -namespace AzFramework -{ - struct ScreenPoint; -} - -namespace SandboxEditor -{ - class OrbitCameraControls - : public AZ::EBusTraits - { - public: - ////////////////////////////////////////////////////////////////////////// - // EBusTraits overrides - static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Multiple; - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById; - using BusIdType = AzFramework::ViewportId; - ////////////////////////////////////////////////////////////////////////// - - virtual void SetOrbitDistance(float orbitDistance [[maybe_unused]]) {;} - }; - using OrbitCameraControlsBus = AZ::EBus; - - class LegacyViewportCameraControllerInstance; - using LegacyViewportCameraController = AzFramework::MultiViewportController; - - class LegacyViewportCameraControllerInstance final - : public AzFramework::MultiViewportControllerInstanceInterface - , public OrbitCameraControlsBus::Handler - { - public: - LegacyViewportCameraControllerInstance(AzFramework::ViewportId viewport, LegacyViewportCameraController* controller); - ~LegacyViewportCameraControllerInstance(); - - bool HandleInputChannelEvent(const AzFramework::ViewportControllerInputEvent& event) override; - void ResetInputChannels() override; - void UpdateViewport(const AzFramework::ViewportControllerUpdateEvent& event) override; - - void SetOrbitDistance(float orbitDistance) override; - - private: - bool JustAltHeld() const; - bool NoModifierHeld() const; - bool AllowDolly() const; - bool AllowOrbit() const; - bool AllowPan() const; - bool InvertPan() const; - - static Qt::KeyboardModifier GetKeyboardModifier(const AzFramework::InputChannel& inputChannel); - static Qt::Key GetKeyboardKey(const AzFramework::InputChannel& inputChannel); - - AZ::RPI::ViewportContextPtr GetViewportContext(); - - bool HandleMouseMove(int dx, int dy); - bool HandleMouseWheel(float zDelta); - bool IsKeyDown(Qt::Key key) const; - void UpdateCursorCapture(bool shouldCaptureCursor); - - bool m_inRotateMode = false; - bool m_inMoveMode = false; - bool m_inOrbitMode = false; - bool m_inZoomMode = false; - int m_totalMouseMoveDelta = 0; - float m_orbitDistance = 10.f; - float m_moveSpeed = 1.f; - AZ::Vector3 m_orbitTarget = {}; - unsigned int m_modifiers = {}; - AZStd::unordered_set m_pressedKeys; - bool m_capturingCursor = false; - }; - -} //namespace SandboxEditor diff --git a/Code/Editor/LevelFileDialog.cpp b/Code/Editor/LevelFileDialog.cpp index 41bb4d6faa..3f3077a2c4 100644 --- a/Code/Editor/LevelFileDialog.cpp +++ b/Code/Editor/LevelFileDialog.cpp @@ -32,22 +32,6 @@ static const char lastLoadPathFilename[] = "lastLoadPath.preset"; // Folder in which levels are stored static const char kLevelsFolder[] = "Levels"; -// List of folder names that are used to detect a level folder -static const char* kLevelFolderNames[] = -{ - "Layers", - "Minimap", - "LevelData" -}; - -// List of files that are used to detect a level folder -static const char* kLevelFileNames[] = -{ - "level.pak", - "filelist.xml", - "levelshadercache.pak", -}; - CLevelFileDialog::CLevelFileDialog(bool openDialog, QWidget* parent) : QDialog(parent) , m_bOpenDialog(openDialog) @@ -98,7 +82,7 @@ CLevelFileDialog::CLevelFileDialog(bool openDialog, QWidget* parent) connect(ui->nameLineEdit, &QLineEdit::textChanged, this, &CLevelFileDialog::OnNameChanged); } - // reject invalid file names (see CryStringUtils::IsValidFileName) + // reject invalid file names ui->nameLineEdit->setValidator(new QRegExpValidator(QRegExp("^[a-zA-Z0-9_\\-./]*$"), ui->nameLineEdit)); ReloadTree(); @@ -315,7 +299,7 @@ void CLevelFileDialog::OnNewFolder() const QString newFolderName = inputDlg.textValue(); const QString newFolderPath = parentFullPath + "/" + newFolderName; - if (!CryStringUtils::IsValidFileName(newFolderName.toUtf8().data())) + if (!AZ::StringFunc::Path::IsValid(newFolderName.toUtf8().data())) { QMessageBox box(this); box.setText(tr("Please enter a single, valid folder name(standard English alphanumeric characters only)")); @@ -416,7 +400,7 @@ bool CLevelFileDialog::ValidateSaveLevelPath(QString& errorMessage) const const QString enteredPath = GetEnteredPath(); const QString levelPath = GetLevelPath(); - if (!CryStringUtils::IsValidFileName(Path::GetFileName(levelPath).toUtf8().data())) + if (!AZ::StringFunc::Path::IsValid(Path::GetFileName(levelPath).toUtf8().data())) { errorMessage = tr("Please enter a valid level name (standard English alphanumeric characters only)"); return false; @@ -477,7 +461,7 @@ bool CLevelFileDialog::ValidateLevelPath(const QString& levelPath) const QString currentPath = (Path::GetEditingGameDataFolder() + "/" + kLevelsFolder).c_str(); for (size_t i = 0; i < splittedPath.size() - 1; ++i) { - currentPath += "/" + splittedPath[i]; + currentPath += "/" + splittedPath[static_cast(i)]; if (CFileUtil::FileExists(currentPath) || CheckLevelFolder(currentPath)) { diff --git a/Code/Editor/LevelFileDialog.h b/Code/Editor/LevelFileDialog.h index 93d8e4eb9b..6347eb946a 100644 --- a/Code/Editor/LevelFileDialog.h +++ b/Code/Editor/LevelFileDialog.h @@ -64,7 +64,6 @@ private: QString m_fileName; QString m_filter; const bool m_bOpenDialog; - bool m_initialized = false; LevelTreeModel* const m_model; LevelTreeModelFilter* const m_filterModel; }; diff --git a/Code/Editor/Lib/Tests/IEditorMock.h b/Code/Editor/Lib/Tests/IEditorMock.h index 9f99b0cd9d..30f1d23576 100644 --- a/Code/Editor/Lib/Tests/IEditorMock.h +++ b/Code/Editor/Lib/Tests/IEditorMock.h @@ -9,7 +9,6 @@ #include #include -#include #include class CEditorMock @@ -85,8 +84,8 @@ public: MOCK_METHOD0(GetObjectManager, struct IObjectManager* ()); MOCK_METHOD0(GetSettingsManager, CSettingsManager* ()); MOCK_METHOD1(GetDBItemManager, IDataBaseManager* (EDataBaseItemType)); - MOCK_METHOD0(GetMaterialManagerLibrary, IBaseLibraryManager* ()); - MOCK_METHOD0(GetIEditorMaterialManager, IEditorMaterialManager* ()); + MOCK_METHOD0(GetMaterialManagerLibrary, IBaseLibraryManager* ()); + MOCK_METHOD0(GetIEditorMaterialManager, IEditorMaterialManager* ()); MOCK_METHOD0(GetIconManager, IIconManager* ()); MOCK_METHOD0(GetMusicManager, CMusicManager* ()); MOCK_METHOD2(GetTerrainElevation, float(float , float )); @@ -178,13 +177,12 @@ public: MOCK_CONST_METHOD0(GetEditorConfigSpec, ESystemConfigSpec()); MOCK_CONST_METHOD0(GetEditorConfigPlatform, ESystemConfigPlatform()); MOCK_METHOD0(ReloadTemplates, void()); - MOCK_METHOD0(GetResourceSelectorHost, IResourceSelectorHost* ()); MOCK_METHOD1(ShowStatusText, void(bool )); MOCK_METHOD1(RegisterObjectContextMenuExtension, void(TContextMenuExtensionFunc )); MOCK_METHOD0(GetEnv, SSystemGlobalEnvironment* ()); MOCK_METHOD0(GetImageUtil, IImageUtil* ()); MOCK_METHOD0(GetEditorSettings, SEditorSettings* ()); - MOCK_METHOD0(GetLogFile, ILogFile* ()); + MOCK_METHOD0(GetLogFile, ILogFile* ()); MOCK_METHOD0(UnloadPlugins, void()); MOCK_METHOD0(LoadPlugins, void()); MOCK_METHOD1(GetSearchPath, QString(EEditorPathName)); diff --git a/Code/Editor/Lib/Tests/test_EditorUtils.cpp b/Code/Editor/Lib/Tests/test_EditorUtils.cpp index 59deb178a9..3556757ae3 100644 --- a/Code/Editor/Lib/Tests/test_EditorUtils.cpp +++ b/Code/Editor/Lib/Tests/test_EditorUtils.cpp @@ -23,12 +23,12 @@ namespace EditorUtilsTest BusConnect(); } - ~WarningDetector() + ~WarningDetector() override { BusDisconnect(); } - virtual bool OnWarning(const char* /*window*/, const char* /*message*/) override + bool OnWarning(const char* /*window*/, const char* /*message*/) override { m_gotWarning = true; return true; diff --git a/Code/Editor/Lib/Tests/test_Main.cpp b/Code/Editor/Lib/Tests/test_Main.cpp index a30afb0b7c..6250c540db 100644 --- a/Code/Editor/Lib/Tests/test_Main.cpp +++ b/Code/Editor/Lib/Tests/test_Main.cpp @@ -17,7 +17,7 @@ class EditorLibTestEnvironment : public AZ::Test::ITestEnvironment { public: - virtual ~EditorLibTestEnvironment() {} + ~EditorLibTestEnvironment() override = default; protected: void SetupEnvironment() override diff --git a/Code/Editor/Lib/Tests/test_ModularViewportCameraController.cpp b/Code/Editor/Lib/Tests/test_ModularViewportCameraController.cpp new file mode 100644 index 0000000000..ce5564c7f6 --- /dev/null +++ b/Code/Editor/Lib/Tests/test_ModularViewportCameraController.cpp @@ -0,0 +1,369 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include +#include +#include +#include +#include +#include + +namespace UnitTest +{ + const QSize WidgetSize = QSize(1920, 1080); + + using AzToolsFramework::ViewportInteraction::MouseInteractionEvent; + + class ViewportMouseCursorRequestImpl : public AzToolsFramework::ViewportInteraction::ViewportMouseCursorRequestBus::Handler + { + public: + void Connect(const AzFramework::ViewportId viewportId, AzToolsFramework::QtEventToAzInputMapper* inputChannelMapper) + { + AzToolsFramework::ViewportInteraction::ViewportMouseCursorRequestBus::Handler::BusConnect(viewportId); + m_inputChannelMapper = inputChannelMapper; + } + + void Disconnect() + { + AzToolsFramework::ViewportInteraction::ViewportMouseCursorRequestBus::Handler::BusDisconnect(); + } + + // ViewportMouseCursorRequestBus overrides ... + void BeginCursorCapture() override; + void EndCursorCapture() override; + bool IsMouseOver() const override; + + private: + AzToolsFramework::QtEventToAzInputMapper* m_inputChannelMapper = nullptr; + }; + + void ViewportMouseCursorRequestImpl::BeginCursorCapture() + { + m_inputChannelMapper->SetCursorCaptureEnabled(true); + } + + void ViewportMouseCursorRequestImpl::EndCursorCapture() + { + m_inputChannelMapper->SetCursorCaptureEnabled(false); + } + + bool ViewportMouseCursorRequestImpl::IsMouseOver() const + { + return true; + } + + class TestModularCameraViewportContextImpl : public AtomToolsFramework::ModularCameraViewportContext + { + public: + AZ::Transform GetCameraTransform() const override + { + return m_cameraTransform; + } + + void SetCameraTransform(const AZ::Transform& transform) override + { + m_cameraTransform = transform; + } + + void ConnectViewMatrixChangedHandler(AZ::RPI::ViewportContext::MatrixChangedEvent::Handler&) override + { + // noop + } + + private: + AZ::Transform m_cameraTransform = AZ::Transform::CreateIdentity(); + }; + + class ModularViewportCameraControllerFixture : public AllocatorsTestFixture + { + public: + static const AzFramework::ViewportId TestViewportId; + + void SetUp() override + { + AllocatorsTestFixture::SetUp(); + + m_rootWidget = AZStd::make_unique(); + m_rootWidget->setFixedSize(WidgetSize); + + m_controllerList = AZStd::make_shared(); + m_controllerList->RegisterViewportContext(TestViewportId); + + m_inputChannelMapper = AZStd::make_unique(m_rootWidget.get(), TestViewportId); + + m_settingsRegistry = AZStd::make_unique(); + AZ::SettingsRegistry::Register(m_settingsRegistry.get()); + } + + void TearDown() override + { + AZ::SettingsRegistry::Unregister(m_settingsRegistry.get()); + m_settingsRegistry.reset(); + + m_inputChannelMapper.reset(); + + m_controllerList->UnregisterViewportContext(TestViewportId); + m_controllerList.reset(); + m_rootWidget.reset(); + + AllocatorsTestFixture::TearDown(); + } + + void PrepareCollaborators() + { + AzFramework::NativeWindowHandle nativeWindowHandle = nullptr; + + // listen for events signaled from QtEventToAzInputMapper and forward to the 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 }); + }); + + m_mockWindowRequests.Connect(nativeWindowHandle); + + using ::testing::Return; + // note: WindowRequests is used internally by ModularViewportCameraController, this ensures it returns the viewport size we want + ON_CALL(m_mockWindowRequests, GetClientAreaSize()) + .WillByDefault(Return(AzFramework::WindowSize(WidgetSize.width(), WidgetSize.height()))); + + // respond to begin/end cursor capture events + m_viewportMouseCursorRequests.Connect(TestViewportId, m_inputChannelMapper.get()); + + // create editor modular camera + m_editorModularViewportCameraComposer = AZStd::make_unique(TestViewportId); + auto controller = m_editorModularViewportCameraComposer->CreateModularViewportCameraController(); + + // set some overrides for the test + controller->SetCameraViewportContextBuilderCallback( + [this](AZStd::unique_ptr& cameraViewportContext) + { + cameraViewportContext = AZStd::make_unique(); + m_cameraViewportContextView = cameraViewportContext.get(); + }); + + // disable smoothing in the test + controller->SetCameraPropsBuilderCallback( + [](AzFramework::CameraProps& cameraProps) + { + cameraProps.m_rotateSmoothingEnabledFn = [] + { + return false; + }; + + cameraProps.m_translateSmoothingEnabledFn = [] + { + return false; + }; + }); + + m_controllerList->Add(controller); + } + + void HaltCollaborators() + { + m_editorModularViewportCameraComposer.reset(); + m_mockWindowRequests.Disconnect(); + m_viewportMouseCursorRequests.Disconnect(); + m_cameraViewportContextView = nullptr; + } + + void RepeatDiagonalMouseMovements(const AZStd::function& deltaTimeFn) + { + // move to the center of the screen + const auto start = QPoint(WidgetSize.width() / 2, WidgetSize.height() / 2); + MouseMove(m_rootWidget.get(), start, QPoint(0, 0)); + m_controllerList->UpdateViewport({ TestViewportId, AzFramework::FloatSeconds(deltaTimeFn()), AZ::ScriptTimePoint() }); + + // move mouse diagonally to top right, then to bottom left and back repeatedly + auto current = start; + auto halfDelta = QPoint(200, -200); + const int iterationsPerDiagonal = 50; + for (int diagonals = 0; diagonals < 80; ++diagonals) + { + for (int i = 0; i < iterationsPerDiagonal; ++i) + { + MousePressAndMove(m_rootWidget.get(), current, halfDelta / iterationsPerDiagonal, Qt::MouseButton::RightButton); + m_controllerList->UpdateViewport({ TestViewportId, AzFramework::FloatSeconds(deltaTimeFn()), AZ::ScriptTimePoint() }); + current += halfDelta / iterationsPerDiagonal; + } + + if (diagonals % 2 == 0) + { + halfDelta.setX(halfDelta.x() * -1); + halfDelta.setY(halfDelta.y() * -1); + } + } + + QTest::mouseRelease(m_rootWidget.get(), Qt::MouseButton::RightButton, Qt::KeyboardModifier::NoModifier, current); + m_controllerList->UpdateViewport({ TestViewportId, AzFramework::FloatSeconds(deltaTimeFn()), AZ::ScriptTimePoint() }); + } + + AZStd::unique_ptr m_rootWidget; + AzFramework::ViewportControllerListPtr m_controllerList; + AZStd::unique_ptr m_inputChannelMapper; + ::testing::NiceMock m_mockWindowRequests; + ViewportMouseCursorRequestImpl m_viewportMouseCursorRequests; + AtomToolsFramework::ModularCameraViewportContext* m_cameraViewportContextView = nullptr; + AZStd::unique_ptr m_settingsRegistry; + AZStd::unique_ptr m_editorModularViewportCameraComposer; + }; + + const AzFramework::ViewportId ModularViewportCameraControllerFixture::TestViewportId = AzFramework::ViewportId(0); + + TEST_F(ModularViewportCameraControllerFixture, MouseMovementDoesNotAccumulateExcessiveDriftInModularViewportCameraWithVaryingDeltaTime) + { + SandboxEditor::SetCameraCaptureCursorForLook(false); + + // Given + PrepareCollaborators(); + + // When + RepeatDiagonalMouseMovements( + [t = 0.0f]() mutable + { + // vary between 30 and 50 fps (40 +/- 10) + const float fps = 40.0f + (10.0f * AZStd::sin(t)); + t += AZ::DegToRad(5.0f); + return 1.0f / fps; + }); + + // Then + // ensure the camera rotation is the identity (no significant drift has occurred as we moved the mouse) + const AZ::Transform cameraRotation = m_cameraViewportContextView->GetCameraTransform(); + EXPECT_THAT(cameraRotation.GetRotation(), IsClose(AZ::Quaternion::CreateIdentity())); + + // Clean-up + HaltCollaborators(); + } + + class ModularViewportCameraControllerDeltaTimeParamFixture + : public ModularViewportCameraControllerFixture + , public ::testing::WithParamInterface // delta time + { + }; + + TEST_P( + ModularViewportCameraControllerDeltaTimeParamFixture, + MouseMovementDoesNotAccumulateExcessiveDriftInModularViewportCameraWithFixedDeltaTime) + { + SandboxEditor::SetCameraCaptureCursorForLook(false); + + // Given + PrepareCollaborators(); + + // When + RepeatDiagonalMouseMovements( + [this] + { + return GetParam(); + }); + + // Then + // ensure the camera rotation is the identity (no significant drift has occurred as we moved the mouse) + const AZ::Transform cameraRotation = m_cameraViewportContextView->GetCameraTransform(); + EXPECT_THAT(cameraRotation.GetRotation(), IsClose(AZ::Quaternion::CreateIdentity())); + + // Clean-up + HaltCollaborators(); + } + + INSTANTIATE_TEST_CASE_P( + All, ModularViewportCameraControllerDeltaTimeParamFixture, testing::Values(1.0f / 60.0f, 1.0f / 50.0f, 1.0f / 30.0f)); + + TEST_F(ModularViewportCameraControllerFixture, MouseMovementOrientatesCameraWhenCursorIsCaptured) + { + // Given + PrepareCollaborators(); + // ensure cursor is captured + SandboxEditor::SetCameraCaptureCursorForLook(true); + + const float deltaTime = 1.0f / 60.0f; + + // When + // move to the center of the screen + auto start = QPoint(WidgetSize.width() / 2, WidgetSize.height() / 2); + MouseMove(m_rootWidget.get(), start, QPoint(0, 0)); + m_controllerList->UpdateViewport({ TestViewportId, AzFramework::FloatSeconds(deltaTime), AZ::ScriptTimePoint() }); + + const auto mouseDelta = QPoint(5, 0); + + // initial movement to begin the camera behavior + MousePressAndMove(m_rootWidget.get(), start, mouseDelta, Qt::MouseButton::RightButton); + m_controllerList->UpdateViewport({ TestViewportId, AzFramework::FloatSeconds(deltaTime), AZ::ScriptTimePoint() }); + + // move the cursor right + for (int i = 0; i < 50; ++i) + { + MousePressAndMove(m_rootWidget.get(), start + mouseDelta, mouseDelta, Qt::MouseButton::RightButton); + m_controllerList->UpdateViewport({ TestViewportId, AzFramework::FloatSeconds(deltaTime), AZ::ScriptTimePoint() }); + } + + // move the cursor left (do an extra iteration moving left to account for the initial dead-zone) + for (int i = 0; i < 51; ++i) + { + MousePressAndMove(m_rootWidget.get(), start + mouseDelta, -mouseDelta, Qt::MouseButton::RightButton); + m_controllerList->UpdateViewport({ TestViewportId, AzFramework::FloatSeconds(deltaTime), AZ::ScriptTimePoint() }); + } + + QTest::mouseRelease(m_rootWidget.get(), Qt::MouseButton::RightButton, Qt::KeyboardModifier::NoModifier, start + mouseDelta); + m_controllerList->UpdateViewport({ TestViewportId, AzFramework::FloatSeconds(deltaTime), AZ::ScriptTimePoint() }); + + // Then + // retrieve the amount of yaw rotation + const AZ::Quaternion cameraRotation = m_cameraViewportContextView->GetCameraTransform().GetRotation(); + const auto eulerAngles = AzFramework::EulerAngles(AZ::Matrix3x3::CreateFromQuaternion(cameraRotation)); + + // camera should be back at the center (no yaw) + using ::testing::FloatNear; + EXPECT_THAT(eulerAngles.GetZ(), FloatNear(0.0f, 0.001f)); + + // Clean-up + HaltCollaborators(); + } + + TEST_F(ModularViewportCameraControllerFixture, CameraDoesNotContinueToRotateGivenNoInputWhenCaptured) + { + // Given + PrepareCollaborators(); + SandboxEditor::SetCameraCaptureCursorForLook(true); + + const float deltaTime = 1.0f / 60.0f; + + // When + // move to the center of the screen + auto start = QPoint(WidgetSize.width() / 2, WidgetSize.height() / 2); + MouseMove(m_rootWidget.get(), start, QPoint(0, 0)); + m_controllerList->UpdateViewport({ TestViewportId, AzFramework::FloatSeconds(deltaTime), AZ::ScriptTimePoint() }); + + // will move a small amount initially + const auto mouseDelta = QPoint(5, 0); + MousePressAndMove(m_rootWidget.get(), start, mouseDelta, Qt::MouseButton::RightButton); + + // ensure further updates to not continue to rotate + for (int i = 0; i < 50; ++i) + { + m_controllerList->UpdateViewport({ TestViewportId, AzFramework::FloatSeconds(deltaTime), AZ::ScriptTimePoint() }); + } + + // Then + // ensure the camera rotation is no longer the identity + const AZ::Quaternion cameraRotation = m_cameraViewportContextView->GetCameraTransform().GetRotation(); + const auto eulerAngles = AzFramework::EulerAngles(AZ::Matrix3x3::CreateFromQuaternion(cameraRotation)); + + // initial amount of rotation after first mouse move + using ::testing::FloatNear; + EXPECT_THAT(eulerAngles.GetZ(), FloatNear(-0.025f, 0.001f)); + + // Clean-up + HaltCollaborators(); + } +} // namespace UnitTest diff --git a/Code/Editor/Lib/Tests/test_ViewportManipulatorController.cpp b/Code/Editor/Lib/Tests/test_ViewportManipulatorController.cpp new file mode 100644 index 0000000000..8c7023634e --- /dev/null +++ b/Code/Editor/Lib/Tests/test_ViewportManipulatorController.cpp @@ -0,0 +1,154 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include +#include +#include +#include +#include + +namespace UnitTest +{ + using AzToolsFramework::ViewportInteraction::MouseInteractionEvent; + + class EditorInteractionViewportSelectionFake : public AzToolsFramework::EditorInteractionSystemViewportSelectionRequestBus::Handler + { + public: + void Connect(); + void Disconnect(); + + // EditorInteractionSystemViewportSelectionRequestBus overrides ... + void SetHandler(const AzToolsFramework::ViewportSelectionRequestsBuilderFn& interactionRequestsBuilder) override; + void SetDefaultHandler() override; + bool InternalHandleMouseViewportInteraction(const MouseInteractionEvent& mouseInteraction) override; + bool InternalHandleMouseManipulatorInteraction(const MouseInteractionEvent& mouseInteraction) override; + + AZStd::function m_internalHandleMouseViewportInteraction; + AZStd::function m_internalHandleMouseManipulatorInteraction; + }; + + void EditorInteractionViewportSelectionFake::Connect() + { + AzToolsFramework::EditorInteractionSystemViewportSelectionRequestBus::Handler::BusConnect(AzToolsFramework::GetEntityContextId()); + } + + void EditorInteractionViewportSelectionFake::Disconnect() + { + AzToolsFramework::EditorInteractionSystemViewportSelectionRequestBus::Handler::BusDisconnect(); + } + + void EditorInteractionViewportSelectionFake::SetHandler( + [[maybe_unused]] const AzToolsFramework::ViewportSelectionRequestsBuilderFn& interactionRequestsBuilder) + { + // noop + } + + void EditorInteractionViewportSelectionFake::SetDefaultHandler() + { + // noop + } + + bool EditorInteractionViewportSelectionFake::InternalHandleMouseViewportInteraction(const MouseInteractionEvent& mouseInteraction) + { + if (m_internalHandleMouseViewportInteraction) + { + return m_internalHandleMouseViewportInteraction(mouseInteraction); + } + + return false; + } + + bool EditorInteractionViewportSelectionFake::InternalHandleMouseManipulatorInteraction(const MouseInteractionEvent& mouseInteraction) + { + if (m_internalHandleMouseManipulatorInteraction) + { + return m_internalHandleMouseManipulatorInteraction(mouseInteraction); + } + + return false; + } + + class ViewportManipulatorControllerFixture : public AllocatorsTestFixture + { + public: + static const AzFramework::ViewportId TestViewportId; + + void SetUp() override + { + AllocatorsTestFixture::SetUp(); + + m_rootWidget = AZStd::make_unique(); + m_rootWidget->setFixedSize(QSize(100, 100)); + + m_controllerList = AZStd::make_shared(); + m_controllerList->RegisterViewportContext(TestViewportId); + + m_inputChannelMapper = AZStd::make_unique(m_rootWidget.get(), TestViewportId); + } + + void TearDown() override + { + m_inputChannelMapper.reset(); + + m_controllerList->UnregisterViewportContext(TestViewportId); + m_controllerList.reset(); + m_rootWidget.reset(); + + AllocatorsTestFixture::TearDown(); + } + + AZStd::unique_ptr m_rootWidget; + AzFramework::ViewportControllerListPtr m_controllerList; + AZStd::unique_ptr m_inputChannelMapper; + }; + + const AzFramework::ViewportId ViewportManipulatorControllerFixture::TestViewportId = AzFramework::ViewportId(0); + + TEST_F(ViewportManipulatorControllerFixture, An_event_is_not_propagated_to_the_viewport_when_a_manipulator_handles_it_first) + { + // forward input events to our controller list + QObject::connect( + m_inputChannelMapper.get(), &AzToolsFramework::QtEventToAzInputMapper::InputChannelUpdated, m_rootWidget.get(), + [this](const AzFramework::InputChannel* inputChannel, [[maybe_unused]] QEvent* event) + { + m_controllerList->HandleInputChannelEvent( + AzFramework::ViewportControllerInputEvent{ TestViewportId, nullptr, *inputChannel }); + }); + + EditorInteractionViewportSelectionFake editorInteractionViewportFake; + editorInteractionViewportFake.m_internalHandleMouseManipulatorInteraction = [](const MouseInteractionEvent&) + { + // report the event was handled (manipulator was interacted with) + return true; + }; + + bool viewportInteractionCalled = false; + editorInteractionViewportFake.m_internalHandleMouseViewportInteraction = [&viewportInteractionCalled](const MouseInteractionEvent&) + { + // we should not call this as the manipulator will have consumed this event + viewportInteractionCalled = true; + return true; + }; + + editorInteractionViewportFake.Connect(); + + m_controllerList->Add(AZStd::make_shared()); + + // simulate a press and move + MousePressAndMove(m_rootWidget.get(), QPoint(10, 10), QPoint(10, 10), Qt::MouseButton::LeftButton); + MouseMove(m_rootWidget.get(), QPoint(20, 20), QPoint(10, 10), Qt::MouseButton::LeftButton); + MouseMove(m_rootWidget.get(), QPoint(30, 30), QPoint(0, 0), Qt::MouseButton::LeftButton); + QTest::mouseRelease(m_rootWidget.get(), Qt::MouseButton::LeftButton, Qt::KeyboardModifier::NoModifier, QPoint(30, 30)); + + // ensure the viewport did not receive the event when it was intercepted first by the manipulator + EXPECT_FALSE(viewportInteractionCalled); + + editorInteractionViewportFake.Disconnect(); + } +} // namespace UnitTest diff --git a/Code/Editor/LogFile.cpp b/Code/Editor/LogFile.cpp index c768f5013b..92186901d7 100644 --- a/Code/Editor/LogFile.cpp +++ b/Code/Editor/LogFile.cpp @@ -179,19 +179,17 @@ void CLogFile::FormatLineV(const char * format, va_list argList) void CLogFile::AboutSystem() { - char szBuffer[MAX_LOGBUFFER_SIZE]; #if defined(AZ_PLATFORM_WINDOWS) || defined(AZ_PLATFORM_LINUX) ////////////////////////////////////////////////////////////////////// // Write the system informations to the log ////////////////////////////////////////////////////////////////////// - - char szProfileBuffer[128]; - char szLanguageBuffer[64]; - //char szCPUModel[64]; + char szBuffer[MAX_LOGBUFFER_SIZE]; + //wchar_t szCPUModel[64]; MEMORYSTATUS MemoryStatus; #endif // defined(AZ_PLATFORM_WINDOWS) || defined(AZ_PLATFORM_LINUX) #if defined(AZ_PLATFORM_WINDOWS) + wchar_t szLanguageBufferW[64]; DEVMODE DisplayConfig; OSVERSIONINFO OSVerInfo; OSVerInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); @@ -201,11 +199,13 @@ void CLogFile::AboutSystem() ////////////////////////////////////////////////////////////////////// // Get system language - GetLocaleInfo(LOCALE_SYSTEM_DEFAULT, LOCALE_SENGLANGUAGE, - szLanguageBuffer, sizeof(szLanguageBuffer)); + GetLocaleInfoW(LOCALE_SYSTEM_DEFAULT, LOCALE_SENGLANGUAGE, + szLanguageBufferW, sizeof(szLanguageBufferW)); + AZStd::string szLanguageBuffer; + AZStd::to_string(szLanguageBuffer, szLanguageBufferW); // Format and send OS information line - azsnprintf(szBuffer, MAX_LOGBUFFER_SIZE, "Current Language: %s ", szLanguageBuffer); + azsnprintf(szBuffer, MAX_LOGBUFFER_SIZE, "Current Language: %s ", szLanguageBuffer.c_str()); CryLog("%s", szBuffer); #else QLocale locale; @@ -286,7 +286,7 @@ AZ_POP_DISABLE_WARNING str += "Version Unknown"; } } - azsnprintf(szBuffer, MAX_LOGBUFFER_SIZE, " %d.%d", OSVerInfo.dwMajorVersion, OSVerInfo.dwMinorVersion); + azsnprintf(szBuffer, MAX_LOGBUFFER_SIZE, " %ld.%ld", OSVerInfo.dwMajorVersion, OSVerInfo.dwMinorVersion); str += szBuffer; ////////////////////////////////////////////////////////////////////// @@ -294,7 +294,9 @@ AZ_POP_DISABLE_WARNING ////////////////////////////////////////////////////////////////////// str += " ("; - GetWindowsDirectory(szBuffer, sizeof(szBuffer)); + wchar_t szBufferW[MAX_LOGBUFFER_SIZE]; + GetWindowsDirectoryW(szBufferW, sizeof(szBufferW)); + AZStd::to_string(szBuffer, MAX_LOGBUFFER_SIZE, szBufferW); str += szBuffer; str += ")"; CryLog("%s", str.toUtf8().data()); @@ -335,7 +337,7 @@ AZ_POP_DISABLE_WARNING str += " "; azstrdate(szBuffer); str += szBuffer; - azsnprintf(szBuffer, MAX_LOGBUFFER_SIZE, ", system running for %d minutes", GetTickCount() / 60000); + azsnprintf(szBuffer, MAX_LOGBUFFER_SIZE, ", system running for %ld minutes", GetTickCount() / 60000); str += szBuffer; CryLog("%s", str.toUtf8().data()); #else @@ -381,12 +383,13 @@ AZ_POP_DISABLE_WARNING #if defined(AZ_PLATFORM_WINDOWS) EnumDisplaySettings(nullptr, ENUM_CURRENT_SETTINGS, &DisplayConfig); - GetPrivateProfileString("boot.description", "display.drv", - "(Unknown graphics card)", szProfileBuffer, sizeof(szProfileBuffer), - "system.ini"); - azsnprintf(szBuffer, MAX_LOGBUFFER_SIZE, "Current display mode is %dx%dx%d, %s", + GetPrivateProfileStringW(L"boot.description", L"display.drv", + L"(Unknown graphics card)", szLanguageBufferW, sizeof(szLanguageBufferW), + L"system.ini"); + AZStd::to_string(szLanguageBuffer, szLanguageBufferW); + azsnprintf(szBuffer, MAX_LOGBUFFER_SIZE, "Current display mode is %ldx%ldx%ld, %s", DisplayConfig.dmPelsWidth, DisplayConfig.dmPelsHeight, - DisplayConfig.dmBitsPerPel, szProfileBuffer); + DisplayConfig.dmBitsPerPel, szLanguageBuffer.c_str()); CryLog("%s", szBuffer); #else auto screen = QGuiApplication::primaryScreen(); @@ -500,7 +503,7 @@ static inline QString CopyAndRemoveColorCode(const char* sText) *d++ = *s++; } - ret.resize(d - ret.data()); + ret.resize(static_cast(d - ret.data())); return QString::fromLatin1(ret); } @@ -568,9 +571,6 @@ void CLogFile::OnWriteToConsole(const char* sText, bool bNewLine) } if (bNewLine) { - //str = CString("\r\n") + str.TrimLeft(); - //str = CString("\r\n") + str; - //str = CString("\r") + str; str = QString("\r\n") + str; str = str.trimmed(); } diff --git a/Code/Editor/MainStatusBar.cpp b/Code/Editor/MainStatusBar.cpp index a1e51ec553..f955035bd8 100644 --- a/Code/Editor/MainStatusBar.cpp +++ b/Code/Editor/MainStatusBar.cpp @@ -15,6 +15,7 @@ // AzQtComponents #include #include +#include // Qt #include @@ -209,7 +210,7 @@ MainStatusBar::MainStatusBar(QWidget* parent) addPermanentWidget(new StatusBarItem(QStringLiteral("connection"), true, this, true), 1); - addPermanentWidget(new StatusBarItem(QStringLiteral("game_info"), this, true), 1); + addPermanentWidget(new GameInfoItem(QStringLiteral("game_info"), this), 1); addPermanentWidget(new MemoryStatusItem(QStringLiteral("memory"), this), 1); } @@ -221,11 +222,6 @@ void MainStatusBar::Init() 500 }; //in ms, so 2 FPS - AZ::IO::FixedMaxPathString projectPath = AZ::Utils::GetProjectPath(); - QString strGameInfo; - strGameInfo = tr("GameFolder: '%1'").arg(projectPath.c_str()); - SetItem(QStringLiteral("game_info"), strGameInfo, tr("Game Info"), QPixmap()); - //ask for updates for items regularly. This is basically what MFC does auto timer = new QTimer(this); timer->setInterval(statusbarTimerUpdateInterval); @@ -436,5 +432,29 @@ QString GeneralStatusItem::CurrentText() const return StatusBarItem::CurrentText(); } +GameInfoItem::GameInfoItem(QString name, MainStatusBar* parent) + : StatusBarItem(name, parent, true) +{ + m_projectPath = QString::fromUtf8(AZ::Utils::GetProjectPath().c_str()); + + SetText(QObject::tr("GameFolder: '%1'").arg(m_projectPath)); + SetToolTip(QObject::tr("Game Info")); + + setContextMenuPolicy(Qt::CustomContextMenu); + QObject::connect(this, &QWidget::customContextMenuRequested, this, &GameInfoItem::OnShowContextMenu); +} + +void GameInfoItem::OnShowContextMenu(const QPoint& pos) +{ + QMenu contextMenu(this); + + // Context menu action to open the project folder in file browser + contextMenu.addAction(AzQtComponents::fileBrowserActionName(), this, [this]() { + AzQtComponents::ShowFileOnDesktop(m_projectPath); + }); + + contextMenu.exec(mapToGlobal(pos)); +} + #include #include diff --git a/Code/Editor/MainStatusBarItems.h b/Code/Editor/MainStatusBarItems.h index 2a3a21e72a..5f8d618dca 100644 --- a/Code/Editor/MainStatusBarItems.h +++ b/Code/Editor/MainStatusBarItems.h @@ -71,3 +71,17 @@ public: private: void updateStatus(); }; + +class GameInfoItem + : public StatusBarItem +{ + Q_OBJECT +public: + GameInfoItem(QString name, MainStatusBar* parent); + +private Q_SLOTS: + void OnShowContextMenu(const QPoint& pos); + +private: + QString m_projectPath; +}; diff --git a/Code/Editor/MainWindow.cpp b/Code/Editor/MainWindow.cpp index cd023f3b42..beb338b732 100644 --- a/Code/Editor/MainWindow.cpp +++ b/Code/Editor/MainWindow.cpp @@ -97,6 +97,7 @@ AZ_POP_DISABLE_WARNING #include "ActionManager.h" #include +#include using namespace AZ; using namespace AzQtComponents; @@ -107,12 +108,6 @@ using namespace AzToolsFramework; #define LAYOUTS_WILDCARD "*.layout" #define DUMMY_LAYOUT_NAME "Dummy_Layout" -static const char* g_openViewPaneEventName = "OpenViewPaneEvent"; //Sent when users open view panes; -static const char* g_viewPaneAttributeName = "ViewPaneName"; //Name of the current view pane -static const char* g_openLocationAttributeName = "OpenLocation"; //Indicates where the current view pane is opened from - -static const char* g_assetImporterName = "AssetImporter"; - class CEditorOpenViewCommand : public _i_reference_target_t { @@ -302,7 +297,7 @@ MainWindow::MainWindow(QWidget* parent) , m_settings("O3DE", "O3DE") , m_toolbarManager(new ToolbarManager(m_actionManager, this)) , m_assetImporterManager(new AssetImporterManager(this)) - , m_levelEditorMenuHandler(new LevelEditorMenuHandler(this, m_viewPaneManager, m_settings)) + , m_levelEditorMenuHandler(new LevelEditorMenuHandler(this, m_viewPaneManager)) , m_sourceControlNotifHandler(new AzToolsFramework::QtSourceControlNotificationHandler(this)) , m_viewPaneHost(nullptr) , m_autoSaveTimer(nullptr) @@ -1474,25 +1469,22 @@ int MainWindow::ViewPaneVersion() const void MainWindow::OnStopAllSounds() { - Audio::SAudioRequest oStopAllSoundsRequest; - Audio::SAudioManagerRequestData oStopAllSoundsRequestData; - oStopAllSoundsRequest.pData = &oStopAllSoundsRequestData; - - CryLogAlways("