From 268b9da8577f7754a0cf1b54afc23d280faf3afb Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Mon, 18 Oct 2021 14:21:34 -0700 Subject: [PATCH 1/5] atom constant component property class Signed-off-by: Scott Murray --- .../Atom/atom_utils/atom_constants.py | 368 ++++++++++++++++++ .../hydra_AtomEditorComponents_MeshAdded.py | 25 +- 2 files changed, 380 insertions(+), 13 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/atom_constants.py b/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/atom_constants.py index 88a959f198..e6c422eb46 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/atom_constants.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/atom_constants.py @@ -6,6 +6,374 @@ SPDX-License-Identifier: Apache-2.0 OR MIT Hold constants used across both hydra and non-hydra scripts. """ + +class AtomComponentProperties: + """ + Holds Atom component related constants + """ + + @staticmethod + def actor(property: str = 'name') -> str: + """ + Actor component properties. + :param property: From the last element of the property tree path. Default 'name' for component name string. + :return: Full property path OR component name if no property specified. + """ + properties = { + 'name': 'Actor', + } + return properties[property] + + @staticmethod + def bloom(property: str = 'name') -> str: + """ + Bloom component properties. Requires PostFX Layer component. + :param property: From the last element of the property tree path. Default 'name' for component name string. + :return: Full property path OR component name if no property specified. + """ + properties = { + 'name': 'Bloom', + 'requires': [AtomComponentProperties.postfx_layer()], + } + return properties[property] + + @staticmethod + def camera(property: str = 'name') -> str: + """ + Camera component properties. + :param property: From the last element of the property tree path. Default 'name' for component name string. + :return: Full property path OR component name if no property specified. + """ + properties = { + 'name': 'Camera', + } + return properties[property] + + @staticmethod + def decal(property: str = 'name') -> str: + """ + Decal component properties. + 'Material' the material Asset.id of the decal. + :param property: From the last element of the property tree path. Default 'name' for component name string. + :return: Full property path OR component name if no property specified. + """ + properties = { + 'name': 'Decal', + 'Material': 'Controller|Configuration|Material', + } + return properties[property] + + @staticmethod + def deferred_fog(property: str = 'name') -> str: + """ + Deferred Fog component properties. Requires PostFX Layer component. + :param property: From the last element of the property tree path. Default 'name' for component name string. + :return: Full property path OR component name if no property specified. + """ + properties = { + 'name': 'Deferred Fog', + 'requires': [AtomComponentProperties.postfx_layer()], + } + return properties[property] + + @staticmethod + def depth_of_field(property: str = 'name') -> str: + """ + Depth of Field component properties. Requires PostFX Layer component. + 'Camera Entity' an EditorEntity.id reference to the Camera component required for this effect. + Must be a different entity than the one which hosts Depth of Field component. + :param property: From the last element of the property tree path. Default 'name' for component name string. + :return: Full property path OR component name if no property specified. + """ + properties = { + 'name': 'DepthOfField', + 'requires': [AtomComponentProperties.postfx_layer()], + 'Camera Entity': 'Controller|Configuration|Camera Entity', + } + return properties[property] + + @staticmethod + def diffuse_probe(property: str = 'name') -> str: + """ + Diffuse Probe Grid component properties. Requires one of 'shapes' listed. + 'shapes' a list of supported shapes as component names. + :param property: From the last element of the property tree path. Default 'name' for component name string. + :return: Full property path OR component name if no property specified. + """ + properties = { + 'name': 'Diffuse Probe Grid', + 'shapes': ['Axis Aligned Box Shape', 'Box Shape'] + } + return properties[property] + + @staticmethod + def directional_light(property: str = 'name') -> str: + """ + Directional Light component properties. + 'Camera' an EditorEntity.id reference to the Camera component that controls cascaded shadow view frustum. + Must be a different entity than the one which hosts Depth of Field component. + :param property: From the last element of the property tree path. Default 'name' for component name string. + :return: Full property path OR component name if no property specified. + """ + properties = { + 'name': 'Directional Light', + 'Camera': 'Controller|Configuration|Shadow|Camera', + } + return properties[property] + + @staticmethod + def display_mapper(property: str = 'name') -> str: + """ + Display Mapper component properties. + :param property: From the last element of the property tree path. Default 'name' for component name string. + :return: Full property path OR component name if no property specified. + """ + properties = { + 'name': 'Display Mapper', + } + return properties[property] + + @staticmethod + def entity_reference(property: str = 'name') -> str: + """ + Entity Reference component properties. + :param property: From the last element of the property tree path. Default 'name' for component name string. + :return: Full property path OR component name if no property specified. + """ + properties = { + 'name': 'Entity Reference', + } + return properties[property] + + @staticmethod + def exposure_control(property: str = 'name') -> str: + """ + Exposure Control component properties. Requires PostFX Layer component. + :param property: From the last element of the property tree path. Default 'name' for component name string. + :return: Full property path OR component name if no property specified. + """ + properties = { + 'name': 'Exposure Control', + 'requires': [AtomComponentProperties.postfx_layer()], + } + return properties[property] + + @staticmethod + def global_skylight(property: str = 'name') -> str: + """ + Global Skylight (IBL) component properties. + 'Diffuse Image' Asset.id for the cubemap image for determining diffuse lighting. + 'Specular Image' Asset.id for the cubemap image for determining specular lighting. + :param property: From the last element of the property tree path. Default 'name' for component name string. + :return: Full property path OR component name if no property specified. + """ + properties = { + 'name': 'Global Skylight (IBL)', + 'Diffuse Image': 'Controller|Configuration|Diffuse Image', + 'Specular Image': 'Controller|Configuration|Specular Image', + } + return properties[property] + + @staticmethod + def grid(property: str = 'name') -> str: + """ + Grid component properties. + :param property: From the last element of the property tree path. Default 'name' for component name string. + :return: Full property path OR component name if no property specified. + """ + properties = { + 'name': 'Grid', + } + return properties[property] + + @staticmethod + def hdr_color_grading(property: str = 'name') -> str: + """ + HDR Color Grading component properties. Requires PostFX Layer component. + :param property: From the last element of the property tree path. Default 'name' for component name string. + :return: Full property path OR component name if no property specified. + """ + properties = { + 'name': 'HDR Color Grading', + 'requires': [AtomComponentProperties.postfx_layer()], + } + return properties[property] + + @staticmethod + def hdri_skybox(property: str = 'name') -> str: + """ + HDRi Skybox component properties. + :param property: From the last element of the property tree path. Default 'name' for component name string. + :return: Full property path OR component name if no property specified. + """ + properties = { + 'name': 'HDRi Skybox', + } + return properties[property] + + @staticmethod + def light(property: str = 'name') -> str: + """ + Light component properties. + 'Light type' from atom_constants.py LIGHT_TYPES + :param property: From the last element of the property tree path. Default 'name' for component name string. + :return: Full property path OR component name if no property specified. + """ + properties = { + 'name': 'Light', + 'Light type': 'Controller|Configuration|Light type', + } + return properties[property] + + @staticmethod + def look_modification(property: str = 'name') -> str: + """ + Look Modification component properties. Requires PostFX Layer component. + :param property: From the last element of the property tree path. Default 'name' for component name string. + :return: Full property path OR component name if no property specified. + """ + properties = { + 'name': 'Look Modification', + 'requires': [AtomComponentProperties.postfx_layer()], + } + return properties[property] + + @staticmethod + def material(property: str = 'name') -> str: + """ + Material component properties. Requires one of Actor OR Mesh component. + :param property: From the last element of the property tree path. Default 'name' for component name string. + :return: Full property path OR component name if no property specified. + """ + properties = { + 'name': 'Material', + 'requires': [AtomComponentProperties.actor(), AtomComponentProperties.mesh()], + } + return properties[property] + + @staticmethod + def mesh(property: str = 'name') -> str: + """ + Mesh component properties. + 'Mesh Asset' Asset.id of the mesh model. + :param property: From the last element of the property tree path. Default 'name' for component name string. + :return: Full property path OR component name if no property specified. + :rtype: str + """ + properties = { + 'name': 'Mesh', + 'Mesh Asset': 'Controller|Configuration|Mesh Asset', + } + return properties[property] + + @staticmethod + def occlusion_culling_plane(property: str = 'name') -> str: + """ + Occlusion Culling Plane component properties. + :param property: From the last element of the property tree path. Default 'name' for component name string. + :return: Full property path OR component name if no property specified. + """ + properties = { + 'name': 'Occlusion Culling Plane', + } + return properties[property] + + @staticmethod + def physical_sky(property: str = 'name') -> str: + """ + Physical Sky component properties. + :param property: From the last element of the property tree path. Default 'name' for component name string. + :return: Full property path OR component name if no property specified. + """ + properties = { + 'name': 'Physical Sky', + } + return properties[property] + + @staticmethod + def postfx_layer(property: str = 'name') -> str: + """ + PostFX Layer component properties. + :param property: From the last element of the property tree path. Default 'name' for component name string. + :return: Full property path OR component name if no property specified. + """ + properties = { + 'name': 'PostFX Layer', + } + return properties[property] + + @staticmethod + def postfx_gradient(property: str = 'name') -> str: + """ + PostFX Gradient Weight Modifier component properties. Requires PostFX Layer component. + :param property: From the last element of the property tree path. Default 'name' for component name string. + :return: Full property path OR component name if no property specified. + """ + properties = { + 'name': 'PostFX Gradient Weight Modifier', + 'requires': [AtomComponentProperties.postfx_layer()], + } + return properties[property] + + @staticmethod + def postfx_radius(property: str = 'name') -> str: + """ + PostFX Radius Weight Modifier component properties. Requires PostFX Layer component. + :param property: From the last element of the property tree path. Default 'name' for component name string. + :return: Full property path OR component name if no property specified. + """ + properties = { + 'name': 'PostFX Radius Weight Modifier', + 'requires': [AtomComponentProperties.postfx_layer()], + } + return properties[property] + + @staticmethod + def postfx_shape(property: str = 'name') -> str: + """ + PostFX Shape Weight Modifier component properties. Requires PostFX Layer and one of 'shapes' listed. + 'shapes' a list of supported shapes as component names. 'Tube Shape' is also supported by requires 'Spline'. + :param property: From the last element of the property tree path. Default 'name' for component name string. + :return: Full property path OR component name if no property specified. + """ + properties = { + 'name': 'PostFX Shape Weight Modifier', + 'requires': [AtomComponentProperties.postfx_layer()], + 'shapes': ['Axis Aligned Box Shape', 'Box Shape', 'Capsule Shape', 'Compound Shape', 'Cylinder Shape', + 'Disk Shape', 'Polygon Prism Shape', 'Quad Shape', 'Sphere Shape', 'Vegetation Reference Shape'], + } + return properties[property] + + @staticmethod + def reflection_probe(property: str = 'name') -> str: + """ + Reflection Probe component properties. Requires one of 'shapes' listed. + 'shapes' a list of supported shapes as component names. + 'Baked Cubemap Path' Asset.id of the baked cubemap image generated by a call to 'BakeReflectionProbe' ebus. + :param property: From the last element of the property tree path. Default 'name' for component name string. + :return: Full property path OR component name if no property specified. + """ + properties = { + 'name': 'Reflection Probe', + 'shapes': ['Axis Aligned Box Shape', 'Box Shape'], + 'Baked Cubemap Path': 'Cubemap|Baked Cubemap Path', + } + return properties[property] + + @staticmethod + def ssao(property: str = 'name') -> str: + """ + SSAO component properties. Requires PostFX Layer component. + :param property: From the last element of the property tree path. Default 'name' for component name string. + :return: Full property path OR component name if no property specified. + """ + properties = { + 'name': 'SSAO', + 'requires': [AtomComponentProperties.postfx_layer()], + } + return properties[property] + + # Light type options for the Light component. LIGHT_TYPES = { 'unknown': 0, diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_MeshAdded.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_MeshAdded.py index fbf5c987d1..82d3b89309 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_MeshAdded.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_MeshAdded.py @@ -80,25 +80,25 @@ def AtomEditorComponents_Mesh_AddedToEntity(): from editor_python_test_tools.asset_utils import Asset from editor_python_test_tools.editor_entity_utils import EditorEntity - from editor_python_test_tools.utils import Report, Tracer, TestHelper as helper + from editor_python_test_tools.utils import Report, Tracer, TestHelper + from Atom.atom_utils.atom_constants import AtomComponentProperties as Atom with Tracer() as error_tracer: # Test setup begins. # Setup: Wait for Editor idle loop before executing Python hydra scripts then open "Base" level. - helper.init_idle() - helper.open_level("", "Base") + TestHelper.init_idle() + TestHelper.open_level("", "Base") # Test steps begin. # 1. Create a Mesh entity with no components. - mesh_name = "Mesh" - mesh_entity = EditorEntity.create_editor_entity(mesh_name) + mesh_entity = EditorEntity.create_editor_entity(Atom.mesh()) Report.critical_result(Tests.mesh_entity_creation, mesh_entity.exists()) # 2. Add a Mesh component to Mesh entity. - mesh_component = mesh_entity.add_component(mesh_name) + mesh_component = mesh_entity.add_component(Atom.mesh()) Report.critical_result( Tests.mesh_component_added, - mesh_entity.has_component(mesh_name)) + mesh_entity.has_component(Atom.mesh())) # 3. UNDO the entity creation and component addition. # -> UNDO component addition. @@ -125,17 +125,16 @@ def AtomEditorComponents_Mesh_AddedToEntity(): Report.result(Tests.creation_redo, mesh_entity.exists()) # 5. Set Mesh component asset property - mesh_property_asset = 'Controller|Configuration|Mesh Asset' model_path = os.path.join('Objects', 'shaderball', 'shaderball_default_1m.azmodel') model = Asset.find_asset_by_path(model_path) - mesh_component.set_component_property_value(mesh_property_asset, model.id) + mesh_component.set_component_property_value(Atom.mesh('Mesh Asset'), model.id) Report.result(Tests.mesh_asset_specified, - mesh_component.get_component_property_value(mesh_property_asset) == model.id) + mesh_component.get_component_property_value(Atom.mesh('Mesh Asset')) == model.id) # 6. Enter/Exit game mode. - helper.enter_game_mode(Tests.enter_game_mode) + TestHelper.enter_game_mode(Tests.enter_game_mode) general.idle_wait_frames(1) - helper.exit_game_mode(Tests.exit_game_mode) + TestHelper.exit_game_mode(Tests.exit_game_mode) # 7. Test IsHidden. mesh_entity.set_visibility_state(False) @@ -159,7 +158,7 @@ def AtomEditorComponents_Mesh_AddedToEntity(): Report.result(Tests.deletion_redo, not mesh_entity.exists()) # 12. Look for errors or asserts. - helper.wait_for_condition(lambda: error_tracer.has_errors or error_tracer.has_asserts, 1.0) + TestHelper.wait_for_condition(lambda: error_tracer.has_errors or error_tracer.has_asserts, 1.0) for error_info in error_tracer.errors: Report.info(f"Error: {error_info.filename} {error_info.function} | {error_info.message}") for assert_info in error_tracer.asserts: From 5b70b2a8a95f88e9267d26b93d3b98907cf5269a Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Mon, 18 Oct 2021 14:37:57 -0700 Subject: [PATCH 2/5] reordering constant and class in file Signed-off-by: Scott Murray --- .../Atom/atom_utils/atom_constants.py | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/atom_constants.py b/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/atom_constants.py index e6c422eb46..b66e5f77e4 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/atom_constants.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/atom_constants.py @@ -7,6 +7,19 @@ 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, +} + + class AtomComponentProperties: """ Holds Atom component related constants @@ -372,16 +385,3 @@ class AtomComponentProperties: 'requires': [AtomComponentProperties.postfx_layer()], } return properties[property] - - -# 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 9f7c80ce23b32468579143126e81bd8102fb3400 Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Mon, 18 Oct 2021 16:30:01 -0700 Subject: [PATCH 3/5] removing an extra blank line and fixing a docstring Signed-off-by: Scott Murray --- .../Gem/PythonTests/Atom/atom_utils/atom_constants.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/atom_constants.py b/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/atom_constants.py index b66e5f77e4..35cec8898b 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/atom_constants.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/atom_constants.py @@ -6,7 +6,6 @@ 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, @@ -124,7 +123,7 @@ class AtomComponentProperties: """ Directional Light component properties. 'Camera' an EditorEntity.id reference to the Camera component that controls cascaded shadow view frustum. - Must be a different entity than the one which hosts Depth of Field component. + Must be a different entity than the one which hosts Directional Light component. :param property: From the last element of the property tree path. Default 'name' for component name string. :return: Full property path OR component name if no property specified. """ From 5bc334be70cd29521ce66010f80025550d78b27f Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Tue, 19 Oct 2021 11:21:00 -0700 Subject: [PATCH 4/5] updating docstrings for formatting and typos Signed-off-by: Scott Murray --- .../Atom/atom_utils/atom_constants.py | 76 ++++++++++++------- 1 file changed, 49 insertions(+), 27 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/atom_constants.py b/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/atom_constants.py index 35cec8898b..86fa3bb7e1 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/atom_constants.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/atom_constants.py @@ -37,9 +37,11 @@ class AtomComponentProperties: return properties[property] @staticmethod - def bloom(property: str = 'name') -> str: + def bloom(property: str = 'name') -> Union[str, List[str]]: """ Bloom component properties. Requires PostFX Layer component. + - 'requires' a list of component names as strings required by this component. + Use editor_entity_utils EditorEntity.add_components(list) to add this list of requirements.\n :param property: From the last element of the property tree path. Default 'name' for component name string. :return: Full property path OR component name if no property specified. """ @@ -65,7 +67,7 @@ class AtomComponentProperties: def decal(property: str = 'name') -> str: """ Decal component properties. - 'Material' the material Asset.id of the decal. + - 'Material' the material Asset.id of the decal. :param property: From the last element of the property tree path. Default 'name' for component name string. :return: Full property path OR component name if no property specified. """ @@ -76,9 +78,11 @@ class AtomComponentProperties: return properties[property] @staticmethod - def deferred_fog(property: str = 'name') -> str: + def deferred_fog(property: str = 'name') -> Union[str, List[str]]: """ Deferred Fog component properties. Requires PostFX Layer component. + - 'requires' a list of component names as strings required by this component. + Use editor_entity_utils EditorEntity.add_components(list) to add this list of requirements.\n :param property: From the last element of the property tree path. Default 'name' for component name string. :return: Full property path OR component name if no property specified. """ @@ -89,11 +93,13 @@ class AtomComponentProperties: return properties[property] @staticmethod - def depth_of_field(property: str = 'name') -> str: + def depth_of_field(property: str = 'name') -> Union[str, List[str]]: """ Depth of Field component properties. Requires PostFX Layer component. - 'Camera Entity' an EditorEntity.id reference to the Camera component required for this effect. - Must be a different entity than the one which hosts Depth of Field component. + - 'requires' a list of component names as strings required by this component. + Use editor_entity_utils EditorEntity.add_components(list) to add this list of requirements.\n + - 'Camera Entity' an EditorEntity.id reference to the Camera component required for this effect. + Must be a different entity than the one which hosts Depth of Field component.\n :param property: From the last element of the property tree path. Default 'name' for component name string. :return: Full property path OR component name if no property specified. """ @@ -105,10 +111,10 @@ class AtomComponentProperties: return properties[property] @staticmethod - def diffuse_probe(property: str = 'name') -> str: + def diffuse_probe(property: str = 'name') -> Union[str, List[str]]: """ - Diffuse Probe Grid component properties. Requires one of 'shapes' listed. - 'shapes' a list of supported shapes as component names. + Diffuse Probe Grid component properties. Requires one of 'shapes'. + - 'shapes' a list of supported shapes as component names. :param property: From the last element of the property tree path. Default 'name' for component name string. :return: Full property path OR component name if no property specified. """ @@ -122,8 +128,8 @@ class AtomComponentProperties: def directional_light(property: str = 'name') -> str: """ Directional Light component properties. - 'Camera' an EditorEntity.id reference to the Camera component that controls cascaded shadow view frustum. - Must be a different entity than the one which hosts Directional Light component. + - 'Camera' an EditorEntity.id reference to the Camera component that controls cascaded shadow view frustum. + Must be a different entity than the one which hosts Directional Light component.\n :param property: From the last element of the property tree path. Default 'name' for component name string. :return: Full property path OR component name if no property specified. """ @@ -158,9 +164,11 @@ class AtomComponentProperties: return properties[property] @staticmethod - def exposure_control(property: str = 'name') -> str: + def exposure_control(property: str = 'name') -> Union[str, List[str]]: """ Exposure Control component properties. Requires PostFX Layer component. + - 'requires' a list of component names as strings required by this component. + Use editor_entity_utils EditorEntity.add_components(list) to add this list of requirements.\n :param property: From the last element of the property tree path. Default 'name' for component name string. :return: Full property path OR component name if no property specified. """ @@ -174,8 +182,8 @@ class AtomComponentProperties: def global_skylight(property: str = 'name') -> str: """ Global Skylight (IBL) component properties. - 'Diffuse Image' Asset.id for the cubemap image for determining diffuse lighting. - 'Specular Image' Asset.id for the cubemap image for determining specular lighting. + - 'Diffuse Image' Asset.id for the cubemap image for determining diffuse lighting. + - 'Specular Image' Asset.id for the cubemap image for determining specular lighting. :param property: From the last element of the property tree path. Default 'name' for component name string. :return: Full property path OR component name if no property specified. """ @@ -199,9 +207,11 @@ class AtomComponentProperties: return properties[property] @staticmethod - def hdr_color_grading(property: str = 'name') -> str: + def hdr_color_grading(property: str = 'name') -> Union[str, List[str]]: """ HDR Color Grading component properties. Requires PostFX Layer component. + - 'requires' a list of component names as strings required by this component. + Use editor_entity_utils EditorEntity.add_components(list) to add this list of requirements.\n :param property: From the last element of the property tree path. Default 'name' for component name string. :return: Full property path OR component name if no property specified. """ @@ -227,7 +237,7 @@ class AtomComponentProperties: def light(property: str = 'name') -> str: """ Light component properties. - 'Light type' from atom_constants.py LIGHT_TYPES + - 'Light type' from atom_constants.py LIGHT_TYPES :param property: From the last element of the property tree path. Default 'name' for component name string. :return: Full property path OR component name if no property specified. """ @@ -238,9 +248,11 @@ class AtomComponentProperties: return properties[property] @staticmethod - def look_modification(property: str = 'name') -> str: + def look_modification(property: str = 'name') -> Union[str, List[str]]: """ Look Modification component properties. Requires PostFX Layer component. + - 'requires' a list of component names as strings required by this component. + Use editor_entity_utils EditorEntity.add_components(list) to add this list of requirements.\n :param property: From the last element of the property tree path. Default 'name' for component name string. :return: Full property path OR component name if no property specified. """ @@ -251,9 +263,11 @@ class AtomComponentProperties: return properties[property] @staticmethod - def material(property: str = 'name') -> str: + def material(property: str = 'name') -> Union[str, List[str]]: """ Material component properties. Requires one of Actor OR Mesh component. + - 'requires' a list of component names as strings required by this component. + Only one of these is required at a time for this component.\n :param property: From the last element of the property tree path. Default 'name' for component name string. :return: Full property path OR component name if no property specified. """ @@ -267,7 +281,7 @@ class AtomComponentProperties: def mesh(property: str = 'name') -> str: """ Mesh component properties. - 'Mesh Asset' Asset.id of the mesh model. + - 'Mesh Asset' Asset.id of the mesh model. :param property: From the last element of the property tree path. Default 'name' for component name string. :return: Full property path OR component name if no property specified. :rtype: str @@ -315,9 +329,11 @@ class AtomComponentProperties: return properties[property] @staticmethod - def postfx_gradient(property: str = 'name') -> str: + def postfx_gradient(property: str = 'name') -> Union[str, List[str]]: """ PostFX Gradient Weight Modifier component properties. Requires PostFX Layer component. + - 'requires' a list of component names as strings required by this component. + Use editor_entity_utils EditorEntity.add_components(list) to add this list of requirements.\n :param property: From the last element of the property tree path. Default 'name' for component name string. :return: Full property path OR component name if no property specified. """ @@ -328,9 +344,11 @@ class AtomComponentProperties: return properties[property] @staticmethod - def postfx_radius(property: str = 'name') -> str: + def postfx_radius(property: str = 'name') -> Union[str, List[str]]: """ PostFX Radius Weight Modifier component properties. Requires PostFX Layer component. + - 'requires' a list of component names as strings required by this component. + Use editor_entity_utils EditorEntity.add_components(list) to add this list of requirements.\n :param property: From the last element of the property tree path. Default 'name' for component name string. :return: Full property path OR component name if no property specified. """ @@ -341,10 +359,12 @@ class AtomComponentProperties: return properties[property] @staticmethod - def postfx_shape(property: str = 'name') -> str: + def postfx_shape(property: str = 'name') -> Union[str, List[str]]: """ PostFX Shape Weight Modifier component properties. Requires PostFX Layer and one of 'shapes' listed. - 'shapes' a list of supported shapes as component names. 'Tube Shape' is also supported by requires 'Spline'. + - 'requires' a list of component names as strings required by this component. + Use editor_entity_utils EditorEntity.add_components(list) to add this list of requirements.\n + - 'shapes' a list of supported shapes as component names. 'Tube Shape' is also supported but requires 'Spline'. :param property: From the last element of the property tree path. Default 'name' for component name string. :return: Full property path OR component name if no property specified. """ @@ -357,11 +377,11 @@ class AtomComponentProperties: return properties[property] @staticmethod - def reflection_probe(property: str = 'name') -> str: + def reflection_probe(property: str = 'name') -> Union[str, List[str]]: """ Reflection Probe component properties. Requires one of 'shapes' listed. - 'shapes' a list of supported shapes as component names. - 'Baked Cubemap Path' Asset.id of the baked cubemap image generated by a call to 'BakeReflectionProbe' ebus. + - 'shapes' a list of supported shapes as component names. + - 'Baked Cubemap Path' Asset.id of the baked cubemap image generated by a call to 'BakeReflectionProbe' ebus. :param property: From the last element of the property tree path. Default 'name' for component name string. :return: Full property path OR component name if no property specified. """ @@ -373,9 +393,11 @@ class AtomComponentProperties: return properties[property] @staticmethod - def ssao(property: str = 'name') -> str: + def ssao(property: str = 'name') -> Union[str, List[str]]: """ SSAO component properties. Requires PostFX Layer component. + - 'requires' a list of component names as strings required by this component. + Use editor_entity_utils EditorEntity.add_components(list) to add this list of requirements.\n :param property: From the last element of the property tree path. Default 'name' for component name string. :return: Full property path OR component name if no property specified. """ From 0c7e732527b4da943cfa9c86b7ad6e22c2114fe2 Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Wed, 20 Oct 2021 14:20:49 -0700 Subject: [PATCH 5/5] removing return type Union which is not supported Signed-off-by: Scott Murray --- .../Atom/atom_utils/atom_constants.py | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/atom_constants.py b/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/atom_constants.py index 86fa3bb7e1..344a0dbd29 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/atom_constants.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/atom_constants.py @@ -37,7 +37,7 @@ class AtomComponentProperties: return properties[property] @staticmethod - def bloom(property: str = 'name') -> Union[str, List[str]]: + def bloom(property: str = 'name') -> str: """ Bloom component properties. Requires PostFX Layer component. - 'requires' a list of component names as strings required by this component. @@ -78,7 +78,7 @@ class AtomComponentProperties: return properties[property] @staticmethod - def deferred_fog(property: str = 'name') -> Union[str, List[str]]: + def deferred_fog(property: str = 'name') -> str: """ Deferred Fog component properties. Requires PostFX Layer component. - 'requires' a list of component names as strings required by this component. @@ -93,7 +93,7 @@ class AtomComponentProperties: return properties[property] @staticmethod - def depth_of_field(property: str = 'name') -> Union[str, List[str]]: + def depth_of_field(property: str = 'name') -> str: """ Depth of Field component properties. Requires PostFX Layer component. - 'requires' a list of component names as strings required by this component. @@ -111,7 +111,7 @@ class AtomComponentProperties: return properties[property] @staticmethod - def diffuse_probe(property: str = 'name') -> Union[str, List[str]]: + def diffuse_probe(property: str = 'name') -> str: """ Diffuse Probe Grid component properties. Requires one of 'shapes'. - 'shapes' a list of supported shapes as component names. @@ -164,7 +164,7 @@ class AtomComponentProperties: return properties[property] @staticmethod - def exposure_control(property: str = 'name') -> Union[str, List[str]]: + def exposure_control(property: str = 'name') -> str: """ Exposure Control component properties. Requires PostFX Layer component. - 'requires' a list of component names as strings required by this component. @@ -207,7 +207,7 @@ class AtomComponentProperties: return properties[property] @staticmethod - def hdr_color_grading(property: str = 'name') -> Union[str, List[str]]: + def hdr_color_grading(property: str = 'name') -> str: """ HDR Color Grading component properties. Requires PostFX Layer component. - 'requires' a list of component names as strings required by this component. @@ -248,7 +248,7 @@ class AtomComponentProperties: return properties[property] @staticmethod - def look_modification(property: str = 'name') -> Union[str, List[str]]: + def look_modification(property: str = 'name') -> str: """ Look Modification component properties. Requires PostFX Layer component. - 'requires' a list of component names as strings required by this component. @@ -263,7 +263,7 @@ class AtomComponentProperties: return properties[property] @staticmethod - def material(property: str = 'name') -> Union[str, List[str]]: + def material(property: str = 'name') -> str: """ Material component properties. Requires one of Actor OR Mesh component. - 'requires' a list of component names as strings required by this component. @@ -329,7 +329,7 @@ class AtomComponentProperties: return properties[property] @staticmethod - def postfx_gradient(property: str = 'name') -> Union[str, List[str]]: + def postfx_gradient(property: str = 'name') -> str: """ PostFX Gradient Weight Modifier component properties. Requires PostFX Layer component. - 'requires' a list of component names as strings required by this component. @@ -344,7 +344,7 @@ class AtomComponentProperties: return properties[property] @staticmethod - def postfx_radius(property: str = 'name') -> Union[str, List[str]]: + def postfx_radius(property: str = 'name') -> str: """ PostFX Radius Weight Modifier component properties. Requires PostFX Layer component. - 'requires' a list of component names as strings required by this component. @@ -359,7 +359,7 @@ class AtomComponentProperties: return properties[property] @staticmethod - def postfx_shape(property: str = 'name') -> Union[str, List[str]]: + def postfx_shape(property: str = 'name') -> str: """ PostFX Shape Weight Modifier component properties. Requires PostFX Layer and one of 'shapes' listed. - 'requires' a list of component names as strings required by this component. @@ -377,7 +377,7 @@ class AtomComponentProperties: return properties[property] @staticmethod - def reflection_probe(property: str = 'name') -> Union[str, List[str]]: + def reflection_probe(property: str = 'name') -> str: """ Reflection Probe component properties. Requires one of 'shapes' listed. - 'shapes' a list of supported shapes as component names. @@ -393,7 +393,7 @@ class AtomComponentProperties: return properties[property] @staticmethod - def ssao(property: str = 'name') -> Union[str, List[str]]: + def ssao(property: str = 'name') -> str: """ SSAO component properties. Requires PostFX Layer component. - 'requires' a list of component names as strings required by this component.