Merge branch 'main' into carlitosan-parser-fixes

main
chcurran 5 years ago
commit 5544621bcc

@ -15,9 +15,9 @@ sys.path.append(os.path.dirname(os.path.abspath(__file__)))
from ActorSplitsAfterDamage import Tests
def run():
from ActorSplitsAfterDamage import run as internal_run
from editor_python_test_tools.utils import Constants
def ActorSplitsAfterCapsuleDamage():
from ActorSplitsAfterDamage import base_run as internal_run
from BlastUtils import Constants
def CapsuleDamage(target_id, position0):
position1 = azlmbr.object.construct('Vector3', position0.x + 1.0, position0.y, position0.z)
@ -30,4 +30,8 @@ def run():
if __name__ == "__main__":
run()
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
Report.start_test(ActorSplitsAfterCapsuleDamage)

@ -22,7 +22,7 @@ class Tests():
# fmt: on
def run():
def ActorSplitsAfterCollision():
"""
Summary:
@ -60,8 +60,8 @@ def run():
import azlmbr.legacy.general as general
import azlmbr.bus
from editor_python_test_tools.utils import CollisionHandler
from editor_python_test_tools.utils import BlastNotificationHandler
from BlastUtils import CollisionHandler
from BlastUtils import BlastNotificationHandler
# Constants
TIMEOUT = 2.0
@ -107,4 +107,8 @@ def run():
if __name__ == "__main__":
run()
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
Report.start_test(ActorSplitsAfterCollision)

@ -20,7 +20,7 @@ class Tests():
# fmt: on
def run(damage_func):
def base_run(damage_func):
"""
Summary:
@ -56,7 +56,7 @@ def run(damage_func):
import azlmbr.legacy.general as general
import azlmbr.bus
from editor_python_test_tools.utils import BlastNotificationHandler
from BlastUtils import BlastNotificationHandler
# Constants
TIMEOUT = 2.0

@ -15,9 +15,9 @@ sys.path.append(os.path.dirname(os.path.abspath(__file__)))
from ActorSplitsAfterDamage import Tests
def run():
from ActorSplitsAfterDamage import run as internal_run
from editor_python_test_tools.utils import Constants
def ActorSplitsAfterImpactSpreadDamage():
from ActorSplitsAfterDamage import base_run as internal_run
from BlastUtils import Constants
def ImpactSpreadDamage(target_id, position):
azlmbr.destruction.BlastFamilyDamageRequestBus(azlmbr.bus.Event, "Impact Spread Damage", target_id,
@ -28,4 +28,8 @@ def run():
if __name__ == "__main__":
run()
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
Report.start_test(ActorSplitsAfterImpactSpreadDamage)

@ -15,9 +15,9 @@ sys.path.append(os.path.dirname(os.path.abspath(__file__)))
from ActorSplitsAfterDamage import Tests
def run():
from ActorSplitsAfterDamage import run as internal_run
from editor_python_test_tools.utils import Constants
def ActorSplitsAfterRadialDamage():
from ActorSplitsAfterDamage import base_run as internal_run
from BlastUtils import Constants
def RadialDamage(target_id, position):
azlmbr.destruction.BlastFamilyDamageRequestBus(azlmbr.bus.Event, "Radial Damage", target_id,
@ -28,4 +28,8 @@ def run():
if __name__ == "__main__":
run()
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
Report.start_test(ActorSplitsAfterRadialDamage)

@ -15,9 +15,9 @@ sys.path.append(os.path.dirname(os.path.abspath(__file__)))
from ActorSplitsAfterDamage import Tests
def run():
from ActorSplitsAfterDamage import run as internal_run
from editor_python_test_tools.utils import Constants
def ActorSplitsAfterShearDamage():
from ActorSplitsAfterDamage import base_run as internal_run
from BlastUtils import Constants
def ShearDamage(target_id, position):
normal = azlmbr.object.construct('Vector3', 1.0, 0.0, 0.0)
@ -29,4 +29,8 @@ def run():
if __name__ == "__main__":
run()
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
Report.start_test(ActorSplitsAfterShearDamage)

@ -15,9 +15,9 @@ sys.path.append(os.path.dirname(os.path.abspath(__file__)))
from ActorSplitsAfterDamage import Tests
def run():
from ActorSplitsAfterDamage import run as internal_run
from editor_python_test_tools.utils import Constants
def ActorSplitsAfterStressDamage():
from ActorSplitsAfterDamage import base_run as internal_run
from BlastUtils import Constants
def StressDamage(target_id, position):
force = azlmbr.object.construct('Vector3', 0.0, 0.0, -100.0) # Should be enough to break `brittle` objects
@ -28,4 +28,8 @@ def run():
if __name__ == "__main__":
run()
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
Report.start_test(ActorSplitsAfterStressDamage)

@ -15,9 +15,9 @@ sys.path.append(os.path.dirname(os.path.abspath(__file__)))
from ActorSplitsAfterDamage import Tests
def run():
from ActorSplitsAfterDamage import run as internal_run
from editor_python_test_tools.utils import Constants
def ActorSplitsAfterTriangleDamage():
from ActorSplitsAfterDamage import base_run as internal_run
from BlastUtils import Constants
def TriangleDamage(target_id, position):
# Some points that form a triangle that contains the given position
@ -32,4 +32,8 @@ def run():
if __name__ == "__main__":
run()
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
Report.start_test(ActorSplitsAfterTriangleDamage)

@ -16,39 +16,53 @@
ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME})
add_subdirectory(assetpipeline)
add_subdirectory(atom_renderer)
## Physics ##
# DISABLED - see LYN-2536
#if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
# ly_add_pytest(
# NAME AutomatedTesting::PhysicsTests
# TEST_SUITE main
# TEST_SERIAL
# PATH ${CMAKE_CURRENT_LIST_DIR}/physics/TestSuite_Active.py
# TIMEOUT 3600
# RUNTIME_DEPENDENCIES
# Legacy::Editor
# Legacy::CryRenderNULL
# AZ::AssetProcessor
# AutomatedTesting.Assets
# COMPONENT
# Physics
# )
# ly_add_pytest(
# NAME AutomatedTesting::PhysicsTests_Sandbox
# TEST_SUITE sandbox
# TEST_SERIAL
# PATH ${CMAKE_CURRENT_LIST_DIR}/physics/TestSuite_Sandbox.py
# TIMEOUT 3600
# RUNTIME_DEPENDENCIES
# Legacy::Editor
# Legacy::CryRenderNULL
# AZ::AssetProcessor
# AutomatedTesting.Assets
# COMPONENT
# Physics
# )
#endif()
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
ly_add_pytest(
NAME AutomatedTesting::PhysicsTests_Main
TEST_SUITE main
TEST_SERIAL
PATH ${CMAKE_CURRENT_LIST_DIR}/physics/TestSuite_Main.py
TIMEOUT 3600
RUNTIME_DEPENDENCIES
Legacy::Editor
Legacy::CryRenderNULL
AZ::AssetProcessor
AutomatedTesting.Assets
COMPONENT
Physics
)
ly_add_pytest(
NAME AutomatedTesting::PhysicsTests_Periodic
TEST_SUITE periodic
TEST_SERIAL
PATH ${CMAKE_CURRENT_LIST_DIR}/physics/TestSuite_Periodic.py
TIMEOUT 3600
RUNTIME_DEPENDENCIES
Legacy::Editor
Legacy::CryRenderNULL
AZ::AssetProcessor
AutomatedTesting.Assets
COMPONENT
Physics
)
ly_add_pytest(
NAME AutomatedTesting::PhysicsTests_Sandbox
TEST_SUITE sandbox
TEST_SERIAL
PATH ${CMAKE_CURRENT_LIST_DIR}/physics/TestSuite_Sandbox.py
TIMEOUT 3600
RUNTIME_DEPENDENCIES
Legacy::Editor
Legacy::CryRenderNULL
AZ::AssetProcessor
AutomatedTesting.Assets
COMPONENT
Physics
)
endif()
## ScriptCanvas ##
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
@ -81,23 +95,22 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
endif()
## White Box ##
# DISABLED - See LYN-2663
#if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
# ly_add_pytest(
# NAME AutomatedTesting::WhiteBoxTests
# TEST_SUITE main
# TEST_SERIAL
# PATH ${CMAKE_CURRENT_LIST_DIR}/WhiteBox/TestSuite_Active.py
# TIMEOUT 3600
# RUNTIME_DEPENDENCIES
# Legacy::Editor
# Legacy::CryRenderNULL
# AZ::AssetProcessor
# AutomatedTesting.Assets
# COMPONENT
# WhiteBox
# )
#endif()
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
ly_add_pytest(
NAME AutomatedTesting::WhiteBoxTests
TEST_SUITE main
TEST_SERIAL
PATH ${CMAKE_CURRENT_LIST_DIR}/WhiteBox/TestSuite_Active.py
TIMEOUT 3600
RUNTIME_DEPENDENCIES
Legacy::Editor
Legacy::CryRenderNULL
AZ::AssetProcessor
AutomatedTesting.Assets
COMPONENT
WhiteBox
)
endif()
## NvCloth ##
# [TODO LYN-1928] Enable when AutomatedTesting runs with Atom
@ -157,7 +170,7 @@ endif()
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
ly_add_pytest(
NAME AutomatedTesting::BlastTests
TEST_SUITE periodic
TEST_SUITE main
TEST_SERIAL TRUE
PATH ${CMAKE_CURRENT_LIST_DIR}/Blast/TestSuite_Active.py
TIMEOUT 3600
@ -165,6 +178,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
Legacy::Editor
AZ::AssetProcessor
AutomatedTesting.Assets
COMPONENT Blast
)
endif()
@ -177,8 +191,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_
## DynVeg ##
ly_add_pytest(
NAME DynamicVegetationTests_Main_GPU
TEST_REQUIRES gpu
NAME AutomatedTesting::DynamicVegetationTests_Main
TEST_SERIAL
TEST_SUITE main
PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/dyn_veg
@ -194,8 +207,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_
)
ly_add_pytest(
NAME DynamicVegetationTests_Sandbox_GPU
TEST_REQUIRES gpu
NAME AutomatedTesting::DynamicVegetationTests_Sandbox
TEST_SERIAL
TEST_SUITE sandbox
PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/dyn_veg
@ -211,8 +223,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_
)
ly_add_pytest(
NAME DynamicVegetationTests_Periodic_GPU
TEST_REQUIRES gpu
NAME AutomatedTesting::DynamicVegetationTests_Periodic
TEST_SERIAL
TEST_SUITE periodic
PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/dyn_veg
@ -228,8 +239,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_
## LandscapeCanvas ##
ly_add_pytest(
NAME LandscapeCanvasTests_Main
TEST_REQUIRES gpu
NAME AutomatedTesting::LandscapeCanvasTests_Main
TEST_SERIAL
TEST_SUITE main
PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/landscape_canvas
@ -244,8 +254,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_
)
ly_add_pytest(
NAME LandscapeCanvasTests_Periodic
TEST_REQUIRES gpu
NAME AutomatedTesting::LandscapeCanvasTests_Periodic
TEST_SERIAL
TEST_SUITE periodic
PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/landscape_canvas
@ -261,8 +270,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_
## GradientSignal ##
ly_add_pytest(
NAME GradientSignalTests_Periodic
TEST_REQUIRES gpu
NAME AutomatedTesting::GradientSignalTests_Periodic
TEST_SERIAL
TEST_SUITE periodic
PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/gradient_signal
@ -280,7 +288,7 @@ endif()
## Editor ##
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_FOUNDATION_TEST_SUPPORTED)
ly_add_pytest(
NAME EditorTests_Periodic
NAME AutomatedTesting::EditorTests_Periodic
TEST_SUITE periodic
TEST_SERIAL
PATH ${CMAKE_CURRENT_LIST_DIR}/editor
@ -298,7 +306,7 @@ endif()
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
# Unstable, SPEC-3838 will restore
#ly_add_pytest(
# NAME asset_load_benchmark_test
# NAME AutomatedTesting::asset_load_benchmark_test
# TEST_SERIAL
# TEST_SUITE benchmark
# PATH ${CMAKE_CURRENT_LIST_DIR}/streaming/benchmark/asset_load_benchmark_test.py

@ -32,7 +32,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=False, cfg_args=[],
halt_on_unexpected=False, run_python="--runpythontest", auto_test_mode=True, null_renderer=True, cfg_args=[],
timeout=300):
"""
Runs the Editor with the specified script, and monitors for expected log lines.
@ -58,7 +58,7 @@ def launch_and_validate_results(request, test_directory, editor, editor_script,
if auto_test_mode:
editor.args.extend(["--autotest_mode"])
if null_renderer:
editor.args.extend(["-NullRenderer"])
editor.args.extend(["-rhi=Null"])
with editor.start():

@ -278,6 +278,12 @@ class Tracer:
self.function = args[3]
self.message = args[4]
def __str__(self):
return f"Warning: [{self.filename}:{self.function}:{self.line}]: [{self.window}] {self.message}"
def __repr__(self):
return f"[Warning: {self.message}]"
class ErrorInfo:
def __init__(self, args):
self.window = args[0]
@ -285,6 +291,12 @@ class Tracer:
self.line = args[2]
self.function = args[3]
self.message = args[4]
def __str__(self):
return f"Error: [{self.filename}:{self.function}:{self.line}]: [{self.window}] {self.message}"
def __repr__(self):
return f"[Error: {self.message}]"
class AssertInfo:
def __init__(self, args):
@ -292,6 +304,12 @@ class Tracer:
self.line = args[1]
self.function = args[2]
self.message = args[3]
def __str__(self):
return f"Assert: [{self.filename}:{self.function}:{self.line}]: {self.message}"
def __repr__(self):
return f"[Assert: {self.message}]"
def _on_warning(self, args):
warningInfo = Tracer.WarningInfo(args)

@ -22,10 +22,10 @@ class Tests():
# fmt:on
def run():
def C28798177_WhiteBox_AddComponentToEntity():
import os
import sys
import WhiteBoxInit as init
from Gems.WhiteBox.Editor.Scripts import WhiteBoxInit as init
import ImportPathHelper as imports
imports.init()
@ -58,4 +58,8 @@ def run():
if __name__ == "__main__":
run()
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
Report.start_test(C28798177_WhiteBox_AddComponentToEntity)

@ -22,13 +22,13 @@ class Tests():
# fmt:on
def run():
def C28798205_WhiteBox_SetInvisible():
# note: This automated test does not fully replicate the test case in Test Rail as it's
# not currently possible using the Hydra API to get an EntityComponentIdPair at runtime,
# in future game_mode will be activated and a runtime White Box Component queried
import os
import sys
import WhiteBoxInit as init
from Gems.WhiteBox.Editor.Scripts import WhiteBoxInit as init
import ImportPathHelper as imports
import editor_python_test_tools.hydra_editor_utils as hydra
imports.init()
@ -68,4 +68,8 @@ def run():
if __name__ == "__main__":
run()
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
Report.start_test(C28798205_WhiteBox_SetInvisible)

@ -26,10 +26,10 @@ class Tests():
critical_shape_check = ("Default shape has more than 0 sides", "default shape has 0 sides")
def run():
def C29279329_WhiteBox_SetDefaultShape():
import os
import sys
import WhiteBoxInit as init
from Gems.WhiteBox.Editor.Scripts import WhiteBoxInit as init
import ImportPathHelper as imports
imports.init()
@ -107,4 +107,8 @@ def run():
if __name__ == "__main__":
run()
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
Report.start_test(C29279329_WhiteBox_SetDefaultShape)

@ -0,0 +1,40 @@
#
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
# its licensors.
#
# For complete copyright and license terms please see the LICENSE at the root of this
# distribution (the "License"). All use of this software is governed by the License,
# or, if provided, by the license below or the license accompanying this file. Do not
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#
################################################################################
# Atom Renderer: Automated Tests
# Runs EditorPythonBindings (hydra) scripts inside the Editor to verify test results for the Atom renderer.
################################################################################
if(PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_BUILD_TESTS_SUPPORTED AND AutomatedTesting IN_LIST LY_PROJECTS)
ly_add_pytest(
NAME AutomatedTesting::AtomRenderer_HydraTests_Main
TEST_SUITE main
PATH ${CMAKE_CURRENT_LIST_DIR}/test_Atom_MainSuite.py
TEST_SERIAL
TIMEOUT 300
RUNTIME_DEPENDENCIES
AssetProcessor
AutomatedTesting.Assets
Editor
)
ly_add_pytest(
NAME AutomatedTesting::AtomRenderer_HydraTests_Sandbox
TEST_SUITE sandbox
PATH ${CMAKE_CURRENT_LIST_DIR}/test_Atom_SandboxSuite.py
TEST_SERIAL
TIMEOUT 300
RUNTIME_DEPENDENCIES
AssetProcessor
AutomatedTesting.Assets
Editor
)
endif()

@ -0,0 +1,10 @@
"""
All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
its licensors.
For complete copyright and license terms please see the LICENSE at the root of this
distribution (the "License"). All use of this software is governed by the License,
or, if provided, by the license below or the license accompanying this file. Do not
remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
"""

@ -0,0 +1,10 @@
"""
All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
its licensors.
For complete copyright and license terms please see the LICENSE at the root of this
distribution (the "License"). All use of this software is governed by the License,
or, if provided, by the license below or the license accompanying this file. Do not
remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
"""

@ -0,0 +1,233 @@
"""
All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
its licensors.
For complete copyright and license terms please see the LICENSE at the root of this
distribution (the "License"). All use of this software is governed by the License,
or, if provided, by the license below or the license accompanying this file. Do not
remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Hydra script that creates an entity and attaches Atom components to it for test verification.
"""
import os
import sys
import azlmbr.math as math
import azlmbr.bus as bus
import azlmbr.paths
import azlmbr.asset as asset
import azlmbr.entity as entity
import azlmbr.legacy.general as general
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.utils import TestHelper
def run():
"""
Summary:
The below common tests are done for each of the components.
1) Addition of component to the entity
2) UNDO/REDO of addition of component
3) Enter/Exit game mode
4) Hide/Show entity containing component
5) Deletion of component
6) UNDO/REDO of deletion of component
Some additional tests for specific components include
1) Assigning value to some properties of each component
2) Verifying if the component is activated only when the required components are added
Expected Result:
1) Component can be added to an entity.
2) The addition of component can be undone and redone.
3) Game mode can be entered/exited without issue.
4) Entity with component can be hidden/shown.
5) Component can be deleted.
6) The deletion of component can be undone and redone.
7) Component is activated only when the required components are added
8) Values can be assigned to the properties of the component
:return: None
"""
def create_entity_undo_redo_component_addition(component_name):
new_entity = hydra.Entity(f"{component_name}")
new_entity.create_entity(math.Vector3(512.0, 512.0, 34.0), [component_name])
general.log(f"{component_name}_test: Component added to the entity: "
f"{hydra.has_components(new_entity.id, [component_name])}")
# undo component addition
general.undo()
TestHelper.wait_for_condition(lambda: not hydra.has_components(new_entity.id, [component_name]), 2.0)
general.log(f"{component_name}_test: Component removed after UNDO: "
f"{not hydra.has_components(new_entity.id, [component_name])}")
# redo component addition
general.redo()
TestHelper.wait_for_condition(lambda: hydra.has_components(new_entity.id, [component_name]), 2.0)
general.log(f"{component_name}_test: Component added after REDO: "
f"{hydra.has_components(new_entity.id, [component_name])}")
return new_entity
def verify_enter_exit_game_mode(component_name):
general.enter_game_mode()
TestHelper.wait_for_condition(lambda: general.is_in_game_mode(), 1.0)
general.log(f"{component_name}_test: Entered game mode: {general.is_in_game_mode()}")
general.exit_game_mode()
TestHelper.wait_for_condition(lambda: not general.is_in_game_mode(), 1.0)
general.log(f"{component_name}_test: Exit game mode: {not general.is_in_game_mode()}")
def verify_hide_unhide_entity(component_name, entity_obj):
def is_entity_hidden(entity_id):
return editor.EditorEntityInfoRequestBus(bus.Event, "IsHidden", entity_id)
editor.EditorEntityAPIBus(bus.Event, "SetVisibilityState", entity_obj.id, False)
general.idle_wait_frames(1)
general.log(f"{component_name}_test: Entity is hidden: {is_entity_hidden(entity_obj.id)}")
editor.EditorEntityAPIBus(bus.Event, "SetVisibilityState", entity_obj.id, True)
general.idle_wait_frames(1)
general.log(f"{component_name}_test: Entity is shown: {not is_entity_hidden(entity_obj.id)}")
def verify_deletion_undo_redo(component_name, entity_obj):
editor.ToolsApplicationRequestBus(bus.Broadcast, "DeleteEntityById", entity_obj.id)
TestHelper.wait_for_condition(lambda: not hydra.find_entity_by_name(entity_obj.name), 1.0)
general.log(f"{component_name}_test: Entity deleted: {not hydra.find_entity_by_name(entity_obj.name)}")
general.undo()
TestHelper.wait_for_condition(lambda: hydra.find_entity_by_name(entity_obj.name) is not None, 1.0)
general.log(f"{component_name}_test: UNDO entity deletion works: "
f"{hydra.find_entity_by_name(entity_obj.name) is not None}")
general.redo()
TestHelper.wait_for_condition(lambda: not hydra.find_entity_by_name(entity_obj.name), 1.0)
general.log(f"{component_name}_test: REDO entity deletion works: "
f"{not hydra.find_entity_by_name(entity_obj.name)}")
def verify_required_component_addition(entity_obj, components_to_add, component_name):
def is_component_enabled(entity_componentid_pair):
return editor.EditorComponentAPIBus(bus.Broadcast, "IsComponentEnabled", entity_componentid_pair)
general.log(
f"{component_name}_test: Entity disabled initially: "
f"{not is_component_enabled(entity_obj.components[0])}")
for component in components_to_add:
entity_obj.add_component(component)
TestHelper.wait_for_condition(lambda: is_component_enabled(entity_obj.components[0]), 1.0)
general.log(
f"{component_name}_test: Entity enabled after adding "
f"required components: {is_component_enabled(entity_obj.components[0])}"
)
def verify_set_property(entity_obj, path, value):
entity_obj.get_set_test(0, path, value)
# Wait for Editor idle loop before executing Python hydra scripts.
TestHelper.init_idle()
# Delete all existing entities initially
search_filter = azlmbr.entity.SearchFilter()
all_entities = entity.SearchBus(azlmbr.bus.Broadcast, "SearchEntities", search_filter)
editor.ToolsApplicationRequestBus(bus.Broadcast, "DeleteEntities", all_entities)
class ComponentTests:
"""Test launcher for each component."""
def __init__(self, component_name, *additional_tests):
self.component_name = component_name
self.additional_tests = additional_tests
self.run_component_tests()
def run_component_tests(self):
# Run common and additional tests
entity_obj = create_entity_undo_redo_component_addition(self.component_name)
# Enter/Exit game mode test
verify_enter_exit_game_mode(self.component_name)
# Any additional tests are executed here
for test in self.additional_tests:
test(entity_obj)
# Hide/Unhide entity test
verify_hide_unhide_entity(self.component_name, entity_obj)
# Deletion/Undo/Redo test
verify_deletion_undo_redo(self.component_name, entity_obj)
# Area Light Component
area_light = "Area Light"
ComponentTests(
area_light, lambda entity_obj: verify_required_component_addition(
entity_obj, ["Capsule Shape"], area_light))
# Decal Component
material_asset_path = os.path.join("Materials", "basic_grey.material")
material_asset = asset.AssetCatalogRequestBus(
bus.Broadcast, "GetAssetIdByPath", material_asset_path, math.Uuid(), False)
ComponentTests(
"Decal", lambda entity_obj: verify_set_property(
entity_obj, "Settings|Decal Settings|Material", material_asset))
# DepthOfField Component
camera_entity = hydra.Entity("camera_entity")
camera_entity.create_entity(math.Vector3(512.0, 512.0, 34.0), ["Camera"])
depth_of_field = "DepthOfField"
ComponentTests(
depth_of_field,
lambda entity_obj: verify_required_component_addition(entity_obj, ["PostFX Layer"], depth_of_field),
lambda entity_obj: verify_set_property(
entity_obj, "Controller|Configuration|Camera Entity", camera_entity.id))
# Directional Light Component
ComponentTests(
"Directional Light",
lambda entity_obj: verify_set_property(
entity_obj, "Controller|Configuration|Shadow|Camera", camera_entity.id))
# Exposure Control Component
ComponentTests(
"Exposure Control", lambda entity_obj: verify_required_component_addition(
entity_obj, ["PostFX Layer"], "Exposure Control"))
# Global Skylight (IBL) Component
diffuse_image_path = os.path.join("LightingPresets", "greenwich_park_02_4k_iblskyboxcm.exr.streamingimage")
diffuse_image_asset = asset.AssetCatalogRequestBus(
bus.Broadcast, "GetAssetIdByPath", diffuse_image_path, math.Uuid(), False)
specular_image_path = os.path.join("LightingPresets", "greenwich_park_02_4k_iblskyboxcm.exr.streamingimage")
specular_image_asset = asset.AssetCatalogRequestBus(
bus.Broadcast, "GetAssetIdByPath", specular_image_path, math.Uuid(), False)
ComponentTests(
"Global Skylight (IBL)",
lambda entity_obj: verify_set_property(
entity_obj, "Controller|Configuration|Diffuse Image", diffuse_image_asset),
lambda entity_obj: verify_set_property(
entity_obj, "Controller|Configuration|Specular Image", specular_image_asset))
# Physical Sky Component
ComponentTests("Physical Sky")
# Point Light Component
ComponentTests("Point Light")
# PostFX Layer Component
ComponentTests("PostFX Layer")
# Radius Weight Modifier Component
ComponentTests("Radius Weight Modifier")
# Light Component
ComponentTests("Light")
# Display Mapper Component
ComponentTests("Display Mapper")
if __name__ == "__main__":
run()

@ -0,0 +1,219 @@
"""
All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
its licensors.
For complete copyright and license terms please see the LICENSE at the root of this
distribution (the "License"). All use of this software is governed by the License,
or, if provided, by the license below or the license accompanying this file. Do not
remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
"""
import logging
import os
import pytest
import editor_python_test_tools.hydra_test_utils as hydra
logger = logging.getLogger(__name__)
EDITOR_TIMEOUT = 120
TEST_DIRECTORY = os.path.join(os.path.dirname(__file__), "atom_hydra_scripts")
@pytest.mark.parametrize("project", ["AutomatedTesting"])
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
@pytest.mark.parametrize("level", ["auto_test"])
class TestAtomEditorComponents(object):
@pytest.mark.test_case_id(
"C32078117", # Area Light
"C32078130", # Display Mapper
"C32078129", # Light
"C32078131", # Radius Weight Modifier
"C32078127", # PostFX Layer
"C32078126", # Point Light
"C32078125", # Physical Sky
"C32078115", # Global Skylight (IBL)
"C32078121", # Exposure Control
"C32078120", # Directional Light
"C32078119", # DepthOfField
"C32078118") # Decal
def test_AtomEditorComponents_AddedToEntity(self, request, editor, level, workspace, project, launcher_platform):
cfg_args = [level]
expected_lines = [
# Area Light Component
"Area Light Entity successfully created",
"Area Light_test: Component added to the entity: True",
"Area Light_test: Component removed after UNDO: True",
"Area Light_test: Component added after REDO: True",
"Area Light_test: Entered game mode: True",
"Area Light_test: Entity enabled after adding required components: True",
"Area Light_test: Entity is hidden: True",
"Area Light_test: Entity is shown: True",
"Area Light_test: Entity deleted: True",
"Area Light_test: UNDO entity deletion works: True",
"Area Light_test: REDO entity deletion works: True",
# Decal Component
"Decal Entity successfully created",
"Decal_test: Component added to the entity: True",
"Decal_test: Component removed after UNDO: True",
"Decal_test: Component added after REDO: True",
"Decal_test: Entered game mode: True",
"Decal_test: Exit game mode: True",
"Decal Settings|Decal Settings|Material: SUCCESS",
"Decal_test: Entity is hidden: True",
"Decal_test: Entity is shown: True",
"Decal_test: Entity deleted: True",
"Decal_test: UNDO entity deletion works: True",
"Decal_test: REDO entity deletion works: True",
# DepthOfField Component
"DepthOfField Entity successfully created",
"DepthOfField_test: Component added to the entity: True",
"DepthOfField_test: Component removed after UNDO: True",
"DepthOfField_test: Component added after REDO: True",
"DepthOfField_test: Entered game mode: True",
"DepthOfField_test: Exit game mode: True",
"DepthOfField_test: Entity disabled initially: True",
"DepthOfField_test: Entity enabled after adding required components: True",
"DepthOfField Controller|Configuration|Camera Entity: SUCCESS",
"DepthOfField_test: Entity is hidden: True",
"DepthOfField_test: Entity is shown: True",
"DepthOfField_test: Entity deleted: True",
"DepthOfField_test: UNDO entity deletion works: True",
"DepthOfField_test: REDO entity deletion works: True",
# Directional Light Component
"Directional Light Entity successfully created",
"Directional Light_test: Component added to the entity: True",
"Directional Light_test: Component removed after UNDO: True",
"Directional Light_test: Component added after REDO: True",
"Directional Light_test: Entered game mode: True",
"Directional Light_test: Exit game mode: True",
"Directional Light Controller|Configuration|Shadow|Camera: SUCCESS",
"Directional Light_test: Entity is hidden: True",
"Directional Light_test: Entity is shown: True",
"Directional Light_test: Entity deleted: True",
"Directional Light_test: UNDO entity deletion works: True",
"Directional Light_test: REDO entity deletion works: True",
# Exposure Control Component
"Exposure Control Entity successfully created",
"Exposure Control_test: Component added to the entity: True",
"Exposure Control_test: Component removed after UNDO: True",
"Exposure Control_test: Component added after REDO: True",
"Exposure Control_test: Entered game mode: True",
"Exposure Control_test: Exit game mode: True",
"Exposure Control_test: Entity disabled initially: True",
"Exposure Control_test: Entity enabled after adding required components: True",
"Exposure Control_test: Entity is hidden: True",
"Exposure Control_test: Entity is shown: True",
"Exposure Control_test: Entity deleted: True",
"Exposure Control_test: UNDO entity deletion works: True",
"Exposure Control_test: REDO entity deletion works: True",
# Global Skylight (IBL) Component
"Global Skylight (IBL) Entity successfully created",
"Global Skylight (IBL)_test: Component added to the entity: True",
"Global Skylight (IBL)_test: Component removed after UNDO: True",
"Global Skylight (IBL)_test: Component added after REDO: True",
"Global Skylight (IBL)_test: Entered game mode: True",
"Global Skylight (IBL)_test: Exit game mode: True",
"Global Skylight (IBL) Controller|Configuration|Diffuse Image: SUCCESS",
"Global Skylight (IBL) Controller|Configuration|Specular Image: SUCCESS",
"Global Skylight (IBL)_test: Entity is hidden: True",
"Global Skylight (IBL)_test: Entity is shown: True",
"Global Skylight (IBL)_test: Entity deleted: True",
"Global Skylight (IBL)_test: UNDO entity deletion works: True",
"Global Skylight (IBL)_test: REDO entity deletion works: True",
# Physical Sky Component
"Physical Sky Entity successfully created",
"Physical Sky component was added to entity",
"Entity has a Physical Sky component",
"Physical Sky_test: Component added to the entity: True",
"Physical Sky_test: Component removed after UNDO: True",
"Physical Sky_test: Component added after REDO: True",
"Physical Sky_test: Entered game mode: True",
"Physical Sky_test: Exit game mode: True",
"Physical Sky_test: Entity is hidden: True",
"Physical Sky_test: Entity is shown: True",
"Physical Sky_test: Entity deleted: True",
"Physical Sky_test: UNDO entity deletion works: True",
"Physical Sky_test: REDO entity deletion works: True",
# Point Light Component
"Point Light Entity successfully created",
"Point Light_test: Component added to the entity: True",
"Point Light_test: Component removed after UNDO: True",
"Point Light_test: Component added after REDO: True",
"Point Light_test: Entered game mode: True",
"Point Light_test: Exit game mode: True",
"Point Light_test: Entity is hidden: True",
"Point Light_test: Entity is shown: True",
"Point Light_test: Entity deleted: True",
"Point Light_test: UNDO entity deletion works: True",
"Point Light_test: REDO entity deletion works: True",
# PostFX Layer Component
"PostFX Layer Entity successfully created",
"PostFX Layer_test: Component added to the entity: True",
"PostFX Layer_test: Component removed after UNDO: True",
"PostFX Layer_test: Component added after REDO: True",
"PostFX Layer_test: Entered game mode: True",
"PostFX Layer_test: Exit game mode: True",
"PostFX Layer_test: Entity is hidden: True",
"PostFX Layer_test: Entity is shown: True",
"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",
# Light Component
"Light Entity successfully created",
"Light_test: Component added to the entity: True",
"Light_test: Component removed after UNDO: True",
"Light_test: Component added after REDO: True",
"Light_test: Entered game mode: True",
"Light_test: Exit game mode: True",
"Light_test: Entity is hidden: True",
"Light_test: Entity is shown: True",
"Light_test: Entity deleted: True",
"Light_test: UNDO entity deletion works: True",
"Light_test: REDO entity deletion works: True",
# Display Mapper Component
"Display Mapper Entity successfully created",
"Display Mapper_test: Component added to the entity: True",
"Display Mapper_test: Component removed after UNDO: True",
"Display Mapper_test: Component added after REDO: True",
"Display Mapper_test: Entered game mode: True",
"Display Mapper_test: Exit game mode: True",
"Display Mapper_test: Entity is hidden: True",
"Display Mapper_test: Entity is shown: True",
"Display Mapper_test: Entity deleted: True",
"Display Mapper_test: UNDO entity deletion works: True",
"Display Mapper_test: REDO entity deletion works: True",
]
unexpected_lines = [
"failed to open",
"Traceback (most recent call last):",
]
hydra.launch_and_validate_results(
request,
TEST_DIRECTORY,
editor,
"hydra_AtomEditorComponents_AddedToEntity.py",
timeout=EDITOR_TIMEOUT,
expected_lines=expected_lines,
unexpected_lines=unexpected_lines,
halt_on_unexpected=True,
null_renderer=True,
cfg_args=cfg_args,
)

@ -0,0 +1,22 @@
"""
All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
its licensors.
For complete copyright and license terms please see the LICENSE at the root of this
distribution (the "License"). All use of this software is governed by the License,
or, if provided, by the license below or the license accompanying this file. Do not
remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
"""
import pytest
@pytest.mark.parametrize("project", ["AutomatedTesting"])
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
@pytest.mark.parametrize("level", ["auto_test"])
class TestAtomEditorComponents(object):
# It requires at least one test
def test_Dummy(self, request, editor, level, workspace, project, launcher_platform):
pass

@ -94,13 +94,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", "-NullRenderer"] + extra_cmdline_args
pycmd = ["--runpythontest", testcase_module_filepath, "-BatchMode", "-autotest_mode", "-rhi=null"] + extra_cmdline_args
editor.args.extend(pycmd) # args are added to the WinLauncher start command
editor.start(backupFiles = False, launch_ap = False)
try:
editor.wait(TestAutomationBase.MAX_TIMEOUT)
except WaitTimeoutError:
errors.append(TestRunError("TIMEOUT", "Editor did not close after {TestAutomationBase.MAX_TIMEOUT} seconds, verify the test is ending and the application didn't freeze"))
errors.append(TestRunError("TIMEOUT", f"Editor did not close after {TestAutomationBase.MAX_TIMEOUT} seconds, verify the test is ending and the application didn't freeze"))
editor.kill()
output = editor.get_output()
@ -118,16 +118,16 @@ class TestAutomationBase:
else:
error_str = "Test failed, no output available..\n"
errors.append(TestRunError("FAILED TEST", error_str))
if return_code != TestAutomationBase.TEST_FAIL_RETCODE: # Crashed
if return_code and return_code != TestAutomationBase.TEST_FAIL_RETCODE: # Crashed
crash_info = "-- No crash log available --"
error_log = os.path.join(workspace.paths.project_log(), 'error.log')
crash_log = os.path.join(workspace.paths.project_log(), 'error.log')
try:
waiter.wait_for(lambda: os.path.exists(error_log), timeout=TestAutomationBase.WAIT_FOR_CRASH_LOG)
waiter.wait_for(lambda: os.path.exists(crash_log), timeout=TestAutomationBase.WAIT_FOR_CRASH_LOG)
except AssertionError:
pass
try:
with open(error_log) as f:
with open(crash_log) as f:
crash_info = f.read()
except Exception as ex:
crash_info += f"\n{str(ex)}"

@ -21,8 +21,8 @@ import azlmbr.legacy.general as general
import azlmbr.paths
sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests'))
from automatedtesting_shared.editor_test_helper import EditorTestHelper
import automatedtesting_shared.pyside_utils as pyside_utils
from editor_python_test_tools.editor_test_helper import EditorTestHelper
import editor_python_test_tools.pyside_utils as pyside_utils
class AssetBrowserTreeNavigationTest(EditorTestHelper):
@ -66,7 +66,7 @@ class AssetBrowserTreeNavigationTest(EditorTestHelper):
return collapse_success and expand_success
# This is the hierarchy we are expanding (4 steps inside)
self.file_path = ("AutomatedTesting", "Assets", "ImageGradients", "lumberyard_gsi.png")
self.file_path = ("AutomatedTesting", "Assets", "ImageGradients", "image_grad_test_gsi.png")
# 1) Open a new level
self.test_success = self.create_level(

@ -22,8 +22,8 @@ import azlmbr.entity as entity
import azlmbr.paths
sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests'))
from automatedtesting_shared.editor_test_helper import EditorTestHelper
import automatedtesting_shared.pyside_utils as pyside_utils
from editor_python_test_tools.editor_test_helper import EditorTestHelper
import editor_python_test_tools.pyside_utils as pyside_utils
class TestDockingBasicDockedTools(EditorTestHelper):

@ -19,8 +19,8 @@ import sys
import azlmbr.paths
sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests'))
from automatedtesting_shared.editor_test_helper import EditorTestHelper
import automatedtesting_shared.pyside_utils as pyside_utils
from editor_python_test_tools.editor_test_helper import EditorTestHelper
import editor_python_test_tools.pyside_utils as pyside_utils
class TestEditMenuOptions(EditorTestHelper):

@ -20,8 +20,8 @@ import sys
import azlmbr.paths
sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests'))
from automatedtesting_shared.editor_test_helper import EditorTestHelper
import automatedtesting_shared.pyside_utils as pyside_utils
from editor_python_test_tools.editor_test_helper import EditorTestHelper
import editor_python_test_tools.pyside_utils as pyside_utils
class TestFileMenuOptions(EditorTestHelper):

@ -19,8 +19,8 @@ import sys
import azlmbr.paths
sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests'))
from automatedtesting_shared.editor_test_helper import EditorTestHelper
import automatedtesting_shared.pyside_utils as pyside_utils
from editor_python_test_tools.editor_test_helper import EditorTestHelper
import editor_python_test_tools.pyside_utils as pyside_utils
class TestViewMenuOptions(EditorTestHelper):

@ -19,7 +19,7 @@ logger = logging.getLogger(__name__)
layout = {
'path': r'Software\Amazon\Lumberyard\Editor\fancyWindowLayouts',
'path': r'Software\Amazon\O3DE\Editor\fancyWindowLayouts',
'value': 'last'
}
restore_camera = {

@ -1,71 +0,0 @@
"""
All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
its licensors.
For complete copyright and license terms please see the LICENSE at the root of this
distribution (the "License"). All use of this software is governed by the License,
or, if provided, by the license below or the license accompanying this file. Do not
remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
"""
"""
C13660194 : Asset Browser - Filtering
"""
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 TestSearchFiltering(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("C13660194")
@pytest.mark.SUITE_periodic
def test_SearchFiltering_Asset_Browser_Filtering(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,
)

@ -1,62 +0,0 @@
"""
All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
its licensors.
For complete copyright and license terms please see the LICENSE at the root of this
distribution (the "License"). All use of this software is governed by the License,
or, if provided, by the license below or the license accompanying this file. Do not
remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
"""
"""
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 = 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 TestTreeNavigation(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_TreeNavigation_Asset_Browser(self, request, editor, level, launcher_platform):
expected_lines = [
"Collapse/Expand tests: True",
"Asset visibility test: True",
"Scrollbar visibility test: True",
"TreeNavigation_Asset_Browser: result=SUCCESS"
]
hydra.launch_and_validate_results(
request,
test_directory,
editor,
"TreeNavigation_Asset_Browser.py",
expected_lines,
run_python="--runpython",
cfg_args=[level],
timeout=log_monitor_timeout,
)

@ -85,7 +85,8 @@ class TestAltitudeFilter(object):
@pytest.mark.test_case_id("C4847478")
@pytest.mark.SUITE_periodic
def test_AltitudeFilterFilterStageToggle(self, request, editor, level, workspace, launcher_platform):
@pytest.mark.xfail # LYN-3275
def test_AltitudeFilter_FilterStageToggle(self, request, editor, level, workspace, launcher_platform):
cfg_args = [level]
expected_lines = [

@ -41,7 +41,7 @@ class TestDynamicSliceInstanceSpawner(object):
return console
@pytest.mark.test_case_id("C28851763")
@pytest.mark.SUITE_main
@pytest.mark.SUITE_sandbox
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
def test_DynamicSliceInstanceSpawner_DynamicSliceSpawnerWorks(self, request, editor, level, workspace, project,
launcher_platform):

@ -36,8 +36,13 @@ class TestEmptyInstanceSpawner(object):
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
@pytest.mark.test_case_id("C28851762")
# Main suite needs at least one test
@pytest.mark.SUITE_main
def test_EmptyInstanceSpawner_Dummy(self, request, editor, level, workspace, project, launcher_platform):
pass
@pytest.mark.test_case_id("C28851762")
@pytest.mark.SUITE_sandbox
def test_EmptyInstanceSpawner_EmptySpawnerWorks(self, request, editor, level, launcher_platform):
cfg_args = [level]

@ -101,6 +101,7 @@ class TestLayerSpawner(object):
@pytest.mark.test_case_id("C4765973")
@pytest.mark.SUITE_periodic
@pytest.mark.xfail # LYN-3275
def test_LayerSpawner_FilterStageToggle(self, request, editor, level, workspace, launcher_platform):
expected_lines = [

@ -46,6 +46,7 @@ class TestMeshBlocker(object):
"""
@pytest.mark.test_case_id("C3980834")
@pytest.mark.SUITE_periodic
@pytest.mark.xfail # LYN-3273
def test_MeshBlocker_InstancesBlockedByMesh(self, request, editor, level, launcher_platform):
expected_lines = [
"'Instance Spawner' created",
@ -69,6 +70,7 @@ class TestMeshBlocker(object):
"""
@pytest.mark.test_case_id("C4766030")
@pytest.mark.SUITE_periodic
@pytest.mark.xfail # LYN-3273
def test_MeshBlocker_InstancesBlockedByMeshHeightTuning(self, request, editor, level, launcher_platform):
expected_lines = [
"'Instance Spawner' created",

@ -60,6 +60,7 @@ class TestPositionModifier(object):
@pytest.mark.test_case_id("C4874100")
@pytest.mark.SUITE_sandbox
@pytest.mark.xfail # LYN-3275
def test_PositionModifier_AutoSnapToSurfaceWorks(self, request, editor, level, launcher_platform):
expected_lines = [

@ -21,7 +21,7 @@ import azlmbr.math as math
import azlmbr.paths
sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests'))
from automatedtesting_shared.editor_test_helper import EditorTestHelper
from editor_python_test_tools.editor_test_helper import EditorTestHelper
editorId = azlmbr.globals.property.LANDSCAPE_CANVAS_EDITOR_ID
createdEntityId = None

@ -22,7 +22,7 @@ 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 automateeditor_python_test_toolsdtesting_shared.hydra_test_utils as hydra
import editor_python_test_tools.hydra_test_utils as hydra
test_directory = os.path.join(os.path.dirname(__file__), 'EditorScripts')

@ -24,7 +24,7 @@ class Tests():
# fmt: on
def run():
def C14861501_PhysXCollider_RenderMeshAutoAssigned():
"""
Summary:
Create entity with Mesh component and assign a render mesh to the Mesh component. Add Physics Collider component
@ -61,7 +61,7 @@ def run():
from asset_utils import Asset
# Asset paths
STATIC_MESH = os.path.join("assets", "c14861501_physxcollider_rendermeshautoassigned", "spherebot", "r0-b_body.cgf")
STATIC_MESH = os.path.join("assets", "c14861501_physxcollider_rendermeshautoassigned", "spherebot", "r0-b_body.azmodel")
PHYSX_MESH = os.path.join(
"assets", "c14861501_physxcollider_rendermeshautoassigned", "spherebot", "r0-b_body.pxmesh"
)
@ -80,8 +80,8 @@ def run():
# 4) Assign a render mesh asset to Mesh component (the fbx mesh having both Static mesh and PhysX collision Mesh)
mesh_asset = Asset.find_asset_by_path(STATIC_MESH)
mesh_component.set_component_property_value("MeshComponentRenderNode|Mesh asset", mesh_asset.id)
mesh_asset.id = mesh_component.get_component_property_value("MeshComponentRenderNode|Mesh asset")
mesh_component.set_component_property_value("Controller|Configuration|Mesh Asset", mesh_asset.id)
mesh_asset.id = mesh_component.get_component_property_value("Controller|Configuration|Mesh Asset")
Report.result(Tests.assign_mesh_asset, mesh_asset.get_path() == STATIC_MESH.replace(os.sep, "/"))
# 5) Add PhysX Collider component
@ -95,4 +95,8 @@ def run():
if __name__ == "__main__":
run()
import ImportPathHelper as imports
imports.init()
from utils import Report
Report.start_test(C14861501_PhysXCollider_RenderMeshAutoAssigned)

@ -62,8 +62,8 @@ def C14861502_PhysXCollider_AssetAutoAssigned():
# Open 3D Engine Imports
import azlmbr.legacy.general as general
MESH_ASSET_PATH = os.path.join("Objects", "SphereBot", "r0-b_body.cgf")
MESH_PROPERTY_PATH = "MeshComponentRenderNode|Mesh asset"
MESH_ASSET_PATH = os.path.join("Objects", "SphereBot", "r0-b_body.azmodel")
MESH_PROPERTY_PATH = "Controller|Configuration|Mesh Asset"
TESTED_PROPERTY_PATH = "Shape Configuration|Asset|PhysX Mesh"
helper.init_idle()

@ -69,7 +69,7 @@ def run():
import azlmbr.asset as azasset
# Asset paths
STATIC_MESH = os.path.join("assets", "c14861504_rendermeshasset_withnopxasset", "test_asset.cgf")
STATIC_MESH = os.path.join("assets", "c14861504_rendermeshasset_withnopxasset", "test_asset.azmodel")
helper.init_idle()
# 1) Load the empty level
@ -85,8 +85,8 @@ def run():
# 4) Assign a render mesh asset to Mesh component (the fbx mesh having both Static mesh and PhysX collision Mesh)
mesh_asset = Asset.find_asset_by_path(STATIC_MESH)
mesh_component.set_component_property_value("MeshComponentRenderNode|Mesh asset", mesh_asset.id)
mesh_asset.id = mesh_component.get_component_property_value("MeshComponentRenderNode|Mesh asset")
mesh_component.set_component_property_value("Controller|Configuration|Mesh Asset", mesh_asset.id)
mesh_asset.id = mesh_component.get_component_property_value("Controller|Configuration|Mesh Asset")
Report.result(Tests.assign_mesh_asset, mesh_asset.get_path() == STATIC_MESH.replace(os.sep, "/"))
# 5) Add PhysX Collider component

@ -27,7 +27,7 @@ class Tests():
# fmt: on
def run():
def C4044695_PhysXCollider_AddMultipleSurfaceFbx():
"""
Summary:
Create entity with Mesh and PhysX Collider components and assign a fbx file in both the components.
@ -45,12 +45,7 @@ def run():
4) Select the PhysicsAsset shape in the PhysX Collider component
5) Assign the fbx file in PhysX Mesh and Mesh component
6) Check if multiple material slots show up under Materials section in the PhysX Collider 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
"""
# Builtins
@ -70,7 +65,7 @@ def run():
SURFACE_TAG_COUNT = 4 # Number of surface tags included in used asset
# Asset paths
STATIC_MESH = os.path.join("assets", "c4044695_physxcollider_addmultiplesurfacefbx", "test.cgf")
STATIC_MESH = os.path.join("assets", "c4044695_physxcollider_addmultiplesurfacefbx", "test.azmodel")
PHYSX_MESH = os.path.join("assets", "c4044695_physxcollider_addmultiplesurfacefbx", "test.pxmesh")
helper.init_idle()
@ -100,8 +95,8 @@ def run():
Report.result(Tests.assign_px_mesh_asset, px_asset.get_path() == PHYSX_MESH.replace(os.sep, "/"))
mesh_asset = Asset.find_asset_by_path(STATIC_MESH)
mesh_component.set_component_property_value("MeshComponentRenderNode|Mesh asset", mesh_asset.id)
mesh_asset.id = mesh_component.get_component_property_value("MeshComponentRenderNode|Mesh asset")
mesh_component.set_component_property_value("Controller|Configuration|Mesh Asset", mesh_asset.id)
mesh_asset.id = mesh_component.get_component_property_value("Controller|Configuration|Mesh Asset")
Report.result(Tests.assign_mesh_asset, mesh_asset.get_path() == STATIC_MESH.replace(os.sep, "/"))
# 6) Check if multiple material slots show up under Materials section in the PhysX Collider component
@ -116,4 +111,8 @@ def run():
if __name__ == "__main__":
run()
import ImportPathHelper as imports
imports.init()
from utils import Report
Report.start_test(C4044695_PhysXCollider_AddMultipleSurfaceFbx)

@ -27,7 +27,7 @@ class Tests():
def C4976236_AddPhysxColliderComponent():
"""
Summary:
Load level with Entity having PhysX Collider component. Verify that editor remains stable in Game mode.
Opens an empty level and creates an Entity with PhysX Collider. Verify that editor remains stable in Game mode.
Expected Behavior:
The Editor is stable there are no warnings or errors.
@ -37,16 +37,10 @@ def C4976236_AddPhysxColliderComponent():
2) Create test entity
3) Start the Tracer to catch any errors and warnings
4) Add the PhysX Collider component and change shape to box
5) Add Mesh component and an asset
6) Enter game mode
7) Verify there are no errors and warnings in the logs
8) Exit game mode
9) Close the editor
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.
5) Enter game mode
6) Verify there are no errors and warnings in the logs
7) Exit game mode
8) Close the editor
:return: None
"""
@ -60,7 +54,7 @@ def C4976236_AddPhysxColliderComponent():
from editor_python_test_tools.utils import TestHelper as helper
from editor_python_test_tools.utils import Tracer
from asset_utils import Asset
helper.init_idle()
# 1) Load the level
helper.open_level("Physics", "Base")
@ -74,17 +68,12 @@ def C4976236_AddPhysxColliderComponent():
# 4) Add the PhysX Collider component and change shape to box
collider_component = test_entity.add_component("PhysX Collider")
Report.result(Tests.add_physx_collider, test_entity.has_component("PhysX Collider"))
collider_component.set_component_property_value('Shape Configuration|Shape', 1)
# 5) Add Mesh component and an asset
mesh_component = test_entity.add_component("Mesh")
asset = Asset.find_asset_by_path(r"Objects\default\primitive_cube.cgf")
mesh_component.set_component_property_value('MeshComponentRenderNode|Mesh asset', asset.id)
collider_component.set_component_property_value('Shape Configuration|Shape', azlmbr.physics.ShapeType_Box)
# 6) Enter game mode
# 5) Enter game mode
helper.enter_game_mode(Tests.enter_game_mode)
# 7) Verify there are no errors and warnings in the logs
# 6) Verify there are no errors and warnings in the logs
success_condition = not (section_tracer.has_errors or section_tracer.has_warnings)
Report.result(Tests.no_errors_and_warnings_found, success_condition)
if not success_condition:
@ -92,9 +81,8 @@ def C4976236_AddPhysxColliderComponent():
Report.info(f"Warnings found: {section_tracer.warnings}")
if section_tracer.has_errors:
Report.info(f"Errors found: {section_tracer.errors}")
Report.failure(Tests.no_errors_and_warnings_found)
# 8) Exit game mode
# 7) Exit game mode
helper.exit_game_mode(Tests.exit_game_mode)

@ -0,0 +1,37 @@
"""
All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
its licensors.
For complete copyright and license terms please see the LICENSE at the root of this
distribution (the "License"). All use of this software is governed by the License,
or, if provided, by the license below or the license accompanying this file. Do not
remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
"""
# This suite consists of all test cases that are passing and have been verified.
import pytest
import os
import sys
from .FileManagement import FileManagement as fm
from ly_test_tools import LAUNCHERS
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../automatedtesting_shared')
from base import TestAutomationBase
revert_physics_config = fm.file_revert_list(['physxdebugconfiguration.setreg', 'physxdefaultsceneconfiguration.setreg', 'physxsystemconfiguration.setreg'], 'AutomatedTesting/Registry')
@pytest.mark.SUITE_main
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
@pytest.mark.parametrize("project", ["AutomatedTesting"])
class TestAutomation(TestAutomationBase):
def test_C111111_RigidBody_EnablingGravityWorksUsingNotificationsPoC(self, request, workspace, editor, launcher_platform):
from . import C111111_RigidBody_EnablingGravityWorksUsingNotificationsPoC as test_module
self._run_test(request, workspace, editor, test_module)

@ -27,26 +27,16 @@ from base import TestAutomationBase
revert_physics_config = fm.file_revert_list(['physxdebugconfiguration.setreg', 'physxdefaultsceneconfiguration.setreg', 'physxsystemconfiguration.setreg'], 'AutomatedTesting/Registry')
@pytest.mark.SUITE_main
@pytest.mark.SUITE_periodic
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
@pytest.mark.parametrize("project", ["AutomatedTesting"])
class TestAutomation(TestAutomationBase):
# Marking the test as an expected failure 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="This test seems to fail sometimes due to it being the first test in the testsuite, we'll duplicate it temporarly."
"Need to figure out the reason why this is the case")
@revert_physics_config
def test_C000000_RigidBody_EnablingGravityWorksPoC_DUPLICATE(self, request, workspace, editor, launcher_platform):
from . import C100000_RigidBody_EnablingGravityWorksPoC as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C3510642_Terrain_NotCollideWithTerrain(self, request, workspace, editor, launcher_platform):
from . 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
@ -279,6 +269,8 @@ class TestAutomation(TestAutomationBase):
from . 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
@ -530,8 +522,4 @@ class TestAutomation(TestAutomationBase):
def test_C100000_RigidBody_EnablingGravityWorksPoC(self, request, workspace, editor, launcher_platform):
from . import C100000_RigidBody_EnablingGravityWorksPoC as test_module
self._run_test(request, workspace, editor, test_module)
def test_C111111_RigidBody_EnablingGravityWorksUsingNotificationsPoC(self, request, workspace, editor, launcher_platform):
from . import C111111_RigidBody_EnablingGravityWorksUsingNotificationsPoC as test_module
self._run_test(request, workspace, editor, test_module)
self._run_test(request, workspace, editor, test_module)

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:75cb1c8454aafc3de81351450a9480f91cb98d926a6e47f87a5ffe91e1d5a7d5
size 4745
oid sha256:f63204a86af8bc0963a4823d047a2e222cc19aabd14570d0789dc90cdc82970c
size 2017

@ -1,356 +1,356 @@
<TimeOfDay Time="13.5" TimeStart="13.5" TimeEnd="13.5" TimeAnimSpeed="0">
<Variable Name="Sun color" Color="0.99989021,0.99946922,0.9991194">
<Spline Keys="-0.000628322:(0.783538:0.89627:0.930341):36,0:(0.783538:0.887923:0.921582):36,0.229167:(0.783538:0.879623:0.921582):36,0.25:(0.947307:0.745404:0.577581):36,0.458333:(1:1:1):36,0.5625:(1:1:1):36,0.75:(0.947307:0.745404:0.577581):36,0.770833:(0.783538:0.879623:0.921582):36,1:(0.783538:0.89627:0.930556):36,"/>
<Variable Name="Sun color" Color="0.78353798,0.89626998,0.93034101">
<Spline Keys="-0.000628322:(0.783538:0.89627:0.930341):36"/>
</Variable>
<Variable Name="Sun intensity" Value="92366.68">
<Spline Keys="0:1000:36,0.229167:1000:36,0.5:120000:36,0.770833:1000:65572,0.999306:1000:36,"/>
<Variable Name="Sun intensity" Value="1000">
<Spline Keys="0:1000:36"/>
</Variable>
<Variable Name="Sun specular multiplier" Value="1">
<Spline Keys="0:1:36,0.25:1:36,0.5:1:36,0.75:1:36,1:1:36,"/>
<Spline Keys="0:1:36"/>
</Variable>
<Variable Name="Fog color" Color="0.27049801,0.47353199,0.83076996">
<Spline Keys="0:(0.00651209:0.00972122:0.0137021):36,0.229167:(0.00604883:0.00972122:0.0137021):36,0.25:(0.270498:0.473532:0.83077):36,0.5:(0.270498:0.473532:0.83077):458788,0.75:(0.270498:0.473532:0.83077):36,0.770833:(0.00604883:0.00972122:0.0137021):36,1:(0.00651209:0.00972122:0.0137021):36,"/>
<Variable Name="Fog color" Color="0.0065120901,0.0097212195,0.0137021">
<Spline Keys="0:(0.00651209:0.00972122:0.0137021):36"/>
</Variable>
<Variable Name="Fog color multiplier" Value="1">
<Spline Keys="0:0.5:36,0.229167:0.5:36,0.25:1:36,0.5:1:36,0.75:1:36,0.770833:0.5:36,1:0.5:65572,"/>
<Variable Name="Fog color multiplier" Value="0.5">
<Spline Keys="0:0.5:36"/>
</Variable>
<Variable Name="Fog height (bottom)" Value="0">
<Spline Keys="0:0:36,0.25:0:36,0.5:0:36,0.75:0:36,1:0:36,"/>
<Spline Keys="0:0:36"/>
</Variable>
<Variable Name="Fog layer density (bottom)" Value="1">
<Spline Keys="0:1:36,0.25:1:36,0.5:1:36,0.75:1:36,1:1:36,"/>
<Spline Keys="0:1:36"/>
</Variable>
<Variable Name="Fog color (top)" Color="0.597202,0.72305501,0.91309899">
<Spline Keys="0:(0.00699541:0.00972122:0.0122865):36,0.229167:(0.00699541:0.00972122:0.0122865):36,0.25:(0.597202:0.723055:0.913099):36,0.5:(0.597202:0.723055:0.913099):458788,0.75:(0.597202:0.723055:0.913099):36,0.770833:(0.00699541:0.00972122:0.0122865):36,1:(0.00699541:0.00972122:0.0122865):36,"/>
<Variable Name="Fog color (top)" Color="0.0069954102,0.0097212195,0.0122865">
<Spline Keys="0:(0.00699541:0.00972122:0.0122865):36"/>
</Variable>
<Variable Name="Fog color (top) multiplier" Value="0.88389361">
<Spline Keys="-4.40702e-06:0.5:36,0.0297507:0.499195:36,0.229167:0.5:36,0.5:1:36,0.770833:0.5:36,1:0.5:36,"/>
<Variable Name="Fog color (top) multiplier" Value="0.5">
<Spline Keys="-4.40702e-06:0.5:36"/>
</Variable>
<Variable Name="Fog height (top)" Value="100.00001">
<Spline Keys="0:100:36,0.25:100:36,0.5:100:36,0.75:100:65572,1:100:36,"/>
<Variable Name="Fog height (top)" Value="100">
<Spline Keys="0:100:36"/>
</Variable>
<Variable Name="Fog layer density (top)" Value="9.9999997e-05">
<Spline Keys="0:0.0001:36,0.25:0.0001:36,0.5:0.0001:65572,0.75:0.0001:36,1:0.0001:36,"/>
<Spline Keys="0:0.0001:36"/>
</Variable>
<Variable Name="Fog color height offset" Value="0">
<Spline Keys="0:0:36,0.25:0:36,0.5:0:36,0.75:0:36,1:0:65572,"/>
<Spline Keys="0:0:36"/>
</Variable>
<Variable Name="Fog color (radial)" Color="0.78592348,0.52744436,0.17234583">
<Spline Keys="0:(0:0:0):36,0.229167:(0.00439144:0.00367651:0.00334654):36,0.25:(0.838799:0.564712:0.184475):36,0.5:(0.768151:0.514918:0.168269):458788,0.75:(0.838799:0.564712:0.184475):36,0.770833:(0.00402472:0.00334654:0.00303527):36,1:(0:0:0):36,"/>
<Variable Name="Fog color (radial)" Color="0,0,0">
<Spline Keys="0:(0:0:0):36"/>
</Variable>
<Variable Name="Fog color (radial) multiplier" Value="6">
<Spline Keys="0:0:36,0.25:6:36,0.5:6:36,0.75:6:36,1:0:36,"/>
<Variable Name="Fog color (radial) multiplier" Value="0">
<Spline Keys="0:0:36"/>
</Variable>
<Variable Name="Fog radial size" Value="0.85000002">
<Spline Keys="0:0:36,0.25:0.85:65572,0.5:0.85:36,0.75:0.85:36,1:0:36,"/>
<Variable Name="Fog radial size" Value="0">
<Spline Keys="0:0:36"/>
</Variable>
<Variable Name="Fog radial lobe" Value="0.75">
<Spline Keys="0:0:36,0.25:0.75:36,0.5:0.75:36,0.75:0.75:65572,1:0:36,"/>
<Variable Name="Fog radial lobe" Value="0">
<Spline Keys="0:0:36"/>
</Variable>
<Variable Name="Volumetric fog: Final density clamp" Value="1">
<Spline Keys="0:1:36,0.25:1:36,0.5:1:65572,0.75:1:36,1:1:36,"/>
<Spline Keys="0:1:36"/>
</Variable>
<Variable Name="Volumetric fog: Global density" Value="1.5">
<Spline Keys="0:1.5:36,0.25:1.5:36,0.5:1.5:65572,0.75:1.5:36,1:1.5:36,"/>
<Spline Keys="0:1.5:36"/>
</Variable>
<Variable Name="Volumetric fog: Ramp start" Value="25.000002">
<Spline Keys="0:25:36,0.25:25:36,0.5:25:65572,0.75:25:36,1:25:36,"/>
<Variable Name="Volumetric fog: Ramp start" Value="25">
<Spline Keys="0:25:36"/>
</Variable>
<Variable Name="Volumetric fog: Ramp end" Value="1000.0001">
<Spline Keys="0:1000:36,0.25:1000:36,0.5:1000:65572,0.75:1000:36,1:1000:36,"/>
<Variable Name="Volumetric fog: Ramp end" Value="1000">
<Spline Keys="0:1000:36"/>
</Variable>
<Variable Name="Volumetric fog: Ramp influence" Value="0.69999993">
<Spline Keys="0:0.7:36,0.25:0.7:36,0.5:0.7:65572,0.75:0.7:36,1:0.7:36,"/>
<Variable Name="Volumetric fog: Ramp influence" Value="0.69999999">
<Spline Keys="0:0.7:36"/>
</Variable>
<Variable Name="Volumetric fog: Shadow darkening" Value="0.20000002">
<Spline Keys="0:0.2:36,0.25:0.2:36,0.5:0.2:65572,0.75:0.2:36,1:0.2:36,"/>
<Variable Name="Volumetric fog: Shadow darkening" Value="0.2">
<Spline Keys="0:0.2:36"/>
</Variable>
<Variable Name="Volumetric fog: Shadow darkening sun" Value="0.5">
<Spline Keys="0:0.5:36,0.25:0.5:36,0.5:0.5:65572,0.75:0.5:36,1:0.5:36,"/>
<Spline Keys="0:0.5:36"/>
</Variable>
<Variable Name="Volumetric fog: Shadow darkening ambient" Value="1">
<Spline Keys="0:1:36,0.25:1:36,0.5:1:65572,0.75:1:36,1:1:36,"/>
<Spline Keys="0:1:36"/>
</Variable>
<Variable Name="Volumetric fog: Shadow range" Value="0.10000001">
<Spline Keys="0:0.1:36,0.25:0.1:36,0.5:0.1:65572,0.75:0.1:36,1:0.1:36,"/>
<Variable Name="Volumetric fog: Shadow range" Value="0.1">
<Spline Keys="0:0.1:36"/>
</Variable>
<Variable Name="Volumetric fog 2: Fog height (bottom)" Value="0">
<Spline Keys="0:0:0,1:0:0,"/>
<Spline Keys="0:0:0"/>
</Variable>
<Variable Name="Volumetric fog 2: Fog layer density (bottom)" Value="1">
<Spline Keys="0:1:0,1:1:0,"/>
<Spline Keys="0:1:0"/>
</Variable>
<Variable Name="Volumetric fog 2: Fog height (top)" Value="4000">
<Spline Keys="0:4000:0,1:4000:0,"/>
<Spline Keys="0:4000:0"/>
</Variable>
<Variable Name="Volumetric fog 2: Fog layer density (top)" Value="9.9999997e-05">
<Spline Keys="0:0.0001:0,1:0.0001:0,"/>
<Spline Keys="0:0.0001:0"/>
</Variable>
<Variable Name="Volumetric fog 2: Global fog density" Value="0.1">
<Spline Keys="0:0.1:0,1:0.1:0,"/>
<Spline Keys="0:0.1:0"/>
</Variable>
<Variable Name="Volumetric fog 2: Ramp start" Value="0">
<Spline Keys="0:0:0,1:0:0,"/>
<Spline Keys="0:0:0"/>
</Variable>
<Variable Name="Volumetric fog 2: Ramp end" Value="0">
<Spline Keys="0:0:0,1:0:0,"/>
<Spline Keys="0:0:0"/>
</Variable>
<Variable Name="Volumetric fog 2: Fog albedo color (atmosphere)" Color="1,1,1">
<Spline Keys="0:(1:1:1):0,1:(1:1:1):0,"/>
<Spline Keys="0:(1:1:1):0"/>
</Variable>
<Variable Name="Volumetric fog 2: Anisotropy factor (atmosphere)" Value="0.60000002">
<Spline Keys="0:0.6:0,1:0.6:0,"/>
<Spline Keys="0:0.6:0"/>
</Variable>
<Variable Name="Volumetric fog 2: Fog albedo color (sun radial)" Color="1,1,1">
<Spline Keys="0:(1:1:1):0,1:(1:1:1):0,"/>
<Spline Keys="0:(1:1:1):0"/>
</Variable>
<Variable Name="Volumetric fog 2: Anisotropy factor (sun radial)" Value="0.94999999">
<Spline Keys="0:0.95:0,1:0.95:0,"/>
<Spline Keys="0:0.95:0"/>
</Variable>
<Variable Name="Volumetric fog 2: Blend factor for sun scattering" Value="1">
<Spline Keys="0:1:0,1:1:0,"/>
<Spline Keys="0:1:0"/>
</Variable>
<Variable Name="Volumetric fog 2: Blend mode for sun scattering" Value="0">
<Spline Keys="0:0:0,1:0:0,"/>
<Spline Keys="0:0:0"/>
</Variable>
<Variable Name="Volumetric fog 2: Fog albedo color (entities)" Color="1,1,1">
<Spline Keys="0:(1:1:1):0,1:(1:1:1):0,"/>
<Spline Keys="0:(1:1:1):0"/>
</Variable>
<Variable Name="Volumetric fog 2: Anisotropy factor (entities)" Value="0.60000002">
<Spline Keys="0:0.6:0,1:0.6:0,"/>
<Spline Keys="0:0.6:0"/>
</Variable>
<Variable Name="Volumetric fog 2: Maximum range of ray-marching" Value="64">
<Spline Keys="0:64:0,1:64:0,"/>
<Spline Keys="0:64:0"/>
</Variable>
<Variable Name="Volumetric fog 2: In-scattering factor" Value="1">
<Spline Keys="0:1:0,1:1:0,"/>
<Spline Keys="0:1:0"/>
</Variable>
<Variable Name="Volumetric fog 2: Extinction factor" Value="0.30000001">
<Spline Keys="0:0.3:0,1:0.3:0,"/>
<Spline Keys="0:0.3:0"/>
</Variable>
<Variable Name="Volumetric fog 2: Analytical volumetric fog visibility" Value="0.5">
<Spline Keys="0:0.5:0,1:0.5:0,"/>
<Spline Keys="0:0.5:0"/>
</Variable>
<Variable Name="Volumetric fog 2: Final density clamp" Value="1">
<Spline Keys="0:1:0,0.5:1:36,1:1:0,"/>
<Spline Keys="0:1:0"/>
</Variable>
<Variable Name="Sky light: Sun intensity" Color="1,1,1">
<Spline Keys="0:(1:1:1):36,0.25:(1:1:1):36,0.494381:(1:1:1):65572,0.5:(1:1:1):36,0.75:(1:1:1):36,1:(1:1:1):36,"/>
<Spline Keys="0:(1:1:1):36"/>
</Variable>
<Variable Name="Sky light: Sun intensity multiplier" Value="200.00002">
<Spline Keys="0:200:36,0.25:200:36,0.5:200:36,0.75:200:36,1:200:36,"/>
<Variable Name="Sky light: Sun intensity multiplier" Value="200">
<Spline Keys="0:200:36"/>
</Variable>
<Variable Name="Sky light: Mie scattering" Value="6.779707">
<Spline Keys="0:40:36,0.5:2:36,1:40:36,"/>
<Variable Name="Sky light: Mie scattering" Value="40">
<Spline Keys="0:40:36"/>
</Variable>
<Variable Name="Sky light: Rayleigh scattering" Value="0.20000002">
<Spline Keys="0:0.2:36,0.229167:0.2:36,0.25:1:36,0.291667:0.2:36,0.5:0.2:36,0.729167:0.2:36,0.75:1:36,0.770833:0.2:36,1:0.2:36,"/>
<Variable Name="Sky light: Rayleigh scattering" Value="0.2">
<Spline Keys="0:0.2:36"/>
</Variable>
<Variable Name="Sky light: Sun anisotropy factor" Value="-0.99989998">
<Spline Keys="0:-0.9999:36,0.25:-0.9999:36,0.5:-0.9999:65572,0.75:-0.9999:36,1:-0.9999:36,"/>
<Spline Keys="0:-0.9999:36"/>
</Variable>
<Variable Name="Sky light: Wavelength (R)" Value="694">
<Spline Keys="0:694:36,0.25:694:36,0.5:694:65572,0.75:694:36,1:694:36,"/>
<Spline Keys="0:694:36"/>
</Variable>
<Variable Name="Sky light: Wavelength (G)" Value="596.99994">
<Spline Keys="0:597:36,0.25:597:36,0.5:597:36,0.75:597:36,1:597:36,"/>
<Variable Name="Sky light: Wavelength (G)" Value="597">
<Spline Keys="0:597:36"/>
</Variable>
<Variable Name="Sky light: Wavelength (B)" Value="488">
<Spline Keys="0:488:36,0.25:488:36,0.5:488:65572,0.75:488:36,1:488:36,"/>
<Spline Keys="0:488:36"/>
</Variable>
<Variable Name="Night sky: Horizon color" Color="0.27049801,0.39157301,0.52711499">
<Spline Keys="0:(0.270498:0.391573:0.520996):36,0.25:(0.270498:0.391573:0.527115):36,0.5:(0.270498:0.391573:0.527115):262180,0.75:(0.270498:0.391573:0.527115):36,1:(0.270498:0.391573:0.520996):36,"/>
<Variable Name="Night sky: Horizon color" Color="0.27049801,0.39157301,0.52099597">
<Spline Keys="0:(0.270498:0.391573:0.520996):36"/>
</Variable>
<Variable Name="Night sky: Horizon color multiplier" Value="0">
<Spline Keys="0:0.1:36,0.25:0:36,0.5:0:65572,0.75:0:36,1:0.1:36,"/>
<Variable Name="Night sky: Horizon color multiplier" Value="0.1">
<Spline Keys="0:0.1:36"/>
</Variable>
<Variable Name="Night sky: Zenith color" Color="0.36130697,0.434154,0.46778399">
<Spline Keys="0:(0.361307:0.434154:0.467784):36,0.25:(0.361307:0.434154:0.467784):36,0.5:(0.361307:0.434154:0.467784):262180,0.75:(0.361307:0.434154:0.467784):36,1:(0.361307:0.434154:0.467784):36,"/>
<Variable Name="Night sky: Zenith color" Color="0.361307,0.434154,0.46778399">
<Spline Keys="0:(0.361307:0.434154:0.467784):36"/>
</Variable>
<Variable Name="Night sky: Zenith color multiplier" Value="0">
<Spline Keys="0:0.02:36,0.25:0:36,0.5:0:65572,0.75:0:36,1:0.02:36,"/>
<Variable Name="Night sky: Zenith color multiplier" Value="0.02">
<Spline Keys="0:0.02:36"/>
</Variable>
<Variable Name="Night sky: Zenith shift" Value="0.5">
<Spline Keys="0:0.5:36,0.25:0.5:36,0.5:0.5:65572,0.75:0.5:36,1:0.5:36,"/>
<Spline Keys="0:0.5:36"/>
</Variable>
<Variable Name="Night sky: Star intensity" Value="0">
<Spline Keys="0:3:36,0.25:0:36,0.5:0:65572,0.75:0:36,0.836647:1.03977:36,1:3:36,"/>
<Variable Name="Night sky: Star intensity" Value="3">
<Spline Keys="0:3:36"/>
</Variable>
<Variable Name="Night sky: Moon color" Color="1,1,1">
<Spline Keys="0:(1:1:1):36,0.25:(1:1:1):36,0.5:(1:1:1):458788,0.75:(1:1:1):36,1:(1:1:1):36,"/>
<Spline Keys="0:(1:1:1):36"/>
</Variable>
<Variable Name="Night sky: Moon color multiplier" Value="0">
<Spline Keys="0:0.4:36,0.25:0:36,0.5:0:36,0.75:0:65572,1:0.4:36,"/>
<Variable Name="Night sky: Moon color multiplier" Value="0.40000001">
<Spline Keys="0:0.4:36"/>
</Variable>
<Variable Name="Night sky: Moon inner corona color" Color="0.904661,1,1">
<Spline Keys="0:(0.89627:1:1):36,0.25:(0.904661:1:1):36,0.5:(0.904661:1:1):393252,0.75:(0.904661:1:1):36,0.836647:(0.89627:1:1):36,1:(0.89627:1:1):36,"/>
<Variable Name="Night sky: Moon inner corona color" Color="0.89626998,1,1">
<Spline Keys="0:(0.89627:1:1):36"/>
</Variable>
<Variable Name="Night sky: Moon inner corona color multiplier" Value="0">
<Spline Keys="0:0.1:36,0.25:0:36,0.5:0:65572,0.75:0:36,1:0.1:36,"/>
<Variable Name="Night sky: Moon inner corona color multiplier" Value="0.1">
<Spline Keys="0:0.1:36"/>
</Variable>
<Variable Name="Night sky: Moon inner corona scale" Value="0">
<Spline Keys="0:2:36,0.25:0:36,0.5:0:65572,0.75:0:36,0.836647:0.693178:36,1:2:36,"/>
<Variable Name="Night sky: Moon inner corona scale" Value="2">
<Spline Keys="0:2:36"/>
</Variable>
<Variable Name="Night sky: Moon outer corona color" Color="0.201556,0.22696599,0.25415203">
<Spline Keys="0:(0.198069:0.226966:0.250158):36,0.25:(0.201556:0.226966:0.254152):36,0.5:(0.201556:0.226966:0.254152):36,0.75:(0.201556:0.226966:0.254152):36,1:(0.198069:0.226966:0.250158):36,"/>
<Variable Name="Night sky: Moon outer corona color" Color="0.19806901,0.22696599,0.25015801">
<Spline Keys="0:(0.198069:0.226966:0.250158):36"/>
</Variable>
<Variable Name="Night sky: Moon outer corona color multiplier" Value="0">
<Spline Keys="0:0.1:36,0.25:0:36,0.5:0:65572,0.75:0:36,1:0.1:36,"/>
<Variable Name="Night sky: Moon outer corona color multiplier" Value="0.1">
<Spline Keys="0:0.1:36"/>
</Variable>
<Variable Name="Night sky: Moon outer corona scale" Value="0">
<Spline Keys="0:0.01:36,0.25:0:36,0.5:0:65572,0.75:0:36,1:0.01:36,"/>
<Variable Name="Night sky: Moon outer corona scale" Value="0.0099999998">
<Spline Keys="0:0.01:36"/>
</Variable>
<Variable Name="Cloud shading: Sun light multiplier" Value="1">
<Spline Keys="0:1:36,0.25:1:36,0.5:1:65572,0.75:1:36,1:1:36,"/>
<Spline Keys="0:1:36"/>
</Variable>
<Variable Name="Cloud shading: Sun custom color" Color="0.83076996,0.76815104,0.65837508">
<Spline Keys="0:(0.737911:0.737911:0.737911):36,0.25:(0.83077:0.768151:0.658375):36,0.5:(0.83077:0.768151:0.658375):458788,0.75:(0.83077:0.768151:0.658375):36,1:(0.737911:0.737911:0.737911):36,"/>
<Variable Name="Cloud shading: Sun custom color" Color="0.73791099,0.73791099,0.73791099">
<Spline Keys="0:(0.737911:0.737911:0.737911):36"/>
</Variable>
<Variable Name="Cloud shading: Sun custom color multiplier" Value="1">
<Spline Keys="0:0.1:36,0.25:1:36,0.5:1:65572,0.75:1:36,1:0.1:36,"/>
<Variable Name="Cloud shading: Sun custom color multiplier" Value="0.1">
<Spline Keys="0:0.1:36"/>
</Variable>
<Variable Name="Cloud shading: Sun custom color influence" Value="0">
<Spline Keys="0:0.5:36,0.25:0:36,0.5:0:65572,0.75:0:36,1:0.5:36,"/>
<Variable Name="Cloud shading: Sun custom color influence" Value="0.5">
<Spline Keys="0:0.5:36"/>
</Variable>
<Variable Name="Sun shafts visibility" Value="0">
<Spline Keys="0:0:36,0.25:0:36,0.5:0:65572,0.75:0:36,1:0:36,"/>
<Spline Keys="0:0:36"/>
</Variable>
<Variable Name="Sun rays visibility" Value="1.5">
<Spline Keys="0:1:36,0.25:1.5:36,0.5:1.5:65572,0.75:1.5:36,1:1:36,"/>
<Variable Name="Sun rays visibility" Value="1">
<Spline Keys="0:1:36"/>
</Variable>
<Variable Name="Sun rays attenuation" Value="1.5">
<Spline Keys="0:0.1:36,0.25:1.5:36,0.5:1.5:65572,0.75:1.5:36,1:0.1:36,"/>
<Variable Name="Sun rays attenuation" Value="0.1">
<Spline Keys="0:0.1:36"/>
</Variable>
<Variable Name="Sun rays suncolor influence" Value="0.5">
<Spline Keys="0:0.5:36,0.25:0.5:36,0.5:0.5:65572,0.75:0.5:36,1:0.5:36,"/>
<Spline Keys="0:0.5:36"/>
</Variable>
<Variable Name="Sun rays custom color" Color="0.66538697,0.83879906,0.94730699">
<Spline Keys="0:(0.665387:0.838799:0.947307):36,0.25:(0.665387:0.838799:0.947307):36,0.5:(0.665387:0.838799:0.947307):458788,0.75:(0.665387:0.838799:0.947307):36,1:(0.665387:0.838799:0.947307):36,"/>
<Variable Name="Sun rays custom color" Color="0.66538697,0.838799,0.94730699">
<Spline Keys="0:(0.665387:0.838799:0.947307):36"/>
</Variable>
<Variable Name="Ocean fog color" Color="0.0012141101,0.0091340598,0.017642001">
<Spline Keys="0:(0.00121411:0.00913406:0.017642):36,0.25:(0.00121411:0.00913406:0.017642):36,0.5:(0.00121411:0.00913406:0.017642):458788,0.75:(0.00121411:0.00913406:0.017642):36,1:(0.00121411:0.00913406:0.017642):36,"/>
<Variable Name="Ocean fog color" Color="0.0012141099,0.0091340598,0.017642001">
<Spline Keys="0:(0.00121411:0.00913406:0.017642):36"/>
</Variable>
<Variable Name="Ocean fog color multiplier" Value="0.5">
<Spline Keys="0:0.5:36,0.25:0.5:36,0.5:0.5:65572,0.75:0.5:36,1:0.5:36,"/>
<Spline Keys="0:0.5:36"/>
</Variable>
<Variable Name="Ocean fog density" Value="0.5">
<Spline Keys="0:0.5:36,0.25:0.5:36,0.5:0.5:65572,0.75:0.5:36,1:0.5:36,"/>
<Spline Keys="0:0.5:36"/>
</Variable>
<Variable Name="Static skybox multiplier" Value="1">
<Spline Keys="0:1:0,1:1:0,"/>
<Spline Keys="0:1:0"/>
</Variable>
<Variable Name="Film curve shoulder scale" Value="2.232213">
<Spline Keys="0:3:36,0.229167:3:36,0.5:2:36,0.770833:3:36,1:3:36,"/>
<Variable Name="Film curve shoulder scale" Value="3">
<Spline Keys="0:3:36"/>
</Variable>
<Variable Name="Film curve midtones scale" Value="0.88389361">
<Spline Keys="0:0.5:36,0.229167:0.5:36,0.5:1:36,0.770833:0.5:36,1:0.5:36,"/>
<Variable Name="Film curve midtones scale" Value="0.5">
<Spline Keys="0:0.5:36"/>
</Variable>
<Variable Name="Film curve toe scale" Value="1">
<Spline Keys="0:1:36,0.25:1:36,0.5:1:65572,0.75:1:36,1:1:36,"/>
<Spline Keys="0:1:36"/>
</Variable>
<Variable Name="Film curve whitepoint" Value="4">
<Spline Keys="0:4:36,0.25:4:36,0.5:4:65572,0.75:4:36,1:4:36,"/>
<Spline Keys="0:4:36"/>
</Variable>
<Variable Name="Saturation" Value="1">
<Spline Keys="0:0.8:36,0.229167:0.8:36,0.5:1:36,0.751391:1:65572,0.770833:0.8:36,1:0.8:36,"/>
<Variable Name="Saturation" Value="0.80000001">
<Spline Keys="0:0.8:36"/>
</Variable>
<Variable Name="Color balance" Color="1,1,1">
<Spline Keys="0:(1:1:1):36,0.25:(1:1:1):36,0.5:(1:1:1):36,0.75:(1:1:1):36,1:(1:1:1):36,"/>
<Spline Keys="0:(1:1:1):36"/>
</Variable>
<Variable Name="Scene key" Value="0.18000002">
<Spline Keys="0:0.18:36,0.25:0.18:36,0.5:0.18:65572,0.75:0.18:36,1:0.18:36,"/>
<Variable Name="Scene key" Value="0.18000001">
<Spline Keys="0:0.18:36"/>
</Variable>
<Variable Name="Min exposure" Value="1">
<Spline Keys="0:1:36,0.25:1:36,0.5:1:65572,0.75:1:36,1:1:36,"/>
<Spline Keys="0:1:36"/>
</Variable>
<Variable Name="Max exposure" Value="2.6142297">
<Spline Keys="0:2:36,0.229167:2:36,0.5:2.8:36,0.770833:2:36,1:2:36,"/>
<Variable Name="Max exposure" Value="2">
<Spline Keys="0:2:36"/>
</Variable>
<Variable Name="EV Min" Value="4.5">
<Spline Keys="0:4.5:0,1:4.5:0,"/>
<Spline Keys="0:4.5:0"/>
</Variable>
<Variable Name="EV Max" Value="17">
<Spline Keys="0:17:0,1:17:0,"/>
<Spline Keys="0:17:0"/>
</Variable>
<Variable Name="EV Auto compensation" Value="1.5">
<Spline Keys="0:1.5:0,1:1.5:0,"/>
<Spline Keys="0:1.5:0"/>
</Variable>
<Variable Name="Bloom amount" Value="0.30899152">
<Spline Keys="0:1:36,0.229167:1:36,0.5:0.1:36,0.770833:1:36,1:1:36,"/>
<Variable Name="Bloom amount" Value="1">
<Spline Keys="0:1:36"/>
</Variable>
<Variable Name="Filters: grain" Value="0">
<Spline Keys="0:0.3:65572,0.229167:0.3:36,0.25:0:36,0.5:0:36,0.75:0:36,1:0.3:36,"/>
<Variable Name="Filters: grain" Value="0.30000001">
<Spline Keys="0:0.3:65572"/>
</Variable>
<Variable Name="Filters: photofilter color" Color="0,0,0">
<Spline Keys="0:(0:0:0):36,0.25:(0:0:0):36,0.5:(0:0:0):458788,0.75:(0:0:0):36,1:(0:0:0):36,"/>
<Spline Keys="0:(0:0:0):36"/>
</Variable>
<Variable Name="Filters: photofilter density" Value="0">
<Spline Keys="0:0:36,0.25:0:36,0.5:0:36,0.75:0:36,1:0:36,"/>
<Spline Keys="0:0:36"/>
</Variable>
<Variable Name="Dof: focus range" Value="500.00003">
<Spline Keys="0:500:36,0.25:500:36,0.5:500:65572,0.75:500:36,1:500:36,"/>
<Variable Name="Dof: focus range" Value="500">
<Spline Keys="0:500:36"/>
</Variable>
<Variable Name="Dof: blur amount" Value="0.10000001">
<Spline Keys="0:0.1:36,0.25:0.1:36,0.5:0.1:65572,0.75:0.1:36,1:0.1:36,"/>
<Variable Name="Dof: blur amount" Value="0.1">
<Spline Keys="0:0.1:36"/>
</Variable>
<Variable Name="Cascade 0: Bias" Value="0.10000001">
<Spline Keys="0:0.1:36,0.25:0.1:36,0.5:0.1:65572,0.75:0.1:36,1:0.1:36,"/>
<Variable Name="Cascade 0: Bias" Value="0.1">
<Spline Keys="0:0.1:36"/>
</Variable>
<Variable Name="Cascade 0: Slope Bias" Value="64">
<Spline Keys="0:64:36,0.25:64:36,0.5:64:65572,0.75:64:36,1:64:36,"/>
<Spline Keys="0:64:36"/>
</Variable>
<Variable Name="Cascade 1: Bias" Value="0.10000001">
<Spline Keys="0:0.1:36,0.25:0.1:36,0.5:0.1:65572,0.75:0.1:36,1:0.1:36,"/>
<Variable Name="Cascade 1: Bias" Value="0.1">
<Spline Keys="0:0.1:36"/>
</Variable>
<Variable Name="Cascade 1: Slope Bias" Value="23">
<Spline Keys="0:23:36,0.25:23:36,0.5:23:65572,0.75:23:36,1:23:36,"/>
<Spline Keys="0:23:36"/>
</Variable>
<Variable Name="Cascade 2: Bias" Value="0.10000001">
<Spline Keys="0:0.1:36,0.25:0.1:36,0.5:0.1:65572,0.75:0.1:36,1:0.1:36,"/>
<Variable Name="Cascade 2: Bias" Value="0.1">
<Spline Keys="0:0.1:36"/>
</Variable>
<Variable Name="Cascade 2: Slope Bias" Value="4">
<Spline Keys="0:4:36,0.25:4:36,0.5:4:65572,0.75:4:36,1:4:36,"/>
<Spline Keys="0:4:36"/>
</Variable>
<Variable Name="Cascade 3: Bias" Value="0.10000001">
<Spline Keys="0:0.1:36,0.25:0.1:36,0.5:0.1:36,0.75:0.1:36,1:0.1:36,"/>
<Variable Name="Cascade 3: Bias" Value="0.1">
<Spline Keys="0:0.1:36"/>
</Variable>
<Variable Name="Cascade 3: Slope Bias" Value="1">
<Spline Keys="0:1:36,0.25:1:36,0.5:1:65572,0.75:1:36,1:1:36,"/>
<Spline Keys="0:1:36"/>
</Variable>
<Variable Name="Cascade 4: Bias" Value="0.10000001">
<Spline Keys="0:0.1:0,0.25:0.1:36,0.5:0.1:65572,0.75:0.1:36,1:0.1:36,"/>
<Variable Name="Cascade 4: Bias" Value="0.1">
<Spline Keys="0:0.1:0"/>
</Variable>
<Variable Name="Cascade 4: Slope Bias" Value="1">
<Spline Keys="0:1:0,0.25:1:36,0.5:1:65572,0.75:1:36,1:1:36,"/>
<Spline Keys="0:1:0"/>
</Variable>
<Variable Name="Cascade 5: Bias" Value="0.0099999998">
<Spline Keys="0:0.01:0,0.25:0.01:36,0.5:0.01:65572,0.75:0.01:36,1:0.01:36,"/>
<Spline Keys="0:0.01:0"/>
</Variable>
<Variable Name="Cascade 5: Slope Bias" Value="1">
<Spline Keys="0:1:0,0.25:1:36,0.5:1:65572,0.75:1:36,1:1:36,"/>
<Spline Keys="0:1:0"/>
</Variable>
<Variable Name="Cascade 6: Bias" Value="0.10000001">
<Spline Keys="0:0.1:0,0.25:0.1:36,0.5:0.1:36,0.75:0.1:36,1:0.1:36,"/>
<Variable Name="Cascade 6: Bias" Value="0.1">
<Spline Keys="0:0.1:0"/>
</Variable>
<Variable Name="Cascade 6: Slope Bias" Value="1">
<Spline Keys="0:1:0,0.25:1:36,0.5:1:65572,0.75:1:36,1:1:36,"/>
<Spline Keys="0:1:0"/>
</Variable>
<Variable Name="Cascade 7: Bias" Value="0.10000001">
<Spline Keys="0:0.1:0,0.25:0.1:36,0.5:0.1:36,0.75:0.1:36,1:0.1:36,"/>
<Variable Name="Cascade 7: Bias" Value="0.1">
<Spline Keys="0:0.1:0"/>
</Variable>
<Variable Name="Cascade 7: Slope Bias" Value="1">
<Spline Keys="0:1:0,0.25:1:36,0.5:1:65572,0.75:1:36,1:1:36,"/>
<Spline Keys="0:1:0"/>
</Variable>
<Variable Name="Shadow jittering" Value="2.4999998">
<Spline Keys="0:5:36,0.25:2.5:36,0.5:2.5:65572,0.75:2.5:36,1:5:0,"/>
<Variable Name="Shadow jittering" Value="5">
<Spline Keys="0:5:36"/>
</Variable>
<Variable Name="HDR dynamic power factor" Value="0">
<Spline Keys="0:0:36,0.25:0:36,0.5:0:65572,0.75:0:36,1:0:36,"/>
<Spline Keys="0:0:36"/>
</Variable>
<Variable Name="Sky brightening (terrain occlusion)" Value="0">
<Spline Keys="0:0:36,0.25:0:36,0.5:0:36,0.75:0:36,1:0:36,"/>
<Spline Keys="0:0:36"/>
</Variable>
<Variable Name="Sun color multiplier" Value="9.999999">
<Spline Keys="0:0.1:36,0.25:10:36,0.5:10:36,0.75:10:36,1:0.1:36,"/>
<Variable Name="Sun color multiplier" Value="0.1">
<Spline Keys="0:0.1:36"/>
</Variable>
</TimeOfDay>

@ -1,7 +1,7 @@
sys_game_name = "AutomatedTesting"
sys_localization_folder = Localization
ca_useIMG_CAF = 0
sys_asserts=2
sys_asserts=1
-- Enable warnings when asset loads take longer than the given millisecond threshold
cl_assetLoadWarningEnable=true

@ -247,7 +247,7 @@ CUNIXConsole* pUnixConsole;
#define LOCALIZATION_TRANSLATIONS_LIST_FILE_NAME "Libs/Localization/localization.xml"
#define LOAD_LEGACY_RENDERER_FOR_EDITOR true // If you set this to false you must for now also set 'ed_useAtomNativeViewport' to true (see /Code/Sandbox/Editor/ViewManager.cpp)
#define LOAD_LEGACY_RENDERER_FOR_EDITOR false // If you set this to true you must also set 'ed_useAtomNativeViewport' to false (see /Code/Sandbox/Editor/ViewManager.cpp)
#define LOAD_LEGACY_RENDERER_FOR_LAUNCHER false
//////////////////////////////////////////////////////////////////////////
@ -1294,7 +1294,7 @@ bool CSystem::OpenRenderLibrary(int type, const SSystemInitParams& initParams)
const char* libname = "";
if (AZ::Interface<AzFramework::AtomActiveInterface>::Get())
{
libname = "CryRenderOther";
libname = DLL_RENDERER_NULL;
}
else if (type == R_DX9_RENDERER)
{

@ -131,78 +131,18 @@ void CTextureManager::LoadDefaultTextures()
#endif
};
// Reduced list of default textures to load.
const TextureEntry texturesFromFileReduced[] =
for (const TextureEntry& entry : texturesFromFile)
{
{"NoTextureCM", "EngineAssets/TextureMsg/ReplaceMeCM.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
{"White", "EngineAssets/Textures/White.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
{"Gray", "EngineAssets/Textures/Grey.dds", FT_DONT_RELEASE | FT_DONT_STREAM },
{"Black", "EngineAssets/Textures/Black.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
{"BlackAlpha", "EngineAssets/Textures/BlackAlpha.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
{"BlackCM", "EngineAssets/Textures/BlackCM.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
{"FlatBump", "EngineAssets/Textures/White_ddn.tif", FT_DONT_RELEASE | FT_DONT_STREAM | FT_TEX_NORMAL_MAP },
{"AverageMemoryUsage", "EngineAssets/Icons/AverageMemoryUsage.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
{"LowMemoryUsage", "EngineAssets/Icons/LowMemoryUsage.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
{"HighMemoryUsage", "EngineAssets/Icons/HighMemoryUsage.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
{"LivePreview", "EngineAssets/Icons/LivePreview.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
#if !defined(_RELEASE)
{"NoTexture", "EngineAssets/TextureMsg/ReplaceMe.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
{"IconTextureCompiling", "EngineAssets/TextureMsg/TextureCompiling.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
{"IconTextureCompiling_a", "EngineAssets/TextureMsg/TextureCompiling_a.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
{"IconTextureCompiling_cm", "EngineAssets/TextureMsg/TextureCompiling_cm.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
{"IconTextureCompiling_ddn", "EngineAssets/TextureMsg/TextureCompiling_ddn.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
{"IconTextureCompiling_ddna", "EngineAssets/TextureMsg/TextureCompiling_ddna.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
{"DefaultMergedDetail", "EngineAssets/Textures/GreyAlpha.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
{"MipMapDebug", "EngineAssets/TextureMsg/MipMapDebug.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
{"ColorBlue", "EngineAssets/TextureMsg/color_Blue.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
{"ColorCyan", "EngineAssets/TextureMsg/color_Cyan.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
{"ColorGreen", "EngineAssets/TextureMsg/color_Green.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
{"ColorPurple", "EngineAssets/TextureMsg/color_Purple.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
{"ColorRed", "EngineAssets/TextureMsg/color_Red.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
{"ColorWhite", "EngineAssets/TextureMsg/color_White.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
{"ColorYellow", "EngineAssets/TextureMsg/color_Yellow.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
{"ColorOrange", "EngineAssets/TextureMsg/color_Orange.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
{"ColorMagenta", "EngineAssets/TextureMsg/color_Magenta.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
#else
{"NoTexture", "EngineAssets/TextureMsg/ReplaceMeRelease.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
#endif
};
// Loop over the appropriate texture list and load the textures, storing them in a map keyed by texture name.
// Use reduced subset of textures for Other.
if (AZ::Interface<AzFramework::AtomActiveInterface>::Get())
{
for (const TextureEntry& entry : texturesFromFileReduced)
CTexture* pNewTexture = CTexture::ForName(entry.szFileName, entry.flags, eTF_Unknown);
if (pNewTexture)
{
// Use EF_LoadTexture rather than CTexture::ForName
CTexture* pNewTexture = static_cast<CTexture*>(gEnv->pRenderer->EF_LoadTexture(entry.szFileName, entry.flags));
if (pNewTexture)
{
CCryNameTSCRC texEntry(entry.szTextureName);
m_DefaultTextures[texEntry] = pNewTexture;
}
else
{
AZ_Assert(false, "Error - CTextureManager failed to load default texture %s", entry.szFileName);
AZ_Warning("[Shaders System]", false, "Error - CTextureManager failed to load default texture %s", entry.szFileName);
}
CCryNameTSCRC texEntry(entry.szTextureName);
m_DefaultTextures[texEntry] = pNewTexture;
}
}
else
{
for (const TextureEntry& entry : texturesFromFile)
else
{
CTexture* pNewTexture = CTexture::ForName(entry.szFileName, entry.flags, eTF_Unknown);
if (pNewTexture)
{
CCryNameTSCRC texEntry(entry.szTextureName);
m_DefaultTextures[texEntry] = pNewTexture;
}
else
{
AZ_Assert(false, "Error - CTextureManager failed to load default texture %s", entry.szFileName);
AZ_Warning("[Shaders System]", false, "Error - CTextureManager failed to load default texture %s", entry.szFileName);
}
AZ_Assert(false, "Error - CTextureManager failed to load default texture %s", entry.szFileName);
AZ_Warning("[Shaders System]", false, "Error - CTextureManager failed to load default texture %s", entry.szFileName);
}
}

@ -78,7 +78,7 @@ namespace Physics
float m_minimumMovementDistance = 0.001f; //!< To avoid jittering, the controller will not attempt to move distances below this.
float m_maximumSpeed = 100.0f; //!< If the accumulated requested velocity for a tick exceeds this magnitude, it will be clamped.
AZStd::string m_colliderTag; //!< Used to identify the collider associated with the character controller.
AZStd::shared_ptr<Physics::ShapeConfiguration> m_shapeConfig = nullptr; //!< The shape to use when creating the character controller.
AZStd::shared_ptr<Physics::ShapeConfiguration> m_shapeConfig; //!< The shape to use when creating the character controller.
AZStd::vector<AZStd::shared_ptr<Physics::Shape>> m_colliders; //!< The list of colliders to attach to the character controller.
};

@ -55,7 +55,7 @@ namespace AzPhysics
//! Flag to determine if the body is part of the simulation.
//! When true the body will be affected by any forces, collisions, and found with scene queries.
bool m_simulating = true;
bool m_simulating = false;
//! Helper functions for setting user data.
//! @param userData Can be a pointer to any type as internally will be cast to a void*. Object lifetime not managed by the SimulatedBody.

@ -46,6 +46,7 @@ namespace AzPhysics
->Field("orientation", &SimulatedBodyConfiguration::m_orientation)
->Field("scale", &SimulatedBodyConfiguration::m_scale)
->Field("entityId", &SimulatedBodyConfiguration::m_entityId)
->Field("startSimulationEnabled", &SimulatedBodyConfiguration::m_startSimulationEnabled)
;
}
}

@ -39,6 +39,7 @@ namespace AzPhysics
AZ::Vector3 m_position = AZ::Vector3::CreateZero();
AZ::Quaternion m_orientation = AZ::Quaternion::CreateIdentity();
AZ::Vector3 m_scale = AZ::Vector3::CreateOne();
bool m_startSimulationEnabled = true;
// Entity/object association.
AZ::EntityId m_entityId = AZ::EntityId(AZ::EntityId::InvalidEntityId);

@ -52,6 +52,11 @@ namespace Physics
}
}
RagdollConfiguration::RagdollConfiguration()
{
m_startSimulationEnabled = false; //ragdolls do not start enabled.
}
void RagdollConfiguration::Reflect(AZ::ReflectContext* context)
{
AZ::SerializeContext* serializeContext = azrtti_cast<AZ::SerializeContext*>(context);

@ -24,6 +24,8 @@
namespace Physics
{
using ParentIndices = AZStd::vector<size_t>;
class RagdollNodeConfiguration
: public AzPhysics::RigidBodyConfiguration
{
@ -46,7 +48,7 @@ namespace Physics
AZ_RTTI(RagdollConfiguration, "{7C96D332-61D8-4C58-A2BF-707716D38D14}", AzPhysics::SimulatedBodyConfiguration);
static void Reflect(AZ::ReflectContext* context);
RagdollConfiguration() = default;
RagdollConfiguration();
explicit RagdollConfiguration(const RagdollConfiguration& settings) = default;
RagdollNodeConfiguration* FindNodeConfigByName(const AZStd::string& nodeName) const;
@ -56,6 +58,8 @@ namespace Physics
AZStd::vector<RagdollNodeConfiguration> m_nodes;
CharacterColliderConfiguration m_colliders;
RagdollState m_initialState;
ParentIndices m_parentIndices;
};
/// Represents a single rigid part of a ragdoll.
@ -79,7 +83,7 @@ namespace Physics
{
public:
AZ_CLASS_ALLOCATOR(Ragdoll, AZ::SystemAllocator, 0);
AZ_RTTI(Ragdoll, "{01F09602-80EC-4693-A0E7-C2719239044B}", AzPhysics::SimulatedBody);
AZ_RTTI(Physics::Ragdoll, "{01F09602-80EC-4693-A0E7-C2719239044B}", AzPhysics::SimulatedBody);
virtual ~Ragdoll() = default;
/// Inserts the ragdoll into the physics simulation.

@ -26,6 +26,22 @@ namespace Physics
->Field("Scale", &ShapeConfiguration::m_scale)
;
}
if (auto behaviorContext = azrtti_cast<AZ::BehaviorContext*>(context))
{
#define REFLECT_SHAPETYPE_ENUM_VALUE(EnumValue) \
behaviorContext->EnumProperty<(int)Physics::ShapeType::EnumValue>("ShapeType_"#EnumValue) \
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Automation) \
->Attribute(AZ::Script::Attributes::Module, "physics");
// Note: Here we only expose the types that are available to the user in the editor
REFLECT_SHAPETYPE_ENUM_VALUE(Box);
REFLECT_SHAPETYPE_ENUM_VALUE(Sphere);
REFLECT_SHAPETYPE_ENUM_VALUE(Cylinder);
REFLECT_SHAPETYPE_ENUM_VALUE(PhysicsAsset);
#undef REFLECT_SHAPETYPE_ENUM_VALUE
}
}
void SphereShapeConfiguration::Reflect(AZ::ReflectContext* context)

@ -348,6 +348,11 @@ namespace AzToolsFramework
*/
virtual bool AreAnyEntitiesSelected() = 0;
/*!
* Returns the number of selected entities.
*/
virtual int GetSelectedEntitiesCount() = 0;
/*!
* Retrieves the set of selected entities.
* \return a list of entity Ids.

@ -395,6 +395,7 @@ namespace AzToolsFramework
->Event("MarkEntityDeselected", &ToolsApplicationRequests::MarkEntityDeselected)
->Event("IsSelected", &ToolsApplicationRequests::IsSelected)
->Event("AreAnyEntitiesSelected", &ToolsApplicationRequests::AreAnyEntitiesSelected)
->Event("GetSelectedEntitiesCount", &ToolsApplicationRequests::GetSelectedEntitiesCount)
;
behaviorContext->EBus<ToolsApplicationNotificationBus>("ToolsApplicationNotificationBus")

@ -101,6 +101,7 @@ namespace AzToolsFramework
SourceControlFileInfo GetSceneSourceControlInfo() override;
bool AreAnyEntitiesSelected() override { return !m_selectedEntities.empty(); }
int GetSelectedEntitiesCount() override { return m_selectedEntities.size(); }
const EntityIdList& GetSelectedEntities() override { return m_selectedEntities; }
const EntityIdList& GetHighlightedEntities() override { return m_highlightedEntities; }
void SetSelectedEntities(const EntityIdList& selectedEntities) override;

@ -242,19 +242,6 @@ namespace AzToolsFramework
return false;
}
}
else
{
// The template is already loaded, this is the case of either saving as same name or different name(loaded from before).
// Update the template with the changes
AzToolsFramework::Prefab::PrefabDom dom;
bool success = AzToolsFramework::Prefab::PrefabDomUtils::StoreInstanceInPrefabDom(*m_rootInstance, dom);
if (!success)
{
AZ_Error("Prefab", false, "Failed to convert current root instance into a DOM when saving file '%.*s'", AZ_STRING_ARG(filename));
return false;
}
m_prefabSystemComponent->UpdatePrefabTemplate(templateId, dom);
}
Prefab::TemplateId prevTemplateId = m_rootInstance->GetTemplateId();
m_rootInstance->SetTemplateId(templateId);

@ -200,7 +200,7 @@ namespace AzToolsFramework
}
return context.Report(result,
result.GetProcessing() == JSR::Processing::Completed ? "Succesfully loaded instance information for prefab." :
result.GetProcessing() == JSR::Processing::Completed ? "Successfully loaded instance information for prefab." :
"Failed to load instance information for prefab");
}

@ -230,6 +230,10 @@ namespace AzToolsFramework
AZ_Assert(instanceDom.IsObject(), "Link Id '%u' cannot be added because the DOM of the instance is not an object.", m_id);
instanceDom.AddMember(rapidjson::StringRef(PrefabDomUtils::LinkIdName), rapidjson::Value().SetUint64(m_id), allocator);
}
else
{
linkIdReference->get().SetUint64(m_id);
}
}
} // namespace Prefab

@ -392,12 +392,27 @@ namespace AzToolsFramework
if (patch.IsArray() && !patch.Empty() && beforeState.IsObject())
{
// Update the state of the entity
PrefabUndoEntityUpdate* state = aznew PrefabUndoEntityUpdate(AZStd::to_string(static_cast<AZ::u64>(entityId)));
state->SetParent(parentUndoBatch);
state->Capture(beforeState, afterState, entityId);
if (IsInstanceContainerEntity(entityId) && !IsLevelInstanceContainerEntity(entityId))
{
m_instanceToTemplateInterface->AppendEntityAliasToPatchPaths(patch, entityId);
// Save these changes as patches to the link
PrefabUndoLinkUpdate* linkUpdate =
aznew PrefabUndoLinkUpdate(AZStd::to_string(static_cast<AZ::u64>(entityId)));
linkUpdate->SetParent(parentUndoBatch);
linkUpdate->Capture(patch, owningInstance->get().GetLinkId());
state->Redo();
linkUpdate->Redo();
}
else
{
// Update the state of the entity
PrefabUndoEntityUpdate* state = aznew PrefabUndoEntityUpdate(AZStd::to_string(static_cast<AZ::u64>(entityId)));
state->SetParent(parentUndoBatch);
state->Capture(beforeState, afterState, entityId);
state->Redo();
}
}
// Update the cache

@ -63,7 +63,7 @@ AZ_POP_DISABLE_WARNING
#include <UI/PropertyEditor/Model/AssetCompleterModel.h>
#include <UI/PropertyEditor/View/AssetCompleterListView.h>
#include <UI/PropertyEditor/ThumbnailDropDown.h>
#include <UI/PropertyEditor/ThumbnailPropertyCtrl.h>
namespace AzToolsFramework
{
@ -93,15 +93,11 @@ namespace AzToolsFramework
setAcceptDrops(true);
m_thumbnail = new Thumbnailer::ThumbnailWidget(this);
m_thumbnail->setFixedSize(QSize(24, 24));
m_thumbnail = new ThumbnailPropertyCtrl(this);
m_thumbnail->setFixedSize(QSize(40, 24));
m_thumbnail->setVisible(false);
m_thumbnailDropDown = new ThumbnailDropDown(this);
m_thumbnailDropDown->setFixedSize(QSize(40, 24));
m_thumbnailDropDown->setVisible(false);
connect(m_thumbnailDropDown, &ThumbnailDropDown::clicked, this, &PropertyAssetCtrl::OnEditButtonClicked);
connect(m_thumbnail, &ThumbnailPropertyCtrl::clicked, this, &PropertyAssetCtrl::OnThumbnailClicked);
m_editButton = new QToolButton(this);
m_editButton->setAutoRaise(true);
@ -112,7 +108,6 @@ namespace AzToolsFramework
connect(m_editButton, &QToolButton::clicked, this, &PropertyAssetCtrl::OnEditButtonClicked);
pLayout->addWidget(m_thumbnail);
pLayout->addWidget(m_thumbnailDropDown);
pLayout->addWidget(m_browseEdit);
pLayout->addWidget(m_editButton);
@ -188,6 +183,17 @@ namespace AzToolsFramework
}
}
void PropertyAssetCtrl::OnThumbnailClicked()
{
const AZ::Data::AssetId assetID = GetCurrentAssetID();
if (m_thumbnailCallback)
{
AZ_Error("Asset Property", m_editNotifyTarget, "No notification target set for edit callback.");
m_thumbnailCallback->Invoke(m_editNotifyTarget, assetID, GetCurrentAssetType());
return;
}
}
void PropertyAssetCtrl::OnCompletionModelReset()
{
if (!m_completerIsActive)
@ -1091,10 +1097,10 @@ namespace AzToolsFramework
void PropertyAssetCtrl::UpdateThumbnail()
{
m_thumbnail->setVisible(m_showThumbnail);
m_thumbnailDropDown->setVisible(m_showThumbnailDropDown);
if (m_showThumbnail || m_showThumbnailDropDown)
if (m_showThumbnail)
{
m_thumbnail->ShowDropDownArrow(m_showThumbnailDropDownButton);
const AZ::Data::AssetId assetID = GetCurrentAssetID();
if (assetID.IsValid())
{
@ -1112,17 +1118,12 @@ namespace AzToolsFramework
{
m_thumbnail->SetThumbnailKey(thumbnailKey, Thumbnailer::ThumbnailContext::DefaultContext);
}
if (m_showThumbnailDropDown)
{
m_thumbnailDropDown->SetThumbnailKey(thumbnailKey, Thumbnailer::ThumbnailContext::DefaultContext);
}
return;
}
}
}
m_thumbnail->ClearThumbnail();
m_thumbnailDropDown->ClearThumbnail();
}
void PropertyAssetCtrl::SetClearButtonEnabled(bool enable)
@ -1156,14 +1157,19 @@ namespace AzToolsFramework
return m_showThumbnail;
}
void PropertyAssetCtrl::SetShowThumbnailDropDown(bool enable)
void PropertyAssetCtrl::SetShowThumbnailDropDownButton(bool enable)
{
m_showThumbnailDropDownButton = enable;
}
bool PropertyAssetCtrl::GetShowThumbnailDropDownButton() const
{
m_showThumbnailDropDown = enable;
return m_showThumbnailDropDownButton;
}
bool PropertyAssetCtrl::GetShowThumbnailDropDown() const
void PropertyAssetCtrl::SetThumbnailCallback(EditCallbackType* editNotifyCallback)
{
return m_showThumbnailDropDown;
m_thumbnailCallback = editNotifyCallback;
}
const AZ::Uuid& AssetPropertyHandlerDefault::GetHandledType() const
@ -1277,23 +1283,21 @@ namespace AzToolsFramework
}
else if (attrib == AZ_CRC_CE("Thumbnail"))
{
bool showThumbnail = false;
if (attrValue->Read<bool>(showThumbnail))
{
GUI->SetShowThumbnail(showThumbnail);
}
GUI->SetShowThumbnail(true);
}
else if (attrib == AZ_CRC_CE("ThumbnailWithDropDown"))
else if (attrib == AZ_CRC_CE("ThumbnailCallback"))
{
PropertyAssetCtrl::EditCallbackType* func = azdynamic_cast<PropertyAssetCtrl::EditCallbackType*>(attrValue->GetAttribute());
if (func)
{
GUI->SetShowThumbnailDropDown(true);
GUI->SetEditNotifyCallback(func);
GUI->SetShowThumbnail(true);
GUI->SetShowThumbnailDropDownButton(true);
GUI->SetThumbnailCallback(func);
}
else
{
GUI->SetEditNotifyCallback(nullptr);
GUI->SetShowThumbnailDropDownButton(false);
GUI->SetThumbnailCallback(nullptr);
}
}
}

@ -45,7 +45,7 @@ namespace AzToolsFramework
{
class AssetCompleterModel;
class AssetCompleterListView;
class ThumbnailDropDown;
class ThumbnailPropertyCtrl;
namespace Thumbnailer
{
@ -95,8 +95,7 @@ namespace AzToolsFramework
void OnAssetIDChanged(AZ::Data::AssetId newAssetID);
protected:
ThumbnailDropDown* m_thumbnailDropDown = nullptr;
Thumbnailer::ThumbnailWidget* m_thumbnail = nullptr;
ThumbnailPropertyCtrl* m_thumbnail = nullptr;
QPushButton* m_errorButton = nullptr;
QToolButton* m_editButton = nullptr;
@ -157,8 +156,8 @@ namespace AzToolsFramework
bool m_showProductAssetName = true;
bool m_showThumbnail = false;
bool m_showThumbnailDropDown = false;
bool m_showThumbnailDropDownButton = false;
EditCallbackType* m_thumbnailCallback = nullptr;
// ! Default suffix used in the field's placeholder text when a default value is set.
const char* m_DefaultSuffix = " (default)";
@ -209,8 +208,9 @@ namespace AzToolsFramework
void SetShowThumbnail(bool enable);
bool GetShowThumbnail() const;
void SetShowThumbnailDropDown(bool enable);
bool GetShowThumbnailDropDown() const;
void SetShowThumbnailDropDownButton(bool enable);
bool GetShowThumbnailDropDownButton() const;
void SetThumbnailCallback(EditCallbackType* editNotifyCallback);
void SetSelectedAssetID(const AZ::Data::AssetId& newID);
void SetCurrentAssetType(const AZ::Data::AssetType& newType);
@ -222,6 +222,7 @@ namespace AzToolsFramework
void UpdateAssetDisplay();
void OnLineEditFocus(bool focus);
virtual void OnEditButtonClicked();
void OnThumbnailClicked();
void OnCompletionModelReset();
void OnAutocomplete(const QModelIndex& index);
void OnTextChange(const QString& text);

@ -19,12 +19,14 @@ AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // 4251: 'QRawFon
#include <QPainter>
#include <UI/UICore/AspectRatioAwarePixmapWidget.hxx>
#include <Thumbnails/ThumbnailWidget.h>
#include <QApplication>
AZ_POP_DISABLE_WARNING
#include "ThumbnailDropDown.h"
#include "ThumbnailPropertyCtrl.h"
namespace AzToolsFramework
{
ThumbnailDropDown::ThumbnailDropDown(QWidget* parent)
ThumbnailPropertyCtrl::ThumbnailPropertyCtrl(QWidget* parent)
: QWidget(parent)
{
QHBoxLayout* pLayout = new QHBoxLayout();
@ -37,6 +39,7 @@ namespace AzToolsFramework
m_dropDownArrow = new AspectRatioAwarePixmapWidget(this);
m_dropDownArrow->setPixmap(QPixmap(":/stylesheet/img/triangle0.png"));
m_dropDownArrow->setFixedSize(QSize(8, 24));
ShowDropDownArrow(false);
m_emptyThumbnail = new QLabel(this);
m_emptyThumbnail->setPixmap(QPixmap(":/stylesheet/img/line.png"));
@ -51,19 +54,33 @@ namespace AzToolsFramework
setLayout(pLayout);
}
void ThumbnailDropDown::SetThumbnailKey(Thumbnailer::SharedThumbnailKey key, const char* contextName)
void ThumbnailPropertyCtrl::SetThumbnailKey(Thumbnailer::SharedThumbnailKey key, const char* contextName)
{
m_key = key;
m_emptyThumbnail->setVisible(false);
m_thumbnail->SetThumbnailKey(key, contextName);
}
void ThumbnailDropDown::ClearThumbnail()
void ThumbnailPropertyCtrl::ClearThumbnail()
{
m_emptyThumbnail->setVisible(true);
m_thumbnail->ClearThumbnail();
}
bool ThumbnailDropDown::event(QEvent* e)
void ThumbnailPropertyCtrl::ShowDropDownArrow(bool visible)
{
if (visible)
{
setFixedSize(QSize(40, 24));
}
else
{
setFixedSize(QSize(24, 24));
}
m_dropDownArrow->setVisible(visible);
}
bool ThumbnailPropertyCtrl::event(QEvent* e)
{
if (isEnabled())
{
@ -77,7 +94,7 @@ namespace AzToolsFramework
return QWidget::event(e);
}
void ThumbnailDropDown::paintEvent(QPaintEvent* e)
void ThumbnailPropertyCtrl::paintEvent(QPaintEvent* e)
{
QPainter p(this);
QRect targetRect(QPoint(), QSize(40, 24));
@ -85,17 +102,32 @@ namespace AzToolsFramework
QWidget::paintEvent(e);
}
void ThumbnailDropDown::enterEvent(QEvent* e)
void ThumbnailPropertyCtrl::enterEvent(QEvent* e)
{
m_dropDownArrow->setPixmap(QPixmap(":/stylesheet/img/triangle0_highlighted.png"));
if (!m_thumbnailEnlarged && m_key)
{
QPoint position = mapToGlobal(pos() - QPoint(185, 0));
QSize size(180, 180);
m_thumbnailEnlarged.reset(new Thumbnailer::ThumbnailWidget());
m_thumbnailEnlarged->setFixedSize(size);
m_thumbnailEnlarged->move(position);
m_thumbnailEnlarged->setWindowFlags(Qt::Window | Qt::FramelessWindowHint);
m_thumbnailEnlarged->SetThumbnailKey(m_key);
m_thumbnailEnlarged->show();
}
QWidget::enterEvent(e);
}
void ThumbnailDropDown::leaveEvent(QEvent* e)
void ThumbnailPropertyCtrl::leaveEvent(QEvent* e)
{
m_dropDownArrow->setPixmap(QPixmap(":/stylesheet/img/triangle0.png"));
if (m_thumbnailEnlarged)
{
m_thumbnailEnlarged.reset();
}
QWidget::leaveEvent(e);
}
}
#include "UI/PropertyEditor/moc_ThumbnailDropDown.cpp"
#include "UI/PropertyEditor/moc_ThumbnailPropertyCtrl.cpp"

@ -30,17 +30,20 @@ namespace AzToolsFramework
class ThumbnailWidget;
}
class ThumbnailDropDown : public QWidget
//! Used by PropertyAssetCtrl to display thumbnail preview of the asset as well as additional drop-down actions
class ThumbnailPropertyCtrl : public QWidget
{
Q_OBJECT
public:
explicit ThumbnailDropDown(QWidget* parent = nullptr);
explicit ThumbnailPropertyCtrl(QWidget* parent = nullptr);
//! Call this to set what thumbnail widget will display
void SetThumbnailKey(Thumbnailer::SharedThumbnailKey key, const char* contextName = "Default");
//! Remove current thumbnail
void ClearThumbnail();
void ShowDropDownArrow(bool visible);
bool event(QEvent* e) override;
Q_SIGNALS:
@ -52,7 +55,9 @@ namespace AzToolsFramework
void leaveEvent(QEvent* e) override;
private:
Thumbnailer::SharedThumbnailKey m_key;
Thumbnailer::ThumbnailWidget* m_thumbnail = nullptr;
QScopedPointer<Thumbnailer::ThumbnailWidget> m_thumbnailEnlarged;
QLabel* m_emptyThumbnail = nullptr;
AspectRatioAwarePixmapWidget* m_dropDownArrow = nullptr;
};

@ -417,8 +417,8 @@ set(FILES
UI/PropertyEditor/GrowTextEdit.cpp
UI/PropertyEditor/MultiLineTextEditHandler.h
UI/PropertyEditor/MultiLineTextEditHandler.cpp
UI/PropertyEditor/ThumbnailDropDown.h
UI/PropertyEditor/ThumbnailDropDown.cpp
UI/PropertyEditor/ThumbnailPropertyCtrl.h
UI/PropertyEditor/ThumbnailPropertyCtrl.cpp
UI/Slice/SlicePushWidget.cpp
UI/Slice/SlicePushWidget.hxx
UI/Slice/SliceOverridesNotificationWindow.cpp

@ -81,12 +81,17 @@ namespace UnitTest
ToolsApplicationRequestBus::BroadcastResult(
anyEntitySelected, &ToolsApplicationRequests::AreAnyEntitiesSelected);
int selectedEntitiesCount = 0;
ToolsApplicationRequestBus::BroadcastResult(
selectedEntitiesCount, &ToolsApplicationRequests::GetSelectedEntitiesCount);
EntityIdList selectedEntityIds;
ToolsApplicationRequestBus::BroadcastResult(
selectedEntityIds, &ToolsApplicationRequests::GetSelectedEntities);
EXPECT_TRUE(testEntitySelected);
EXPECT_TRUE(anyEntitySelected);
EXPECT_EQ(selectedEntitiesCount, 1);
EXPECT_EQ(selectedEntityIds.size(), 1);
EXPECT_EQ(selectedEntityIds.front(), testEntityId);
@ -100,11 +105,15 @@ namespace UnitTest
ToolsApplicationRequestBus::BroadcastResult(
anyEntitySelected, &ToolsApplicationRequests::AreAnyEntitiesSelected);
ToolsApplicationRequestBus::BroadcastResult(
selectedEntitiesCount, &ToolsApplicationRequests::GetSelectedEntitiesCount);
ToolsApplicationRequestBus::BroadcastResult(
selectedEntityIds, &ToolsApplicationRequests::GetSelectedEntities);
EXPECT_FALSE(testEntitySelected);
EXPECT_FALSE(anyEntitySelected);
EXPECT_EQ(selectedEntitiesCount, 0);
EXPECT_TRUE(selectedEntityIds.empty());
}
@ -141,11 +150,16 @@ namespace UnitTest
ToolsApplicationRequestBus::BroadcastResult(
anyEntitySelected, &ToolsApplicationRequests::AreAnyEntitiesSelected);
int selectedEntitiesCount = 0;
ToolsApplicationRequestBus::BroadcastResult(
selectedEntitiesCount, &ToolsApplicationRequests::GetSelectedEntitiesCount);
EntityIdList actualSelectedEntityIds;
ToolsApplicationRequestBus::BroadcastResult(
actualSelectedEntityIds, &ToolsApplicationRequests::GetSelectedEntities);
EXPECT_TRUE(anyEntitySelected);
EXPECT_EQ(selectedEntitiesCount, expectedSelectedEntityIds.size());
EXPECT_EQ(actualSelectedEntityIds.size(), expectedSelectedEntityIds.size());
for (auto& id : expectedSelectedEntityIds)
{
@ -160,10 +174,14 @@ namespace UnitTest
ToolsApplicationRequestBus::BroadcastResult(
anyEntitySelected, &ToolsApplicationRequests::AreAnyEntitiesSelected);
ToolsApplicationRequestBus::BroadcastResult(
selectedEntitiesCount, &ToolsApplicationRequests::GetSelectedEntitiesCount);
ToolsApplicationRequestBus::BroadcastResult(
actualSelectedEntityIds, &ToolsApplicationRequests::GetSelectedEntities);
EXPECT_TRUE(anyEntitySelected);
EXPECT_EQ(selectedEntitiesCount, expectedSelectedEntityIds.size());
EXPECT_EQ(actualSelectedEntityIds.size(), expectedSelectedEntityIds.size());
for (auto& id : expectedSelectedEntityIds)
{

@ -9,17 +9,10 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#
if (LY_MONOLITHIC_GAME) # only Atom is supported in monolithic
set(LY_BUILD_DEPENDENCIES
PUBLIC
Legacy::CryRenderOther
)
else()
set(LY_BUILD_DEPENDENCIES
PRIVATE
Legacy::CryRenderD3D11
)
endif()
set(LY_BUILD_DEPENDENCIES
PRIVATE
Legacy::CryRenderD3D11
)
set(ICON_FILE ${project_real_path}/Gem/Resources/GameSDK.ico)
if(NOT EXISTS ${ICON_FILE})

@ -1,187 +1,64 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates, or
* a third party where indicated.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates, or
* a third party where indicated.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#include "EditorDefs.h"
#include "PropertyMotionCtrl.h"
// Qt
#include <QHBoxLayout>
#include <QLabel>
#include <QToolButton>
// AzToolsFramework
#include <AzToolsFramework/AssetBrowser/AssetSelectionModel.h>
#include <AzToolsFramework/API/ToolsApplicationAPI.h>
#include <AzToolsFramework/AssetBrowser/AssetSelectionModel.h>
MotionPropertyCtrl::MotionPropertyCtrl(QWidget *pParent)
: QWidget(pParent)
{
m_motionLabel = new QLabel;
m_pBrowseButton = new QToolButton;
m_pBrowseButton->setIcon(QIcon(":/reflectedPropertyCtrl/img/file_browse.png"));
m_pApplyButton = new QToolButton;
m_pApplyButton->setIcon(QIcon(":/reflectedPropertyCtrl/img/apply.png"));
m_pApplyButton->setFocusPolicy(Qt::StrongFocus);
m_pBrowseButton->setFocusPolicy(Qt::StrongFocus);
QHBoxLayout *pLayout = new QHBoxLayout(this);
pLayout->setContentsMargins(0, 0, 0, 0);
pLayout->addWidget(m_motionLabel, 1);
pLayout->addWidget(m_pBrowseButton);
pLayout->addWidget(m_pApplyButton);
connect(m_pBrowseButton, &QAbstractButton::clicked, this, &MotionPropertyCtrl::OnBrowseClicked);
connect(m_pApplyButton, &QAbstractButton::clicked, this, &MotionPropertyCtrl::OnApplyClicked);
};
MotionPropertyCtrl::~MotionPropertyCtrl()
{
}
void MotionPropertyCtrl::SetValue(const CReflectedVarMotion &motion)
{
m_motion = motion;
SetLabelText(motion.m_motion);
}
CReflectedVarMotion MotionPropertyCtrl::value() const
{
return m_motion;
}
void MotionPropertyCtrl::OnBrowseClicked()
{
static AZ::Data::AssetType emotionFXMotionAssetType("{00494B8E-7578-4BA2-8B28-272E90680787}"); // from MotionAsset.h in EMotionFX Gem
// Request the AssetBrowser Dialog and set a type filter
AssetSelectionModel selection = AssetSelectionModel::AssetTypeSelection(emotionFXMotionAssetType);
selection.SetSelectedAssetId(m_motion.m_assetId);
AzToolsFramework::EditorRequests::Bus::Broadcast(&AzToolsFramework::EditorRequests::BrowseForAssets, selection);
if (selection.IsValid())
{
auto product = azrtti_cast<const ProductAssetBrowserEntry*>(selection.GetResult());
if (product != nullptr)
{
m_motion.m_motion = product->GetRelativePath();
m_motion.m_assetId = product->GetAssetId();
SetLabelText(m_motion.m_motion);
emit ValueChanged(m_motion);
}
}
}
// TODO: Might be able to delete this function
void MotionPropertyCtrl::OnApplyClicked()
{
#if 0
CUIEnumerations &roGeneralProxy = CUIEnumerations::GetUIEnumerationsInstance();
QStringList cSelectedMotions;
size_t nTotalMotions(0);
size_t nCurrentMotion(0);
QString combinedString = GetIEditor()->GetResourceSelectorHost()->GetGlobalSelection("motion");
SplitString(combinedString, cSelectedMotions, ',');
nTotalMotions = cSelectedMotions.size();
for (nCurrentMotion = 0; nCurrentMotion < nTotalMotions; ++nCurrentMotion)
{
QString& rstrCurrentAnimAction = cSelectedMotions[nCurrentMotion];
if (!rstrCurrentAnimAction.isEmpty())
{
m_motion.m_motion = rstrCurrentAnimAction.toLatin1().data();
SetLabelText(m_motion.m_motion);
emit ValueChanged(m_motion);
}
}
#endif
}
QWidget* MotionPropertyCtrl::GetFirstInTabOrder()
{
return m_pBrowseButton;
}
QWidget* MotionPropertyCtrl::GetLastInTabOrder()
{
return m_pApplyButton;
}
void MotionPropertyCtrl::UpdateTabOrder()
{
setTabOrder(m_pBrowseButton, m_pApplyButton);
}
void MotionPropertyCtrl::SetLabelText(const AZStd::string& motion)
{
if (!motion.empty())
{
AZStd::string filename;
if (AzFramework::StringFunc::Path::GetFileName(motion.c_str(), filename))
{
m_motionLabel->setText(filename.c_str());
}
else
{
m_motionLabel->setText(motion.c_str());
}
}
else
{
m_motionLabel->setText("");
}
}
QWidget* MotionPropertyWidgetHandler::CreateGUI(QWidget *pParent)
QWidget* MotionPropertyWidgetHandler::CreateGUI(QWidget* pParent)
{
MotionPropertyCtrl* newCtrl = aznew MotionPropertyCtrl(pParent);
connect(newCtrl, &MotionPropertyCtrl::ValueChanged, newCtrl, [newCtrl]()
{
EBUS_EVENT(AzToolsFramework::PropertyEditorGUIMessages::Bus, RequestWrite, newCtrl);
});
AzToolsFramework::PropertyAssetCtrl* newCtrl = aznew AzToolsFramework::PropertyAssetCtrl(pParent);
connect(
newCtrl, &AzToolsFramework::PropertyAssetCtrl::OnAssetIDChanged, this, [newCtrl]([[maybe_unused]] AZ::Data::AssetId newAssetId) {
EBUS_EVENT(AzToolsFramework::PropertyEditorGUIMessages::Bus, RequestWrite, newCtrl);
AzToolsFramework::PropertyEditorGUIMessages::Bus::Broadcast(
&AzToolsFramework::PropertyEditorGUIMessages::Bus::Handler::OnEditingFinished, newCtrl);
});
return newCtrl;
}
void MotionPropertyWidgetHandler::ConsumeAttribute(MotionPropertyCtrl* GUI, AZ::u32 attrib, AzToolsFramework::PropertyAttributeReader* attrValue, const char* debugName)
void MotionPropertyWidgetHandler::ConsumeAttribute(
[[maybe_unused]] AzToolsFramework::PropertyAssetCtrl* GUI, [[maybe_unused]] AZ::u32 attrib,
[[maybe_unused]] AzToolsFramework::PropertyAttributeReader* attrValue, [[maybe_unused]] const char* debugName)
{
Q_UNUSED(GUI);
Q_UNUSED(attrib);
Q_UNUSED(attrValue);
Q_UNUSED(debugName);
}
void MotionPropertyWidgetHandler::WriteGUIValuesIntoProperty(size_t index, MotionPropertyCtrl* GUI, property_t& instance, AzToolsFramework::InstanceDataNode* node)
void MotionPropertyWidgetHandler::WriteGUIValuesIntoProperty(
[[maybe_unused]] size_t index, [[maybe_unused]] AzToolsFramework::PropertyAssetCtrl* GUI, property_t& instance,
[[maybe_unused]] AzToolsFramework::InstanceDataNode* node)
{
Q_UNUSED(index);
Q_UNUSED(node);
CReflectedVarMotion val = GUI->value();
CReflectedVarMotion val;
val.m_motion = GUI->GetCurrentAssetHint();
val.m_assetId = GUI->GetSelectedAssetID();
instance = static_cast<property_t>(val);
}
bool MotionPropertyWidgetHandler::ReadValuesIntoGUI(size_t index, MotionPropertyCtrl* GUI, const property_t& instance, AzToolsFramework::InstanceDataNode* node)
bool MotionPropertyWidgetHandler::ReadValuesIntoGUI(
[[maybe_unused]] size_t index, [[maybe_unused]] AzToolsFramework::PropertyAssetCtrl* GUI, const property_t& instance,
[[maybe_unused]] AzToolsFramework::InstanceDataNode* node)
{
Q_UNUSED(index);
Q_UNUSED(node);
CReflectedVarMotion val = instance;
GUI->SetValue(val);
static const AZ::Data::AssetType emotionFXMotionAssetType(
"{00494B8E-7578-4BA2-8B28-272E90680787}"); // from MotionAsset.h in EMotionFX Gem
GUI->blockSignals(true);
GUI->SetSelectedAssetID(instance.m_assetId);
GUI->SetCurrentAssetType(emotionFXMotionAssetType);
GUI->blockSignals(false);
return false;
}
#include <Controls/ReflectedPropertyControl/moc_PropertyMotionCtrl.cpp>

@ -1,92 +1,67 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#ifndef CRYINCLUDE_EDITOR_UTILS_PROPERTYMOTIONCTRL_H
#define CRYINCLUDE_EDITOR_UTILS_PROPERTYMOTIONCTRL_H
#pragma once
#if !defined(Q_MOC_RUN)
#include <AzCore/base.h>
#include <AzCore/Memory/SystemAllocator.h>
#include "ReflectedVar.h"
#include <QWidget>
#include <QPointer>
#include <AzCore/Memory/SystemAllocator.h>
#include <AzCore/base.h>
#include <AzToolsFramework/UI/PropertyEditor/PropertyAssetCtrl.hxx>
#include <AzToolsFramework/UI/PropertyEditor/PropertyEditorAPI.h>
#include <QPointer>
#include <QWidget>
#endif
class QToolButton;
class QLabel;
class QHBoxLayout;
namespace AzToolsFramework
{
class PropertyAssetCtrl;
}
class MotionPropertyCtrl
: public QWidget
class MotionPropertyWidgetHandler : QObject,
public AzToolsFramework::PropertyHandler<CReflectedVarMotion, AzToolsFramework::PropertyAssetCtrl>
{
Q_OBJECT
public:
AZ_CLASS_ALLOCATOR(MotionPropertyCtrl, AZ::SystemAllocator, 0);
MotionPropertyCtrl(QWidget* pParent = nullptr);
virtual ~MotionPropertyCtrl();
CReflectedVarMotion value() const;
QWidget* GetFirstInTabOrder();
QWidget* GetLastInTabOrder();
void UpdateTabOrder();
signals:
void ValueChanged(CReflectedVarMotion value);
public:
AZ_CLASS_ALLOCATOR(MotionPropertyWidgetHandler, AZ::SystemAllocator, 0);
public slots:
void SetValue(const CReflectedVarMotion& motion);
virtual AZ::u32 GetHandlerName(void) const override
{
return AZ_CRC("Motion", 0xf5fea1e8);
}
protected slots:
void OnBrowseClicked();
void OnApplyClicked();
virtual bool IsDefaultHandler() const override
{
return true;
}
private:
void SetLabelText(const AZStd::string& motion);
virtual QWidget* GetFirstInTabOrder(AzToolsFramework::PropertyAssetCtrl* widget) override
{
return widget->GetFirstInTabOrder();
}
QToolButton* m_pBrowseButton;
QToolButton* m_pApplyButton;
QLabel* m_motionLabel;
virtual QWidget* GetLastInTabOrder(AzToolsFramework::PropertyAssetCtrl* widget) override
{
return widget->GetLastInTabOrder();
}
CReflectedVarMotion m_motion;
};
class MotionPropertyWidgetHandler
: QObject
, public AzToolsFramework::PropertyHandler < CReflectedVarMotion, MotionPropertyCtrl >
{
public:
AZ_CLASS_ALLOCATOR(MotionPropertyWidgetHandler, AZ::SystemAllocator, 0);
virtual AZ::u32 GetHandlerName(void) const override { return AZ_CRC("Motion", 0xf5fea1e8); }
virtual bool IsDefaultHandler() const override { return true; }
virtual QWidget* GetFirstInTabOrder(MotionPropertyCtrl* widget) override { return widget->GetFirstInTabOrder(); }
virtual QWidget* GetLastInTabOrder(MotionPropertyCtrl* widget) override { return widget->GetLastInTabOrder(); }
virtual void UpdateWidgetInternalTabbing(MotionPropertyCtrl* widget) override { widget->UpdateTabOrder(); }
virtual void UpdateWidgetInternalTabbing(AzToolsFramework::PropertyAssetCtrl* widget) override
{
widget->UpdateTabOrder();
}
virtual QWidget* CreateGUI(QWidget* pParent) override;
virtual void ConsumeAttribute(MotionPropertyCtrl* GUI, AZ::u32 attrib, AzToolsFramework::PropertyAttributeReader* attrValue, const char* debugName) override;
virtual void WriteGUIValuesIntoProperty(size_t index, MotionPropertyCtrl* GUI, property_t& instance, AzToolsFramework::InstanceDataNode* node) override;
virtual bool ReadValuesIntoGUI(size_t index, MotionPropertyCtrl* GUI, const property_t& instance, AzToolsFramework::InstanceDataNode* node) override;
virtual void ConsumeAttribute(
AzToolsFramework::PropertyAssetCtrl* GUI, AZ::u32 attrib, AzToolsFramework::PropertyAttributeReader* attrValue,
const char* debugName) override;
virtual void WriteGUIValuesIntoProperty(
size_t index, AzToolsFramework::PropertyAssetCtrl* GUI, property_t& instance, AzToolsFramework::InstanceDataNode* node) override;
virtual bool ReadValuesIntoGUI(
size_t index, AzToolsFramework::PropertyAssetCtrl* GUI, const property_t& instance,
AzToolsFramework::InstanceDataNode* node) override;
};
#endif // CRYINCLUDE_EDITOR_UTILS_PROPERTYMOTIONCTRL_H

@ -5232,6 +5232,13 @@ extern "C" int AZ_DLL_EXPORT CryEditMain(int argc, char* argv[])
AzQtComponents::Utilities::HandleDpiAwareness(AzQtComponents::Utilities::SystemDpiAware);
Editor::EditorQtApplication app(argc, argv);
if (app.arguments().contains("-autotest_mode"))
{
// Nullroute all stdout to null for automated tests, this way we make sure
// that the test result output is not polluted with unrelated output data.
theApp->RedirectStdoutToNull();
}
// Hook the trace bus to catch errors, boot the AZ app after the QApplication is up
int ret = 0;
@ -5249,13 +5256,6 @@ extern "C" int AZ_DLL_EXPORT CryEditMain(int argc, char* argv[])
return -1;
}
if (app.arguments().contains("-autotest_mode"))
{
// Nullroute all stdout to null for automated tests, this way we make sure
// that the test result output is not polluted with unrelated output data.
theApp->RedirectStdoutToNull();
}
AzToolsFramework::EditorEvents::Bus::Broadcast(&AzToolsFramework::EditorEvents::NotifyQtApplicationAvailable, &app);
#if defined(AZ_PLATFORM_MAC)

@ -232,7 +232,6 @@ int EditorViewportWidget::OnCreate()
{
m_renderer = GetIEditor()->GetRenderer();
m_engine = GetIEditor()->Get3DEngine();
assert(m_engine);
CreateRenderContext();
@ -793,8 +792,14 @@ void EditorViewportWidget::OnRender()
// 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);
GetIEditor()->GetRenderer()->SetCamera(gEnv->pSystem->GetViewCamera());
m_engine->RenderWorld(0, SRenderingPassInfo::CreateGeneralPassRenderingInfo(m_Camera), __FUNCTION__);
if (GetIEditor()->GetRenderer())
{
GetIEditor()->GetRenderer()->SetCamera(gEnv->pSystem->GetViewCamera());
}
if (m_engine)
{
m_engine->RenderWorld(0, SRenderingPassInfo::CreateGeneralPassRenderingInfo(m_Camera), __FUNCTION__);
}
return;
}
@ -886,8 +891,7 @@ void EditorViewportWidget::OnBeginPrepareRender()
fov = 2 * atanf((h * tan(fov / 2)) / maxTargetHeight);
}
}
m_Camera.SetFrustum(w, h, fov, fNearZ, gEnv->p3DEngine->GetMaxViewDistance());
m_Camera.SetFrustum(w, h, fov, fNearZ);
}
GetIEditor()->GetSystem()->SetViewCamera(m_Camera);
@ -2424,7 +2428,10 @@ void EditorViewportWidget::SetDefaultCamera()
return;
}
ResetToViewSourceType(ViewSourceType::None);
gEnv->p3DEngine->GetPostEffectBaseGroup()->SetParam("Dof_Active", 0.0f);
if (gEnv->p3DEngine)
{
gEnv->p3DEngine->GetPostEffectBaseGroup()->SetParam("Dof_Active", 0.0f);
}
GetViewManager()->SetCameraObjectId(m_cameraObjectId);
SetName(m_defaultViewName);
SetViewTM(m_defaultViewTM);
@ -2607,8 +2614,7 @@ bool EditorViewportWidget::GetActiveCameraPosition(AZ::Vector3& cameraPos)
{
if (GetIEditor()->IsInGameMode())
{
const Vec3 camPos = m_engine->GetRenderingCamera().GetPosition();
cameraPos = LYVec3ToAZVec3(camPos);
cameraPos = m_renderViewport->GetViewportContext()->GetCameraTransform().GetTranslation();
}
else
{

@ -139,7 +139,10 @@ bool CGameExporter::Export(unsigned int flags, [[maybe_unused]] EEndian eExportE
// Make sure we unload any unused CGFs before exporting so that they don't end up in
// the level data.
pEditor->Get3DEngine()->FreeUnusedCGFResources();
if (pEditor->Get3DEngine())
{
pEditor->Get3DEngine()->FreeUnusedCGFResources();
}
CCryEditDoc* pDocument = pEditor->GetDocument();
@ -282,7 +285,7 @@ void CGameExporter::ExportVisAreas(const char* pszGamePath, EEndian eExportEndia
SHotUpdateInfo exportInfo;
I3DEngine* p3DEngine = pEditor->Get3DEngine();
if (eExportEndian == GetPlatformEndian()) // skip second export, this data is common for PC and consoles
if (p3DEngine && (eExportEndian == GetPlatformEndian())) // skip second export, this data is common for PC and consoles
{
std::vector<struct IStatObj*>* pTempBrushTable = NULL;
std::vector<_smart_ptr<IMaterial>>* pTempMatsTable = NULL;
@ -367,25 +370,28 @@ void CGameExporter::ExportLevelData(const QString& path, bool bExportMission)
QString missionFileName;
QString currentMissionFileName;
I3DEngine* p3DEngine = pEditor->Get3DEngine();
for (int i = 0; i < pDocument->GetMissionCount(); i++)
if (p3DEngine)
{
CMission* pMission = pDocument->GetMission(i);
for (int i = 0; i < pDocument->GetMissionCount(); i++)
{
CMission* pMission = pDocument->GetMission(i);
QString name = pMission->GetName();
name.replace(' ', '_');
missionFileName = QStringLiteral("Mission_%1.xml").arg(name);
QString name = pMission->GetName();
name.replace(' ', '_');
missionFileName = QStringLiteral("Mission_%1.xml").arg(name);
XmlNodeRef missionDescNode = missionsNode->newChild("Mission");
missionDescNode->setAttr("Name", pMission->GetName().toUtf8().data());
missionDescNode->setAttr("File", missionFileName.toUtf8().data());
missionDescNode->setAttr("CGFCount", p3DEngine->GetLoadedObjectCount());
XmlNodeRef missionDescNode = missionsNode->newChild("Mission");
missionDescNode->setAttr("Name", pMission->GetName().toUtf8().data());
missionDescNode->setAttr("File", missionFileName.toUtf8().data());
missionDescNode->setAttr("CGFCount", p3DEngine->GetLoadedObjectCount());
int nProgressBarRange = m_numExportedMaterials / 10 + p3DEngine->GetLoadedObjectCount();
missionDescNode->setAttr("ProgressBarRange", nProgressBarRange);
int nProgressBarRange = m_numExportedMaterials / 10 + p3DEngine->GetLoadedObjectCount();
missionDescNode->setAttr("ProgressBarRange", nProgressBarRange);
if (pMission == pCurrentMission)
{
currentMissionFileName = missionFileName;
if (pMission == pCurrentMission)
{
currentMissionFileName = missionFileName;
}
}
}
@ -413,7 +419,10 @@ void CGameExporter::ExportLevelData(const QString& path, bool bExportMission)
XmlNodeRef missionNode = rootAction->createNode("Mission");
pCurrentMission->Export(missionNode, objectsNode);
missionNode->setAttr("CGFCount", p3DEngine->GetLoadedObjectCount());
if (p3DEngine)
{
missionNode->setAttr("CGFCount", p3DEngine->GetLoadedObjectCount());
}
//if (!CFileUtil::OverwriteFile( path+currentMissionFileName ))
// return;
@ -483,6 +492,11 @@ void CGameExporter::ExportLevelInfo(const QString& path)
//////////////////////////////////////////////////////////////////////////
void CGameExporter::ExportMapInfo(XmlNodeRef& node)
{
if (!GetIEditor()->Get3DEngine())
{
return;
}
XmlNodeRef info = node->newChild("LevelInfo");
IEditor* pEditor = GetIEditor();

@ -22,7 +22,6 @@
#include "Include/ITransformManipulator.h"
#include "ActionManager.h"
#include "Settings.h"
#include "Objects/SelectionGroup.h"
#include "Include/IObjectManager.h"
#include "MathConversion.h"
@ -191,10 +190,12 @@ void CInfoBar::IdleUpdate()
Vec3 marker = GetIEditor()->GetMarkerPosition();
CSelectionGroup* selection = GetIEditor()->GetSelection();
if (selection->GetCount() != m_numSelected)
int selectedEntitiesCount = 0;
AzToolsFramework::ToolsApplicationRequestBus::BroadcastResult(
selectedEntitiesCount, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntitiesCount);
if (selectedEntitiesCount != m_numSelected)
{
m_numSelected = selection->GetCount();
m_numSelected = selectedEntitiesCount;
updateUI = true;
}

@ -525,6 +525,11 @@ void CMaterialManager::OnEditorNotifyEvent(EEditorNotifyEvent event)
//////////////////////////////////////////////////////////////////////////
void CMaterialManager::ReloadDirtyMaterials()
{
if (!GetIEditor()->Get3DEngine())
{
return;
}
IMaterialManager* runtimeMaterialManager = GetIEditor()->Get3DEngine()->GetMaterialManager();
uint32 mtlCount = 0;
@ -550,7 +555,6 @@ void CMaterialManager::ReloadDirtyMaterials()
}
}
}
}
//////////////////////////////////////////////////////////////////////////
@ -744,12 +748,15 @@ int CMaterialManager::GetHighlightFlags(CMaterial* pMaterial) const
result |= eHighlight_NoSurfaceType;
}
if (ISurfaceTypeManager* pSurfaceManager = GetIEditor()->Get3DEngine()->GetMaterialManager()->GetSurfaceTypeManager())
if (GetIEditor()->Get3DEngine())
{
const ISurfaceType* pSurfaceType = pSurfaceManager->GetSurfaceTypeByName(surfaceTypeName.toUtf8().data());
if (pSurfaceType && pSurfaceType->GetBreakability() != 0)
if (ISurfaceTypeManager* pSurfaceManager = GetIEditor()->Get3DEngine()->GetMaterialManager()->GetSurfaceTypeManager())
{
result |= eHighlight_Breakable;
const ISurfaceType* pSurfaceType = pSurfaceManager->GetSurfaceTypeByName(surfaceTypeName.toUtf8().data());
if (pSurfaceType && pSurfaceType->GetBreakability() != 0)
{
result |= eHighlight_Breakable;
}
}
}

@ -212,8 +212,11 @@ void CMission::SyncContent(bool bRetrieve, bool bIgnoreObjects, [[maybe_unused]]
else
{
// Save time of day.
m_timeOfDay = XmlHelpers::CreateXmlNode("TimeOfDay");
GetIEditor()->Get3DEngine()->GetTimeOfDay()->Serialize(m_timeOfDay, false);
if (GetIEditor()->Get3DEngine())
{
m_timeOfDay = XmlHelpers::CreateXmlNode("TimeOfDay");
GetIEditor()->Get3DEngine()->GetTimeOfDay()->Serialize(m_timeOfDay, false);
}
if (!bIgnoreObjects)
{

@ -11,5 +11,5 @@
set(LY_BUILD_DEPENDENCIES
PRIVATE
Legacy::CryRenderD3D11
)
Legacy::CryRenderNULL
)

@ -138,6 +138,7 @@ bool CLevelShaderCache::SaveBuffer(QString& textBuffer)
void CLevelShaderCache::Update()
{
IRenderer* pRenderer = gEnv->pRenderer;
if (pRenderer)
{
QString buf;
char* str = NULL;

@ -1,2 +0,0 @@
#Ignore these directories
SDKs

@ -1,22 +0,0 @@
Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd
and Clark Cooper
Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Expat maintainers.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

@ -1 +0,0 @@
MotionBuilder support was removed in CL 88235, please back it out if this decision is reversed. This was for bug LMBR-9220

@ -97,6 +97,9 @@ namespace AZ
};
} // DataTypes
} // SceneAPI
AZ_TYPE_INFO_SPECIALIZE(SceneAPI::DataTypes::Color, "{937E3BF8-5204-4D40-A8DA-C8F083C89F9F}");
} // AZ
namespace AZStd

@ -11,6 +11,8 @@
*/
#include <SceneAPI/SceneData/GraphData/AnimationData.h>
#include <AzCore/Serialization/SerializeContext.h>
#include <AzCore/RTTI/BehaviorContext.h>
namespace AZ
{
@ -18,6 +20,31 @@ namespace AZ
{
namespace GraphData
{
void AnimationData::Reflect(ReflectContext* context)
{
SerializeContext* serializeContext = azrtti_cast<SerializeContext*>(context);
if (serializeContext)
{
serializeContext->Class<AnimationData, SceneAPI::DataTypes::IAnimationData>()
->Version(1);
}
BehaviorContext* behaviorContext = azrtti_cast<BehaviorContext*>(context);
if (behaviorContext)
{
behaviorContext->Class<SceneAPI::DataTypes::IAnimationData>()
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common)
->Attribute(AZ::Script::Attributes::Module, "scene")
->Method("GetKeyFrameCount", &SceneAPI::DataTypes::IAnimationData::GetKeyFrameCount)
->Method("GetKeyFrame", &SceneAPI::DataTypes::IAnimationData::GetKeyFrame)
->Method("GetTimeStepBetweenFrames", &SceneAPI::DataTypes::IAnimationData::GetTimeStepBetweenFrames);
behaviorContext->Class<AnimationData>()
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common)
->Attribute(AZ::Script::Attributes::Module, "scene");
}
}
AnimationData::AnimationData()
: m_timeStepBetweenFrames(1.0/30.0) // default value
{
@ -61,6 +88,32 @@ namespace AZ
}
void BlendShapeAnimationData::Reflect(ReflectContext* context)
{
SerializeContext* serializeContext = azrtti_cast<SerializeContext*>(context);
if (serializeContext)
{
serializeContext->Class<BlendShapeAnimationData, SceneAPI::DataTypes::IBlendShapeAnimationData>()
->Version(1);
}
BehaviorContext* behaviorContext = azrtti_cast<BehaviorContext*>(context);
if (behaviorContext)
{
behaviorContext->Class<SceneAPI::DataTypes::IBlendShapeAnimationData>()
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common)
->Attribute(AZ::Script::Attributes::Module, "scene")
->Method("GetBlendShapeName", &SceneAPI::DataTypes::IBlendShapeAnimationData::GetBlendShapeName)
->Method("GetKeyFrameCount", &SceneAPI::DataTypes::IBlendShapeAnimationData::GetKeyFrameCount)
->Method("GetKeyFrame", &SceneAPI::DataTypes::IBlendShapeAnimationData::GetKeyFrame)
->Method("GetTimeStepBetweenFrames", &SceneAPI::DataTypes::IBlendShapeAnimationData::GetTimeStepBetweenFrames);
behaviorContext->Class<BlendShapeAnimationData>()
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common)
->Attribute(AZ::Script::Attributes::Module, "scene");
}
}
BlendShapeAnimationData::BlendShapeAnimationData()
: m_timeStepBetweenFrames(1 / 30.0) // default value
{

@ -30,6 +30,8 @@ namespace AZ
public:
AZ_RTTI(AnimationData, "{D350732E-4727-41C8-95E0-FBAF5F2AC074}", SceneAPI::DataTypes::IAnimationData);
static void Reflect(ReflectContext* context);
SCENE_DATA_API AnimationData();
SCENE_DATA_API ~AnimationData() override = default;
SCENE_DATA_API virtual void AddKeyFrame(const SceneAPI::DataTypes::MatrixType& keyFrameTransform);
@ -53,6 +55,8 @@ namespace AZ
public:
AZ_RTTI(BlendShapeAnimationData, "{02766CCF-BDA7-46B6-9BB1-58A90C1AD6AA}", SceneAPI::DataTypes::IBlendShapeAnimationData);
static void Reflect(ReflectContext* context);
SCENE_DATA_API BlendShapeAnimationData();
SCENE_DATA_API ~BlendShapeAnimationData() override = default;
SCENE_DATA_API void CloneAttributesFrom(const IGraphObject* sourceObject) override;

@ -12,9 +12,13 @@
#include <AzCore/Casting/numeric_cast.h>
#include <SceneAPI/SceneData/GraphData/BlendShapeData.h>
#include <AzCore/Serialization/SerializeContext.h>
#include <AzCore/RTTI/BehaviorContext.h>
namespace AZ
{
AZ_TYPE_INFO_SPECIALIZE(SceneAPI::DataTypes::IBlendShapeData::Face, "{C972EC9A-3A5C-47CD-9A92-ECB4C0C0451C}");
namespace SceneData
{
namespace GraphData
@ -23,6 +27,82 @@ namespace AZ
BlendShapeData::~BlendShapeData() = default;
void BlendShapeData::Reflect(ReflectContext* context)
{
SerializeContext* serializeContext = azrtti_cast<SerializeContext*>(context);
if (serializeContext)
{
serializeContext->Class<BlendShapeData, SceneAPI::DataTypes::IBlendShapeData>()
->Version(1);
}
BehaviorContext* behaviorContext = azrtti_cast<BehaviorContext*>(context);
if (behaviorContext)
{
behaviorContext->Class<SceneAPI::DataTypes::IBlendShapeData>()
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common)
->Attribute(AZ::Script::Attributes::Module, "scene")
->Method("GetUsedControlPointCount", &SceneAPI::DataTypes::IBlendShapeData::GetUsedControlPointCount)
->Method("GetControlPointIndex", &SceneAPI::DataTypes::IBlendShapeData::GetControlPointIndex)
->Method("GetUsedPointIndexForControlPoint", &SceneAPI::DataTypes::IBlendShapeData::GetUsedPointIndexForControlPoint)
->Method("GetVertexCount", &SceneAPI::DataTypes::IBlendShapeData::GetVertexCount)
->Method("GetFaceCount", &SceneAPI::DataTypes::IBlendShapeData::GetFaceCount)
->Method("GetFaceInfo", &SceneAPI::DataTypes::IBlendShapeData::GetFaceInfo)
->Method("GetPosition", &SceneAPI::DataTypes::IBlendShapeData::GetPosition)
->Method("GetNormal", &SceneAPI::DataTypes::IBlendShapeData::GetNormal)
->Method("GetFaceVertexIndex", &SceneAPI::DataTypes::IBlendShapeData::GetFaceVertexIndex);
behaviorContext->Class<SceneAPI::DataTypes::IBlendShapeData::Face>("BlendShapeDataFace")
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common)
->Attribute(AZ::Script::Attributes::Module, "scene")
->Method("GetVertexIndex", [](const SceneAPI::DataTypes::IBlendShapeData::Face& self, int index)
{
if (index >= 0 && index < 3)
{
return self.vertexIndex[index];
}
return aznumeric_cast<unsigned int>(0);
});
behaviorContext->Class<BlendShapeData>()
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common)
->Attribute(AZ::Script::Attributes::Module, "scene")
->Method("GetUV", &BlendShapeData::GetUV)
->Method("GetTangent", [](const BlendShapeData& self, size_t index)
{
if (index < self.GetTangents().size())
{
return self.GetTangents().at(index);
}
AZ_Error("SceneGraphData", false, "Cannot get to tangent at index(%zu)", index);
return Vector4::CreateZero();
})
->Method("GetBitangent", [](const BlendShapeData& self, size_t index)
{
if (index < self.GetBitangents().size())
{
return self.GetBitangents().at(index);
}
AZ_Error("SceneGraphData", false, "Cannot get to bitangents at index(%zu)", index);
return Vector3::CreateZero();
})
->Method("GetColor", [](const BlendShapeData& self, AZ::u8 colorSetIndex, AZ::u8 colorIndex)
{
SceneAPI::DataTypes::Color color(0,0,0,0);
if (colorSetIndex < MaxNumColorSets)
{
const AZStd::vector<SceneAPI::DataTypes::Color>& colorChannel = self.GetColors(colorSetIndex);
if (colorIndex < colorChannel.size())
{
return colorChannel[colorIndex];
}
}
AZ_Error("SceneGraphData", false, "Cannot get to color setIndex(%d) at colorIndex(%d)", colorSetIndex, colorIndex);
return color;
});
}
}
void BlendShapeData::AddPosition(const Vector3& position)
{
m_positions.push_back(position);

@ -31,6 +31,8 @@ namespace AZ
public:
AZ_RTTI(BlendShapeData, "{FF875C22-2E4F-4CE3-BA49-09BF78C70A09}", SceneAPI::DataTypes::IBlendShapeData)
SCENE_DATA_API static void Reflect(ReflectContext* context);
// Maximum number of color sets matches limitation set in assImp (AI_MAX_NUMBER_OF_COLOR_SETS)
static constexpr AZ::u8 MaxNumColorSets = 8;
// Maximum number of uv sets matches limitation set in assImp (AI_MAX_NUMBER_OF_TEXTURECOORDS)

@ -16,8 +16,6 @@
namespace AZ
{
AZ_TYPE_INFO_SPECIALIZE(SceneAPI::DataTypes::Color, "{937E3BF8-5204-4D40-A8DA-C8F083C89F9F}");
namespace SceneData
{
namespace GraphData
@ -40,7 +38,7 @@ namespace AZ
->Method("GetCount", &MeshVertexColorData::GetCount )
->Method("GetColor", &MeshVertexColorData::GetColor);
behaviorContext->Class<AZ::SceneAPI::DataTypes::Color>("MeshVertexColor")
behaviorContext->Class<AZ::SceneAPI::DataTypes::Color>("VertexColor")
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common)
->Attribute(AZ::Script::Attributes::Module, "scene")
->Property("red", BehaviorValueGetter(&AZ::SceneAPI::DataTypes::Color::red), nullptr)

@ -81,8 +81,9 @@ namespace AZ
SceneData::SceneNodeSelectionList::Reflect(context);
// Graph objects
context->Class<AZ::SceneData::GraphData::AnimationData>()->Version(1);
context->Class<AZ::SceneData::GraphData::BlendShapeData>()->Version(1);
AZ::SceneData::GraphData::AnimationData::Reflect(context);
AZ::SceneData::GraphData::BlendShapeAnimationData::Reflect(context);
AZ::SceneData::GraphData::BlendShapeData::Reflect(context);
AZ::SceneData::GraphData::BoneData::Reflect(context);
AZ::SceneData::GraphData::MaterialData::Reflect(context);
AZ::SceneData::GraphData::MeshData::Reflect(context);
@ -107,6 +108,9 @@ namespace AZ
AZ::SceneData::GraphData::MeshVertexUVData::Reflect(context);
AZ::SceneData::GraphData::MeshVertexTangentData::Reflect(context);
AZ::SceneData::GraphData::MeshVertexBitangentData::Reflect(context);
AZ::SceneData::GraphData::AnimationData::Reflect(context);
AZ::SceneData::GraphData::BlendShapeAnimationData::Reflect(context);
AZ::SceneData::GraphData::BlendShapeData::Reflect(context);
}
} // namespace SceneAPI
} // namespace AZ

@ -29,6 +29,8 @@
#include <SceneAPI/SceneData/GraphData/MeshVertexColorData.h>
#include <SceneAPI/SceneData/GraphData/MeshVertexTangentData.h>
#include <SceneAPI/SceneData/GraphData/MeshVertexUVData.h>
#include <SceneAPI/SceneData/GraphData/AnimationData.h>
#include <SceneAPI/SceneData/GraphData/BlendShapeData.h>
namespace AZ
{
@ -101,6 +103,53 @@ namespace AZ
tangentData->SetTangentSetIndex(2);
return true;
}
else if (data.get_type_info().m_id == azrtti_typeid<AZ::SceneData::GraphData::AnimationData>())
{
auto* animationData = AZStd::any_cast<AZ::SceneData::GraphData::AnimationData>(&data);
animationData->ReserveKeyFrames(3);
animationData->AddKeyFrame(DataTypes::MatrixType::CreateFromValue(1.0));
animationData->AddKeyFrame(DataTypes::MatrixType::CreateFromValue(2.0));
animationData->AddKeyFrame(DataTypes::MatrixType::CreateFromValue(3.0));
animationData->SetTimeStepBetweenFrames(4.0);
return true;
}
else if (data.get_type_info().m_id == azrtti_typeid<AZ::SceneData::GraphData::BlendShapeAnimationData>())
{
auto* blendShapeAnimationData = AZStd::any_cast<AZ::SceneData::GraphData::BlendShapeAnimationData>(&data);
blendShapeAnimationData->SetBlendShapeName("mockBlendShapeName");
blendShapeAnimationData->ReserveKeyFrames(3);
blendShapeAnimationData->AddKeyFrame(1.0);
blendShapeAnimationData->AddKeyFrame(2.0);
blendShapeAnimationData->AddKeyFrame(3.0);
blendShapeAnimationData->SetTimeStepBetweenFrames(4.0);
return true;
}
else if (data.get_type_info().m_id == azrtti_typeid<AZ::SceneData::GraphData::BlendShapeData>())
{
auto* blendShapeData = AZStd::any_cast<AZ::SceneData::GraphData::BlendShapeData>(&data);
blendShapeData->AddPosition({ 1.0, 2.0, 3.0 });
blendShapeData->AddPosition({ 2.0, 3.0, 4.0 });
blendShapeData->AddPosition({ 3.0, 4.0, 5.0 });
blendShapeData->AddNormal({ 0.1, 0.2, 0.3 });
blendShapeData->AddNormal({ 0.2, 0.3, 0.4 });
blendShapeData->AddNormal({ 0.3, 0.4, 0.5 });
blendShapeData->AddTangentAndBitangent(Vector4{ 0.1f, 0.2f, 0.3f, 0.4f }, { 0.0, 0.1, 0.2 });
blendShapeData->AddTangentAndBitangent(Vector4{ 0.2f, 0.3f, 0.4f, 0.5f }, { 0.1, 0.2, 0.3 });
blendShapeData->AddTangentAndBitangent(Vector4{ 0.3f, 0.4f, 0.5f, 0.6f }, { 0.2, 0.3, 0.4 });
blendShapeData->AddUV(Vector2{ 0.9, 0.8 }, 0);
blendShapeData->AddUV(Vector2{ 0.7, 0.7 }, 1);
blendShapeData->AddUV(Vector2{ 0.6, 0.6 }, 2);
blendShapeData->AddColor(DataTypes::Color{ 0.1, 0.2, 0.3, 0.4 }, 0);
blendShapeData->AddColor(DataTypes::Color{ 0.2, 0.3, 0.4, 0.5 }, 1);
blendShapeData->AddColor(DataTypes::Color{ 0.3, 0.4, 0.5, 0.6 }, 2);
blendShapeData->AddFace({ 0, 1, 2 });
blendShapeData->AddFace({ 1, 2, 0 });
blendShapeData->AddFace({ 2, 0, 1 });
blendShapeData->SetVertexIndexToControlPointIndexMap(0, 1);
blendShapeData->SetVertexIndexToControlPointIndexMap(1, 2);
blendShapeData->SetVertexIndexToControlPointIndexMap(2, 0);
return true;
}
return false;
}
@ -296,6 +345,116 @@ namespace AZ
ExpectExecute("TestExpectIntegerEquals(meshVertexTangentData:GetTangentSetIndex(), 2)");
ExpectExecute("TestExpectTrue(meshVertexTangentData:GetTangentSpace(), MeshVertexTangentData.EMotionFX)");
}
TEST_F(GrapDatahBehaviorScriptTest, SceneGraph_AnimationData_AccessWorks)
{
ExpectExecute("animationData = AnimationData()");
ExpectExecute("TestExpectTrue(animationData ~= nil)");
ExpectExecute("MockGraphData.FillData(animationData)");
ExpectExecute("TestExpectIntegerEquals(animationData:GetKeyFrameCount(), 3)");
ExpectExecute("TestExpectFloatEquals(animationData:GetTimeStepBetweenFrames(), 4.0)");
ExpectExecute("TestExpectFloatEquals(animationData:GetKeyFrame(0).basisX.x, 1.0)");
ExpectExecute("TestExpectFloatEquals(animationData:GetKeyFrame(1).basisX.y, 2.0)");
ExpectExecute("TestExpectFloatEquals(animationData:GetKeyFrame(2).basisX.z, 3.0)");
}
TEST_F(GrapDatahBehaviorScriptTest, SceneGraph_BlendShapeAnimationData_AccessWorks)
{
ExpectExecute("blendShapeAnimationData = BlendShapeAnimationData()");
ExpectExecute("TestExpectTrue(blendShapeAnimationData ~= nil)");
ExpectExecute("MockGraphData.FillData(blendShapeAnimationData)");
ExpectExecute("TestExpectTrue(blendShapeAnimationData:GetBlendShapeName() == 'mockBlendShapeName')");
ExpectExecute("TestExpectIntegerEquals(blendShapeAnimationData:GetKeyFrameCount(), 3)");
ExpectExecute("TestExpectFloatEquals(blendShapeAnimationData:GetKeyFrame(0), 1.0)");
ExpectExecute("TestExpectFloatEquals(blendShapeAnimationData:GetKeyFrame(1), 2.0)");
ExpectExecute("TestExpectFloatEquals(blendShapeAnimationData:GetKeyFrame(2), 3.0)");
ExpectExecute("TestExpectFloatEquals(blendShapeAnimationData:GetTimeStepBetweenFrames(), 4.0)");
}
TEST_F(GrapDatahBehaviorScriptTest, SceneGraph_BlendShapeData_AccessWorks)
{
ExpectExecute("blendShapeData = BlendShapeData()");
ExpectExecute("TestExpectTrue(blendShapeData ~= nil)");
ExpectExecute("MockGraphData.FillData(blendShapeData)");
ExpectExecute("TestExpectIntegerEquals(blendShapeData:GetUsedControlPointCount(), 3)");
ExpectExecute("TestExpectIntegerEquals(blendShapeData:GetVertexCount(), 3)");
ExpectExecute("TestExpectIntegerEquals(blendShapeData:GetFaceCount(), 3)");
ExpectExecute("TestExpectIntegerEquals(blendShapeData:GetFaceVertexIndex(0, 2), 2)");
ExpectExecute("TestExpectIntegerEquals(blendShapeData:GetFaceVertexIndex(1, 0), 1)");
ExpectExecute("TestExpectIntegerEquals(blendShapeData:GetFaceVertexIndex(2, 1), 0)");
ExpectExecute("TestExpectIntegerEquals(blendShapeData:GetControlPointIndex(0), 1)");
ExpectExecute("TestExpectIntegerEquals(blendShapeData:GetControlPointIndex(1), 2)");
ExpectExecute("TestExpectIntegerEquals(blendShapeData:GetControlPointIndex(2), 0)");
ExpectExecute("TestExpectIntegerEquals(blendShapeData:GetUsedPointIndexForControlPoint(0), 2)");
ExpectExecute("TestExpectIntegerEquals(blendShapeData:GetUsedPointIndexForControlPoint(1), 0)");
ExpectExecute("TestExpectIntegerEquals(blendShapeData:GetUsedPointIndexForControlPoint(2), 1)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetPosition(0).x, 1.0)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetPosition(0).y, 2.0)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetPosition(0).z, 3.0)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetPosition(1).x, 2.0)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetPosition(1).y, 3.0)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetPosition(1).z, 4.0)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetPosition(2).x, 3.0)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetPosition(2).y, 4.0)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetPosition(2).z, 5.0)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetNormal(0).x, 0.1)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetNormal(0).y, 0.2)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetNormal(0).z, 0.3)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetNormal(1).x, 0.2)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetNormal(1).y, 0.3)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetNormal(1).z, 0.4)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetNormal(2).x, 0.3)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetNormal(2).y, 0.4)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetNormal(2).z, 0.5)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetFaceInfo(0):GetVertexIndex(0), 0)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetFaceInfo(0):GetVertexIndex(1), 1)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetFaceInfo(0):GetVertexIndex(2), 2)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetFaceInfo(1):GetVertexIndex(0), 1)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetFaceInfo(1):GetVertexIndex(1), 2)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetFaceInfo(1):GetVertexIndex(2), 0)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetFaceInfo(2):GetVertexIndex(0), 2)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetFaceInfo(2):GetVertexIndex(1), 0)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetFaceInfo(2):GetVertexIndex(2), 1)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetUV(0, 0).x, 0.9)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetUV(0, 0).y, 0.8)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetUV(0, 1).x, 0.7)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetUV(0, 1).y, 0.7)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetUV(0, 2).x, 0.6)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetUV(0, 2).y, 0.6)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetColor(0, 0).red, 0.1)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetColor(0, 0).green, 0.2)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetColor(0, 0).blue, 0.3)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetColor(0, 0).alpha, 0.4)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetColor(1, 0).red, 0.2)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetColor(1, 0).green, 0.3)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetColor(1, 0).blue, 0.4)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetColor(1, 0).alpha, 0.5)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetColor(2, 0).red, 0.3)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetColor(2, 0).green, 0.4)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetColor(2, 0).blue, 0.5)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetColor(2, 0).alpha, 0.6)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetTangent(0).x, 0.1)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetTangent(0).y, 0.2)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetTangent(0).z, 0.3)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetTangent(0).w, 0.4)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetTangent(1).x, 0.2)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetTangent(1).y, 0.3)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetTangent(1).z, 0.4)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetTangent(1).w, 0.5)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetTangent(2).x, 0.3)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetTangent(2).y, 0.4)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetTangent(2).z, 0.5)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetTangent(2).w, 0.6)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetBitangent(0).x, 0.0)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetBitangent(0).y, 0.1)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetBitangent(0).z, 0.2)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetBitangent(1).x, 0.1)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetBitangent(1).y, 0.2)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetBitangent(1).z, 0.3)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetBitangent(2).x, 0.2)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetBitangent(2).y, 0.3)");
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetBitangent(2).z, 0.4)");
}
}
}
}

@ -13,6 +13,7 @@
#pragma once
#include <Atom/Features/SrgSemantics.azsli>
#include <viewsrg.srgi>
#include <Atom/RPI/ShaderResourceGroups/DefaultDrawSrg.azsli>
#include "MaterialInputs/BaseColorInput.azsli"

@ -10,7 +10,6 @@
*
*/
#include <viewsrg.srgi>
#include <Atom/Features/PBR/AlphaUtils.azsli>
#include "./EnhancedPBR_Common.azsli"
#include <Atom/Features/PBR/DefaultObjectSrg.azsli>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save