diff --git a/Assets/Editor/Styles/Office2007.dll b/Assets/Editor/Styles/Office2007.dll deleted file mode 100644 index 3f986741cc..0000000000 --- a/Assets/Editor/Styles/Office2007.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d1c5941f584d35b3d21eb9c311b02698c30499895e9a8c827fb71168e2656255 -size 1436672 diff --git a/Assets/Editor/Styles/Office2007Black.dll b/Assets/Editor/Styles/Office2007Black.dll deleted file mode 100644 index 0a65e1d056..0000000000 --- a/Assets/Editor/Styles/Office2007Black.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5f480ade0a4190f7cb1d7cf286e970f958632d88e19b8c21ead11f838358a750 -size 369584 diff --git a/Assets/Editor/Styles/Office2007Silver.dll b/Assets/Editor/Styles/Office2007Silver.dll deleted file mode 100644 index bf24eda6a5..0000000000 --- a/Assets/Editor/Styles/Office2007Silver.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d5eba063346e9163f43bbfec7e71497c847645fb12a3ec573314c9f44afbc801 -size 364464 diff --git a/AutomatedTesting/Gem/Code/enabled_gems.cmake b/AutomatedTesting/Gem/Code/enabled_gems.cmake index 4ab914c118..b712fec7ab 100644 --- a/AutomatedTesting/Gem/Code/enabled_gems.cmake +++ b/AutomatedTesting/Gem/Code/enabled_gems.cmake @@ -49,14 +49,7 @@ set(ENABLED_GEMS HttpRequestor Atom_AtomBridge PythonCoverage + AWSCore + AWSClientAuth + AWSMetrics ) - -# TODO remove conditional add once AWSNativeSDK libs are fixed for Android and Linux Monolithic release. -set(aws_excluded_platforms Android) -if (NOT (LY_MONOLITHIC_GAME AND ${PAL_PLATFORM_NAME} IN_LIST aws_excluded_platforms)) - list(APPEND ENABLED_GEMS - AWSCore - AWSClientAuth - AWSMetrics - ) -endif() diff --git a/AutomatedTesting/Gem/PythonTests/NvCloth/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/NvCloth/CMakeLists.txt index 5b26424097..4c7e32b683 100644 --- a/AutomatedTesting/Gem/PythonTests/NvCloth/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonTests/NvCloth/CMakeLists.txt @@ -9,6 +9,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) ly_add_pytest( NAME AutomatedTesting::NvClothTests_Main TEST_SUITE main + TEST_REQUIRES gpu TEST_SERIAL PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Active.py TIMEOUT 1500 diff --git a/AutomatedTesting/Gem/PythonTests/NvCloth/TestSuite_Active.py b/AutomatedTesting/Gem/PythonTests/NvCloth/TestSuite_Active.py index ce3f04b8f1..60df2343ec 100755 --- a/AutomatedTesting/Gem/PythonTests/NvCloth/TestSuite_Active.py +++ b/AutomatedTesting/Gem/PythonTests/NvCloth/TestSuite_Active.py @@ -20,10 +20,13 @@ from base import TestAutomationBase @pytest.mark.parametrize("project", ["AutomatedTesting"]) class TestAutomation(TestAutomationBase): + use_null_renderer = False # Use default renderer (needs gpu) + extra_cmdline_args = [] + def test_C18977329_NvCloth_AddClothSimulationToMesh(self, request, workspace, editor, launcher_platform): from . import C18977329_NvCloth_AddClothSimulationToMesh as test_module - self._run_test(request, workspace, editor, test_module) + self._run_test(request, workspace, editor, test_module, self.extra_cmdline_args, self.use_null_renderer) def test_C18977330_NvCloth_AddClothSimulationToActor(self, request, workspace, editor, launcher_platform): from . import C18977330_NvCloth_AddClothSimulationToActor as test_module - self._run_test(request, workspace, editor, test_module) + self._run_test(request, workspace, editor, test_module, self.extra_cmdline_args, self.use_null_renderer) diff --git a/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/base.py b/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/base.py index 2e2f794e94..f0e1d237c3 100755 --- a/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/base.py +++ b/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/base.py @@ -51,7 +51,7 @@ class TestAutomationBase: cls._kill_ly_processes() - def _run_test(self, request, workspace, editor, testcase_module, extra_cmdline_args=[]): + def _run_test(self, request, workspace, editor, testcase_module, extra_cmdline_args=[], use_null_renderer=True): test_starttime = time.time() self.logger = logging.getLogger(__name__) errors = [] @@ -89,7 +89,10 @@ 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", "-rhi=null", f"-pythontestcase={request.node.originalname}"] + extra_cmdline_args + pycmd = ["--runpythontest", testcase_module_filepath, "-BatchMode", "-autotest_mode", f"-pythontestcase={request.node.originalname}"] + if use_null_renderer: + pycmd += ["-rhi=null"] + pycmd += extra_cmdline_args editor.args.extend(pycmd) # args are added to the WinLauncher start command editor.start(backupFiles = False, launch_ap = False) try: diff --git a/AutomatedTesting/Gem/PythonTests/scripting/FileMenu_Default_NewAndOpen.py b/AutomatedTesting/Gem/PythonTests/scripting/FileMenu_Default_NewAndOpen.py index b6ef00486b..129570f80d 100644 --- a/AutomatedTesting/Gem/PythonTests/scripting/FileMenu_Default_NewAndOpen.py +++ b/AutomatedTesting/Gem/PythonTests/scripting/FileMenu_Default_NewAndOpen.py @@ -58,8 +58,11 @@ class TestFileMenuDefaultNewOpen: sc_main = sc.findChild(QtWidgets.QMainWindow) sc_tabs = sc_main.findChild(QtWidgets.QTabWidget, "ScriptCanvasTabs") - # 3) Trigger File->New action + # wait for the intial tab count + general.idle_wait(GENERAL_WAIT) initial_tabs_count = sc_tabs.count() + + # 3) Trigger File->New action action = pyside_utils.find_child_by_pattern( sc_main, {"objectName": "action_New_Script", "type": QtWidgets.QAction} ) diff --git a/AutomatedTesting/Gem/PythonTests/smoke/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/smoke/CMakeLists.txt index 6e91ae4ea4..af9fc142e2 100644 --- a/AutomatedTesting/Gem/PythonTests/smoke/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonTests/smoke/CMakeLists.txt @@ -51,17 +51,4 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) AutomatedTesting.GameLauncher AutomatedTesting.Assets ) - - ly_add_pytest( - NAME AutomatedTesting::GameLauncherWithGPU - TEST_REQUIRES gpu - PATH ${CMAKE_CURRENT_LIST_DIR}/test_GameLauncher_EnterExitGameMode_Works.py - TIMEOUT 100 - RUNTIME_DEPENDENCIES - AZ::AssetProcessor - AZ::PythonBindingsExample - Legacy::Editor - AutomatedTesting.GameLauncher - AutomatedTesting.Assets - ) endif() diff --git a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/PasswordSignIn.scriptcanvas b/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/PasswordSignIn.scriptcanvas index ffc3064084..1a135f3e2c 100644 --- a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/PasswordSignIn.scriptcanvas +++ b/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/PasswordSignIn.scriptcanvas @@ -3,7 +3,7 @@ - + @@ -16,21 +16,21 @@ - + - + - + @@ -68,7 +68,7 @@ - + @@ -106,7 +106,7 @@ - + @@ -144,7 +144,7 @@ - + @@ -182,7 +182,7 @@ - + @@ -220,7 +220,7 @@ - + @@ -229,12 +229,55 @@ + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + @@ -258,7 +301,7 @@ - + @@ -268,7 +311,7 @@ - + @@ -296,7 +339,7 @@ - + @@ -306,10 +349,10 @@ - + - + @@ -334,7 +377,7 @@ - + @@ -344,7 +387,7 @@ - + @@ -369,28 +412,43 @@ - + + + + + + + + + + + + + + + + - + - + - + - + - + @@ -399,22 +457,22 @@ - + - + - + - + - + @@ -422,9 +480,9 @@ - + - + @@ -434,7 +492,7 @@ - + @@ -852,21 +910,127 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + @@ -904,7 +1068,7 @@ - + @@ -942,7 +1106,7 @@ - + @@ -980,7 +1144,7 @@ - + @@ -1018,7 +1182,7 @@ - + @@ -1056,7 +1220,7 @@ - + @@ -1094,7 +1258,7 @@ - + @@ -1132,7 +1296,7 @@ - + @@ -1170,7 +1334,7 @@ - + @@ -1208,7 +1372,7 @@ - + @@ -1246,7 +1410,7 @@ - + @@ -1284,7 +1448,7 @@ - + @@ -1322,7 +1486,7 @@ - + @@ -1360,7 +1524,7 @@ - + @@ -1398,7 +1562,7 @@ - + @@ -1436,7 +1600,7 @@ - + @@ -1474,7 +1638,7 @@ - + @@ -1512,7 +1676,7 @@ - + @@ -1550,7 +1714,7 @@ - + @@ -1588,7 +1752,7 @@ - + @@ -1626,7 +1790,7 @@ - + @@ -1664,7 +1828,7 @@ - + @@ -1702,7 +1866,7 @@ - + @@ -1740,7 +1904,7 @@ - + @@ -1778,7 +1942,7 @@ - + @@ -1816,7 +1980,7 @@ - + @@ -1854,7 +2018,7 @@ - + @@ -1892,7 +2056,7 @@ - + @@ -1930,7 +2094,7 @@ - + @@ -1968,7 +2132,7 @@ - + @@ -2017,20 +2181,20 @@ - + - + - + - + @@ -2047,14 +2211,14 @@ - + - + @@ -2071,14 +2235,14 @@ - + - + @@ -2095,14 +2259,14 @@ - + - + @@ -2119,14 +2283,14 @@ - + - + @@ -2143,14 +2307,14 @@ - + - + @@ -2167,14 +2331,14 @@ - + - + @@ -2191,14 +2355,14 @@ - + - + @@ -2215,7 +2379,7 @@ - + @@ -2235,14 +2399,14 @@ - + - + @@ -2259,14 +2423,14 @@ - + - + @@ -2283,14 +2447,14 @@ - + - + @@ -2310,107 +2474,21 @@ - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -2448,7 +2526,7 @@ - + @@ -2486,7 +2564,7 @@ - + @@ -2521,49 +2599,19 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + @@ -2571,59 +2619,233 @@ - + - + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -2633,8 +2855,8 @@ - - + + @@ -2643,7 +2865,7 @@ - + @@ -2661,7 +2883,7 @@ - + @@ -2671,66 +2893,35 @@ - - + + - + - - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -2740,84 +2931,8 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -2844,7 +2959,7 @@ - + @@ -2882,7 +2997,7 @@ - + @@ -2920,50 +3035,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -2973,11 +3045,11 @@ - + - - + + @@ -3001,7 +3073,7 @@ - + @@ -3011,7 +3083,7 @@ - + @@ -3039,7 +3111,7 @@ - + @@ -3049,10 +3121,10 @@ - + - + @@ -3077,7 +3149,7 @@ - + @@ -3087,7 +3159,7 @@ - + @@ -3112,43 +3184,28 @@ - - - - - - - - - - - - - - - - + - + - + - + - + - + @@ -3157,22 +3214,22 @@ - + - + - + - + - + @@ -3180,9 +3237,9 @@ - + - + @@ -3192,21 +3249,21 @@ - + - + - + - + - + @@ -3215,9 +3272,14 @@ + + + + + - - + + @@ -3227,16 +3289,16 @@ - + - - + + - + @@ -3244,7 +3306,7 @@ - + @@ -3254,8 +3316,8 @@ - - + + @@ -3282,7 +3344,7 @@ - + @@ -3292,8 +3354,8 @@ - - + + @@ -3320,7 +3382,7 @@ - + @@ -3330,10 +3392,10 @@ - - + + - + @@ -3341,62 +3403,73 @@ - + - + - - - - - + + + + + + + - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -3406,24 +3479,24 @@ - + - - + + - - + + - + @@ -3434,7 +3507,7 @@ - + @@ -3444,7 +3517,7 @@ - + @@ -3457,7 +3530,7 @@ - + @@ -3468,11 +3541,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -3482,24 +3586,24 @@ - - + + - + - - + + - + @@ -3510,7 +3614,7 @@ - + @@ -3520,8 +3624,8 @@ - - + + @@ -3530,10 +3634,10 @@ - + - + @@ -3548,7 +3652,7 @@ - + @@ -3558,8 +3662,8 @@ - - + + @@ -3571,7 +3675,7 @@ - + @@ -3586,7 +3690,7 @@ - + @@ -3596,10 +3700,10 @@ - - + + - + @@ -3607,13 +3711,13 @@ - + - + @@ -3624,7 +3728,7 @@ - + @@ -3634,8 +3738,8 @@ - - + + @@ -3647,7 +3751,7 @@ - + @@ -3662,7 +3766,7 @@ - + @@ -3700,7 +3804,7 @@ - + @@ -3710,7 +3814,7 @@ - + @@ -3738,7 +3842,7 @@ - + @@ -3776,7 +3880,7 @@ - + @@ -3786,7 +3890,7 @@ - + @@ -3814,7 +3918,7 @@ - + @@ -3824,10 +3928,10 @@ - + - + @@ -3835,13 +3939,13 @@ - + - + - + @@ -3852,7 +3956,7 @@ - + @@ -3890,45 +3994,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -3938,7 +4004,7 @@ - + @@ -3966,7 +4032,7 @@ - + @@ -3976,11 +4042,11 @@ - + - - + + @@ -4004,7 +4070,7 @@ - + @@ -4014,7 +4080,7 @@ - + @@ -4042,7 +4108,7 @@ - + @@ -4052,11 +4118,11 @@ - + - - + + @@ -4080,7 +4146,7 @@ - + @@ -4090,7 +4156,7 @@ - + @@ -4118,7 +4184,7 @@ - + @@ -4156,7 +4222,7 @@ - + @@ -4166,10 +4232,10 @@ - + - + @@ -4177,13 +4243,13 @@ - + - + - + @@ -4194,7 +4260,7 @@ - + @@ -4204,11 +4270,11 @@ - + - - + + @@ -4232,7 +4298,7 @@ - + @@ -4242,7 +4308,7 @@ - + @@ -4270,7 +4336,7 @@ - + @@ -4308,7 +4374,7 @@ - + @@ -4318,7 +4384,7 @@ - + @@ -4342,344 +4408,135 @@ - - - - - - - - - - - - - + + + + + - - + + + + + + + - - + + + + + - - - - - - - - - - + + - - - - - - - - - - - - + + + - - + + + - + + + - - - - - - - - - - - - + - - - - + + + + + - - + + + + + + + - - + + + + + - - - - + + - - - - - - - - - - - - + + + - - + + + - + + + - - - - - - - - - - - - + - - - - + + + + + - - + + + + + + + - - + + + + + - - - - + + - - - - - - - - - - - - + + + - - + + + - + + + - - - - - - - - - - - - + - - - - + + + + + - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -4689,14 +4546,14 @@ - - + + - + - + @@ -4707,7 +4564,7 @@ - + @@ -4716,23 +4573,18 @@ - - - - - - + - - + + - + @@ -4750,7 +4602,7 @@ - + @@ -4759,13 +4611,8 @@ - - - - - - + @@ -4775,14 +4622,14 @@ - - + + - + - + @@ -4793,7 +4640,7 @@ - + @@ -4803,24 +4650,24 @@ - + - + - - + + - + @@ -4831,7 +4678,7 @@ - + @@ -4841,7 +4688,7 @@ - + @@ -4854,7 +4701,7 @@ - + @@ -4866,162 +4713,306 @@ - - - - - - + + + + + + + + + + + + - - - + + - - - - - - - + + - - - + + + + + + + + + + - + + - - - - - + + + + + + + + + - - - + + - + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + - + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - + + + + + @@ -5029,127 +5020,107 @@ - + - + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - + + + + - + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -5158,8 +5129,13 @@ + + + + + - + @@ -5170,13 +5146,13 @@ - + - + @@ -5187,7 +5163,7 @@ - + @@ -5197,7 +5173,7 @@ - + @@ -5207,7 +5183,7 @@ - + @@ -5225,7 +5201,7 @@ - + @@ -5235,10 +5211,10 @@ - + - + @@ -5246,13 +5222,13 @@ - + - + @@ -5260,19 +5236,56 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - + @@ -5280,21 +5293,21 @@ - + - + - + - + @@ -5332,7 +5345,7 @@ - + @@ -5366,126 +5379,58 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - - - - - - - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + - + @@ -5493,7 +5438,7 @@ - + @@ -5501,14 +5446,14 @@ - + - + @@ -5546,7 +5491,7 @@ - + @@ -5584,11 +5529,11 @@ - + - + @@ -5601,28 +5546,28 @@ - + - + - + - + - + - + - + @@ -5632,28 +5577,28 @@ - + - + - + - + - + - + - + @@ -5663,28 +5608,28 @@ - + - + - + - + - + - + - + @@ -5694,28 +5639,28 @@ - + - + - + - + - + - + - + @@ -5725,28 +5670,28 @@ - + - + - + - + - + - + - + @@ -5756,28 +5701,28 @@ - + - + - + - + - + - + - + @@ -5787,28 +5732,28 @@ - + - + - + - + - + - + - + @@ -5818,28 +5763,28 @@ - + - + - + - + - + - + - + @@ -5849,28 +5794,28 @@ - + - + - + - + - + - + - + @@ -5886,7 +5831,7 @@ - + @@ -5894,49 +5839,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -5947,7 +5850,7 @@ - + @@ -5955,14 +5858,14 @@ - + - + @@ -5983,7 +5886,7 @@ - + @@ -5994,7 +5897,7 @@ - + @@ -6002,14 +5905,14 @@ - + - + @@ -6030,28 +5933,7 @@ - - - - - - - - - - - - - - - - - - - - - - + @@ -6059,27 +5941,21 @@ - + - + - - - - - - - + @@ -6088,51 +5964,52 @@ + + + + + + - + - - - - - - - - + + - + - - + + - + - - + + - - - - - - + - + + + + + + + @@ -6140,41 +6017,41 @@ - + - - - + + + + - - - + + + + - + - - - - + + + - - - - + + + @@ -6182,41 +6059,41 @@ - + - - - + + + + - - - + + + + - + - - - - + + + - - - - + + + @@ -6224,16 +6101,10 @@ - + - - - - - - @@ -6244,21 +6115,32 @@ - + - - + + - + - - + + - + + + + + + + + + + + + @@ -6266,7 +6148,7 @@ - + @@ -6287,7 +6169,7 @@ - + @@ -6297,7 +6179,7 @@ - + @@ -6305,7 +6187,7 @@ - + @@ -6313,20 +6195,22 @@ - + - - - + + + + - - - + + + + @@ -6337,17 +6221,62 @@ - - + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + - + + + + + + + + + + + + + + @@ -6355,7 +6284,7 @@ - + @@ -6363,33 +6292,33 @@ - + - + - + - - - + + + - - - + + + @@ -6397,10 +6326,16 @@ - + + + + + + + @@ -6415,28 +6350,17 @@ - - + + - + - - + + - - - - - - - - - - - - + @@ -6444,41 +6368,41 @@ - + - - - + + + + - - - + + + + - + - - - - + + + - - - - + + + @@ -6486,41 +6410,62 @@ - + - - - + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + @@ -6531,15 +6476,7 @@ - - - - - - - - - + @@ -6551,13 +6488,17 @@ - + + + + + @@ -6567,11 +6508,15 @@ - + + + + + - + diff --git a/AutomatedTesting/Levels/Physics/C12712452_ScriptCanvas_CollisionEvents/C12712452_ScriptCanvas_CollisionEvents.ly b/AutomatedTesting/Levels/Physics/C12712452_ScriptCanvas_CollisionEvents/C12712452_ScriptCanvas_CollisionEvents.ly index b34e483067..fc576ec459 100644 --- a/AutomatedTesting/Levels/Physics/C12712452_ScriptCanvas_CollisionEvents/C12712452_ScriptCanvas_CollisionEvents.ly +++ b/AutomatedTesting/Levels/Physics/C12712452_ScriptCanvas_CollisionEvents/C12712452_ScriptCanvas_CollisionEvents.ly @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ec428aee9c49ffd58a00fdcbb0625185a22f5690f7b2e81326ef5443699019e6 -size 10945 +oid sha256:e04b536d187793187b64a55914d92c1a1c18393a0369715269a295c7b7a7d370 +size 8883 diff --git a/Code/Editor/AboutDialog.cpp b/Code/Editor/AboutDialog.cpp index f7385b39b7..0ba089cd5d 100644 --- a/Code/Editor/AboutDialog.cpp +++ b/Code/Editor/AboutDialog.cpp @@ -45,7 +45,7 @@ CAboutDialog::CAboutDialog(QString versionText, QString richTextCopyrightNotice, CAboutDialog > QLabel#link { text-decoration: underline; color: #94D2FF; }"); // Prepare background image - QImage backgroundImage(QStringLiteral(":/StartupLogoDialog/splashscreen_background_gradient.jpg")); + QImage backgroundImage(QStringLiteral(":/StartupLogoDialog/splashscreen_background_developer_preview.jpg")); m_backgroundImage = QPixmap::fromImage(backgroundImage.scaled(m_enforcedWidth, m_enforcedHeight, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); // Draw the Open 3D Engine logo from svg diff --git a/Code/Editor/StartupLogoDialog.cpp b/Code/Editor/StartupLogoDialog.cpp index d26f174821..68f1c655fb 100644 --- a/Code/Editor/StartupLogoDialog.cpp +++ b/Code/Editor/StartupLogoDialog.cpp @@ -36,11 +36,11 @@ CStartupLogoDialog::CStartupLogoDialog(QString versionText, QString richTextCopy s_pLogoWindow = this; - m_backgroundImage = QPixmap(QStringLiteral(":/StartupLogoDialog/splashscreen_background_gradient.jpg")); + m_backgroundImage = QPixmap(QStringLiteral(":/StartupLogoDialog/splashscreen_background_developer_preview.jpg")); setFixedSize(QSize(600, 300)); // Prepare background image - QImage backgroundImage(QStringLiteral(":/StartupLogoDialog/splashscreen_background_gradient.jpg")); + QImage backgroundImage(QStringLiteral(":/StartupLogoDialog/splashscreen_background_developer_preview.jpg")); m_backgroundImage = QPixmap::fromImage(backgroundImage.scaled(m_enforcedWidth, m_enforcedHeight, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); // Draw the Open 3D Engine logo from svg diff --git a/Code/Editor/StartupLogoDialog.qrc b/Code/Editor/StartupLogoDialog.qrc index 2493810ad8..38d1d1da2a 100644 --- a/Code/Editor/StartupLogoDialog.qrc +++ b/Code/Editor/StartupLogoDialog.qrc @@ -1,6 +1,6 @@ o3de_logo.svg - splashscreen_background_gradient.jpg + splashscreen_background_developer_preview.jpg diff --git a/Code/Editor/splashscreen_background_developer_preview.jpg b/Code/Editor/splashscreen_background_developer_preview.jpg new file mode 100644 index 0000000000..59f05a64df --- /dev/null +++ b/Code/Editor/splashscreen_background_developer_preview.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7105ec99477f124a8ac8d588f2dfc4ee7bb54f39386c8131b7703c86754c0cb8 +size 248690 diff --git a/Code/Framework/AzCore/AzCore/Script/ScriptContext.cpp b/Code/Framework/AzCore/AzCore/Script/ScriptContext.cpp index bcce4beb2c..84988d23c3 100644 --- a/Code/Framework/AzCore/AzCore/Script/ScriptContext.cpp +++ b/Code/Framework/AzCore/AzCore/Script/ScriptContext.cpp @@ -689,6 +689,81 @@ namespace AZ return 1; } + int Class__IndexAllowNil(lua_State* l) + { + LSV_BEGIN(l, 1); + + // calling format __index(table,key) + lua_getmetatable(l, -2); // load the userdata metatable + int metaTableIndex = lua_gettop(l); + + // Check if the key is string, if so we expect it to be a function or property name + // otherwise we allow users to provide custom index handlers + // Technically we can allow strings too, but it will clash with function/property names and it be hard to figure + // out what is going on from with in the system. + if (lua_type(l, -2) == LUA_TSTRING) + { + lua_pushvalue(l, -2); // duplicate the key + lua_rawget(l, -2); // load the value at this index + } + else + { + lua_pushliteral(l, "__AZ_Index"); + lua_rawget(l, -2); // check if the user provided custom Index method in the class metatable + if (lua_isnil(l, -1)) // if not report an error + { + lua_rawgeti(l, -2, AZ_LUA_CLASS_METATABLE_NAME_INDEX); // load the class name for a better error + if (!lua_isstring(l, -1)) // if we failed it means we are the base metatable + { + lua_pop(l, 1); + lua_rawgeti(l, 1, AZ_LUA_CLASS_METATABLE_NAME_INDEX); + } + ScriptContext::FromNativeContext(l)->Error(ScriptContext::ErrorType::Warning, true, "Invalid index type [], should be string! '%s:%s'!", lua_tostring(l, -1), lua_tostring(l, -4)); + } + else + { + // if we have custom index handler + lua_pushvalue(l, -4); // duplicate the table (class pointer) + lua_pushvalue(l, -4); // duplicate the index value for the call + lua_call(l, 2, 1); // call the function + } + + lua_remove(l, metaTableIndex); // remove the metatable + return 1; + } + + if (!lua_isnil(l, -1)) + { + if (lua_tocfunction(l, -1) == &Internal::LuaPropertyTagHelper) // if it's a property + { + lua_getupvalue(l, -1, 1); // push on the stack the getter function + lua_remove(l, -2); // remove property object + + if (lua_isnil(l, -1)) + { + lua_rawgeti(l, -2, AZ_LUA_CLASS_METATABLE_NAME_INDEX); // load the class name for a better error + if (!lua_isstring(l, -1)) // if we failed it means we are the base metatable + { + lua_pop(l, 1); + lua_rawgeti(l, 1, AZ_LUA_CLASS_METATABLE_NAME_INDEX); + } + + ScriptContext::FromNativeContext(l)->Error(ScriptContext::ErrorType::Warning, true, "Property '%s:%s' is write only", lua_tostring(l, -1), lua_tostring(l, -4)); + lua_pop(l, 1); // pop class name + } + else + { + lua_pushvalue(l, -4); // copy the user data to be passed as a this pointer. + lua_call(l, 1, 1); // call a function with one argument (this pointer) and 1 result + } + } + } + + lua_remove(l, metaTableIndex); // remove the metatable + return 1; + } + + //========================================================================= // Class__NewIndex // [3/22/2012] @@ -826,30 +901,6 @@ namespace AZ return 1; } - //========================================================================= - // ClassMetatable__Index - // [3/24/2012] - //========================================================================= - int ClassMetatable__Index(lua_State* l) - { - // since the Class__Index is generic function (ask for the class metatable) - // we can reuse the code for the base metatable (which is a metatable - // of the class metatable) - return Class__Index(l); - } - - //========================================================================= - // ClassMetatable__NewIndex - // [3/30/2012] - //========================================================================= - int ClassMetatable__NewIndex(lua_State* l) - { - // since the Class__NewIndex is generic function (ask for the class metatable) - // we can reuse the code for the base metatable (which is a metatable - // of the class metatable) - return Class__NewIndex(l); - } - inline size_t BufferStringCopy(const char* source, char* destination, size_t destinationSize) { size_t srcLen = strlen(source); @@ -5053,9 +5104,20 @@ LUA_API const Node* lua_getDummyNode() lua_pushcclosure(m_lua, &DefaultBehaviorCaller::Destroy, 0); lua_rawset(m_lua, -3); - lua_pushliteral(m_lua, "__index"); - lua_pushcclosure(m_lua, &Internal::Class__Index, 0); - lua_rawset(m_lua, -3); + { + lua_pushliteral(m_lua, "__index"); + + if (FindAttribute(Script::Attributes::UseClassIndexAllowNil, behaviorClass->m_attributes)) + { + lua_pushcclosure(m_lua, &Internal::Class__IndexAllowNil, 0); + } + else + { + lua_pushcclosure(m_lua, &Internal::Class__Index, 0); + } + + lua_rawset(m_lua, -3); + } lua_pushliteral(m_lua, "__newindex"); lua_pushcclosure(m_lua, &Internal::Class__NewIndex, 0); diff --git a/Code/Framework/AzCore/AzCore/Script/ScriptContextAttributes.h b/Code/Framework/AzCore/AzCore/Script/ScriptContextAttributes.h index e09e0699f9..f145d1a681 100644 --- a/Code/Framework/AzCore/AzCore/Script/ScriptContextAttributes.h +++ b/Code/Framework/AzCore/AzCore/Script/ScriptContextAttributes.h @@ -16,19 +16,20 @@ namespace AZ { namespace Attributes { - const static AZ::Crc32 Ignore = AZ_CRC("ScriptIgnore", 0xeb7615e1); ///< Don't use the element in the script reflection - const static AZ::Crc32 ClassNameOverride = AZ_CRC("ScriptClassNameOverride", 0x891238a3); ///< Provide a custom name for script reflection, that doesn't match the behavior Context name - const static AZ::Crc32 MethodOverride = AZ_CRC("ScriptFunctionOverride", 0xf89a7882); ///< Use a custom function in the attribute instead of the function - const static AZ::Crc32 ConstructorOverride = AZ_CRC("ConstructorOverride", 0xef5ce4aa); ///< You can provide a custom constructor to be called when created from Lua script - const static AZ::Crc32 EventHandlerCreationFunction = AZ_CRC_CE("EventHandlerCreationFunction"); ///< helps create a handler for any script target so that script functions can be used for AZ::Event signals - const static AZ::Crc32 GenericConstructorOverride = AZ_CRC("GenericConstructorOverride", 0xe6a1698e); ///< You can provide a custom constructor to be called when creating a script - const static AZ::Crc32 ReaderWriterOverride = AZ_CRC("ReaderWriterOverride", 0x1ad9ce2a); ///< paired with \ref ScriptContext::CustomReaderWriter allows you to customize read/write to Lua VM - const static AZ::Crc32 ConstructibleFromNil = AZ_CRC("ConstructibleFromNil", 0x23908169); ///< Applied to classes. Value (bool) specifies if the class be default constructed when nil is provided. - const static AZ::Crc32 ToolTip = AZ_CRC("ToolTip", 0xa1b95fb0); ///< Add a tooltip for a method/event/property - const static AZ::Crc32 Category = AZ_CRC("Category", 0x064c19c1); ///< Provide a category to allow for partitioning/sorting/ordering of the element - const static AZ::Crc32 Deprecated = AZ_CRC("Deprecated", 0xfe49a138); ///< Marks a reflected class, method, EBus or property as deprecated. - const static AZ::Crc32 DisallowBroadcast = AZ_CRC("DisallowBroadcast", 0x389b0ac7); ///< Marks a reflected EBus as not allowing Broadcasts, only Events. - const static AZ::Crc32 ClassConstantValue = AZ_CRC_CE("ClassConstantValue"); ///< Indicates the property is backed by a constant value + static constexpr AZ::Crc32 Ignore = AZ_CRC_CE("ScriptIgnore"); ///< Don't use the element in the script reflection + static constexpr AZ::Crc32 ClassNameOverride = AZ_CRC_CE("ScriptClassNameOverride"); ///< Provide a custom name for script reflection, that doesn't match the behavior Context name + static constexpr AZ::Crc32 MethodOverride = AZ_CRC_CE("ScriptFunctionOverride"); ///< Use a custom function in the attribute instead of the function + static constexpr AZ::Crc32 ConstructorOverride = AZ_CRC_CE("ConstructorOverride"); ///< You can provide a custom constructor to be called when created from Lua script + static constexpr AZ::Crc32 EventHandlerCreationFunction = AZ_CRC_CE("EventHandlerCreationFunction"); ///< helps create a handler for any script target so that script functions can be used for AZ::Event signals + static constexpr AZ::Crc32 GenericConstructorOverride = AZ_CRC_CE("GenericConstructorOverride"); ///< You can provide a custom constructor to be called when creating a script + static constexpr AZ::Crc32 ReaderWriterOverride = AZ_CRC_CE("ReaderWriterOverride"); ///< paired with \ref ScriptContext::CustomReaderWriter allows you to customize read/write to Lua VM + static constexpr AZ::Crc32 ConstructibleFromNil = AZ_CRC_CE("ConstructibleFromNil"); ///< Applied to classes. Value (bool) specifies if the class be default constructed when nil is provided. + static constexpr AZ::Crc32 ToolTip = AZ_CRC_CE("ToolTip"); ///< Add a tooltip for a method/event/property + static constexpr AZ::Crc32 Category = AZ_CRC_CE("Category"); ///< Provide a category to allow for partitioning/sorting/ordering of the element + static constexpr AZ::Crc32 Deprecated = AZ_CRC_CE("Deprecated"); ///< Marks a reflected class, method, EBus or property as deprecated. + static constexpr AZ::Crc32 DisallowBroadcast = AZ_CRC_CE("DisallowBroadcast"); ///< Marks a reflected EBus as not allowing Broadcasts, only Events. + static constexpr AZ::Crc32 ClassConstantValue = AZ_CRC_CE("ClassConstantValue"); ///< Indicates the property is backed by a constant value + static constexpr AZ::Crc32 UseClassIndexAllowNil = AZ_CRC_CE("UseClassIndexAllowNil"); ///< Use the Class__IndexAllowNil method, which will not report an error on accessing undeclared values (allows for nil) //! Attribute which stores BehaviorAzEventDescription structure which contains //! the script name of an AZ::Event and the name of it's parameter arguments @@ -39,11 +40,11 @@ namespace AZ static constexpr AZ::Crc32 EventParameterTypes = AZ_CRC_CE("EventParameterTypes"); ///< Recommends that the Lua runtime look up the member function in the meta table of the first argument, rather than in the original table - const static AZ::Crc32 TreatAsMemberFunction = AZ_CRC("TreatAsMemberFunction", 0x64be831a); + static constexpr AZ::Crc32 TreatAsMemberFunction = AZ_CRC_CE("TreatAsMemberFunction"); ///< This attribute can be attached to the EditContext Attribute of a reflected class, the BehaviorContext Attribute of a reflected class, method, ebus or property. ///< ExcludeFlags can be used to prevent elements from appearing in List, Documentation, etc... - const static AZ::Crc32 ExcludeFrom = AZ_CRC("ExcludeFrom", 0xa98972fe); + static constexpr AZ::Crc32 ExcludeFrom = AZ_CRC_CE("ExcludeFrom"); enum ExcludeFlags : AZ::u64 { List = 1 << 0, //< The reflected item will be excluded from any list (e.g. node palette) @@ -54,7 +55,7 @@ namespace AZ }; //! Used to specify the usage of a Behavior Context element (e.g. Class or EBus) designed for automation scripts - const static AZ::Crc32 Scope = AZ_CRC("Scope", 0x00af55d3); + static constexpr AZ::Crc32 Scope = AZ_CRC_CE("Scope"); enum class ScopeFlags : AZ::u64 { Launcher = 1 << 0, //< a type meant for game run-time Launcher client (default value) @@ -63,15 +64,15 @@ namespace AZ }; //! Provide a partition hierarchy in a string dotted notation to namespace a script element - const static AZ::Crc32 Module = AZ_CRC("Module", 0x0c242628); + static constexpr AZ::Crc32 Module = AZ_CRC_CE("Module"); //! Provide an alternate name for script elements such as helpful PEP8 Python methods and property aliases - const static AZ::Crc32 Alias = AZ_CRC("Alias", 0xe16c6b94); + static constexpr AZ::Crc32 Alias = AZ_CRC_CE("Alias"); - const static AZ::Crc32 EnableAsScriptEventParamType = AZ_CRC("ScriptEventParam", 0xa41e4cb0); - const static AZ::Crc32 EnableAsScriptEventReturnType = AZ_CRC("ScriptEventReturn", 0xf89b5337); + static constexpr AZ::Crc32 EnableAsScriptEventParamType = AZ_CRC_CE("ScriptEventParam"); + static constexpr AZ::Crc32 EnableAsScriptEventReturnType = AZ_CRC_CE("ScriptEventReturn"); - const static AZ::Crc32 Storage = AZ_CRC("ScriptStorage", 0xcd95b44d); + static constexpr AZ::Crc32 Storage = AZ_CRC_CE("ScriptStorage"); enum class StorageType { ScriptOwn, // default, Host allocated memory, Lua will destruct object, Lua will free host-memory via host-supplied function @@ -79,7 +80,7 @@ namespace AZ Value, // Object is Lua allocated memory, Lua will destruct object, Lua will free Lua-memory }; - const static AZ::Crc32 Operator = AZ_CRC("ScriptOperator", 0xfee681b6); + static constexpr AZ::Crc32 Operator = AZ_CRC_CE("ScriptOperator"); enum class OperatorType { // note storage policy can be T*,T (only if we store raw pointers), shared_ptr, intrusive pointer @@ -100,7 +101,7 @@ namespace AZ IndexWrite, // given a key/index and a value, you can store it in the class }; - const static AZ::Crc32 AssetType = AZ_CRC("AssetType", 0xabbf8d5f); ///< Provide an asset type for a generic AssetId method + static constexpr AZ::Crc32 AssetType = AZ_CRC_CE("AssetType"); ///< Provide an asset type for a generic AssetId method } // Attributes } // Script diff --git a/Code/Framework/AzCore/AzCore/Script/ScriptDebug.cpp b/Code/Framework/AzCore/AzCore/Script/ScriptDebug.cpp index 8725e7f3f2..ab40f31312 100644 --- a/Code/Framework/AzCore/AzCore/Script/ScriptDebug.cpp +++ b/Code/Framework/AzCore/AzCore/Script/ScriptDebug.cpp @@ -24,7 +24,6 @@ namespace AZ //========================================================================= AZStd::string ExtractUserMessage(const ScriptDataContext& dc) { - AZStd::string userMessage = "Condition failed"; const int argCount = dc.GetNumArguments(); if (argCount > 0 && dc.IsString(argCount - 1)) { @@ -33,12 +32,12 @@ namespace AZ { if (value) { - userMessage = value; + return value; } } } - return userMessage; + return "ExtractUserMessage from print/Debug.Log/Warn/Error/Assert failed. Consider wrapping your argument in tostring()."; } //========================================================================= diff --git a/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsSceneQueries.h b/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsSceneQueries.h index af1f5947a4..443315ce92 100644 --- a/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsSceneQueries.h +++ b/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsSceneQueries.h @@ -188,7 +188,7 @@ namespace AzPhysics AZ::Transform m_start = AZ::Transform::CreateIdentity(); //!< World space start position. Assumes only rotation + translation (no scaling). AZ::Vector3 m_direction = AZ::Vector3::CreateZero(); //!< World space direction (Should be normalized) AZStd::shared_ptr m_shapeConfiguration; //!< Shape information. - SceneQuery::HitFlags m_hitFlags = SceneQuery::HitFlags::Default; //!< Query behavior flags + SceneQuery::HitFlags m_hitFlags = SceneQuery::HitFlags::Default | SceneQuery::HitFlags::MTD; //!< Query behavior flags. MTD Is On by default to correctly report objects that are initially in contact with the start pose. SceneQuery::FilterCallback m_filterCallback = nullptr; //!< Hit filtering function bool m_reportMultipleHits = false; //!< flag to have the cast stop after the first hit or return all hits along the query. }; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.cpp index d046fc733d..3acb4ae72c 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.cpp @@ -46,10 +46,11 @@ namespace AzToolsFramework::Prefab::SpawnableUtils } } + template void OrganizeEntitiesForSorting( - AzFramework::Spawnable::EntityList& entities, + AZStd::vector& entities, AZStd::unordered_set& existingEntityIds, - AZStd::unordered_map& parentIdToChildren, + AZStd::unordered_map>& parentIdToChildren, AZStd::vector& candidateIds, size_t& removedEntitiesCount) { @@ -90,7 +91,7 @@ namespace AzToolsFramework::Prefab::SpawnableUtils // entities with no transform component will be treated like entities with no parent. AZ::EntityId parentId; if (AZ::TransformInterface* transformInterface = - AZ::EntityUtils::FindFirstDerivedComponent(entity.get())) + AZ::EntityUtils::FindFirstDerivedComponent(&(*entity))) { parentId = transformInterface->GetParentId(); if (parentId == entityId) @@ -104,8 +105,7 @@ namespace AzToolsFramework::Prefab::SpawnableUtils } auto& children = parentIdToChildren[parentId]; - children.emplace_back(nullptr); - children.back().swap(entity); + children.emplace_back(AZStd::move(entity)); } // clear 'entities', we'll refill it in sorted order. @@ -125,9 +125,10 @@ namespace AzToolsFramework::Prefab::SpawnableUtils } + template void TraceParentingLoop( const AZ::EntityId& parentFromLoopId, - const AZStd::unordered_map& parentIdToChildren) + const AZStd::unordered_map>& parentIdToChildren) { // Find name to use in warning message @@ -153,16 +154,22 @@ namespace AzToolsFramework::Prefab::SpawnableUtils parentFromLoopId.ToString().c_str()); } + void SortEntitiesByTransformHierarchy(AzFramework::Spawnable& spawnable) { - auto& entities = spawnable.GetEntities(); + SortEntitiesByTransformHierarchy(spawnable.GetEntities()); + } + + template + void SortEntitiesByTransformHierarchy(AZStd::vector& entities) + { const size_t originalEntityCount = entities.size(); // IDs of those present in 'entities'. Does not include parent ID if parent not found in 'entities' AZStd::unordered_set existingEntityIds; // map children by their parent ID (even if parent not found in 'entities') - AZStd::unordered_map parentIdToChildren; + AZStd::unordered_map> parentIdToChildren; // use 'candidateIds' to track the parent IDs we're going to process next. AZStd::vector candidateIds; @@ -199,8 +206,7 @@ namespace AzToolsFramework::Prefab::SpawnableUtils for (auto& child : foundChildren->second) { candidateIds.push_back(child->GetId()); - entities.emplace_back(nullptr); - entities.back().swap(child); + entities.emplace_back(AZStd::move(child)); } parentIdToChildren.erase(foundChildren); @@ -217,4 +223,7 @@ namespace AzToolsFramework::Prefab::SpawnableUtils } + // Explicit specializations of SortEntitiesByTransformHierarchy (have to be in cpp due to clang errors) + template void SortEntitiesByTransformHierarchy(AZStd::vector& entities); + template void SortEntitiesByTransformHierarchy(AZStd::vector>& entities); } // namespace AzToolsFramework::Prefab::SpawnableUtils diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.h index 2c2ec2f532..ff5cc2021b 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.h @@ -16,4 +16,8 @@ namespace AzToolsFramework::Prefab::SpawnableUtils bool CreateSpawnable(AzFramework::Spawnable& spawnable, const PrefabDom& prefabDom, AZStd::vector>& referencedAssets); void SortEntitiesByTransformHierarchy(AzFramework::Spawnable& spawnable); + + template + void SortEntitiesByTransformHierarchy(AZStd::vector& entities); + } // namespace AzToolsFramework::Prefab::SpawnableUtils diff --git a/Code/Legacy/CryCommon/LyShine/Bus/UiCanvasBus.h b/Code/Legacy/CryCommon/LyShine/Bus/UiCanvasBus.h index 894f97c9fe..744cb19a12 100644 --- a/Code/Legacy/CryCommon/LyShine/Bus/UiCanvasBus.h +++ b/Code/Legacy/CryCommon/LyShine/Bus/UiCanvasBus.h @@ -20,14 +20,6 @@ struct IUiAnimationSystem; class UiCanvasInterface : public AZ::ComponentBus { -public: // types - - enum class ErrorCode - { - NoError, - PrefabContainsExternalEntityRefs - }; - public: // member functions //! Deleting a canvas will delete all its child elements recursively and all of their components @@ -110,23 +102,6 @@ public: // member functions //! \return true if no error virtual bool SaveToXml(const string& assetIdPathname, const string& sourceAssetPathname) = 0; - //! Save the given UI element entity to the given path as a prefab - //! \param pathname the path to save the prefab to - //! \param entity pointer to the entity to save as a prefab - //! \return true if no error - virtual bool SaveAsPrefab(const string& pathname, AZ::Entity* entity) = 0; - - //! Check if it is OK to save the given UI element entity to the given path as a prefab - //! \param entity pointer to the entity to save as a prefab - //! \return errorCode which is NoError if OK to save - virtual ErrorCode CheckElementValidToSaveAsPrefab(AZ::Entity* entity) = 0; - - //! Load a prefab element from the given file and optionally insert as child of given entity - //! \return the top level entity created - virtual AZ::Entity* LoadFromPrefab(const string& pathname, - bool makeUniqueName, - AZ::Entity* optionalInsertionPoint) = 0; - //! Initialize a set of entities that have been added to the canvas //! Used when instantiating a slice or for undo/redo, copy/paste //! \param topLevelEntities - The elements that were created diff --git a/Code/Tools/AssetProcessor/native/AssetManager/assetProcessorManager.cpp b/Code/Tools/AssetProcessor/native/AssetManager/assetProcessorManager.cpp index 91abc032f2..96a30596c1 100644 --- a/Code/Tools/AssetProcessor/native/AssetManager/assetProcessorManager.cpp +++ b/Code/Tools/AssetProcessor/native/AssetManager/assetProcessorManager.cpp @@ -2548,7 +2548,7 @@ namespace AssetProcessor jobdetail.m_jobParam[AZ_CRC(AutoFailReasonKey)] = AZStd::string::format( "Source file ( %s ) contains non ASCII characters.\n" - "Open 3D Engine currently only supports file paths having ASCII characters and therefore asset processor will not be able to process this file.\n" + "O3DE currently only supports file paths having ASCII characters and therefore asset processor will not be able to process this file.\n" "Please rename the source file to fix this error.\n", normalizedPath.toUtf8().data()); diff --git a/Code/Tools/AssetProcessor/native/tests/AssetProcessorTest.cpp b/Code/Tools/AssetProcessor/native/tests/AssetProcessorTest.cpp index 2b80a3acbf..046c305518 100644 --- a/Code/Tools/AssetProcessor/native/tests/AssetProcessorTest.cpp +++ b/Code/Tools/AssetProcessor/native/tests/AssetProcessorTest.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include "BaseAssetProcessorTest.h" #include @@ -67,11 +68,19 @@ namespace AssetProcessor static char** paramStringArray = &namePtr; auto registry = AZ::SettingsRegistry::Get(); - auto projectPathKey = - AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_path"; + auto bootstrapKey = AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey); + auto projectPathKey = bootstrapKey + "/project_path"; registry->Set(projectPathKey, "AutomatedTesting"); AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*registry); - + + // Forcing the branch token into settings registry before starting the application manager. + // This avoids writing the asset_processor.setreg file which can cause fileIO errors. + AZ::IO::FixedMaxPathString enginePath = AZ::Utils::GetEnginePath(); + auto branchTokenKey = bootstrapKey + "/assetProcessor_branch_token"; + AZStd::string token; + AzFramework::StringFunc::AssetPath::CalculateBranchToken(enginePath.c_str(), token); + registry->Set(branchTokenKey, token.c_str()); + m_application.reset(new UnitTestAppManager(&numParams, ¶mStringArray)); ASSERT_EQ(m_application->BeforeRun(), ApplicationManager::Status_Success); ASSERT_TRUE(m_application->PrepareForTests()); diff --git a/Code/Tools/AssetProcessor/native/ui/MainWindow.ui b/Code/Tools/AssetProcessor/native/ui/MainWindow.ui index 869edce3f0..d4f341d2b5 100644 --- a/Code/Tools/AssetProcessor/native/ui/MainWindow.ui +++ b/Code/Tools/AssetProcessor/native/ui/MainWindow.ui @@ -17,7 +17,7 @@ - Asset Processor + O3DE Asset Processor diff --git a/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp b/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp index 7ac957c6b7..cbdb1e4184 100644 --- a/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp +++ b/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp @@ -478,7 +478,7 @@ void ApplicationManagerBase::InitConnectionManager() result = QObject::connect(GetRCController(), &AssetProcessor::RCController::JobStarted, this, [](QString inputFile, QString platform) { - QString msg = QCoreApplication::translate("Asset Processor", "Processing %1 (%2)...\n", "%1 is the name of the file, and %2 is the platform to process it for").arg(inputFile, platform); + QString msg = QCoreApplication::translate("O3DE Asset Processor", "Processing %1 (%2)...\n", "%1 is the name of the file, and %2 is the platform to process it for").arg(inputFile, platform); AZ_Printf(AssetProcessor::ConsoleChannel, "%s", msg.toUtf8().constData()); AssetNotificationMessage message(inputFile.toUtf8().constData(), AssetNotificationMessage::JobStarted, AZ::Data::s_invalidAssetType, platform.toUtf8().constData()); EBUS_EVENT(AssetProcessor::ConnectionBus, SendPerPlatform, 0, message, platform); diff --git a/Code/Tools/ProjectManager/Resources/Backgrounds/DefaultBackground.jpg b/Code/Tools/ProjectManager/Resources/Backgrounds/DefaultBackground.jpg new file mode 100644 index 0000000000..3af15393c4 --- /dev/null +++ b/Code/Tools/ProjectManager/Resources/Backgrounds/DefaultBackground.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:342c3eaccf68a178dfd8c2b1792a93a8c9197c8184dca11bf90706d7481df087 +size 1611268 diff --git a/Code/Tools/ProjectManager/Resources/Backgrounds/FirstTimeBackgroundImage.jpg b/Code/Tools/ProjectManager/Resources/Backgrounds/FirstTimeBackgroundImage.jpg deleted file mode 100644 index bfa5f83cf6..0000000000 --- a/Code/Tools/ProjectManager/Resources/Backgrounds/FirstTimeBackgroundImage.jpg +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7088e902885d98953f6a1715efab319c063a4ab8918fd0e810251c8ed82b8514 -size 542983 diff --git a/Code/Tools/ProjectManager/Resources/Backgrounds/FtueBackground.jpg b/Code/Tools/ProjectManager/Resources/Backgrounds/FtueBackground.jpg new file mode 100644 index 0000000000..44291a8b1d --- /dev/null +++ b/Code/Tools/ProjectManager/Resources/Backgrounds/FtueBackground.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:797794816e4b1702f1ae1f32b408c95c79eb1f8a95aba43cfad9cccc181b0bda +size 1135182 diff --git a/Code/Tools/ProjectManager/Resources/ProjectManager.qrc b/Code/Tools/ProjectManager/Resources/ProjectManager.qrc index 0b9de2af89..cfe4b37fbc 100644 --- a/Code/Tools/ProjectManager/Resources/ProjectManager.qrc +++ b/Code/Tools/ProjectManager/Resources/ProjectManager.qrc @@ -26,12 +26,13 @@ o3de.svg menu.svg menu_hover.svg - Backgrounds/FirstTimeBackgroundImage.jpg ArrowDownLine.svg ArrowUpLine.svg CarrotArrowDown.svg Summary.svg WindowClose.svg Warning.svg + Backgrounds/DefaultBackground.jpg + Backgrounds/FtueBackground.jpg diff --git a/Code/Tools/ProjectManager/Source/CreateProjectCtrl.h b/Code/Tools/ProjectManager/Source/CreateProjectCtrl.h index c453e2d500..7dea0cb9a2 100644 --- a/Code/Tools/ProjectManager/Source/CreateProjectCtrl.h +++ b/Code/Tools/ProjectManager/Source/CreateProjectCtrl.h @@ -11,7 +11,6 @@ #include #endif -// due to current limitations, customizing template Gems is disabled #define TEMPLATE_GEM_CONFIGURATION_ENABLED QT_FORWARD_DECLARE_CLASS(QStackedWidget) diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemInfo.cpp b/Code/Tools/ProjectManager/Source/GemCatalog/GemInfo.cpp index 2f6491a77d..36f4489081 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemInfo.cpp +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemInfo.cpp @@ -61,8 +61,8 @@ namespace O3DE::ProjectManager { switch (origin) { - case O3DEFoundation: - return "Open 3D Foundation"; + case Open3DEEngine: + return "Open 3D Engine"; case Local: return "Local"; default: diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemInfo.h b/Code/Tools/ProjectManager/Source/GemCatalog/GemInfo.h index 6c9580b19a..c82b310fd9 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemInfo.h +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemInfo.h @@ -43,7 +43,7 @@ namespace O3DE::ProjectManager enum GemOrigin { - O3DEFoundation = 1 << 0, + Open3DEEngine = 1 << 0, Local = 1 << 1, NumGemOrigins = 2 }; diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.cpp b/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.cpp index 035fcb7181..b9dc3e9fcc 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.cpp +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.cpp @@ -99,7 +99,13 @@ namespace O3DE::ProjectManager painter->drawText(gemCreatorRect, Qt::TextSingleLine, gemCreator); // Gem summary - const QSize summarySize = QSize(contentRect.width() - s_summaryStartX - s_buttonWidth - s_itemMargins.right() * 3, contentRect.height()); + + // In case there are feature tags displayed at the bottom, decrease the size of the summary text field. + const QStringList featureTags = GemModel::GetFeatures(modelIndex); + const int summaryHeight = contentRect.height() - (!featureTags.empty() * 30); + + const QSize summarySize = QSize(contentRect.width() - s_summaryStartX - s_buttonWidth - s_itemMargins.right() * 3, + summaryHeight); const QRect summaryRect = QRect(/*topLeft=*/QPoint(contentRect.left() + s_summaryStartX, contentRect.top()), summarySize); painter->setFont(standardFont); @@ -108,9 +114,9 @@ namespace O3DE::ProjectManager const QString summary = GemModel::GetSummary(modelIndex); painter->drawText(summaryRect, Qt::AlignLeft | Qt::TextWordWrap, summary); - DrawButton(painter, contentRect, modelIndex); DrawPlatformIcons(painter, contentRect, modelIndex); + DrawFeatureTags(painter, contentRect, featureTags, standardFont, summaryRect); painter->restore(); } @@ -206,6 +212,46 @@ namespace O3DE::ProjectManager } } + void GemItemDelegate::DrawFeatureTags(QPainter* painter, const QRect& contentRect, const QStringList& featureTags, const QFont& standardFont, const QRect& summaryRect) const + { + QFont gemFeatureTagFont(standardFont); + gemFeatureTagFont.setPixelSize(s_featureTagFontSize); + gemFeatureTagFont.setBold(false); + painter->setFont(gemFeatureTagFont); + + int x = s_summaryStartX; + for (const QString& featureTag : featureTags) + { + QRect featureTagRect = GetTextRect(gemFeatureTagFont, featureTag, s_featureTagFontSize); + featureTagRect.moveTo(contentRect.left() + x + s_featureTagBorderMarginX, + contentRect.top() + 47); + featureTagRect = painter->boundingRect(featureTagRect, Qt::TextSingleLine, featureTag); + + QRect backgroundRect = featureTagRect; + backgroundRect = backgroundRect.adjusted(/*left=*/-s_featureTagBorderMarginX, + /*top=*/-s_featureTagBorderMarginY, + /*right=*/s_featureTagBorderMarginX, + /*bottom=*/s_featureTagBorderMarginY); + + // Skip drawing all following feature tags as there is no more space available. + if (backgroundRect.right() > summaryRect.right()) + { + break; + } + + // Draw border. + painter->setPen(m_textColor); + painter->setBrush(Qt::NoBrush); + painter->drawRect(backgroundRect); + + // Draw text within the border. + painter->setPen(m_textColor); + painter->drawText(featureTagRect, Qt::TextSingleLine, featureTag); + + x += backgroundRect.width() + s_featureTagSpacing; + } + } + void GemItemDelegate::DrawButton(QPainter* painter, const QRect& contentRect, const QModelIndex& modelIndex) const { painter->save(); diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.h b/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.h index 07c25a5ad4..40d06002de 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.h +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.h @@ -57,12 +57,19 @@ namespace O3DE::ProjectManager inline constexpr static int s_buttonCircleRadius = s_buttonBorderRadius - 2; inline constexpr static qreal s_buttonFontSize = 10.0; + // Feature tags + inline constexpr static int s_featureTagFontSize = 10; + inline constexpr static int s_featureTagBorderMarginX = 3; + inline constexpr static int s_featureTagBorderMarginY = 3; + inline constexpr static int s_featureTagSpacing = 7; + protected: void CalcRects(const QStyleOptionViewItem& option, QRect& outFullRect, QRect& outItemRect, QRect& outContentRect) const; QRect GetTextRect(QFont& font, const QString& text, qreal fontSize) const; QRect CalcButtonRect(const QRect& contentRect) const; void DrawPlatformIcons(QPainter* painter, const QRect& contentRect, const QModelIndex& modelIndex) const; void DrawButton(QPainter* painter, const QRect& contentRect, const QModelIndex& modelIndex) const; + void DrawFeatureTags(QPainter* painter, const QRect& contentRect, const QStringList& featureTags, const QFont& standardFont, const QRect& summaryRect) const; QAbstractItemModel* m_model = nullptr; diff --git a/Code/Tools/ProjectManager/Source/NewProjectSettingsScreen.cpp b/Code/Tools/ProjectManager/Source/NewProjectSettingsScreen.cpp index 26e5e074e5..c0c96d8281 100644 --- a/Code/Tools/ProjectManager/Source/NewProjectSettingsScreen.cpp +++ b/Code/Tools/ProjectManager/Source/NewProjectSettingsScreen.cpp @@ -97,10 +97,21 @@ namespace O3DE::ProjectManager { m_templates = templatesResult.GetValue(); - // sort alphabetically by display name because they could be in any order + // sort alphabetically by display name (but putting Standard first) because they could be in any order std::sort(m_templates.begin(), m_templates.end(), [](const ProjectTemplateInfo& arg1, const ProjectTemplateInfo& arg2) { - return arg1.m_displayName.toLower() < arg2.m_displayName.toLower(); + if (arg1.m_displayName == "Standard") + { + return true; + } + else if (arg2.m_displayName == "Standard") + { + return false; + } + else + { + return arg1.m_displayName.toLower() < arg2.m_displayName.toLower(); + } }); for (int index = 0; index < m_templates.size(); ++index) diff --git a/Code/Tools/ProjectManager/Source/NewProjectSettingsScreen.h b/Code/Tools/ProjectManager/Source/NewProjectSettingsScreen.h index d812bfd091..924821e534 100644 --- a/Code/Tools/ProjectManager/Source/NewProjectSettingsScreen.h +++ b/Code/Tools/ProjectManager/Source/NewProjectSettingsScreen.h @@ -19,6 +19,7 @@ QT_FORWARD_DECLARE_CLASS(QFrame) namespace O3DE::ProjectManager { QT_FORWARD_DECLARE_CLASS(TagContainerWidget) + class NewProjectSettingsScreen : public ProjectSettingsScreen { diff --git a/Code/Tools/ProjectManager/Source/ProjectBuilderController.cpp b/Code/Tools/ProjectManager/Source/ProjectBuilderController.cpp index 00e2e5d68d..33defeec8b 100644 --- a/Code/Tools/ProjectManager/Source/ProjectBuilderController.cpp +++ b/Code/Tools/ProjectManager/Source/ProjectBuilderController.cpp @@ -92,10 +92,18 @@ namespace O3DE::ProjectManager // Open application assigned to this file type QDesktopServices::openUrl(QUrl("file:///" + m_worker->GetLogFilePath())); } + + m_projectInfo.m_buildFailed = true; + m_projectInfo.m_logUrl = QUrl("file:///" + m_worker->GetLogFilePath()); + emit NotifyBuildProject(m_projectInfo); } else { QMessageBox::critical(m_parent, tr("Project Failed to Build!"), result); + + m_projectInfo.m_buildFailed = true; + m_projectInfo.m_logUrl = QUrl(); + emit NotifyBuildProject(m_projectInfo); } emit Done(false); diff --git a/Code/Tools/ProjectManager/Source/ProjectBuilderController.h b/Code/Tools/ProjectManager/Source/ProjectBuilderController.h index c3e3026b34..15ad5412b3 100644 --- a/Code/Tools/ProjectManager/Source/ProjectBuilderController.h +++ b/Code/Tools/ProjectManager/Source/ProjectBuilderController.h @@ -38,6 +38,7 @@ namespace O3DE::ProjectManager signals: void Done(bool success = true); + void NotifyBuildProject(const ProjectInfo& projectInfo); private: ProjectInfo m_projectInfo; diff --git a/Code/Tools/ProjectManager/Source/ProjectBuilderWorker.cpp b/Code/Tools/ProjectManager/Source/ProjectBuilderWorker.cpp index 45034686c3..63899035e0 100644 --- a/Code/Tools/ProjectManager/Source/ProjectBuilderWorker.cpp +++ b/Code/Tools/ProjectManager/Source/ProjectBuilderWorker.cpp @@ -14,7 +14,7 @@ namespace O3DE::ProjectManager { - const QString ProjectBuilderWorker::BuildCancelled = ProjectBuilderWorker::tr("Build Cancelled."); + const QString ProjectBuilderWorker::BuildCancelled = QObject::tr("Build Cancelled."); ProjectBuilderWorker::ProjectBuilderWorker(const ProjectInfo& projectInfo) : QObject() diff --git a/Code/Tools/ProjectManager/Source/ProjectButtonWidget.cpp b/Code/Tools/ProjectManager/Source/ProjectButtonWidget.cpp index 68a43b3b52..cce9da5734 100644 --- a/Code/Tools/ProjectManager/Source/ProjectButtonWidget.cpp +++ b/Code/Tools/ProjectManager/Source/ProjectButtonWidget.cpp @@ -11,6 +11,7 @@ #include #include +#include #include #include #include @@ -20,6 +21,7 @@ #include #include #include +#include namespace O3DE::ProjectManager { @@ -40,8 +42,57 @@ namespace O3DE::ProjectManager m_overlayLabel->setVisible(false); vLayout->addWidget(m_overlayLabel); + m_buildOverlayLayout = new QVBoxLayout(); + m_buildOverlayLayout->addSpacing(10); + + QHBoxLayout* horizontalMessageLayout = new QHBoxLayout(); + + horizontalMessageLayout->addSpacing(10); + m_warningIcon = new QLabel(this); + m_warningIcon->setPixmap(QIcon(":/Warning.svg").pixmap(20, 20)); + m_warningIcon->setAlignment(Qt::AlignTop); + m_warningIcon->setVisible(false); + horizontalMessageLayout->addWidget(m_warningIcon); + + horizontalMessageLayout->addSpacing(10); + + m_warningText = new QLabel("", this); + m_warningText->setObjectName("projectWarningOverlay"); + m_warningText->setWordWrap(true); + m_warningText->setAlignment(Qt::AlignLeft); + m_warningText->setVisible(false); + connect(m_warningText, &QLabel::linkActivated, this, &LabelButton::OnLinkActivated); + horizontalMessageLayout->addWidget(m_warningText); + + QSpacerItem* textSpacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Expanding); + horizontalMessageLayout->addSpacerItem(textSpacer); + + m_buildOverlayLayout->addLayout(horizontalMessageLayout); + + QSpacerItem* buttonSpacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Expanding); + m_buildOverlayLayout->addSpacerItem(buttonSpacer); + + QHBoxLayout* horizontalOpenEditorButtonLayout = new QHBoxLayout(); + horizontalOpenEditorButtonLayout->addSpacing(34); + m_openEditorButton = new QPushButton(tr("Open Editor"), this); + m_openEditorButton->setObjectName("openEditorButton"); + m_openEditorButton->setDefault(true); + m_openEditorButton->setVisible(false); + horizontalOpenEditorButtonLayout->addWidget(m_openEditorButton); + horizontalOpenEditorButtonLayout->addSpacing(34); + m_buildOverlayLayout->addLayout(horizontalOpenEditorButtonLayout); + + QHBoxLayout* horizontalButtonLayout = new QHBoxLayout(); + horizontalButtonLayout->addSpacing(34); m_actionButton = new QPushButton(tr("Project Action"), this); m_actionButton->setVisible(false); + horizontalButtonLayout->addWidget(m_actionButton); + horizontalButtonLayout->addSpacing(34); + + m_buildOverlayLayout->addLayout(horizontalButtonLayout); + m_buildOverlayLayout->addSpacing(16); + + vLayout->addItem(m_buildOverlayLayout); m_progressBar = new QProgressBar(this); m_progressBar->setObjectName("labelButtonProgressBar"); @@ -73,16 +124,41 @@ namespace O3DE::ProjectManager return m_overlayLabel; } + void LabelButton::SetLogUrl(const QUrl& url) + { + m_logUrl = url; + } + QProgressBar* LabelButton::GetProgressBar() { return m_progressBar; } + QPushButton* LabelButton::GetOpenEditorButton() + { + return m_openEditorButton; + } + QPushButton* LabelButton::GetActionButton() { return m_actionButton; } + QLabel* LabelButton::GetWarningLabel() + { + return m_warningText; + } + + QLabel* LabelButton::GetWarningIcon() + { + return m_warningIcon; + } + + void LabelButton::OnLinkActivated(const QString& /*link*/) + { + QDesktopServices::openUrl(m_logUrl); + } + ProjectButton::ProjectButton(const ProjectInfo& projectInfo, QWidget* parent, bool processing) : QFrame(parent) , m_projectInfo(projectInfo) @@ -110,7 +186,6 @@ namespace O3DE::ProjectManager m_projectImageLabel = new LabelButton(this); m_projectImageLabel->setFixedSize(ProjectPreviewImageWidth, ProjectPreviewImageHeight); m_projectImageLabel->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter); - connect(m_projectImageLabel, &LabelButton::triggered, [this]() { emit OpenProject(m_projectInfo.m_path); }); vLayout->addWidget(m_projectImageLabel); QString projectPreviewPath = QDir(m_projectInfo.m_path).filePath(m_projectInfo.m_iconPath); @@ -145,6 +220,8 @@ namespace O3DE::ProjectManager void ProjectButton::ReadySetup() { + connect(m_projectImageLabel->GetOpenEditorButton(), &QPushButton::clicked, [this](){ emit OpenProject(m_projectInfo.m_path); }); + QMenu* menu = new QMenu(this); menu->addAction(tr("Edit Project Settings..."), this, [this]() { emit EditProject(m_projectInfo.m_path); }); menu->addAction(tr("Build"), this, [this]() { emit BuildProject(m_projectInfo); }); @@ -170,9 +247,6 @@ namespace O3DE::ProjectManager QPushButton* projectActionButton = m_projectImageLabel->GetActionButton(); if (!m_actionButtonConnection) { - QSpacerItem* buttonSpacer = new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding); - m_projectImageLabel->layout()->addItem(buttonSpacer); - m_projectImageLabel->layout()->addWidget(projectActionButton); projectActionButton->setVisible(true); } else @@ -186,6 +260,27 @@ namespace O3DE::ProjectManager void ProjectButton::SetProjectBuildButtonAction() { + m_projectImageLabel->GetWarningLabel()->setText(tr("Building project required.")); + m_projectImageLabel->GetWarningIcon()->setVisible(true); + m_projectImageLabel->GetWarningLabel()->setVisible(true); + SetProjectButtonAction(tr("Build Project"), [this]() { emit BuildProject(m_projectInfo); }); + } + + void ProjectButton::ShowBuildFailed(bool show, const QUrl& logUrl) + { + if (!logUrl.isEmpty()) + { + m_projectImageLabel->GetWarningLabel()->setText(tr("Failed to build. Click to view logs.")); + } + else + { + m_projectImageLabel->GetWarningLabel()->setText(tr("Project failed to build.")); + } + + m_projectImageLabel->GetWarningLabel()->setTextInteractionFlags(Qt::LinksAccessibleByMouse); + m_projectImageLabel->GetWarningIcon()->setVisible(show); + m_projectImageLabel->GetWarningLabel()->setVisible(show); + m_projectImageLabel->SetLogUrl(logUrl); SetProjectButtonAction(tr("Build Project"), [this]() { emit BuildProject(m_projectInfo); }); } @@ -209,6 +304,16 @@ namespace O3DE::ProjectManager m_projectImageLabel->GetProgressBar()->setValue(progress); } + void ProjectButton::enterEvent(QEvent* /*event*/) + { + m_projectImageLabel->GetOpenEditorButton()->setVisible(true); + } + + void ProjectButton::leaveEvent(QEvent* /*event*/) + { + m_projectImageLabel->GetOpenEditorButton()->setVisible(false); + } + LabelButton* ProjectButton::GetLabelButton() { return m_projectImageLabel; diff --git a/Code/Tools/ProjectManager/Source/ProjectButtonWidget.h b/Code/Tools/ProjectManager/Source/ProjectButtonWidget.h index b3b4b2bcf6..a99984c12f 100644 --- a/Code/Tools/ProjectManager/Source/ProjectButtonWidget.h +++ b/Code/Tools/ProjectManager/Source/ProjectButtonWidget.h @@ -20,6 +20,9 @@ QT_FORWARD_DECLARE_CLASS(QPixmap) QT_FORWARD_DECLARE_CLASS(QAction) QT_FORWARD_DECLARE_CLASS(QProgressBar) +QT_FORWARD_DECLARE_CLASS(QLayout) +QT_FORWARD_DECLARE_CLASS(QVBoxLayout) +QT_FORWARD_DECLARE_CLASS(QEvent) namespace O3DE::ProjectManager { @@ -34,21 +37,32 @@ namespace O3DE::ProjectManager void SetEnabled(bool enabled); void SetOverlayText(const QString& text); + void SetLogUrl(const QUrl& url); QLabel* GetOverlayLabel(); QProgressBar* GetProgressBar(); + QPushButton* GetOpenEditorButton(); QPushButton* GetActionButton(); + QLabel* GetWarningLabel(); + QLabel* GetWarningIcon(); + QLayout* GetBuildOverlayLayout(); signals: void triggered(); public slots: void mousePressEvent(QMouseEvent* event) override; + void OnLinkActivated(const QString& link); private: + QVBoxLayout* m_buildOverlayLayout; QLabel* m_overlayLabel; QProgressBar* m_progressBar; + QPushButton* m_openEditorButton; QPushButton* m_actionButton; + QLabel* m_warningText; + QLabel* m_warningIcon; + QUrl m_logUrl; bool m_enabled = true; }; @@ -63,6 +77,7 @@ namespace O3DE::ProjectManager void SetProjectButtonAction(const QString& text, AZStd::function lambda); void SetProjectBuildButtonAction(); + void ShowBuildFailed(bool show, const QUrl& logUrl); void SetLaunchButtonEnabled(bool enabled); void SetButtonOverlayText(const QString& text); @@ -81,11 +96,14 @@ namespace O3DE::ProjectManager void BaseSetup(); void ProcessingSetup(); void ReadySetup(); + void enterEvent(QEvent* event) override; + void leaveEvent(QEvent* event) override; void BuildThisProject(); ProjectInfo m_projectInfo; LabelButton* m_projectImageLabel; QFrame* m_projectFooter; + QLayout* m_requiresBuildLayout; QMetaObject::Connection m_actionButtonConnection; }; diff --git a/Code/Tools/ProjectManager/Source/ProjectInfo.h b/Code/Tools/ProjectManager/Source/ProjectInfo.h index d78ef54c83..a6a661420b 100644 --- a/Code/Tools/ProjectManager/Source/ProjectInfo.h +++ b/Code/Tools/ProjectManager/Source/ProjectInfo.h @@ -9,6 +9,7 @@ #if !defined(Q_MOC_RUN) #include +#include #include #include #endif @@ -54,5 +55,7 @@ namespace O3DE::ProjectManager // Used in project creation bool m_needsBuild = false; //! Does this project need to be built + bool m_buildFailed = false; + QUrl m_logUrl; }; } // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/ProjectsScreen.cpp b/Code/Tools/ProjectManager/Source/ProjectsScreen.cpp index cc3e386118..a31cd8b263 100644 --- a/Code/Tools/ProjectManager/Source/ProjectsScreen.cpp +++ b/Code/Tools/ProjectManager/Source/ProjectsScreen.cpp @@ -53,8 +53,6 @@ namespace O3DE::ProjectManager vLayout->setContentsMargins(s_contentMargins, 0, s_contentMargins, 0); setLayout(vLayout); - m_background.load(":/Backgrounds/FirstTimeBackgroundImage.jpg"); - m_stack = new QStackedWidget(this); m_firstTimeContent = CreateFirstTimeContent(); @@ -117,6 +115,8 @@ namespace O3DE::ProjectManager QFrame* ProjectsScreen::CreateProjectsContent(QString buildProjectPath, ProjectButton** projectButton) { + RemoveInvalidProjects(); + QFrame* frame = new QFrame(this); frame->setObjectName("projectsContent"); { @@ -193,7 +193,19 @@ namespace O3DE::ProjectManager } else if (RequiresBuildProjectIterator(project.m_path) != m_requiresBuild.end()) { - projectButtonWidget->SetProjectBuildButtonAction(); + auto buildProjectIterator = RequiresBuildProjectIterator(project.m_path); + if (buildProjectIterator != m_requiresBuild.end()) + { + if (buildProjectIterator->m_buildFailed) + { + projectButtonWidget->ShowBuildFailed(true, buildProjectIterator->m_logUrl); + } + else + { + projectButtonWidget->SetProjectBuildButtonAction(); + } + } + } } @@ -232,6 +244,8 @@ namespace O3DE::ProjectManager m_projectsContent->deleteLater(); } + m_background.load(":/Backgrounds/DefaultBackground.jpg"); + // Make sure to update builder with latest Project Button if (m_currentBuilder) { @@ -269,21 +283,30 @@ namespace O3DE::ProjectManager // we paint the background here because qss does not support background cover scaling QPainter painter(this); - auto winSize = size(); - auto pixmapRatio = (float)m_background.width() / m_background.height(); - auto windowRatio = (float)winSize.width() / winSize.height(); + const QSize winSize = size(); + const float pixmapRatio = (float)m_background.width() / m_background.height(); + const float windowRatio = (float)winSize.width() / winSize.height(); + QRect backgroundRect; if (pixmapRatio > windowRatio) { - auto newWidth = (int)(winSize.height() * pixmapRatio); - auto offset = (newWidth - winSize.width()) / -2; - painter.drawPixmap(offset, 0, newWidth, winSize.height(), m_background); + const int newWidth = (int)(winSize.height() * pixmapRatio); + const int offset = (newWidth - winSize.width()) / -2; + backgroundRect = QRect(offset, 0, newWidth, winSize.height()); } else { - auto newHeight = (int)(winSize.width() / pixmapRatio); - painter.drawPixmap(0, 0, winSize.width(), newHeight, m_background); + const int newHeight = (int)(winSize.width() / pixmapRatio); + backgroundRect = QRect(0, 0, winSize.width(), newHeight); } + + // Draw the background image. + painter.drawPixmap(backgroundRect, m_background); + + // Draw a semi-transparent overlay to darken down the colors. + painter.setCompositionMode (QPainter::CompositionMode_DestinationIn); + const float overlayTransparency = 0.7f; + painter.fillRect(backgroundRect, QColor(0, 0, 0, static_cast(255.0f * overlayTransparency))); } void ProjectsScreen::HandleNewProjectButton() @@ -407,7 +430,7 @@ namespace O3DE::ProjectManager void ProjectsScreen::SuggestBuildProjectMsg(const ProjectInfo& projectInfo, bool showMessage) { - if (RequiresBuildProjectIterator(projectInfo.m_path) == m_requiresBuild.end()) + if (RequiresBuildProjectIterator(projectInfo.m_path) == m_requiresBuild.end() || projectInfo.m_buildFailed) { m_requiresBuild.append(projectInfo); } @@ -459,6 +482,7 @@ namespace O3DE::ProjectManager { if (ShouldDisplayFirstTimeContent()) { + m_background.load(":/Backgrounds/FtueBackground.jpg"); m_stack->setCurrentWidget(m_firstTimeContent); } else @@ -485,6 +509,11 @@ namespace O3DE::ProjectManager return displayFirstTimeContent; } + bool ProjectsScreen::RemoveInvalidProjects() + { + return PythonBindingsInterface::Get()->RemoveInvalidProjects(); + } + bool ProjectsScreen::StartProjectBuild(const ProjectInfo& projectInfo) { if (ProjectUtils::IsVS2019Installed()) @@ -500,6 +529,7 @@ namespace O3DE::ProjectManager m_currentBuilder = new ProjectBuilderController(projectInfo, nullptr, this); ResetProjectsContent(); connect(m_currentBuilder, &ProjectBuilderController::Done, this, &ProjectsScreen::ProjectBuildDone); + connect(m_currentBuilder, &ProjectBuilderController::NotifyBuildProject, this, &ProjectsScreen::SuggestBuildProject); m_currentBuilder->Start(); } diff --git a/Code/Tools/ProjectManager/Source/ProjectsScreen.h b/Code/Tools/ProjectManager/Source/ProjectsScreen.h index 1ca8448134..787db16c59 100644 --- a/Code/Tools/ProjectManager/Source/ProjectsScreen.h +++ b/Code/Tools/ProjectManager/Source/ProjectsScreen.h @@ -62,6 +62,7 @@ namespace O3DE::ProjectManager ProjectButton* CreateProjectButton(ProjectInfo& project, QLayout* flowLayout, bool processing = false); void ResetProjectsContent(); bool ShouldDisplayFirstTimeContent(); + bool RemoveInvalidProjects(); bool StartProjectBuild(const ProjectInfo& projectInfo); QList::iterator RequiresBuildProjectIterator(const QString& projectPath); diff --git a/Code/Tools/ProjectManager/Source/PythonBindings.cpp b/Code/Tools/ProjectManager/Source/PythonBindings.cpp index 24f83cd2a2..167cf6d10e 100644 --- a/Code/Tools/ProjectManager/Source/PythonBindings.cpp +++ b/Code/Tools/ProjectManager/Source/PythonBindings.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -23,6 +23,8 @@ #include #include +#include + namespace Platform { bool InsertPythonLibraryPath( @@ -42,7 +44,7 @@ namespace Platform return false; } - // Implemented in each different platform's PAL implentation files, as it differs per platform. + // Implemented in each different platform's PAL implementation files, as it differs per platform. AZStd::string GetPythonHomePath(const char* pythonPackage, const char* engineRoot); } // namespace Platform @@ -650,6 +652,12 @@ namespace O3DE::ProjectManager gemInfo.m_summary = Py_To_String_Optional(data, "summary", ""); gemInfo.m_version = ""; gemInfo.m_requirement = Py_To_String_Optional(data, "requirements", ""); + gemInfo.m_creator = Py_To_String_Optional(data, "origin", ""); + + if (gemInfo.m_creator.contains("Open 3D Engine")) + { + gemInfo.m_gemOrigin = GemInfo::GemOrigin::Open3DEEngine; + } if (data.contains("user_tags")) { @@ -769,6 +777,21 @@ namespace O3DE::ProjectManager }); } + bool PythonBindings::RemoveInvalidProjects() + { + bool removalResult = false; + bool result = ExecuteWithLock( + [&] + { + auto pythonRemovalResult = m_register.attr("remove_invalid_o3de_projects")(); + + // Returns an exit code so boolify it then invert result + removalResult = !pythonRemovalResult.cast(); + }); + + return result && removalResult; + } + AZ::Outcome PythonBindings::UpdateProject(const ProjectInfo& projectInfo) { bool updateProjectSucceeded = false; @@ -836,11 +859,19 @@ namespace O3DE::ProjectManager templateInfo.m_canonicalTags.push_back(Py_To_String(tag)); } } - if (data.contains("included_gems")) + + QString templateProjectPath = QDir(templateInfo.m_path).filePath("Template"); + auto enabledGemNames = GetEnabledGemNames(templateProjectPath); + if (enabledGemNames) { - for (auto gem : data["included_gems"]) + for (auto gem : enabledGemNames.GetValue()) { - templateInfo.m_includedGems.push_back(Py_To_String(gem)); + // Exclude the template ${Name} placeholder for the list of included gems + // That Gem gets created with the project + if (!gem.contains("${Name}")) + { + templateInfo.m_includedGems.push_back(Py_To_String(gem.c_str())); + } } } } diff --git a/Code/Tools/ProjectManager/Source/PythonBindings.h b/Code/Tools/ProjectManager/Source/PythonBindings.h index 1d98505457..98ca8e90f0 100644 --- a/Code/Tools/ProjectManager/Source/PythonBindings.h +++ b/Code/Tools/ProjectManager/Source/PythonBindings.h @@ -50,6 +50,7 @@ namespace O3DE::ProjectManager AZ::Outcome UpdateProject(const ProjectInfo& projectInfo) override; AZ::Outcome AddGemToProject(const QString& gemPath, const QString& projectPath) override; AZ::Outcome RemoveGemFromProject(const QString& gemPath, const QString& projectPath) override; + bool RemoveInvalidProjects() override; // ProjectTemplate AZ::Outcome> GetProjectTemplates(const QString& projectPath = {}) override; diff --git a/Code/Tools/ProjectManager/Source/PythonBindingsInterface.h b/Code/Tools/ProjectManager/Source/PythonBindingsInterface.h index 0adc842a05..8580087737 100644 --- a/Code/Tools/ProjectManager/Source/PythonBindingsInterface.h +++ b/Code/Tools/ProjectManager/Source/PythonBindingsInterface.h @@ -141,6 +141,11 @@ namespace O3DE::ProjectManager */ virtual AZ::Outcome RemoveGemFromProject(const QString& gemPath, const QString& projectPath) = 0; + /** + * Removes invalid projects from the manifest + */ + virtual bool RemoveInvalidProjects() = 0; + // Project Templates diff --git a/Gems/AWSClientAuth/Code/Include/Private/Authentication/AWSCognitoAuthenticationProvider.h b/Gems/AWSClientAuth/Code/Include/Private/Authentication/AWSCognitoAuthenticationProvider.h index 0d3696f3d5..cdd551cbed 100644 --- a/Gems/AWSClientAuth/Code/Include/Private/Authentication/AWSCognitoAuthenticationProvider.h +++ b/Gems/AWSClientAuth/Code/Include/Private/Authentication/AWSCognitoAuthenticationProvider.h @@ -22,7 +22,7 @@ namespace AWSClientAuth virtual ~AWSCognitoAuthenticationProvider() = default; // AuthenticationProviderInterface overrides - bool Initialize(AZStd::weak_ptr settingsRegistry) override; + bool Initialize() override; void PasswordGrantSingleFactorSignInAsync(const AZStd::string& username, const AZStd::string& password) override; void PasswordGrantMultiFactorSignInAsync(const AZStd::string& username, const AZStd::string& password) override; void PasswordGrantMultiFactorConfirmSignInAsync(const AZStd::string& username, const AZStd::string& confirmationCode) override; diff --git a/Gems/AWSClientAuth/Code/Include/Private/Authentication/AuthenticationProviderInterface.h b/Gems/AWSClientAuth/Code/Include/Private/Authentication/AuthenticationProviderInterface.h index 9cba2227b1..c8addc6ff6 100644 --- a/Gems/AWSClientAuth/Code/Include/Private/Authentication/AuthenticationProviderInterface.h +++ b/Gems/AWSClientAuth/Code/Include/Private/Authentication/AuthenticationProviderInterface.h @@ -22,9 +22,8 @@ namespace AWSClientAuth virtual ~AuthenticationProviderInterface() = default; //! Extract required settings for the provider from setting registry. - //! @param settingsRegistry Passed in initialized settings registry object. //! @return bool True: if provider can parse required settings and validate. False: fails to parse required settings. - virtual bool Initialize(AZStd::weak_ptr settingsRegistry) = 0; + virtual bool Initialize() = 0; //! Call sign in endpoint for provider password grant flow. //! @param username Username to use to for sign in. diff --git a/Gems/AWSClientAuth/Code/Include/Private/Authentication/AuthenticationProviderManager.h b/Gems/AWSClientAuth/Code/Include/Private/Authentication/AuthenticationProviderManager.h index d4cb66b1a4..5ccc670d47 100644 --- a/Gems/AWSClientAuth/Code/Include/Private/Authentication/AuthenticationProviderManager.h +++ b/Gems/AWSClientAuth/Code/Include/Private/Authentication/AuthenticationProviderManager.h @@ -29,7 +29,7 @@ namespace AWSClientAuth protected: // AuthenticationProviderRequestsBus Interface - bool Initialize(const AZStd::vector& providerNames, const AZStd::string& settingsRegistryPath) override; + bool Initialize(const AZStd::vector& providerNames) override; void PasswordGrantSingleFactorSignInAsync(const ProviderNameEnum& providerName, const AZStd::string& username, const AZStd::string& password) override; void PasswordGrantMultiFactorSignInAsync(const ProviderNameEnum& providerName, const AZStd::string& username, const AZStd::string& password) override; void PasswordGrantMultiFactorConfirmSignInAsync(const ProviderNameEnum& providerName, const AZStd::string& username, const AZStd::string& confirmationCode) override; @@ -42,7 +42,7 @@ namespace AWSClientAuth AuthenticationTokens GetAuthenticationTokens(const ProviderNameEnum& providerName) override; // AuthenticationProviderScriptCanvasRequest interface - bool Initialize(const AZStd::vector& providerNames, const AZStd::string& settingsRegistryPath) override; + bool Initialize(const AZStd::vector& providerNames) override; void PasswordGrantSingleFactorSignInAsync( const AZStd::string& providerName, const AZStd::string& username, const AZStd::string& password) override; void PasswordGrantMultiFactorSignInAsync( @@ -64,8 +64,6 @@ namespace AWSClientAuth bool IsProviderInitialized(const ProviderNameEnum& providerName); void ResetProviders(); ProviderNameEnum GetProviderNameEnum(AZStd::string name); - - AZStd::shared_ptr m_settingsRegistry; }; } // namespace AWSClientAuth diff --git a/Gems/AWSClientAuth/Code/Include/Private/Authentication/AuthenticationProviderScriptCanvasBus.h b/Gems/AWSClientAuth/Code/Include/Private/Authentication/AuthenticationProviderScriptCanvasBus.h index 17a3907846..ccbf3e0466 100644 --- a/Gems/AWSClientAuth/Code/Include/Private/Authentication/AuthenticationProviderScriptCanvasBus.h +++ b/Gems/AWSClientAuth/Code/Include/Private/Authentication/AuthenticationProviderScriptCanvasBus.h @@ -20,9 +20,8 @@ namespace AWSClientAuth //! Parse the settings file for required settings for authentication providers. Instantiate and initialize authentication providers //! @param providerNames List of provider names to instantiate and initialize for Authentication. - //! @param settingsRegistryPath Path for the settings registry file to use to configure providers. //! @return bool True: if all providers initialized successfully. False: If any provider fails initialization. - virtual bool Initialize(const AZStd::vector& providerNames, const AZStd::string& settingsRegistryPath) = 0; + virtual bool Initialize(const AZStd::vector& providerNames) = 0; //! Checks if user is signed in. //! If access tokens are available and not expired. diff --git a/Gems/AWSClientAuth/Code/Include/Private/Authentication/GoogleAuthenticationProvider.h b/Gems/AWSClientAuth/Code/Include/Private/Authentication/GoogleAuthenticationProvider.h index 292cf2e80a..d5616213b3 100644 --- a/Gems/AWSClientAuth/Code/Include/Private/Authentication/GoogleAuthenticationProvider.h +++ b/Gems/AWSClientAuth/Code/Include/Private/Authentication/GoogleAuthenticationProvider.h @@ -21,7 +21,7 @@ namespace AWSClientAuth virtual ~GoogleAuthenticationProvider(); // AuthenticationProviderInterface overrides - bool Initialize(AZStd::weak_ptr settingsRegistry) override; + bool Initialize() override; void PasswordGrantSingleFactorSignInAsync(const AZStd::string& username, const AZStd::string& password) override; void PasswordGrantMultiFactorSignInAsync(const AZStd::string& username, const AZStd::string& password) override; void PasswordGrantMultiFactorConfirmSignInAsync(const AZStd::string& username, const AZStd::string& confirmationCode) override; diff --git a/Gems/AWSClientAuth/Code/Include/Private/Authentication/LWAAuthenticationProvider.h b/Gems/AWSClientAuth/Code/Include/Private/Authentication/LWAAuthenticationProvider.h index 8a4d68f67e..9e12cf5810 100644 --- a/Gems/AWSClientAuth/Code/Include/Private/Authentication/LWAAuthenticationProvider.h +++ b/Gems/AWSClientAuth/Code/Include/Private/Authentication/LWAAuthenticationProvider.h @@ -21,7 +21,7 @@ namespace AWSClientAuth virtual ~LWAAuthenticationProvider(); // AuthenticationProviderInterface overrides - bool Initialize(AZStd::weak_ptr settingsRegistry) override; + bool Initialize() override; void PasswordGrantSingleFactorSignInAsync(const AZStd::string& username, const AZStd::string& password) override; void PasswordGrantMultiFactorSignInAsync(const AZStd::string& username, const AZStd::string& password) override; void PasswordGrantMultiFactorConfirmSignInAsync(const AZStd::string& username, const AZStd::string& confirmationCode) override; diff --git a/Gems/AWSClientAuth/Code/Include/Public/Authentication/AuthenticationProviderBus.h b/Gems/AWSClientAuth/Code/Include/Public/Authentication/AuthenticationProviderBus.h index d11588ad55..d9b37b06db 100644 --- a/Gems/AWSClientAuth/Code/Include/Public/Authentication/AuthenticationProviderBus.h +++ b/Gems/AWSClientAuth/Code/Include/Public/Authentication/AuthenticationProviderBus.h @@ -19,9 +19,8 @@ namespace AWSClientAuth //! Parse the settings file for required settings for authentication providers. Instantiate and initialize authentication providers //! @param providerNames List of provider names to instantiate and initialize for Authentication. - //! @param settingsRegistryPath Path for the settings registry file to use to configure providers. //! @return bool True: if all providers initialized successfully. False: If any provider fails initialization. - virtual bool Initialize(const AZStd::vector& providerNames, const AZStd::string& settingsRegistryPath) = 0; + virtual bool Initialize(const AZStd::vector& providerNames) = 0; //! Checks if user is signed in. //! If access tokens are available and not expired. diff --git a/Gems/AWSClientAuth/Code/Source/Authentication/AWSCognitoAuthenticationProvider.cpp b/Gems/AWSClientAuth/Code/Source/Authentication/AWSCognitoAuthenticationProvider.cpp index 482c9b1d9e..7f00e93f51 100644 --- a/Gems/AWSClientAuth/Code/Source/Authentication/AWSCognitoAuthenticationProvider.cpp +++ b/Gems/AWSClientAuth/Code/Source/Authentication/AWSCognitoAuthenticationProvider.cpp @@ -30,9 +30,8 @@ namespace AWSClientAuth constexpr char CognitoRefreshTokenAuthParamKey[] = "REFRESH_TOKEN"; constexpr char CognitoSmsMfaCodeKey[] = "SMS_MFA_CODE"; - bool AWSCognitoAuthenticationProvider::Initialize(AZStd::weak_ptr settingsRegistry) + bool AWSCognitoAuthenticationProvider::Initialize() { - AZ_UNUSED(settingsRegistry); AWSCore::AWSResourceMappingRequestBus::BroadcastResult( m_cognitoAppClientId, &AWSCore::AWSResourceMappingRequests::GetResourceNameId, CognitoAppClientIdResourceMappingKey); AZ_Warning("AWSCognitoAuthenticationProvider", !m_cognitoAppClientId.empty(), "Missing Cognito App Client Id from resource mappings. Calls to Cognito will fail."); diff --git a/Gems/AWSClientAuth/Code/Source/Authentication/AuthenticationProviderManager.cpp b/Gems/AWSClientAuth/Code/Source/Authentication/AuthenticationProviderManager.cpp index 75f70932f1..a4fb232648 100644 --- a/Gems/AWSClientAuth/Code/Source/Authentication/AuthenticationProviderManager.cpp +++ b/Gems/AWSClientAuth/Code/Source/Authentication/AuthenticationProviderManager.cpp @@ -6,7 +6,6 @@ */ #include -#include #include #include @@ -27,37 +26,21 @@ namespace AWSClientAuth AuthenticationProviderManager::~AuthenticationProviderManager() { ResetProviders(); - m_settingsRegistry.reset(); AuthenticationProviderScriptCanvasRequestBus::Handler::BusDisconnect(); AuthenticationProviderRequestBus::Handler::BusDisconnect(); AZ::Interface::Unregister(this); } - bool AuthenticationProviderManager::Initialize(const AZStd::vector& providerNames, const AZStd::string& settingsRegistryPath) + bool AuthenticationProviderManager::Initialize(const AZStd::vector& providerNames) { ResetProviders(); - AZ::IO::FileIOBase* fileIO = AZ::IO::FileIOBase::GetInstance(); - AZ_Assert(fileIO, "File IO is not initialized."); - - m_settingsRegistry.reset(); - m_settingsRegistry = AZStd::make_shared(); - - AZStd::array resolvedPath{}; - fileIO->ResolvePath(settingsRegistryPath.data(), resolvedPath.data(), resolvedPath.size()); - - - if (!m_settingsRegistry->MergeSettingsFile(resolvedPath.data(), AZ::SettingsRegistryInterface::Format::JsonMergePatch)) - { - AZ_Error("AuthenticationProviderManager", false, "Error merging settings registry for path: %s", resolvedPath.data()); - return false; - } bool initializeSuccess = true; for (auto providerName : providerNames) { m_authenticationProvidersMap[providerName] = CreateAuthenticationProviderObject(providerName); - initializeSuccess = initializeSuccess && m_authenticationProvidersMap[providerName]->Initialize(m_settingsRegistry); + initializeSuccess = initializeSuccess && m_authenticationProvidersMap[providerName]->Initialize(); } return initializeSuccess; @@ -199,14 +182,14 @@ namespace AWSClientAuth } bool AuthenticationProviderManager::Initialize( - const AZStd::vector& providerNames, const AZStd::string& settingsRegistryPath) + const AZStd::vector& providerNames) { AZStd::vector providerNamesEnum; for (auto name : providerNames) { providerNamesEnum.push_back(GetProviderNameEnum(name)); } - return Initialize(providerNamesEnum, settingsRegistryPath); + return Initialize(providerNamesEnum); } void AuthenticationProviderManager::PasswordGrantSingleFactorSignInAsync(const AZStd::string& providerName, const AZStd::string& username, const AZStd::string& password) diff --git a/Gems/AWSClientAuth/Code/Source/Authentication/GoogleAuthenticationProvider.cpp b/Gems/AWSClientAuth/Code/Source/Authentication/GoogleAuthenticationProvider.cpp index 3d180b17db..3d6e351017 100644 --- a/Gems/AWSClientAuth/Code/Source/Authentication/GoogleAuthenticationProvider.cpp +++ b/Gems/AWSClientAuth/Code/Source/Authentication/GoogleAuthenticationProvider.cpp @@ -30,9 +30,16 @@ namespace AWSClientAuth m_settings.reset(); } - bool GoogleAuthenticationProvider::Initialize(AZStd::weak_ptr settingsRegistry) + bool GoogleAuthenticationProvider::Initialize() { - if (!settingsRegistry.lock()->GetObject(m_settings.get(), azrtti_typeid(m_settings.get()), GoogleSettingsPath)) + AZ::SettingsRegistryInterface* settingsRegistry = AZ::SettingsRegistry::Get(); + if (!settingsRegistry) + { + AZ_Warning("AWSCognitoAuthenticationProvider", false, "Failed to load the setting registry"); + return false; + } + + if (!settingsRegistry->GetObject(m_settings.get(), azrtti_typeid(m_settings.get()), GoogleSettingsPath)) { AZ_Warning("AWSCognitoAuthenticationProvider", false, "Failed to get Google settings object for path %s", GoogleSettingsPath); return false; diff --git a/Gems/AWSClientAuth/Code/Source/Authentication/LWAAuthenticationProvider.cpp b/Gems/AWSClientAuth/Code/Source/Authentication/LWAAuthenticationProvider.cpp index b8028ff769..f5628b3734 100644 --- a/Gems/AWSClientAuth/Code/Source/Authentication/LWAAuthenticationProvider.cpp +++ b/Gems/AWSClientAuth/Code/Source/Authentication/LWAAuthenticationProvider.cpp @@ -29,9 +29,16 @@ namespace AWSClientAuth m_settings.reset(); } - bool LWAAuthenticationProvider::Initialize(AZStd::weak_ptr settingsRegistry) + bool LWAAuthenticationProvider::Initialize() { - if (!settingsRegistry.lock()->GetObject(m_settings.get(), azrtti_typeid(m_settings.get()), LwaSettingsPath)) + AZ::SettingsRegistryInterface* settingsRegistry = AZ::SettingsRegistry::Get(); + if (!settingsRegistry) + { + AZ_Warning("AWSCognitoAuthenticationProvider", false, "Failed to load the setting registry"); + return false; + } + + if (!settingsRegistry->GetObject(m_settings.get(), azrtti_typeid(m_settings.get()), LwaSettingsPath)) { AZ_Warning("AWSCognitoAuthenticationProvider", false, "Failed to get login with Amazon settings object for path %s", LwaSettingsPath); return false; diff --git a/Gems/AWSClientAuth/Code/Tests/AWSClientAuthGemMock.h b/Gems/AWSClientAuth/Code/Tests/AWSClientAuthGemMock.h index eef29e2cb5..cf6364fa00 100644 --- a/Gems/AWSClientAuth/Code/Tests/AWSClientAuthGemMock.h +++ b/Gems/AWSClientAuth/Code/Tests/AWSClientAuthGemMock.h @@ -351,12 +351,12 @@ namespace AWSClientAuthUnitTest AuthenticationProviderMock() { - ON_CALL(*this, Initialize(testing::_)).WillByDefault(testing::Return(true)); + ON_CALL(*this, Initialize()).WillByDefault(testing::Return(true)); } virtual ~AuthenticationProviderMock() = default; - MOCK_METHOD1(Initialize, bool(AZStd::weak_ptr settingsRegistry)); + MOCK_METHOD0(Initialize, bool()); MOCK_METHOD2(PasswordGrantSingleFactorSignInAsync, void(const AZStd::string& username, const AZStd::string& password)); MOCK_METHOD2(PasswordGrantMultiFactorSignInAsync, void(const AZStd::string& username, const AZStd::string& password)); MOCK_METHOD2(PasswordGrantMultiFactorConfirmSignInAsync, void(const AZStd::string& username, const AZStd::string& confirmationCode)); @@ -495,6 +495,8 @@ namespace AWSClientAuthUnitTest m_settingsRegistry->SetContext(m_serializeContext.get()); m_settingsRegistry->SetContext(m_registrationContext.get()); + AZ::SettingsRegistry::Register(m_settingsRegistry.get()); + AZ::ComponentApplicationBus::Handler::BusConnect(); AZ::Interface::Register(this); @@ -555,6 +557,8 @@ namespace AWSClientAuthUnitTest AWSClientAuth::AWSClientAuthRequestBus::Handler::BusDisconnect(); } + AZ::SettingsRegistry::Unregister(m_settingsRegistry.get()); + m_testFolder.reset(); m_settingsRegistry.reset(); m_serializeContext.reset(); @@ -660,8 +664,5 @@ namespace AWSClientAuthUnitTest m_testFolderCreated = true; return path; } - - }; - - + }; } diff --git a/Gems/AWSClientAuth/Code/Tests/Authentication/AWSCognitoAuthenticationProviderTest.cpp b/Gems/AWSClientAuth/Code/Tests/Authentication/AWSCognitoAuthenticationProviderTest.cpp index 328f77b28f..99a8c867d7 100644 --- a/Gems/AWSClientAuth/Code/Tests/Authentication/AWSCognitoAuthenticationProviderTest.cpp +++ b/Gems/AWSClientAuth/Code/Tests/Authentication/AWSCognitoAuthenticationProviderTest.cpp @@ -31,7 +31,7 @@ class AWSCognitoAuthenticationProviderTest { AWSClientAuthUnitTest::AWSClientAuthGemAllocatorFixture::SetUp(); - m_cognitoAuthenticationProviderMock.Initialize(m_settingsRegistry); + m_cognitoAuthenticationProviderMock.Initialize(); AWSCore::AWSCoreRequestBus::Handler::BusConnect(); @@ -98,7 +98,7 @@ TEST_F(AWSCognitoAuthenticationProviderTest, Initialize_Success) { EXPECT_CALL(m_awsResourceMappingRequestBusMock, GetResourceNameId(testing::_)).Times(1); AWSClientAuthUnitTest::AWSCognitoAuthenticationProviderrLocalMock mock; - ASSERT_TRUE(mock.Initialize(m_settingsRegistry)); + ASSERT_TRUE(mock.Initialize()); ASSERT_EQ(mock.m_cognitoAppClientId, AWSClientAuthUnitTest::TEST_RESOURCE_NAME_ID); } @@ -260,5 +260,5 @@ TEST_F(AWSCognitoAuthenticationProviderTest, Initialize_Fail_EmptyResourceName) { AWSClientAuthUnitTest::AWSCognitoAuthenticationProviderrLocalMock mock; EXPECT_CALL(m_awsResourceMappingRequestBusMock, GetResourceNameId(testing::_)).Times(1).WillOnce(testing::Return("")); - ASSERT_FALSE(mock.Initialize(m_settingsRegistry)); + ASSERT_FALSE(mock.Initialize()); } diff --git a/Gems/AWSClientAuth/Code/Tests/Authentication/AuthenticationProviderManagerScriptCanvasBusTest.cpp b/Gems/AWSClientAuth/Code/Tests/Authentication/AuthenticationProviderManagerScriptCanvasBusTest.cpp index fb233aeb5d..736b0a299d 100644 --- a/Gems/AWSClientAuth/Code/Tests/Authentication/AuthenticationProviderManagerScriptCanvasBusTest.cpp +++ b/Gems/AWSClientAuth/Code/Tests/Authentication/AuthenticationProviderManagerScriptCanvasBusTest.cpp @@ -28,7 +28,8 @@ protected: AWSClientAuth::LWAProviderSetting::Reflect(*m_serializeContext); AWSClientAuth::GoogleProviderSetting::Reflect(*m_serializeContext); - m_settingspath = AZStd::string::format("%s/%s/authenticationProvider.setreg", + AZStd::string settingspath = AZStd::string::format( + "%s/%s/authenticationProvider.setreg", m_testFolder->c_str(), AZ::SettingsRegistryInterface::RegistryFolder); CreateTestFile("authenticationProvider.setreg" , R"({ @@ -54,6 +55,7 @@ protected: } } })"); + m_settingsRegistry->MergeSettingsFile(settingspath, AZ::SettingsRegistryInterface::Format::JsonMergePatch, {}); m_mockController = AZStd::make_unique>(); } @@ -66,20 +68,19 @@ protected: public: AZStd::unique_ptr> m_mockController; - AZStd::string m_settingspath; AZStd::vector m_enabledProviderNames { AWSClientAuth::ProvideNameEnumStringAWSCognitoIDP, AWSClientAuth::ProvideNameEnumStringLoginWithAmazon, AWSClientAuth::ProvideNameEnumStringGoogle}; }; TEST_F(AuthenticationProviderManagerScriptCanvasTest, Initialize_Success) { - ASSERT_TRUE(m_mockController->Initialize(m_enabledProviderNames, m_settingspath)); + ASSERT_TRUE(m_mockController->Initialize(m_enabledProviderNames)); ASSERT_TRUE(m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP] != nullptr); } TEST_F(AuthenticationProviderManagerScriptCanvasTest, PasswordGrantSingleFactorSignInAsync_Success) { - m_mockController->Initialize(m_enabledProviderNames, m_settingspath); + m_mockController->Initialize(m_enabledProviderNames); testing::NiceMock *cognitoProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP].get(); EXPECT_CALL(*cognitoProviderMock, PasswordGrantSingleFactorSignInAsync(testing::_, testing::_)).Times(1); @@ -96,7 +97,7 @@ TEST_F(AuthenticationProviderManagerScriptCanvasTest, PasswordGrantSingleFactorS TEST_F(AuthenticationProviderManagerScriptCanvasTest, PasswordGrantMultiFactorSignInAsync_Success) { - m_mockController->Initialize(m_enabledProviderNames, m_settingspath); + m_mockController->Initialize(m_enabledProviderNames); testing::NiceMock* cognitoProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP].get(); testing::NiceMock* lwaProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::LoginWithAmazon].get(); @@ -111,7 +112,7 @@ TEST_F(AuthenticationProviderManagerScriptCanvasTest, PasswordGrantMultiFactorSi TEST_F(AuthenticationProviderManagerScriptCanvasTest, PasswordGrantMultiFactorConfirmSignInAsync_Success) { - m_mockController->Initialize(m_enabledProviderNames, m_settingspath); + m_mockController->Initialize(m_enabledProviderNames); testing::NiceMock *cognitoProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP].get(); testing::NiceMock *lwaProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::LoginWithAmazon].get(); @@ -126,7 +127,7 @@ TEST_F(AuthenticationProviderManagerScriptCanvasTest, PasswordGrantMultiFactorCo TEST_F(AuthenticationProviderManagerScriptCanvasTest, DeviceCodeGrantSignInAsync_Success) { - m_mockController->Initialize(m_enabledProviderNames, m_settingspath); + m_mockController->Initialize(m_enabledProviderNames); testing::NiceMock* cognitoProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP].get(); testing::NiceMock* lwaProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::LoginWithAmazon].get(); @@ -142,7 +143,7 @@ TEST_F(AuthenticationProviderManagerScriptCanvasTest, DeviceCodeGrantSignInAsync TEST_F(AuthenticationProviderManagerScriptCanvasTest, DeviceCodeGrantConfirmSignInAsync_Success) { - m_mockController->Initialize(m_enabledProviderNames, m_settingspath); + m_mockController->Initialize(m_enabledProviderNames); testing::NiceMock* cognitoProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP].get(); testing::NiceMock* lwaProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::LoginWithAmazon].get(); @@ -157,7 +158,7 @@ TEST_F(AuthenticationProviderManagerScriptCanvasTest, DeviceCodeGrantConfirmSign TEST_F(AuthenticationProviderManagerScriptCanvasTest, RefreshTokenAsync_Success) { - m_mockController->Initialize(m_enabledProviderNames, m_settingspath); + m_mockController->Initialize(m_enabledProviderNames); testing::NiceMock *cognitoProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP].get(); testing::NiceMock *lwaProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::LoginWithAmazon].get(); @@ -172,7 +173,7 @@ TEST_F(AuthenticationProviderManagerScriptCanvasTest, RefreshTokenAsync_Success) TEST_F(AuthenticationProviderManagerScriptCanvasTest, GetTokensWithRefreshAsync_ValidToken_Success) { - m_mockController->Initialize(m_enabledProviderNames, m_settingspath); + m_mockController->Initialize(m_enabledProviderNames); testing::NiceMock* cognitoProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP].get(); AWSClientAuth::AuthenticationTokens tokens( @@ -188,7 +189,7 @@ TEST_F(AuthenticationProviderManagerScriptCanvasTest, GetTokensWithRefreshAsync_ TEST_F(AuthenticationProviderManagerScriptCanvasTest, GetTokensWithRefreshAsync_InvalidToken_Success) { - m_mockController->Initialize(m_enabledProviderNames, m_settingspath); + m_mockController->Initialize(m_enabledProviderNames); testing::NiceMock* cognitoProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP].get(); AWSClientAuth::AuthenticationTokens tokens; EXPECT_CALL(*cognitoProviderMock, GetAuthenticationTokens()).Times(1).WillOnce(testing::Return(tokens)); @@ -209,7 +210,7 @@ TEST_F(AuthenticationProviderManagerScriptCanvasTest, GetTokensWithRefreshAsync_ TEST_F(AuthenticationProviderManagerScriptCanvasTest, GetTokens_Success) { - m_mockController->Initialize(m_enabledProviderNames, m_settingspath); + m_mockController->Initialize(m_enabledProviderNames); testing::NiceMock* cognitoProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP].get(); AWSClientAuth::AuthenticationTokens tokens( @@ -224,7 +225,7 @@ TEST_F(AuthenticationProviderManagerScriptCanvasTest, GetTokens_Success) TEST_F(AuthenticationProviderManagerScriptCanvasTest, IsSignedIn_Success) { - m_mockController->Initialize(m_enabledProviderNames, m_settingspath); + m_mockController->Initialize(m_enabledProviderNames); testing::NiceMock* cognitoProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP].get(); AWSClientAuth::AuthenticationTokens tokens( @@ -238,7 +239,7 @@ TEST_F(AuthenticationProviderManagerScriptCanvasTest, IsSignedIn_Success) TEST_F(AuthenticationProviderManagerScriptCanvasTest, SignOut_Success) { - m_mockController->Initialize(m_enabledProviderNames, m_settingspath); + m_mockController->Initialize(m_enabledProviderNames); testing::NiceMock* googleProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::Google].get(); EXPECT_CALL(*googleProviderMock, SignOut()).Times(1); @@ -248,9 +249,3 @@ TEST_F(AuthenticationProviderManagerScriptCanvasTest, SignOut_Success) googleProviderMock = nullptr; } -TEST_F(AuthenticationProviderManagerScriptCanvasTest, Initialize_Fail_InvalidPath) -{ - AZ_TEST_START_TRACE_SUPPRESSION; - ASSERT_FALSE(m_mockController->Initialize(m_enabledProviderNames, "")); - AZ_TEST_STOP_TRACE_SUPPRESSION(2); -} diff --git a/Gems/AWSClientAuth/Code/Tests/Authentication/AuthenticationProviderManagerTest.cpp b/Gems/AWSClientAuth/Code/Tests/Authentication/AuthenticationProviderManagerTest.cpp index 362efaf025..747ea1efda 100644 --- a/Gems/AWSClientAuth/Code/Tests/Authentication/AuthenticationProviderManagerTest.cpp +++ b/Gems/AWSClientAuth/Code/Tests/Authentication/AuthenticationProviderManagerTest.cpp @@ -27,7 +27,8 @@ protected: AWSClientAuth::LWAProviderSetting::Reflect(*m_serializeContext); AWSClientAuth::GoogleProviderSetting::Reflect(*m_serializeContext); - m_settingspath = AZStd::string::format("%s/%s/authenticationProvider.setreg", + AZStd::string settingspath = AZStd::string::format( + "%s/%s/authenticationProvider.setreg", m_testFolder->c_str(), AZ::SettingsRegistryInterface::RegistryFolder); CreateTestFile("authenticationProvider.setreg" , R"({ @@ -53,6 +54,7 @@ protected: } } })"); + m_settingsRegistry->MergeSettingsFile(settingspath, AZ::SettingsRegistryInterface::Format::JsonMergePatch, {}); m_mockController = AZStd::make_unique>(); } @@ -65,20 +67,19 @@ protected: public: AZStd::unique_ptr> m_mockController; - AZStd::string m_settingspath; AZStd::vector m_enabledProviderNames {AWSClientAuth::ProviderNameEnum::AWSCognitoIDP, AWSClientAuth::ProviderNameEnum::LoginWithAmazon, AWSClientAuth::ProviderNameEnum::Google}; }; TEST_F(AuthenticationProviderManagerTest, Initialize_Success) { - ASSERT_TRUE(m_mockController->Initialize(m_enabledProviderNames, m_settingspath)); + ASSERT_TRUE(m_mockController->Initialize(m_enabledProviderNames)); ASSERT_TRUE(m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP] != nullptr); } TEST_F(AuthenticationProviderManagerTest, PasswordGrantSingleFactorSignInAsync_Success) { - m_mockController->Initialize(m_enabledProviderNames, m_settingspath); + m_mockController->Initialize(m_enabledProviderNames); testing::NiceMock *cognitoProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP].get(); EXPECT_CALL(*cognitoProviderMock, PasswordGrantSingleFactorSignInAsync(testing::_, testing::_)).Times(1); @@ -95,7 +96,7 @@ TEST_F(AuthenticationProviderManagerTest, PasswordGrantSingleFactorSignInAsync_F TEST_F(AuthenticationProviderManagerTest, PasswordGrantMultiFactorSignInAsync_Success) { - m_mockController->Initialize(m_enabledProviderNames, m_settingspath); + m_mockController->Initialize(m_enabledProviderNames); testing::NiceMock* cognitoProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP].get(); testing::NiceMock* lwaProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::LoginWithAmazon].get(); @@ -110,7 +111,7 @@ TEST_F(AuthenticationProviderManagerTest, PasswordGrantMultiFactorSignInAsync_Su TEST_F(AuthenticationProviderManagerTest, PasswordGrantMultiFactorConfirmSignInAsync_Success) { - m_mockController->Initialize(m_enabledProviderNames, m_settingspath); + m_mockController->Initialize(m_enabledProviderNames); testing::NiceMock *cognitoProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP].get(); testing::NiceMock *lwaProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::LoginWithAmazon].get(); @@ -125,7 +126,7 @@ TEST_F(AuthenticationProviderManagerTest, PasswordGrantMultiFactorConfirmSignInA TEST_F(AuthenticationProviderManagerTest, DeviceCodeGrantSignInAsync_Success) { - m_mockController->Initialize(m_enabledProviderNames, m_settingspath); + m_mockController->Initialize(m_enabledProviderNames); testing::NiceMock* cognitoProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP].get(); testing::NiceMock* lwaProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::LoginWithAmazon].get(); @@ -141,7 +142,7 @@ TEST_F(AuthenticationProviderManagerTest, DeviceCodeGrantSignInAsync_Success) TEST_F(AuthenticationProviderManagerTest, DeviceCodeGrantConfirmSignInAsync_Success) { - m_mockController->Initialize(m_enabledProviderNames, m_settingspath); + m_mockController->Initialize(m_enabledProviderNames); testing::NiceMock* cognitoProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP].get(); testing::NiceMock* lwaProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::LoginWithAmazon].get(); @@ -156,7 +157,7 @@ TEST_F(AuthenticationProviderManagerTest, DeviceCodeGrantConfirmSignInAsync_Succ TEST_F(AuthenticationProviderManagerTest, RefreshTokenAsync_Success) { - m_mockController->Initialize(m_enabledProviderNames, m_settingspath); + m_mockController->Initialize(m_enabledProviderNames); testing::NiceMock *cognitoProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP].get(); testing::NiceMock *lwaProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::LoginWithAmazon].get(); @@ -171,7 +172,7 @@ TEST_F(AuthenticationProviderManagerTest, RefreshTokenAsync_Success) TEST_F(AuthenticationProviderManagerTest, GetTokensWithRefreshAsync_ValidToken_Success) { - m_mockController->Initialize(m_enabledProviderNames, m_settingspath); + m_mockController->Initialize(m_enabledProviderNames); testing::NiceMock* cognitoProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP].get(); AWSClientAuth::AuthenticationTokens tokens( @@ -187,7 +188,7 @@ TEST_F(AuthenticationProviderManagerTest, GetTokensWithRefreshAsync_ValidToken_S TEST_F(AuthenticationProviderManagerTest, GetTokensWithRefreshAsync_InvalidToken_Success) { - m_mockController->Initialize(m_enabledProviderNames, m_settingspath); + m_mockController->Initialize(m_enabledProviderNames); testing::NiceMock* cognitoProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP].get(); AWSClientAuth::AuthenticationTokens tokens; EXPECT_CALL(*cognitoProviderMock, GetAuthenticationTokens()).Times(1).WillOnce(testing::Return(tokens)); @@ -208,7 +209,7 @@ TEST_F(AuthenticationProviderManagerTest, GetTokensWithRefreshAsync_NotInitializ TEST_F(AuthenticationProviderManagerTest, GetTokens_Success) { - m_mockController->Initialize(m_enabledProviderNames, m_settingspath); + m_mockController->Initialize(m_enabledProviderNames); testing::NiceMock* cognitoProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP].get(); AWSClientAuth::AuthenticationTokens tokens( @@ -223,7 +224,7 @@ TEST_F(AuthenticationProviderManagerTest, GetTokens_Success) TEST_F(AuthenticationProviderManagerTest, IsSignedIn_Success) { - m_mockController->Initialize(m_enabledProviderNames, m_settingspath); + m_mockController->Initialize(m_enabledProviderNames); testing::NiceMock* cognitoProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP].get(); AWSClientAuth::AuthenticationTokens tokens( @@ -237,7 +238,7 @@ TEST_F(AuthenticationProviderManagerTest, IsSignedIn_Success) TEST_F(AuthenticationProviderManagerTest, SignOut_Success) { - m_mockController->Initialize(m_enabledProviderNames, m_settingspath); + m_mockController->Initialize(m_enabledProviderNames); testing::NiceMock* googleProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::Google].get(); EXPECT_CALL(*googleProviderMock, SignOut()).Times(1); @@ -247,9 +248,3 @@ TEST_F(AuthenticationProviderManagerTest, SignOut_Success) googleProviderMock = nullptr; } -TEST_F(AuthenticationProviderManagerTest, Initialize_Fail_InvalidPath) -{ - AZ_TEST_START_TRACE_SUPPRESSION; - ASSERT_FALSE(m_mockController->Initialize(m_enabledProviderNames, "")); - AZ_TEST_STOP_TRACE_SUPPRESSION(2); -} diff --git a/Gems/AWSClientAuth/Code/Tests/Authentication/GoogleAuthenticationProviderTest.cpp b/Gems/AWSClientAuth/Code/Tests/Authentication/GoogleAuthenticationProviderTest.cpp index f8b8399118..06aa7eeec8 100644 --- a/Gems/AWSClientAuth/Code/Tests/Authentication/GoogleAuthenticationProviderTest.cpp +++ b/Gems/AWSClientAuth/Code/Tests/Authentication/GoogleAuthenticationProviderTest.cpp @@ -47,7 +47,7 @@ class GoogleAuthenticationProviderTest })"); m_settingsRegistry->MergeSettingsFile(path, AZ::SettingsRegistryInterface::Format::JsonMergePatch, {}); - m_googleAuthenticationProviderLocalMock.Initialize(m_settingsRegistry); + m_googleAuthenticationProviderLocalMock.Initialize(); } void TearDown() override @@ -63,7 +63,7 @@ public: TEST_F(GoogleAuthenticationProviderTest, Initialize_Success) { AWSClientAuthUnitTest::GoogleAuthenticationProviderLocalMock mock; - ASSERT_TRUE(mock.Initialize(m_settingsRegistry)); + ASSERT_TRUE(mock.Initialize()); ASSERT_EQ(mock.m_settings->m_appClientId, "TestGoogleClientId"); } @@ -117,14 +117,19 @@ TEST_F(GoogleAuthenticationProviderTest, RefreshTokensAsync_Fail_RequestHttpErro TEST_F(GoogleAuthenticationProviderTest, Initialize_Fail_EmptyRegistry) { + AZ::SettingsRegistry::Unregister(m_settingsRegistry.get()); + AZStd::shared_ptr registry = AZStd::make_shared(); registry->SetContext(m_serializeContext.get()); + AZ::SettingsRegistry::Register(registry.get()); AWSClientAuthUnitTest::GoogleAuthenticationProviderLocalMock mock; - ASSERT_FALSE(mock.Initialize(registry)); + ASSERT_FALSE(mock.Initialize()); ASSERT_EQ(mock.m_settings->m_appClientId, ""); + AZ::SettingsRegistry::Unregister(registry.get()); registry.reset(); // Restore - mock.Initialize(m_settingsRegistry); + AZ::SettingsRegistry::Register(m_settingsRegistry.get()); + mock.Initialize(); } diff --git a/Gems/AWSClientAuth/Code/Tests/Authentication/LWAAuthenticationProviderTest.cpp b/Gems/AWSClientAuth/Code/Tests/Authentication/LWAAuthenticationProviderTest.cpp index cbbec30cb7..21f23bf627 100644 --- a/Gems/AWSClientAuth/Code/Tests/Authentication/LWAAuthenticationProviderTest.cpp +++ b/Gems/AWSClientAuth/Code/Tests/Authentication/LWAAuthenticationProviderTest.cpp @@ -47,7 +47,7 @@ class LWAAuthenticationProviderTest })"); m_settingsRegistry->MergeSettingsFile(path, AZ::SettingsRegistryInterface::Format::JsonMergePatch, {}); - m_lwaAuthenticationProviderLocalMock.Initialize(m_settingsRegistry); + m_lwaAuthenticationProviderLocalMock.Initialize(); } void TearDown() override @@ -63,7 +63,7 @@ public: TEST_F(LWAAuthenticationProviderTest, Initialize_Success) { AWSClientAuthUnitTest::LWAAuthenticationProviderLocalMock mock; - ASSERT_TRUE(mock.Initialize(m_settingsRegistry)); + ASSERT_TRUE(mock.Initialize()); ASSERT_EQ(mock.m_settings->m_appClientId, "TestLWAClientId"); } @@ -117,14 +117,19 @@ TEST_F(LWAAuthenticationProviderTest, RefreshTokensAsync_Fail_RequestHttpError) TEST_F(LWAAuthenticationProviderTest, Initialize_Fail_EmptyRegistry) { + AZ::SettingsRegistry::Unregister(m_settingsRegistry.get()); + AZStd::shared_ptr registry = AZStd::make_shared(); registry->SetContext(m_serializeContext.get()); + AZ::SettingsRegistry::Register(registry.get()); AWSClientAuthUnitTest::LWAAuthenticationProviderLocalMock mock; - ASSERT_FALSE(mock.Initialize(registry)); + ASSERT_FALSE(mock.Initialize()); ASSERT_EQ(mock.m_settings->m_appClientId, ""); + AZ::SettingsRegistry::Unregister(registry.get()); registry.reset(); // Restore - mock.Initialize(m_settingsRegistry); + AZ::SettingsRegistry::Register(m_settingsRegistry.get()); + mock.Initialize(); } diff --git a/Gems/AWSCore/Code/Include/Private/Configuration/AWSCoreConfiguration.h b/Gems/AWSCore/Code/Include/Private/Configuration/AWSCoreConfiguration.h index 42b828f450..14c4da33ba 100644 --- a/Gems/AWSCore/Code/Include/Private/Configuration/AWSCoreConfiguration.h +++ b/Gems/AWSCore/Code/Include/Private/Configuration/AWSCoreConfiguration.h @@ -7,7 +7,6 @@ #pragma once -#include #include #include @@ -35,8 +34,10 @@ namespace AWSCore "Failed to get profile name, return default value instead."; static constexpr const char ResourceMappingFileNameNotFoundErrorMessage[] = "Failed to get resource mapping config file name, return empty value instead."; - static constexpr const char SettingsRegistryLoadFailureErrorMessage[] = + static constexpr const char SettingsRegistryFileLoadFailureErrorMessage[] = "Failed to load AWSCore settings registry file."; + static constexpr const char GlobalSettingsRegistryLoadFailureErrorMessage[] = + "Failed to load AWSCore configurations from global settings registry."; AWSCoreConfiguration(); @@ -53,9 +54,6 @@ namespace AWSCore void ReloadConfiguration() override; private: - // Initialize settings registry reference by loading for project .setreg file - void InitSettingsRegistry(); - // Initialize source project folder path void InitSourceProjectFolderPath(); @@ -66,7 +64,6 @@ namespace AWSCore void ResetSettingsRegistryData(); AZStd::string m_sourceProjectFolder; - AZ::SettingsRegistryImpl m_settingsRegistry; AZStd::string m_profileName; AZStd::string m_resourceMappingConfigFileName; }; diff --git a/Gems/AWSCore/Code/Source/Configuration/AWSCoreConfiguration.cpp b/Gems/AWSCore/Code/Source/Configuration/AWSCoreConfiguration.cpp index c6863e6f3d..4b5ce59517 100644 --- a/Gems/AWSCore/Code/Source/Configuration/AWSCoreConfiguration.cpp +++ b/Gems/AWSCore/Code/Source/Configuration/AWSCoreConfiguration.cpp @@ -6,6 +6,8 @@ */ #include +#include +#include #include #include @@ -69,27 +71,6 @@ namespace AWSCore void AWSCoreConfiguration::InitConfig() { InitSourceProjectFolderPath(); - InitSettingsRegistry(); - } - - void AWSCoreConfiguration::InitSettingsRegistry() - { - if (m_sourceProjectFolder.empty()) - { - AZ_Warning(AWSCoreConfigurationName, false, ProjectSourceFolderNotFoundErrorMessage); - return; - } - - AZStd::string settingsRegistryPath = AZStd::string::format("%s/%s/%s", - m_sourceProjectFolder.c_str(), AZ::SettingsRegistryInterface::RegistryFolder, AWSCoreConfiguration::AWSCoreConfigurationFileName); - AzFramework::StringFunc::Path::Normalize(settingsRegistryPath); - - if (!m_settingsRegistry.MergeSettingsFile(settingsRegistryPath, AZ::SettingsRegistryInterface::Format::JsonMergePatch, "")) - { - AZ_Warning(AWSCoreConfigurationName, false, SettingsRegistryLoadFailureErrorMessage); - return; - } - ParseSettingsRegistryValues(); } @@ -108,10 +89,17 @@ namespace AWSCore void AWSCoreConfiguration::ParseSettingsRegistryValues() { + AZ::SettingsRegistryInterface* settingsRegistry = AZ::SettingsRegistry::Get(); + if (!settingsRegistry) + { + AZ_Warning(AWSCoreConfigurationName, false, GlobalSettingsRegistryLoadFailureErrorMessage); + return; + } + m_resourceMappingConfigFileName.clear(); auto resourceMappingConfigFileNamePath = AZStd::string::format("%s%s", AZ::SettingsRegistryMergeUtils::OrganizationRootKey, AWSCoreResourceMappingConfigFileNameKey); - if (!m_settingsRegistry.Get(m_resourceMappingConfigFileName, resourceMappingConfigFileNamePath)) + if (!settingsRegistry->Get(m_resourceMappingConfigFileName, resourceMappingConfigFileNamePath)) { AZ_Warning(AWSCoreConfigurationName, false, ResourceMappingFileNameNotFoundErrorMessage); } @@ -119,7 +107,7 @@ namespace AWSCore m_profileName.clear(); auto profileNamePath = AZStd::string::format( "%s%s", AZ::SettingsRegistryMergeUtils::OrganizationRootKey, AWSCoreProfileNameKey); - if (!m_settingsRegistry.Get(m_profileName, profileNamePath)) + if (!settingsRegistry->Get(m_profileName, profileNamePath)) { AZ_Warning(AWSCoreConfigurationName, false, ProfileNameNotFoundErrorMessage); m_profileName = AWSCoreDefaultProfileName; @@ -128,20 +116,43 @@ namespace AWSCore void AWSCoreConfiguration::ResetSettingsRegistryData() { + AZ::SettingsRegistryInterface* settingsRegistry = AZ::SettingsRegistry::Get(); + if (!settingsRegistry) + { + AZ_Warning(AWSCoreConfigurationName, false, GlobalSettingsRegistryLoadFailureErrorMessage); + return; + } + auto profileNamePath = AZStd::string::format("%s%s", AZ::SettingsRegistryMergeUtils::OrganizationRootKey, AWSCoreProfileNameKey); - m_settingsRegistry.Remove(profileNamePath); + settingsRegistry->Remove(profileNamePath); m_profileName = AWSCoreDefaultProfileName; auto resourceMappingConfigFileNamePath = AZStd::string::format("%s%s", AZ::SettingsRegistryMergeUtils::OrganizationRootKey, AWSCoreResourceMappingConfigFileNameKey); - m_settingsRegistry.Remove(resourceMappingConfigFileNamePath); + settingsRegistry->Remove(resourceMappingConfigFileNamePath); m_resourceMappingConfigFileName.clear(); + + // Reload the AWSCore setting registry file from disk. + if (m_sourceProjectFolder.empty()) + { + AZ_Warning(AWSCoreConfigurationName, false, SettingsRegistryFileLoadFailureErrorMessage); + return; + } + + auto settingsRegistryPath = AZ::IO::FixedMaxPath(AZStd::string_view{ m_sourceProjectFolder }) / + AZ::SettingsRegistryInterface::RegistryFolder / + AWSCoreConfiguration::AWSCoreConfigurationFileName; + if (!settingsRegistry->MergeSettingsFile(settingsRegistryPath.c_str(), AZ::SettingsRegistryInterface::Format::JsonMergePatch, "")) + { + AZ_Warning(AWSCoreConfigurationName, false, SettingsRegistryFileLoadFailureErrorMessage); + return; + } } void AWSCoreConfiguration::ReloadConfiguration() { ResetSettingsRegistryData(); - InitSettingsRegistry(); + ParseSettingsRegistryValues(); } } // namespace AWSCore diff --git a/Gems/AWSCore/Code/Source/Editor/Attribution/AWSCoreAttributionManager.cpp b/Gems/AWSCore/Code/Source/Editor/Attribution/AWSCoreAttributionManager.cpp index f2ff7ed816..8f0c07edb5 100644 --- a/Gems/AWSCore/Code/Source/Editor/Attribution/AWSCoreAttributionManager.cpp +++ b/Gems/AWSCore/Code/Source/Editor/Attribution/AWSCoreAttributionManager.cpp @@ -38,9 +38,8 @@ namespace AWSCore constexpr char AWSAttributionDelaySecondsKey[] = "/Amazon/AWS/Preferences/AWSAttributionDelaySeconds"; constexpr char AWSAttributionLastTimeStampKey[] = "/Amazon/AWS/Preferences/AWSAttributionLastTimeStamp"; constexpr char AWSAttributionConsentShownKey[] = "/Amazon/AWS/Preferences/AWSAttributionConsentShown"; - constexpr char AWSAttributionApiId[] = "2zxvvmv8d7"; - constexpr char AWSAttributionChinaApiId[] = ""; - constexpr char AWSAttributionApiStage[] = "prod"; + constexpr char AWSAttributionEndpoint[] = "https://o3deattribution.us-east-1.amazonaws.com"; + constexpr char AWSAttributionChinaEndpoint[] = ""; const int AWSAttributionDefaultDelayInDays = 7; AWSAttributionManager::AWSAttributionManager() @@ -253,17 +252,17 @@ namespace AWSCore // Assumption to determine China region is the default profile is set to China region. auto profile_name = Aws::Auth::GetConfigProfileName(); Aws::Client::ClientConfiguration clientConfig(profile_name.c_str()); - AZStd::string apiId = AWSAttributionApiId; if (clientConfig.region == Aws::Region::CN_NORTH_1 || clientConfig.region == Aws::Region::CN_NORTHWEST_1) { config->region = Aws::Region::CN_NORTH_1; - apiId = AWSAttributionChinaApiId; + config->endpointOverride = AWSAttributionChinaEndpoint; + } + else + { + config->region = Aws::Region::US_EAST_1; + config->endpointOverride = AWSAttributionEndpoint; } - - config->region = Aws::Region::US_WEST_2; - config->endpointOverride = - AWSResourceMappingUtils::FormatRESTApiUrl(apiId, config->region.value().c_str(), AWSAttributionApiStage).c_str(); } bool AWSAttributionManager::CheckConsentShown() diff --git a/Gems/AWSCore/Code/Source/ResourceMapping/AWSResourceMappingManager.cpp b/Gems/AWSCore/Code/Source/ResourceMapping/AWSResourceMappingManager.cpp index 48e3ffad70..c58dba227b 100644 --- a/Gems/AWSCore/Code/Source/ResourceMapping/AWSResourceMappingManager.cpp +++ b/Gems/AWSCore/Code/Source/ResourceMapping/AWSResourceMappingManager.cpp @@ -31,7 +31,7 @@ namespace AWSCore void AWSResourceMappingManager::ActivateManager() { - ReloadConfigFile(true); + ReloadConfigFile(); AWSResourceMappingRequestBus::Handler::BusConnect(); } diff --git a/Gems/AWSCore/Code/Tests/AWSCoreSystemComponentTest.cpp b/Gems/AWSCore/Code/Tests/AWSCoreSystemComponentTest.cpp index 52acd7d6f5..c9f7ebfcf7 100644 --- a/Gems/AWSCore/Code/Tests/AWSCoreSystemComponentTest.cpp +++ b/Gems/AWSCore/Code/Tests/AWSCoreSystemComponentTest.cpp @@ -67,10 +67,13 @@ protected: m_serializeContext = AZStd::make_unique(); m_serializeContext->CreateEditContext(); m_behaviorContext = AZStd::make_unique(); + m_componentDescriptor.reset(AWSCoreSystemComponent::CreateDescriptor()); m_componentDescriptor->Reflect(m_serializeContext.get()); m_componentDescriptor->Reflect(m_behaviorContext.get()); + m_settingsRegistry->SetContext(m_serializeContext.get()); + m_entity = aznew AZ::Entity(); m_coreSystemsComponent.reset(m_entity->CreateComponent()); } diff --git a/Gems/AWSCore/Code/Tests/Configuration/AWSCoreConfigurationTest.cpp b/Gems/AWSCore/Code/Tests/Configuration/AWSCoreConfigurationTest.cpp index 371e264f56..be32acedf5 100644 --- a/Gems/AWSCore/Code/Tests/Configuration/AWSCoreConfigurationTest.cpp +++ b/Gems/AWSCore/Code/Tests/Configuration/AWSCoreConfigurationTest.cpp @@ -60,6 +60,8 @@ public: AzFramework::StringFunc::Path::Normalize(m_normalizedSetRegFolderPath); m_localFileIO->SetAlias("@devassets@", m_normalizedSourceProjectFolder.c_str()); + + CreateTestSetRegFile(TEST_VALID_RESOURCE_MAPPING_SETREG); } void TearDown() override @@ -73,11 +75,11 @@ public: } AZStd::unique_ptr m_awsCoreConfiguration; + AZStd::string m_normalizedSetRegFilePath; private: AZStd::string m_normalizedSourceProjectFolder; AZStd::string m_normalizedSetRegFolderPath; - AZStd::string m_normalizedSetRegFilePath; void CreateTestFile(const AZStd::string& filePath, const AZStd::string& fileContent) { @@ -118,17 +120,9 @@ private: TEST_F(AWSCoreConfigurationTest, InitConfig_NoSourceProjectFolderFound_ReturnEmptyConfigFilePath) { + m_settingsRegistry->MergeSettingsFile(m_normalizedSetRegFilePath, AZ::SettingsRegistryInterface::Format::JsonMergePatch, {}); m_localFileIO->ClearAlias("@devassets@"); - AZ_TEST_START_TRACE_SUPPRESSION; - m_awsCoreConfiguration->InitConfig(); - AZ_TEST_STOP_TRACE_SUPPRESSION(1); // expect the above have thrown an AZ_Error - auto actualConfigFilePath = m_awsCoreConfiguration->GetResourceMappingConfigFilePath(); - EXPECT_TRUE(actualConfigFilePath.empty()); -} - -TEST_F(AWSCoreConfigurationTest, InitConfig_NoSettingsRegistryFileFound_ReturnEmptyConfigFilePath) -{ AZ_TEST_START_TRACE_SUPPRESSION; m_awsCoreConfiguration->InitConfig(); AZ_TEST_STOP_TRACE_SUPPRESSION(1); // expect the above have thrown an AZ_Error @@ -140,6 +134,7 @@ TEST_F(AWSCoreConfigurationTest, InitConfig_NoSettingsRegistryFileFound_ReturnEm TEST_F(AWSCoreConfigurationTest, InitConfig_SettingsRegistryIsEmpty_ReturnEmptyConfigFilePath) { CreateTestSetRegFile(TEST_INVALID_RESOURCE_MAPPING_SETREG); + m_settingsRegistry->MergeSettingsFile(m_normalizedSetRegFilePath, AZ::SettingsRegistryInterface::Format::JsonMergePatch, {}); m_awsCoreConfiguration->InitConfig(); auto actualConfigFilePath = m_awsCoreConfiguration->GetResourceMappingConfigFilePath(); @@ -148,7 +143,7 @@ TEST_F(AWSCoreConfigurationTest, InitConfig_SettingsRegistryIsEmpty_ReturnEmptyC TEST_F(AWSCoreConfigurationTest, InitConfig_LoadValidSettingsRegistry_ReturnNonEmptyConfigFilePath) { - CreateTestSetRegFile(TEST_VALID_RESOURCE_MAPPING_SETREG); + m_settingsRegistry->MergeSettingsFile(m_normalizedSetRegFilePath, AZ::SettingsRegistryInterface::Format::JsonMergePatch, {}); m_awsCoreConfiguration->InitConfig(); auto actualConfigFilePath = m_awsCoreConfiguration->GetResourceMappingConfigFilePath(); @@ -157,6 +152,7 @@ TEST_F(AWSCoreConfigurationTest, InitConfig_LoadValidSettingsRegistry_ReturnNonE TEST_F(AWSCoreConfigurationTest, ReloadConfiguration_NoSourceProjectFolderFound_ReturnEmptyConfigFilePath) { + m_settingsRegistry->MergeSettingsFile(m_normalizedSetRegFilePath, AZ::SettingsRegistryInterface::Format::JsonMergePatch, {}); m_localFileIO->ClearAlias("@devassets@"); m_awsCoreConfiguration->ReloadConfiguration(); @@ -167,6 +163,7 @@ TEST_F(AWSCoreConfigurationTest, ReloadConfiguration_NoSourceProjectFolderFound_ TEST_F(AWSCoreConfigurationTest, ReloadConfiguration_LoadValidSettingsRegistryAfterInvalidOne_ReturnNonEmptyConfigFilePath) { CreateTestSetRegFile(TEST_INVALID_RESOURCE_MAPPING_SETREG); + m_settingsRegistry->MergeSettingsFile(m_normalizedSetRegFilePath, AZ::SettingsRegistryInterface::Format::JsonMergePatch, {}); m_awsCoreConfiguration->InitConfig(); auto actualConfigFilePath = m_awsCoreConfiguration->GetResourceMappingConfigFilePath(); @@ -185,7 +182,7 @@ TEST_F(AWSCoreConfigurationTest, ReloadConfiguration_LoadValidSettingsRegistryAf TEST_F(AWSCoreConfigurationTest, ReloadConfiguration_LoadInvalidSettingsRegistryAfterValidOne_ReturnEmptyConfigFilePath) { - CreateTestSetRegFile(TEST_VALID_RESOURCE_MAPPING_SETREG); + m_settingsRegistry->MergeSettingsFile(m_normalizedSetRegFilePath, AZ::SettingsRegistryInterface::Format::JsonMergePatch, {}); m_awsCoreConfiguration->InitConfig(); auto actualConfigFilePath = m_awsCoreConfiguration->GetResourceMappingConfigFilePath(); diff --git a/Gems/AWSCore/Code/Tests/Editor/Attribution/AWSCoreAttributionManagerTest.cpp b/Gems/AWSCore/Code/Tests/Editor/Attribution/AWSCoreAttributionManagerTest.cpp index 4128edc1e2..ef75ac7df3 100644 --- a/Gems/AWSCore/Code/Tests/Editor/Attribution/AWSCoreAttributionManagerTest.cpp +++ b/Gems/AWSCore/Code/Tests/Editor/Attribution/AWSCoreAttributionManagerTest.cpp @@ -14,7 +14,6 @@ #include #include #include -#include #include #include #include @@ -161,7 +160,6 @@ namespace AWSAttributionUnitTest protected: AZStd::shared_ptr m_serializeContext; AZStd::unique_ptr m_registrationContext; - AZStd::shared_ptr m_settingsRegistry; AZStd::unique_ptr m_jobContext; AZStd::unique_ptr m_jobCancelGroup; AZStd::unique_ptr m_jobManager; @@ -186,13 +184,9 @@ namespace AWSAttributionUnitTest AZ::JsonSystemComponent::Reflect(m_registrationContext.get()); - m_settingsRegistry = AZStd::make_unique(); - m_settingsRegistry->SetContext(m_serializeContext.get()); m_settingsRegistry->SetContext(m_registrationContext.get()); - AZ::SettingsRegistry::Register(m_settingsRegistry.get()); - AZ::JobManagerDesc jobManagerDesc; AZ::JobManagerThreadDesc threadDesc; @@ -210,9 +204,6 @@ namespace AWSAttributionUnitTest m_jobCancelGroup.reset(); m_jobManager.reset(); - AZ::SettingsRegistry::Unregister(m_settingsRegistry.get()); - - m_settingsRegistry.reset(); m_serializeContext.reset(); m_registrationContext.reset(); @@ -427,8 +418,8 @@ namespace AWSAttributionUnitTest manager.SetApiEndpointAndRegion(config); // THEN - ASSERT_TRUE(config->region == Aws::Region::US_WEST_2); - ASSERT_TRUE(config->endpointOverride->find("execute-api.us-west-2.amazonaws.com") != Aws::String::npos); + ASSERT_TRUE(config->region == Aws::Region::US_EAST_1); + ASSERT_TRUE(config->endpointOverride->find("o3deattribution.us-east-1.amazonaws.com") != Aws::String::npos); delete config; } diff --git a/Gems/AWSCore/Code/Tests/Editor/Attribution/AWSCoreAttributionSystemComponentTest.cpp b/Gems/AWSCore/Code/Tests/Editor/Attribution/AWSCoreAttributionSystemComponentTest.cpp index eaae801776..a790ccf067 100644 --- a/Gems/AWSCore/Code/Tests/Editor/Attribution/AWSCoreAttributionSystemComponentTest.cpp +++ b/Gems/AWSCore/Code/Tests/Editor/Attribution/AWSCoreAttributionSystemComponentTest.cpp @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include @@ -87,13 +86,9 @@ namespace AWSCoreUnitTest m_componentDescriptor->Reflect(m_serializeContext.get()); m_componentDescriptor->Reflect(m_behaviorContext.get()); - m_settingsRegistry = AZStd::make_unique(); - m_settingsRegistry->SetContext(m_serializeContext.get()); m_settingsRegistry->SetContext(m_registrationContext.get()); - AZ::SettingsRegistry::Register(m_settingsRegistry.get()); - m_entity = aznew AZ::Entity(); m_awsCoreSystemComponentMock = aznew testing::NiceMock(); m_entity->AddComponent(m_awsCoreSystemComponentMock); @@ -113,7 +108,6 @@ namespace AWSCoreUnitTest m_awsCoreComponentDescriptor.reset(); m_componentDescriptor.reset(); m_behaviorContext.reset(); - m_settingsRegistry.reset(); m_registrationContext.reset(); m_serializeContext.reset(); AWSCoreFixture::TearDown(); @@ -130,7 +124,6 @@ namespace AWSCoreUnitTest AZStd::unique_ptr m_registrationContext; AZStd::unique_ptr m_componentDescriptor; AZStd::unique_ptr m_awsCoreComponentDescriptor; - AZStd::shared_ptr m_settingsRegistry; }; TEST_F(AWSAttributionSystemComponentTest, SystemComponentInitActivate_Success) diff --git a/Gems/AWSCore/Code/Tests/ResourceMapping/AWSResourceMappingManagerTest.cpp b/Gems/AWSCore/Code/Tests/ResourceMapping/AWSResourceMappingManagerTest.cpp index 424a5e2048..ca43724a1d 100644 --- a/Gems/AWSCore/Code/Tests/ResourceMapping/AWSResourceMappingManagerTest.cpp +++ b/Gems/AWSCore/Code/Tests/ResourceMapping/AWSResourceMappingManagerTest.cpp @@ -171,7 +171,7 @@ TEST_F(AWSResourceMappingManagerTest, ActivateManager_ParseInvalidConfigFile_Con AZStd::string actualRegion; AWSResourceMappingRequestBus::BroadcastResult(actualAccountId, &AWSResourceMappingRequests::GetDefaultAccountId); AWSResourceMappingRequestBus::BroadcastResult(actualRegion, &AWSResourceMappingRequests::GetDefaultRegion); - EXPECT_EQ(m_reloadConfigurationCounter, 1); + EXPECT_EQ(m_reloadConfigurationCounter, 0); EXPECT_TRUE(actualAccountId.empty()); EXPECT_TRUE(actualRegion.empty()); EXPECT_TRUE(m_resourceMappingManager->GetStatus() == AWSResourceMappingManager::Status::Error); @@ -186,7 +186,7 @@ TEST_F(AWSResourceMappingManagerTest, ActivateManager_ParseValidConfigFile_Confi AZStd::string actualRegion; AWSResourceMappingRequestBus::BroadcastResult(actualAccountId, &AWSResourceMappingRequests::GetDefaultAccountId); AWSResourceMappingRequestBus::BroadcastResult(actualRegion, &AWSResourceMappingRequests::GetDefaultRegion); - EXPECT_EQ(m_reloadConfigurationCounter, 1); + EXPECT_EQ(m_reloadConfigurationCounter, 0); EXPECT_FALSE(actualAccountId.empty()); EXPECT_FALSE(actualRegion.empty()); EXPECT_TRUE(m_resourceMappingManager->GetStatus() == AWSResourceMappingManager::Status::Ready); @@ -413,7 +413,7 @@ TEST_F(AWSResourceMappingManagerTest, ReloadConfigFile_ParseValidConfigFileAfter AZStd::string actualRegion; AWSResourceMappingRequestBus::BroadcastResult(actualAccountId, &AWSResourceMappingRequests::GetDefaultAccountId); AWSResourceMappingRequestBus::BroadcastResult(actualRegion, &AWSResourceMappingRequests::GetDefaultRegion); - EXPECT_EQ(m_reloadConfigurationCounter, 1); + EXPECT_EQ(m_reloadConfigurationCounter, 0); EXPECT_TRUE(actualAccountId.empty()); EXPECT_TRUE(actualRegion.empty()); EXPECT_TRUE(m_resourceMappingManager->GetStatus() == AWSResourceMappingManager::Status::Error); @@ -423,7 +423,7 @@ TEST_F(AWSResourceMappingManagerTest, ReloadConfigFile_ParseValidConfigFileAfter AWSResourceMappingRequestBus::BroadcastResult(actualAccountId, &AWSResourceMappingRequests::GetDefaultAccountId); AWSResourceMappingRequestBus::BroadcastResult(actualRegion, &AWSResourceMappingRequests::GetDefaultRegion); - EXPECT_EQ(m_reloadConfigurationCounter, 1); + EXPECT_EQ(m_reloadConfigurationCounter, 0); EXPECT_FALSE(actualAccountId.empty()); EXPECT_FALSE(actualRegion.empty()); EXPECT_TRUE(m_resourceMappingManager->GetStatus() == AWSResourceMappingManager::Status::Ready); diff --git a/Gems/AWSCore/Code/Tests/TestFramework/AWSCoreFixture.h b/Gems/AWSCore/Code/Tests/TestFramework/AWSCoreFixture.h index 78d377711b..a6ebe9ab31 100644 --- a/Gems/AWSCore/Code/Tests/TestFramework/AWSCoreFixture.h +++ b/Gems/AWSCore/Code/Tests/TestFramework/AWSCoreFixture.h @@ -9,6 +9,7 @@ #include #include +#include #include #include @@ -117,10 +118,16 @@ public: m_otherFileIO = AZ::IO::FileIOBase::GetInstance(); AZ::IO::FileIOBase::SetInstance(nullptr); AZ::IO::FileIOBase::SetInstance(m_localFileIO); + + m_settingsRegistry = AZStd::make_unique(); + AZ::SettingsRegistry::Register(m_settingsRegistry.get()); } void TearDown() override { + AZ::SettingsRegistry::Unregister(m_settingsRegistry.get()); + m_settingsRegistry.reset(); + AZ::IO::FileIOBase::SetInstance(nullptr); if (m_otherFileIO) @@ -160,4 +167,7 @@ public: private: AZ::IO::FileIOBase* m_otherFileIO = nullptr; + +protected: + AZStd::unique_ptr m_settingsRegistry; }; diff --git a/Gems/AWSMetrics/Code/Include/Private/ClientConfiguration.h b/Gems/AWSMetrics/Code/Include/Private/ClientConfiguration.h index 239d01b56c..835f44aca8 100644 --- a/Gems/AWSMetrics/Code/Include/Private/ClientConfiguration.h +++ b/Gems/AWSMetrics/Code/Include/Private/ClientConfiguration.h @@ -17,12 +17,16 @@ namespace AWSMetrics class ClientConfiguration { public: + static constexpr const char AWSMetricsMaxQueueSizeInMbKey[] = "/Gems/AWSMetrics/MaxQueueSizeInMb"; + static constexpr const char AWSMetricsQueueFlushPeriodInSecondsKey[] = "/Gems/AWSMetrics/QueueFlushPeriodInSeconds"; + static constexpr const char AWSMetricsOfflineRecordingEnabledKey[] = "/Gems/AWSMetrics/OfflineRecording"; + static constexpr const char AWSMetricsMaxNumRetriesKey[] = "/Gems/AWSMetrics/MaxNumRetries"; + ClientConfiguration(); - //! Reset the client settings based on the provided configuration file. - //! @param settingsRegistryPath Full path to the configuration file. + //! Initialize the client settings based on the global setting registry. //! @return whether the operation is successful - bool ResetClientConfiguration(const AZStd::string& settingsRegistryPath); + bool InitClientConfiguration(); //! Retrieve the max queue size setting. //! @return Max queue size in bytes. diff --git a/Gems/AWSMetrics/Code/Include/Private/MetricsManager.h b/Gems/AWSMetrics/Code/Include/Private/MetricsManager.h index 9f110c75e0..1cdb2b8118 100644 --- a/Gems/AWSMetrics/Code/Include/Private/MetricsManager.h +++ b/Gems/AWSMetrics/Code/Include/Private/MetricsManager.h @@ -33,9 +33,8 @@ namespace AWSMetrics ~MetricsManager(); //! Initializing the metrics manager - //! @param settingsRegistryPath Path to the settings registry file. //! @return Whether the operation is successful. - bool Init(const AZStd::string& settingsRegistryPath = ""); + bool Init(); //! Start sending metircs to the backend or a local file. void StartMetrics(); //! Stop sending metircs to the backend or a local file. diff --git a/Gems/AWSMetrics/Code/Source/AWSMetricsSystemComponent.cpp b/Gems/AWSMetrics/Code/Source/AWSMetricsSystemComponent.cpp index cbc10a1f04..ee9b2d6edc 100644 --- a/Gems/AWSMetrics/Code/Source/AWSMetricsSystemComponent.cpp +++ b/Gems/AWSMetrics/Code/Source/AWSMetricsSystemComponent.cpp @@ -192,11 +192,7 @@ namespace AWSMetrics void AWSMetricsSystemComponent::Init() { - AZStd::string priorAlias = AZ::IO::FileIOBase::GetInstance()->GetAlias("@devroot@"); - AZStd::string configFilePath = priorAlias + "\\Gems\\AWSMetrics\\Code\\" + AZ::SettingsRegistryInterface::RegistryFolder + "\\awsMetricsClientConfiguration.setreg"; - AzFramework::StringFunc::Path::Normalize(configFilePath); - - m_metricsManager->Init(configFilePath); + m_metricsManager->Init(); } void AWSMetricsSystemComponent::Activate() diff --git a/Gems/AWSMetrics/Code/Source/ClientConfiguration.cpp b/Gems/AWSMetrics/Code/Source/ClientConfiguration.cpp index 504c02d920..b97eba25bd 100644 --- a/Gems/AWSMetrics/Code/Source/ClientConfiguration.cpp +++ b/Gems/AWSMetrics/Code/Source/ClientConfiguration.cpp @@ -9,6 +9,7 @@ #include #include +#include #include #include @@ -23,38 +24,44 @@ namespace AWSMetrics { } - bool ClientConfiguration::ResetClientConfiguration(const AZStd::string& settingsRegistryPath) + bool ClientConfiguration::InitClientConfiguration() { - AZStd::unique_ptr settingsRegistry = AZStd::make_unique(); - - AZ_Printf("AWSMetrics", "Reset client settings using the confiugration file %s", settingsRegistryPath.c_str()); - if (!settingsRegistry->MergeSettingsFile(settingsRegistryPath, AZ::SettingsRegistryInterface::Format::JsonMergePatch)) + AZ::SettingsRegistryInterface* settingsRegistry = AZ::SettingsRegistry::Get(); + if (!settingsRegistry) { - AZ_Warning("AWSMetrics", false, "Failed to merge the configuration file"); + AZ_Warning("AWSMetrics", false, "Failed to load the setting registry"); return false; } - if (!settingsRegistry->Get(m_maxQueueSizeInMb, "/Amazon/Gems/AWSMetrics/MaxQueueSizeInMb")) + if (!settingsRegistry->Get( + m_maxQueueSizeInMb, + AZStd::string::format("%s%s", AZ::SettingsRegistryMergeUtils::OrganizationRootKey, AWSMetricsMaxQueueSizeInMbKey))) { - AZ_Warning("AWSMetrics", false, "Failed to read the maximum queue size setting in the configuration file"); + AZ_Warning("AWSMetrics", false, "Failed to read the maximum queue size setting from the setting registry"); return false; } - if (!settingsRegistry->Get(m_queueFlushPeriodInSeconds, "/Amazon/Gems/AWSMetrics/QueueFlushPeriodInSeconds")) + if (!settingsRegistry->Get( + m_queueFlushPeriodInSeconds, + AZStd::string::format("%s%s", AZ::SettingsRegistryMergeUtils::OrganizationRootKey, AWSMetricsQueueFlushPeriodInSecondsKey))) { - AZ_Warning("AWSMetrics", false, "Failed to read the queue flush period setting in the configuration file"); + AZ_Warning("AWSMetrics", false, "Failed to read the queue flush period setting from the setting registry"); return false; } bool enableOfflineRecording = false; - if (!settingsRegistry->Get(enableOfflineRecording, "/Amazon/Gems/AWSMetrics/OfflineRecording")) + if (!settingsRegistry->Get( + enableOfflineRecording, + AZStd::string::format("%s%s", AZ::SettingsRegistryMergeUtils::OrganizationRootKey, AWSMetricsOfflineRecordingEnabledKey))) { - AZ_Warning("AWSMetrics", false, "Failed to read the submission target setting in the configuration file"); + AZ_Warning("AWSMetrics", false, "Failed to read the submission target setting from the setting registry"); return false; } m_offlineRecordingEnabled = enableOfflineRecording; - if (!settingsRegistry->Get(m_maxNumRetries, "/Amazon/Gems/AWSMetrics/MaxNumRetries")) + if (!settingsRegistry->Get( + m_maxNumRetries, + AZStd::string::format("%s%s", AZ::SettingsRegistryMergeUtils::OrganizationRootKey, AWSMetricsMaxNumRetriesKey))) { AZ_Warning("AWSMetrics", false, "Failed to read the maximum number of retries setting in the configuration file"); return false; diff --git a/Gems/AWSMetrics/Code/Source/MetricsManager.cpp b/Gems/AWSMetrics/Code/Source/MetricsManager.cpp index 5779697010..b2eda9a39d 100644 --- a/Gems/AWSMetrics/Code/Source/MetricsManager.cpp +++ b/Gems/AWSMetrics/Code/Source/MetricsManager.cpp @@ -34,9 +34,9 @@ namespace AWSMetrics ShutdownMetrics(); } - bool MetricsManager::Init(const AZStd::string& settingsRegistryPath) + bool MetricsManager::Init() { - if (!m_clientConfiguration->ResetClientConfiguration(settingsRegistryPath)) + if (!m_clientConfiguration->InitClientConfiguration()) { return false; } diff --git a/Gems/AWSMetrics/Code/Tests/AWSMetricsGemMock.h b/Gems/AWSMetrics/Code/Tests/AWSMetricsGemMock.h index 77d3f5e5b8..33fae3693e 100644 --- a/Gems/AWSMetrics/Code/Tests/AWSMetricsGemMock.h +++ b/Gems/AWSMetrics/Code/Tests/AWSMetricsGemMock.h @@ -52,10 +52,14 @@ namespace AWSMetrics m_settingsRegistry->SetContext(m_serializeContext.get()); m_settingsRegistry->SetContext(m_registrationContext.get()); + + AZ::SettingsRegistry::Register(m_settingsRegistry.get()); } void TearDown() override { + AZ::SettingsRegistry::Unregister(m_settingsRegistry.get()); + m_registrationContext->EnableRemoveReflection(); AZ::JsonSystemComponent::Reflect(m_registrationContext.get()); m_registrationContext->DisableRemoveReflection(); @@ -130,7 +134,7 @@ namespace AWSMetrics AZStd::unique_ptr m_serializeContext; AZStd::unique_ptr m_registrationContext; - AZStd::shared_ptr m_settingsRegistry; + AZStd::unique_ptr m_settingsRegistry; private: AZStd::string GetTestFolderPath() diff --git a/Gems/AWSMetrics/Code/Tests/MetricsManagerTest.cpp b/Gems/AWSMetrics/Code/Tests/MetricsManagerTest.cpp index 39d06dec66..32b1c9d240 100644 --- a/Gems/AWSMetrics/Code/Tests/MetricsManagerTest.cpp +++ b/Gems/AWSMetrics/Code/Tests/MetricsManagerTest.cpp @@ -135,7 +135,8 @@ namespace AWSMetrics m_metricsManager = AZStd::make_unique(); AZStd::string configFilePath = CreateClientConfigFile(true, (double) TestMetricsEventSizeInBytes / MbToBytes * 2, DefaultFlushPeriodInSeconds, 0); - m_metricsManager->Init(configFilePath); + m_settingsRegistry->MergeSettingsFile(configFilePath, AZ::SettingsRegistryInterface::Format::JsonMergePatch, {}); + m_metricsManager->Init(); RemoveFile(m_metricsManager->GetMetricsFilePath()); @@ -161,7 +162,8 @@ namespace AWSMetrics RevertMockIOToLocalFileIO(); AZStd::string configFilePath = CreateClientConfigFile(offlineRecordingEnabled, maxQueueSizeInMb, queueFlushPeriodInSeconds, MaxNumRetries); - m_metricsManager->Init(configFilePath); + m_settingsRegistry->MergeSettingsFile(configFilePath, AZ::SettingsRegistryInterface::Format::JsonMergePatch, {}); + m_metricsManager->Init(); ReplaceLocalFileIOWithMockIO(); } @@ -555,10 +557,11 @@ namespace AWSMetrics AZStd::unique_ptr m_clientConfiguration; }; - TEST_F(ClientConfigurationTest, ResetClientConfiguration_ValidConfigurationFile_Success) + TEST_F(ClientConfigurationTest, ResetClientConfiguration_ValidClientConfiguration_Success) { AZStd::string configFilePath = CreateClientConfigFile(true, DEFAULT_MAX_QUEUE_SIZE_IN_MB, DefaultFlushPeriodInSeconds, DEFAULT_MAX_NUM_RETRIES); - ASSERT_TRUE(m_clientConfiguration->ResetClientConfiguration(configFilePath)); + m_settingsRegistry->MergeSettingsFile(configFilePath, AZ::SettingsRegistryInterface::Format::JsonMergePatch, {}); + ASSERT_TRUE(m_clientConfiguration->InitClientConfiguration()); ASSERT_TRUE(m_clientConfiguration->OfflineRecordingEnabled()); ASSERT_EQ(m_clientConfiguration->GetMaxQueueSizeInBytes(), DEFAULT_MAX_QUEUE_SIZE_IN_MB * 1000000); @@ -573,12 +576,4 @@ namespace AWSMetrics ASSERT_EQ(strcmp(m_clientConfiguration->GetMetricsFileDir(), resolvedPath), 0); ASSERT_EQ(m_clientConfiguration->GetMetricsFileFullPath(), expectedMetricsFilePath); } - - TEST_F(ClientConfigurationTest, ResetClientConfiguration_InvalidConfigurationFile_Fail) - { - AZStd::string configFilePath = "invalidConfig"; - AZ_TEST_START_TRACE_SUPPRESSION; - ASSERT_FALSE(m_clientConfiguration->ResetClientConfiguration(configFilePath)); - AZ_TEST_STOP_TRACE_SUPPRESSION(1); - } } diff --git a/Gems/AWSMetrics/Code/Registry/awsMetricsClientConfiguration.setreg b/Gems/AWSMetrics/Registry/awsMetricsClientConfiguration.setreg similarity index 100% rename from Gems/AWSMetrics/Code/Registry/awsMetricsClientConfiguration.setreg rename to Gems/AWSMetrics/Registry/awsMetricsClientConfiguration.setreg diff --git a/Gems/Atom/CMakeLists.txt b/Gems/Atom/CMakeLists.txt index 3c7a6951f6..8dc38ec7ad 100644 --- a/Gems/Atom/CMakeLists.txt +++ b/Gems/Atom/CMakeLists.txt @@ -14,3 +14,11 @@ add_subdirectory(RPI) add_subdirectory(Tools) add_subdirectory(Utils) +# The "Atom" Gem will alias the real Atom_AtomBridge target variants +# allows the enabling and disabling the "Atom" Gem to build the pre-requisite dependencies +ly_create_alias(NAME Atom.Clients NAMESPACE Gem TARGETS Gem::Atom_AtomBridge.Clients) +ly_create_alias(NAME Atom.Servers NAMESPACE Gem TARGETS Gem::Atom_AtomBridge.Servers) +if(PAL_TRAIT_BUILD_HOST_TOOLS) + ly_create_alias(NAME Atom.Builders NAMESPACE Gem TARGETS Gem::Atom_AtomBridge.Builders) + ly_create_alias(NAME Atom.Tools NAMESPACE Gem TARGETS Gem::Atom_AtomBridge.Tools) +endif() diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/MaterialInputs/DetailMapsInput.azsli b/Gems/Atom/Feature/Common/Assets/Materials/Types/MaterialInputs/DetailMapsInput.azsli index dab066a8ce..3e4762de98 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/MaterialInputs/DetailMapsInput.azsli +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/MaterialInputs/DetailMapsInput.azsli @@ -33,7 +33,12 @@ bool m_detail_normal_flipX; \ bool m_detail_normal_flipY; \ \ float3x3 m_detailUvMatrix; \ -float3x3 m_detailUvMatrixInverse; +float4 m_detailUvMatrixPad; \ +float3x3 m_detailUvMatrixInverse; \ +float4 m_detailUvMatrixInversePad; + +// [GFX TODO][ATOM-14595] m_detailUvMatrixPad and m_detailUvMatrixInversePad are a workaround for a data stomping bug. +// Remove them once the bug is fixed. #define COMMON_OPTIONS_DETAIL_MAPS(prefix) \ diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_HandleOpacityMode.lua b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_HandleOpacityMode.lua index c96c2ff585..7ec6a60320 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_HandleOpacityMode.lua +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_HandleOpacityMode.lua @@ -82,6 +82,12 @@ function ProcessEditor(context) context:SetMaterialPropertyVisibility("opacity.factor", mainVisibility) context:SetMaterialPropertyVisibility("opacity.doubleSided", mainVisibility) + if(opacityMode == OpacityMode_Blended or opacityMode == OpacityMode_TintedTransparent) then + context:SetMaterialPropertyVisibility("opacity.alphaAffectsSpecular", MaterialPropertyVisibility_Enabled) + else + context:SetMaterialPropertyVisibility("opacity.alphaAffectsSpecular", MaterialPropertyVisibility_Hidden) + end + if(mainVisibility == MaterialPropertyVisibility_Enabled) then local alphaSource = context:GetMaterialPropertyValue_enum("opacity.alphaSource") diff --git a/Gems/Atom/Feature/Common/Assets/Passes/DepthExponentiation.pass b/Gems/Atom/Feature/Common/Assets/Passes/DepthExponentiation.pass index c08f5c9e4a..82dd13935a 100644 --- a/Gems/Atom/Feature/Common/Assets/Passes/DepthExponentiation.pass +++ b/Gems/Atom/Feature/Common/Assets/Passes/DepthExponentiation.pass @@ -54,7 +54,7 @@ "Attachment": "Depth" }, "ImageDescriptor": { - "Format": "R32_FLOAT" + "Format": "R16_FLOAT" } } ], diff --git a/Gems/Atom/Feature/Common/Assets/Passes/FilterDepthVertical.pass b/Gems/Atom/Feature/Common/Assets/Passes/FilterDepthVertical.pass index 321d0abf4a..5d8a4de21b 100644 --- a/Gems/Atom/Feature/Common/Assets/Passes/FilterDepthVertical.pass +++ b/Gems/Atom/Feature/Common/Assets/Passes/FilterDepthVertical.pass @@ -54,7 +54,7 @@ "Attachment": "Input" }, "ImageDescriptor": { - "Format": "R32_FLOAT" + "Format": "R16_FLOAT" } } ], diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/Shadow/DirectionalLightShadow.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/Shadow/DirectionalLightShadow.azsli index 4642d13f02..1e3d993341 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/Shadow/DirectionalLightShadow.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/Shadow/DirectionalLightShadow.azsli @@ -356,8 +356,9 @@ float DirectionalLightShadow::GetVisibilityFromLightEsm() { const float distanceWithinCameraView = depthDiff / (1. - distanceMin); const float3 coord = float3(shadowCoord.xy, indexOfCascade); - const float expDepthInShadowmap = expShadowmap.Sample(PassSrg::LinearSampler, coord).r; - const float ratio = exp(-EsmExponentialShift * distanceWithinCameraView) * expDepthInShadowmap; + const float occluder = expShadowmap.Sample(PassSrg::LinearSampler, coord).r; + const float exponent = -EsmExponentialShift * (distanceWithinCameraView - occluder); + const float ratio = exp(exponent); m_debugInfo.m_cascadeIndex = indexOfCascade; return saturate(ratio); @@ -385,8 +386,9 @@ float DirectionalLightShadow::GetVisibilityFromLightEsmPcf() { const float distanceWithinCameraView = depthDiff / (1. - distanceMin); const float3 coord = float3(shadowCoord.xy, indexOfCascade); - const float expDepthInShadowmap = expShadowmap.Sample(PassSrg::LinearSampler, coord).r; - float ratio = exp(-EsmExponentialShift * distanceWithinCameraView) * expDepthInShadowmap; + const float occluder = expShadowmap.Sample(PassSrg::LinearSampler, coord).r; + const float exponent = -EsmExponentialShift * (distanceWithinCameraView - occluder); + float ratio = exp(exponent); static const float pcfFallbackThreshold = 1.04; if (ratio > pcfFallbackThreshold) diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/Shadow/DepthExponentiation.azsl b/Gems/Atom/Feature/Common/Assets/Shaders/Shadow/DepthExponentiation.azsl index 75330cc134..19e54d14fd 100644 --- a/Gems/Atom/Feature/Common/Assets/Shaders/Shadow/DepthExponentiation.azsl +++ b/Gems/Atom/Feature/Common/Assets/Shaders/Shadow/DepthExponentiation.azsl @@ -63,12 +63,7 @@ void MainCS(uint3 dispatchId: SV_DispatchThreadID) // So this converts it to "depth" to emphasize the difference // within the frustum. const float depth = (depthInClip - distanceMin) / (1. - distanceMin); - - // Todo: Expose Esm exponent slider for directional lights - // This would remove the exp calculation below, collapsing it into a subtraction in DirectionalLightShadow.azsli - // ATOM-15775 - const float outValue = exp(EsmExponentialShift * depth); - PassSrg::m_outputShadowmap[dispatchId].r = outValue; + PassSrg::m_outputShadowmap[dispatchId].r = depth; break; } case ShadowmapLightType::Spot: diff --git a/Gems/AtomLyIntegration/CMakeLists.txt b/Gems/AtomLyIntegration/CMakeLists.txt index 798cacfb2e..35d4d388a6 100644 --- a/Gems/AtomLyIntegration/CMakeLists.txt +++ b/Gems/AtomLyIntegration/CMakeLists.txt @@ -14,3 +14,12 @@ add_subdirectory(TechnicalArt) add_subdirectory(AtomBridge) add_subdirectory(AtomViewportDisplayInfo) add_subdirectory(AtomViewportDisplayIcons) + +# The "AtomLyIntegration" Gem will also alias the real Atom_AtomBridge target variants +# The Atom Gem does the same at the moment. +ly_create_alias(NAME AtomLyIntegration.Clients NAMESPACE Gem TARGETS Gem::Atom_AtomBridge.Clients) +ly_create_alias(NAME AtomLyIntegration.Servers NAMESPACE Gem TARGETS Gem::Atom_AtomBridge.Servers) +if(PAL_TRAIT_BUILD_HOST_TOOLS) + ly_create_alias(NAME AtomLyIntegration.Builders NAMESPACE Gem TARGETS Gem::Atom_AtomBridge.Builders) + ly_create_alias(NAME AtomLyIntegration.Tools NAMESPACE Gem TARGETS Gem::Atom_AtomBridge.Tools) +endif() diff --git a/Gems/ImGui/External/ImGui/v1.82/imgui/imgui.h b/Gems/ImGui/External/ImGui/v1.82/imgui/imgui.h index da70306401..af3d3471bc 100644 --- a/Gems/ImGui/External/ImGui/v1.82/imgui/imgui.h +++ b/Gems/ImGui/External/ImGui/v1.82/imgui/imgui.h @@ -2598,7 +2598,6 @@ struct ImFontAtlas // NB: Consider using ImFontGlyphRangesBuilder to build glyph ranges from textual data. IMGUI_API const ImWchar* GetGlyphRangesDefault(); // Basic Latin, Extended Latin IMGUI_API const ImWchar* GetGlyphRangesKorean(); // Default + Korean characters - IMGUI_API const ImWchar* GetGlyphRangesJapanese(); // Default + Hiragana, Katakana, Half-Width, Selection of 2999 Ideographs IMGUI_API const ImWchar* GetGlyphRangesChineseFull(); // Default + Half-Width + Japanese Hiragana/Katakana + full set of about 21000 CJK Unified Ideographs IMGUI_API const ImWchar* GetGlyphRangesChineseSimplifiedCommon();// Default + Half-Width + Japanese Hiragana/Katakana + set of 2500 CJK Unified Ideographs for common simplified Chinese IMGUI_API const ImWchar* GetGlyphRangesCyrillic(); // Default + about 400 Cyrillic characters diff --git a/Gems/ImGui/External/ImGui/v1.82/imgui/imgui_draw.cpp b/Gems/ImGui/External/ImGui/v1.82/imgui/imgui_draw.cpp index c41a1ba0b2..fc1c7b34ab 100644 --- a/Gems/ImGui/External/ImGui/v1.82/imgui/imgui_draw.cpp +++ b/Gems/ImGui/External/ImGui/v1.82/imgui/imgui_draw.cpp @@ -2901,95 +2901,6 @@ const ImWchar* ImFontAtlas::GetGlyphRangesChineseSimplifiedCommon() return &full_ranges[0]; } -const ImWchar* ImFontAtlas::GetGlyphRangesJapanese() -{ - // 2999 ideograms code points for Japanese - // - 2136 Joyo (meaning "for regular use" or "for common use") Kanji code points - // - 863 Jinmeiyo (meaning "for personal name") Kanji code points - // - Sourced from the character information database of the Information-technology Promotion Agency, Japan - // - https://mojikiban.ipa.go.jp/mji/ - // - Available under the terms of the Creative Commons Attribution-ShareAlike 2.1 Japan (CC BY-SA 2.1 JP). - // - https://creativecommons.org/licenses/by-sa/2.1/jp/deed.en - // - https://creativecommons.org/licenses/by-sa/2.1/jp/legalcode - // - You can generate this code by the script at: - // - https://github.com/vaiorabbit/everyday_use_kanji - // - References: - // - List of Joyo Kanji - // - (Official list by the Agency for Cultural Affairs) https://www.bunka.go.jp/kokugo_nihongo/sisaku/joho/joho/kakuki/14/tosin02/index.html - // - (Wikipedia) https://en.wikipedia.org/wiki/List_of_j%C5%8Dy%C5%8D_kanji - // - List of Jinmeiyo Kanji - // - (Official list by the Ministry of Justice) http://www.moj.go.jp/MINJI/minji86.html - // - (Wikipedia) https://en.wikipedia.org/wiki/Jinmeiy%C5%8D_kanji - // - Missing 1 Joyo Kanji: U+20B9F (Kun'yomi: Shikaru, On'yomi: Shitsu,shichi), see https://github.com/ocornut/imgui/pull/3627 for details. - // You can use ImFontGlyphRangesBuilder to create your own ranges derived from this, by merging existing ranges or adding new characters. - // (Stored as accumulative offsets from the initial unicode codepoint 0x4E00. This encoding is designed to helps us compact the source code size.) - static const short accumulative_offsets_from_0x4E00[] = - { - 0,1,2,4,1,1,1,1,2,1,3,3,2,2,1,5,3,5,7,5,6,1,2,1,7,2,6,3,1,8,1,1,4,1,1,18,2,11,2,6,2,1,2,1,5,1,2,1,3,1,2,1,2,3,3,1,1,2,3,1,1,1,12,7,9,1,4,5,1, - 1,2,1,10,1,1,9,2,2,4,5,6,9,3,1,1,1,1,9,3,18,5,2,2,2,2,1,6,3,7,1,1,1,1,2,2,4,2,1,23,2,10,4,3,5,2,4,10,2,4,13,1,6,1,9,3,1,1,6,6,7,6,3,1,2,11,3, - 2,2,3,2,15,2,2,5,4,3,6,4,1,2,5,2,12,16,6,13,9,13,2,1,1,7,16,4,7,1,19,1,5,1,2,2,7,7,8,2,6,5,4,9,18,7,4,5,9,13,11,8,15,2,1,1,1,2,1,2,2,1,2,2,8, - 2,9,3,3,1,1,4,4,1,1,1,4,9,1,4,3,5,5,2,7,5,3,4,8,2,1,13,2,3,3,1,14,1,1,4,5,1,3,6,1,5,2,1,1,3,3,3,3,1,1,2,7,6,6,7,1,4,7,6,1,1,1,1,1,12,3,3,9,5, - 2,6,1,5,6,1,2,3,18,2,4,14,4,1,3,6,1,1,6,3,5,5,3,2,2,2,2,12,3,1,4,2,3,2,3,11,1,7,4,1,2,1,3,17,1,9,1,24,1,1,4,2,2,4,1,2,7,1,1,1,3,1,2,2,4,15,1, - 1,2,1,1,2,1,5,2,5,20,2,5,9,1,10,8,7,6,1,1,1,1,1,1,6,2,1,2,8,1,1,1,1,5,1,1,3,1,1,1,1,3,1,1,12,4,1,3,1,1,1,1,1,10,3,1,7,5,13,1,2,3,4,6,1,1,30, - 2,9,9,1,15,38,11,3,1,8,24,7,1,9,8,10,2,1,9,31,2,13,6,2,9,4,49,5,2,15,2,1,10,2,1,1,1,2,2,6,15,30,35,3,14,18,8,1,16,10,28,12,19,45,38,1,3,2,3, - 13,2,1,7,3,6,5,3,4,3,1,5,7,8,1,5,3,18,5,3,6,1,21,4,24,9,24,40,3,14,3,21,3,2,1,2,4,2,3,1,15,15,6,5,1,1,3,1,5,6,1,9,7,3,3,2,1,4,3,8,21,5,16,4, - 5,2,10,11,11,3,6,3,2,9,3,6,13,1,2,1,1,1,1,11,12,6,6,1,4,2,6,5,2,1,1,3,3,6,13,3,1,1,5,1,2,3,3,14,2,1,2,2,2,5,1,9,5,1,1,6,12,3,12,3,4,13,2,14, - 2,8,1,17,5,1,16,4,2,2,21,8,9,6,23,20,12,25,19,9,38,8,3,21,40,25,33,13,4,3,1,4,1,2,4,1,2,5,26,2,1,1,2,1,3,6,2,1,1,1,1,1,1,2,3,1,1,1,9,2,3,1,1, - 1,3,6,3,2,1,1,6,6,1,8,2,2,2,1,4,1,2,3,2,7,3,2,4,1,2,1,2,2,1,1,1,1,1,3,1,2,5,4,10,9,4,9,1,1,1,1,1,1,5,3,2,1,6,4,9,6,1,10,2,31,17,8,3,7,5,40,1, - 7,7,1,6,5,2,10,7,8,4,15,39,25,6,28,47,18,10,7,1,3,1,1,2,1,1,1,3,3,3,1,1,1,3,4,2,1,4,1,3,6,10,7,8,6,2,2,1,3,3,2,5,8,7,9,12,2,15,1,1,4,1,2,1,1, - 1,3,2,1,3,3,5,6,2,3,2,10,1,4,2,8,1,1,1,11,6,1,21,4,16,3,1,3,1,4,2,3,6,5,1,3,1,1,3,3,4,6,1,1,10,4,2,7,10,4,7,4,2,9,4,3,1,1,1,4,1,8,3,4,1,3,1, - 6,1,4,2,1,4,7,2,1,8,1,4,5,1,1,2,2,4,6,2,7,1,10,1,1,3,4,11,10,8,21,4,6,1,3,5,2,1,2,28,5,5,2,3,13,1,2,3,1,4,2,1,5,20,3,8,11,1,3,3,3,1,8,10,9,2, - 10,9,2,3,1,1,2,4,1,8,3,6,1,7,8,6,11,1,4,29,8,4,3,1,2,7,13,1,4,1,6,2,6,12,12,2,20,3,2,3,6,4,8,9,2,7,34,5,1,18,6,1,1,4,4,5,7,9,1,2,2,4,3,4,1,7, - 2,2,2,6,2,3,25,5,3,6,1,4,6,7,4,2,1,4,2,13,6,4,4,3,1,5,3,4,4,3,2,1,1,4,1,2,1,1,3,1,11,1,6,3,1,7,3,6,2,8,8,6,9,3,4,11,3,2,10,12,2,5,11,1,6,4,5, - 3,1,8,5,4,6,6,3,5,1,1,3,2,1,2,2,6,17,12,1,10,1,6,12,1,6,6,19,9,6,16,1,13,4,4,15,7,17,6,11,9,15,12,6,7,2,1,2,2,15,9,3,21,4,6,49,18,7,3,2,3,1, - 6,8,2,2,6,2,9,1,3,6,4,4,1,2,16,2,5,2,1,6,2,3,5,3,1,2,5,1,2,1,9,3,1,8,6,4,8,11,3,1,1,1,1,3,1,13,8,4,1,3,2,2,1,4,1,11,1,5,2,1,5,2,5,8,6,1,1,7, - 4,3,8,3,2,7,2,1,5,1,5,2,4,7,6,2,8,5,1,11,4,5,3,6,18,1,2,13,3,3,1,21,1,1,4,1,4,1,1,1,8,1,2,2,7,1,2,4,2,2,9,2,1,1,1,4,3,6,3,12,5,1,1,1,5,6,3,2, - 4,8,2,2,4,2,7,1,8,9,5,2,3,2,1,3,2,13,7,14,6,5,1,1,2,1,4,2,23,2,1,1,6,3,1,4,1,15,3,1,7,3,9,14,1,3,1,4,1,1,5,8,1,3,8,3,8,15,11,4,14,4,4,2,5,5, - 1,7,1,6,14,7,7,8,5,15,4,8,6,5,6,2,1,13,1,20,15,11,9,2,5,6,2,11,2,6,2,5,1,5,8,4,13,19,25,4,1,1,11,1,34,2,5,9,14,6,2,2,6,1,1,14,1,3,14,13,1,6, - 12,21,14,14,6,32,17,8,32,9,28,1,2,4,11,8,3,1,14,2,5,15,1,1,1,1,3,6,4,1,3,4,11,3,1,1,11,30,1,5,1,4,1,5,8,1,1,3,2,4,3,17,35,2,6,12,17,3,1,6,2, - 1,1,12,2,7,3,3,2,1,16,2,8,3,6,5,4,7,3,3,8,1,9,8,5,1,2,1,3,2,8,1,2,9,12,1,1,2,3,8,3,24,12,4,3,7,5,8,3,3,3,3,3,3,1,23,10,3,1,2,2,6,3,1,16,1,16, - 22,3,10,4,11,6,9,7,7,3,6,2,2,2,4,10,2,1,1,2,8,7,1,6,4,1,3,3,3,5,10,12,12,2,3,12,8,15,1,1,16,6,6,1,5,9,11,4,11,4,2,6,12,1,17,5,13,1,4,9,5,1,11, - 2,1,8,1,5,7,28,8,3,5,10,2,17,3,38,22,1,2,18,12,10,4,38,18,1,4,44,19,4,1,8,4,1,12,1,4,31,12,1,14,7,75,7,5,10,6,6,13,3,2,11,11,3,2,5,28,15,6,18, - 18,5,6,4,3,16,1,7,18,7,36,3,5,3,1,7,1,9,1,10,7,2,4,2,6,2,9,7,4,3,32,12,3,7,10,2,23,16,3,1,12,3,31,4,11,1,3,8,9,5,1,30,15,6,12,3,2,2,11,19,9, - 14,2,6,2,3,19,13,17,5,3,3,25,3,14,1,1,1,36,1,3,2,19,3,13,36,9,13,31,6,4,16,34,2,5,4,2,3,3,5,1,1,1,4,3,1,17,3,2,3,5,3,1,3,2,3,5,6,3,12,11,1,3, - 1,2,26,7,12,7,2,14,3,3,7,7,11,25,25,28,16,4,36,1,2,1,6,2,1,9,3,27,17,4,3,4,13,4,1,3,2,2,1,10,4,2,4,6,3,8,2,1,18,1,1,24,2,2,4,33,2,3,63,7,1,6, - 40,7,3,4,4,2,4,15,18,1,16,1,1,11,2,41,14,1,3,18,13,3,2,4,16,2,17,7,15,24,7,18,13,44,2,2,3,6,1,1,7,5,1,7,1,4,3,3,5,10,8,2,3,1,8,1,1,27,4,2,1, - 12,1,2,1,10,6,1,6,7,5,2,3,7,11,5,11,3,6,6,2,3,15,4,9,1,1,2,1,2,11,2,8,12,8,5,4,2,3,1,5,2,2,1,14,1,12,11,4,1,11,17,17,4,3,2,5,5,7,3,1,5,9,9,8, - 2,5,6,6,13,13,2,1,2,6,1,2,2,49,4,9,1,2,10,16,7,8,4,3,2,23,4,58,3,29,1,14,19,19,11,11,2,7,5,1,3,4,6,2,18,5,12,12,17,17,3,3,2,4,1,6,2,3,4,3,1, - 1,1,1,5,1,1,9,1,3,1,3,6,1,8,1,1,2,6,4,14,3,1,4,11,4,1,3,32,1,2,4,13,4,1,2,4,2,1,3,1,11,1,4,2,1,4,4,6,3,5,1,6,5,7,6,3,23,3,5,3,5,3,3,13,3,9,10, - 1,12,10,2,3,18,13,7,160,52,4,2,2,3,2,14,5,4,12,4,6,4,1,20,4,11,6,2,12,27,1,4,1,2,2,7,4,5,2,28,3,7,25,8,3,19,3,6,10,2,2,1,10,2,5,4,1,3,4,1,5, - 3,2,6,9,3,6,2,16,3,3,16,4,5,5,3,2,1,2,16,15,8,2,6,21,2,4,1,22,5,8,1,1,21,11,2,1,11,11,19,13,12,4,2,3,2,3,6,1,8,11,1,4,2,9,5,2,1,11,2,9,1,1,2, - 14,31,9,3,4,21,14,4,8,1,7,2,2,2,5,1,4,20,3,3,4,10,1,11,9,8,2,1,4,5,14,12,14,2,17,9,6,31,4,14,1,20,13,26,5,2,7,3,6,13,2,4,2,19,6,2,2,18,9,3,5, - 12,12,14,4,6,2,3,6,9,5,22,4,5,25,6,4,8,5,2,6,27,2,35,2,16,3,7,8,8,6,6,5,9,17,2,20,6,19,2,13,3,1,1,1,4,17,12,2,14,7,1,4,18,12,38,33,2,10,1,1, - 2,13,14,17,11,50,6,33,20,26,74,16,23,45,50,13,38,33,6,6,7,4,4,2,1,3,2,5,8,7,8,9,3,11,21,9,13,1,3,10,6,7,1,2,2,18,5,5,1,9,9,2,68,9,19,13,2,5, - 1,4,4,7,4,13,3,9,10,21,17,3,26,2,1,5,2,4,5,4,1,7,4,7,3,4,2,1,6,1,1,20,4,1,9,2,2,1,3,3,2,3,2,1,1,1,20,2,3,1,6,2,3,6,2,4,8,1,3,2,10,3,5,3,4,4, - 3,4,16,1,6,1,10,2,4,2,1,1,2,10,11,2,2,3,1,24,31,4,10,10,2,5,12,16,164,15,4,16,7,9,15,19,17,1,2,1,1,5,1,1,1,1,1,3,1,4,3,1,3,1,3,1,2,1,1,3,3,7, - 2,8,1,2,2,2,1,3,4,3,7,8,12,92,2,10,3,1,3,14,5,25,16,42,4,7,7,4,2,21,5,27,26,27,21,25,30,31,2,1,5,13,3,22,5,6,6,11,9,12,1,5,9,7,5,5,22,60,3,5, - 13,1,1,8,1,1,3,3,2,1,9,3,3,18,4,1,2,3,7,6,3,1,2,3,9,1,3,1,3,2,1,3,1,1,1,2,1,11,3,1,6,9,1,3,2,3,1,2,1,5,1,1,4,3,4,1,2,2,4,4,1,7,2,1,2,2,3,5,13, - 18,3,4,14,9,9,4,16,3,7,5,8,2,6,48,28,3,1,1,4,2,14,8,2,9,2,1,15,2,4,3,2,10,16,12,8,7,1,1,3,1,1,1,2,7,4,1,6,4,38,39,16,23,7,15,15,3,2,12,7,21, - 37,27,6,5,4,8,2,10,8,8,6,5,1,2,1,3,24,1,16,17,9,23,10,17,6,1,51,55,44,13,294,9,3,6,2,4,2,2,15,1,1,1,13,21,17,68,14,8,9,4,1,4,9,3,11,7,1,1,1, - 5,6,3,2,1,1,1,2,3,8,1,2,2,4,1,5,5,2,1,4,3,7,13,4,1,4,1,3,1,1,1,5,5,10,1,6,1,5,2,1,5,2,4,1,4,5,7,3,18,2,9,11,32,4,3,3,2,4,7,11,16,9,11,8,13,38, - 32,8,4,2,1,1,2,1,2,4,4,1,1,1,4,1,21,3,11,1,16,1,1,6,1,3,2,4,9,8,57,7,44,1,3,3,13,3,10,1,1,7,5,2,7,21,47,63,3,15,4,7,1,16,1,1,2,8,2,3,42,15,4, - 1,29,7,22,10,3,78,16,12,20,18,4,67,11,5,1,3,15,6,21,31,32,27,18,13,71,35,5,142,4,10,1,2,50,19,33,16,35,37,16,19,27,7,1,133,19,1,4,8,7,20,1,4, - 4,1,10,3,1,6,1,2,51,5,40,15,24,43,22928,11,1,13,154,70,3,1,1,7,4,10,1,2,1,1,2,1,2,1,2,2,1,1,2,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1, - 3,2,1,1,1,1,2,1,1, - }; - static ImWchar base_ranges[] = // not zero-terminated - { - 0x0020, 0x00FF, // Basic Latin + Latin Supplement - 0x3000, 0x30FF, // CJK Symbols and Punctuations, Hiragana, Katakana - 0x31F0, 0x31FF, // Katakana Phonetic Extensions - 0xFF00, 0xFFEF // Half-width characters - }; - static ImWchar full_ranges[IM_ARRAYSIZE(base_ranges) + IM_ARRAYSIZE(accumulative_offsets_from_0x4E00)*2 + 1] = { 0 }; - if (!full_ranges[0]) - { - memcpy(full_ranges, base_ranges, sizeof(base_ranges)); - UnpackAccumulativeOffsetsIntoRanges(0x4E00, accumulative_offsets_from_0x4E00, IM_ARRAYSIZE(accumulative_offsets_from_0x4E00), full_ranges + IM_ARRAYSIZE(base_ranges)); - } - return &full_ranges[0]; -} - const ImWchar* ImFontAtlas::GetGlyphRangesCyrillic() { static const ImWchar ranges[] = diff --git a/Gems/LyShine/Assets/LyShine_Dependencies.xml b/Gems/LyShine/Assets/LyShine_Dependencies.xml index 83c63cfbd4..6297f55ffd 100644 --- a/Gems/LyShine/Assets/LyShine_Dependencies.xml +++ b/Gems/LyShine/Assets/LyShine_Dependencies.xml @@ -1,9 +1,3 @@ - - - - - - - + diff --git a/Gems/LyShine/Assets/Textures/Basic/Button_Sliced_Normal.tif.exportsettings b/Gems/LyShine/Assets/Textures/Basic/Button_Sliced_Normal.tif.exportsettings deleted file mode 100644 index 1415bea891..0000000000 --- a/Gems/LyShine/Assets/Textures/Basic/Button_Sliced_Normal.tif.exportsettings +++ /dev/null @@ -1 +0,0 @@ -/autooptimizefile=0 /dns=1 /preset=ReferenceImage_Linear /reduce=0 /ser=0 diff --git a/Gems/LyShine/Assets/Textures/Cursor_Default.tif b/Gems/LyShine/Assets/Textures/Cursor_Default.tif new file mode 100644 index 0000000000..01e65389c3 --- /dev/null +++ b/Gems/LyShine/Assets/Textures/Cursor_Default.tif @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a268774eb6d4d4590960c28edbf2a35d3fb7a73caab38d9ad15812c3df1c0c02 +size 4529 diff --git a/Gems/LyShine/Assets/Textures/Cursor_Default.tif.assetinfo b/Gems/LyShine/Assets/Textures/Cursor_Default.tif.assetinfo new file mode 100644 index 0000000000..47b628d60a --- /dev/null +++ b/Gems/LyShine/Assets/Textures/Cursor_Default.tif.assetinfo @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Gems/LyShine/Assets/seedList.seed b/Gems/LyShine/Assets/seedList.seed index f42f2a81bc..499469bd63 100644 --- a/Gems/LyShine/Assets/seedList.seed +++ b/Gems/LyShine/Assets/seedList.seed @@ -1,28 +1,12 @@ - - - - - - - - - - - - - - - - - + diff --git a/Gems/LyShine/Code/Editor/EditorCommon.h b/Gems/LyShine/Code/Editor/EditorCommon.h index 04dc03f8a0..f6b9dc1458 100644 --- a/Gems/LyShine/Code/Editor/EditorCommon.h +++ b/Gems/LyShine/Code/Editor/EditorCommon.h @@ -112,7 +112,6 @@ enum class FusibleCommand #include "FileHelpers.h" #include "ComponentHelpers.h" #include "HierarchyHelpers.h" -#include "PrefabHelpers.h" #include "UiSliceManager.h" #include "SelectionHelpers.h" #include "ViewportInteraction.h" @@ -173,8 +172,6 @@ bool ClipboardContainsOurDataType(); #define UICANVASEDITOR_COORDINATE_SYSTEM_CYCLE_SHORTCUT_KEY_SEQUENCE QKeySequence(Qt::CTRL + Qt::Key_W) #define UICANVASEDITOR_SNAP_TO_GRID_TOGGLE_SHORTCUT_KEY_SEQUENCE QKeySequence(Qt::Key_G) -#define UICANVASEDITOR_PREFAB_EXTENSION "uiprefab" - #define UICANVASEDITOR_CANVAS_DIRECTORY "UI/Canvases" #define UICANVASEDITOR_CANVAS_EXTENSION "uicanvas" diff --git a/Gems/LyShine/Code/Editor/EditorMenu.cpp b/Gems/LyShine/Code/Editor/EditorMenu.cpp index 039ed7f3ca..ec56c316ee 100644 --- a/Gems/LyShine/Code/Editor/EditorMenu.cpp +++ b/Gems/LyShine/Code/Editor/EditorMenu.cpp @@ -146,19 +146,6 @@ void EditorWindow::AddMenu_File() menu->addSeparator(); - // "Save as Prefab..." file menu option - { - HierarchyWidget* widget = GetHierarchy(); - QAction* action = PrefabHelpers::CreateSavePrefabAction(widget); - action->setEnabled(canvasLoaded); - - // This menu option is always available to the user - menu->addAction(action); - addAction(action); // Also add the action to the window until the shortcut dispatcher can find the menu action - } - - menu->addSeparator(); - // Close the active canvas { QAction* action = CreateCloseCanvasAction(GetCanvas()); diff --git a/Gems/LyShine/Code/Editor/EditorWindow.cpp b/Gems/LyShine/Code/Editor/EditorWindow.cpp index 0edc1e6151..7db6de5fc4 100644 --- a/Gems/LyShine/Code/Editor/EditorWindow.cpp +++ b/Gems/LyShine/Code/Editor/EditorWindow.cpp @@ -128,7 +128,6 @@ EditorWindow::EditorWindow(QWidget* parent, Qt::WindowFlags flags) , m_previewActionLogDockWidget(nullptr) , m_previewAnimationListDockWidget(nullptr) , m_editorMode(UiEditorMode::Edit) - , m_prefabFiles() , m_actionsEnabledWithSelection() , m_pasteAsSiblingAction(nullptr) , m_pasteAsChildAction(nullptr) @@ -160,8 +159,6 @@ EditorWindow::EditorWindow(QWidget* parent, Qt::WindowFlags flags) connect(m_hierarchy, &HierarchyWidget::SetUserSelection, this, &EditorWindow::UpdateActionsEnabledState); m_clipboardConnection = connect(QApplication::clipboard(), &QClipboard::dataChanged, this, &EditorWindow::UpdateActionsEnabledState); - UpdatePrefabFiles(); - // Create the cursor to be used when picking an element in the hierarchy or viewport during object pick mode. // Uses the default hot spot which is the center of the image m_entityPickerCursor = QCursor(QPixmap(UICANVASEDITOR_ENTITY_PICKER_CURSOR)); @@ -1551,46 +1548,6 @@ AssetTreeEntry* EditorWindow::GetSliceLibraryTree() return m_sliceLibraryTree; } -void EditorWindow::UpdatePrefabFiles() -{ - m_prefabFiles.clear(); - - // IMPORTANT: ScanDirectory() is VERY slow. It can easily take as much - // as a whole second to execute. That's why we want to cache its result - // up front and ONLY access the cached data. - GetIEditor()->GetFileUtil()->ScanDirectory("", "*." UICANVASEDITOR_PREFAB_EXTENSION, m_prefabFiles); - SortPrefabsList(); -} - -IFileUtil::FileArray& EditorWindow::GetPrefabFiles() -{ - return m_prefabFiles; -} - -void EditorWindow::AddPrefabFile(const QString& prefabFilename) -{ - IFileUtil::FileDesc fd; - fd.filename = prefabFilename; - m_prefabFiles.push_back(fd); - SortPrefabsList(); -} - -void EditorWindow::SortPrefabsList() -{ - AZStd::sort(m_prefabFiles.begin(), m_prefabFiles.end(), - [](const IFileUtil::FileDesc& fd1, const IFileUtil::FileDesc& fd2) - { - // Some of the files in the list are in different directories, so we - // explicitly sort by filename only. - AZStd::string fd1Filename; - AzFramework::StringFunc::Path::GetFileName(fd1.filename.toUtf8().data(), fd1Filename); - - AZStd::string fd2Filename; - AzFramework::StringFunc::Path::GetFileName(fd2.filename.toUtf8().data(), fd2Filename); - return fd1Filename < fd2Filename; - }); -} - void EditorWindow::ToggleEditorMode() { m_editorMode = (m_editorMode == UiEditorMode::Edit) ? UiEditorMode::Preview : UiEditorMode::Edit; diff --git a/Gems/LyShine/Code/Editor/EditorWindow.h b/Gems/LyShine/Code/Editor/EditorWindow.h index 0f2dd39210..b00ae7ab95 100644 --- a/Gems/LyShine/Code/Editor/EditorWindow.h +++ b/Gems/LyShine/Code/Editor/EditorWindow.h @@ -139,11 +139,6 @@ public: // member functions AssetTreeEntry* GetSliceLibraryTree(); - //! WARNING: This is a VERY slow function. - void UpdatePrefabFiles(); - IFileUtil::FileArray& GetPrefabFiles(); - void AddPrefabFile(const QString& prefabFilename); - //! Returns the current mode of the editor (Edit or Preview) UiEditorMode GetEditorMode() { return m_editorMode; } @@ -325,8 +320,6 @@ private: // member functions QAction* CreateCloseAllOtherCanvasesAction(AZ::EntityId canvasEntityId, bool forContextMenu = false); QAction* CreateCloseAllCanvasesAction(bool forContextMenu = false); - void SortPrefabsList(); - void SaveModeSettings(UiEditorMode mode, bool syncSettings); void RestoreModeSettings(UiEditorMode mode); @@ -391,8 +384,6 @@ private: // data //! This tree caches the folder view of all the slice assets under the slice library path AssetTreeEntry* m_sliceLibraryTree = nullptr; - IFileUtil::FileArray m_prefabFiles; - //! Values for setting up undoable canvas/entity changes SerializeHelpers::SerializedEntryList m_preChangeState; bool m_haveValidEntitiesPreChangeState = false; diff --git a/Gems/LyShine/Code/Editor/HierarchyMenu.cpp b/Gems/LyShine/Code/Editor/HierarchyMenu.cpp index 3758041f7a..72868dccdb 100644 --- a/Gems/LyShine/Code/Editor/HierarchyMenu.cpp +++ b/Gems/LyShine/Code/Editor/HierarchyMenu.cpp @@ -26,8 +26,7 @@ HierarchyMenu::HierarchyMenu(HierarchyWidget* hierarchy, QTreeWidgetItemRawPtrQList selectedItems = hierarchy->selectedItems(); - if (showMask & (Show::kNew_EmptyElement | Show::kNew_ElementFromPrefabs | - Show::kNew_EmptyElementAtRoot | Show::kNew_ElementFromPrefabsAtRoot)) + if (showMask & (Show::kNew_EmptyElement | Show::kNew_EmptyElementAtRoot)) { QMenu* menu = (addMenuForNewElement ? addMenu("&New...") : this); @@ -40,11 +39,6 @@ HierarchyMenu::HierarchyMenu(HierarchyWidget* hierarchy, { New_ElementFromSlice(hierarchy, selectedItems, menu, (showMask & Show::kNew_InstantiateSliceAtRoot), optionalPos); } - - if (showMask & (Show::kNew_ElementFromPrefabs | Show::kNew_ElementFromPrefabsAtRoot)) - { - New_ElementFromPrefabs(hierarchy, selectedItems, menu, (showMask & Show::kNew_ElementFromPrefabsAtRoot), optionalPos); - } } if (showMask & (Show::kNewSlice | Show::kPushToSlice)) @@ -52,11 +46,6 @@ HierarchyMenu::HierarchyMenu(HierarchyWidget* hierarchy, SliceMenuItems(hierarchy, selectedItems, showMask); } - if (showMask & Show::kSavePrefab) - { - SavePrefab(hierarchy, selectedItems); - } - addSeparator(); if (showMask & Show::kCutCopyPaste) @@ -192,21 +181,6 @@ void HierarchyMenu::CutCopyPaste(HierarchyWidget* hierarchy, } } -void HierarchyMenu::SavePrefab(HierarchyWidget* hierarchy, - QTreeWidgetItemRawPtrQList& selectedItems) -{ - QAction* action = PrefabHelpers::CreateSavePrefabAction(hierarchy); - - // Only enable "save as prefab" option if exactly one element is selected - // in the hierarchy pane - if (selectedItems.size() != 1) - { - action->setEnabled(false); - } - - addAction(action); -} - void HierarchyMenu::SliceMenuItems(HierarchyWidget* hierarchy, QTreeWidgetItemRawPtrQList& selectedItems, size_t showMask) @@ -404,19 +378,6 @@ void HierarchyMenu::New_EmptyElement(HierarchyWidget* hierarchy, optionalPos)); } -void HierarchyMenu::New_ElementFromPrefabs(HierarchyWidget* hierarchy, - QTreeWidgetItemRawPtrQList& selectedItems, - QMenu* menu, - bool addAtRoot, - const QPoint* optionalPos) -{ - PrefabHelpers::CreateAddPrefabMenu(hierarchy, - selectedItems, - menu, - addAtRoot, - optionalPos); -} - void HierarchyMenu::New_ElementFromSlice(HierarchyWidget* hierarchy, QTreeWidgetItemRawPtrQList& selectedItems, QMenu* menu, diff --git a/Gems/LyShine/Code/Editor/HierarchyMenu.h b/Gems/LyShine/Code/Editor/HierarchyMenu.h index 69432a4d24..9d73c083f9 100644 --- a/Gems/LyShine/Code/Editor/HierarchyMenu.h +++ b/Gems/LyShine/Code/Editor/HierarchyMenu.h @@ -26,11 +26,8 @@ public: kNone = 0x0000, kCutCopyPaste = 0x0001, - kSavePrefab = 0x0002, kNew_EmptyElement = 0x0004, kNew_EmptyElementAtRoot = 0x0008, - kNew_ElementFromPrefabs = 0x0010, - kNew_ElementFromPrefabsAtRoot = 0x0020, kAddComponents = 0x0040, kDeleteElement = 0x0080, kNewSlice = 0x0100, @@ -52,9 +49,6 @@ private: void CutCopyPaste(HierarchyWidget* hierarchy, QTreeWidgetItemRawPtrQList& selectedItems); - void SavePrefab(HierarchyWidget* hierarchy, - QTreeWidgetItemRawPtrQList& selectedItems); - void SliceMenuItems(HierarchyWidget* hierarchy, QTreeWidgetItemRawPtrQList& selectedItems, size_t showMask); @@ -64,11 +58,6 @@ private: QMenu* menu, bool addAtRoot, const QPoint* optionalPos); - void New_ElementFromPrefabs(HierarchyWidget* hierarchy, - QTreeWidgetItemRawPtrQList& selectedItems, - QMenu* menu, - bool addAtRoot, - const QPoint* optionalPos); void New_ElementFromSlice(HierarchyWidget* hierarchy, QTreeWidgetItemRawPtrQList& selectedItems, QMenu* menu, diff --git a/Gems/LyShine/Code/Editor/HierarchyWidget.cpp b/Gems/LyShine/Code/Editor/HierarchyWidget.cpp index 9b72f2407f..e5d39282b2 100644 --- a/Gems/LyShine/Code/Editor/HierarchyWidget.cpp +++ b/Gems/LyShine/Code/Editor/HierarchyWidget.cpp @@ -235,9 +235,7 @@ void HierarchyWidget::contextMenuEvent(QContextMenuEvent* ev) { HierarchyMenu contextMenu(this, (HierarchyMenu::Show::kCutCopyPaste | - HierarchyMenu::Show::kSavePrefab | HierarchyMenu::Show::kNew_EmptyElement | - HierarchyMenu::Show::kNew_ElementFromPrefabs | HierarchyMenu::Show::kDeleteElement | HierarchyMenu::Show::kNewSlice | HierarchyMenu::Show::kNew_InstantiateSlice | diff --git a/Gems/LyShine/Code/Editor/NewElementToolbarSection.cpp b/Gems/LyShine/Code/Editor/NewElementToolbarSection.cpp index c8de5afb11..d9342fe412 100644 --- a/Gems/LyShine/Code/Editor/NewElementToolbarSection.cpp +++ b/Gems/LyShine/Code/Editor/NewElementToolbarSection.cpp @@ -21,7 +21,6 @@ NewElementToolbarSection::NewElementToolbarSection(QToolBar* parent, bool addSep { HierarchyMenu contextMenu(editorWindow->GetHierarchy(), (HierarchyMenu::Show::kNew_EmptyElementAtRoot | - HierarchyMenu::Show::kNew_ElementFromPrefabsAtRoot | HierarchyMenu::Show::kNew_InstantiateSliceAtRoot), false); diff --git a/Gems/LyShine/Code/Editor/PrefabHelpers.cpp b/Gems/LyShine/Code/Editor/PrefabHelpers.cpp deleted file mode 100644 index c6f81dd56e..0000000000 --- a/Gems/LyShine/Code/Editor/PrefabHelpers.cpp +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#include "UiCanvasEditor_precompiled.h" - -#include "EditorCommon.h" -#include "AzFramework/StringFunc/StringFunc.h" -#include "Util/PathUtil.h" - -#include -#include - -namespace PrefabHelpers -{ - QAction* CreateSavePrefabAction(HierarchyWidget* hierarchy) - { - QAction* action = new QAction("(Deprecated) Save as Prefab...", hierarchy); - QObject::connect(action, - &QAction::triggered, - hierarchy, - [ hierarchy ]([[maybe_unused]] bool checked) - { - // Note that selectedItems() can be expensive, so call it once and save the value. - QTreeWidgetItemRawPtrQList selectedItems(hierarchy->selectedItems()); - if (selectedItems.isEmpty()) - { - QMessageBox(QMessageBox::Information, - "Selection Needed", - "Please select an element in the Hierarchy pane", - QMessageBox::Ok, hierarchy->GetEditorWindow()).exec(); - - return; - } - else if (selectedItems.size() > 1) - { - QMessageBox(QMessageBox::Information, - "Too Many Items Selected", - "Please select only one element in the Hierarchy pane", - QMessageBox::Ok, hierarchy->GetEditorWindow()).exec(); - - return; - } - - QString selectedFile = QFileDialog::getSaveFileName(nullptr, - QString(), - FileHelpers::GetAbsoluteGameDir(), - "*." UICANVASEDITOR_PREFAB_EXTENSION, - nullptr, - QFileDialog::DontConfirmOverwrite); - if (selectedFile.isEmpty()) - { - // Nothing to do. - return; - } - - FileHelpers::AppendExtensionIfNotPresent(selectedFile, UICANVASEDITOR_PREFAB_EXTENSION); - - AZ::EntityId canvasEntityId = hierarchy->GetEditorWindow()->GetCanvas(); - - // We've already checked if selectedItems is empty, so calling front() should be fine here - HierarchyItem* hierarchyItem = HierarchyItem::RttiCast(selectedItems.front()); - AZ::Entity* element = hierarchyItem->GetElement(); - - // Check if this element is OK to save as a prefab - UiCanvasInterface::ErrorCode errorCode = UiCanvasInterface::ErrorCode::NoError; - EBUS_EVENT_ID_RESULT(errorCode, canvasEntityId, UiCanvasBus, CheckElementValidToSaveAsPrefab, - element); - - if (errorCode != UiCanvasInterface::ErrorCode::NoError) - { - if (errorCode == UiCanvasInterface::ErrorCode::PrefabContainsExternalEntityRefs) - { - QMessageBox box(QMessageBox::Question, - "External references", - "The selected element contains references to elements that will not be in the prefab.\n" - "If saved these references will be cleared in the prefab.\n\n" - "Do you wish to save as prefab anyway?", - (QMessageBox::Yes | QMessageBox::No), hierarchy->GetEditorWindow()); - box.setDefaultButton(QMessageBox::No); - - int result = box.exec(); - if (result == QMessageBox::No) - { - return; - } - } - else - { - // this should never happen, but will if we forget to update this code when a new error is - // added - QMessageBox(QMessageBox::Information, - "Cannot save as prefab", - "Unknown error", - QMessageBox::Ok, hierarchy->GetEditorWindow()).exec(); - return; - } - } - - FileHelpers::SourceControlAddOrEdit(selectedFile.toStdString().c_str(), hierarchy->GetEditorWindow()); - - bool saveSuccessful = false; - EBUS_EVENT_ID_RESULT(saveSuccessful, canvasEntityId, UiCanvasBus, SaveAsPrefab, - selectedFile.toStdString().c_str(), element); - - // Refresh the menu to update "Add prefab...". - if (saveSuccessful) - { - QString gamePath(Path::FullPathToGamePath(selectedFile)); - hierarchy->GetEditorWindow()->AddPrefabFile(gamePath); - - return; - } - - QMessageBox(QMessageBox::Critical, - "Error", - "Unable to save file. Is the file read-only?", - QMessageBox::Ok, hierarchy->GetEditorWindow()).exec(); - }); - - return action; - } - - void CreateAddPrefabMenu(HierarchyWidget* hierarchy, - QTreeWidgetItemRawPtrQList& selectedItems, - QMenu* parent, - bool addAtRoot, - const QPoint* optionalPos) - { - // Find all the prefabs in the project directory and in any enabled Gems - IFileUtil::FileArray& files = hierarchy->GetEditorWindow()->GetPrefabFiles(); - if (files.empty()) - { - // Since this feature is deprecated we don't show the menu unles there are prefabs - return; - } - - QMenu* prefabMenu = parent->addMenu(QString("(Deprecated) Element%1 from prefab").arg(!addAtRoot && selectedItems.size() > 1 ? "s" : "")); - - QList result; - { - for (auto file : files) - { - // Get the filepath from the engine root directory - QString fullFileName = Path::GamePathToFullPath(file.filename); - QString filepath(fullFileName); - - // Extract the filename without its extension, get it from fullFileName rather than - // file.filename because the former preserves case - AZStd::string filename; - AzFramework::StringFunc::Path::GetFileName(fullFileName.toUtf8().data(), filename); - - QAction* action = new QAction(filename.c_str(), prefabMenu); - QObject::connect(action, - &QAction::triggered, - hierarchy, - [filepath, hierarchy, addAtRoot, optionalPos]([[maybe_unused]] bool checked) - { - if (addAtRoot) - { - hierarchy->clearSelection(); - } - - CommandHierarchyItemCreateFromData::Push(hierarchy->GetEditorWindow()->GetActiveStack(), - hierarchy, - hierarchy->selectedItems(), - true, - [hierarchy, filepath, optionalPos](HierarchyItem* parent, - LyShine::EntityArray& listOfNewlyCreatedTopLevelElements) - { - AZ::Entity* newEntity = nullptr; - EBUS_EVENT_ID_RESULT(newEntity, - hierarchy->GetEditorWindow()->GetCanvas(), - UiCanvasBus, - LoadFromPrefab, - filepath.toStdString().c_str(), - true, - (parent ? parent->GetElement() : nullptr)); - if (newEntity) - { - if (optionalPos) - { - EntityHelpers::MoveElementToGlobalPosition(newEntity, *optionalPos); - } - - listOfNewlyCreatedTopLevelElements.push_back(newEntity); - } - }, - "Prefab"); - }); - result.push_back(action); - } - } - - prefabMenu->addActions(result); - } -} // namespace PrefabHelpers diff --git a/Gems/LyShine/Code/Editor/PrefabHelpers.h b/Gems/LyShine/Code/Editor/PrefabHelpers.h deleted file mode 100644 index 5d39513715..0000000000 --- a/Gems/LyShine/Code/Editor/PrefabHelpers.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#pragma once - -namespace PrefabHelpers -{ - QAction* CreateSavePrefabAction(HierarchyWidget* hierarchy); - - void CreateAddPrefabMenu(HierarchyWidget* hierarchy, - QTreeWidgetItemRawPtrQList& selectedItems, - QMenu* parent, - bool addAtRoot, - const QPoint* optionalPos); -} // namespace PrefabHelpers diff --git a/Gems/LyShine/Code/Editor/ViewportWidget.cpp b/Gems/LyShine/Code/Editor/ViewportWidget.cpp index fd1374f31a..af0f93d8fa 100644 --- a/Gems/LyShine/Code/Editor/ViewportWidget.cpp +++ b/Gems/LyShine/Code/Editor/ViewportWidget.cpp @@ -428,9 +428,7 @@ void ViewportWidget::contextMenuEvent(QContextMenuEvent* e) const QPoint pos = e->pos(); HierarchyMenu contextMenu(m_editorWindow->GetHierarchy(), HierarchyMenu::Show::kCutCopyPaste | - HierarchyMenu::Show::kSavePrefab | HierarchyMenu::Show::kNew_EmptyElement | - HierarchyMenu::Show::kNew_ElementFromPrefabs | HierarchyMenu::Show::kDeleteElement | HierarchyMenu::Show::kNewSlice | HierarchyMenu::Show::kNew_InstantiateSlice | diff --git a/Gems/LyShine/Code/Source/Draw2d.cpp b/Gems/LyShine/Code/Source/Draw2d.cpp index a836395752..b4f2cc1672 100644 --- a/Gems/LyShine/Code/Source/Draw2d.cpp +++ b/Gems/LyShine/Code/Source/Draw2d.cpp @@ -536,22 +536,19 @@ AZ::Vector2 CDraw2d::Align(AZ::Vector2 position, AZ::Vector2 size, //////////////////////////////////////////////////////////////////////////////////////////////////// AZ::Data::Instance CDraw2d::LoadTexture(const AZStd::string& pathName) { - AZStd::string sourceRelativePath(pathName); - AZStd::string cacheRelativePath = sourceRelativePath + ".streamingimage"; - // The file may not be in the AssetCatalog at this point if it is still processing or doesn't exist on disk. // Use GenerateAssetIdTEMP instead of GetAssetIdByPath so that it will return a valid AssetId anyways AZ::Data::AssetId streamingImageAssetId; AZ::Data::AssetCatalogRequestBus::BroadcastResult( streamingImageAssetId, &AZ::Data::AssetCatalogRequestBus::Events::GenerateAssetIdTEMP, - sourceRelativePath.c_str()); + pathName.c_str()); streamingImageAssetId.m_subId = AZ::RPI::StreamingImageAsset::GetImageAssetSubId(); auto streamingImageAsset = AZ::Data::AssetManager::Instance().FindOrCreateAsset(streamingImageAssetId, AZ::Data::AssetLoadBehavior::PreLoad); AZ::Data::Instance image = AZ::RPI::StreamingImage::FindOrCreate(streamingImageAsset); if (!image) { - AZ_Error("Draw2d", false, "Failed to find or create an image instance from image asset '%s'", streamingImageAsset.GetHint().c_str()); + AZ_Error("Draw2d", false, "Failed to find or create an image instance from image asset '%s'", pathName.c_str()); } return image; diff --git a/Gems/LyShine/Code/Source/LyShineSystemComponent.cpp b/Gems/LyShine/Code/Source/LyShineSystemComponent.cpp index 26e2adf0b3..7521c8b6c1 100644 --- a/Gems/LyShine/Code/Source/LyShineSystemComponent.cpp +++ b/Gems/LyShine/Code/Source/LyShineSystemComponent.cpp @@ -135,7 +135,7 @@ namespace LyShine //////////////////////////////////////////////////////////////////////////////////////////////////// LyShineSystemComponent::LyShineSystemComponent() { - m_cursorImagePathname.SetAssetPath("engineassets/textures/cursor_green.tif"); + m_cursorImagePathname.SetAssetPath("Textures/Cursor_Default.tif"); } //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/Gems/LyShine/Code/Source/UiCanvasComponent.cpp b/Gems/LyShine/Code/Source/UiCanvasComponent.cpp index b678089cb4..b3a26de98e 100644 --- a/Gems/LyShine/Code/Source/UiCanvasComponent.cpp +++ b/Gems/LyShine/Code/Source/UiCanvasComponent.cpp @@ -590,174 +590,6 @@ bool UiCanvasComponent::SaveToXml(const string& assetIdPathname, const string& s return result; } -//////////////////////////////////////////////////////////////////////////////////////////////////// -UiCanvasInterface::ErrorCode UiCanvasComponent::CheckElementValidToSaveAsPrefab(AZ::Entity* entity) -{ - AZ_Assert(entity, "null entity ptr passed to SaveAsPrefab"); - - // Check that none of the EntityId's in this entity or its children reference entities that - // are not part of the prefab. - // First make a list of all entityIds that will be in the prefab - AZStd::vector entitiesInPrefab = GetEntityIdsOfElementAndDescendants(entity); - - // Next check all entity refs in the element to see if any are externel - // We use ReplaceEntityRefs even though we don't want to change anything - bool foundRefOutsidePrefab = false; - AZ::SerializeContext* context = nullptr; - EBUS_EVENT_RESULT(context, AZ::ComponentApplicationBus, GetSerializeContext); - AZ_Assert(context, "No serialization context found"); - AZ::EntityUtils::ReplaceEntityRefs(entity, [&](const AZ::EntityId& key, bool /*isEntityId*/) -> AZ::EntityId - { - if (key.IsValid()) - { - auto iter = AZStd::find(entitiesInPrefab.begin(), entitiesInPrefab.end(), key); - if (iter == entitiesInPrefab.end()) - { - foundRefOutsidePrefab = true; - } - } - return key; // always leave key unchanged - }, context); - - if (foundRefOutsidePrefab) - { - return UiCanvasInterface::ErrorCode::PrefabContainsExternalEntityRefs; - } - - return UiCanvasInterface::ErrorCode::NoError; -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// -bool UiCanvasComponent::SaveAsPrefab(const string& pathname, AZ::Entity* entity) -{ - AZ_Assert(entity, "null entity ptr passed to SaveAsPrefab"); - - AZ::SerializeContext* context = nullptr; - EBUS_EVENT_RESULT(context, AZ::ComponentApplicationBus, GetSerializeContext); - AZ_Assert(context, "No serialization context found"); - - // To be sure that we do not save an invalid prefab, if this entity contains entity references - // outside of the prefab set them to invalid references - // First make a list of all entityIds that will be in the prefab - AZStd::vector entitiesInPrefab = GetEntityIdsOfElementAndDescendants(entity); - - // Next make a serializable object containing all the entities to save (in order to check for invalid refs) - AZ::SliceComponent::InstantiatedContainer sourceObjects(false); - for (const AZ::EntityId& id : entitiesInPrefab) - { - AZ::Entity* sourceEntity = nullptr; - EBUS_EVENT_RESULT(sourceEntity, AZ::ComponentApplicationBus, FindEntity, id); - if (sourceEntity) - { - sourceObjects.m_entities.push_back(sourceEntity); - } - } - - // clone all the objects in order to replace external references - AZ::SliceComponent::InstantiatedContainer* clonedObjects = context->CloneObject(&sourceObjects); - AZ::Entity* clonedRootEntity = clonedObjects->m_entities[0]; - - // use ReplaceEntityRefs to replace external references with invalid IDs - // Note that we are not generating new IDs so we do not need to fixup internal references - AZ::EntityUtils::ReplaceEntityRefs(clonedObjects, [&](const AZ::EntityId& key, bool /*isEntityId*/) -> AZ::EntityId - { - if (key.IsValid()) - { - auto iter = AZStd::find(entitiesInPrefab.begin(), entitiesInPrefab.end(), key); - if (iter == entitiesInPrefab.end()) - { - return AZ::EntityId(); - } - } - return key; // leave key unchanged - }, context); - - // make a wrapper object around the prefab entity so that we have an opportunity to change what - // is in a prefab file in future. - UiSerialize::PrefabFileObject fileObject; - fileObject.m_rootEntityId = clonedRootEntity->GetId(); - - // add all of the entities that are not the root entity to a childEntities list - for (auto descendant : clonedObjects->m_entities) - { - fileObject.m_entities.push_back(descendant); - } - - bool result = AZ::Utils::SaveObjectToFile(pathname.c_str(), AZ::ObjectStream::ST_XML, &fileObject); - - // now delete the cloned entities we created, fixed up and saved - delete clonedObjects; - - return result; -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// -AZ::Entity* UiCanvasComponent::LoadFromPrefab(const string& pathname, bool makeUniqueName, AZ::Entity* optionalInsertionPoint) -{ - AZ::Entity* newEntity = nullptr; - - // Currently LoadObjectFromFile will hang if the file cannot be parsed - // (LMBR-10078). So first check that it is in the right format - if (!IsValidAzSerializedFile(pathname)) - { - return nullptr; - } - - // The top level object in the file is a wrapper object called PrefabFileObject - // this is to give us more protection against changes to what we store in the file in future - // NOTE: this read doesn't support pak files but that is OK because prefab files are an - // editor only feature. - UiSerialize::PrefabFileObject* fileObject = - AZ::Utils::LoadObjectFromFile(pathname.c_str()); - AZ_Assert(fileObject, "Failed to load prefab"); - - if (fileObject) - { - // We want new IDs so generate them and fixup all references within the list of entities - { - AZ::SerializeContext* context = nullptr; - EBUS_EVENT_RESULT(context, AZ::ComponentApplicationBus, GetSerializeContext); - AZ_Assert(context, "No serialization context found"); - - AZ::SliceComponent::EntityIdToEntityIdMap entityIdMap; - AZ::IdUtils::Remapper::GenerateNewIdsAndFixRefs(fileObject, entityIdMap, context); - } - - // add all of the entities to this canvases EntityContext - m_entityContext->AddUiEntities(fileObject->m_entities); - - EBUS_EVENT_RESULT(newEntity, AZ::ComponentApplicationBus, FindEntity, fileObject->m_rootEntityId); - - delete fileObject; // we do not keep the file wrapper object around - - if (makeUniqueName) - { - AZ::EntityId parentEntityId; - if (optionalInsertionPoint) - { - parentEntityId = optionalInsertionPoint->GetId(); - } - AZStd::string uniqueName = GetUniqueChildName(parentEntityId, newEntity->GetName(), nullptr); - newEntity->SetName(uniqueName); - } - - UiElementComponent* elementComponent = newEntity->FindComponent(); - AZ_Assert(elementComponent, "No element component found on prefab entity"); - - AZ::Entity* parent = (optionalInsertionPoint) ? optionalInsertionPoint : GetRootElement(); - - // recursively visit all the elements and set their canvas and parent pointers - elementComponent->FixupPostLoad(newEntity, this, parent, true); - - // add this new entity as a child of the parent (insertionPoint or root) - UiElementComponent* parentElementComponent = parent->FindComponent(); - AZ_Assert(parentElementComponent, "No element component found on parent entity"); - parentElementComponent->AddChild(newEntity); - } - - return newEntity; -} - //////////////////////////////////////////////////////////////////////////////////////////////////// void UiCanvasComponent::FixupCreatedEntities(LyShine::EntityArray topLevelEntities, bool makeUniqueNamesAndIds, AZ::Entity* optionalInsertionPoint) { @@ -3695,6 +3527,7 @@ void UiCanvasComponent::CreateRenderTarget() return; } +#ifdef LYSHINE_ATOM_TODO // [LYN-3359] Support RTT using Atom // Create a render target that this canvas will be rendered to. // The render target size is the canvas size. m_renderTargetHandle = gEnv->pRenderer->CreateRenderTarget(m_renderTargetName.c_str(), @@ -3716,6 +3549,7 @@ void UiCanvasComponent::CreateRenderTarget() ISystem::CrySystemNotificationBus::Handler::BusConnect(); } +#endif } //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -3734,7 +3568,7 @@ void UiCanvasComponent::DestroyRenderTarget() //////////////////////////////////////////////////////////////////////////////////////////////////// void UiCanvasComponent::RenderCanvasToTexture() { -#ifdef LYSHINE_ATOM_TODO +#ifdef LYSHINE_ATOM_TODO // [LYN-3359] Support RTT using Atom if (m_renderTargetHandle <= 0) { return; diff --git a/Gems/LyShine/Code/Source/UiCanvasComponent.h b/Gems/LyShine/Code/Source/UiCanvasComponent.h index df904684ec..b4815f4a76 100644 --- a/Gems/LyShine/Code/Source/UiCanvasComponent.h +++ b/Gems/LyShine/Code/Source/UiCanvasComponent.h @@ -99,11 +99,6 @@ public: // member functions AZ::EntityId FindInteractableToHandleEvent(AZ::Vector2 point) override; bool SaveToXml(const string& assetIdPathname, const string& sourceAssetPathname) override; - bool SaveAsPrefab(const string& pathname, AZ::Entity* entity) override; - UiCanvasInterface::ErrorCode CheckElementValidToSaveAsPrefab(AZ::Entity* entity) override; - AZ::Entity* LoadFromPrefab(const string& pathname, - bool makeUniqueName, - AZ::Entity* optionalInsertionPoint) override; void FixupCreatedEntities(LyShine::EntityArray topLevelEntities, bool makeUniqueNamesAndIds, AZ::Entity* optionalInsertionPoint) override; void AddElement(AZ::Entity* element, AZ::Entity* parent, AZ::Entity* insertBefore) override; void ReinitializeElements() override; diff --git a/Gems/LyShine/Code/Source/UiFaderComponent.cpp b/Gems/LyShine/Code/Source/UiFaderComponent.cpp index 9f5ca82a9c..08f6c89b3a 100644 --- a/Gems/LyShine/Code/Source/UiFaderComponent.cpp +++ b/Gems/LyShine/Code/Source/UiFaderComponent.cpp @@ -452,6 +452,7 @@ void UiFaderComponent::CreateOrResizeRenderTarget(const AZ::Vector2& pixelAligne m_viewportTopLeft = pixelAlignedTopLeft; m_viewportSize = renderTargetSize; +#ifdef LYSHINE_ATOM_TODO // [LYN-3359] Support RTT using Atom // Check if the render target already exists if (m_renderTargetHandle != -1) { @@ -494,6 +495,7 @@ void UiFaderComponent::CreateOrResizeRenderTarget(const AZ::Vector2& pixelAligne DestroyRenderTarget(); } } +#endif // at this point either all render targets and depth surfaces are created or none are. // If all succeeded then update the render target size @@ -637,6 +639,7 @@ void UiFaderComponent::RenderRttFader(LyShine::IRenderGraph* renderGraph, UiElem } } +#ifdef LYSHINE_ATOM_TODO // [LYN-3359] Support RTT using Atom // Add a primitive to render a quad using the render target we have created { // Set the texture and other render state required @@ -650,6 +653,7 @@ void UiFaderComponent::RenderRttFader(LyShine::IRenderGraph* renderGraph, UiElem renderGraph->AddPrimitive(&m_cachedPrimitive, texture, isClampTextureMode, isTextureSRGB, isTexturePremultipliedAlpha, blendMode); } +#endif } } diff --git a/Gems/LyShine/Code/Source/UiMaskComponent.cpp b/Gems/LyShine/Code/Source/UiMaskComponent.cpp index 80a8054e89..1c1327ee34 100644 --- a/Gems/LyShine/Code/Source/UiMaskComponent.cpp +++ b/Gems/LyShine/Code/Source/UiMaskComponent.cpp @@ -553,6 +553,7 @@ void UiMaskComponent::CreateOrResizeRenderTarget(const AZ::Vector2& pixelAligned m_viewportTopLeft = pixelAlignedTopLeft; m_viewportSize = renderTargetSize; +#ifdef LYSHINE_ATOM_TODO // [LYN-3359] Support RTT using Atom // Check if the render target already exists if (m_contentRenderTargetHandle != -1) { @@ -618,6 +619,7 @@ void UiMaskComponent::CreateOrResizeRenderTarget(const AZ::Vector2& pixelAligned DestroyRenderTarget(); } } +#endif // at this point either all render targets and depth surfaces are created or none are. // If all succeeded then update the render target size @@ -803,6 +805,7 @@ void UiMaskComponent::RenderUsingGradientMask(LyShine::IRenderGraph* renderGraph } } +#ifdef LYSHINE_ATOM_TODO // [LYN-3359] Support RTT using Atom // Add a primitive to do the alpha mask { // Set the texture and other render state required @@ -817,6 +820,7 @@ void UiMaskComponent::RenderUsingGradientMask(LyShine::IRenderGraph* renderGraph renderGraph->AddAlphaMaskPrimitive(&m_cachedPrimitive, texture, maskTexture, isClampTextureMode, isTextureSRGB, isTexturePremultipliedAlpha, blendMode); } +#endif } } diff --git a/Gems/LyShine/Code/Source/UiSerialize.cpp b/Gems/LyShine/Code/Source/UiSerialize.cpp index 80ff9113f2..639821930a 100644 --- a/Gems/LyShine/Code/Source/UiSerialize.cpp +++ b/Gems/LyShine/Code/Source/UiSerialize.cpp @@ -556,11 +556,6 @@ namespace UiSerialize serializeContext->Class >()-> Serializer(&AZ::Serialize::StaticInstance::s_instance); - serializeContext->Class() - ->Version(2, &PrefabFileObject::VersionConverter) - ->Field("RootEntity", &PrefabFileObject::m_rootEntityId) - ->Field("Entities", &PrefabFileObject::m_entities); - serializeContext->Class() ->Version(1) ->Field("SerializeString", &AnimationData::m_serializeData); @@ -607,54 +602,6 @@ namespace UiSerialize } } - //////////////////////////////////////////////////////////////////////////////////////////////////// - bool PrefabFileObject::VersionConverter(AZ::SerializeContext& context, AZ::SerializeContext::DataElementNode& classElement) - { - if (classElement.GetVersion() == 1) - { - // this is an old UI prefab (prior to UI Slices). We need to move all of the owned child entities into a - // separate list and have the references to them be via entity ID - - // Find the m_rootEntity in the PrefabFileObject, in the old format this is an entity, - // we will replace it with an entityId - int rootEntityIndex = classElement.FindElement(AZ_CRC("RootEntity", 0x3cead042)); - if (rootEntityIndex == -1) - { - return false; - } - AZ::SerializeContext::DataElementNode& rootEntityNode = classElement.GetSubElement(rootEntityIndex); - - // All UI element entities will be copied to this container and then added to the m_childEntities list - AZStd::vector copiedEntities; - - // recursively process the root element and all of its child elements, copying their child entities to the - // entities container and replacing them with EntityIds - if (!UiElementComponent::MoveEntityAndDescendantsToListAndReplaceWithEntityId(context, rootEntityNode, -1, copiedEntities)) - { - return false; - } - - // Create the child entities member (which is a generic vector) - using entityVector = AZStd::vector; - AZ::SerializeContext::ClassData* classData = AZ::SerializeGenericTypeInfo::GetGenericInfo()->GetClassData(); - int entitiesIndex = classElement.AddElement(context, "Entities", *classData); - if (entitiesIndex == -1) - { - return false; - } - AZ::SerializeContext::DataElementNode& entitiesNode = classElement.GetSubElement(entitiesIndex); - - // now add all of the copied entities to the entities vector node - for (AZ::SerializeContext::DataElementNode& entityElement : copiedEntities) - { - entityElement.SetName("element"); // all elements in the Vector should have this name - entitiesNode.AddElement(entityElement); - } - } - - return true; - } - //////////////////////////////////////////////////////////////////////////////////////////////// // Helper function to VersionConverter to move three state actions from the derived interactable // to the interactable base class diff --git a/Gems/LyShine/Code/Source/UiSerialize.h b/Gems/LyShine/Code/Source/UiSerialize.h index 9bdddceba2..c3ad18420d 100644 --- a/Gems/LyShine/Code/Source/UiSerialize.h +++ b/Gems/LyShine/Code/Source/UiSerialize.h @@ -16,20 +16,6 @@ namespace UiSerialize //! Define the Cry and UI types for the AZ Serialize system void ReflectUiTypes(AZ::ReflectContext* context); - //! Wrapper class for prefab file. This allows us to make changes to what the top - //! level objects are in the prefab file and do some conversion - //! NOTE: This is only used for old pre-slices UI prefabs - class PrefabFileObject - { - public: - virtual ~PrefabFileObject() { } - AZ_CLASS_ALLOCATOR(PrefabFileObject, AZ::SystemAllocator, 0); - AZ_RTTI(PrefabFileObject, "{C264CC6F-E50C-4813-AAE6-F7AB0B1774D0}"); - static bool VersionConverter(AZ::SerializeContext& context, AZ::SerializeContext::DataElementNode& classElement); - AZ::EntityId m_rootEntityId; - AZStd::vector m_entities; - }; - //! Wrapper class for animation system data file. This allows us to use the old Cry //! serialize for the animation data class AnimationData diff --git a/Gems/LyShine/Code/Source/World/UiCanvasOnMeshComponent.h b/Gems/LyShine/Code/Source/World/UiCanvasOnMeshComponent.h index b861d04784..83fc705bf6 100644 --- a/Gems/LyShine/Code/Source/World/UiCanvasOnMeshComponent.h +++ b/Gems/LyShine/Code/Source/World/UiCanvasOnMeshComponent.h @@ -62,7 +62,7 @@ public: // static member functions static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required) { - required.push_back(AZ_CRC("LegacyMeshService", 0xb462a299)); + required.push_back(AZ_CRC("MeshService", 0x71d8a455)); required.push_back(AZ_CRC("UiCanvasRefService", 0xb4cb5ef4)); } diff --git a/Gems/LyShine/Code/lyshine_uicanvaseditor_files.cmake b/Gems/LyShine/Code/lyshine_uicanvaseditor_files.cmake index 84a5f560c7..7d6e995d10 100644 --- a/Gems/LyShine/Code/lyshine_uicanvaseditor_files.cmake +++ b/Gems/LyShine/Code/lyshine_uicanvaseditor_files.cmake @@ -108,8 +108,6 @@ set(FILES Editor/PivotPresets.h Editor/PivotPresetsWidget.cpp Editor/PivotPresetsWidget.h - Editor/PrefabHelpers.cpp - Editor/PrefabHelpers.h Editor/PresetButton.cpp Editor/PresetButton.h Editor/PreviewActionLog.cpp diff --git a/Gems/Microphone/Code/CMakeLists.txt b/Gems/Microphone/Code/CMakeLists.txt index be71d65e33..077797fdd6 100644 --- a/Gems/Microphone/Code/CMakeLists.txt +++ b/Gems/Microphone/Code/CMakeLists.txt @@ -22,7 +22,7 @@ ly_add_target( Source BUILD_DEPENDENCIES PRIVATE - Gem::AudioSystem + Gem::AudioSystem.Static PUBLIC 3rdParty::libsamplerate Legacy::CryCommon @@ -39,10 +39,7 @@ ly_add_target( BUILD_DEPENDENCIES PRIVATE Gem::Microphone.Static - RUNTIME_DEPENDENCIES - Gem::AudioSystem ) -# The above "Microphone" target is used by all interactive applications -ly_create_alias(NAME Microphone.Clients NAMESPACE Gem TARGETS Gem::Microphone) -ly_create_alias(NAME Microphone.Tools NAMESPACE Gem TARGETS Gem::Microphone) +ly_create_alias(NAME Microphone.Clients NAMESPACE Gem TARGETS Gem::Microphone Gem::AudioSystem) +ly_create_alias(NAME Microphone.Tools NAMESPACE Gem TARGETS Gem::Microphone Gem::AudioSystem.Editor) diff --git a/Gems/Multiplayer/Code/Source/Pipeline/NetworkPrefabProcessor.cpp b/Gems/Multiplayer/Code/Source/Pipeline/NetworkPrefabProcessor.cpp index 0c6235eefe..57baec2f5f 100644 --- a/Gems/Multiplayer/Code/Source/Pipeline/NetworkPrefabProcessor.cpp +++ b/Gems/Multiplayer/Code/Source/Pipeline/NetworkPrefabProcessor.cpp @@ -72,21 +72,24 @@ namespace Multiplayer } static void GatherNetEntities( - AzToolsFramework::Prefab::Instance* instance, - AZStd::vector>& output) + AzToolsFramework::Prefab::Instance* instance, + AZStd::unordered_map& entityToInstanceMap, + AZStd::vector& netEntities) { - instance->GetEntities([instance, &output](AZStd::unique_ptr& prefabEntity) + instance->GetEntities([instance, &entityToInstanceMap, &netEntities](AZStd::unique_ptr& prefabEntity) { if (prefabEntity->FindComponent()) { - output.push_back(AZStd::make_pair(prefabEntity.get(), instance)); + AZ::Entity* entity = prefabEntity.get(); + entityToInstanceMap[entity] = instance; + netEntities.push_back(entity); } return true; }); - instance->GetNestedInstances([&output](AZStd::unique_ptr& nestedInstance) + instance->GetNestedInstances([&entityToInstanceMap, &netEntities](AZStd::unique_ptr& nestedInstance) { - GatherNetEntities(nestedInstance.get(), output); + GatherNetEntities(nestedInstance.get(), entityToInstanceMap, netEntities); }); } @@ -112,33 +115,32 @@ namespace Multiplayer auto&& [object, networkSpawnable] = ProcessedObjectStore::Create(uniqueName, context.GetSourceUuid(), AZStd::move(serializer)); + auto& netSpawnableEntities = networkSpawnable->GetEntities(); // Grab all net entities with their corresponding Instances to handle nested prefabs correctly - AZStd::vector> netEntities; - GatherNetEntities(sourceInstance.get(), netEntities); + AZStd::unordered_map netEntityToInstanceMap; + AZStd::vector prefabNetEntities; + GatherNetEntities(sourceInstance.get(), netEntityToInstanceMap, prefabNetEntities); - if (netEntities.empty()) + if (prefabNetEntities.empty()) { // No networked entities in the prefab, no need to do anything in this processor. return; } - // Instance container for net entities - AZStd::unique_ptr networkInstance(aznew Instance()); - networkInstance->SetTemplateSourcePath(AZ::IO::PathView(uniqueName)); + // Sort the entities prior to processing. The entities will end up in the net spawnable in this order. + SpawnableUtils::SortEntitiesByTransformHierarchy(prefabNetEntities); // Create an asset for our future network spawnable: this allows us to put references to the asset in the components AZ::Data::Asset networkSpawnableAsset; networkSpawnableAsset.Create(networkSpawnable->GetId()); networkSpawnableAsset.SetAutoLoadBehavior(AZ::Data::AssetLoadBehavior::PreLoad); - // Each spawnable has a root meta-data entity at position 0, so starting net indices from 1 - size_t netEntitiesIndexCounter = 1; + size_t netEntitiesIndexCounter = 0; - for (auto& entityInstancePair : netEntities) + for (auto* prefabEntity : prefabNetEntities) { - AZ::Entity* prefabEntity = entityInstancePair.first; - Instance* instance = entityInstancePair.second; + Instance* instance = netEntityToInstanceMap[prefabEntity]; AZ::EntityId entityId = prefabEntity->GetId(); AZ::Entity* netEntity = instance->DetachEntity(entityId).release(); @@ -147,7 +149,11 @@ namespace Multiplayer // Net entity will need a new ID to avoid IDs collision netEntity->SetId(AZ::Entity::MakeId()); - networkInstance->AddEntity(*netEntity); + netEntity->InvalidateDependencies(); + netEntity->EvaluateDependencies(); + + // Insert the entity into the target net spawnable + netSpawnableEntities.emplace_back(netEntity); // Use the old ID for the breadcrumb entity to keep parent-child relationship in the original spawnable AZ::Entity* breadcrumbEntity = aznew AZ::Entity(entityId, netEntity->GetName()); @@ -185,37 +191,12 @@ namespace Multiplayer } // save the final result in the target Prefab DOM. - PrefabDom networkPrefab; - if (!PrefabDomUtils::StoreInstanceInPrefabDom(*networkInstance, networkPrefab)) - { - AZ_Error("NetworkPrefabProcessor", false, "Saving exported Prefab Instance within a Prefab Dom failed."); - return; - } - if (!PrefabDomUtils::StoreInstanceInPrefabDom(*sourceInstance, prefab)) { AZ_Error("NetworkPrefabProcessor", false, "Saving exported Prefab Instance within a Prefab Dom failed."); return; } - bool result = SpawnableUtils::CreateSpawnable(*networkSpawnable, networkPrefab); - if (result) - { - AzFramework::Spawnable::EntityList& entities = networkSpawnable->GetEntities(); - for (auto it = entities.begin(); it != entities.end(); ++it) - { - (*it)->InvalidateDependencies(); - (*it)->EvaluateDependencies(); - } - - SpawnableUtils::SortEntitiesByTransformHierarchy(*networkSpawnable); - - context.GetProcessedObjects().push_back(AZStd::move(object)); - } - else - { - AZ_Error("Prefabs", false, "Failed to convert prefab '%.*s' to a spawnable.", AZ_STRING_ARG(prefabName)); - context.ErrorEncountered(); - } + context.GetProcessedObjects().push_back(AZStd::move(object)); } } diff --git a/Gems/PhysX/Code/Source/Common/PhysXSceneQueryHelpers.cpp b/Gems/PhysX/Code/Source/Common/PhysXSceneQueryHelpers.cpp index 37e37d07e3..c157f14871 100644 --- a/Gems/PhysX/Code/Source/Common/PhysXSceneQueryHelpers.cpp +++ b/Gems/PhysX/Code/Source/Common/PhysXSceneQueryHelpers.cpp @@ -45,11 +45,17 @@ namespace PhysX hit.m_distance = pxHit.distance; hit.m_resultFlags |= AzPhysics::SceneQuery::ResultFlags::Distance; - hit.m_position = PxMathConvert(pxHit.position); - hit.m_resultFlags |= AzPhysics::SceneQuery::ResultFlags::Position; + if (pxHit.flags & physx::PxHitFlag::ePOSITION) + { + hit.m_position = PxMathConvert(pxHit.position); + hit.m_resultFlags |= AzPhysics::SceneQuery::ResultFlags::Position; + } - hit.m_normal = PxMathConvert(pxHit.normal); - hit.m_resultFlags |= AzPhysics::SceneQuery::ResultFlags::Normal; + if (pxHit.flags & physx::PxHitFlag::eNORMAL) + { + hit.m_normal = PxMathConvert(pxHit.normal); + hit.m_resultFlags |= AzPhysics::SceneQuery::ResultFlags::Normal; + } const ActorData* actorData = Utils::GetUserData(pxHit.actor); hit.m_bodyHandle = actorData->GetBodyHandle(); diff --git a/Gems/PhysX/Code/Source/Scene/PhysXScene.cpp b/Gems/PhysX/Code/Source/Scene/PhysXScene.cpp index 22df3f0758..81010a6db6 100644 --- a/Gems/PhysX/Code/Source/Scene/PhysXScene.cpp +++ b/Gems/PhysX/Code/Source/Scene/PhysXScene.cpp @@ -348,6 +348,8 @@ namespace PhysX { const physx::PxTransform pose = PxMathConvert(shapecastRequest->m_start); const physx::PxVec3 dir = PxMathConvert(shapecastRequest->m_direction.GetNormalized()); + AZ_Warning("PhysXScene", (static_cast(shapecastRequest->m_hitFlags & AzPhysics::SceneQuery::HitFlags::MTD) != 0), + "Not having MTD set for shape scene queries may result in incorrect reporting of colliders that are in contact or intersect the initial pose of the sweep."); const physx::PxHitFlags hitFlags = SceneQueryHelpers::GetPxHitFlags(shapecastRequest->m_hitFlags); bool status = false; diff --git a/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp b/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp index 035fa0f855..4b6b7227a4 100644 --- a/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp +++ b/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp @@ -19,7 +19,7 @@ #include #include -// Undo this + // Undo this AZ_PUSH_DISABLE_WARNING(4251 4800 4244, "-Wunknown-warning-option") #include #include @@ -90,8 +90,8 @@ namespace ScriptCanvasEditor void EditorAssetSystemComponent::Deactivate() { ScriptCanvas::Translation::RequestBus::Handler::BusDisconnect(); - ScriptCanvas::Grammar::RequestBus::Handler::BusDisconnect(); - + ScriptCanvas::Grammar::RequestBus::Handler::BusDisconnect(); + EditorAssetConversionBus::Handler::BusDisconnect(); AzToolsFramework::AssetBrowser::AssetBrowserInteractionNotificationBus::Handler::BusDisconnect(); m_editorAssetRegistry.Unregister(); @@ -119,8 +119,8 @@ namespace ScriptCanvasEditor AZ::Data::Asset EditorAssetSystemComponent::LoadAsset(AZStd::string_view graphPath) { - auto outcome = ScriptCanvasBuilder::LoadEditorAsset(graphPath); - + auto outcome = ScriptCanvasBuilder::LoadEditorAsset(graphPath, AZ::Data::AssetId(AZ::Uuid::CreateRandom())); + if (outcome.IsSuccess()) { return outcome.GetValue(); diff --git a/Gems/ScriptCanvas/Code/Asset/RuntimeAssetSystemComponent.cpp b/Gems/ScriptCanvas/Code/Asset/RuntimeAssetSystemComponent.cpp index 9cee1fb375..e993b21b26 100644 --- a/Gems/ScriptCanvas/Code/Asset/RuntimeAssetSystemComponent.cpp +++ b/Gems/ScriptCanvas/Code/Asset/RuntimeAssetSystemComponent.cpp @@ -21,8 +21,10 @@ namespace ScriptCanvas void RuntimeAssetSystemComponent::Reflect(AZ::ReflectContext* context) { - ScriptCanvas::RuntimeData::Reflect(context); - ScriptCanvas::SubgraphInterfaceData::Reflect(context); + RuntimeData::Reflect(context); + RuntimeDataOverrides::Reflect(context); + SubgraphInterfaceData::Reflect(context); + if (auto serializeContext = azrtti_cast(context)) { serializeContext->Class() diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp new file mode 100644 index 0000000000..dbd36b3641 --- /dev/null +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp @@ -0,0 +1,376 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include +#include +#include +#include +#include + +namespace ScriptCanvasBuilderCpp +{ + void AppendTabs(AZStd::string& result, size_t depth) + { + for (size_t i = 0; i < depth; ++i) + { + result += "\t"; + } + } +} + +namespace ScriptCanvasBuilder +{ + void BuildVariableOverrides::Clear() + { + m_source.Reset(); + m_variables.clear(); + m_entityIds.clear(); + m_dependencies.clear(); + } + + void BuildVariableOverrides::CopyPreviousOverriddenValues(const BuildVariableOverrides& source) + { + for (auto& overriddenValue : m_overrides) + { + auto iter = AZStd::find_if(source.m_overrides.begin(), source.m_overrides.end(), [&overriddenValue](const auto& candidate) { return candidate.GetVariableId() == overriddenValue.GetVariableId(); }); + + if (iter != source.m_overrides.end()) + { + overriddenValue.DeepCopy(*iter); + overriddenValue.SetScriptInputControlVisibility(AZ::Edit::PropertyVisibility::Hide); + overriddenValue.SetAllowSignalOnChange(false); + // check that a name update is not necessary anymore + } + } + + ////////////////////////////////////////////////////////////////////////// + // #functions2 provide an identifier for the node/variable in the source that caused the dependency. the root will not have one. + // the above will provide the data to handle the cases where only certain dependency nodes were removed + // until then we do a sanity check, if any part of the depenecies were altered, assume no overrides are valid. + if (m_dependencies.size() != source.m_dependencies.size()) + { + return; + } + else + { + for (size_t index = 0; index != m_dependencies.size(); ++index) + { + if (m_dependencies[index].m_source != source.m_dependencies[index].m_source) + { + return; + } + } + } + ////////////////////////////////////////////////////////////////////////// + + for (size_t index = 0; index != m_dependencies.size(); ++index) + { + m_dependencies[index].CopyPreviousOverriddenValues(source.m_dependencies[index]); + } + } + + bool BuildVariableOverrides::IsEmpty() const + { + return m_variables.empty() && m_entityIds.empty() && m_dependencies.empty(); + } + + void BuildVariableOverrides::Reflect(AZ::ReflectContext* reflectContext) + { + if (auto serializeContext = azrtti_cast(reflectContext)) + { + serializeContext->Class() + ->Version(0) + ->Field("source", &BuildVariableOverrides::m_source) + ->Field("variables", &BuildVariableOverrides::m_variables) + ->Field("entityId", &BuildVariableOverrides::m_entityIds) + ->Field("overrides", &BuildVariableOverrides::m_overrides) + ->Field("dependencies", &BuildVariableOverrides::m_dependencies) + ; + + if (auto editContext = serializeContext->GetEditContext()) + { + editContext->Class< BuildVariableOverrides>("Variables", "Variables exposed by the attached Script Canvas Graph") + ->ClassElement(AZ::Edit::ClassElements::Group, "Variable Fields") + ->Attribute(AZ::Edit::Attributes::AutoExpand, true) + ->DataElement(AZ::Edit::UIHandlers::Default, &BuildVariableOverrides::m_overrides, "Variables", "Array of Variables within Script Canvas Graph") + ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) + ->DataElement(AZ::Edit::UIHandlers::Default, &BuildVariableOverrides::m_dependencies, "Dependencies", "Variables in Dependencies of the Script Canvas Graph") + ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) + ; + } + } + } + + // use this to initialize the new data, and make sure they have a editor graph variable for proper editor display + void BuildVariableOverrides::PopulateFromParsedResults(const ScriptCanvas::Grammar::ParsedRuntimeInputs& inputs, const ScriptCanvas::VariableData& variables) + { + for (auto& variable : inputs.m_variables) + { + auto graphVariable = variables.FindVariable(variable.first); + if (!graphVariable) + { + AZ_Error("ScriptCanvasBuilder", false, "Missing Variable from graph data that was just parsed"); + continue; + } + + m_variables.push_back(*graphVariable); + auto& buildVariable = m_variables.back(); + buildVariable.DeepCopy(*graphVariable); // in case of BCO, a new one needs to be created + + // copy to override list for editor display + m_overrides.push_back(*graphVariable); + auto& overrideValue = m_overrides.back(); + overrideValue.DeepCopy(*graphVariable); + overrideValue.SetScriptInputControlVisibility(AZ::Edit::PropertyVisibility::Hide); + overrideValue.SetAllowSignalOnChange(false); + } + + for (auto& entityId : inputs.m_entityIds) + { + m_entityIds.push_back(entityId); + + if (!ScriptCanvas::Grammar::IsParserGeneratedId(entityId.first)) + { + auto graphEntityId = variables.FindVariable(entityId.first); + if (!graphEntityId) + { + AZ_Error("ScriptCanvasBuilder", false, "Missing EntityId from graph data that was just parsed"); + continue; + } + + // copy to override list for editor display + if (graphEntityId->IsComponentProperty()) + { + m_overrides.push_back(*graphEntityId); + auto& overrideValue = m_overrides.back(); + overrideValue.SetScriptInputControlVisibility(AZ::Edit::PropertyVisibility::Hide); + overrideValue.SetAllowSignalOnChange(false); + } + } + } + } + + EditorAssetTree* EditorAssetTree::ModRoot() + { + if (!m_parent) + { + return this; + } + + return m_parent->ModRoot(); + } + + void EditorAssetTree::SetParent(EditorAssetTree& parent) + { + m_parent = &parent; + } + + AZStd::string EditorAssetTree::ToString(size_t depth) const + { + AZStd::string result; + ScriptCanvasBuilderCpp::AppendTabs(result, depth); + result += m_asset.GetId().ToString(); + result += m_asset.GetHint(); + depth += m_dependencies.empty() ? 0 : 1; + + for (const auto& dependency : m_dependencies) + { + result += "\n"; + ScriptCanvasBuilderCpp::AppendTabs(result, depth); + result += dependency.ToString(depth); + } + + return result; + } + + ScriptCanvas::RuntimeDataOverrides ConvertToRuntime(const BuildVariableOverrides& buildOverrides) + { + ScriptCanvas::RuntimeDataOverrides runtimeOverrides; + + runtimeOverrides.m_runtimeAsset = AZ::Data::Asset + (AZ::Data::AssetId(buildOverrides.m_source.GetId().m_guid, AZ_CRC("RuntimeData", 0x163310ae)), azrtti_typeid(), {}); + runtimeOverrides.m_runtimeAsset.SetAutoLoadBehavior(AZ::Data::AssetLoadBehavior::PreLoad); + runtimeOverrides.m_variableIndices.resize(buildOverrides.m_variables.size()); + + for (size_t index = 0; index != buildOverrides.m_variables.size(); ++index) + { + auto& variable = buildOverrides.m_variables[index]; + auto iter = AZStd::find_if + ( buildOverrides.m_overrides.begin() + , buildOverrides.m_overrides.end() + , [&variable](auto& candidate) { return candidate.GetVariableId() == variable.GetVariableId(); }); + + if (iter != buildOverrides.m_overrides.end()) + { + if (iter->GetDatum()) + { + runtimeOverrides.m_variables.push_back(ScriptCanvas::RuntimeVariable(iter->GetDatum()->ToAny())); + runtimeOverrides.m_variableIndices[index] = true; + } + else + { + AZ_Warning("ScriptCanvasBuilder", false, "build overrides missing variable override, Script may not function properly"); + runtimeOverrides.m_variableIndices[index] = false; + } + } + else + { + runtimeOverrides.m_variableIndices[index] = false; + } + } + + for (auto& entity : buildOverrides.m_entityIds) + { + auto& variableId = entity.first; + auto iter = AZStd::find_if(buildOverrides.m_overrides.begin(), buildOverrides.m_overrides.end(), [&variableId](auto& candidate) { return candidate.GetVariableId() == variableId; }); + if (iter != buildOverrides.m_overrides.end()) + { + // the entity was overridden on the instance + if (iter->GetDatum() && iter->GetDatum()->GetAs()) + { + runtimeOverrides.m_entityIds.push_back(*iter->GetDatum()->GetAs()); + } + else + { + AZ_Warning("ScriptCanvasBuilder", false, "build overrides missing EntityId, Script may not function properly"); + runtimeOverrides.m_entityIds.push_back(AZ::EntityId{}); + } + } + else + { + // the entity is overridden, as part of the required process of to instantiation + runtimeOverrides.m_entityIds.push_back(entity.second); + } + } + + for (auto& buildDependency : buildOverrides.m_dependencies) + { + runtimeOverrides.m_dependencies.push_back(ConvertToRuntime(buildDependency)); + } + + return runtimeOverrides; + } + + AZ::Outcome LoadEditorAssetTree(AZ::Data::AssetId editorAssetId, AZStd::string_view assetHint, EditorAssetTree* parent) + { + EditorAssetTree result; + AZ::Data::AssetInfo assetInfo; + AZStd::string watchFolder; + bool resultFound = false; + + if (!AzToolsFramework::AssetSystemRequestBus::FindFirstHandler()) + { + return AZ::Failure(AZStd::string("LoadEditorAssetTree found no handler for AzToolsFramework::AssetSystemRequestBus.")); + } + + AzToolsFramework::AssetSystemRequestBus::BroadcastResult + ( resultFound + , &AzToolsFramework::AssetSystem::AssetSystemRequest::GetSourceInfoBySourceUUID + , editorAssetId.m_guid + , assetInfo + , watchFolder); + + if (!resultFound) + { + return AZ::Failure(AZStd::string::format("LoadEditorAssetTree failed to get engine relative path from %s-%.*s.", editorAssetId.ToString().c_str(), aznumeric_cast(assetHint.size()), assetHint.data())); + } + + AZStd::vector dependentAssets; + + auto filterCB = [&dependentAssets](const AZ::Data::AssetFilterInfo& filterInfo)->bool + { + if (filterInfo.m_assetType == azrtti_typeid()) + { + dependentAssets.push_back(AZ::Data::AssetId(filterInfo.m_assetId.m_guid, 0)); + } + else if (filterInfo.m_assetType == azrtti_typeid()) + { + dependentAssets.push_back(filterInfo.m_assetId); + } + + return true; + }; + + auto loadAssetOutcome = ScriptCanvasBuilder::LoadEditorAsset(assetInfo.m_relativePath, editorAssetId, filterCB); + if (!loadAssetOutcome.IsSuccess()) + { + return AZ::Failure(AZStd::string::format("LoadEditorAssetTree failed to load graph from %s-%s: %s", editorAssetId.ToString().c_str(), assetHint.data(), loadAssetOutcome.GetError().c_str())); + } + + for (auto& dependentAsset : dependentAssets) + { + auto loadDependentOutcome = LoadEditorAssetTree(dependentAsset, "", &result); + if (!loadDependentOutcome.IsSuccess()) + { + return AZ::Failure(AZStd::string::format("LoadEditorAssetTree failed to load dependent graph from %s-%s: %s", editorAssetId.ToString().c_str(), assetHint.data(), loadDependentOutcome.GetError().c_str())); + } + + result.m_dependencies.push_back(loadDependentOutcome.TakeValue()); + } + + if (parent) + { + result.SetParent(*parent); + } + + result.m_asset = loadAssetOutcome.TakeValue(); + + return AZ::Success(result); + } + + AZ::Outcome ParseEditorAssetTree(const EditorAssetTree& editorAssetTree) + { + auto buildEntity = editorAssetTree.m_asset->GetScriptCanvasEntity(); + if (!buildEntity) + { + return AZ::Failure(AZStd::string("No entity from source asset")); + } + + auto variableComponent = AZ::EntityUtils::FindFirstDerivedComponent(buildEntity); + if (!variableComponent) + { + return AZ::Failure(AZStd::string("No GraphVariableManagerComponent in source Entity")); + } + + const ScriptCanvas::VariableData* variableData = variableComponent->GetVariableDataConst(); // get this from the entity + if (!variableData) + { + return AZ::Failure(AZStd::string("No variableData in source GraphVariableManagerComponent")); + } + + auto parseOutcome = ScriptCanvasBuilder::ParseGraph(*buildEntity, ""); + if (!parseOutcome.IsSuccess() || !parseOutcome.GetValue()) + { + return AZ::Failure(AZStd::string("graph failed to parse")); + } + + BuildVariableOverrides result; + result.m_source = editorAssetTree.m_asset; + result.PopulateFromParsedResults(parseOutcome.GetValue()->GetRuntimeInputs(), *variableData); + + // recurse... + for (auto& dependentAsset : editorAssetTree.m_dependencies) + { + // #functions2 provide an identifier for the node/variable in the source that caused the dependency. the root will not have one. + auto parseDependentOutcome = ParseEditorAssetTree(dependentAsset); + if (!parseDependentOutcome.IsSuccess()) + { + return AZ::Failure(AZStd::string::format + ("ParseEditorAssetTree failed to parse dependent graph from %s-%s: %s" + , dependentAsset.m_asset.GetId().ToString().c_str() + , dependentAsset.m_asset.GetHint().c_str() + , parseDependentOutcome.GetError().c_str())); + } + + result.m_dependencies.push_back(parseDependentOutcome.TakeValue()); + } + + return AZ::Success(result); + } + +} diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.h b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.h new file mode 100644 index 0000000000..7cbc6c029e --- /dev/null +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.h @@ -0,0 +1,82 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include +#include + +namespace ScriptCanvas +{ + namespace Grammar + { + struct ParsedRuntimeInputs; + } +} + +namespace ScriptCanvasEditor +{ + class ScriptCanvasAsset; +} + +namespace ScriptCanvasBuilder +{ + class BuildVariableOverrides + { + public: + AZ_TYPE_INFO(BuildVariableOverrides, "{8336D44C-8EDC-4C28-AEB4-3420D5FD5AE2}"); + AZ_CLASS_ALLOCATOR(BuildVariableOverrides, AZ::SystemAllocator, 0); + + static void Reflect(AZ::ReflectContext* reflectContext); + + void Clear(); + + // use this to preserve old values that may have been overridden on the instance, and are still valid in the parsed graph + void CopyPreviousOverriddenValues(const BuildVariableOverrides& source); + + bool IsEmpty() const; + + // use this to initialize the new data, and make sure they have a editor graph variable for proper editor display + void PopulateFromParsedResults(const ScriptCanvas::Grammar::ParsedRuntimeInputs& inputs, const ScriptCanvas::VariableData& variables); + + // #functions2 provide an identifier for the node/variable in the source that caused the dependency. the root will not have one. + AZ::Data::Asset m_source; + + // all of the variables here are overrides + AZStd::vector m_variables; + // the values here may or may not be overrides + AZStd::vector> m_entityIds; + // this is all that gets exposed to the edit context + AZStd::vector m_overrides; + // AZStd::vector m_entityIdRuntimeInputIndices; since all of the entity ids need to go in, they may not need indices + AZStd::vector m_dependencies; + }; + + class EditorAssetTree + { + public: + AZ_CLASS_ALLOCATOR(EditorAssetTree, AZ::SystemAllocator, 0); + + EditorAssetTree* m_parent = nullptr; + AZStd::vector m_dependencies; + AZ::Data::Asset m_asset; + + EditorAssetTree* ModRoot(); + + void SetParent(EditorAssetTree& parent); + + AZStd::string ToString(size_t depth = 0) const; + }; + + // copy the variables overridden during editor / prefab build time back to runtime data + ScriptCanvas::RuntimeDataOverrides ConvertToRuntime(const BuildVariableOverrides& overrides); + + AZ::Outcome LoadEditorAssetTree(AZ::Data::AssetId editorAssetId, AZStd::string_view assetHint, EditorAssetTree* parent = nullptr); + + AZ::Outcome ParseEditorAssetTree(const EditorAssetTree& editorAssetTree); +} diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp index cdbd9ff943..c3e5b03041 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -163,6 +164,8 @@ namespace ScriptCanvasBuilder void PluginComponent::Reflect(AZ::ReflectContext* context) { + BuildVariableOverrides::Reflect(context); + if (AZ::SerializeContext* serializeContext = azrtti_cast(context)) { serializeContext->Class() diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp index 20b927140a..6b163a5027 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp @@ -70,6 +70,7 @@ namespace ScriptCanvasBuilder AZ_Warning(s_scriptCanvasBuilder, false, "CreateJobs for \"%s\" failed because the source file could not be opened.", fullPath.data()); return; } + AZStd::vector fileBuffer(ioStream.GetLength()); size_t bytesRead = ioStream.Read(fileBuffer.size(), fileBuffer.data()); if (bytesRead != ioStream.GetLength()) @@ -87,15 +88,15 @@ namespace ScriptCanvasBuilder { // force load these before processing if (filterInfo.m_assetType == azrtti_typeid() - || filterInfo.m_assetType == azrtti_typeid()) + || filterInfo.m_assetType == azrtti_typeid()) { this->m_processEditorAssetDependencies.push_back(filterInfo); } // these trigger re-processing if (filterInfo.m_assetType == azrtti_typeid() - || filterInfo.m_assetType == azrtti_typeid() - || filterInfo.m_assetType == azrtti_typeid()) + || filterInfo.m_assetType == azrtti_typeid() + || filterInfo.m_assetType == azrtti_typeid()) { AssetBuilderSDK::SourceFileDependency dependency; dependency.m_sourceFileDependencyUUID = filterInfo.m_assetId.m_guid; @@ -210,7 +211,7 @@ namespace ScriptCanvasBuilder bool pathFound = false; AZStd::string relativePath; AzToolsFramework::AssetSystemRequestBus::BroadcastResult - ( pathFound + (pathFound , &AzToolsFramework::AssetSystem::AssetSystemRequest::GetRelativeProductPathFromFullSourceOrProductPath , request.m_fullPath.c_str(), relativePath); diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h index fe07175744..fa6ed17a3c 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h @@ -55,6 +55,8 @@ namespace ScriptCanvasBuilder DependencyArguments, DependencyRequirementsData, AddAssetDependencySearch, + PrefabIntegration, + CorrectGraphVariableVersion, // add new entries above Current, }; @@ -130,10 +132,12 @@ namespace ScriptCanvasBuilder int GetBuilderVersion(); - AZ::Outcome, AZStd::string> LoadEditorAsset(AZStd::string_view graphPath); + AZ::Outcome, AZStd::string> LoadEditorAsset(AZStd::string_view graphPath, AZ::Data::AssetId assetId, AZ::Data::AssetFilterCB assetFilterCB = {}); AZ::Outcome, AZStd::string> LoadEditorFunctionAsset(AZStd::string_view graphPath); + AZ::Outcome ParseGraph(AZ::Entity& buildEntity, AZStd::string_view graphPath); + AZ::Outcome ProcessTranslationJob(ProcessTranslationJobInput& input); ScriptCanvasEditor::Graph* PrepareSourceGraph(AZ::Entity* const buildEntity); @@ -149,7 +153,7 @@ namespace ScriptCanvasBuilder { public: static AZ::Uuid GetUUID(); - + Worker() = default; Worker(const Worker&) = delete; @@ -175,7 +179,7 @@ namespace ScriptCanvasBuilder // cached on first time query mutable AZStd::string m_fingerprintString; }; - + class FunctionWorker : public AssetBuilderSDK::AssetBuilderCommandBus::Handler { @@ -195,7 +199,7 @@ namespace ScriptCanvasBuilder int GetVersionNumber() const; void ProcessJob(const AssetBuilderSDK::ProcessJobRequest& request, AssetBuilderSDK::ProcessJobResponse& response) const; - + void ShutDown() override {}; private: diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp index 7c63652c1a..94f09b4b9a 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp @@ -17,9 +17,7 @@ #include #include #include - #include - #include #include #include @@ -32,7 +30,6 @@ #include #include #include - #include namespace ScriptCanvasBuilder @@ -62,6 +59,26 @@ namespace ScriptCanvasBuilder } } + AZ::Outcome ParseGraph(AZ::Entity& buildEntity, AZStd::string_view graphPath) + { + AZStd::string fileNameOnly; + AzFramework::StringFunc::Path::GetFullFileName(graphPath.data(), fileNameOnly); + + ScriptCanvas::Grammar::Request request; + request.graph = PrepareSourceGraph(&buildEntity); + if (!request.graph) + { + return AZ::Failure(AZStd::string("build entity did not have source graph components")); + } + + request.rawSaveDebugOutput = ScriptCanvas::Grammar::g_saveRawTranslationOuputToFileAtPrefabTime; + request.printModelToConsole = ScriptCanvas::Grammar::g_printAbstractCodeModelAtPrefabTime; + request.name = fileNameOnly.empty() ? fileNameOnly : "BuilderGraph"; + request.addDebugInformation = false; + + return ScriptCanvas::Translation::ParseGraph(request); + } + AZ::Outcome CreateLuaAsset(AZ::Entity* buildEntity, AZ::Data::AssetId scriptAssetId, AZStd::string_view rawLuaFilePath) { AZStd::string fullPath(rawLuaFilePath); @@ -72,7 +89,7 @@ namespace ScriptCanvasBuilder auto sourceGraph = PrepareSourceGraph(buildEntity); ScriptCanvas::Grammar::Request request; - request.assetId = scriptAssetId; + request.scriptAssetId = scriptAssetId; request.graph = sourceGraph; request.name = fileNameOnly; request.rawSaveDebugOutput = ScriptCanvas::Grammar::g_saveRawTranslationOuputToFile; @@ -82,7 +99,7 @@ namespace ScriptCanvasBuilder bool pathFound = false; AZStd::string relativePath; AzToolsFramework::AssetSystemRequestBus::BroadcastResult - ( pathFound + (pathFound , &AzToolsFramework::AssetSystem::AssetSystemRequest::GetRelativeProductPathFromFullSourceOrProductPath , fullPath.c_str(), relativePath); @@ -396,7 +413,7 @@ namespace ScriptCanvasBuilder ; } - AZ::Outcome < AZ::Data::Asset, AZStd::string> LoadEditorAsset(AZStd::string_view filePath) + AZ::Outcome < AZ::Data::Asset, AZStd::string> LoadEditorAsset(AZStd::string_view filePath, AZ::Data::AssetId assetId, AZ::Data::AssetFilterCB assetFilterCB) { AZStd::shared_ptr assetDataStream = AZStd::make_shared(); @@ -425,9 +442,9 @@ namespace ScriptCanvasBuilder AZ::ComponentApplicationBus::BroadcastResult(context, &AZ::ComponentApplicationBus::Events::GetSerializeContext); AZ::Data::Asset asset; - asset.Create(AZ::Data::AssetId(AZ::Uuid::CreateRandom())); + asset.Create(assetId); - if (editorAssetHandler.LoadAssetData(asset, assetDataStream, AZ::Data::AssetFilterCB{}) != AZ::Data::AssetHandler::LoadResult::LoadComplete) + if (editorAssetHandler.LoadAssetData(asset, assetDataStream, assetFilterCB) != AZ::Data::AssetHandler::LoadResult::LoadComplete) { return AZ::Failure(AZStd::string::format("Failed to load ScriptCavas asset: %s", filePath.data())); } @@ -513,10 +530,7 @@ namespace ScriptCanvasBuilder } } - if (buildEntity->GetState() == AZ::Entity::State::Constructed) - { - buildEntity->Init(); - } + ScriptCanvas::ScopedAuxiliaryEntityHandler entityHandler(buildEntity); if (buildEntity->GetState() == AZ::Entity::State::Init) { @@ -533,7 +547,7 @@ namespace ScriptCanvasBuilder auto version = sourceGraph->GetVersion(); if (version.grammarVersion == ScriptCanvas::GrammarVersion::Initial - || version.runtimeVersion == ScriptCanvas::RuntimeVersion::Initial) + || version.runtimeVersion == ScriptCanvas::RuntimeVersion::Initial) { return AZ::Failure(AZStd::string(ScriptCanvas::ParseErrors::SourceUpdateRequired)); } @@ -542,7 +556,7 @@ namespace ScriptCanvasBuilder request.path = input.fullPath; request.name = input.fileNameOnly; request.namespacePath = input.namespacePath; - request.assetId = input.assetID; + request.scriptAssetId = input.assetID; request.graph = sourceGraph; request.rawSaveDebugOutput = ScriptCanvas::Grammar::g_saveRawTranslationOuputToFile; request.printModelToConsole = ScriptCanvas::Grammar::g_printAbstractCodeModel; @@ -728,6 +742,6 @@ namespace ScriptCanvasBuilder ScriptCanvas::Translation::Result TranslateToLua(ScriptCanvas::Grammar::Request& request) { request.translationTargetFlags = ScriptCanvas::Translation::TargetFlags::Lua; - return ScriptCanvas::Translation::ParseGraph(request); + return ScriptCanvas::Translation::ParseAndTranslateGraph(request); } } diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp index 97f5b8706f..1e879c000a 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp @@ -19,19 +19,30 @@ #include #include #include - #include #include #include +#include #include #include #include #include #include #include -#include #include + +namespace EditorScriptCanvasComponentCpp +{ + enum Version + { + PrefabIntegration = 10, + + // add description above + Current + }; +} + namespace ScriptCanvasEditor { static bool EditorScriptCanvasComponentVersionConverter(AZ::SerializeContext& serializeContext, AZ::SerializeContext::DataElementNode& rootElement) @@ -74,6 +85,63 @@ namespace ScriptCanvasEditor rootElement.RemoveElementByName(AZ_CRC("m_variableEntityIdMap", 0xdc6c75a8)); } + if (rootElement.GetVersion() <= EditorScriptCanvasComponentCpp::Version::PrefabIntegration) + { + auto variableDataElementIndex = rootElement.FindElement(AZ_CRC_CE("m_variableData")); + if (variableDataElementIndex == -1) + { + AZ_Error("ScriptCanvas", false, "EditorScriptCanvasComponent conversion failed: 'm_variableData' index was missing"); + return false; + } + + auto& variableDataElement = rootElement.GetSubElement(variableDataElementIndex); + + ScriptCanvas::EditableVariableData editableData; + if (!variableDataElement.GetData(editableData)) + { + AZ_Error("ScriptCanvas", false, "EditorScriptCanvasComponent conversion failed: could not retrieve old 'm_variableData'"); + return false; + } + + auto scriptCanvasAssetHolderElementIndex = rootElement.FindElement(AZ_CRC_CE("m_assetHolder")); + if (scriptCanvasAssetHolderElementIndex == -1) + { + AZ_Error("ScriptCanvas", false, "EditorScriptCanvasComponent conversion failed: 'm_assetHolder' index was missing"); + return false; + } + + auto& scriptCanvasAssetHolderElement = rootElement.GetSubElement(scriptCanvasAssetHolderElementIndex); + + ScriptCanvasAssetHolder assetHolder; + if (!scriptCanvasAssetHolderElement.GetData(assetHolder)) + { + AZ_Error("ScriptCanvas", false, "EditorScriptCanvasComponent conversion failed: could not retrieve old 'm_assetHolder'"); + return false; + } + + rootElement.RemoveElement(variableDataElementIndex); + + if (!rootElement.AddElementWithData(serializeContext, "runtimeDataIsValid", true)) + { + AZ_Error("ScriptCanvas", false, "EditorScriptCanvasComponent conversion failed: failed to add 'runtimeDataIsValid'"); + return false; + } + + ScriptCanvasBuilder::BuildVariableOverrides overrides; + overrides.m_source = AZ::Data::Asset(assetHolder.GetAssetId(), assetHolder.GetAssetType(), assetHolder.GetAssetHint());; + + for (auto& variable : editableData.GetVariables()) + { + overrides.m_overrides.push_back(variable.m_graphVariable); + } + + if (!rootElement.AddElementWithData(serializeContext, "runtimeDataOverrides", overrides)) + { + AZ_Error("ScriptCanvas", false, "EditorScriptCanvasComponent conversion failed: failed to add 'runtimeDataOverrides'"); + return false; + } + } + return true; } @@ -83,10 +151,11 @@ namespace ScriptCanvasEditor if (auto serializeContext = azrtti_cast(context)) { serializeContext->Class() - ->Version(8, &EditorScriptCanvasComponentVersionConverter) + ->Version(EditorScriptCanvasComponentCpp::Version::Current, &EditorScriptCanvasComponentVersionConverter) ->Field("m_name", &EditorScriptCanvasComponent::m_name) ->Field("m_assetHolder", &EditorScriptCanvasComponent::m_scriptCanvasAssetHolder) - ->Field("m_variableData", &EditorScriptCanvasComponent::m_editableData) + ->Field("runtimeDataIsValid", &EditorScriptCanvasComponent::m_runtimeDataIsValid) + ->Field("runtimeDataOverrides", &EditorScriptCanvasComponent::m_variableOverrides) ; if (AZ::EditContext* editContext = serializeContext->GetEditContext()) @@ -103,9 +172,9 @@ namespace ScriptCanvasEditor ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("Level", 0x9aeacc13)) ->Attribute(AZ::Edit::Attributes::HelpPageURL, "https://o3de.org/docs/user-guide/components/reference/script-canvas/") ->DataElement(AZ::Edit::UIHandlers::Default, &EditorScriptCanvasComponent::m_scriptCanvasAssetHolder, "Script Canvas Asset", "Script Canvas asset associated with this component") - ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) - ->DataElement(AZ::Edit::UIHandlers::Default, &EditorScriptCanvasComponent::m_editableData, "Properties", "Script Canvas Graph Properties") - ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) + ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) + ->DataElement(AZ::Edit::UIHandlers::Default, &EditorScriptCanvasComponent::m_variableOverrides, "Properties", "Script Canvas Graph Properties") + ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) ; } } @@ -133,6 +202,11 @@ namespace ScriptCanvasEditor AzFramework::AssetCatalogEventBus::Handler::BusDisconnect(); } + const AZStd::string& EditorScriptCanvasComponent::GetName() const + { + return m_name; + } + void EditorScriptCanvasComponent::UpdateName() { AZ::Data::AssetId assetId = m_scriptCanvasAssetHolder.GetAssetId(); @@ -208,18 +282,7 @@ namespace ScriptCanvasEditor if (fileAssetId.IsValid()) { AssetTrackerNotificationBus::Handler::BusConnect(fileAssetId); - - ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, fileAssetId); - - if (memoryAsset && memoryAsset->GetAsset().GetStatus() == AZ::Data::AssetData::AssetStatus::Ready) - { - OnScriptCanvasAssetReady(memoryAsset); - } - else - { - AssetTrackerRequestBus::Broadcast(&AssetTrackerRequests::Load, m_scriptCanvasAssetHolder.GetAssetId(), m_scriptCanvasAssetHolder.GetAssetType(), nullptr); - } + AzToolsFramework::ToolsApplicationNotificationBus::Broadcast(&AzToolsFramework::ToolsApplicationEvents::InvalidatePropertyDisplay, AzToolsFramework::Refresh_EntireTree_NewContent); } } @@ -233,81 +296,67 @@ namespace ScriptCanvasEditor EditorComponentBase::Deactivate(); - //EditorScriptCanvasAssetNotificationBus::Handler::BusDisconnect(); EditorScriptCanvasComponentRequestBus::Handler::BusDisconnect(); EditorContextMenuRequestBus::Handler::BusDisconnect(); } - //========================================================================= - void EditorScriptCanvasComponent::BuildGameEntity(AZ::Entity* gameEntity) + void EditorScriptCanvasComponent::BuildGameEntityData() { - AZ::Data::AssetId editorAssetId = m_scriptCanvasAssetHolder.GetAssetId(); + using namespace ScriptCanvasBuilder; + + m_runtimeDataIsValid = false; - if (!editorAssetId.IsValid()) + auto assetTreeOutcome = LoadEditorAssetTree(m_scriptCanvasAssetHolder.GetAssetId(), m_scriptCanvasAssetHolder.GetAssetHint()); + if (!assetTreeOutcome.IsSuccess()) { + AZ_Warning("ScriptCanvas", false, "EditorScriptCanvasComponent::BuildGameEntityData failed: %s", assetTreeOutcome.GetError().c_str()); return; } - AZ::Data::AssetId runtimeAssetId(editorAssetId.m_guid, AZ_CRC("RuntimeData", 0x163310ae)); - AZ::Data::Asset runtimeAsset(runtimeAssetId, azrtti_typeid(), {}); + EditorAssetTree& editorAssetTree = assetTreeOutcome.GetValue(); - /* - - This defense against creating useless runtime components is pending changes the slice update system. - It also would require better abilities to check asset integrity when building assets that depend - on ScriptCanvas assets. + auto parseOutcome = ParseEditorAssetTree(editorAssetTree); + if (!parseOutcome.IsSuccess()) + { + AZ_Warning("ScriptCanvas", false, "EditorScriptCanvasComponent::BuildGameEntityData failed: %s", parseOutcome.GetError().c_str()); + return; + } - AZ::Data::AssetInfo assetInfo; - AZ::Data::AssetCatalogRequestBus::BroadcastResult(assetInfo, &AZ::Data::AssetCatalogRequestBus::Events::GetAssetInfoById, runtimeAssetId); + auto& variableOverrides = parseOutcome.GetValue(); - if (assetInfo.m_assetType == AZ::Data::s_invalidAssetType) + if (!m_variableOverrides.IsEmpty()) { - AZ_Warning("ScriptCanvas", false, "No ScriptCanvas Runtime Asset information for Entity ('%s' - '%s') Graph ('%s'), asset may be in error or deleted" - , gameEntity->GetName().c_str() - , GetEntityId().ToString().c_str() - , GetName().c_str()); - return; + variableOverrides.CopyPreviousOverriddenValues(m_variableOverrides); } - AzFramework::AssetSystem::AssetStatus statusResult = AzFramework::AssetSystem::AssetStatus_Unknown; - AzFramework::AssetSystemRequestBus::BroadcastResult(statusResult, &AzFramework::AssetSystem::AssetSystemRequests::GetAssetStatusById, runtimeAssetId); + m_variableOverrides = parseOutcome.TakeValue(); + m_runtimeDataIsValid = true; + } - if (statusResult != AzFramework::AssetSystem::AssetStatus_Compiled) + void EditorScriptCanvasComponent::BuildGameEntity(AZ::Entity* gameEntity) + { + if (!m_runtimeDataIsValid) { - AZ_Warning("ScriptCanvas", false, "No ScriptCanvas Runtime Asset for Entity ('%s' - '%s') Graph ('%s'), compilation may have failed or not completed" - , gameEntity->GetName().c_str() - , GetEntityId().ToString().c_str() - , GetName().c_str()); + // this is fine, there could have been no graph set, or set to a graph that failed to compile return; } - */ - // #functions2 dependency-ctor-args make recursive - auto executionComponent = gameEntity->CreateComponent(runtimeAsset); - ScriptCanvas::VariableData varData; + // build everything again as a sanity check against dependencies. All of the variable overrides that were valid will be copied over + BuildGameEntityData(); - for (const auto& varConfig : m_editableData.GetVariables()) + if (!m_runtimeDataIsValid) { - if (varConfig.m_graphVariable.GetDatum()->Empty()) - { - AZ_Error("ScriptCanvas", false, "Data loss detected for GraphVariable ('%s') on Entity ('%s' - '%s') Graph ('%s')" - , varConfig.m_graphVariable.GetVariableName().data() - , gameEntity->GetName().c_str() - , GetEntityId().ToString().c_str() - , GetName().c_str()); - } - else - { - varData.AddVariable(varConfig.m_graphVariable.GetVariableName(), varConfig.m_graphVariable); - } + AZ_Error("ScriptCanvasBuilder", false, "Runtime information did not build for ScriptCanvas Component using asset: %s", m_scriptCanvasAssetHolder.GetAssetId().ToString().c_str()); + return; } - executionComponent->SetVariableOverrides(varData); + auto runtimeComponent = gameEntity->CreateComponent(); + auto runtimeOverrides = ConvertToRuntime(m_variableOverrides); + runtimeComponent->SetRuntimeDataOverrides(runtimeOverrides); } void EditorScriptCanvasComponent::OnCatalogAssetAdded(const AZ::Data::AssetId& assetId) { - // If we removed out asset due to the catalog removing. Just set it back. if (m_removedCatalogId == assetId) { if (!m_scriptCanvasAssetHolder.GetAssetId().IsValid()) @@ -317,12 +366,9 @@ namespace ScriptCanvasEditor } } } - void EditorScriptCanvasComponent::OnCatalogAssetRemoved(const AZ::Data::AssetId& removedAssetId, const AZ::Data::AssetInfo& /*assetInfo*/) { AZ::Data::AssetId assetId = m_scriptCanvasAssetHolder.GetAssetId(); - - // If the Asset gets removed from disk while the Editor is loaded clear out the asset reference. if (assetId == removedAssetId) { m_removedCatalogId = assetId; @@ -355,8 +401,6 @@ namespace ScriptCanvasEditor } } - AzToolsFramework::ScopedUndoBatch undo("Update Entity With New SC Graph"); - AzToolsFramework::ToolsApplicationRequests::Bus::Broadcast(&AzToolsFramework::ToolsApplicationRequests::Bus::Events::AddDirtyEntity, GetEntityId()); AzToolsFramework::ToolsApplicationEvents::Bus::Broadcast(&AzToolsFramework::ToolsApplicationEvents::InvalidatePropertyDisplay, AzToolsFramework::Refresh_AttributesAndValues); } @@ -448,7 +492,6 @@ namespace ScriptCanvasEditor { // Invalidate the previously removed catalog id if we are setting a new asset id m_removedCatalogId.SetInvalid(); - SetPrimaryAsset(assetId); } } @@ -469,125 +512,17 @@ namespace ScriptCanvasEditor { if (memoryAsset->GetFileAssetId() == m_scriptCanvasAssetHolder.GetAssetId()) { - LoadVariables(memoryAsset); + auto assetData = memoryAsset->GetAsset(); + [[maybe_unused]] AZ::Entity* scriptCanvasEntity = assetData->GetScriptCanvasEntity(); + AZ_Assert(scriptCanvasEntity, "This graph must have a valid entity"); + BuildGameEntityData(); + AzToolsFramework::ToolsApplicationNotificationBus::Broadcast(&AzToolsFramework::ToolsApplicationEvents::InvalidatePropertyDisplay, AzToolsFramework::Refresh_EntireTree_NewContent); UpdateName(); } } - /*! Start Variable Block Implementation */ - void EditorScriptCanvasComponent::AddVariable(AZStd::string_view varName, const ScriptCanvas::GraphVariable& graphVariable) - { - // We only add component properties to the component - if (!graphVariable.IsComponentProperty()) - { - return; - } - - const auto& variableId = graphVariable.GetVariableId(); - ScriptCanvas::EditableVariableConfiguration* originalVarNameValuePair = m_editableData.FindVariable(variableId); - if (!originalVarNameValuePair) - { - m_editableData.AddVariable(varName, graphVariable); - originalVarNameValuePair = m_editableData.FindVariable(variableId); - } - - if (!originalVarNameValuePair) - { - AZ_Error("Script Canvas", false, "Unable to find variable with id %s and name %s on the ScriptCanvas Component. There is an issue in AddVariable", - variableId.ToString().data(), varName.data()); - return; - } - - // Update the variable name as it may have changed - originalVarNameValuePair->m_graphVariable.SetVariableName(varName); - originalVarNameValuePair->m_graphVariable.SetExposureCategory(graphVariable.GetExposureCategory()); - originalVarNameValuePair->m_graphVariable.SetScriptInputControlVisibility(AZ::Edit::PropertyVisibility::Hide); - originalVarNameValuePair->m_graphVariable.SetAllowSignalOnChange(false); - } - - void EditorScriptCanvasComponent::AddNewVariables(const ScriptCanvas::VariableData& graphVarData) - { - for (auto&& variablePair : graphVarData.GetVariables()) - { - AddVariable(variablePair.second.GetVariableName(), variablePair.second); - } - } - - void EditorScriptCanvasComponent::RemoveVariable(const ScriptCanvas::VariableId& varId) - { - m_editableData.RemoveVariable(varId); - } - - void EditorScriptCanvasComponent::RemoveOldVariables(const ScriptCanvas::VariableData& graphVarData) - { - AZStd::vector oldVariableIds; - for (auto varConfig : m_editableData.GetVariables()) - { - const auto& variableId = varConfig.m_graphVariable.GetVariableId(); - - // We only add component sourced graph properties to the script canvas component, so if this variable was switched to a graph-only property remove it. - // Also be sure to remove this variable if it's been deleted entirely. - auto graphVariable = graphVarData.FindVariable(variableId); - if (!graphVariable || !graphVariable->IsComponentProperty()) - { - oldVariableIds.push_back(variableId); - } - } - - for (const auto& oldVariableId : oldVariableIds) - { - RemoveVariable(oldVariableId); - } - } - - bool EditorScriptCanvasComponent::UpdateVariable(const ScriptCanvas::GraphVariable& graphDatum, ScriptCanvas::GraphVariable& updateDatum, ScriptCanvas::GraphVariable& originalDatum) - { - // If the editable datum is the different than the original datum, then the "variable value" has been overridden on this component - - // Variable values only propagate from the Script Canvas graph to this component if the original "variable value" has not been overridden - // by the editable "variable value" on this component and the "variable value" on the graph is different than the variable value on this component - auto isNotOverridden = (*updateDatum.GetDatum()) == (*originalDatum.GetDatum()); - auto scGraphIsModified = (*originalDatum.GetDatum()) != (*graphDatum.GetDatum()); - - if (isNotOverridden && scGraphIsModified) - { - ScriptCanvas::ModifiableDatumView originalDatumView; - originalDatum.ConfigureDatumView(originalDatumView); - - originalDatumView.AssignToDatum((*graphDatum.GetDatum())); - - - ScriptCanvas::ModifiableDatumView updatedDatumView; - updateDatum.ConfigureDatumView(updatedDatumView); - - updatedDatumView.AssignToDatum((*graphDatum.GetDatum())); - - return true; - } - return false; - } - - void EditorScriptCanvasComponent::LoadVariables(const ScriptCanvasMemoryAsset::pointer memoryAsset) - { - auto assetData = memoryAsset->GetAsset(); - - AZ::Entity* scriptCanvasEntity = assetData->GetScriptCanvasEntity(); - AZ_Assert(scriptCanvasEntity, "This graph must have a valid entity"); - - auto variableComponent = scriptCanvasEntity ? AZ::EntityUtils::FindFirstDerivedComponent(scriptCanvasEntity) : nullptr; - if (variableComponent) - { - // Add properties from the SC Asset to the SC Component if they do not exist on the SC Component - AddNewVariables(*variableComponent->GetVariableData()); - RemoveOldVariables(*variableComponent->GetVariableData()); - } - - AzToolsFramework::ToolsApplicationNotificationBus::Broadcast(&AzToolsFramework::ToolsApplicationEvents::InvalidatePropertyDisplay, AzToolsFramework::Refresh_EntireTree_NewContent); - } - void EditorScriptCanvasComponent::ClearVariables() { - m_editableData.Clear(); + m_variableOverrides.Clear(); } - /* End Variable Block Implementation*/ } diff --git a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.h b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.h index f1e3c85783..f176143328 100644 --- a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.h +++ b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.h @@ -19,8 +19,15 @@ namespace ScriptCanvas namespace ScriptCanvasEditor { - using LoadedInterpretedDependencies = AZStd::vector>; - AZ_INLINE LoadedInterpretedDependencies LoadInterpretedDepencies(const ScriptCanvas::DependencySet& dependencySet); + struct LoadedInterpretedDependency + { + AZStd::string path; + AZ::Data::Asset runtimeAsset; + ScriptCanvas::Translation::LuaAssetResult luaAssetResult; + AZStd::vector dependencies; + }; + + AZ_INLINE AZStd::vector LoadInterpretedDepencies(const ScriptCanvas::DependencySet& dependencySet); AZ_INLINE LoadTestGraphResult LoadTestGraph(AZStd::string_view path); @@ -49,10 +56,11 @@ namespace ScriptCanvasEditor AZ_INLINE void RunGraphImplementation(const RunGraphSpec& runGraphSpec, Reporter& reporter); AZ_INLINE void RunGraphImplementation(const RunGraphSpec& runGraphSpec, LoadTestGraphResult& loadGraphResult, Reporter& reporter); AZ_INLINE void RunGraphImplementation(const RunGraphSpec& runGraphSpec, Reporters& reporters); - + AZ_INLINE void Simulate(const DurationSpec& duration); AZ_INLINE void SimulateDuration(const DurationSpec& duration); AZ_INLINE void SimulateSeconds(const DurationSpec& duration); AZ_INLINE void SimulateTicks(const DurationSpec& duration); } // ScriptCanvasEditor + #include diff --git a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl index ee748129e7..0eb3c3a719 100644 --- a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl +++ b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl @@ -26,9 +26,25 @@ namespace ScriptCanvasEditor { using namespace ScriptCanvas; - AZ_INLINE LoadedInterpretedDependencies LoadInterpretedDepencies(const ScriptCanvas::DependencySet& dependencySet) + // The runtime context (appropriately) always assumes that EntityIds are overridden, this step copies the values from the runtime data + // over to the override data to simulate build step that does this when building prefabs + AZ_INLINE void CopyAssetEntityIdsToOverrides(RuntimeDataOverrides& runtimeDataOverrides) { - LoadedInterpretedDependencies loadedAssets; + runtimeDataOverrides.m_entityIds.reserve(runtimeDataOverrides.m_runtimeAsset->GetData().m_input.m_entityIds.size()); + for (auto& varEntityPar : runtimeDataOverrides.m_runtimeAsset->GetData().m_input.m_entityIds) + { + runtimeDataOverrides.m_entityIds.push_back(varEntityPar.second); + } + + for (auto& dependency : runtimeDataOverrides.m_dependencies) + { + CopyAssetEntityIdsToOverrides(dependency); + } + } + + AZ_INLINE AZStd::vector LoadInterpretedDepencies(const ScriptCanvas::DependencySet& dependencySet) + { + AZStd::vector loadedAssets; if (!dependencySet.empty()) { @@ -41,7 +57,7 @@ namespace ScriptCanvasEditor AZ_Assert(namespacePath.size() >= 3, "This functions assumes unit test dependencies are in the ScriptCanvas gem unit test folder"); AZStd::string originalPath = namespacePath[2].data(); - + for (size_t index = 3; index < namespacePath.size(); ++index) { originalPath += "/"; @@ -52,11 +68,11 @@ namespace ScriptCanvasEditor { originalPath.resize(originalPath.size() - AZStd::string_view(Grammar::k_internalRuntimeSuffix).size()); } - + AZStd::string path = AZStd::string::format("%s/%s.scriptcanvas", k_unitTestDirPathRelative, originalPath.data()); LoadTestGraphResult loadResult = LoadTestGraph(path); AZ_Assert(loadResult.m_runtimeAsset, "failed to load dependent asset"); - + AZ::Outcome luaAssetOutcome = AZ::Failure(AZStd::string("lua asset creation for function failed")); ScriptCanvasEditor::EditorAssetConversionBus::BroadcastResult(luaAssetOutcome, &ScriptCanvasEditor::EditorAssetConversionBusTraits::CreateLuaAsset, loadResult.m_editorAsset, loadResult.m_graphPath); AZ_Assert(luaAssetOutcome.IsSuccess(), "failed to create Lua asset"); @@ -69,8 +85,9 @@ namespace ScriptCanvasEditor } const ScriptCanvas::Translation::LuaAssetResult& luaAssetResult = luaAssetOutcome.GetValue(); - loadedAssets.push_back({ modulePath, luaAssetResult }); - } + // #functions2_recursive_unit_tests + loadedAssets.push_back({ modulePath, loadResult.m_runtimeAsset, luaAssetResult, {} }); + } } return loadedAssets; @@ -182,7 +199,7 @@ namespace ScriptCanvasEditor RuntimeData runtimeDataBuffer; AZStd::vector dependencyDataBuffer; - LoadedInterpretedDependencies dependencies; + AZStd::vector dependencies; if (runGraphSpec.runSpec.execution == ExecutionMode::Interpreted) { @@ -202,9 +219,12 @@ namespace ScriptCanvasEditor { dependencies = LoadInterpretedDepencies(luaAssetResult.m_dependencies.source.userSubgraphs); + RuntimeDataOverrides runtimeDataOverrides; + runtimeDataOverrides.m_runtimeAsset = loadResult.m_runtimeAsset; + if (!dependencies.empty()) { - // eventually, this will need to be recursive, or the full asset handling system will need to be integrated into the testing framework + // #functions2_recursive_unit_tests eventually, this will need to be recursive, or the full asset handling system will need to be integrated into the testing framework // in order to test functionality with a dependency stack greater than 2 // load all script assets, and their dependencies, initialize statics on all those dependencies if it is the first time loaded @@ -215,7 +235,7 @@ namespace ScriptCanvasEditor for (auto& dependency : dependencies) { - inMemoryModules.emplace_back(dependency.first, dependency.second.m_scriptAsset); + inMemoryModules.emplace_back(dependency.path, dependency.luaAssetResult.m_scriptAsset); } AZ::ScriptSystemRequestBus::Broadcast(&AZ::ScriptSystemRequests::UseInMemoryRequireHook, inMemoryModules, AZ::ScriptContextIds::DefaultScriptContextId); @@ -224,7 +244,11 @@ namespace ScriptCanvasEditor for (size_t index = 0; index < dependencies.size(); ++index) { auto& dependency = dependencies[index]; - const ScriptCanvas::Translation::LuaAssetResult& depencyAssetResult = dependency.second; + const ScriptCanvas::Translation::LuaAssetResult& depencyAssetResult = dependency.luaAssetResult; + + RuntimeDataOverrides dependencyRuntimeDataOverrides; + dependencyRuntimeDataOverrides.m_runtimeAsset = dependency.runtimeAsset; + runtimeDataOverrides.m_dependencies.push_back(dependencyRuntimeDataOverrides); RuntimeData& dependencyData = dependencyDataBuffer[index]; dependencyData.m_input = depencyAssetResult.m_runtimeInputs; @@ -239,7 +263,9 @@ namespace ScriptCanvasEditor loadResult.m_runtimeAsset.Get()->GetData().m_script = loadResult.m_scriptAsset; loadResult.m_runtimeAsset.Get()->GetData().m_input = luaAssetResult.m_runtimeInputs; loadResult.m_runtimeAsset.Get()->GetData().m_debugMap = luaAssetResult.m_debugMap; - loadResult.m_runtimeComponent = loadResult.m_entity->CreateComponent(loadResult.m_runtimeAsset); + loadResult.m_runtimeComponent = loadResult.m_entity->CreateComponent(); + CopyAssetEntityIdsToOverrides(runtimeDataOverrides); + loadResult.m_runtimeComponent->SetRuntimeDataOverrides(runtimeDataOverrides); Execution::Context::InitializeActivationData(loadResult.m_runtimeAsset->GetData()); Execution::InitializeInterpretedStatics(loadResult.m_runtimeAsset->GetData()); } diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h index 0abfda43d9..e96ed57632 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h @@ -8,14 +8,14 @@ #pragma once #include +#include #include - +#include #include #include #include +#include #include -#include -#include namespace ScriptCanvasEditor { @@ -27,11 +27,10 @@ namespace ScriptCanvasEditor which it uses to maintain the asset data in memory. Therefore removing an open ScriptCanvasAsset from the file system will remove the reference from the EditorScriptCanvasComponent, but not the reference from the MainWindow allowing the ScriptCanvas graph to still be modified while open - Finally per graph instance variables values are stored on the EditorScriptCanvasComponent and injected into the runtime ScriptCanvas component in BuildGameEntity */ class EditorScriptCanvasComponent - : public AzToolsFramework::Components::EditorComponentBase + : public AzToolsFramework::Components::EditorComponentBase , private EditorContextMenuRequestBus::Handler , private AzFramework::AssetCatalogEventBus::Handler , private EditorScriptCanvasComponentLoggingBus::Handler @@ -54,7 +53,6 @@ namespace ScriptCanvasEditor void Deactivate() override; //===================================================================== - //===================================================================== // EditorComponentBase void BuildGameEntity(AZ::Entity* gameEntity) override; @@ -71,10 +69,10 @@ namespace ScriptCanvasEditor void CloseGraph(); void SetName(const AZStd::string& name) { m_name = name; } - const AZStd::string& GetName() const { return m_name; }; + const AZStd::string& GetName() const; AZ::EntityId GetEditorEntityId() const { return GetEntity() ? GetEntityId() : AZ::EntityId(); } AZ::NamedEntityId GetNamedEditorEntityId() const { return GetEntity() ? GetNamedEntityId() : AZ::NamedEntityId(); } - + //===================================================================== // EditorScriptCanvasComponentRequestBus void SetAssetId(const AZ::Data::AssetId& assetId) override; @@ -119,12 +117,8 @@ namespace ScriptCanvasEditor (void)incompatible; } - //===================================================================== - // AssetCatalogEventBus void OnCatalogAssetAdded(const AZ::Data::AssetId& assetId) override; void OnCatalogAssetRemoved(const AZ::Data::AssetId& assetId, const AZ::Data::AssetInfo& assetInfo) override; - //===================================================================== - void OnScriptCanvasAssetChanged(AZ::Data::AssetId assetId); void UpdateName(); @@ -133,21 +127,15 @@ namespace ScriptCanvasEditor void OnScriptCanvasAssetReady(const ScriptCanvasMemoryAsset::pointer asset); //===================================================================== - void AddVariable(AZStd::string_view varName, const ScriptCanvas::GraphVariable& varDatum); - void AddNewVariables(const ScriptCanvas::VariableData& graphVarData); - void RemoveVariable(const ScriptCanvas::VariableId& varId); - void RemoveOldVariables(const ScriptCanvas::VariableData& graphVarData); - bool UpdateVariable(const ScriptCanvas::GraphVariable& graphDatum, ScriptCanvas::GraphVariable& updateDatum, ScriptCanvas::GraphVariable& originalDatum); - void LoadVariables(const ScriptCanvasMemoryAsset::pointer memoryAsset); + void BuildGameEntityData(); void ClearVariables(); private: AZ::Data::AssetId m_removedCatalogId; AZ::Data::AssetId m_previousAssetId; - AZStd::string m_name; ScriptCanvasAssetHolder m_scriptCanvasAssetHolder; - - ScriptCanvas::EditableVariableData m_editableData; + bool m_runtimeDataIsValid = false; + ScriptCanvasBuilder::BuildVariableOverrides m_variableOverrides; }; } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingDataAggregator.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingDataAggregator.cpp index 2af6da583a..ad5725295c 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingDataAggregator.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingDataAggregator.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -289,7 +289,7 @@ namespace ScriptCanvasEditor void LoggingDataAggregator::OnRegistrationDisabled(const AZ::NamedEntityId&, const ScriptCanvas::GraphIdentifier&) { - + } void LoggingDataAggregator::ResetLog() @@ -324,7 +324,7 @@ namespace ScriptCanvasEditor m_hasAnchor = false; m_anchorTimeStamp = ScriptCanvas::Timestamp(0); } - + void LoggingDataAggregator::RegisterScriptCanvas(const AZ::NamedEntityId& entityId, const ScriptCanvas::GraphIdentifier& graphIdentifier) { bool foundMatch = false; @@ -335,7 +335,7 @@ namespace ScriptCanvasEditor if (mapIter->second == graphIdentifier) { foundMatch = true; - AZ_Error("ScriptCanvas", false, "Received a duplicated registration callback."); + AZ_Warning("ScriptCanvas", false, "Received a duplicated registration callback."); } } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index 4bcc50e5ea..fcbd1a1680 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -523,7 +523,7 @@ namespace ScriptCanvasEditor // Creation Actions { m_createScriptCanvas = new QToolButton(); - m_createScriptCanvas->setIcon(QIcon(ScriptCanvas::AssetDescription::GetIconPath())); + m_createScriptCanvas->setIcon(QIcon(":/ScriptCanvasEditorResources/Resources/create_graph.png")); m_createScriptCanvas->setToolTip("Creates a new Script Canvas Graph"); QObject::connect(m_createScriptCanvas, &QToolButton::clicked, this, &MainWindow::OnFileNew); diff --git a/Assets/Editor/Icons/ScriptCanvas/Viewport/ScriptCanvas.png b/Gems/ScriptCanvas/Code/Editor/View/Windows/Resources/create_graph.png similarity index 100% rename from Assets/Editor/Icons/ScriptCanvas/Viewport/ScriptCanvas.png rename to Gems/ScriptCanvas/Code/Editor/View/Windows/Resources/create_graph.png diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/ScriptCanvasEditorResources.qrc b/Gems/ScriptCanvas/Code/Editor/View/Windows/ScriptCanvasEditorResources.qrc index c9f2ff5fa3..be90d229dc 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/ScriptCanvasEditorResources.qrc +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/ScriptCanvasEditorResources.qrc @@ -12,6 +12,7 @@ Resources/capture_offline.png Resources/create_function_input.png Resources/create_function_output.png + Resources/create_graph.png Resources/CollapseAll_Icon.png Resources/edit_icon.png Resources/error_icon.png diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/RuntimeAsset.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/RuntimeAsset.cpp index c8a14f9231..cd8c7a3af3 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/RuntimeAsset.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/RuntimeAsset.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -15,17 +15,28 @@ namespace ScriptCanvasRuntimeAssetCpp { AddDependencies = 3, ChangeScriptRequirementToAsset, - // add your entry above + + // add description above Current }; + enum class RuntimeDataOverridesVersion : unsigned int + { + Initial = 0, + AddRuntimeAsset, + + // add description above + Current, + }; + enum class FunctionRuntimeDataVersion { MergeBackEnd2dotZero, AddSubgraphInterface, RemoveLegacyData, RemoveConnectionToRuntimeData, - // add your entry above + + // add description above Current }; } @@ -87,9 +98,9 @@ namespace ScriptCanvas { return data.m_input.GetConstructorParameterCount() != 0 || AZStd::any_of(data.m_requiredAssets.begin(), data.m_requiredAssets.end(), [](const AZ::Data::Asset& asset) - { - return RequiresDependencyConstructionParametersRecurse(asset.Get()->m_runtimeData); - }); + { + return RequiresDependencyConstructionParametersRecurse(asset.Get()->m_runtimeData); + }); } bool RuntimeData::RequiresStaticInitialization() const @@ -97,6 +108,80 @@ namespace ScriptCanvas return !m_cloneSources.empty(); } + bool RuntimeDataOverrides::IsPreloadBehaviorEnforced(const RuntimeDataOverrides& overrides) + { + if (overrides.m_runtimeAsset.GetAutoLoadBehavior() != AZ::Data::AssetLoadBehavior::PreLoad) + { + return false; + } + + for (auto& dependency : overrides.m_dependencies) + { + if (!IsPreloadBehaviorEnforced(dependency)) + { + return false; + } + } + + return true; + } + + void RuntimeDataOverrides::EnforcePreloadBehavior() + { + m_runtimeAsset.SetAutoLoadBehavior(AZ::Data::AssetLoadBehavior::PreLoad); + + for (auto& dependency : m_dependencies) + { + dependency.EnforcePreloadBehavior(); + } + } + + void RuntimeDataOverrides::Reflect(AZ::ReflectContext* context) + { + RuntimeVariable::Reflect(context); + + if (auto serializeContext = azrtti_cast(context)) + { + serializeContext->Class() + ->Version(static_cast(ScriptCanvasRuntimeAssetCpp::RuntimeDataOverridesVersion::Current)) + ->Field("runtimeAsset", &RuntimeDataOverrides::m_runtimeAsset) + ->Field("variables", &RuntimeDataOverrides::m_variables) + ->Field("variableIndices", &RuntimeDataOverrides::m_variableIndices) + ->Field("entityIds", &RuntimeDataOverrides::m_entityIds) + ->Field("dependencies", &RuntimeDataOverrides::m_dependencies) + ; + } + } + + RuntimeVariable::RuntimeVariable(const AZStd::any& source) + : value(source) + { + } + + RuntimeVariable::RuntimeVariable(AZStd::any&& source) + : value(AZStd::move(source)) + { + } + + void RuntimeVariable::Reflect(AZ::ReflectContext* context) + { + if (auto serializeContext = azrtti_cast(context)) + { + serializeContext->Class() + ->Field("value", &RuntimeVariable::value) + ; + + if (auto editContext = serializeContext->GetEditContext()) + { + editContext->Class("RuntimeVariable", "RuntimeVariable") + ->DataElement(AZ::Edit::UIHandlers::Default, &RuntimeVariable::value, "value", "") + ->Attribute(AZ::Edit::Attributes::AutoExpand, true) + ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) + ->Attribute(AZ::Edit::Attributes::ContainerCanBeModified, true) + ; + } + } + } //////////////////////// // SubgraphInterfaceData @@ -118,7 +203,7 @@ namespace ScriptCanvas { *this = AZStd::move(other); } - + SubgraphInterfaceData& SubgraphInterfaceData::operator=(SubgraphInterfaceData&& other) { if (this != &other) diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/RuntimeAsset.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/RuntimeAsset.h index cc41d5ae5e..a52ba7331b 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/RuntimeAsset.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/RuntimeAsset.h @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -10,6 +10,7 @@ #include #include +#include #include #include #include @@ -21,6 +22,7 @@ namespace ScriptCanvas { class RuntimeAsset; + struct RuntimeVariable; class RuntimeAssetDescription : public AssetDescription { @@ -41,7 +43,7 @@ namespace ScriptCanvas "Script Canvas Runtime", "Script Canvas Runtime", "Icons/ScriptCanvas/Viewport/ScriptCanvas.png", - AZ::Color(1.0f,0.0f,0.0f,1.0f), + AZ::Color(1.0f, 0.0f, 0.0f, 1.0f), false ) {} @@ -82,6 +84,24 @@ namespace ScriptCanvas bool static RequiresDependencyConstructionParametersRecurse(const RuntimeData& data); }; + struct RuntimeDataOverrides + { + AZ_TYPE_INFO(RuntimeDataOverrides, "{CE3C0AE6-4EBA-43B2-B2D5-7AC24A194E63}"); + AZ_CLASS_ALLOCATOR(RuntimeDataOverrides, AZ::SystemAllocator, 0); + + static bool IsPreloadBehaviorEnforced(const RuntimeDataOverrides& overrides); + + static void Reflect(AZ::ReflectContext* reflectContext); + + AZ::Data::Asset m_runtimeAsset; + AZStd::vector m_variables; + AZStd::vector m_variableIndices; + AZStd::vector m_entityIds; + AZStd::vector m_dependencies; + + void EnforcePreloadBehavior(); + }; + class RuntimeAssetBase : public AZ::Data::AssetData { @@ -94,7 +114,6 @@ namespace ScriptCanvas { } - }; template class RuntimeAssetTyped @@ -165,7 +184,7 @@ namespace ScriptCanvas "Script Canvas Function Interface", "Script Canvas Function Interface", "Icons/ScriptCanvas/Viewport/ScriptCanvas_Function.png", - AZ::Color(1.0f,0.0f,0.0f,1.0f), + AZ::Color(1.0f, 0.0f, 0.0f, 1.0f), false ) {} @@ -207,6 +226,6 @@ namespace ScriptCanvas static const char* GetFileExtension() { return "scriptcanvas_fn_compiled"; } static const char* GetFileFilter() { return "*.scriptcanvas_fn_compiled"; } - friend class SubgraphInterfaceAssetHandler; + friend class SubgraphInterfaceAssetHandler; }; } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp index c81b70618a..32d65147ac 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp @@ -1,12 +1,12 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ - #include +#include #include #include #include @@ -17,6 +17,33 @@ namespace ScriptCanvas { + ScopedAuxiliaryEntityHandler::ScopedAuxiliaryEntityHandler(AZ::Entity* buildEntity) + : m_buildEntity(buildEntity) + , m_wasAdded(false) + { + if (AZ::Interface::Get() != nullptr) + { + AZ::Interface::Get()->RemoveEntity(buildEntity); + } + + if (buildEntity->GetState() == AZ::Entity::State::Constructed) + { + buildEntity->Init(); + m_wasAdded = true; + } + } + + ScopedAuxiliaryEntityHandler::~ScopedAuxiliaryEntityHandler() + { + if (!m_wasAdded) + { + if (AZ::Interface::Get() != nullptr) + { + AZ::Interface::Get()->AddEntity(m_buildEntity); + } + } + } + bool IsNamespacePathEqual(const NamespacePath& lhs, const NamespacePath& rhs) { if (lhs.size() != rhs.size()) @@ -128,4 +155,3 @@ namespace ScriptCanvas runtimeVersion = RuntimeVersion::Current; } } - diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h index 044a3d54db..d272b9b315 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -26,7 +27,7 @@ namespace AZ { class Entity; class ReflectContext; - + template bool ReadAttribute(t_Attribute& resultOut, AttributeId id, const t_Container& attributes) { @@ -41,7 +42,7 @@ namespace ScriptCanvas // The actual value in each location initialized to GraphOwnerId is populated with the owning entity at editor-time, Asset Processor-time, or runtime, as soon as the owning entity is known. using GraphOwnerIdType = AZ::EntityId; static const GraphOwnerIdType GraphOwnerId = AZ::EntityId(0xacedc0de); - + // A place holder identifier for unique runtime graph on Entity that is running more than one instance of the same graph. // This allows multiple instances of the same graph to be addressed individually on the same entity. // The actual value in each location initialized to UniqueId is populated at run-time. @@ -52,7 +53,7 @@ namespace ScriptCanvas constexpr const char* k_OnVariableWriteEventName = "OnVariableValueChanged"; constexpr const char* k_OnVariableWriteEbusName = "VariableNotification"; - + class Node; class Edge; @@ -195,7 +196,7 @@ namespace ScriptCanvas using PropertyFields = AZStd::vector>; - using NamedActiveEntityId = AZ::NamedEntityId; + using NamedActiveEntityId = AZ::NamedEntityId; using NamedNodeId = NamedId; using NamedSlotId = NamedId; @@ -204,7 +205,26 @@ namespace ScriptCanvas using EBusBusId = AZ::Crc32; using ScriptCanvasId = AZ::EntityId; enum class AzEventIdentifier : size_t {}; - + + struct RuntimeVariable + { + AZ_TYPE_INFO(RuntimeVariable, "{6E969359-5AF5-4ECA-BE89-A96AB30A624E}"); + AZ_CLASS_ALLOCATOR(RuntimeVariable, AZ::SystemAllocator, 0); + + static void Reflect(AZ::ReflectContext* reflectContext); + + AZStd::any value; + + RuntimeVariable() = default; + RuntimeVariable(const RuntimeVariable&) = default; + RuntimeVariable(RuntimeVariable&&) = default; + explicit RuntimeVariable(const AZStd::any& source); + explicit RuntimeVariable(AZStd::any&& source); + + RuntimeVariable& operator=(const RuntimeVariable&) = default; + RuntimeVariable& operator=(RuntimeVariable&&) = default; + }; + struct NamespacePathHasher { AZ_FORCE_INLINE size_t operator()(const NamespacePath& path) const @@ -245,6 +265,17 @@ namespace ScriptCanvas }; using ScriptCanvasSettingsRequestBus = AZ::EBus; + + class ScopedAuxiliaryEntityHandler + { + public: + ScopedAuxiliaryEntityHandler(AZ::Entity* buildEntity); + ~ScopedAuxiliaryEntityHandler(); + + private: + bool m_wasAdded = false; + AZ::Entity* m_buildEntity = nullptr; + }; } namespace AZStd diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Datum.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Datum.cpp index cd2cf7d9ea..50823a3189 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Datum.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Datum.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -17,15 +17,55 @@ #include #include - #include #include "DatumBus.h" namespace DatumHelpers { + enum Version + { + JSONSerializerSupport = 6, + + // label your entry above + Current + }; + using namespace ScriptCanvas; - + + bool VersionConverter(AZ::SerializeContext& context, AZ::SerializeContext::DataElementNode& rootDataElementNode) + { + if (rootDataElementNode.GetVersion() <= Version::JSONSerializerSupport) + { + auto storageElementIndex = rootDataElementNode.FindElement(AZ_CRC_CE("m_datumStorage")); + if (storageElementIndex == -1) + { + AZ_Error("ScriptCanvas", false, "Datum Version conversion failed: 'm_datumStorage' was missing."); + return false; + } + + auto& storageElement = rootDataElementNode.GetSubElement(storageElementIndex); + + AZStd::any previousStorage; + if (!storageElement.GetData(previousStorage)) + { + AZ_Error("ScriptCanvas", false, "Datum Version conversion failed: Could not retrieve old version of 'm_datumStorage'."); + return false; + } + + rootDataElementNode.RemoveElement(storageElementIndex); + + RuntimeVariable newStorage(previousStorage); + if (!rootDataElementNode.AddElementWithData(context, "m_datumStorage", newStorage)) + { + AZ_Error("ScriptCanvas", false, "Datum Version conversion failed: Could not add new version of 'm_datumStorage'."); + return false; + } + } + + return true; + } + template struct ImplicitConversionHelp { @@ -129,7 +169,7 @@ namespace DatumHelpers return true; } - + AZ_FORCE_INLINE bool ConvertImplicitlyCheckedVector3(const void* source, const Data::Type& targetType, AZStd::any& target, const AZ::BehaviorClass* targetClass) { const AZ::Vector3& sourceVector = *reinterpret_cast(source); @@ -169,7 +209,7 @@ namespace DatumHelpers } else if (typeID == azrtti_typeid()) { - target = BehaviorContextObject::Create(AZ::Vector2(static_cast(sourceVector.GetX()), static_cast(sourceVector.GetY())), behaviorClass); + target = BehaviorContextObject::Create(AZ::Vector2((sourceVector.GetX()), (sourceVector.GetY())), behaviorClass); } else if (typeID == azrtti_typeid()) { @@ -224,7 +264,7 @@ namespace DatumHelpers } else if (typeID == azrtti_typeid()) { - target = BehaviorContextObject::Create(AZ::Vector2(static_cast(sourceVector.GetX()), static_cast(sourceVector.GetY())), behaviorClass); + target = BehaviorContextObject::Create(AZ::Vector2((sourceVector.GetX()), (sourceVector.GetY())), behaviorClass); } else if (typeID == azrtti_typeid()) { @@ -246,10 +286,10 @@ namespace DatumHelpers ? Data::IsVectorType(type.GetAZType()) : Data::IsVectorType(type); } - + AZ_FORCE_INLINE Data::eType GetVectorType(const Data::Type& type) { - return type.GetType() == Data::eType::BehaviorContextObject + return type.GetType() == Data::eType::BehaviorContextObject ? Data::FromAZType(type.GetAZType()).GetType() : type.GetType(); } @@ -257,7 +297,7 @@ namespace DatumHelpers AZ_FORCE_INLINE bool ConvertImplicitlyCheckedVector(const Data::Type& sourceType, const void* source, const Data::Type& targetType, AZStd::any& target, const AZ::BehaviorClass* targetClass) { const Data::eType sourceVectorType = GetVectorType(sourceType); - + switch (sourceVectorType) { case Data::eType::Vector2: @@ -277,9 +317,9 @@ namespace DatumHelpers AZ_Assert ( (a.GetType() == Data::eType::BehaviorContextObject && Data::IsAutoBoxedType(b)) - || + || (b.GetType() == Data::eType::BehaviorContextObject && Data::IsAutoBoxedType(a)) - , "these types are not convertible, or need no conversion."); + , "these types are not convertible, or need no conversion."); return a.GetType() == Data::eType::BehaviorContextObject ? b.GetType() : a.GetType(); } @@ -287,15 +327,15 @@ namespace DatumHelpers AZ_FORCE_INLINE bool ConvertImplicitlyChecked(const Data::Type& sourceType, const void* source, const Data::Type& targetType, AZStd::any& target, const AZ::BehaviorClass* targetClass) { AZ_Assert(!targetType.IS_A(sourceType), "Bad use of conversion, target type IS-A source type"); - + if (IsAnyVectorType(sourceType) && IsAnyVectorType(targetType)) { return ConvertImplicitlyCheckedVector(sourceType, source, targetType, target, targetClass); - } + } else if (Data::IsConvertible(sourceType, targetType)) { auto conversionType = GetMathConversionType(targetType, sourceType); - + switch (conversionType) { case Data::eType::AABB: @@ -323,7 +363,7 @@ namespace DatumHelpers return false; } - + template AZ_INLINE bool FromBehaviorContext(const AZ::Uuid& typeID, const void* source, AZStd::any& destination) { @@ -339,7 +379,7 @@ namespace DatumHelpers return false; } - + AZ_INLINE bool FromBehaviorContextAABB(const AZ::Uuid& typeID, const void* source, AZStd::any& destination) { return FromBehaviorContext(typeID, source, destination); @@ -364,7 +404,7 @@ namespace DatumHelpers { return FromBehaviorContext(typeID, source, destination); } - + AZ_INLINE bool FromBehaviorContextEntityID(const AZ::Uuid& typeID, const void* source, AZStd::any& destination) { return FromBehaviorContext(typeID, source, destination); @@ -443,7 +483,7 @@ namespace DatumHelpers { return FromBehaviorContext(typeID, source, destination); } - + AZ_INLINE bool FromBehaviorContextVector2(const AZ::Uuid& typeID, const void* source, AZStd::any& destination) { AZ::Vector2* target = AZStd::any_cast(&destination); @@ -532,7 +572,7 @@ namespace DatumHelpers { return FromBehaviorContext(typeID, source, destination); } - + template AZ_INLINE bool IsDataEqual(const void* lhs, const void* rhs) { @@ -952,7 +992,7 @@ namespace DatumHelpers { return ToBehaviorContext(valueOut, typeIDOut, valueIn); } - + AZ_INLINE bool ToBehaviorContextString(AZ::BehaviorValueParameter& destination, const void* valueIn) { if (Data::IsString(destination.m_typeId)) @@ -1006,7 +1046,7 @@ namespace DatumHelpers vector4out->SetY(vector2in->GetY()); return true; } - + return false; } @@ -1029,7 +1069,7 @@ namespace DatumHelpers *reinterpret_cast(valueOut) = AZ::Vector4::CreateFromVector3(*vector3in); return true; } - + return false; } @@ -1052,7 +1092,7 @@ namespace DatumHelpers *reinterpret_cast(valueOut) = *vector4in; return true; } - + return false; } @@ -1060,7 +1100,7 @@ namespace DatumHelpers { const AZ::Uuid& typeIDOut = destination.m_typeId; void* valueOut = destination.GetValueAddress(); - + if (valueIn) { switch (typeIn.GetType()) @@ -1128,7 +1168,7 @@ namespace DatumHelpers AZ::BehaviorValueParameter parameter; parameter.m_typeId = description.m_typeId; parameter.m_name = name.data(); - + if (description.m_traits & AZ::BehaviorParameter::TR_POINTER) { pointer = value; @@ -1153,7 +1193,7 @@ namespace DatumHelpers if (parameterDesc.m_typeId == azrtti_typeid() && (parameterDesc.m_traits & (AZ::BehaviorParameter::TR_POINTER | AZ::BehaviorParameter::TR_CONST))) { - AZStd::string_view parameterString = *reinterpret_cast(source); + AZStd::string_view parameterString = *reinterpret_cast(source); return AZ::Success(AZStd::string(parameterString)); } else if (parameterDesc.m_typeId == azrtti_typeid()) @@ -1161,7 +1201,7 @@ namespace DatumHelpers const AZStd::string_view* parameterString = nullptr; if (parameterDesc.m_traits & AZ::BehaviorParameter::TR_POINTER) { - parameterString = *reinterpret_cast(source); + parameterString = *reinterpret_cast(source); } else { @@ -1209,7 +1249,7 @@ namespace ScriptCanvas { Initialize(type, originality, source, sourceTypeID); } - + Datum::Datum(const AZStd::string& behaviorClassName, eOriginality originality) : Datum(Data::FromAZType(AZ::BehaviorContextHelper::GetClassType(behaviorClassName)), originality, nullptr, AZ::Uuid::CreateNull()) { @@ -1227,12 +1267,12 @@ namespace ScriptCanvas Datum::Datum(const AZ::BehaviorValueParameter& value) : Datum(value, - !(value.m_traits & (AZ::BehaviorParameter::TR_POINTER | AZ::BehaviorParameter::TR_REFERENCE)) ? eOriginality::Original : eOriginality::Copy, + !(value.m_traits& (AZ::BehaviorParameter::TR_POINTER | AZ::BehaviorParameter::TR_REFERENCE)) ? eOriginality::Original : eOriginality::Copy, value.m_value) { } - void Datum::ReconfigureDatumTo(Datum&& datum) + void Datum::ReconfigureDatumTo(Datum&& datum) { bool isOverloadedStorage = datum.m_isOverloadedStorage; @@ -1258,7 +1298,7 @@ namespace ScriptCanvas InitializeOverloadedStorage(source.m_type, m_originality); m_class = source.m_class; m_type = source.m_type; - + if (!Data::IsValueType(m_type)) { AZ::BehaviorContext* behaviorContext = nullptr; @@ -1268,15 +1308,15 @@ namespace ScriptCanvas if (classIter != behaviorContext->m_typeToClassMap.end()) { - BehaviorContextObjectPtr sourceObjectPtr = (*AZStd::any_cast(&source.m_storage)); + BehaviorContextObjectPtr sourceObjectPtr = (*AZStd::any_cast(&source.m_storage.value)); BehaviorContextObjectPtr newObjectPtr = sourceObjectPtr->CloneObject((*classIter->second)); - m_storage = AZStd::move(newObjectPtr); - BehaviorContextObjectPtr newSourceObjectPtr = (*AZStd::any_cast(&m_storage)); + m_storage.value = AZStd::move(newObjectPtr); + BehaviorContextObjectPtr newSourceObjectPtr = (*AZStd::any_cast(&m_storage.value)); } } else { - m_storage = source.m_storage; + m_storage.value = source.m_storage.value; m_conversionStorage = source.m_conversionStorage; } @@ -1303,7 +1343,7 @@ namespace ScriptCanvas { AZ::AttributeReader operatorAttrReader(nullptr, operatorAttr); AZ::Script::Attributes::OperatorType methodAttribute{}; - + if (operatorAttrReader.Read(methodAttribute) && methodAttribute == operatorType && method->HasResult() @@ -1314,16 +1354,16 @@ namespace ScriptCanvas AZ::BehaviorValueParameter result(&comparisonResult); AZStd::array params; AZ::Outcome lhsArgument = lhs.ToBehaviorValueParameter(*method->GetArgument(0)); - + if (lhsArgument.IsSuccess() && lhsArgument.GetValue().m_value) { params[0].Set(lhsArgument.GetValue()); AZ::Outcome rhsArgument = rhs.ToBehaviorValueParameter(*method->GetArgument(1)); - + if (rhsArgument.IsSuccess() && rhsArgument.GetValue().m_value) { params[1].Set(rhsArgument.GetValue()); - + if (method->Call(params.data(), aznumeric_caster(params.size()), &result)) { return AZ::Success(comparisonResult); @@ -1339,7 +1379,7 @@ namespace ScriptCanvas void Datum::Clear() { - m_storage.clear(); + m_storage.value.clear(); m_class = nullptr; m_type = Data::Type::Invalid(); } @@ -1352,12 +1392,12 @@ namespace ScriptCanvas { if (m_pointer) { - DatumHelpers::FromBehaviorContextNumber(resultType.m_typeId, m_pointer, m_storage); + DatumHelpers::FromBehaviorContextNumber(resultType.m_typeId, m_pointer, m_storage.value); } } else { - DatumHelpers::FromBehaviorContextNumber(resultType.m_typeId, reinterpret_cast(&m_conversionStorage), m_storage); + DatumHelpers::FromBehaviorContextNumber(resultType.m_typeId, reinterpret_cast(&m_conversionStorage), m_storage.value); } } else if (IS_A(Data::Type::String()) && !Data::IsString(resultType.m_typeId) && AZ::BehaviorContextHelper::IsStringParameter(resultType)) @@ -1365,7 +1405,7 @@ namespace ScriptCanvas void* storageAddress = (resultType.m_traits & AZ::BehaviorParameter::TR_POINTER) ? reinterpret_cast(&m_pointer) : AZStd::any_cast(&m_conversionStorage); if (auto stringOutcome = DatumHelpers::ConvertBehaviorContextString(resultType, storageAddress)) { - m_storage = stringOutcome.GetValue(); + m_storage.value = stringOutcome.GetValue(); } } else if (m_type.GetType() == Data::eType::BehaviorContextObject @@ -1373,73 +1413,73 @@ namespace ScriptCanvas { if (m_pointer) { - m_storage = BehaviorContextObject::CreateReference(resultType.m_typeId, m_pointer); + m_storage.value = BehaviorContextObject::CreateReference(resultType.m_typeId, m_pointer); } } } - + bool Datum::FromBehaviorContext(const void* source, const AZ::Uuid& typeID) { const auto& type = Data::FromAZType(typeID); InitializeOverloadedStorage(type, eOriginality::Copy); - + if (IS_A(type)) { switch (m_type.GetType()) { case ScriptCanvas::Data::eType::AABB: - return DatumHelpers::FromBehaviorContextAABB(typeID, source, m_storage); + return DatumHelpers::FromBehaviorContextAABB(typeID, source, m_storage.value); case ScriptCanvas::Data::eType::BehaviorContextObject: return FromBehaviorContextObject(m_class, source); - + case ScriptCanvas::Data::eType::Boolean: - return DatumHelpers::FromBehaviorContextBool(typeID, source, m_storage); + return DatumHelpers::FromBehaviorContextBool(typeID, source, m_storage.value); case ScriptCanvas::Data::eType::Color: - return DatumHelpers::FromBehaviorContextColor(typeID, source, m_storage); - + return DatumHelpers::FromBehaviorContextColor(typeID, source, m_storage.value); + case ScriptCanvas::Data::eType::CRC: - return DatumHelpers::FromBehaviorContextCRC(typeID, source, m_storage); - + return DatumHelpers::FromBehaviorContextCRC(typeID, source, m_storage.value); + case ScriptCanvas::Data::eType::EntityID: - return DatumHelpers::FromBehaviorContextEntityID(typeID, source, m_storage); + return DatumHelpers::FromBehaviorContextEntityID(typeID, source, m_storage.value); case ScriptCanvas::Data::eType::Matrix3x3: - return DatumHelpers::FromBehaviorContextMatrix3x3(typeID, source, m_storage); + return DatumHelpers::FromBehaviorContextMatrix3x3(typeID, source, m_storage.value); case ScriptCanvas::Data::eType::Matrix4x4: - return DatumHelpers::FromBehaviorContextMatrix4x4(typeID, source, m_storage); + return DatumHelpers::FromBehaviorContextMatrix4x4(typeID, source, m_storage.value); case ScriptCanvas::Data::eType::Number: - return DatumHelpers::FromBehaviorContextNumber(typeID, source, m_storage); + return DatumHelpers::FromBehaviorContextNumber(typeID, source, m_storage.value); case ScriptCanvas::Data::eType::OBB: - return DatumHelpers::FromBehaviorContextOBB(typeID, source, m_storage); + return DatumHelpers::FromBehaviorContextOBB(typeID, source, m_storage.value); case ScriptCanvas::Data::eType::Plane: - return DatumHelpers::FromBehaviorContextPlane(typeID, source, m_storage); + return DatumHelpers::FromBehaviorContextPlane(typeID, source, m_storage.value); case ScriptCanvas::Data::eType::Quaternion: - return DatumHelpers::FromBehaviorContextQuaternion(typeID, source, m_storage); + return DatumHelpers::FromBehaviorContextQuaternion(typeID, source, m_storage.value); case ScriptCanvas::Data::eType::String: - return DatumHelpers::FromBehaviorContextString(typeID, source, m_storage); + return DatumHelpers::FromBehaviorContextString(typeID, source, m_storage.value); case ScriptCanvas::Data::eType::Transform: - return DatumHelpers::FromBehaviorContextTransform(typeID, source, m_storage); + return DatumHelpers::FromBehaviorContextTransform(typeID, source, m_storage.value); case ScriptCanvas::Data::eType::Vector2: - return DatumHelpers::FromBehaviorContextVector2(typeID, source, m_storage); - + return DatumHelpers::FromBehaviorContextVector2(typeID, source, m_storage.value); + case ScriptCanvas::Data::eType::Vector3: - return DatumHelpers::FromBehaviorContextVector3(typeID, source, m_storage); - + return DatumHelpers::FromBehaviorContextVector3(typeID, source, m_storage.value); + case ScriptCanvas::Data::eType::Vector4: - return DatumHelpers::FromBehaviorContextVector4(typeID, source, m_storage); + return DatumHelpers::FromBehaviorContextVector4(typeID, source, m_storage.value); } } - else if (DatumHelpers::ConvertImplicitlyChecked(type, source, m_type, m_storage, m_class)) + else if (DatumHelpers::ConvertImplicitlyChecked(type, source, m_type, m_storage.value, m_class)) { return true; } @@ -1455,14 +1495,14 @@ namespace ScriptCanvas bool Datum::FromBehaviorContextNumber(const void* source, const AZ::Uuid& typeID) { - return DatumHelpers::FromBehaviorContextNumber(typeID, source, m_storage); + return DatumHelpers::FromBehaviorContextNumber(typeID, source, m_storage.value); } bool Datum::FromBehaviorContextObject(const AZ::BehaviorClass* behaviorClass, const void* source) { if (behaviorClass) { - m_storage = BehaviorContextObject::CreateReference(behaviorClass->m_typeId, const_cast(source)); + m_storage.value = BehaviorContextObject::CreateReference(behaviorClass->m_typeId, const_cast(source)); return true; } @@ -1471,10 +1511,10 @@ namespace ScriptCanvas const void* Datum::GetValueAddress() const { - return !m_storage.empty() - ? m_type.GetType() != Data::eType::BehaviorContextObject - ? AZStd::any_cast(&m_storage) - : (*AZStd::any_cast(&m_storage))->Get() + return !m_storage.value.empty() + ? m_type.GetType() != Data::eType::BehaviorContextObject + ? AZStd::any_cast(&m_storage.value) + : (*AZStd::any_cast(&m_storage.value))->Get() : nullptr; } @@ -1488,7 +1528,7 @@ namespace ScriptCanvas AZ_Error("ScriptCanvas", Empty(), "double initialized datum"); m_type = type; - + switch (type.GetType()) { case ScriptCanvas::Data::eType::AABB: @@ -1532,10 +1572,10 @@ namespace ScriptCanvas case ScriptCanvas::Data::eType::Quaternion: return InitializeQuaternion(source); - + case ScriptCanvas::Data::eType::String: return InitializeString(source, sourceTypeID); - + case ScriptCanvas::Data::eType::Transform: return InitializeTransform(source); @@ -1554,13 +1594,13 @@ namespace ScriptCanvas bool Datum::InitializeAABB(const void* source) { - m_storage = source ? *reinterpret_cast(source) : Data::Traits::GetDefault(); + m_storage.value = source ? *reinterpret_cast(source) : Data::Traits::GetDefault(); return true; } bool Datum::InitializeAssetId(const void* source) { - m_storage = source ? *reinterpret_cast(source) : Data::Traits::GetDefault(); + m_storage.value = source ? *reinterpret_cast(source) : Data::Traits::GetDefault(); return true; } @@ -1594,7 +1634,7 @@ namespace ScriptCanvas } const auto& type = Data::FromAZType(description.m_typeId); - const eOriginality originality + const eOriginality originality = !(description.m_traits & (AZ::BehaviorParameter::TR_POINTER | AZ::BehaviorParameter::TR_REFERENCE)) ? eOriginality::Original : eOriginality::Copy; @@ -1621,11 +1661,11 @@ namespace ScriptCanvas if (m_originality == eOriginality::Original) { - m_storage = BehaviorContextObject::Create(behaviorClass, source); + m_storage.value = BehaviorContextObject::Create(behaviorClass, source); } else { - m_storage = BehaviorContextObject::CreateReference(behaviorClass.m_typeId, const_cast(source)); + m_storage.value = BehaviorContextObject::CreateReference(behaviorClass.m_typeId, const_cast(source)); } return true; @@ -1636,68 +1676,68 @@ namespace ScriptCanvas bool Datum::InitializeBool(const void* source) { - m_storage = source ? *reinterpret_cast(source) : Data::Traits::GetDefault(); + m_storage.value = source ? *reinterpret_cast(source) : Data::Traits::GetDefault(); return true; } bool Datum::InitializeColor(const void* source) { - m_storage = source ? *reinterpret_cast(source) : Data::Traits::GetDefault(); + m_storage.value = source ? *reinterpret_cast(source) : Data::Traits::GetDefault(); return true; } bool Datum::InitializeCRC(const void* source) { - m_storage = source ? *reinterpret_cast(source) : Data::Traits::GetDefault(); + m_storage.value = source ? *reinterpret_cast(source) : Data::Traits::GetDefault(); return true; } bool Datum::InitializeEntityID(const void* source) { - m_storage = source ? *reinterpret_cast(source) : Data::Traits::GetDefault(); + m_storage.value = source ? *reinterpret_cast(source) : Data::Traits::GetDefault(); return true; } bool Datum::InitializeNamedEntityID(const void* source) { - m_storage = source ? *reinterpret_cast(source) : Data::Traits::GetDefault(); + m_storage.value = source ? *reinterpret_cast(source) : Data::Traits::GetDefault(); return true; } bool Datum::InitializeMatrix3x3(const void* source) { - m_storage = source ? *reinterpret_cast(source) : Data::Traits::GetDefault(); + m_storage.value = source ? *reinterpret_cast(source) : Data::Traits::GetDefault(); return true; } bool Datum::InitializeMatrix4x4(const void* source) { - m_storage = source ? *reinterpret_cast(source) : Data::Traits::GetDefault(); + m_storage.value = source ? *reinterpret_cast(source) : Data::Traits::GetDefault(); return true; } bool Datum::InitializeNumber(const void* source, const AZ::Uuid& sourceTypeID) { - m_storage = Data::Traits::GetDefault(); - return (source && DatumHelpers::FromBehaviorContextNumber(sourceTypeID, source, m_storage)) || true; + m_storage.value = Data::Traits::GetDefault(); + return (source && DatumHelpers::FromBehaviorContextNumber(sourceTypeID, source, m_storage.value)) || true; } bool Datum::InitializeOBB(const void* source) { - m_storage = source - ? *reinterpret_cast(source) + m_storage.value = source + ? *reinterpret_cast(source) : Data::Traits::GetDefault(); return true; } bool Datum::InitializePlane(const void* source) { - m_storage = source ? *reinterpret_cast(source) : Data::Traits::GetDefault(); + m_storage.value = source ? *reinterpret_cast(source) : Data::Traits::GetDefault(); return true; } bool Datum::InitializeQuaternion(const void* source) { - m_storage = source ? *reinterpret_cast(source) : Data::Traits::GetDefault(); + m_storage.value = source ? *reinterpret_cast(source) : Data::Traits::GetDefault(); return true; } @@ -1707,49 +1747,49 @@ namespace ScriptCanvas { if (sourceTypeID == azrtti_typeid()) { - m_storage = Data::StringType(*reinterpret_cast(source)); + m_storage.value = Data::StringType(*reinterpret_cast(source)); } else if (sourceTypeID == azrtti_typeid()) { - m_storage = Data::StringType(reinterpret_cast(source)); + m_storage.value = Data::StringType(reinterpret_cast(source)); } else { - m_storage = *reinterpret_cast(source); + m_storage.value = *reinterpret_cast(source); } } else { - m_storage = Data::Traits::GetDefault(); + m_storage.value = Data::Traits::GetDefault(); } return true; } bool Datum::InitializeTransform(const void* source) { - m_storage = source ? *reinterpret_cast(source) : Data::Traits::GetDefault(); + m_storage.value = source ? *reinterpret_cast(source) : Data::Traits::GetDefault(); return true; } bool Datum::InitializeVector2(const void* source, const AZ::Uuid& sourceTypeID) { - m_storage = Data::Traits::GetDefault(); + m_storage.value = Data::Traits::GetDefault(); // return a success regardless, but do the initialization first if source is not null - return (source && DatumHelpers::FromBehaviorContextVector2(sourceTypeID, source, m_storage)) || true; + return (source && DatumHelpers::FromBehaviorContextVector2(sourceTypeID, source, m_storage.value)) || true; } bool Datum::InitializeVector3(const void* source, const AZ::Uuid& sourceTypeID) { - m_storage = Data::Traits::GetDefault(); + m_storage.value = Data::Traits::GetDefault(); // return a success regardless, but do the initialization first if source is not null - return (source && DatumHelpers::FromBehaviorContextVector3(sourceTypeID, source, m_storage)) || true; + return (source && DatumHelpers::FromBehaviorContextVector3(sourceTypeID, source, m_storage.value)) || true; } bool Datum::InitializeVector4(const void* source, const AZ::Uuid& sourceTypeID) { - m_storage = Data::Traits::GetDefault(); + m_storage.value = Data::Traits::GetDefault(); // return a success regardless, but do the initialization first if source is not null - return (source && DatumHelpers::FromBehaviorContextVector4(sourceTypeID, source, m_storage)) || true; + return (source && DatumHelpers::FromBehaviorContextVector4(sourceTypeID, source, m_storage.value)) || true; } void Datum::SetType(const Data::Type& dataType) @@ -1759,7 +1799,7 @@ namespace ScriptCanvas if (dataType.IsValid()) { m_isDefaultConstructed = false; - + Datum tempDatum(dataType, ScriptCanvas::Datum::eOriginality::Original); ReconfigureDatumTo(AZStd::move(tempDatum)); } @@ -1787,18 +1827,18 @@ namespace ScriptCanvas auto dataTraitIt = typeIdTraitMap.find(m_type.GetType()); if (dataTraitIt != typeIdTraitMap.end()) { - return dataTraitIt->second.m_dataTraits.IsDefault(m_storage, m_type); + return dataTraitIt->second.m_dataTraits.IsDefault(m_storage.value, m_type); } AZ_Error("Script Canvas", m_isOverloadedStorage, "Unsupported ScriptCanvas Data type"); return true; } - + void* Datum::ModResultAddress() { return m_type.GetType() != Data::eType::BehaviorContextObject - ? AZStd::any_cast(&m_storage) - : (*AZStd::any_cast(&m_storage))->Mod(); + ? AZStd::any_cast(&m_storage.value) + : (*AZStd::any_cast(&m_storage.value))->Mod(); } void* Datum::ModValueAddress() const @@ -1821,12 +1861,12 @@ namespace ScriptCanvas InitializeOverloadedStorage(source.m_type, m_originality); m_class = AZStd::move(source.m_class); m_type = AZStd::move(source.m_type); - if (!source.m_storage.empty()) + if (!source.m_storage.value.empty()) { - m_storage = AZStd::move(source.m_storage); + m_storage.value = AZStd::move(source.m_storage.value); } } - else if (!DatumHelpers::ConvertImplicitlyChecked(source.GetType(), source.GetValueAddress(), m_type, m_storage, m_class)) + else if (!DatumHelpers::ConvertImplicitlyChecked(source.GetType(), source.GetValueAddress(), m_type, m_storage.value, m_class)) { AZ_Error("Script Canvas", false, "Failed to convert from %s to %s", GetName(source.GetType()).c_str(), GetName(m_type).c_str()); } @@ -1852,9 +1892,9 @@ namespace ScriptCanvas InitializeOverloadedStorage(source.m_type, m_originality); m_class = source.m_class; m_type = source.m_type; - m_storage = source.m_storage; + m_storage.value = source.m_storage.value; } - else if (!DatumHelpers::ConvertImplicitlyChecked(source.GetType(), source.GetValueAddress(), m_type, m_storage, m_class)) + else if (!DatumHelpers::ConvertImplicitlyChecked(source.GetType(), source.GetValueAddress(), m_type, m_storage.value, m_class)) { AZ_Error("Script Canvas", false, "Failed to convert from %s to %s", GetName(source.GetType()).c_str(), GetName(m_type).c_str()); } @@ -1924,7 +1964,7 @@ namespace ScriptCanvas { return CallComparisonOperator(AZ::Script::Attributes::OperatorType::LessThan, m_class, *this, other); } - else + else { return AZ::Success(DatumHelpers::IsDataLess(m_type, GetValueAddress(), other.GetValueAddress())); } @@ -1970,7 +2010,7 @@ namespace ScriptCanvas } ComparisonOutcome isLessEqualResult = (*this <= other); - + if (isLessEqualResult.IsSuccess()) { return AZ::Success(!isLessEqualResult.GetValue()); @@ -1989,7 +2029,7 @@ namespace ScriptCanvas } ComparisonOutcome isLessResult = (*this < other); - + if (isLessResult.IsSuccess()) { return AZ::Success(!isLessResult.GetValue()); @@ -2028,7 +2068,7 @@ namespace ScriptCanvas if (auto serializeContext = azrtti_cast(reflection)) { serializeContext->Class() - ->Version(6) + ->Version(DatumHelpers::Version::Current, &DatumHelpers::VersionConverter) ->EventHandler() ->Field("m_isUntypedStorage", &Datum::m_isOverloadedStorage) ->Field("m_type", &Datum::m_type) @@ -2041,13 +2081,13 @@ namespace ScriptCanvas { editContext->Class("Datum", "Datum") ->ClassElement(AZ::Edit::ClassElements::EditorData, "Datum") - ->Attribute(AZ::Edit::Attributes::Visibility, &Datum::GetVisibility) - ->Attribute(AZ::Edit::Attributes::ChildNameLabelOverride, &Datum::GetLabel) + ->Attribute(AZ::Edit::Attributes::Visibility, &Datum::GetVisibility) + ->Attribute(AZ::Edit::Attributes::ChildNameLabelOverride, &Datum::GetLabel) ->DataElement(AZ::Edit::UIHandlers::Default, &Datum::m_storage, "Datum", "") - ->Attribute(AZ::Edit::Attributes::Visibility, &Datum::GetDatumVisibility) - ->Attribute(AZ::Edit::Attributes::AutoExpand, true) - ->Attribute(AZ::Edit::Attributes::ContainerCanBeModified, true) - ->Attribute(AZ::Edit::Attributes::ChangeNotify, &Datum::OnDatumEdited) + ->Attribute(AZ::Edit::Attributes::Visibility, &Datum::GetDatumVisibility) + ->Attribute(AZ::Edit::Attributes::AutoExpand, true) + ->Attribute(AZ::Edit::Attributes::ContainerCanBeModified, true) + ->Attribute(AZ::Edit::Attributes::ChangeNotify, &Datum::OnDatumEdited) ; } } @@ -2066,7 +2106,7 @@ namespace ScriptCanvas return findIt != uniqueIdMap.end() ? findIt->second : sourceId; }, serializeContext, false); } - + void Datum::SetToDefaultValueOfType() { if (m_isOverloadedStorage) @@ -2079,7 +2119,7 @@ namespace ScriptCanvas auto dataTraitIt = typeIdTraitMap.find(m_type.GetType()); if (dataTraitIt != typeIdTraitMap.end()) { - m_storage = dataTraitIt->second.m_dataTraits.GetDefault(m_type); + m_storage.value = dataTraitIt->second.m_dataTraits.GetDefault(m_type); } else { @@ -2119,7 +2159,7 @@ namespace ScriptCanvas return AZ::Edit::PropertyVisibility::ShowChildrenOnly; } } - + void Datum::SetNotificationsTarget(AZ::EntityId notificationId) { m_notificationId = notificationId; @@ -2129,12 +2169,12 @@ namespace ScriptCanvas { if (m_type.GetType() == Data::eType::BehaviorContextObject) { - BehaviorContextObjectPtr ptr = (*AZStd::any_cast(&m_storage)); + BehaviorContextObjectPtr ptr = (*AZStd::any_cast(&m_storage.value)); return ptr->ToAny(); } else { - return m_storage; + return m_storage.value; } } @@ -2144,11 +2184,11 @@ namespace ScriptCanvas AZ::BehaviorContext* behaviorContext = nullptr; AZ::ComponentApplicationBus::BroadcastResult(behaviorContext, &AZ::ComponentApplicationRequests::GetBehaviorContext); AZ_Assert(behaviorContext, "Script Canvas can't do anything without a behavior context!"); - AZ::BehaviorClass* destinationBehaviorClass = AZ::BehaviorContextHelper::GetClass(behaviorContext, destination.m_typeId); + AZ::BehaviorClass* destinationBehaviorClass = AZ::BehaviorContextHelper::GetClass(behaviorContext, destination.m_typeId); const auto targetType = Data::FromAZType(destination.m_typeId); - - const bool success = - ( (IS_A(targetType) || IsConvertibleTo(targetType)) || (IS_A(Data::Type::String()) && AZ::BehaviorContextHelper::IsStringParameter(destination)) ) + + const bool success = + ((IS_A(targetType) || IsConvertibleTo(targetType)) || (IS_A(Data::Type::String()) && AZ::BehaviorContextHelper::IsStringParameter(destination))) && DatumHelpers::ToBehaviorContext(m_type, GetValueAddress(), destination, destinationBehaviorClass); AZ_Error("Script Canvas", success, "Cannot push Datum with type %s into BehaviorValueParameter expecting type %s", GetName(m_type).c_str(), GetName(targetType).c_str()); @@ -2176,9 +2216,9 @@ namespace ScriptCanvas AZ::Outcome Datum::ToBehaviorValueParameter(const AZ::BehaviorParameter& description) const { AZ_Assert(m_isOverloadedStorage || IS_A(Data::FromAZType(description.m_typeId)) || IsConvertibleTo(description), "Mismatched type going to behavior value parameter: %s", description.m_name); - + const_cast(this)->InitializeOverloadedStorage(Data::FromAZType(description.m_typeId), eOriginality::Copy); - + if (!Data::IsValueType(m_type) && !SatisfiesTraits(description.m_traits)) { return AZ::Failure(AZStd::string("Attempting to convert null value to BehaviorValueParameter that expects reference or value")); @@ -2218,7 +2258,7 @@ namespace ScriptCanvas return AZ::Success(parameter); } } - + AZ::Outcome Datum::ToBehaviorValueParameterResult([[maybe_unused]] const AZ::BehaviorParameter& description, [[maybe_unused]] const AZStd::string_view className, [[maybe_unused]] const AZStd::string_view methodName) { AZ_Assert(m_isOverloadedStorage || IS_A(Data::FromAZType(description.m_typeId)) || IsConvertibleTo(description), "Mismatched type going to behavior value parameter: %s (Context: %s :: %s)", description.m_name, className.data(), methodName.data()); @@ -2245,7 +2285,7 @@ namespace ScriptCanvas if (description.m_traits & AZ::BehaviorParameter::TR_POINTER) { m_pointer = ModResultAddress(); - + if (!m_pointer) { return AZ::Failure(AZStd::string("nowhere to go for the for behavior context result")); @@ -2257,12 +2297,12 @@ namespace ScriptCanvas else { parameter.m_value = ModResultAddress(); - + if (!parameter.m_value) { return AZ::Failure(AZStd::string("nowhere to go for the for behavior context result")); } - + parameter.m_traits = 0; } } @@ -2271,7 +2311,7 @@ namespace ScriptCanvas parameter.m_typeId = description.m_typeId; /// \todo verify there is no polymorphic danger here parameter.m_name = m_class ? m_class->m_name.c_str() : Data::GetBehaviorContextName(m_type); parameter.m_azRtti = m_class ? m_class->m_azRtti : nullptr; - + if (description.m_traits & (AZ::BehaviorParameter::TR_POINTER | AZ::BehaviorParameter::TR_REFERENCE)) { parameter.m_value = &m_pointer; @@ -2280,7 +2320,7 @@ namespace ScriptCanvas else { parameter.m_value = ModResultAddress(); - + if (!parameter.m_value) { return AZ::Failure(AZStd::string("nowhere to go for the for behavior context result")); @@ -2333,7 +2373,7 @@ namespace ScriptCanvas return AZ::Failure(AZStd::string::format("Cannot create a BehaviorValueParameter of type %s", description.m_name)); } - + bool Datum::ToString(Data::StringType& result) const { switch (GetType().GetType()) @@ -2422,11 +2462,11 @@ namespace ScriptCanvas result = AZStd::string::format("", Data::GetName(m_type).data()); return false; } - + AZStd::string Datum::ToStringAABB(const Data::AABBType& aabb) const { return AZStd::string::format - ( "(Min: %s, Max: %s)" + ("(Min: %s, Max: %s)" , ToStringVector3(aabb.GetMin()).c_str() , ToStringVector3(aabb.GetMax()).c_str()); } @@ -2438,7 +2478,7 @@ namespace ScriptCanvas AZStd::string Datum::ToStringColor(const Data::ColorType& c) const { - return AZStd::string::format("(r=%.7f,g=%.7f,b=%.7f,a=%.7f)", static_cast(c.GetR()), static_cast(c.GetG()), static_cast(c.GetB()), static_cast(c.GetA())); + return AZStd::string::format("(r=%.7f,g=%.7f,b=%.7f,a=%.7f)", (c.GetR()), (c.GetG()), (c.GetB()), (c.GetA())); } bool Datum::ToStringBehaviorClassObject(Data::StringType& stringOut) const @@ -2466,15 +2506,15 @@ namespace ScriptCanvas } } } - + stringOut = ""; return false; } - + AZStd::string Datum::ToStringMatrix3x3(const AZ::Matrix3x3& m) const { return AZStd::string::format - ( "(%s, %s, %s)" + ("(%s, %s, %s)" , ToStringVector3(m.GetColumn(0)).c_str() , ToStringVector3(m.GetColumn(1)).c_str() , ToStringVector3(m.GetColumn(2)).c_str()); @@ -2484,7 +2524,7 @@ namespace ScriptCanvas AZStd::string Datum::ToStringMatrix4x4(const AZ::Matrix4x4& m) const { return AZStd::string::format - ( "(%s, %s, %s, %s)" + ("(%s, %s, %s, %s)" , ToStringVector4(m.GetColumn(0)).c_str() , ToStringVector4(m.GetColumn(1)).c_str() , ToStringVector4(m.GetColumn(2)).c_str() @@ -2495,7 +2535,7 @@ namespace ScriptCanvas AZStd::string Datum::ToStringOBB(const Data::OBBType& obb) const { return AZStd::string::format - ( "(Position: %s, AxisX: %s, AxisY: %s, AxisZ: %s, halfLengthX: %.7f, halfLengthY: %.7f, halfLengthZ: %.7f)" + ("(Position: %s, AxisX: %s, AxisY: %s, AxisZ: %s, halfLengthX: %.7f, halfLengthY: %.7f, halfLengthZ: %.7f)" , ToStringVector3(obb.GetPosition()).c_str() , ToStringVector3(obb.GetAxisX()).c_str() , ToStringVector3(obb.GetAxisY()).c_str() @@ -2514,10 +2554,10 @@ namespace ScriptCanvas { AZ::Vector3 eulerRotation = AZ::ConvertTransformToEulerDegrees(AZ::Transform::CreateFromQuaternion(source)); return AZStd::string::format - ( "(Pitch: %5.2f, Roll: %5.2f, Yaw: %5.2f)" - , static_cast(eulerRotation.GetX()) - , static_cast(eulerRotation.GetY()) - , static_cast(eulerRotation.GetZ())); + ("(Pitch: %5.2f, Roll: %5.2f, Yaw: %5.2f)" + , (eulerRotation.GetX()) + , (eulerRotation.GetY()) + , (eulerRotation.GetZ())); } AZStd::string Datum::ToStringTransform(const Data::TransformType& source) const @@ -2527,39 +2567,39 @@ namespace ScriptCanvas float scale = copy.ExtractUniformScale(); AZ::Vector3 rotation = AZ::ConvertTransformToEulerDegrees(copy); return AZStd::string::format - ( "(Position: X: %f, Y: %f, Z: %f," - " Rotation: X: %f, Y: %f, Z: %f," - " Scale: %f)" - , static_cast(pos.GetX()), static_cast(pos.GetY()), static_cast(pos.GetZ()) - , static_cast(rotation.GetX()), static_cast(rotation.GetY()), static_cast(rotation.GetZ()) - , scale); + ("(Position: X: %f, Y: %f, Z: %f," + " Rotation: X: %f, Y: %f, Z: %f," + " Scale: %f)" + , (pos.GetX()), (pos.GetY()), (pos.GetZ()) + , (rotation.GetX()), (rotation.GetY()), (rotation.GetZ()) + , scale); } AZStd::string Datum::ToStringVector2(const AZ::Vector2& source) const { return AZStd::string::format - ( "(X: %f, Y: %f)" + ("(X: %f, Y: %f)" , source.GetX() , source.GetY()); } - + AZStd::string Datum::ToStringVector3(const AZ::Vector3& source) const { return AZStd::string::format - ( "(X: %f, Y: %f, Z: %f)" - , static_cast(source.GetX()) - , static_cast(source.GetY()) - , static_cast(source.GetZ())); + ("(X: %f, Y: %f, Z: %f)" + , (source.GetX()) + , (source.GetY()) + , (source.GetZ())); } - + AZStd::string Datum::ToStringVector4(const AZ::Vector4& source) const { return AZStd::string::format - ("(X: %f, Y: %f, Z: %f, W: %f)" - , static_cast(source.GetX()) - , static_cast(source.GetY()) - , static_cast(source.GetZ()) - , static_cast(source.GetW())); + ("(X: %f, Y: %f, Z: %f, W: %f)" + , (source.GetX()) + , (source.GetY()) + , (source.GetZ()) + , (source.GetW())); } AZ::Outcome Datum::CallBehaviorContextMethod(const AZ::BehaviorMethod* method, AZ::BehaviorValueParameter* params, unsigned int numExpectedArgs) @@ -2608,5 +2648,4 @@ namespace ScriptCanvas { return datum != nullptr && !datum->Empty(); } - } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Datum.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Datum.h index c3730aed0a..189934fe17 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Datum.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Datum.h @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -9,8 +9,8 @@ #include #include -#include #include +#include #include #include #include @@ -59,7 +59,7 @@ namespace ScriptCanvas Datum(BehaviorContextResultTag, const AZ::BehaviorParameter& resultType); Datum(const AZStd::string& behaviorClassName, eOriginality originality); Datum(const AZ::BehaviorValueParameter& value); - + void ReconfigureDatumTo(Datum&& object); void ReconfigureDatumTo(const Datum& object); @@ -204,18 +204,18 @@ namespace ScriptCanvas { static_assert(!AZStd::is_pointer::value, "no pointer types in the Datum::GetAsHelper"); - if (datum.m_storage.empty()) + if (datum.m_storage.value.empty()) { // rare, but can be caused by removals or problems with reflection to BehaviorContext, so must be checked return nullptr; } else if (datum.m_type.GetType() == Data::eType::BehaviorContextObject) { - return (*AZStd::any_cast(&datum.m_storage))->CastConst(); + return (*AZStd::any_cast(&datum.m_storage.value))->CastConst(); } else { - return AZStd::any_cast(&datum.m_storage); + return AZStd::any_cast(&datum.m_storage.value); } } }; @@ -253,12 +253,12 @@ namespace ScriptCanvas // eOriginality records the graph source of the object eOriginality m_originality = eOriginality::Copy; // storage for the datum, regardless of ScriptCanvas::Data::Type - AZStd::any m_storage; + RuntimeVariable m_storage; - // This contains the editor label for m_storage. + // This contains the editor label for m_storage.value. AZStd::string m_datumLabel; - // This contains the editor visibility for m_storage. + // This contains the editor visibility for m_storage.value. AZ::Crc32 m_visibility{ AZ::Edit::PropertyVisibility::ShowChildrenOnly }; // storage for implicit conversions, when needed AZStd::any m_conversionStorage; @@ -304,7 +304,7 @@ namespace ScriptCanvas bool InitializeCRC(const void* source); bool InitializeEntityID(const void* source); - + bool InitializeNamedEntityID(const void* source); bool InitializeMatrix3x3(const void* source); @@ -384,7 +384,7 @@ namespace ScriptCanvas bool Datum::Empty() const { - return m_storage.empty() || GetValueAddress() == nullptr; + return m_storage.value.empty() || GetValueAddress() == nullptr; } template @@ -492,7 +492,7 @@ namespace ScriptCanvas { if (Data::IsValueType(m_type)) { - m_storage = value; + m_storage.value = value; return true; } else diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp index a1791509b0..c2245e92ee 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -136,10 +136,7 @@ namespace ScriptCanvas { if (nodeEntity) { - if (nodeEntity->GetState() == AZ::Entity::State::Constructed) - { - nodeEntity->Init(); - } + ScriptCanvas::ScopedAuxiliaryEntityHandler entityHandler(nodeEntity); if (auto* node = AZ::EntityUtils::FindFirstDerivedComponent(nodeEntity)) { @@ -155,10 +152,7 @@ namespace ScriptCanvas { if (connectionEntity) { - if (connectionEntity->GetState() == AZ::Entity::State::Constructed) - { - connectionEntity->Init(); - } + ScriptCanvas::ScopedAuxiliaryEntityHandler entityHandler(connectionEntity); } } @@ -169,7 +163,7 @@ namespace ScriptCanvas { if (m_isFunctionGraph) { - return true; + return true; } return false; @@ -418,7 +412,7 @@ namespace ScriptCanvas void Graph::ValidateVariables(ValidationResults& validationResults) { const VariableData* variableData = GetVariableData(); - + if (!variableData) { return; @@ -440,7 +434,7 @@ namespace ScriptCanvas { errorDescription = AZStd::string::format("Variable %s has an invalid type %s.", GetVariableName(variableId).data(), variableType.GetAZType().ToString().c_str()); } - } + } else if (variableType == Data::Type::Invalid()) { errorDescription = AZStd::string::format("Variable %s has an invalid type.", GetVariableName(variableId).data()); @@ -502,7 +496,7 @@ namespace ScriptCanvas { m_graphData.m_nodes.emplace(nodeEntity); m_nodeMapping[nodeId] = node; - + node->SetOwningScriptCanvasId(m_scriptCanvasId); node->Configure(); GraphNotificationBus::Event(m_scriptCanvasId, &GraphNotifications::OnNodeAdded, nodeId); @@ -523,17 +517,17 @@ namespace ScriptCanvas if (node) { auto entry = m_graphData.m_nodes.find(node->GetEntity()); - if (entry != m_graphData.m_nodes.end()) - { - m_nodeMapping.erase(nodeId); - m_graphData.m_nodes.erase(entry); - GraphNotificationBus::Event(GetScriptCanvasId(), &GraphNotifications::OnNodeRemoved, nodeId); + if (entry != m_graphData.m_nodes.end()) + { + m_nodeMapping.erase(nodeId); + m_graphData.m_nodes.erase(entry); + GraphNotificationBus::Event(GetScriptCanvasId(), &GraphNotifications::OnNodeRemoved, nodeId); - RemoveDependentAsset(nodeId); - return true; + RemoveDependentAsset(nodeId); + return true; + } } } - } return false; } @@ -1036,17 +1030,17 @@ namespace ScriptCanvas } } -// for (auto connectionId : removableConnections) -// { -// DisconnectById(connectionId); -// } + // for (auto connectionId : removableConnections) + // { + // DisconnectById(connectionId); + // } if (!removableConnections.empty()) { // RefreshConnectionValidity(warnOnRemoval); } } - + void Graph::OnEntityActivated(const AZ::EntityId&) { } @@ -1075,7 +1069,7 @@ namespace ScriptCanvas AZ::Data::AssetManager::Instance().GetAsset(scriptEventNode->GetAssetId(), AZ::Data::AssetLoadBehavior::Default); } } - + m_batchAddingData = false; GraphNotificationBus::Event(GetScriptCanvasId(), &GraphNotifications::OnBatchAddComplete); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Nodeable.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Nodeable.cpp index c73b7e0b8e..f3d6070ac6 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Nodeable.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Nodeable.cpp @@ -79,6 +79,7 @@ namespace ScriptCanvas behaviorContext->Class() ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::List) ->Attribute(AZ::ScriptCanvasAttributes::VariableCreationForbidden, AZ::AttributeIsValid::IfPresent) + ->Attribute(AZ::Script::Attributes::UseClassIndexAllowNil, AZ::AttributeIsValid::IfPresent) ->Constructor() ->Method("Deactivate", &Nodeable::Deactivate) ->Method("InitializeExecutionState", &Nodeable::InitializeExecutionState) diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Debugger/Debugger.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Debugger/Debugger.cpp index 1435808490..c99e467a9d 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Debugger/Debugger.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Debugger/Debugger.cpp @@ -756,10 +756,9 @@ namespace ScriptCanvas { auto runtimeComponent = (*graphIter); - if (graphIdentifier.m_assetId.m_guid == runtimeComponent->GetAsset().GetId().m_guid) + if (graphIdentifier.m_assetId.m_guid == runtimeComponent->GetRuntimeDataOverrides().m_runtimeAsset.GetId().m_guid) { // TODO: Gate on ComponentId - // \todo chcurran restore this functionality // runtimeComponent->SetIsGraphObserved(observedState); runtimeComponents.erase(graphIter); break; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionContext.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionContext.cpp index 3098f03e6a..22455b8a1c 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionContext.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionContext.cpp @@ -1,12 +1,13 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ #include #include +#include #include #include #include @@ -19,13 +20,13 @@ namespace ExecutionContextCpp { - void TypeCopy(AZ::BehaviorValueParameter& lhs, const AZ::BehaviorValueParameter& rhs) + void CopyTypeInformationOnly(AZ::BehaviorValueParameter& lhs, const AZ::BehaviorValueParameter& rhs) { lhs.m_typeId = rhs.m_typeId; lhs.m_azRtti = rhs.m_azRtti; } - void ValueCopy(AZ::BehaviorValueParameter& lhs, const AZ::BehaviorValueParameter& rhs) + void CopyTypeAndValueSource(AZ::BehaviorValueParameter& lhs, const AZ::BehaviorValueParameter& rhs) { lhs.m_typeId = rhs.m_typeId; lhs.m_azRtti = rhs.m_azRtti; @@ -37,97 +38,72 @@ namespace ScriptCanvas { namespace Execution { - ActivationData::ActivationData(const RuntimeComponent& component, ActivationInputArray& storage) - : entityId(component.GetEntityId()) - , variableOverrides(component.GetVariableOverrides()) - , runtimeData(component.GetAsset()->GetData()) + ActivationData::ActivationData(const RuntimeDataOverrides& variableOverrides, ActivationInputArray& storage) + : variableOverrides(variableOverrides) + , runtimeData(variableOverrides.m_runtimeAsset->GetData()) , storage(storage) {} - ActivationData::ActivationData(const AZ::EntityId entityId, const VariableData& variableOverrides, const RuntimeData& runtimeData, ActivationInputArray& storage) - : entityId(entityId) - , variableOverrides(variableOverrides) - , runtimeData(runtimeData) - , storage(storage) - {} + const void* ActivationData::GetVariableSource(size_t index, size_t& overrideIndexTracker) const + { + if (variableOverrides.m_variableIndices[index]) + { + return AZStd::any_cast(&variableOverrides.m_variables[overrideIndexTracker++].value); + } + else + { + return runtimeData.m_input.m_variables[index].second.GetAsDanger(); + } + } - ActivationInputRange Context::CreateActivateInputRange(ActivationData& activationData) + ActivationInputRange Context::CreateActivateInputRange(ActivationData& activationData, [[maybe_unused]] const AZ::EntityId& forSliceSupportOnly) { const RuntimeData& runtimeData = activationData.runtimeData; ActivationInputRange rangeOut = runtimeData.m_activationInputRange; rangeOut.inputs = activationData.storage.begin(); - + AZ_Assert(rangeOut.totalCount <= activationData.storage.size(), "Too many initial arguments for activation. " "Consider increasing size, source of ActivationInputArray, or breaking up the source graph"); - // nodeables + // nodeables - until the optimization is required, every instance gets their own copy { auto sourceVariableIter = runtimeData.m_activationInputRange.inputs; const auto sourceVariableSentinel = runtimeData.m_activationInputRange.inputs + runtimeData.m_activationInputRange.nodeableCount; auto destVariableIter = rangeOut.inputs; for (; sourceVariableIter != sourceVariableSentinel; ++sourceVariableIter, ++destVariableIter) { - ExecutionContextCpp::ValueCopy(*destVariableIter, *sourceVariableIter); + ExecutionContextCpp::CopyTypeAndValueSource(*destVariableIter, *sourceVariableIter); } } - // (possibly overridden) variables + // (possibly overridden) variables, only the overrides are saved in on the component, otherwise they are taken from the runtime asset { auto sourceVariableIter = runtimeData.m_activationInputRange.inputs + runtimeData.m_activationInputRange.nodeableCount; auto destVariableIter = rangeOut.inputs + runtimeData.m_activationInputRange.nodeableCount; - for (auto& idDatumPair : runtimeData.m_input.m_variables) + size_t overrideIndexTracker = 0; + const size_t sentinel = runtimeData.m_input.m_variables.size(); + for (size_t index = 0; index != sentinel; ++index, ++destVariableIter, ++sourceVariableIter) { - ExecutionContextCpp::TypeCopy(*destVariableIter, *sourceVariableIter); - - auto variableOverride = activationData.variableOverrides.FindVariable(idDatumPair.first); - const Datum* datum = variableOverride ? variableOverride->GetDatum() : &idDatumPair.second; - destVariableIter->m_value = const_cast(datum->GetAsDanger()); - - ++destVariableIter; - ++sourceVariableIter; + ExecutionContextCpp::CopyTypeInformationOnly(*destVariableIter, *sourceVariableIter); + destVariableIter->m_value = const_cast(activationData.GetVariableSource(index, overrideIndexTracker)); } } - // (must always be re-mapped) EntityId - if (!runtimeData.m_input.m_entityIds.empty()) + // (always overridden) EntityIds { - AZ::SliceComponent::EntityIdToEntityIdMap loadedEntityIdMap; - AzFramework::EntityContextId owningContextId = AzFramework::EntityContextId::CreateNull(); - AzFramework::EntityIdContextQueryBus::EventResult(owningContextId, activationData.entityId, &AzFramework::EntityIdContextQueries::GetOwningContextId); - if (!owningContextId.IsNull()) - { - AzFramework::SliceEntityOwnershipServiceRequestBus::EventResult(loadedEntityIdMap, owningContextId, &AzFramework::SliceEntityOwnershipServiceRequestBus::Events::GetLoadedEntityIdMap); - } - AZ::BehaviorValueParameter* destVariableIter = rangeOut.inputs + runtimeData.m_activationInputRange.nodeableCount + runtimeData.m_activationInputRange.variableCount; const auto entityIdTypeId = azrtti_typeid(); - for (auto& idEntityPair : runtimeData.m_input.m_entityIds) + + for (auto& entityId : activationData.variableOverrides.m_entityIds) { destVariableIter->m_typeId = entityIdTypeId; destVariableIter->m_value = destVariableIter->m_tempData.allocate(sizeof(Data::EntityIDType), AZStd::alignment_of::value, 0); auto entityIdValuePtr = reinterpret_cast*>(destVariableIter->m_value); - - if (auto variableOverride = activationData.variableOverrides.FindVariable(idEntityPair.first)) - { - *entityIdValuePtr = *variableOverride->GetDatum()->GetAs(); - } - else - { - auto iter = loadedEntityIdMap.find(idEntityPair.second); - if (iter != loadedEntityIdMap.end()) - { - *entityIdValuePtr = iter->second; - } - else - { - *entityIdValuePtr = Data::EntityIDType(); - } - } - + *entityIdValuePtr = entityId; ++destVariableIter; } } @@ -156,7 +132,7 @@ namespace ScriptCanvas for (auto& idDatumPair : runtimeData.m_input.m_variables) { - const Datum* datum = &idDatumPair.second; + const Datum* datum = &idDatumPair.second; AZ::BehaviorValueParameter bvp; bvp.m_typeId = datum->GetType().GetAZType(); const auto classIter(behaviorContext.m_typeToClassMap.find(bvp.m_typeId)); @@ -214,6 +190,6 @@ namespace ScriptCanvas Execution::InterpretedUnloadData(runtimeData); } - } + } -} +} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionContext.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionContext.h index ee3c5230c3..e5adf33c16 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionContext.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionContext.h @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -12,9 +12,9 @@ namespace ScriptCanvas { class RuntimeComponent; - class VariableData; struct RuntimeData; + struct RuntimeDataOverrides; namespace Execution { @@ -22,15 +22,15 @@ namespace ScriptCanvas struct ActivationData { - ActivationData(const RuntimeComponent& component, ActivationInputArray& storage); - ActivationData(const AZ::EntityId entityId, const VariableData& variableOverrides, const RuntimeData& runtimeData, ActivationInputArray& storage); - - const AZ::EntityId entityId; - const VariableData& variableOverrides; + const RuntimeDataOverrides& variableOverrides; const RuntimeData& runtimeData; ActivationInputArray& storage; + + ActivationData(const RuntimeDataOverrides& variableOverrides, ActivationInputArray& storage); + + const void* GetVariableSource(size_t index, size_t& overrideIndexTracker) const; }; - + struct ActivationInputRange { AZ::BehaviorValueParameter* inputs = nullptr; @@ -47,7 +47,7 @@ namespace ScriptCanvas AZ_TYPE_INFO(Context, "{2C137581-19F4-42EB-8BF3-14DBFBC02D8D}"); AZ_CLASS_ALLOCATOR(Context, AZ::SystemAllocator, 0); - static ActivationInputRange CreateActivateInputRange(ActivationData& activationData); + static ActivationInputRange CreateActivateInputRange(ActivationData& activationData, const AZ::EntityId& forSliceSupportOnly); static void InitializeActivationData(RuntimeData& runtimeData); static void UnloadData(RuntimeData& runtimeData); @@ -56,5 +56,5 @@ namespace ScriptCanvas static void IntializeStaticCloners(RuntimeData& runtimeData, AZ::BehaviorContext& behaviorContext); }; - } -} + } +} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionState.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionState.cpp index 6579d24e21..230ab335a6 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionState.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionState.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -27,34 +27,34 @@ namespace ScriptCanvas ExecutionState::ExecutionState(const ExecutionStateConfig& config) : m_component(&config.component) {} - + ExecutionStatePtr ExecutionState::Create(const ExecutionStateConfig& config) { Grammar::ExecutionStateSelection selection = config.runtimeData.m_input.m_executionSelection; switch (selection) { - case Grammar::InterpretedPure: + case Grammar::ExecutionStateSelection::InterpretedPure: return AZStd::make_shared(config); - - case Grammar::InterpretedPureOnGraphStart: + + case Grammar::ExecutionStateSelection::InterpretedPureOnGraphStart: return AZStd::make_shared(config); - case Grammar::InterpretedObject: + case Grammar::ExecutionStateSelection::InterpretedObject: return AZStd::make_shared(config); - case Grammar::InterpretedObjectOnGraphStart: + case Grammar::ExecutionStateSelection::InterpretedObjectOnGraphStart: return AZStd::make_shared(config); - + default: AZ_Assert(false, "Unsupported ScriptCanvas execution selection"); return nullptr; } } - + AZ::Data::AssetId ExecutionState::GetAssetId() const { - return m_component->GetAsset().GetId(); + return m_component->GetRuntimeDataOverrides().m_runtimeAsset.GetId(); } AZ::EntityId ExecutionState::GetEntityId() const @@ -82,9 +82,9 @@ namespace ScriptCanvas return m_component->GetScriptCanvasId(); } - const VariableData& ExecutionState::GetVariableOverrides() const + const RuntimeDataOverrides& ExecutionState::GetRuntimeDataOverrides() const { - return m_component->GetVariableOverrides(); + return m_component->GetRuntimeDataOverrides(); } void ExecutionState::Reflect(AZ::ReflectContext* reflectContext) @@ -92,10 +92,12 @@ namespace ScriptCanvas if (auto behaviorContext = azrtti_cast(reflectContext)) { behaviorContext->Class() + ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::List) + ->Attribute(AZ::ScriptCanvasAttributes::VariableCreationForbidden, AZ::AttributeIsValid::IfPresent) ->Method("GetEntityId", &ExecutionState::GetEntityId) ->Method("GetScriptCanvasId", &ExecutionState::GetScriptCanvasId) ->Method("ToString", &ExecutionState::ToString) - ->Attribute(AZ::Script::Attributes::Operator, AZ::Script::Attributes::OperatorType::ToString) + ->Attribute(AZ::Script::Attributes::Operator, AZ::Script::Attributes::OperatorType::ToString) ; } @@ -116,7 +118,7 @@ namespace ScriptCanvas { return shared_from_this(); } - + AZStd::string ExecutionState::ToString() const { return AZStd::string::format("ExecutionState[%p]", this); @@ -132,4 +134,4 @@ namespace ScriptCanvas return ExecutionStateWeakConstPtr(this); } -} +} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionState.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionState.h index feb10c56eb..d32807813e 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionState.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionState.h @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -37,7 +37,7 @@ namespace ScriptCanvas ExecutionStateConfig(AZ::Data::Asset asset, RuntimeComponent& component); }; - + class ExecutionState : public AZStd::enable_shared_from_this { @@ -50,7 +50,7 @@ namespace ScriptCanvas static void Reflect(AZ::ReflectContext* reflectContext); const RuntimeComponent* m_component = nullptr; - + ExecutionState(const ExecutionStateConfig& config); virtual ~ExecutionState() = default; @@ -71,7 +71,7 @@ namespace ScriptCanvas AZ::EntityId GetScriptCanvasId() const; - const VariableData& GetVariableOverrides() const; + const RuntimeDataOverrides& GetRuntimeDataOverrides() const; virtual void Initialize() = 0; @@ -88,4 +88,4 @@ namespace ScriptCanvas ExecutionStateWeakConstPtr WeakFromThisConst() const; }; -} +} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.cpp index 3d4cb9a939..8a8c33bc10 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -176,7 +176,7 @@ namespace ExecutionInterpretedAPICpp // Lua: AZStd::pair multipleResults = ScriptCanvas::BehaviorContextUtils::ConstructTupleGetContext(typeId); AZ_Assert(multipleResults.first, "failure to construct a tuple by typeid from behavior context"); - AZ::BehaviorValueParameter parameter; + AZ::BehaviorValueParameter parameter; parameter.m_value = multipleResults.first; parameter.m_typeId = typeId; AZ::StackPush(lua, multipleResults.second, parameter); @@ -253,7 +253,7 @@ namespace ScriptCanvas break; } } - + void SetInterpretedExecutionModeDebug() { AZ::ScriptContext* scriptContext{}; @@ -314,7 +314,7 @@ namespace ScriptCanvas { using namespace ExecutionInterpretedAPICpp; static_assert(sizeof(AZ::Uuid) == k_UuidSize, "size of uuid has changed"); - + AZStd::string fastString; fastString.resize(k_StringFastSize); char* fastDigit = fastString.begin(); @@ -338,7 +338,7 @@ namespace ScriptCanvas AZ_Assert(string, "string argument must not be null"); AZ_Assert(strlen(string) == k_StringFastSize, "invalid length of string, fast format must be: 0123456789ABCDEF0123456789ABCDEF"); const char* current = string; - + AZ::Uuid id; auto data = id.begin(); auto sentinel = id.end(); @@ -358,8 +358,7 @@ namespace ScriptCanvas ++current; *data = (value0 << 4) | value1; - } - while ((++data) != sentinel); + } while ((++data) != sentinel); return id; } @@ -370,7 +369,6 @@ namespace ScriptCanvas /** Here is the function in Lua for easier reading - function OverrideNodeableMetatable(userdata, class_mt) local proxy = setmetatable({}, class_mt) -- class_mt from the user graph definition local instance_mt = { @@ -388,18 +386,16 @@ namespace ScriptCanvas --]] return setmetatable(userdata instance_mt) -- can't be done from Lua end - --[[ userdata to Nodeable before: getmetatable(userdata).__index == Nodeable - + userdata to Nodeable after: local override_mt = getmetatable(userdata) local proxy = override_mt.__index local SubGraph = getmetatable(proxy).__index getmetatable(SubGraph.__index) == Nodeable) --]] - */ // \note: all other metamethods ignored for now @@ -504,7 +500,7 @@ namespace ScriptCanvas AZ_Assert(argsCount >= 2, "CallExecutionOut: Error in compiled Lua file, not enough arguments"); AZ_Assert(lua_isuserdata(lua, 1), "CallExecutionOut: Error in compiled lua file, 1st argument to SetExecutionOut is not userdata (Nodeable)"); AZ_Assert(lua_isnumber(lua, 2), "CallExecutionOut: Error in compiled lua file, 2nd argument to SetExecutionOut is not a number"); - Nodeable* nodeable = AZ::ScriptValue::StackRead(lua, 1); + Nodeable* nodeable = AZ::ScriptValue::StackRead(lua, 1); size_t index = aznumeric_caster(lua_tointeger(lua, 2)); nodeable->CallOut(index, nullptr, nullptr, argsCount - 2); // Lua: results... @@ -568,7 +564,7 @@ namespace ScriptCanvas { const int handlerIndex = lua_gettop(lua) - argCount; lua_pushcfunction(lua, &ExecutionInterpretedAPICpp::ErrorHandler); - lua_insert(lua, handlerIndex); + lua_insert(lua, handlerIndex); int result = lua_pcall(lua, argCount, returnValueCount, handlerIndex); lua_remove(lua, handlerIndex); return result; @@ -581,7 +577,7 @@ namespace ScriptCanvas AZ_Assert(lua_isuserdata(lua, -3), "Error in compiled lua file, 1st argument to SetExecutionOut is not userdata (Nodeable)"); AZ_Assert(lua_isnumber(lua, -2), "Error in compiled lua file, 2nd argument to SetExecutionOut is not a number"); - AZ_Assert(lua_isfunction(lua, -1), "Error in compiled lua file, 3rd argument to SetExecutionOut is not a function (lambda need to get around atypically routed arguments)"); + AZ_Assert(lua_isfunction(lua, -1), "Error in compiled lua file, 3rd argument to SetExecutionOut is not a function (lambda need to get around atypically routed arguments)"); Nodeable* nodeable = AZ::ScriptValue::StackRead(lua, -3); AZ_Assert(nodeable, "Failed to read nodeable"); size_t index = aznumeric_caster(lua_tointeger(lua, -2)); @@ -680,9 +676,9 @@ namespace ScriptCanvas struct DependencyConstructionPack { ExecutionStateInterpreted* executionState; - AZStd::vector>* dependentAssets; - const size_t dependentAssetsIndex; - RuntimeData& runtimeData; + AZStd::vector* dependencies; + const size_t dependenciesIndex; + RuntimeDataOverrides& runtimeOverrides; }; DependencyConstructionPack UnpackDependencyConstructionArgsSanitize(lua_State* lua) @@ -690,27 +686,26 @@ namespace ScriptCanvas auto executionState = AZ::ScriptValue::StackRead(lua, 1); AZ_Assert(executionState, "Error in compiled lua file, 1st argument to UnpackDependencyArgs is not an ExecutionStateInterpreted"); AZ_Assert(lua_islightuserdata(lua, 2), "Error in compiled lua file, 2nd argument to UnpackDependencyArgs is not userdata (AZStd::vector>*), but a :%s", lua_typename(lua, 2)); - auto dependentAssets = reinterpret_cast>*>(lua_touserdata(lua, 2)); + auto dependentOverrides = reinterpret_cast*>(lua_touserdata(lua, 2)); AZ_Assert(lua_isinteger(lua, 3), "Error in compiled Lua file, 3rd argument to UnpackDependencyArgs is not a number"); - const size_t dependentAssetsIndex = aznumeric_caster(lua_tointeger(lua, 3)); - - return DependencyConstructionPack{ executionState, dependentAssets, dependentAssetsIndex, (*dependentAssets)[dependentAssetsIndex].Get()->m_runtimeData }; + const size_t dependencyIndex = aznumeric_caster(lua_tointeger(lua, 3)); + return DependencyConstructionPack{ executionState, dependentOverrides, dependencyIndex, (*dependentOverrides)[dependencyIndex] }; } int Unpack(lua_State* lua, DependencyConstructionPack& args) { ActivationInputArray storage; - ActivationData data(args.executionState->GetEntityId(), args.executionState->GetVariableOverrides(), args.runtimeData, storage); - ActivationInputRange range = Execution::Context::CreateActivateInputRange(data); + ActivationData data(args.runtimeOverrides, storage); + ActivationInputRange range = Execution::Context::CreateActivateInputRange(data, args.executionState->GetEntityId()); PushActivationArgs(lua, range.inputs, range.totalCount); return range.totalCount; } int UnpackDependencyConstructionArgs(lua_State* lua) { - // Lua: executionState, dependentAssets, dependentAssetsIndex + // Lua: executionState, dependent overrides, index into dependent overrides DependencyConstructionPack pack = UnpackDependencyConstructionArgsSanitize(lua); - lua_pushlightuserdata(lua, const_cast(reinterpret_cast(&pack.runtimeData.m_requiredAssets))); + lua_pushlightuserdata(lua, const_cast(reinterpret_cast(&pack.runtimeOverrides.m_dependencies))); return 1 + Unpack(lua, pack); } @@ -720,6 +715,5 @@ namespace ScriptCanvas DependencyConstructionPack constructionArgs = UnpackDependencyConstructionArgsSanitize(lua); return Unpack(lua, constructionArgs); } - } - -} + } +} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpreted.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpreted.cpp index d52807e952..7f690d086e 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpreted.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpreted.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -20,6 +20,7 @@ namespace ExecutionStateInterpretedCpp AZ::Data::Asset GetSubgraphAssetForDebug(const AZ::Data::AssetId& id) { + // #functions2 this may have to be made recursive auto asset = AZ::Data::AssetManager::Instance().GetAsset(id, AZ::Data::AssetLoadBehavior::PreLoad); asset.BlockUntilLoadComplete(); return asset; @@ -32,7 +33,7 @@ namespace ScriptCanvas : ExecutionState(config) , m_interpretedAsset(config.runtimeData.m_script) {} - + void ExecutionStateInterpreted::ClearLuaRegistryIndex() { m_luaRegistryIndex = LUA_NOREF; @@ -40,8 +41,8 @@ namespace ScriptCanvas const Grammar::DebugExecution* ExecutionStateInterpreted::GetDebugSymbolIn(size_t index) const { - return index < m_component->GetAssetData().m_debugMap.m_ins.size() - ? &(m_component->GetAssetData().m_debugMap.m_ins[index]) + return index < m_component->GetRuntimeAssetData().m_debugMap.m_ins.size() + ? &(m_component->GetRuntimeAssetData().m_debugMap.m_ins[index]) : nullptr; } @@ -55,8 +56,8 @@ namespace ScriptCanvas const Grammar::DebugExecution* ExecutionStateInterpreted::GetDebugSymbolOut(size_t index) const { - return index < m_component->GetAssetData().m_debugMap.m_outs.size() - ? &(m_component->GetAssetData().m_debugMap.m_outs[index]) + return index < m_component->GetRuntimeAssetData().m_debugMap.m_outs.size() + ? &(m_component->GetRuntimeAssetData().m_debugMap.m_outs[index]) : nullptr; } @@ -70,8 +71,8 @@ namespace ScriptCanvas const Grammar::DebugExecution* ExecutionStateInterpreted::GetDebugSymbolReturn(size_t index) const { - return index < m_component->GetAssetData().m_debugMap.m_returns.size() - ? &(m_component->GetAssetData().m_debugMap.m_returns[index]) + return index < m_component->GetRuntimeAssetData().m_debugMap.m_returns.size() + ? &(m_component->GetRuntimeAssetData().m_debugMap.m_returns[index]) : nullptr; } @@ -85,8 +86,8 @@ namespace ScriptCanvas const Grammar::DebugDataSource* ExecutionStateInterpreted::GetDebugSymbolVariableChange(size_t index) const { - return index < m_component->GetAssetData().m_debugMap.m_variables.size() - ? &(m_component->GetAssetData().m_debugMap.m_variables[index]) + return index < m_component->GetRuntimeAssetData().m_debugMap.m_variables.size() + ? &(m_component->GetRuntimeAssetData().m_debugMap.m_variables[index]) : nullptr; } @@ -131,6 +132,8 @@ namespace ScriptCanvas if (AZ::BehaviorContext* behaviorContext = azrtti_cast(reflectContext)) { behaviorContext->Class() + ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::List) + ->Attribute(AZ::ScriptCanvasAttributes::VariableCreationForbidden, AZ::AttributeIsValid::IfPresent) ; } } @@ -148,5 +151,4 @@ namespace ScriptCanvas luaL_unref(m_luaState, LUA_REGISTRYINDEX, m_luaRegistryIndex); m_luaRegistryIndex = LUA_NOREF; } - -} +} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpretedPerActivation.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpretedPerActivation.cpp index 7662c8dca9..42bb5681d6 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpretedPerActivation.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpretedPerActivation.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -19,7 +19,7 @@ namespace ScriptCanvas ExecutionStateInterpretedPerActivation::ExecutionStateInterpretedPerActivation(const ExecutionStateConfig& config) : ExecutionStateInterpreted(config) {} - + ExecutionStateInterpretedPerActivation::~ExecutionStateInterpretedPerActivation() { if (m_deactivationRequired) @@ -45,15 +45,15 @@ namespace ScriptCanvas AZ::Internal::LuaClassToStack(lua, this, azrtti_typeid(), AZ::ObjectToLua::ByReference, AZ::AcquisitionOnPush::None); // Lua: graph_VM, graph_VM['new'], userdata Execution::ActivationInputArray storage; - Execution::ActivationData data(*m_component, storage); - Execution::ActivationInputRange range = Execution::Context::CreateActivateInputRange(data); + Execution::ActivationData data(m_component->GetRuntimeDataOverrides(), storage); + Execution::ActivationInputRange range = Execution::Context::CreateActivateInputRange(data, m_component->GetEntityId()); if (range.requiresDependencyConstructionParameters) { - lua_pushlightuserdata(lua, const_cast(reinterpret_cast(&data.runtimeData.m_requiredAssets))); - // Lua: graph_VM, graph_VM['new'], userdata, dependencies + lua_pushlightuserdata(lua, const_cast(reinterpret_cast(&data.variableOverrides.m_dependencies))); + // Lua: graph_VM, graph_VM['new'], userdata, runtimeDataOverrides Execution::PushActivationArgs(lua, range.inputs, range.totalCount); - // Lua: graph_VM, graph_VM['new'], userdata, dependencies, args... + // Lua: graph_VM, graph_VM['new'], userdata, runtimeDataOverrides, args... AZ::Internal::LuaSafeCall(lua, aznumeric_caster(2 + range.totalCount), 1); } else @@ -139,5 +139,4 @@ namespace ScriptCanvas ; } } - -} +} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpretedPure.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpretedPure.cpp index db8d729e67..0c697d4735 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpretedPure.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpretedPure.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -21,7 +21,7 @@ namespace ScriptCanvas void ExecutionStateInterpretedPure::Execute() {} - + void ExecutionStateInterpretedPure::Initialize() {} @@ -52,8 +52,8 @@ namespace ScriptCanvas AZ::Internal::LuaClassToStack(lua, this, azrtti_typeid(), AZ::ObjectToLua::ByReference, AZ::AcquisitionOnPush::None); // Lua: graph_VM, graph_VM['k_OnGraphStartFunctionName'], userdata Execution::ActivationInputArray storage; - Execution::ActivationData data(*m_component, storage); - Execution::ActivationInputRange range = Execution::Context::CreateActivateInputRange(data); + Execution::ActivationData data(m_component->GetRuntimeDataOverrides(), storage); + Execution::ActivationInputRange range = Execution::Context::CreateActivateInputRange(data, m_component->GetEntityId()); Execution::PushActivationArgs(lua, range.inputs, range.totalCount); // Lua: graph_VM, graph_VM['k_OnGraphStartFunctionName'], userdata, args... const int result = Execution::InterpretedSafeCall(lua, aznumeric_caster(1 + range.totalCount), 0); @@ -78,4 +78,4 @@ namespace ScriptCanvas ; } } -} +} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/RuntimeComponent.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/RuntimeComponent.cpp index 7533ec3699..64d6a9339e 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/RuntimeComponent.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/RuntimeComponent.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -24,9 +24,12 @@ namespace RuntimeComponentCpp { - enum Version + enum class RuntimeComponentVersion : unsigned int { ForceAssetPreloads = 5, + AddRuntimeDataOverrides, + PrefabSupport, + RemoveRuntimeAsset, // add description above Current, @@ -40,17 +43,11 @@ namespace ScriptCanvas return GraphInfo(scriptCanvasId, graphIdentifier); } - DatumValue CreateDatumValue(ScriptCanvasId /*scriptCanvasId*/, const GraphVariable& variable) + DatumValue CreateDatumValue([[maybe_unused]] ScriptCanvasId scriptCanvasId, const GraphVariable& variable) { return DatumValue::Create(GraphVariable((*variable.GetDatum()), variable.GetVariableId())); } - RuntimeComponent::RuntimeComponent(AZ::Data::Asset runtimeAsset) - : m_runtimeAsset(runtimeAsset) - { - m_runtimeAsset.SetAutoLoadBehavior(AZ::Data::AssetLoadBehavior::PreLoad); - } - void RuntimeComponent::Activate() { InitializeExecution(); @@ -66,18 +63,13 @@ namespace ScriptCanvas AZ_PROFILE_SCOPE_DYNAMIC(AZ::Debug::ProfileCategory::ScriptCanvas, "RuntimeComponent::Execute (%s)", m_runtimeAsset.GetId().ToString().c_str()); AZ_Assert(m_executionState, "RuntimeComponent::Execute called without an execution state"); SC_EXECUTION_TRACE_GRAPH_ACTIVATED(CreateActivationInfo()); - SCRIPT_CANVAS_PERFORMANCE_SCOPE_EXECUTION(m_executionState->GetScriptCanvasId(), m_runtimeAsset.GetId()); + SCRIPT_CANVAS_PERFORMANCE_SCOPE_EXECUTION(m_executionState->GetScriptCanvasId(), m_runtimeOverrides.m_runtimeAsset.GetId()); m_executionState->Execute(); } - const AZ::Data::Asset& RuntimeComponent::GetAsset() const - { - return m_runtimeAsset; - } - - const RuntimeData& RuntimeComponent::GetAssetData() const + const RuntimeData& RuntimeComponent::GetRuntimeAssetData() const { - return m_runtimeAsset->GetData(); + return m_runtimeOverrides.m_runtimeAsset->GetData(); } ExecutionMode RuntimeComponent::GetExecutionMode() const @@ -87,7 +79,7 @@ namespace ScriptCanvas GraphIdentifier RuntimeComponent::GetGraphIdentifier() const { - return GraphIdentifier(AZ::Data::AssetId(m_runtimeAsset.GetId().m_guid, 0), 0); + return GraphIdentifier(AZ::Data::AssetId(m_runtimeOverrides.m_runtimeAsset.GetId().m_guid, 0), 0); } AZ::EntityId RuntimeComponent::GetScriptCanvasId() const @@ -95,37 +87,43 @@ namespace ScriptCanvas return m_scriptCanvasId; } - const VariableData& RuntimeComponent::GetVariableOverrides() const + const RuntimeDataOverrides& RuntimeComponent::GetRuntimeDataOverrides() const { - return m_variableOverrides; + return m_runtimeOverrides; + } + + void RuntimeComponent::SetRuntimeDataOverrides(const RuntimeDataOverrides& overrideData) + { + m_runtimeOverrides = overrideData; + m_runtimeOverrides.EnforcePreloadBehavior(); } void RuntimeComponent::Init() { m_scriptCanvasId = AZ::Entity::MakeId(); - AZ_Assert(m_runtimeAsset.GetAutoLoadBehavior() == AZ::Data::AssetLoadBehavior::PreLoad, "RuntimeComponent::m_runtimeAsset Auto load behavior MUST be set to AZ::Data::AssetLoadBehavior::PreLoad"); + AZ_Assert(RuntimeDataOverrides::IsPreloadBehaviorEnforced(m_runtimeOverrides), "RuntimeComponent::m_runtimeAsset Auto load behavior MUST be set to AZ::Data::AssetLoadBehavior::PreLoad"); } void RuntimeComponent::InitializeExecution() { #if defined(SCRIPT_CANVAS_RUNTIME_ASSET_CHECK) - if (!m_runtimeAsset.Get()) + if (!m_runtimeOverrides.m_runtimeAsset.Get()) { - AZ_Error("ScriptCanvas", false, "RuntimeComponent::m_runtimeAsset AssetId: %s was valid, but the data was not pre-loaded, so this script will not run", m_runtimeAsset.GetId().ToString().data()); + AZ_Error("ScriptCanvas", false, "RuntimeComponent::m_runtimeAsset AssetId: %s was valid, but the data was not pre-loaded, so this script will not run", m_runtimeOverrides.m_runtimeAsset.GetId().ToString().data()); return; } #else - AZ_Assert(m_runtimeAsset.Get(), "RuntimeComponent::m_runtimeAsset AssetId: %s was valid, but the data was not pre-loaded, so this script will not run", m_runtimeAsset.GetId().ToString().data()); + AZ_Assert(m_runtimeAsset.Get(), "RuntimeComponent::m_runtimeAsset AssetId: %s was valid, but the data was not pre-loaded, so this script will not run", m_runtimeOverrides.m_runtimeAsset.GetId().ToString().data()); #endif AZ_PROFILE_SCOPE_DYNAMIC(AZ::Debug::ProfileCategory::ScriptCanvas, "RuntimeComponent::InitializeExecution (%s)", m_runtimeAsset.GetId().ToString().c_str()); - SCRIPT_CANVAS_PERFORMANCE_SCOPE_INITIALIZATION(m_scriptCanvasId, m_runtimeAsset.GetId()); - m_executionState = ExecutionState::Create(ExecutionStateConfig(m_runtimeAsset, *this)); + SCRIPT_CANVAS_PERFORMANCE_SCOPE_INITIALIZATION(m_scriptCanvasId, m_runtimeOverrides.m_runtimeAsset.GetId()); + m_executionState = ExecutionState::Create(ExecutionStateConfig(m_runtimeOverrides.m_runtimeAsset, *this)); #if defined(SCRIPT_CANVAS_RUNTIME_ASSET_CHECK) if (!m_executionState) { - AZ_Error("ScriptCanvas", false, "RuntimeComponent::m_runtimeAsset AssetId: %s failed to create an execution state, possibly due to missing dependent asset, script will not run", m_runtimeAsset.GetId().ToString().data()); + AZ_Error("ScriptCanvas", false, "RuntimeComponent::m_runtimeAsset AssetId: %s failed to create an execution state, possibly due to missing dependent asset, script will not run", m_runtimeOverrides.m_runtimeAsset.GetId().ToString().data()); return; } #else @@ -135,7 +133,7 @@ namespace ScriptCanvas AZ::EntityBus::Handler::BusConnect(GetEntityId()); m_executionState->Initialize(); } - + void RuntimeComponent::OnEntityActivated(const AZ::EntityId&) { Execute(); @@ -151,24 +149,18 @@ namespace ScriptCanvas if (auto serializeContext = azrtti_cast(context)) { serializeContext->Class() - ->Version(RuntimeComponentCpp::Version::Current, &RuntimeComponent::VersionConverter) - ->Field("m_runtimeAsset", &RuntimeComponent::m_runtimeAsset) - ->Field("m_variableOverrides", &RuntimeComponent::m_variableOverrides) + ->Version(static_cast(RuntimeComponentCpp::RuntimeComponentVersion::Current), &RuntimeComponent::VersionConverter) + ->Field("runtimeOverrides", &RuntimeComponent::m_runtimeOverrides) ; } } - void RuntimeComponent::SetVariableOverrides(const VariableData& overrideData) - { - m_variableOverrides = overrideData; - } - void RuntimeComponent::StopExecution() { if (m_executionState) { m_executionState->StopExecution(); - SCRIPT_CANVAS_PERFORMANCE_FINALIZE_TIMER(GetScriptCanvasId(), m_runtimeAsset.GetId()); + SCRIPT_CANVAS_PERFORMANCE_FINALIZE_TIMER(GetScriptCanvasId(), m_runtimeOverrides.m_runtimeAsset.GetId()); SC_EXECUTION_TRACE_GRAPH_DEACTIVATED(CreateActivationInfo()); } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/RuntimeComponent.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/RuntimeComponent.h index 025c936d28..c59960f93f 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/RuntimeComponent.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/RuntimeComponent.h @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -17,9 +17,6 @@ #include #include -#include "RuntimeComponent.h" - - namespace ScriptCanvas { using VariableIdMap = AZStd::unordered_map; @@ -45,11 +42,8 @@ namespace ScriptCanvas RuntimeComponent() = default; - RuntimeComponent(AZ::Data::Asset runtimeAsset); - - const AZ::Data::Asset& GetAsset() const; - - const RuntimeData& GetAssetData() const; + // used to provide debug symbols, usually coming in the form of Node/Slot/Variable IDs + const RuntimeData& GetRuntimeAssetData() const; GraphIdentifier GetGraphIdentifier() const; @@ -57,9 +51,9 @@ namespace ScriptCanvas AZ::EntityId GetScriptCanvasId() const; - const VariableData& GetVariableOverrides() const; + const RuntimeDataOverrides& GetRuntimeDataOverrides() const; - void SetVariableOverrides(const VariableData& overrideData); + void SetRuntimeDataOverrides(const RuntimeDataOverrides& overrideData); protected: static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible) @@ -94,15 +88,8 @@ namespace ScriptCanvas void StopExecution(); private: - AZ::Data::Asset m_runtimeAsset; ExecutionStatePtr m_executionState; AZ::EntityId m_scriptCanvasId; - - //! Per instance variable data overrides for the runtime asset - //! This is serialized when building this component from the EditorScriptCanvasComponent - // \todo remove the names from this data, and make it more lightweight - // it only needs variable id and value - // move the other information to the runtime system component - VariableData m_variableOverrides; + RuntimeDataOverrides m_runtimeOverrides; }; } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp index 50abf19389..2ba248bb5e 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp @@ -1,12 +1,13 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ #include #include +#include #include #include #include @@ -41,11 +42,11 @@ namespace AbstractCodeModelCpp using namespace ScriptCanvas::Grammar; AZStd::unordered_set< const Nodes::Core::FunctionDefinitionNode*> Intersection - ( const AZStd::unordered_multimap& lhs + (const AZStd::unordered_multimap& lhs , const AZStd::unordered_set< const Nodes::Core::FunctionDefinitionNode*>& rhs) { AZStd::unordered_set< const Nodes::Core::FunctionDefinitionNode*> intersection; - + for (auto candidate : lhs) { if (rhs.contains(candidate.first)) @@ -147,7 +148,7 @@ namespace ScriptCanvas } } m_functions.clear(); - + m_userInsThatRequireTopology.clear(); m_userOutsThatRequireTopology.clear(); @@ -239,7 +240,7 @@ namespace ScriptCanvas // #functions2 slot<->variable consider getting all variables from the UX variable manager, or from the ACM and looking them up in the variable manager for ordering m_sourceVariableByDatum.insert(AZStd::make_pair(datum, &variablePair.second)); } - + } for (auto& sourceVariable : sortedVariables) @@ -424,7 +425,7 @@ namespace ScriptCanvas } void AbstractCodeModel::AddExecutionMapIn - ( UserInParseTopologyResult /*result*/ + (UserInParseTopologyResult /*result*/ , ExecutionTreeConstPtr root , const AZStd::vector& outCalls , AZStd::string_view defaultOutName @@ -441,10 +442,10 @@ namespace ScriptCanvas for (auto& input : functionInput) { in.inputs.push_back - ({ GetOriginalVariableName(input.second->m_source, nodelingIn) - , input.second->m_source->m_name - , input.second->m_source->m_datum - , input.second->m_source->m_sourceVariableId }); + ({ GetOriginalVariableName(input.second->m_source, nodelingIn) + , input.second->m_source->m_name + , input.second->m_source->m_datum + , input.second->m_source->m_sourceVariableId }); } if (!root->HasExplicitUserOutCalls()) @@ -473,10 +474,10 @@ namespace ScriptCanvas { const auto& returnValueVariable = root->GetReturnValue(returnValueIndex).second->m_source; out.outputs.push_back - ({ GetOriginalVariableName(returnValueVariable, *uniqueNodelingsOut.begin()) - , returnValueVariable->m_name - , returnValueVariable->m_datum.GetType() - , returnValueVariable->m_sourceVariableId }); + ({ GetOriginalVariableName(returnValueVariable, *uniqueNodelingsOut.begin()) + , returnValueVariable->m_name + , returnValueVariable->m_datum.GetType() + , returnValueVariable->m_sourceVariableId }); } in.outs.push_back(AZStd::move(out)); @@ -505,15 +506,15 @@ namespace ScriptCanvas SetDisplayAndParsedName(out, defaultOutName); out.sourceID = defaultOutId; } - + for (size_t inputIndex = 0; inputIndex < outCall->GetInputCount(); ++inputIndex) { const auto& returnValueVariable = outCall->GetInput(inputIndex).m_value; out.outputs.push_back - ({ GetOriginalVariableName(returnValueVariable, outCallID.m_node) - , returnValueVariable->m_name - , returnValueVariable->m_datum.GetType() - , returnValueVariable->m_sourceVariableId }); + ({ GetOriginalVariableName(returnValueVariable, outCallID.m_node) + , returnValueVariable->m_name + , returnValueVariable->m_datum.GetType() + , returnValueVariable->m_sourceVariableId }); } AZStd::const_pointer_cast(outCall)->SetOutCallIndex(m_outIndexCount); @@ -543,20 +544,20 @@ namespace ScriptCanvas { const auto& inputVariable = outCall->GetInput(inputIndex).m_value; out.outputs.push_back - ({ GetOriginalVariableName(inputVariable, &nodeling) - , inputVariable->m_name - , inputVariable->m_datum.GetType() - , inputVariable->m_sourceVariableId }); + ({ GetOriginalVariableName(inputVariable, &nodeling) + , inputVariable->m_name + , inputVariable->m_datum.GetType() + , inputVariable->m_sourceVariableId }); } for (size_t returnValueIndex = 0; returnValueIndex < outCall->GetReturnValueCount(); ++returnValueIndex) { const auto& returnValueVariable = outCall->GetReturnValue(returnValueIndex).second->m_source; out.outputs.push_back - ({ GetOriginalVariableName(returnValueVariable, &nodeling) - , returnValueVariable->m_name - , returnValueVariable->m_datum.GetType() - , returnValueVariable->m_sourceVariableId }); + ({ GetOriginalVariableName(returnValueVariable, &nodeling) + , returnValueVariable->m_name + , returnValueVariable->m_datum.GetType() + , returnValueVariable->m_sourceVariableId }); } AZStd::const_pointer_cast(outCall)->SetOutCallIndex(m_outIndexCount); @@ -697,7 +698,7 @@ namespace ScriptCanvas } AZStd::string AbstractCodeModel::CheckUniqueInterfaceNames - ( AZStd::string_view candidate + (AZStd::string_view candidate , AZStd::string_view defaultName , AZStd::unordered_set& uniqueNames , const AZStd::unordered_set& nodelingsOut) @@ -755,7 +756,7 @@ namespace ScriptCanvas } AZStd::vector AbstractCodeModel::CombineVariableLists - ( const AZStd::vector& constructionNodeables + (const AZStd::vector& constructionNodeables , const AZStd::vector>& constructionInputVariables , const AZStd::vector>& entityIds) const { @@ -766,12 +767,12 @@ namespace ScriptCanvas const void* nodeableAsVoidPtr = nodeable; auto iter = AZStd::find_if - ( m_nodeablesByNode.begin() + (m_nodeablesByNode.begin() , m_nodeablesByNode.end() - , [&](const auto& candidate) - { - return candidate.second->m_nodeable->m_datum.GetAsDanger() == nodeableAsVoidPtr; - }); + , [&](const auto& candidate) + { + return candidate.second->m_nodeable->m_datum.GetAsDanger() == nodeableAsVoidPtr; + }); if (iter != m_nodeablesByNode.end()) { @@ -784,7 +785,7 @@ namespace ScriptCanvas for (const auto& variable : entityIds) { - auto iter = AZStd::find_if( m_variables.begin(), m_variables.end(), [&](const auto& candidate) { + auto iter = AZStd::find_if(m_variables.begin(), m_variables.end(), [&](const auto& candidate) { if (candidate->m_datum.GetType() == Data::Type::EntityID()) { bool isVariableIdMatch = candidate->m_sourceVariableId == variable.first; @@ -836,7 +837,7 @@ namespace ScriptCanvas { ExecutionTreePtr child = AZStd::make_shared(); child->SetParent(parent); - child->SetId({node, slot}); + child->SetId({ node, slot }); child->SetScope(parent ? parent->ModScope() : m_graphScope); return child; } @@ -944,7 +945,7 @@ namespace ScriptCanvas AddError(node.GetEntityId(), nullptr, ParseErrors::EventNodeConnectCallMalformed); return false; } - + auto azEventNode = azrtti_cast(&node); if (!azEventNode) { @@ -1081,7 +1082,7 @@ namespace ScriptCanvas { // Node output is input data to a function definition OutputAssignmentPtr output = CreateOutput(execution, outputSlot, {}, "input"); - + if (auto variable = FindReferencedVariableChecked(execution, outputSlot)) { output->m_assignments.push_back(variable); @@ -1222,11 +1223,11 @@ namespace ScriptCanvas if (m_uniqueInNames.contains(displayName)) { AddError - ( nodeling->GetEntityId() + (nodeling->GetEntityId() , nullptr , AZStd::string::format ( "%s is the name of multiple In Nodelings in a subgraph,\n" - "this will result in a difficult or impossible to use Function Node when used in another graph", displayName.data())); + "this will result in a difficult or impossible to use Function Node when used in another graph", displayName.c_str())); return; } else @@ -1258,8 +1259,8 @@ namespace ScriptCanvas AddError(nodeling->GetEntityId() , nullptr , AZStd::string::format - ( "%s is the name of multiple In Nodelings in a subgraph,\n" - "this will result in a difficult or impossible to use Function Node when used in another graph", displayName.data())); + ("%s is the name of multiple In Nodelings in a subgraph,\n" + "this will result in a difficult or impossible to use Function Node when used in another graph", displayName.data())); } else { @@ -1355,7 +1356,7 @@ namespace ScriptCanvas { AddError(nullptr, aznew Internal::ParseError(node.GetEntityId(), AZStd::string::format ( "Execution cycle detected (see connections to %s-%s. Use a looping node like While or For" - , node.GetDebugName().data(), outSlot.GetName().data()).data())); + , node.GetDebugName().c_str(), outSlot.GetName().c_str()).c_str())); return true; } @@ -1368,12 +1369,12 @@ namespace ScriptCanvas AbstractCodeModel::ReturnValueConnections AbstractCodeModel::FindAssignments(ExecutionTreeConstPtr execution, const Slot& output) { ReturnValueConnections connections; - + if (auto variable = FindReferencedVariableChecked(execution, output)) { connections.m_returnValuesOrReferences.push_back(variable); } - + auto connectedNodes = execution->GetId().m_node->GetConnectedNodes(output); bool isAtLeastOneReturnValueFound = false; @@ -1477,7 +1478,7 @@ namespace ScriptCanvas return slot && candidate.second == slot; }); - return iter != scriptCanvasNodesConnectedToInput.end() ? *iter : EndpointResolved{nullptr, nullptr}; + return iter != scriptCanvasNodesConnectedToInput.end() ? *iter : EndpointResolved{ nullptr, nullptr }; }; for (size_t childIndex = 0; childIndex < outputSource->GetChildrenCount(); ++childIndex) @@ -1543,8 +1544,8 @@ namespace ScriptCanvas for (const auto& otherConnections : scriptCanvasNodesConnectedToInput) { if (otherConnections.first == outputSCNode - && otherConnections.second != outputSlot - && InSimultaneousDataPath(*outputSCNode, *otherConnections.second, *outputSlot)) + && otherConnections.second != outputSlot + && InSimultaneousDataPath(*outputSCNode, *otherConnections.second, *outputSlot)) { AddError(executionWithInput->GetId().m_node->GetEntityId(), executionWithInput, ParseErrors::MultipleSimulaneousInputValues); } @@ -1570,7 +1571,7 @@ namespace ScriptCanvas VariableConstPtr AbstractCodeModel::FindVariable(const AZ::EntityId& sourceNodeId) const { auto resultIter = AZStd::find_if - ( m_variables.begin() + (m_variables.begin() , m_variables.end() , [&sourceNodeId](const VariableConstPtr& candidate) { return candidate->m_nodeableNodeId == sourceNodeId; }); @@ -1580,7 +1581,7 @@ namespace ScriptCanvas VariableConstPtr AbstractCodeModel::FindVariable(const VariableId& sourceVariableId) const { auto resultIter = AZStd::find_if - ( m_variables.begin() + (m_variables.begin() , m_variables.end() , [&sourceVariableId](const VariableConstPtr& candidate) { return candidate->m_sourceVariableId == sourceVariableId; }); @@ -1591,7 +1592,7 @@ namespace ScriptCanvas { if (IsUserNodeable(variable)) { - auto iter = AZStd::find_if(m_nodeablesByNode.begin(), m_nodeablesByNode.end(), [&variable](auto& candidate){ return candidate.second->m_nodeable == variable; }); + auto iter = AZStd::find_if(m_nodeablesByNode.begin(), m_nodeablesByNode.end(), [&variable](auto& candidate) { return candidate.second->m_nodeable == variable; }); if (iter != m_nodeablesByNode.end()) { return iter->second->m_simpleName; @@ -1604,7 +1605,7 @@ namespace ScriptCanvas const AZStd::pair* AbstractCodeModel::FindStaticVariable(VariableConstPtr variable) const { auto iter = AZStd::find_if - ( m_staticVariableNames.begin() + (m_staticVariableNames.begin() , m_staticVariableNames.end() , [&](const auto& candidate) { return candidate.first == variable; }); @@ -1622,7 +1623,7 @@ namespace ScriptCanvas else { const_cast(this)->AddError(execution, aznew ParseError(slot.GetNodeId(), AZStd::string::format - ( "Failed to find member variable for Variable Reference in slot: %s Id: %s" + ("Failed to find member variable for Variable Reference in slot: %s Id: %s" , slot.GetName().data() , slot.GetVariableReference().ToString().data()))); } @@ -1965,7 +1966,7 @@ namespace ScriptCanvas return {}; } - + AZStd::sys_time_t AbstractCodeModel::GetParseDuration() const { return m_parseDuration; @@ -2091,7 +2092,7 @@ namespace ScriptCanvas { const AZStd::vector& slots = outcome.GetValue(); if (AZStd::find(slots.begin(), slots.end(), &reference) != slots.end() - && AZStd::find(slots.begin(), slots.end(), &candidate) != slots.end()) + && AZStd::find(slots.begin(), slots.end(), &candidate) != slots.end()) { return true; } @@ -2165,7 +2166,7 @@ namespace ScriptCanvas if (m_start) { - roots.push_back(m_start); + roots.push_back(m_start); } for (auto& nodeableParse : m_nodeablesByNode) @@ -2237,7 +2238,7 @@ namespace ScriptCanvas { ExecutionTreePtr child = CreateChild(parent, node, outSlot); child->SetScope(AZStd::make_shared()); - child->ModScope()->m_parent = parent ? parent->ModScope(): m_graphScope; + child->ModScope()->m_parent = parent ? parent->ModScope() : m_graphScope; return child; } @@ -2258,12 +2259,16 @@ namespace ScriptCanvas m_variableScopeMeaning = VariableScopeMeaning_LegacyFunctions::ValueInitialization; } #endif + // The Order Matters: begin + + // add all data to the ACM for easy look up in input/output processing for ACM nodes AddAllVariablesPreParse(); if (!IsErrorFree()) { return; } + // parse basic editor nodes as they may add implicit variables for (auto& nodeEntity : m_source.m_graphData->m_nodes) { if (nodeEntity) @@ -2296,18 +2301,27 @@ namespace ScriptCanvas return; } + // parse the implicit variables added by ebus handling syntax sugar ParseAutoConnectedEBusHandlerVariables(); + // all possible data is available, now parse execution, starting with "main", currently keyed to RuntimeComponent::Activate Parse(m_startNodes); - + // parse any function introduced by nodes other than On Graph Start/"main" for (auto node : m_possibleExecutionRoots) { ParseExecutionTreeRoots(*node); } - + // parse functions introduced by variable change events ParseVariableHandling(); + // parse all user function and function object signatures ParseUserFunctionTopology(); - ParseConstructionInputVariables(); + // culls unused variables, and determine whether the the graph defines an object or static functionality ParseExecutionCharacteristics(); + // now that variables have been culled, determined what data needs to be initialized by an external source + ParseConstructionInputVariables(); + // now that externally initialized data has been identified, associate local, static initializers with individual functions + ParseFunctionLocalStaticUseage(); + + // The Order Matters: end // from here on, nothing more needs to happen during simple parsing // for example, in the editor, to get validation on syntax based effects for the view @@ -2315,7 +2329,10 @@ namespace ScriptCanvas if (IsErrorFree()) { + // the graph could have used several user graphs which required construction, and maybe multiple instances of the same user asset + // this will create indices for those nodes to be able to pass in the proper entry in the construction argument tree at translation and runtime ParseDependenciesAssetIndicies(); + // protect all names against keyword collision and language naming violations ConvertNamesToIdentifiers(); if (m_source.m_addDebugInfo) @@ -2334,7 +2351,7 @@ namespace ScriptCanvas AddError(nullptr, ValidationConstPtr(aznew InactiveGraph())); } } - else + else { MarkParseStop(); @@ -2629,9 +2646,9 @@ namespace ScriptCanvas // create a variable declaration ExecutionTreePtr variableConstruction = CreateChild(inPreviouslyExecutedScopeResult.m_mostParent->ModParent(), nullptr, nullptr); - variableConstruction->AddInput({ nullptr , newInputResultOfAssignment, DebugDataSource::FromInternal()}); + variableConstruction->AddInput({ nullptr , newInputResultOfAssignment, DebugDataSource::FromInternal() }); variableConstruction->SetSymbol(Symbol::VariableDeclaration); - + // splice the variable declaration right before the most parent for loop is executed auto positionOutcome = mostForLoopParent->RemoveChild(inPreviouslyExecutedScopeResult.m_mostParent); if (!positionOutcome.IsSuccess()) @@ -2701,7 +2718,7 @@ namespace ScriptCanvas case VariableConstructionRequirement::InputVariable: { - auto variableID = variable->m_sourceVariableId.IsValid() ? variable->m_sourceVariableId : VariableId::MakeVariableId(); + auto variableID = variable->m_sourceVariableId.IsValid() ? variable->m_sourceVariableId : MakeParserGeneratedId(m_generatedIdCount++); inputVariableIds.push_back(variableID); inputVariablesById.insert({ variableID, variable }); // sort revealed a datum copy issue: type is not preserved, workaround below @@ -2755,7 +2772,7 @@ namespace ScriptCanvas { auto& localStatics = ModStaticVariablesNames(staticVariable->m_source); auto iter = AZStd::find_if - ( localStatics.begin() + (localStatics.begin() , localStatics.end() , [&](const auto& candidate) { return candidate.first == staticVariable; }); @@ -2834,16 +2851,16 @@ namespace ScriptCanvas { switch (execution->GetSymbol()) { - // nothing required + // nothing required case Symbol::PlaceHolderDuringParsing: break; - // out and return value information + // out and return value information case Symbol::FunctionDefinition: AddDebugInformationFunctionDefinition(execution); break; - // add in out everything + // add in out everything case Symbol::ForEach: case Symbol::FunctionCall: case Symbol::OperatorAddition: @@ -2857,7 +2874,7 @@ namespace ScriptCanvas AddDebugInformationOut(execution); break; - // add in but not out + // add in but not out case Symbol::Break: case Symbol::LogicalAND: case Symbol::LogicalNOT: @@ -2871,8 +2888,8 @@ namespace ScriptCanvas AddDebugInformationIn(execution); break; - // add in-debug-info if the if condition is NOT prefixed with logic or comparison expression (which will have the in-debug-info) - // add out-debug-info in all cases including including empty cases + // add in-debug-info if the if condition is NOT prefixed with logic or comparison expression (which will have the in-debug-info) + // add out-debug-info in all cases including including empty cases case Symbol::IfCondition: if (!(execution->GetId().m_node->IsIfBranchPrefacedWithBooleanExpression())) { @@ -2900,7 +2917,7 @@ namespace ScriptCanvas if (dependencies.userSubgraphs.find(m_source.m_namespacePath) != dependencies.userSubgraphs.end()) { AZStd::string circularDependency = AZStd::string::format - ( ParseErrors::CircularDependencyFormat + (ParseErrors::CircularDependencyFormat , m_source.m_name.data() , node.GetDebugName().data() , m_source.m_name.data()); @@ -2908,6 +2925,7 @@ namespace ScriptCanvas AddError(nullptr, aznew Internal::ParseError(node.GetEntityId(), circularDependency)); } + // #functions2 make this use an identifier for the node, for property window display and easier find/replace updates // this part must NOT recurse, the dependency tree should remain a tree and not be flattened m_orderedDependencies.source.MergeWith(dependencies); } @@ -2950,11 +2968,32 @@ namespace ScriptCanvas { if (!input->m_sourceVariableId.IsValid() && IsEntityIdThatRequiresRuntimeRemap(input)) { - input->m_sourceVariableId = VariableId::MakeVariableId(); + input->m_sourceVariableId = MakeParserGeneratedId(m_generatedIdCount++); input->m_source = nullptr; // promote to member variable for at this stage, optimizations on data flow will occur later input->m_isMember = true; - input->m_name = m_graphScope->AddVariableName(input->m_name); + + AZStd::string entityVariableName; + + if (slotAndVariable.m_slot) + { + if (execution->GetId().m_node) + { + entityVariableName.append(execution->GetId().m_node->GetNodeName()); + entityVariableName.append("."); + entityVariableName.append(slotAndVariable.m_slot->GetName()); + } + else + { + entityVariableName.append(slotAndVariable.m_slot->GetName()); + } + } + else + { + entityVariableName = input->m_name; + } + + input->m_name = m_graphScope->AddVariableName(entityVariableName); AddVariable(input); } } @@ -3020,11 +3059,11 @@ namespace ScriptCanvas CullUnusedVariables(); if (allRootsArePure - && m_ebusHandlingByNode.empty() - && m_eventHandlingByNode.empty() - && m_nodeablesByNode.empty() - && m_variableWriteHandlingByVariable.empty() - && m_subgraphInterface.IsParsedPure()) + && m_ebusHandlingByNode.empty() + && m_eventHandlingByNode.empty() + && m_nodeablesByNode.empty() + && m_variableWriteHandlingByVariable.empty() + && m_subgraphInterface.IsParsedPure()) { if (m_start) { @@ -3077,7 +3116,7 @@ namespace ScriptCanvas void AbstractCodeModel::ParseExecutionLoop(ExecutionTreePtr executionLoop) { AddDebugInfiniteLoopDetectionInLoop(executionLoop); - + auto loopSlot = executionLoop->GetId().m_node->GetSlot(executionLoop->GetId().m_node->GetLoopSlotId()); AZ_Assert(loopSlot, "Node did not return a valid loop slot"); ExecutionTreePtr executionLoopBody = OpenScope(executionLoop, executionLoop->GetId().m_node, loopSlot); @@ -3255,7 +3294,7 @@ namespace ScriptCanvas } else if (numConnections == 1) { - ParseExecutionFunctionRecurse(execution, execution->ModChild(0), outSlot, executionOutNodes[0]); + ParseExecutionFunctionRecurse(execution, execution->ModChild(0), outSlot, executionOutNodes[0]); } else { @@ -3762,7 +3801,7 @@ namespace ScriptCanvas trueValue->m_source = once; trueValue->m_datum = Datum(Data::BooleanType(true)); once->AddInput({ nullptr, trueValue, DebugDataSource::FromInternal() }); - + ExecutionTreePtr onReset = CreateChild(once, once->GetId().m_node, onceResetSlot); onReset->SetSymbol(Symbol::PlaceHolderDuringParsing); onReset->MarkInputOutputPreprocessed(); @@ -3849,7 +3888,7 @@ namespace ScriptCanvas executionSwitch->SetSymbol(Symbol::Switch); ParseExecutionSequentialChildren(executionSwitch); } - + // the execution will already have its function definition defined, this will create the body of that function void AbstractCodeModel::ParseExecutionTreeBody(ExecutionTreePtr execution, const Slot& outSlot) { @@ -4112,7 +4151,7 @@ namespace ScriptCanvas { auto& userFunctionNode = *userFunctionIter->first; auto outSlots = userFunctionNode.GetSlotsByType(CombinedSlotType::ExecutionOut); - + if (outSlots.empty() || !outSlots.front()) { AddError(userFunctionNode.GetEntityId(), nullptr, ScriptCanvas::ParseErrors::NoOutSlotInFunctionDefinitionStart); @@ -4167,6 +4206,32 @@ namespace ScriptCanvas ParseExecutionLoop(execution); } + void AbstractCodeModel::ParseFunctionLocalStaticUseage() + { + for (auto execution : ModAllExecutionRoots()) + { + if (auto localVariables = GetLocalVariables(execution)) + { + for (auto variable : *localVariables) + { + if (const AZStd::pair* pair = FindStaticVariable(variable)) + { + auto& localStatics = ModStaticVariablesNames(execution); + auto iter = AZStd::find_if + ( localStatics.begin() + , localStatics.end() + , [&](const auto& candidate) { return candidate.first == variable; }); + + if (iter == localStatics.end()) + { + localStatics.push_back(*pair); + } + } + } + } + } + } + void AbstractCodeModel::ParseImplicitVariables(const Node& node) { if (IsCycle(node)) @@ -4179,7 +4244,7 @@ namespace ScriptCanvas auto onceControl = AddMemberVariable(Datum(Data::BooleanType(true)), "onceControl"); m_controlVariablesBySourceNode.insert({ &node, onceControl }); } - else + else { const auto nodelingType = CheckNodelingType(node); if (nodelingType != NodelingType::None) @@ -4208,7 +4273,7 @@ namespace ScriptCanvas { const VariableId assignedFromId = execution->GetId().m_node->GetVariableIdRead(execution->GetId().m_slot); auto variableRead = assignedFromId.IsValid() ? FindVariable(assignedFromId) : nullptr; - + if (variableRead) { // nullptr is acceptable here @@ -4314,7 +4379,7 @@ namespace ScriptCanvas for (auto sourceNodeAndSlot : nodes) { AddError(nullptr, aznew ScopedDataConnectionEvent - ( execution->GetNodeId() + (execution->GetNodeId() , targetNode , targetSlot , *sourceNodeAndSlot.first @@ -4324,7 +4389,7 @@ namespace ScriptCanvas } } } - + bool AbstractCodeModel::ParseInputThisPointer(ExecutionTreePtr execution) { auto node = execution->GetId().m_node; @@ -4364,7 +4429,7 @@ namespace ScriptCanvas { auto node2 = execution->GetId().m_node; AddError(execution, aznew ParseError(node2->GetEntityId(), AZStd::string::format - ( "Failed to find member variable for Node: %s Id: %s" + ("Failed to find member variable for Node: %s Id: %s" , node2->GetNodeName().data() , node2->GetEntityId().ToString().data()).data())); } @@ -4394,7 +4459,7 @@ namespace ScriptCanvas { auto node2 = execution->GetId().m_node; AddError(execution, aznew ParseError(node2->GetEntityId(), AZStd::string::format - ( "Failed to find member variable for Node: %s Id: %s" + ("Failed to find member variable for Node: %s Id: %s" , node2->GetNodeName().data() , node2->GetEntityId().ToString().data()).data())); } @@ -4451,10 +4516,10 @@ namespace ScriptCanvas } ExecutionChild* executionChildInParent = &parent->ModChild(indexInParentCall); - + const size_t executionInputCount = execution->GetInputCount(); const size_t thisInputOffset = execution->InputHasThisPointer() ? 1 : 0; - + // the original index has ALL the input from the slots on the node // create multiple calls with separate function call nodes, but ONLY take the inputs required // as indicated by the function call info @@ -4811,7 +4876,7 @@ namespace ScriptCanvas } } } - + void AbstractCodeModel::ParseReturnValue(ExecutionTreePtr execution, const Slot& returnValueSlot) { if (auto variable = FindReferencedVariableChecked(execution, returnValueSlot)) @@ -4862,9 +4927,9 @@ namespace ScriptCanvas { ParseUserIn(iter.second, iter.first); } - + m_userInsThatRequireTopology.clear(); - + ParseUserOuts(); auto parseOutcome = m_subgraphInterface.Parse(); @@ -4920,7 +4985,7 @@ namespace ScriptCanvas AddError(root, aznew Internal::ParseError(AZ::EntityId(), "In Nodeling didn't parse properly, there were still leaves without nodelings in the execution tree.")); return; } - } + } auto& outCallsChecked = listenerCheck.GetOutCalls(); if (!result.addSingleOutToMap && outCallsChecked.empty()) @@ -4968,8 +5033,8 @@ namespace ScriptCanvas } if ((!root->HasExplicitUserOutCalls()) - && root->GetReturnValueCount() > 0 - && branches > 1) + && root->GetReturnValueCount() > 0 + && branches > 1) { AddError(root->GetNodeId(), root, ScriptCanvas::ParseErrors::TooManyBranchesForReturn); return; @@ -5005,7 +5070,7 @@ namespace ScriptCanvas AZStd::pair returnValue = execution->GetReturnValue(execution->GetReturnValueCount() - 1); AZStd::const_pointer_cast(returnValue.second)->m_isNewValue = true; } - } + } } } @@ -5029,7 +5094,7 @@ namespace ScriptCanvas result.addExplicitOutCalls = nodelingsOutCount > 1; result.isSimpleFunction = !result.addExplicitOutCalls; } - else + else { // user explicitly defined at least 1 Out and there are execution leaves without Outs, so we provide an Out to any missing ones result.addSingleOutToMap = true; @@ -5037,7 +5102,7 @@ namespace ScriptCanvas result.addExplicitOutCalls = true; result.isSimpleFunction = false; } - + return result; } @@ -5058,41 +5123,41 @@ namespace ScriptCanvas void AbstractCodeModel::ParseUserLatentData(ExecutionTreePtr execution) { - if (execution->IsOnLatentPath()) - { - if (execution->GetChildrenCount() == 0) - { - execution->AddChild({ nullptr, {}, nullptr }); - } - - auto& executionChild = execution->ModChild(0); - - // inputs are return values expected from the latent out call - for (auto& returnValue : FindUserLatentReturnValues(execution)) - { - // if there are return values, we can continue execution after - // the nodeling out that is in the path (disable the contract) - // and we must make sure there's ONLY ONE - // and no immediate ins - auto outputAssignment = CreateOutputAssignment(returnValue); - executionChild.m_output.push_back({ nullptr, outputAssignment }); - } - - auto methodRoot = execution->ModRoot(); - - // outputs are inputs to the latent out call - for (auto& inputValue : FindUserLatentOutput(execution)) - { - inputValue->m_source = methodRoot; - execution->AddInput({ nullptr, inputValue, DebugDataSource::FromVariable(SlotId{}, inputValue->m_datum.GetType(), inputValue->m_sourceVariableId) }); - } - - methodRoot->CopyInput(execution, ExecutionTree::RemapVariableSource::No); - } - else - { - AddError(execution, aznew Internal::ParseError(execution->GetNodeId(), "immediate execution parsed data in latent thread")); - } + if (execution->IsOnLatentPath()) + { + if (execution->GetChildrenCount() == 0) + { + execution->AddChild({ nullptr, {}, nullptr }); + } + + auto& executionChild = execution->ModChild(0); + + // inputs are return values expected from the latent out call + for (auto& returnValue : FindUserLatentReturnValues(execution)) + { + // if there are return values, we can continue execution after + // the nodeling out that is in the path (disable the contract) + // and we must make sure there's ONLY ONE + // and no immediate ins + auto outputAssignment = CreateOutputAssignment(returnValue); + executionChild.m_output.push_back({ nullptr, outputAssignment }); + } + + auto methodRoot = execution->ModRoot(); + + // outputs are inputs to the latent out call + for (auto& inputValue : FindUserLatentOutput(execution)) + { + inputValue->m_source = methodRoot; + execution->AddInput({ nullptr, inputValue, DebugDataSource::FromVariable(SlotId{}, inputValue->m_datum.GetType(), inputValue->m_sourceVariableId) }); + } + + methodRoot->CopyInput(execution, ExecutionTree::RemapVariableSource::No); + } + else + { + AddError(execution, aznew Internal::ParseError(execution->GetNodeId(), "immediate execution parsed data in latent thread")); + } } void AbstractCodeModel::ParseUserOutCall(ExecutionTreePtr execution) @@ -5164,7 +5229,7 @@ namespace ScriptCanvas if (!IsConnectedToUserIn(nodeling)) { const auto report = AZStd::string::format - ( "Nodeling Out (%s) not connected to Nodeling In, functionality cannot be executed", nodeling->GetDisplayName().data()); + ("Nodeling Out (%s) not connected to Nodeling In, functionality cannot be executed", nodeling->GetDisplayName().data()); AddError(nullptr, aznew Internal::ParseError(nodeling->GetEntityId(), report)); } @@ -5172,7 +5237,7 @@ namespace ScriptCanvas else { const auto report = AZStd::string::format - ("null nodeling in immediate out list"); + ("null nodeling in immediate out list"); AddError(nullptr, aznew Internal::ParseError(nodeling->GetEntityId(), report)); } @@ -5210,27 +5275,8 @@ namespace ScriptCanvas TraverseTree(execution, listener); const auto& usage = listener.GetUsedVariables(); const bool usesOnlyLocalVariables = usage.memberVariables.empty() && usage.implicitMemberVariables.empty(); - m_variableUse.localVariables.insert(usage.localVariables.begin(), usage.localVariables.end()); m_variableUse.memberVariables.insert(usage.memberVariables.begin(), usage.memberVariables.end()); - - for (auto variable : m_variableUse.localVariables) - { - if (const AZStd::pair* pair = FindStaticVariable(variable)) - { - auto& localStatics = ModStaticVariablesNames(execution); - auto iter = AZStd::find_if - (localStatics.begin() - , localStatics.end() - , [&](const auto& candidate) { return candidate.first == variable; }); - - if (iter == localStatics.end()) - { - localStatics.push_back(*pair); - } - } - } - m_variableUseByExecution.emplace(execution, listener.MoveUsedVariables()); return (!usage.usesExternallyInitializedVariables) && usesOnlyLocalVariables && listener.IsPure(); } @@ -5285,7 +5331,7 @@ namespace ScriptCanvas RemoveFromTree(noOpChild); } } - + void AbstractCodeModel::RemoveFromTree(ExecutionTreePtr execution) { if (!execution->GetParent()) @@ -5304,7 +5350,7 @@ namespace ScriptCanvas { AddError(execution->GetNodeId(), execution, ScriptCanvas::ParseErrors::RequiredOutputRemoved); } - + if (childCount != 0) { if (childCount > 1) @@ -5332,7 +5378,7 @@ namespace ScriptCanvas execution->Clear(); } - + AZ::Outcome> AbstractCodeModel::RemoveChild(const ExecutionTreePtr& execution, const ExecutionTreeConstPtr& child) { return execution->RemoveChild(child); @@ -5342,7 +5388,5 @@ namespace ScriptCanvas { return type == Data::eType::BehaviorContextObject; } - } - } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.h index a3ddec73bf..92de21ff97 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.h @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -71,7 +71,7 @@ namespace ScriptCanvas AZStd::optional> CheckUserNodeableDependencyConstructionIndex(VariableConstPtr nodeable) const; AZStd::vector CombineVariableLists - ( const AZStd::vector& constructionNodeables + (const AZStd::vector& constructionNodeables , const AZStd::vector>& constructionInputVariableIds , const AZStd::vector>& entityIds) const; @@ -120,7 +120,7 @@ namespace ScriptCanvas const ParsedRuntimeInputs& GetRuntimeInputs() const; const Source& GetSource() const; - + const AZStd::string& GetSourceString() const; ExecutionTreeConstPtr GetStart() const; @@ -150,21 +150,19 @@ namespace ScriptCanvas bool IsUserNodeable(VariableConstPtr variable) const; - bool HasUserNodeableDependenciesInVariables() const; - template AZStd::vector ToVariableList(const AZStd::vector>& source) const; private: - ////////////////////////////////////////////////////////////////////////// - // Internal parsing - ////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////// + // Internal parsing + ////////////////////////////////////////////////////////////////////////// struct ReturnValueConnections { bool m_hasOtherConnections = false; AZStd::vector m_returnValuesOrReferences; }; - + void AddAllVariablesPreParse(); void AddAllVariablesPreParse_LegacyFunctions(); @@ -210,7 +208,7 @@ namespace ScriptCanvas bool CheckCreateRoot(const Node& node); AZStd::string CheckUniqueInterfaceNames - ( AZStd::string_view candidate + (AZStd::string_view candidate , AZStd::string_view defaultName , AZStd::unordered_set& uniqueNames , const AZStd::unordered_set& nodelingsOut); @@ -340,7 +338,7 @@ namespace ScriptCanvas void ParseExecutionLogicalExpression(ExecutionTreePtr execution, Symbol symbol); void ParseExecutionLoop(ExecutionTreePtr execution); - + void ParseExecutionMultipleOutSyntaxSugar(ExecutionTreePtr execution, const EndpointsResolved& executionOutNodes, const AZStd::vector& outSlots); void ParseExecutionMultipleOutSyntaxSugarOfSequencNode(ExecutionTreePtr sequence); @@ -368,6 +366,8 @@ namespace ScriptCanvas void ParseExecutionWhileLoop(ExecutionTreePtr execution); + void ParseFunctionLocalStaticUseage(); + void ParseImplicitVariables(const Node& node); void ParseInputData(ExecutionTreePtr execution); @@ -428,7 +428,7 @@ namespace ScriptCanvas void PruneNoOpChildren(const ExecutionTreePtr& execution); AZ::Outcome> RemoveChild(const ExecutionTreePtr& execution, const ExecutionTreeConstPtr& child); - + void RemoveFromTree(ExecutionTreePtr execution); struct ConnectionInPreviouslyExecutedScope @@ -473,7 +473,7 @@ namespace ScriptCanvas } void AddExecutionMapIn - ( UserInParseTopologyResult result + (UserInParseTopologyResult result , ExecutionTreeConstPtr root , const AZStd::vector& outCalls , AZStd::string_view defaultOutName @@ -505,6 +505,7 @@ namespace ScriptCanvas static UserInParseTopologyResult ParseUserInTolopology(size_t nodelingsOutCount, size_t leavesWithoutNodelingsCount); size_t m_outIndexCount = 0; + size_t m_generatedIdCount = 0; ExecutionTreePtr m_start; AZStd::vector m_startNodes; ScopePtr m_graphScope; @@ -513,7 +514,7 @@ namespace ScriptCanvas AZStd::unordered_set m_userNodeables; AZStd::unordered_map m_dependencyByVariable; - + AZStd::vector m_variables; AZStd::vector m_possibleExecutionRoots; @@ -621,7 +622,7 @@ namespace ScriptCanvas for (const auto& variable : source) { auto iter = AZStd::find_if - ( m_variables.begin() + (m_variables.begin() , m_variables.end() , [&](const auto& candidate) { return candidate->m_sourceVariableId == variable.first; }); @@ -633,7 +634,5 @@ namespace ScriptCanvas return variables; } - - } - -} + } +} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/ParsingUtilities.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/ParsingUtilities.cpp index 9f7473551c..cd2a1b184d 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/ParsingUtilities.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/ParsingUtilities.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -47,6 +47,10 @@ namespace ParsingUtilitiesCpp using namespace ScriptCanvas; using namespace ScriptCanvas::Grammar; + const AZ::u64 k_parserGeneratedMask = 0x7FC0616C94E7465F; + const size_t k_maskIndex = 0; + const size_t k_countIndex = 1; + class PrettyPrinter : public ExecutionTreeTraversalListener { @@ -85,7 +89,7 @@ namespace ParsingUtilitiesCpp { m_result += AZStd::string::format(" # children: %zu", childCount); } - + if (m_marker == execution) { m_result += " <<<< MARKER <<<< "; @@ -97,7 +101,7 @@ namespace ParsingUtilitiesCpp m_result += "\n"; } - void EvaluateRoot(ExecutionTreeConstPtr node, const Slot* ) + void EvaluateRoot(ExecutionTreeConstPtr node, const Slot*) { m_result += "\nRoot:\n"; } @@ -356,7 +360,7 @@ namespace ScriptCanvas else if (nodeling->IsExecutionExit()) { return NodelingType::Out; - } + } } return NodelingType::None; @@ -785,7 +789,7 @@ namespace ScriptCanvas { return execution->GetInputCount() > index && ((execution->GetInput(index).m_value->m_datum.GetAs() && *execution->GetInput(index).m_value->m_datum.GetAs() == GraphOwnerId && !execution->GetInput(index).m_value->m_isExposedToConstruction) - || (execution->GetInput(index).m_value->m_datum.GetAs() && *execution->GetInput(index).m_value->m_datum.GetAs() == GraphOwnerId && !execution->GetInput(index).m_value->m_isExposedToConstruction)); + || (execution->GetInput(index).m_value->m_datum.GetAs() && *execution->GetInput(index).m_value->m_datum.GetAs() == GraphOwnerId && !execution->GetInput(index).m_value->m_isExposedToConstruction)); } bool IsIsNull(const ExecutionTreeConstPtr& execution) @@ -855,7 +859,7 @@ namespace ScriptCanvas return true; } } - + return IsMidSequence(parent); } @@ -1001,10 +1005,16 @@ namespace ScriptCanvas return true; } + bool IsParserGeneratedId(const ScriptCanvas::VariableId& id) + { + using namespace ParsingUtilitiesCpp; + return reinterpret_cast(id.m_id.data)[k_maskIndex] == k_parserGeneratedMask; + } + bool IsPropertyExtractionSlot(const ExecutionTreeConstPtr& execution, const Slot* outputSlot) { auto iter = AZStd::find_if - ( execution->GetPropertyExtractionSources().begin() + (execution->GetPropertyExtractionSources().begin() , execution->GetPropertyExtractionSources().end() , [&](const auto& iter) { return iter.first == outputSlot; }); @@ -1052,9 +1062,9 @@ namespace ScriptCanvas bool IsSequenceNode(const ExecutionTreeConstPtr& execution) { return (IsSequenceNode(execution->GetId().m_node) - && execution->GetId().m_slot->GetType() == CombinedSlotType::ExecutionIn); + && execution->GetId().m_slot->GetType() == CombinedSlotType::ExecutionIn); } - + bool IsSwitchStatement(const ExecutionTreeConstPtr& execution) { return execution->GetId().m_node->IsSwitchStatement() @@ -1120,6 +1130,16 @@ namespace ScriptCanvas return AZStd::string::format("%s%s", k_memberNamePrefix, name.data()); } + VariableId MakeParserGeneratedId(size_t count) + { + using namespace ParsingUtilitiesCpp; + + AZ::Uuid parserGenerated; + reinterpret_cast(parserGenerated.data)[k_maskIndex] = k_parserGeneratedMask; + reinterpret_cast(parserGenerated.data)[k_countIndex] = count; + return ScriptCanvas::VariableId(parserGenerated); + } + VariableConstructionRequirement ParseConstructionRequirement(VariableConstPtr variable) { if (IsEntityIdThatRequiresRuntimeRemap(variable)) @@ -1216,7 +1236,7 @@ namespace ScriptCanvas result += AZStd::string::format("Variable: %s, Type: %s, Scope: %s, \n" , variable->m_name.data() , Data::GetName(variable->m_datum.GetType()).data() - , variable->m_isMember ? "Member" : "Local" ); + , variable->m_isMember ? "Member" : "Local"); } auto roots = model.GetAllExecutionRoots(); @@ -1261,11 +1281,11 @@ namespace ScriptCanvas bool RequiresRuntimeRemap(const AZ::EntityId& entityId) { - return entityId.IsValid() + return entityId.IsValid() && entityId != UniqueId && entityId != GraphOwnerId; } - + AZStd::string SlotNameToIndexString(const Slot& slot) { auto indexString = slot.GetName(); @@ -1445,5 +1465,5 @@ namespace ScriptCanvas } } } - } -} + } +} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/ParsingUtilities.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/ParsingUtilities.h index b443bc7be2..e7804e355c 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/ParsingUtilities.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/ParsingUtilities.h @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -113,7 +113,7 @@ namespace ScriptCanvas bool IsInfiniteSelfEntityActivationLoop(const AbstractCodeModel& model, ExecutionTreeConstPtr execution); bool IsInfiniteSelfEntityActivationLoopRecurse(const AbstractCodeModel& model, ExecutionTreeConstPtr execution); - + bool IsInfiniteVariableWriteHandlingLoop(const AbstractCodeModel& model, VariableWriteHandlingPtr variableHandling, ExecutionTreeConstPtr execution, bool isConnected); bool IsInLoop(const ExecutionTreeConstPtr& execution); @@ -144,6 +144,8 @@ namespace ScriptCanvas bool IsOnSelfEntityActivated(const AbstractCodeModel& model, ExecutionTreeConstPtr execution); + bool IsParserGeneratedId(const VariableId& id); + bool IsPropertyExtractionSlot(const ExecutionTreeConstPtr& execution, const Slot* outputSlot); bool IsPropertyExtractionNode(const ExecutionTreeConstPtr& execution); @@ -178,6 +180,8 @@ namespace ScriptCanvas bool IsWrittenMathExpression(const ExecutionTreeConstPtr& execution); + VariableId MakeParserGeneratedId(size_t count); + AZStd::string MakeMemberVariableName(AZStd::string_view name); VariableConstructionRequirement ParseConstructionRequirement(Grammar::VariableConstPtr value); @@ -203,6 +207,5 @@ namespace ScriptCanvas void TraverseTree(const AbstractCodeModel& execution, ExecutionTreeTraversalListener& listener); void TraverseTree(const ExecutionTreeConstPtr& execution, ExecutionTreeTraversalListener& listener); - } - -} + } +} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/Primitives.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/Primitives.cpp index c32595a900..aa11d01fdf 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/Primitives.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/Primitives.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -99,9 +99,9 @@ namespace ScriptCanvas m_inputs.clear(); m_outputs.clear(); } - + bool FunctionPrototype::IsVoid() const - { + { return m_outputs.empty(); } @@ -200,24 +200,23 @@ namespace ScriptCanvas baseName.append(suffix); return AddVariableName(baseName); } - + AZ::s32 Scope::AddNameCount(AZStd::string_view name) { AZ::s32 count = -1; ScopePtr ns = shared_from_this(); - + do { auto iter = ns->m_baseNameToCount.find(name); - + if (iter != ns->m_baseNameToCount.end()) { // a basename has been found in current or parent scope, get the latest count count = iter->second; break; } - } - while ((ns = AZStd::const_pointer_cast(ns->m_parent))); + } while ((ns = AZStd::const_pointer_cast(ns->m_parent))); auto iter = m_baseNameToCount.find(name); if (iter == m_baseNameToCount.end()) @@ -235,7 +234,7 @@ namespace ScriptCanvas const VariableData Source::k_emptyVardata{}; Source::Source - ( const Graph& graph + (const Graph& graph , const AZ::Data::AssetId& id , const GraphData& graphData , const VariableData& variableData @@ -277,8 +276,8 @@ namespace ScriptCanvas AzFramework::StringFunc::Path::StripExtension(namespacePath); return AZ::Success(Source - ( *request.graph - , request.assetId + (*request.graph + , request.scriptAssetId , *graphData , *sourceVariableData , name @@ -294,23 +293,23 @@ namespace ScriptCanvas } Variable::Variable(Datum&& datum) - : m_datum(datum) + : m_datum(datum) {} - + Variable::Variable(const Datum& datum, const AZStd::string& name, TraitsFlags traitsFlags) : m_datum(datum) , m_name(name) - , m_isConst(traitsFlags & TraitsFlags::Const) - , m_isMember(traitsFlags & TraitsFlags::Member) + , m_isConst(traitsFlags& TraitsFlags::Const) + , m_isMember(traitsFlags& TraitsFlags::Member) {} Variable::Variable(Datum&& datum, AZStd::string&& name, TraitsFlags&& traitsFlags) : m_datum(datum) , m_name(name) - , m_isConst(traitsFlags & TraitsFlags::Const) - , m_isMember(traitsFlags & TraitsFlags::Member) + , m_isConst(traitsFlags& TraitsFlags::Const) + , m_isMember(traitsFlags& TraitsFlags::Member) {} - + void Variable::Reflect(AZ::ReflectContext* reflectContext) { if (auto serializeContext = azrtti_cast(reflectContext)) @@ -339,5 +338,5 @@ namespace ScriptCanvas m_variable = nullptr; m_connectionVariable = nullptr; } - } -} + } +} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/PrimitivesDeclarations.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/PrimitivesDeclarations.cpp index 85bb4a0025..4d4b3824d2 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/PrimitivesDeclarations.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/PrimitivesDeclarations.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -12,7 +12,9 @@ namespace ScriptCanvas namespace Grammar { AZ_CVAR(bool, g_disableParseOnGraphValidation, false, {}, AZ::ConsoleFunctorFlags::Null, "In case parsing the graph is interfering with opening a graph, disable parsing on validation"); - AZ_CVAR(bool, g_printAbstractCodeModel, false, {}, AZ::ConsoleFunctorFlags::Null, "Print out the Abstract Code Model at the end of parsing for debug purposes."); - AZ_CVAR(bool, g_saveRawTranslationOuputToFile, false, {}, AZ::ConsoleFunctorFlags::Null, "Save out the raw result of translation for debug purposes."); + AZ_CVAR(bool, g_printAbstractCodeModel, true, {}, AZ::ConsoleFunctorFlags::Null, "Print out the Abstract Code Model at the end of parsing for debug purposes."); + AZ_CVAR(bool, g_printAbstractCodeModelAtPrefabTime, false, {}, AZ::ConsoleFunctorFlags::Null, "Print out the Abstract Code Model at the end of parsing (at prefab time) for debug purposes."); + AZ_CVAR(bool, g_saveRawTranslationOuputToFile, true, {}, AZ::ConsoleFunctorFlags::Null, "Save out the raw result of translation for debug purposes."); + AZ_CVAR(bool, g_saveRawTranslationOuputToFileAtPrefabTime, false, {}, AZ::ConsoleFunctorFlags::Null, "Save out the raw result of translation (at prefab time) for debug purposes."); } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/PrimitivesDeclarations.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/PrimitivesDeclarations.h index a9d838a4fe..6ff1010509 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/PrimitivesDeclarations.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/PrimitivesDeclarations.h @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -108,7 +108,7 @@ namespace ScriptCanvas constexpr const char* k_InitializeExecutionOutByRequiredCountName = "InitializeExecutionOutByRequiredCount"; constexpr const char* k_InterpretedConfigurationPerformance = "SCRIPT_CANVAS_GLOBAL_PERFORMANCE"; constexpr const char* k_InterpretedConfigurationRelease = "SCRIPT_CANVAS_GLOBAL_RELEASE"; - + constexpr const char* k_NodeableCallInterpretedOut = "ExecutionOut"; constexpr const char* k_NodeableUserBaseClassName = "Nodeable"; constexpr const char* k_NodeableSetExecutionOutName = "SetExecutionOut"; @@ -120,7 +120,7 @@ namespace ScriptCanvas constexpr const char* k_OnGraphStartFunctionName = "OnGraphStart"; constexpr const char* k_OverrideNodeableMetatableName = "OverrideNodeableMetatable"; - + constexpr const char* k_stringFormatLexicalScopeName = "string"; constexpr const char* k_stringFormatName = "format"; @@ -139,7 +139,7 @@ namespace ScriptCanvas constexpr const char* k_DependentAssetsIndexArgName = "dependentAssetsIndex"; constexpr const char* k_UnpackDependencyConstructionArgsFunctionName = "UnpackDependencyConstructionArgs"; constexpr const char* k_UnpackDependencyConstructionArgsLeafFunctionName = "UnpackDependencyConstructionArgsLeaf"; - + enum class ExecutionCharacteristics : AZ::u32 { Object, @@ -147,7 +147,7 @@ namespace ScriptCanvas }; // default to a pure, interpreted function - enum ExecutionStateSelection : AZ::u32 + enum class ExecutionStateSelection : AZ::u32 { InterpretedPure, InterpretedPureOnGraphStart, @@ -172,7 +172,7 @@ namespace ScriptCanvas Count, }; #undef REGISTER_ENUM - + // create the Symbol strings #define REGISTER_ENUM(x) #x, static const char* g_SymbolNames[] = @@ -247,7 +247,9 @@ namespace ScriptCanvas AZ_CVAR_EXTERNED(bool, g_disableParseOnGraphValidation); AZ_CVAR_EXTERNED(bool, g_printAbstractCodeModel); + AZ_CVAR_EXTERNED(bool, g_printAbstractCodeModelAtPrefabTime); AZ_CVAR_EXTERNED(bool, g_saveRawTranslationOuputToFile); + AZ_CVAR_EXTERNED(bool, g_saveRawTranslationOuputToFileAtPrefabTime); struct DependencyInfo { @@ -258,7 +260,7 @@ namespace ScriptCanvas struct Request { - AZ::Data::AssetId assetId; + AZ::Data::AssetId scriptAssetId; const Graph* graph = nullptr; AZStd::string_view name; AZStd::string_view path; @@ -291,7 +293,7 @@ namespace ScriptCanvas Source() = default; Source - ( const Graph& graph + (const Graph& graph , const AZ::Data::AssetId& id , const GraphData& graphData , const VariableData& variableData @@ -305,8 +307,8 @@ namespace ScriptCanvas AZStd::string ToTypeSafeEBusResultName(const Data::Type& type); AZStd::string ToSafeName(const AZStd::string& name); NamespacePath ToNamespacePath(AZStd::string_view path, AZStd::string_view name); - } -} + } +} namespace AZStd { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Serialization/ScriptUserDataSerializer.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Serialization/ScriptUserDataSerializer.cpp new file mode 100644 index 0000000000..158e1fb562 --- /dev/null +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Serialization/ScriptUserDataSerializer.cpp @@ -0,0 +1,101 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include +#include + +using namespace ScriptCanvas; + +namespace AZ +{ + AZ_CLASS_ALLOCATOR_IMPL(ScriptUserDataSerializer, SystemAllocator, 0); + + JsonSerializationResult::Result ScriptUserDataSerializer::Load + ( void* outputValue + , [[maybe_unused]] const Uuid& outputValueTypeId + , const rapidjson::Value& inputValue + , JsonDeserializerContext& context) + { + namespace JSR = JsonSerializationResult; + + AZ_Assert(outputValueTypeId == azrtti_typeid(), "ScriptUserDataSerializer Load against output typeID that was not RuntimeVariable"); + AZ_Assert(outputValue, "ScriptUserDataSerializer Load against null output"); + + auto outputVariable = reinterpret_cast(outputValue); + JsonSerializationResult::ResultCode result(JSR::Tasks::ReadField); + AZ::Uuid typeId = AZ::Uuid::CreateNull(); + + auto typeIdMember = inputValue.FindMember(JsonSerialization::TypeIdFieldIdentifier); + if (typeIdMember == inputValue.MemberEnd()) + { + return context.Report(JSR::Tasks::ReadField, JSR::Outcomes::Missing, AZStd::string::format("ScriptUserDataSerializer::Load failed to load the %s member", JsonSerialization::TypeIdFieldIdentifier)); + } + + result.Combine(LoadTypeId(typeId, typeIdMember->value, context)); + if (typeId.IsNull()) + { + return context.Report(JSR::Tasks::ReadField, JSR::Outcomes::Catastrophic, "ScriptUserDataSerializer::Load failed to load the AZ TypeId of the value"); + } + + outputVariable->value = context.GetSerializeContext()->CreateAny(typeId); + if (outputVariable->value.empty() || outputVariable->value.type() != typeId) + { + return context.Report(result, "ScriptUserDataSerializer::Load failed to load a value matched the reported AZ TypeId. The C++ declaration may have been deleted or changed."); + } + + result.Combine(ContinueLoadingFromJsonObjectField(AZStd::any_cast(&outputVariable->value), typeId, inputValue, "value", context)); + return context.Report(result, result.GetProcessing() != JSR::Processing::Halted + ? "ScriptUserDataSerializer Load finished loading RuntimeVariable" + : "ScriptUserDataSerializer Load failed to load RuntimeVariable"); + } + + JsonSerializationResult::Result ScriptUserDataSerializer::Store + ( rapidjson::Value& outputValue + , const void* inputValue + , const void* defaultValue + , [[maybe_unused]] const Uuid& valueTypeId + , JsonSerializerContext& context) + { + namespace JSR = JsonSerializationResult; + + AZ_Assert(valueTypeId == azrtti_typeid(), "RuntimeVariable Store against value typeID that was not RuntimeVariable"); + AZ_Assert(inputValue, "RuntimeVariable Store against null inputValue pointer "); + + auto inputScriptDataPtr = reinterpret_cast(inputValue); + auto defaultScriptDataPtr = reinterpret_cast(defaultValue); + auto inputAnyPtr = &inputScriptDataPtr->value; + auto defaultAnyPtr = defaultScriptDataPtr ? &defaultScriptDataPtr->value : nullptr; + + if (defaultAnyPtr) + { + ScriptCanvas::Datum inputDatum(ScriptCanvas::Data::FromAZType(inputAnyPtr->type()), ScriptCanvas::Datum::eOriginality::Copy, AZStd::any_cast(inputAnyPtr), inputAnyPtr->type()); + ScriptCanvas::Datum defaultDatum(ScriptCanvas::Data::FromAZType(defaultAnyPtr->type()), ScriptCanvas::Datum::eOriginality::Copy, AZStd::any_cast(defaultAnyPtr), defaultAnyPtr->type()); + + if (inputDatum == defaultDatum) + { + return context.Report(JSR::Tasks::WriteValue, JSR::Outcomes::DefaultsUsed, "ScriptUserDataSerializer Store used defaults for RuntimeVariable"); + } + } + + JSR::ResultCode result(JSR::Tasks::WriteValue); + outputValue.SetObject(); + + { + rapidjson::Value typeValue; + result.Combine(StoreTypeId(typeValue, inputAnyPtr->type(), context)); + outputValue.AddMember(rapidjson::StringRef(JsonSerialization::TypeIdFieldIdentifier), AZStd::move(typeValue), context.GetJsonAllocator()); + } + + result.Combine(ContinueStoringToJsonObjectField(outputValue, "value", AZStd::any_cast(inputAnyPtr), AZStd::any_cast(defaultAnyPtr), inputAnyPtr->type(), context)); + + return context.Report(result, result.GetProcessing() != JSR::Processing::Halted + ? "ScriptUserDataSerializer Store finished saving RuntimeVariable" + : "ScriptUserDataSerializer Store failed to save RuntimeVariable"); + } + +} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Serialization/ScriptUserDataSerializer.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Serialization/ScriptUserDataSerializer.h new file mode 100644 index 0000000000..1e627f5acb --- /dev/null +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Serialization/ScriptUserDataSerializer.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include +#include + +namespace AZ +{ + class ScriptUserDataSerializer + : public BaseJsonSerializer + { + public: + AZ_RTTI(ScriptUserDataSerializer, "{7E5FC193-8CDB-4251-A68B-F337027381DF}", BaseJsonSerializer); + AZ_CLASS_ALLOCATOR_DECL; + + private: + JsonSerializationResult::Result Load + ( void* outputValue + , const Uuid& outputValueTypeId + , const rapidjson::Value& inputValue + , JsonDeserializerContext& context) override; + + JsonSerializationResult::Result Store + ( rapidjson::Value& outputValue + , const void* inputValue + , const void* defaultValue + , const Uuid& valueTypeId, JsonSerializerContext& context) override; + }; +} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/GraphToX.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/GraphToX.cpp index 8a424a1d7b..31d581ad27 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/GraphToX.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/GraphToX.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -75,7 +75,7 @@ namespace ScriptCanvas { return m_model.GetSource().m_name; } - + AZStd::string_view GraphToX::GetFullPath() const { return m_model.GetSource().m_path; @@ -120,7 +120,7 @@ namespace ScriptCanvas resolution += Grammar::ToIdentifier(namespaces[index]); } } - + return resolution; } @@ -128,13 +128,13 @@ namespace ScriptCanvas { writer.Write(m_configuration.m_singleLineComment); } - + void GraphToX::OpenBlockComment(Writer& writer) { writer.WriteIndent(); writer.WriteLine(m_configuration.m_blockCommentOpen); } - + void GraphToX::OpenFunctionBlock(Writer& writer) { writer.WriteLineIndented(m_configuration.m_functionBlockOpen); @@ -162,7 +162,7 @@ namespace ScriptCanvas void GraphToX::WriteCopyright(Writer& writer) { OpenBlockComment(writer); - writer.WriteLine(GetAmazonCopyright()); + writer.WriteLine(GetCopyright()); CloseBlockComment(writer); } @@ -206,5 +206,5 @@ namespace ScriptCanvas writer.Write("Last written: "); writer.WriteLine(buffer); } - } -} + } +} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/Translation.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/Translation.cpp index e735469538..24a08b26ff 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/Translation.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/Translation.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -30,7 +30,6 @@ namespace TranslationCPP AZ::Outcome, AZStd::pair> ToCPlusPlus(const Grammar::AbstractCodeModel& model, bool rawSave = false) { AZStd::string dotH, dotCPP; - auto outcome = GraphToCPlusPlus::Translate(model, dotH, dotCPP); if (outcome.IsSuccess()) { @@ -48,13 +47,11 @@ namespace TranslationCPP { saveOutcome = SaveDotCPP(model.GetSource(), dotCPP); } - if (!saveOutcome.IsSuccess()) { AZ_TracePrintf("Save failed %s", saveOutcome.GetError().data()); } } - return AZ::Success(AZStd::make_pair(AZStd::move(dotH), AZStd::move(dotCPP))); } else @@ -96,16 +93,28 @@ namespace ScriptCanvas { namespace Translation { - Result ParseGraph(const Grammar::Request& request) + AZ::Outcome ParseGraph(const Grammar::Request& request) { AZ::Outcome sourceOutcome = Grammar::Source::Construct(request); if (!sourceOutcome.IsSuccess()) { - return Result(sourceOutcome.TakeError()); + return AZ::Failure(sourceOutcome.TakeError()); } - + Grammar::AbstractCodeModelConstPtr model = Grammar::AbstractCodeModel::Parse(sourceOutcome.TakeValue()); + return AZ::Success(model); + } + + Result ParseAndTranslateGraph(const Grammar::Request& request) + { + auto parseOutcome = ParseGraph(request); + if (!parseOutcome.IsSuccess()) + { + return Result(parseOutcome.TakeError()); + } + + Grammar::AbstractCodeModelConstPtr model = parseOutcome.TakeValue(); Translations translations; Errors errors; @@ -124,61 +133,56 @@ namespace ScriptCanvas } } -// if (targetFlags & (TargetFlags::Cpp | TargetFlags::Hpp)) -// { -// auto outcomeCPP = TranslationCPP::ToCPlusPlus(*model.get(), rawSave); -// if (outcomeCPP.IsSuccess()) -// { -// auto hppAndCpp = outcomeCPP.TakeValue(); -// -// TargetResult cppResult; -// cppResult.m_text = AZStd::move(hppAndCpp.first); -// translations.emplace(TargetFlags::Hpp, AZStd::move(cppResult)); -// TargetResult hppResult; -// hppResult.m_text = AZStd::move(hppAndCpp.second); -// translations.emplace(TargetFlags::Cpp, AZStd::move(hppResult)); -// } -// else -// { -// auto hppAndCpp = outcomeCPP.TakeError(); -// errors.emplace(TargetFlags::Hpp, AZStd::move(hppAndCpp.first)); -// errors.emplace(TargetFlags::Cpp, AZStd::move(hppAndCpp.second)); -// } -// } + // Translation to C++ (executed via BehaviorContext calls) has been demonstrated in the past and is partially in progress. + // These calls allow for users to execute multiple translations from the same abstract code model. + // More work is required to complete all the latest features of the ACM, and do integrate output files into the build. + // + // if (targetFlags & (TargetFlags::Cpp | TargetFlags::Hpp)) + // { + // auto outcomeCPP = TranslationCPP::ToCPlusPlus(*model.get(), rawSave); + // if (outcomeCPP.IsSuccess()) + // { + // auto hppAndCpp = outcomeCPP.TakeValue(); + // + // TargetResult cppResult; + // cppResult.m_text = AZStd::move(hppAndCpp.first); + // translations.emplace(TargetFlags::Hpp, AZStd::move(cppResult)); + // TargetResult hppResult; + // hppResult.m_text = AZStd::move(hppAndCpp.second); + // translations.emplace(TargetFlags::Cpp, AZStd::move(hppResult)); + // } + // else + // { + // auto hppAndCpp = outcomeCPP.TakeError(); + // errors.emplace(TargetFlags::Hpp, AZStd::move(hppAndCpp.first)); + // errors.emplace(TargetFlags::Cpp, AZStd::move(hppAndCpp.second)); + // } + // } } - else - { - ValidationResults results; - for (auto& test : model->GetValidationEvents()) - { - results.AddValidationEvent(test.get()); - } - } return Result(model, AZStd::move(translations), AZStd::move(errors)); - } + } Result ToCPlusPlusAndLua(const Grammar::Request& request) { Grammar::Request toBoth = request; toBoth.translationTargetFlags = TargetFlags::Lua | TargetFlags::Cpp; - return ParseGraph(toBoth); + return ParseAndTranslateGraph(toBoth); } Result ToCPlusPlus(const Grammar::Request& request) { Grammar::Request toCpp = request; toCpp.translationTargetFlags = TargetFlags::Cpp; - return ParseGraph(toCpp); + return ParseAndTranslateGraph(toCpp); } Result ToLua(const Grammar::Request& request) { Grammar::Request toLua = request; toLua.translationTargetFlags = TargetFlags::Lua; - return ParseGraph(toLua); + return ParseAndTranslateGraph(toLua); } - - } -} + } +} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/Translation.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/Translation.h index b25526f04a..2a7bece919 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/Translation.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/Translation.h @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -18,14 +18,15 @@ namespace ScriptCanvas namespace Translation { - Result ParseGraph(const Grammar::Request& request); + AZ::Outcome ParseGraph(const Grammar::Request& request); + + Result ParseAndTranslateGraph(const Grammar::Request& request); Result ToCPlusPlus(const Grammar::Request& request); Result ToCPlusPlusAndLua(const Grammar::Request& request); - + Result ToLua(const Grammar::Request& request); - - } -} + } +} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/TranslationResult.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/TranslationResult.h index e822fd244a..96c5e8eb28 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/TranslationResult.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/TranslationResult.h @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -41,7 +41,7 @@ namespace ScriptCanvas Cpp = 1 << 1, Hpp = 1 << 2, }; - + // information required at runtime begin execution of the compiled graph from the host struct RuntimeInputs { @@ -51,10 +51,13 @@ namespace ScriptCanvas static void Reflect(AZ::ReflectContext* reflectContext); Grammar::ExecutionStateSelection m_executionSelection = Grammar::ExecutionStateSelection::InterpretedPure; + AZStd::vector m_nodeables; AZStd::vector> m_variables; + // either the entityId was a (member) variable in the source graph, or it got promoted to one during parsing AZStd::vector> m_entityIds; + // Statics required for internal, local values that need non-code constructible initialization, // when the system can't pass in the input from C++. AZStd::vector> m_staticVariables; @@ -84,7 +87,7 @@ namespace ScriptCanvas using ErrorList = AZStd::vector; using Errors = AZStd::unordered_map; using Translations = AZStd::unordered_map; - + AZStd::sys_time_t SumDurations(const Translations& translation); class Result @@ -98,6 +101,7 @@ namespace ScriptCanvas const AZStd::sys_time_t m_translationDuration; Result(AZStd::string invalidSourceInfo); + Result(Result&& source); Result(Grammar::AbstractCodeModelConstPtr model); Result(Grammar::AbstractCodeModelConstPtr model, Translations&& translations, Errors&& errors); @@ -107,7 +111,7 @@ namespace ScriptCanvas AZ::Outcome IsSuccess(TargetFlags flag) const; bool TranslationSucceed(TargetFlags flag) const; }; - + struct LuaAssetResult { AZ::Data::Asset m_scriptAsset; @@ -117,7 +121,5 @@ namespace ScriptCanvas AZStd::sys_time_t m_parseDuration; AZStd::sys_time_t m_translationDuration; }; - - } - -} + } +} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/TranslationUtilities.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/TranslationUtilities.cpp index 0318959e0e..b2625335a9 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/TranslationUtilities.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/TranslationUtilities.cpp @@ -166,7 +166,7 @@ namespace ScriptCanvas return TranslationUtilitiesCPP::k_namespaceNameNative; } - AZStd::string_view GetAmazonCopyright() + AZStd::string_view GetCopyright() { return "* Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution.\n" diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/TranslationUtilities.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/TranslationUtilities.h index 429cd653f1..58033e4ff0 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/TranslationUtilities.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/TranslationUtilities.h @@ -34,7 +34,7 @@ namespace ScriptCanvas AZStd::string EntityIdValueToString(const AZ::EntityId& entityId, const Configuration& config); - AZStd::string_view GetAmazonCopyright(); + AZStd::string_view GetCopyright(); AZStd::string_view GetAutoNativeNamespace(); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.cpp index 3f93153c1f..ece0357626 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -102,45 +102,45 @@ namespace ScriptCanvas classElement.RemoveElementByName(AZ_CRC_CE("Scope")); classElement.AddElementWithData(context, "InitialValueSource", VariableFlags::InitialValueSource::Component); } + + classElement.RemoveElementByName(AZ_CRC("ExposeAsInput", 0x0f7879f0)); + classElement.RemoveElementByName(AZ_CRC("Exposure", 0x398f29cd)); } else - if (classElement.GetVersion() < 3) - { - bool exposeAsInputField = false; - classElement.GetChildData(AZ_CRC("ExposeAsInput", 0x0f7879f0), exposeAsInputField); - - if (exposeAsInputField) - { - classElement.RemoveElementByName(AZ_CRC("Exposure", 0x398f29cd)); - classElement.AddElementWithData(context, "Scope", VariableFlags::Scope::Graph); - } - else + if (classElement.GetVersion() < 3) { - AZ::u8 exposureType = VariableFlags::Deprecated::Exposure::Exp_Local; - classElement.GetChildData(AZ_CRC("Exposure", 0x398f29cd), exposureType); + bool exposeAsInputField = false; + classElement.GetChildData(AZ_CRC("ExposeAsInput", 0x0f7879f0), exposeAsInputField); - VariableFlags::Scope scope = VariableFlags::Scope::Graph; - - if ((exposureType & VariableFlags::Deprecated::Exposure::Exp_InOut) == VariableFlags::Deprecated::Exposure::Exp_InOut) - { - scope = VariableFlags::Scope::Graph; - } - else if (exposureType & VariableFlags::Deprecated::Exposure::Exp_Input) + if (exposeAsInputField) { - scope = VariableFlags::Scope::Graph; + classElement.RemoveElementByName(AZ_CRC("Exposure", 0x398f29cd)); + classElement.AddElementWithData(context, "Scope", VariableFlags::Scope::Graph); } - else if (exposureType & VariableFlags::Deprecated::Exposure::Exp_Output) + else { - scope = VariableFlags::Scope::Function; + AZ::u8 exposureType = VariableFlags::Deprecated::Exposure::Exp_Local; + classElement.GetChildData(AZ_CRC("Exposure", 0x398f29cd), exposureType); + + VariableFlags::Scope scope = VariableFlags::Scope::Graph; + + if (((exposureType & VariableFlags::Deprecated::Exposure::Exp_InOut) == VariableFlags::Deprecated::Exposure::Exp_InOut) + || exposureType & VariableFlags::Deprecated::Exposure::Exp_Input) + { + scope = VariableFlags::Scope::Graph; + } + else if (exposureType & VariableFlags::Deprecated::Exposure::Exp_Output) + { + scope = VariableFlags::Scope::Function; + } + + classElement.AddElementWithData(context, "Scope", scope); } - classElement.AddElementWithData(context, "Scope", scope); + classElement.RemoveElementByName(AZ_CRC("Exposure", 0x398f29cd)); + classElement.RemoveElementByName(AZ_CRC("ExposeAsInput", 0x0f7879f0)); } - classElement.RemoveElementByName(AZ_CRC("Exposure", 0x398f29cd)); - classElement.RemoveElementByName(AZ_CRC("ExposeAsInput", 0x0f7879f0)); - } - return true; } @@ -203,8 +203,8 @@ namespace ScriptCanvas editContext->Class("Variable", "Represents a Variable field within a Script Canvas Graph") ->ClassElement(AZ::Edit::ClassElements::EditorData, "") ->Attribute(AZ::Edit::Attributes::Visibility, &GraphVariable::GetVisibility) - ->Attribute(AZ::Edit::Attributes::ChildNameLabelOverride, &GraphVariable::GetDisplayName) - ->Attribute(AZ::Edit::Attributes::NameLabelOverride, &GraphVariable::GetDisplayName) + ->Attribute(AZ::Edit::Attributes::ChildNameLabelOverride, &GraphVariable::GetVariableName) + ->Attribute(AZ::Edit::Attributes::NameLabelOverride, &GraphVariable::GetVariableName) ->Attribute(AZ::Edit::Attributes::DescriptionTextOverride, &GraphVariable::GetDescriptionOverride) ->DataElement(AZ::Edit::UIHandlers::ComboBox, &GraphVariable::m_InitialValueSource, "Initial Value Source", "Variables can get their values from within the graph or through component properties.") diff --git a/Gems/ScriptCanvas/Code/Source/SystemComponent.cpp b/Gems/ScriptCanvas/Code/Source/SystemComponent.cpp index eeb0d25289..3cb5da74ab 100644 --- a/Gems/ScriptCanvas/Code/Source/SystemComponent.cpp +++ b/Gems/ScriptCanvas/Code/Source/SystemComponent.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -9,10 +9,11 @@ #include #include +#include #include #include - #include +#include #include #include #include @@ -21,6 +22,7 @@ #include #include #include +#include #include #include @@ -53,7 +55,6 @@ namespace ScriptCanvasSystemComponentCpp namespace ScriptCanvas { - void SystemComponent::Reflect(AZ::ReflectContext* context) { Nodeable::Reflect(context); @@ -83,11 +84,16 @@ namespace ScriptCanvas } } + if (AZ::JsonRegistrationContext* jsonContext = azrtti_cast(context)) + { + jsonContext->Serializer() + ->HandlesType(); + } + #if defined(SC_EXECUTION_TRACE_ENABLED) ExecutionLogData::Reflect(context); ExecutionLogAsset::Reflect(context); #endif//defined(SC_EXECUTION_TRACE_ENABLED) - } void SystemComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided) @@ -144,7 +150,7 @@ namespace ScriptCanvas ModPerformanceTracker()->CalculateReports(); Execution::PerformanceTrackingReport report = ModPerformanceTracker()->GetGlobalReport(); - + const double ready = aznumeric_caster(report.timing.initializationTime); const double instant = aznumeric_caster(report.timing.executionTime); const double latent = aznumeric_caster(report.timing.latentTime); @@ -357,11 +363,11 @@ namespace ScriptCanvas auto dataRegistry = ScriptCanvas::GetDataRegistry(); for (const auto& classIter : behaviorContext->m_classes) { - auto createability = GetCreatibility(serializeContext, classIter.second); - if (createability.first != DataRegistry::Createability::None) - { - dataRegistry->RegisterType(classIter.second->m_typeId, createability.second, createability.first); - } + auto createability = GetCreatibility(serializeContext, classIter.second); + if (createability.first != DataRegistry::Createability::None) + { + dataRegistry->RegisterType(classIter.second->m_typeId, createability.second, createability.first); + } } } diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake index d1d7606b4f..28bcd49fe7 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake @@ -588,6 +588,8 @@ set(FILES Include/ScriptCanvas/Profiler/Aggregator.cpp Include/ScriptCanvas/Profiler/DrillerEvents.h Include/ScriptCanvas/Profiler/DrillerEvents.cpp + Include/ScriptCanvas/Serialization/ScriptUserDataSerializer.h + Include/ScriptCanvas/Serialization/ScriptUserDataSerializer.cpp Include/ScriptCanvas/Data/DataTrait.cpp Include/ScriptCanvas/Data/DataTrait.h Include/ScriptCanvas/Data/PropertyTraits.cpp @@ -620,5 +622,4 @@ set(SKIP_UNITY_BUILD_INCLUSION_FILES Include/ScriptCanvas/Libraries/Core/FunctionCallNode.h Include/ScriptCanvas/Libraries/Core/FunctionCallNodeIsOutOfDate.h Include/ScriptCanvas/Libraries/Core/FunctionCallNodeIsOutOfDate.cpp - ) diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_builder_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_builder_files.cmake index c8a8d43a64..a401a0cc1d 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_builder_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_builder_files.cmake @@ -7,6 +7,8 @@ set(FILES Builder/BuilderSystemComponent.h + Builder/ScriptCanvasBuilder.cpp + Builder/ScriptCanvasBuilder.h Builder/ScriptCanvasBuilderComponent.cpp Builder/ScriptCanvasBuilderComponent.h Builder/ScriptCanvasBuilderWorker.cpp diff --git a/Gems/UiBasics/Assets/UI/Prefabs/Button.uiprefab b/Gems/UiBasics/Assets/UI/Prefabs/Button.uiprefab deleted file mode 100644 index b4e44904e7..0000000000 --- a/Gems/UiBasics/Assets/UI/Prefabs/Button.uiprefab +++ /dev/null @@ -1,201 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Gems/UiBasics/Assets/UI/Prefabs/Checkbox.uiprefab b/Gems/UiBasics/Assets/UI/Prefabs/Checkbox.uiprefab deleted file mode 100644 index 4342f051c9..0000000000 --- a/Gems/UiBasics/Assets/UI/Prefabs/Checkbox.uiprefab +++ /dev/null @@ -1,346 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Gems/UiBasics/Assets/UI/Prefabs/Image.uiprefab b/Gems/UiBasics/Assets/UI/Prefabs/Image.uiprefab deleted file mode 100644 index 14aebe3ed0..0000000000 --- a/Gems/UiBasics/Assets/UI/Prefabs/Image.uiprefab +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Gems/UiBasics/Assets/UI/Prefabs/LayoutColumn.uiprefab b/Gems/UiBasics/Assets/UI/Prefabs/LayoutColumn.uiprefab deleted file mode 100644 index 46a09c2228..0000000000 --- a/Gems/UiBasics/Assets/UI/Prefabs/LayoutColumn.uiprefab +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Gems/UiBasics/Assets/UI/Prefabs/LayoutGrid.uiprefab b/Gems/UiBasics/Assets/UI/Prefabs/LayoutGrid.uiprefab deleted file mode 100644 index 84a23fbbb2..0000000000 --- a/Gems/UiBasics/Assets/UI/Prefabs/LayoutGrid.uiprefab +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Gems/UiBasics/Assets/UI/Prefabs/LayoutRow.uiprefab b/Gems/UiBasics/Assets/UI/Prefabs/LayoutRow.uiprefab deleted file mode 100644 index 35577ee608..0000000000 --- a/Gems/UiBasics/Assets/UI/Prefabs/LayoutRow.uiprefab +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Gems/UiBasics/Assets/UI/Prefabs/ScrollBarHorizontal.uiprefab b/Gems/UiBasics/Assets/UI/Prefabs/ScrollBarHorizontal.uiprefab deleted file mode 100644 index 2911354397..0000000000 --- a/Gems/UiBasics/Assets/UI/Prefabs/ScrollBarHorizontal.uiprefab +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Gems/UiBasics/Assets/UI/Prefabs/ScrollBarVertical.uiprefab b/Gems/UiBasics/Assets/UI/Prefabs/ScrollBarVertical.uiprefab deleted file mode 100644 index 44f8303729..0000000000 --- a/Gems/UiBasics/Assets/UI/Prefabs/ScrollBarVertical.uiprefab +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Gems/UiBasics/Assets/UI/Prefabs/ScrollBox.uiprefab b/Gems/UiBasics/Assets/UI/Prefabs/ScrollBox.uiprefab deleted file mode 100644 index 1019b8b098..0000000000 --- a/Gems/UiBasics/Assets/UI/Prefabs/ScrollBox.uiprefab +++ /dev/null @@ -1,526 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Gems/UiBasics/Assets/UI/Prefabs/Slider.uiprefab b/Gems/UiBasics/Assets/UI/Prefabs/Slider.uiprefab deleted file mode 100644 index 35a669bdb2..0000000000 --- a/Gems/UiBasics/Assets/UI/Prefabs/Slider.uiprefab +++ /dev/null @@ -1,339 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Gems/UiBasics/Assets/UI/Prefabs/Text.uiprefab b/Gems/UiBasics/Assets/UI/Prefabs/Text.uiprefab deleted file mode 100644 index 69646878b8..0000000000 --- a/Gems/UiBasics/Assets/UI/Prefabs/Text.uiprefab +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Gems/UiBasics/Assets/UI/Prefabs/TextInput.uiprefab b/Gems/UiBasics/Assets/UI/Prefabs/TextInput.uiprefab deleted file mode 100644 index 593d6dc220..0000000000 --- a/Gems/UiBasics/Assets/UI/Prefabs/TextInput.uiprefab +++ /dev/null @@ -1,351 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Gems/UiBasics/Assets/UI/Prefabs/TooltipDisplay.uiprefab b/Gems/UiBasics/Assets/UI/Prefabs/TooltipDisplay.uiprefab deleted file mode 100644 index b0dea29b0e..0000000000 --- a/Gems/UiBasics/Assets/UI/Prefabs/TooltipDisplay.uiprefab +++ /dev/null @@ -1,154 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Templates/DefaultProject/Template/Code/enabled_gems.cmake b/Templates/DefaultProject/Template/Code/enabled_gems.cmake index 99c3b89895..9ccce2905c 100644 --- a/Templates/DefaultProject/Template/Code/enabled_gems.cmake +++ b/Templates/DefaultProject/Template/Code/enabled_gems.cmake @@ -7,7 +7,7 @@ set(ENABLED_GEMS ${Name} - Atom_AtomBridge + Atom AudioSystem AWSCore CameraFramework diff --git a/Templates/DefaultProject/template.json b/Templates/DefaultProject/template.json index fabfb0cf18..5eaf66e3af 100644 --- a/Templates/DefaultProject/template.json +++ b/Templates/DefaultProject/template.json @@ -6,7 +6,6 @@ "license": "What license DefaultProject uses goes here: i.e. https://opensource.org/licenses/MIT", "display_name": "Standard", "summary": "This template has everything you need to build a full online 3D game or application.", - "included_gems": ["Atom","Camera","EMotionFX","UI","Maestro","Input","ImGui"], "canonical_tags": [], "user_tags": [ "DefaultProject" diff --git a/Templates/MinimalProject/Template/Code/enabled_gems.cmake b/Templates/MinimalProject/Template/Code/enabled_gems.cmake index 13774c2831..db63d149ab 100644 --- a/Templates/MinimalProject/Template/Code/enabled_gems.cmake +++ b/Templates/MinimalProject/Template/Code/enabled_gems.cmake @@ -7,7 +7,7 @@ set(ENABLED_GEMS ${Name} - Atom_AtomBridge + Atom CameraFramework ImGui ) diff --git a/Tools/Redistributables/ANGLE/win32/libEGL.dll b/Tools/Redistributables/ANGLE/win32/libEGL.dll deleted file mode 100644 index 17591e8a92..0000000000 --- a/Tools/Redistributables/ANGLE/win32/libEGL.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a355059a9c5502b031f7dc6e20d926a3408d72e3e65de0c698ab7558a96dc815 -size 11776 diff --git a/Tools/Redistributables/ANGLE/win32/libEGLd.dll b/Tools/Redistributables/ANGLE/win32/libEGLd.dll deleted file mode 100644 index 57b9edd0fd..0000000000 --- a/Tools/Redistributables/ANGLE/win32/libEGLd.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3d56680be69f7445b11646ddd73ba700bccfca4f719ebc7a2c8f541f69ef7c7d -size 47104 diff --git a/Tools/Redistributables/ANGLE/win32/libGLESv2.dll b/Tools/Redistributables/ANGLE/win32/libGLESv2.dll deleted file mode 100644 index 8db2dd1884..0000000000 --- a/Tools/Redistributables/ANGLE/win32/libGLESv2.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:74ad18a8407c076eb828f90df6f001f3ddbc60dabe0d51d6a6e63b239895c372 -size 2013696 diff --git a/Tools/Redistributables/ANGLE/win32/libGLESv2d.dll b/Tools/Redistributables/ANGLE/win32/libGLESv2d.dll deleted file mode 100644 index fb0d5e866c..0000000000 --- a/Tools/Redistributables/ANGLE/win32/libGLESv2d.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9fc47544300f53039fbdcb3c19ce7304d838a033f929d91cb9b00706f00470db -size 9986048 diff --git a/Tools/Redistributables/D3DCompiler/win32/D3DCompiler_43.dll b/Tools/Redistributables/D3DCompiler/win32/D3DCompiler_43.dll deleted file mode 100644 index 33360daba7..0000000000 --- a/Tools/Redistributables/D3DCompiler/win32/D3DCompiler_43.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:44c3a7e330b54a35a9efa015831392593aa02e7da1460be429d17c3644850e8a -size 2526056 diff --git a/Tools/Redistributables/D3DCompiler/win32/d3dcompiler_46.dll b/Tools/Redistributables/D3DCompiler/win32/d3dcompiler_46.dll deleted file mode 100644 index 76409ef17f..0000000000 --- a/Tools/Redistributables/D3DCompiler/win32/d3dcompiler_46.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:dde5c2d0ff52f07017ea91e833f3baeca74661539599795df2e8096218abcca7 -size 3873208 diff --git a/Tools/Redistributables/D3DCompiler/win32/d3dcompiler_47.dll b/Tools/Redistributables/D3DCompiler/win32/d3dcompiler_47.dll deleted file mode 100644 index e720652a3d..0000000000 --- a/Tools/Redistributables/D3DCompiler/win32/d3dcompiler_47.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d82f77d802ff05d4da0c82335a05613604da243513faa7fb145aaad0119bddb5 -size 4488904 diff --git a/Tools/Redistributables/D3DCompiler/win32/d3dcsx_46.dll b/Tools/Redistributables/D3DCompiler/win32/d3dcsx_46.dll deleted file mode 100644 index af3bca66f8..0000000000 --- a/Tools/Redistributables/D3DCompiler/win32/d3dcsx_46.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:475f0b6c0f62fc1420e69130d1df2ff15821f13817d47c81ee18d78fbf5690a9 -size 1917016 diff --git a/Tools/Redistributables/D3DCompiler/win32/d3dcsx_47.dll b/Tools/Redistributables/D3DCompiler/win32/d3dcsx_47.dll deleted file mode 100644 index 142d90def6..0000000000 --- a/Tools/Redistributables/D3DCompiler/win32/d3dcsx_47.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b8d78452c139d4f4e4e387050fbf3587ae7767a91f52b270e09af5ca00c729e4 -size 1921168 diff --git a/Tools/Redistributables/D3DCompiler/win32/d3dx11_43.dll b/Tools/Redistributables/D3DCompiler/win32/d3dx11_43.dll deleted file mode 100644 index cfb2d499ae..0000000000 --- a/Tools/Redistributables/D3DCompiler/win32/d3dx11_43.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:981e42629df751217406e7150477cddc853b79abd6a8568a1566298ed8f7bd59 -size 276832 diff --git a/Tools/Redistributables/D3DCompiler/win32/xinput1_3.dll b/Tools/Redistributables/D3DCompiler/win32/xinput1_3.dll deleted file mode 100644 index 33fbe019ff..0000000000 --- a/Tools/Redistributables/D3DCompiler/win32/xinput1_3.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:756cad002e1553cfa1a91ebe8c1b9380ffabe0b4b1916c4a4db802396ddfbef8 -size 107368 diff --git a/Tools/Redistributables/DbgHelp/win32/dbghelp.dll b/Tools/Redistributables/DbgHelp/win32/dbghelp.dll deleted file mode 100644 index 92ea21217c..0000000000 --- a/Tools/Redistributables/DbgHelp/win32/dbghelp.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c53733eb15cdc60920efcf6fc5a5ad9e936b5ea6d0a1913506730a5721ff2a10 -size 1413064 diff --git a/Tools/Redistributables/DirectX 9.0c/APR2007_XACT_x64.cab b/Tools/Redistributables/DirectX 9.0c/APR2007_XACT_x64.cab deleted file mode 100644 index e7bf2eaf5f..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/APR2007_XACT_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0e1042d91b755a36e7dfca480bb3f868cb23f5438dd1415fd3fcfb13b27d761e -size 195766 diff --git a/Tools/Redistributables/DirectX 9.0c/APR2007_XACT_x86.cab b/Tools/Redistributables/DirectX 9.0c/APR2007_XACT_x86.cab deleted file mode 100644 index 98e73d72fb..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/APR2007_XACT_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9dee9f2b720b0fc90b8ebdac22d20f2008e58f16f354b9a967526c439bf0b9a3 -size 151225 diff --git a/Tools/Redistributables/DirectX 9.0c/APR2007_d3dx10_33_x64.cab b/Tools/Redistributables/DirectX 9.0c/APR2007_d3dx10_33_x64.cab deleted file mode 100644 index bc9e0209be..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/APR2007_d3dx10_33_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1bed02f304d495c2769debff315ae3f017c7e9907d85138996554e8e61a61e91 -size 698612 diff --git a/Tools/Redistributables/DirectX 9.0c/APR2007_d3dx10_33_x86.cab b/Tools/Redistributables/DirectX 9.0c/APR2007_d3dx10_33_x86.cab deleted file mode 100644 index da023a3b35..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/APR2007_d3dx10_33_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6aca96d6aa400d8ad07d2fb1c4aa94c62d261b9370cbf01d2acce24e489038ba -size 695865 diff --git a/Tools/Redistributables/DirectX 9.0c/APR2007_d3dx9_33_x64.cab b/Tools/Redistributables/DirectX 9.0c/APR2007_d3dx9_33_x64.cab deleted file mode 100644 index 013a902ffe..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/APR2007_d3dx9_33_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:387c63928479e0ad138fa154f9f291821275f6fdf122aac8ace87f0d2033e77c -size 1607358 diff --git a/Tools/Redistributables/DirectX 9.0c/APR2007_d3dx9_33_x86.cab b/Tools/Redistributables/DirectX 9.0c/APR2007_d3dx9_33_x86.cab deleted file mode 100644 index 5b27284802..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/APR2007_d3dx9_33_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9a7e65d97910b2038bb01a640a86c2ebf62ab7b36a50f349e71ec901b206f0ee -size 1606039 diff --git a/Tools/Redistributables/DirectX 9.0c/APR2007_xinput_x64.cab b/Tools/Redistributables/DirectX 9.0c/APR2007_xinput_x64.cab deleted file mode 100644 index b2e5465682..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/APR2007_xinput_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e7a09f8235cc587cc63f583e39fbc75008d9677c8bb4dcc11cb8d0178a5153ac -size 96817 diff --git a/Tools/Redistributables/DirectX 9.0c/APR2007_xinput_x86.cab b/Tools/Redistributables/DirectX 9.0c/APR2007_xinput_x86.cab deleted file mode 100644 index def39b9c76..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/APR2007_xinput_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2acea6c8b9f6f7f89ec51365a1e49fbd0d8c42c53418bd0783dbf3f74a744e6d -size 53302 diff --git a/Tools/Redistributables/DirectX 9.0c/AUG2006_XACT_x64.cab b/Tools/Redistributables/DirectX 9.0c/AUG2006_XACT_x64.cab deleted file mode 100644 index fc21802558..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/AUG2006_XACT_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:beaac99fd17bc9fa85a2a220a13d8c13bd90f66eee595cbd27ab9aaadc234b03 -size 182903 diff --git a/Tools/Redistributables/DirectX 9.0c/AUG2006_XACT_x86.cab b/Tools/Redistributables/DirectX 9.0c/AUG2006_XACT_x86.cab deleted file mode 100644 index f45772bf7a..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/AUG2006_XACT_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:cd2e1256efa1723eb77c77440f7b72f0eed8c0df17677cd4cc5a95a65a0f4849 -size 137235 diff --git a/Tools/Redistributables/DirectX 9.0c/AUG2006_xinput_x64.cab b/Tools/Redistributables/DirectX 9.0c/AUG2006_xinput_x64.cab deleted file mode 100644 index e39bf153fb..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/AUG2006_xinput_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a54c7820f37b5e70068b801263c7efcc26b6404555a968094227e8bbaf5c22c5 -size 87142 diff --git a/Tools/Redistributables/DirectX 9.0c/AUG2006_xinput_x86.cab b/Tools/Redistributables/DirectX 9.0c/AUG2006_xinput_x86.cab deleted file mode 100644 index 4375d58ed1..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/AUG2006_xinput_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ad2b521d1a7abca6314eaeacb23690b63b2a17adbb2a47d3d69cc4660c7d2152 -size 46058 diff --git a/Tools/Redistributables/DirectX 9.0c/AUG2007_XACT_x64.cab b/Tools/Redistributables/DirectX 9.0c/AUG2007_XACT_x64.cab deleted file mode 100644 index 9a235b6833..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/AUG2007_XACT_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:35f09b0727ee1ab9116166c512c08886623a67939b2e0d841efdee689b6e0f84 -size 198096 diff --git a/Tools/Redistributables/DirectX 9.0c/AUG2007_XACT_x86.cab b/Tools/Redistributables/DirectX 9.0c/AUG2007_XACT_x86.cab deleted file mode 100644 index 4bebdc313e..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/AUG2007_XACT_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b39c1b8483111be11cd4c10ef2d18ec8f0b23ff13b628482507076ede9fa9bd1 -size 153012 diff --git a/Tools/Redistributables/DirectX 9.0c/AUG2007_d3dx10_35_x64.cab b/Tools/Redistributables/DirectX 9.0c/AUG2007_d3dx10_35_x64.cab deleted file mode 100644 index 74b7b71f68..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/AUG2007_d3dx10_35_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:edbdcb1fa651ec3c8a505a0bb8570b6147ed89ca372e3e6ea86dc6876d6a72f5 -size 852286 diff --git a/Tools/Redistributables/DirectX 9.0c/AUG2007_d3dx10_35_x86.cab b/Tools/Redistributables/DirectX 9.0c/AUG2007_d3dx10_35_x86.cab deleted file mode 100644 index fc0868a13a..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/AUG2007_d3dx10_35_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a574ecb764861fc40301ebb65fb0bde10fc904ac6eea0580c325dd0c561ff35b -size 796867 diff --git a/Tools/Redistributables/DirectX 9.0c/AUG2007_d3dx9_35_x64.cab b/Tools/Redistributables/DirectX 9.0c/AUG2007_d3dx9_35_x64.cab deleted file mode 100644 index 42e6fff02c..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/AUG2007_d3dx9_35_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6a637ef67615722156fe3fd57ef7581d4ac85ee237d445975b6a20c7a76bd7e3 -size 1800160 diff --git a/Tools/Redistributables/DirectX 9.0c/AUG2007_d3dx9_35_x86.cab b/Tools/Redistributables/DirectX 9.0c/AUG2007_d3dx9_35_x86.cab deleted file mode 100644 index 71186b145f..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/AUG2007_d3dx9_35_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6891a70890d5b0bed82a41c47211690a73b24b6df331b83135ed647ff13b1aca -size 1708152 diff --git a/Tools/Redistributables/DirectX 9.0c/Apr2005_d3dx9_25_x64.cab b/Tools/Redistributables/DirectX 9.0c/Apr2005_d3dx9_25_x64.cab deleted file mode 100644 index 1be3556dbe..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Apr2005_d3dx9_25_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b4188ce988af9c4771ae0abcc7edc42a091133f9f20196564f51755dc55ea85d -size 1347354 diff --git a/Tools/Redistributables/DirectX 9.0c/Apr2005_d3dx9_25_x86.cab b/Tools/Redistributables/DirectX 9.0c/Apr2005_d3dx9_25_x86.cab deleted file mode 100644 index 7764f8a390..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Apr2005_d3dx9_25_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6ebfb6ed6ac0b69502a5b74e2edca188872fe767269c4ebf62f174157d198de4 -size 1078962 diff --git a/Tools/Redistributables/DirectX 9.0c/Apr2006_MDX1_x86.cab b/Tools/Redistributables/DirectX 9.0c/Apr2006_MDX1_x86.cab deleted file mode 100644 index c424daaec9..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Apr2006_MDX1_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0e3b4b9d5a45884620820d0e9cfed852b03dfb44e443179a35e93f3183384db3 -size 916430 diff --git a/Tools/Redistributables/DirectX 9.0c/Apr2006_MDX1_x86_Archive.cab b/Tools/Redistributables/DirectX 9.0c/Apr2006_MDX1_x86_Archive.cab deleted file mode 100644 index 86ec8042a1..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Apr2006_MDX1_x86_Archive.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0a051a9b50f58dc631254102ac885942ced67c2911950de0cdd93cd1cd9453ec -size 4162630 diff --git a/Tools/Redistributables/DirectX 9.0c/Apr2006_XACT_x64.cab b/Tools/Redistributables/DirectX 9.0c/Apr2006_XACT_x64.cab deleted file mode 100644 index 20f0ea95bf..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Apr2006_XACT_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:002f45af20e43a24abee7a79c5add11987c88140b84e2ecd33c0c67259c7f71b -size 179133 diff --git a/Tools/Redistributables/DirectX 9.0c/Apr2006_XACT_x86.cab b/Tools/Redistributables/DirectX 9.0c/Apr2006_XACT_x86.cab deleted file mode 100644 index 6f07ba3a82..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Apr2006_XACT_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:875662d0fc1fe865bf43e7279fd391e88f96b3141c1a829ab3080d547501ff8f -size 133103 diff --git a/Tools/Redistributables/DirectX 9.0c/Apr2006_d3dx9_30_x64.cab b/Tools/Redistributables/DirectX 9.0c/Apr2006_d3dx9_30_x64.cab deleted file mode 100644 index 061253b14e..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Apr2006_d3dx9_30_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:079f61e155695a61a0ce009ee00cf76fbf6b2b9b412c1a5b4a2035d4b5c90a5b -size 1397830 diff --git a/Tools/Redistributables/DirectX 9.0c/Apr2006_d3dx9_30_x86.cab b/Tools/Redistributables/DirectX 9.0c/Apr2006_d3dx9_30_x86.cab deleted file mode 100644 index 82dbc5a86d..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Apr2006_d3dx9_30_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4b5da79e14ef58f2608fc5ccedfc7c6c6f782291aa5573f36af76f2903173db5 -size 1115221 diff --git a/Tools/Redistributables/DirectX 9.0c/Apr2006_xinput_x64.cab b/Tools/Redistributables/DirectX 9.0c/Apr2006_xinput_x64.cab deleted file mode 100644 index b305f61305..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Apr2006_xinput_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:48da57aa045a877053a481802fdb3ec5782615d9ad85a8c06612bd80272e75d7 -size 87101 diff --git a/Tools/Redistributables/DirectX 9.0c/Apr2006_xinput_x86.cab b/Tools/Redistributables/DirectX 9.0c/Apr2006_xinput_x86.cab deleted file mode 100644 index 4785f91ec3..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Apr2006_xinput_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a9b3dd45926364d79b42b75d8064c814ff428437143c59b1c703ec8323305fbb -size 46010 diff --git a/Tools/Redistributables/DirectX 9.0c/Aug2005_d3dx9_27_x64.cab b/Tools/Redistributables/DirectX 9.0c/Aug2005_d3dx9_27_x64.cab deleted file mode 100644 index edeca33d5e..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Aug2005_d3dx9_27_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:281d20c56caa3a2851199c028d4d20ef0a862cc3f84b165eb200da573d9e4401 -size 1350542 diff --git a/Tools/Redistributables/DirectX 9.0c/Aug2005_d3dx9_27_x86.cab b/Tools/Redistributables/DirectX 9.0c/Aug2005_d3dx9_27_x86.cab deleted file mode 100644 index 6aadd5ad03..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Aug2005_d3dx9_27_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7a10900872ecd9bdbc8f7beb7869a260fa4b25e34084f237f1b096df5371c273 -size 1077644 diff --git a/Tools/Redistributables/DirectX 9.0c/Aug2008_XACT_x64.cab b/Tools/Redistributables/DirectX 9.0c/Aug2008_XACT_x64.cab deleted file mode 100644 index 1d0d437175..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Aug2008_XACT_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c49e261887fefc13cc914590e33faec10316641bf683a121901c302a7a9efab4 -size 121772 diff --git a/Tools/Redistributables/DirectX 9.0c/Aug2008_XACT_x86.cab b/Tools/Redistributables/DirectX 9.0c/Aug2008_XACT_x86.cab deleted file mode 100644 index cbc6dffade..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Aug2008_XACT_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:913f67e5daeb61d872392f2951e13ecfacef572ad4bb1731f7bbefa1ab314a24 -size 92996 diff --git a/Tools/Redistributables/DirectX 9.0c/Aug2008_XAudio_x64.cab b/Tools/Redistributables/DirectX 9.0c/Aug2008_XAudio_x64.cab deleted file mode 100644 index c119908c98..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Aug2008_XAudio_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5320967b14b8f7ad95973a26d3cb9de645acc663d3c3d1fce7d6464abe7e0d78 -size 271412 diff --git a/Tools/Redistributables/DirectX 9.0c/Aug2008_XAudio_x86.cab b/Tools/Redistributables/DirectX 9.0c/Aug2008_XAudio_x86.cab deleted file mode 100644 index 0521c517d3..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Aug2008_XAudio_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d26eff418f73c878a174c69a12dff08323df617526e8c5d8439e975f083db63b -size 271038 diff --git a/Tools/Redistributables/DirectX 9.0c/Aug2008_d3dx10_39_x64.cab b/Tools/Redistributables/DirectX 9.0c/Aug2008_d3dx10_39_x64.cab deleted file mode 100644 index 3496ddab0c..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Aug2008_d3dx10_39_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ae64328b9a02a47c5ad429b9fba47b9228ab1a1e7d4e00e5d24087f2772d0b80 -size 867612 diff --git a/Tools/Redistributables/DirectX 9.0c/Aug2008_d3dx10_39_x86.cab b/Tools/Redistributables/DirectX 9.0c/Aug2008_d3dx10_39_x86.cab deleted file mode 100644 index f0be0e37bb..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Aug2008_d3dx10_39_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8c0643efa8d113fc5ef0a0e98d9a2cc0e32cb8d4219ca0bc7e57cf710fd4fdad -size 849167 diff --git a/Tools/Redistributables/DirectX 9.0c/Aug2008_d3dx9_39_x64.cab b/Tools/Redistributables/DirectX 9.0c/Aug2008_d3dx9_39_x64.cab deleted file mode 100644 index 300b15aed0..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Aug2008_d3dx9_39_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e0c5dc6a375a70ac6c8cea9193b76db241dad8e754702d57fd20765b55b30798 -size 1794084 diff --git a/Tools/Redistributables/DirectX 9.0c/Aug2008_d3dx9_39_x86.cab b/Tools/Redistributables/DirectX 9.0c/Aug2008_d3dx9_39_x86.cab deleted file mode 100644 index f594ff002a..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Aug2008_d3dx9_39_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:87d672f2ea01ef2123fe5c92da82a988cd964ca55ad660cc073d78d8151a7d84 -size 1464672 diff --git a/Tools/Redistributables/DirectX 9.0c/Aug2009_D3DCompiler_42_x64.cab b/Tools/Redistributables/DirectX 9.0c/Aug2009_D3DCompiler_42_x64.cab deleted file mode 100644 index 0358983866..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Aug2009_D3DCompiler_42_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d2e14fc8cb9410caad5bd17c4acff2b6e060c552c432d11946a6905aee216931 -size 919044 diff --git a/Tools/Redistributables/DirectX 9.0c/Aug2009_D3DCompiler_42_x86.cab b/Tools/Redistributables/DirectX 9.0c/Aug2009_D3DCompiler_42_x86.cab deleted file mode 100644 index 7d3398e5b4..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Aug2009_D3DCompiler_42_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:36c9be8c55f721c38110d56a6ccada672e7566d89f77c738c94fcdf1a584ecf4 -size 900598 diff --git a/Tools/Redistributables/DirectX 9.0c/Aug2009_XACT_x64.cab b/Tools/Redistributables/DirectX 9.0c/Aug2009_XACT_x64.cab deleted file mode 100644 index 698f966cee..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Aug2009_XACT_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:69dab3f80a58912fbee51934d1e6da8d0432efa7577810600dfd168d4a52d637 -size 122408 diff --git a/Tools/Redistributables/DirectX 9.0c/Aug2009_XACT_x86.cab b/Tools/Redistributables/DirectX 9.0c/Aug2009_XACT_x86.cab deleted file mode 100644 index 9dd9e2a8f8..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Aug2009_XACT_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7c4bab445d4666965019b6084c23e4b9ae9e34b14898d01debc0101ddb9e12e4 -size 93106 diff --git a/Tools/Redistributables/DirectX 9.0c/Aug2009_XAudio_x64.cab b/Tools/Redistributables/DirectX 9.0c/Aug2009_XAudio_x64.cab deleted file mode 100644 index 5ab27e27ec..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Aug2009_XAudio_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1269f085046694d1466a4b75386ec30dd0564949db4fa90df366983f860acb97 -size 273264 diff --git a/Tools/Redistributables/DirectX 9.0c/Aug2009_XAudio_x86.cab b/Tools/Redistributables/DirectX 9.0c/Aug2009_XAudio_x86.cab deleted file mode 100644 index a17034abaa..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Aug2009_XAudio_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b8e0c1022a42156c4239aea081f3abb0bf45ef61f30413df182e422e26435714 -size 272642 diff --git a/Tools/Redistributables/DirectX 9.0c/Aug2009_d3dcsx_42_x64.cab b/Tools/Redistributables/DirectX 9.0c/Aug2009_d3dcsx_42_x64.cab deleted file mode 100644 index d443cc3a07..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Aug2009_d3dcsx_42_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b53bb3ed6f56702672f9f0201f6399b28f8c012ac7f1a604fb13b32a10a40dab -size 3112111 diff --git a/Tools/Redistributables/DirectX 9.0c/Aug2009_d3dcsx_42_x86.cab b/Tools/Redistributables/DirectX 9.0c/Aug2009_d3dcsx_42_x86.cab deleted file mode 100644 index 9ac2fdf691..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Aug2009_d3dcsx_42_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a66fd98a1f746698848a4a7eb5ae69dac8ff2654b56c7decebb03cdca8dc7c85 -size 3319740 diff --git a/Tools/Redistributables/DirectX 9.0c/Aug2009_d3dx10_42_x64.cab b/Tools/Redistributables/DirectX 9.0c/Aug2009_d3dx10_42_x64.cab deleted file mode 100644 index eb81c297df..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Aug2009_d3dx10_42_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2cfd51f0115c048ed432522d387167e46b2a2929524dcbd08b91c07705d5da27 -size 232635 diff --git a/Tools/Redistributables/DirectX 9.0c/Aug2009_d3dx10_42_x86.cab b/Tools/Redistributables/DirectX 9.0c/Aug2009_d3dx10_42_x86.cab deleted file mode 100644 index 75c77c166e..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Aug2009_d3dx10_42_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:eef0244674e44a4131f12243a11badf3e9c7a24efdca73dd26cf75f24d902597 -size 192131 diff --git a/Tools/Redistributables/DirectX 9.0c/Aug2009_d3dx11_42_x64.cab b/Tools/Redistributables/DirectX 9.0c/Aug2009_d3dx11_42_x64.cab deleted file mode 100644 index 226a317dd7..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Aug2009_d3dx11_42_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0b91a568769bf0f89658ffb4eff9eacdc5debbe4ddc2d94da6f7068237c94c86 -size 136301 diff --git a/Tools/Redistributables/DirectX 9.0c/Aug2009_d3dx11_42_x86.cab b/Tools/Redistributables/DirectX 9.0c/Aug2009_d3dx11_42_x86.cab deleted file mode 100644 index d645143381..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Aug2009_d3dx11_42_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e8c845fc2cf746ba07f8921a09dc533973621d6f8a015342e2b078d11815b121 -size 105044 diff --git a/Tools/Redistributables/DirectX 9.0c/Aug2009_d3dx9_42_x64.cab b/Tools/Redistributables/DirectX 9.0c/Aug2009_d3dx9_42_x64.cab deleted file mode 100644 index 6b79425e40..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Aug2009_d3dx9_42_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:832f6a4415c873ed8acca0d5c9e65fe163d9567f0ce29fb3fda11d7afd1e11c7 -size 930116 diff --git a/Tools/Redistributables/DirectX 9.0c/Aug2009_d3dx9_42_x86.cab b/Tools/Redistributables/DirectX 9.0c/Aug2009_d3dx9_42_x86.cab deleted file mode 100644 index c34893deff..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Aug2009_d3dx9_42_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0adc71e37869f12b4806321f40c25dad3d5f8ad372eb35e0bcbaacf60408eb45 -size 728456 diff --git a/Tools/Redistributables/DirectX 9.0c/DEC2006_XACT_x64.cab b/Tools/Redistributables/DirectX 9.0c/DEC2006_XACT_x64.cab deleted file mode 100644 index 6aec647190..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/DEC2006_XACT_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b3f65d918e4dc0e84ce5d0add6d0d46425c58de19fddfbc7b996ff357caac3b2 -size 192475 diff --git a/Tools/Redistributables/DirectX 9.0c/DEC2006_XACT_x86.cab b/Tools/Redistributables/DirectX 9.0c/DEC2006_XACT_x86.cab deleted file mode 100644 index 6bbe0f8c43..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/DEC2006_XACT_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3d9b905fce31b42c47be263165d71c346b5d47abdabbfe6e9a87fd5a89b0b9f5 -size 145599 diff --git a/Tools/Redistributables/DirectX 9.0c/DEC2006_d3dx10_00_x64.cab b/Tools/Redistributables/DirectX 9.0c/DEC2006_d3dx10_00_x64.cab deleted file mode 100644 index d3a5fd50f9..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/DEC2006_d3dx10_00_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d926d1381f1949754f5e6d597c4ab49e3f350312b2e426effafeed22ba9ced91 -size 212807 diff --git a/Tools/Redistributables/DirectX 9.0c/DEC2006_d3dx10_00_x86.cab b/Tools/Redistributables/DirectX 9.0c/DEC2006_d3dx10_00_x86.cab deleted file mode 100644 index 07e9610fa8..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/DEC2006_d3dx10_00_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:07fe66373868c32de3f4a4097bd3834ac98018f490f5bf08f02f559c48dbf985 -size 191720 diff --git a/Tools/Redistributables/DirectX 9.0c/DEC2006_d3dx9_32_x64.cab b/Tools/Redistributables/DirectX 9.0c/DEC2006_d3dx9_32_x64.cab deleted file mode 100644 index c172e53054..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/DEC2006_d3dx9_32_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:473c0111f5a1efb6791575c5f769431fa2affd76813aaf9d476a571e26cd3fed -size 1571154 diff --git a/Tools/Redistributables/DirectX 9.0c/DEC2006_d3dx9_32_x86.cab b/Tools/Redistributables/DirectX 9.0c/DEC2006_d3dx9_32_x86.cab deleted file mode 100644 index 84c2e49f7c..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/DEC2006_d3dx9_32_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:81251ebd8ee94f108807e32e04dea544c3937a5f870bc6ccb917d059e70b1838 -size 1574376 diff --git a/Tools/Redistributables/DirectX 9.0c/DSETUP.dll b/Tools/Redistributables/DirectX 9.0c/DSETUP.dll deleted file mode 100644 index f29cc3d578..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/DSETUP.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2a61679eeedabf7d0d0ac14e5447486575622d6b7cfa56f136c1576ff96da21f -size 95576 diff --git a/Tools/Redistributables/DirectX 9.0c/DXSETUP.exe b/Tools/Redistributables/DirectX 9.0c/DXSETUP.exe deleted file mode 100644 index 6b93909d18..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/DXSETUP.exe +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8f47d7121ef6532ad9ad9901e44e237f5c30448b752028c58a9d19521414e40d -size 517976 diff --git a/Tools/Redistributables/DirectX 9.0c/Dec2005_d3dx9_28_x64.cab b/Tools/Redistributables/DirectX 9.0c/Dec2005_d3dx9_28_x64.cab deleted file mode 100644 index e775a2a8b8..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Dec2005_d3dx9_28_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8231b38a0ab70018f15d7239ed96e5f2bc89ddae6cf9650c9d7bd052b96877e3 -size 1357976 diff --git a/Tools/Redistributables/DirectX 9.0c/Dec2005_d3dx9_28_x86.cab b/Tools/Redistributables/DirectX 9.0c/Dec2005_d3dx9_28_x86.cab deleted file mode 100644 index 86454423b4..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Dec2005_d3dx9_28_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:bdee0708db956a4ce59220626106a2df70ede2e1e32f29e432254b04876fa7b9 -size 1079456 diff --git a/Tools/Redistributables/DirectX 9.0c/FEB2007_XACT_x64.cab b/Tools/Redistributables/DirectX 9.0c/FEB2007_XACT_x64.cab deleted file mode 100644 index 2e2c35a180..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/FEB2007_XACT_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:85d3279df02904f161f62f7a529911e135439ae26f4aa4984be439a4ac1768ab -size 194675 diff --git a/Tools/Redistributables/DirectX 9.0c/FEB2007_XACT_x86.cab b/Tools/Redistributables/DirectX 9.0c/FEB2007_XACT_x86.cab deleted file mode 100644 index 96b93a2c92..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/FEB2007_XACT_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d2446c0478d0087250c2f4f4cbdec7bdc9aec7ac92ca37b874c96aa3a3275dcd -size 147983 diff --git a/Tools/Redistributables/DirectX 9.0c/Feb2005_d3dx9_24_x64.cab b/Tools/Redistributables/DirectX 9.0c/Feb2005_d3dx9_24_x64.cab deleted file mode 100644 index 5be33e5b4a..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Feb2005_d3dx9_24_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:48eeeecd6411039b23f32b7b22c8d40bce45280af5f8b066edd6cf30284b90ca -size 1247499 diff --git a/Tools/Redistributables/DirectX 9.0c/Feb2005_d3dx9_24_x86.cab b/Tools/Redistributables/DirectX 9.0c/Feb2005_d3dx9_24_x86.cab deleted file mode 100644 index 2ed0e17879..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Feb2005_d3dx9_24_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:12e2aab3dbaee503724a5505a6f6951f07306578801a4b5b6b9b54514275ce79 -size 1013225 diff --git a/Tools/Redistributables/DirectX 9.0c/Feb2006_XACT_x64.cab b/Tools/Redistributables/DirectX 9.0c/Feb2006_XACT_x64.cab deleted file mode 100644 index cb79f55355..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Feb2006_XACT_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ea39caab8e071df53c2f44c19fb2ff6e2f6af4ef47f0c66d8e7b1b0918d6745f -size 178359 diff --git a/Tools/Redistributables/DirectX 9.0c/Feb2006_XACT_x86.cab b/Tools/Redistributables/DirectX 9.0c/Feb2006_XACT_x86.cab deleted file mode 100644 index dd87d1e7f2..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Feb2006_XACT_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:633a1fe357e57bbb8e058e1e029f61f379ab936a85c5d30ee442d804a1806868 -size 132409 diff --git a/Tools/Redistributables/DirectX 9.0c/Feb2006_d3dx9_29_x64.cab b/Tools/Redistributables/DirectX 9.0c/Feb2006_d3dx9_29_x64.cab deleted file mode 100644 index 9e8ae80d11..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Feb2006_d3dx9_29_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:405bd17fe25128a91693807a6008031d87c005ba93d016cbab6276891d3bc6bb -size 1362796 diff --git a/Tools/Redistributables/DirectX 9.0c/Feb2006_d3dx9_29_x86.cab b/Tools/Redistributables/DirectX 9.0c/Feb2006_d3dx9_29_x86.cab deleted file mode 100644 index 2465317daa..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Feb2006_d3dx9_29_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:20231448d5d74b7df1e43d796d76381d563699f81944c7ad9ccbcc1a77a5591e -size 1084720 diff --git a/Tools/Redistributables/DirectX 9.0c/Feb2010_X3DAudio_x64.cab b/Tools/Redistributables/DirectX 9.0c/Feb2010_X3DAudio_x64.cab deleted file mode 100644 index 4bd9c61e96..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Feb2010_X3DAudio_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:832b6d48e169b4725ae482ea4d1c3360a09631a89b2fac3aba81a50805a50adc -size 54678 diff --git a/Tools/Redistributables/DirectX 9.0c/Feb2010_X3DAudio_x86.cab b/Tools/Redistributables/DirectX 9.0c/Feb2010_X3DAudio_x86.cab deleted file mode 100644 index aac3d6e0f5..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Feb2010_X3DAudio_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:acba5c4d4ac90e1df1c8404be5ff780e24238153cb410af909cd4364d213f2a9 -size 20713 diff --git a/Tools/Redistributables/DirectX 9.0c/Feb2010_XACT_x64.cab b/Tools/Redistributables/DirectX 9.0c/Feb2010_XACT_x64.cab deleted file mode 100644 index 65d5681887..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Feb2010_XACT_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:42d7936ca7520a8092ccb82612d0217c755ecf619251fd2aa0c37ccfd8c49807 -size 122446 diff --git a/Tools/Redistributables/DirectX 9.0c/Feb2010_XACT_x86.cab b/Tools/Redistributables/DirectX 9.0c/Feb2010_XACT_x86.cab deleted file mode 100644 index 30931d7c9e..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Feb2010_XACT_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d168fcdd6b63c24f6f6d2851ad1d0d977146edd9f6377b46d8f87bf5a92a0693 -size 93180 diff --git a/Tools/Redistributables/DirectX 9.0c/Feb2010_XAudio_x64.cab b/Tools/Redistributables/DirectX 9.0c/Feb2010_XAudio_x64.cab deleted file mode 100644 index 54a5f9cbc4..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Feb2010_XAudio_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:038a01a9b3ba4ceb4df4726a5704a5b325871c07e3714913c3a9ff4184a50df6 -size 276960 diff --git a/Tools/Redistributables/DirectX 9.0c/Feb2010_XAudio_x86.cab b/Tools/Redistributables/DirectX 9.0c/Feb2010_XAudio_x86.cab deleted file mode 100644 index 086ffd2cbc..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Feb2010_XAudio_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:86a653d6a77bad77df48a19669eb41dc402297b42d6f9ee239b39735be409d31 -size 277191 diff --git a/Tools/Redistributables/DirectX 9.0c/JUN2006_XACT_x64.cab b/Tools/Redistributables/DirectX 9.0c/JUN2006_XACT_x64.cab deleted file mode 100644 index 82090d645c..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/JUN2006_XACT_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e7bddd9db994cbb19671d45216edf40ffb3a77068cc97fbeb4c4e41e0d073501 -size 180785 diff --git a/Tools/Redistributables/DirectX 9.0c/JUN2006_XACT_x86.cab b/Tools/Redistributables/DirectX 9.0c/JUN2006_XACT_x86.cab deleted file mode 100644 index 1696587f03..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/JUN2006_XACT_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c1a1348611259756b5921d43f9fd9f2a5b40a48af88ea679a40263a2aca029ec -size 133671 diff --git a/Tools/Redistributables/DirectX 9.0c/JUN2007_XACT_x64.cab b/Tools/Redistributables/DirectX 9.0c/JUN2007_XACT_x64.cab deleted file mode 100644 index 285768e9d5..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/JUN2007_XACT_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0e08de538c217d80b19bd56066a269ca9b388e63ff6f3807b369d7b6a7fe794f -size 197122 diff --git a/Tools/Redistributables/DirectX 9.0c/JUN2007_XACT_x86.cab b/Tools/Redistributables/DirectX 9.0c/JUN2007_XACT_x86.cab deleted file mode 100644 index 15fdc248b7..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/JUN2007_XACT_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e28d18ef520ca81ff7d33dad80b6144771cb82516f01739cef8d3b813c74643d -size 152909 diff --git a/Tools/Redistributables/DirectX 9.0c/JUN2007_d3dx10_34_x64.cab b/Tools/Redistributables/DirectX 9.0c/JUN2007_d3dx10_34_x64.cab deleted file mode 100644 index 76478ca29d..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/JUN2007_d3dx10_34_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3ef426fdd89840ead821ee8fe7a6f470ad8bf06dbcf2ac7cc8e8a0dd0a55622d -size 699044 diff --git a/Tools/Redistributables/DirectX 9.0c/JUN2007_d3dx10_34_x86.cab b/Tools/Redistributables/DirectX 9.0c/JUN2007_d3dx10_34_x86.cab deleted file mode 100644 index c5b6b4de8b..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/JUN2007_d3dx10_34_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:47b355fb5324776370e2bd27ca2df982a516611fc1e702d75a829b207b3b80f6 -size 698472 diff --git a/Tools/Redistributables/DirectX 9.0c/JUN2007_d3dx9_34_x64.cab b/Tools/Redistributables/DirectX 9.0c/JUN2007_d3dx9_34_x64.cab deleted file mode 100644 index 4841c81828..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/JUN2007_d3dx9_34_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c28c2018fcc72a9548a752e2917284320fc1a8848ae9d92bf3513aa312cafc29 -size 1607774 diff --git a/Tools/Redistributables/DirectX 9.0c/JUN2007_d3dx9_34_x86.cab b/Tools/Redistributables/DirectX 9.0c/JUN2007_d3dx9_34_x86.cab deleted file mode 100644 index 559505b2c7..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/JUN2007_d3dx9_34_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9c3507b1dd4a81651a5013cb7ecb552932ce5989cbaadd4024f02918f55276ac -size 1607286 diff --git a/Tools/Redistributables/DirectX 9.0c/JUN2008_X3DAudio_x64.cab b/Tools/Redistributables/DirectX 9.0c/JUN2008_X3DAudio_x64.cab deleted file mode 100644 index 6b6be93338..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/JUN2008_X3DAudio_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:627c66ed6f3b82c8a90f549584c324e33f039f397f196ce9eccb86de76efb574 -size 55154 diff --git a/Tools/Redistributables/DirectX 9.0c/JUN2008_X3DAudio_x86.cab b/Tools/Redistributables/DirectX 9.0c/JUN2008_X3DAudio_x86.cab deleted file mode 100644 index b81fafa4fc..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/JUN2008_X3DAudio_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:151d0be9d3fa6ce37f7aa8e047b8cc449e86398ed0623c3cc0e203ec221ebc2a -size 21905 diff --git a/Tools/Redistributables/DirectX 9.0c/JUN2008_XACT_x64.cab b/Tools/Redistributables/DirectX 9.0c/JUN2008_XACT_x64.cab deleted file mode 100644 index 6bd29b50c2..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/JUN2008_XACT_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f0736b0ab6eb8c91682f6934c9d4306fc134c65066f70f7f5f80031a927baa8d -size 121054 diff --git a/Tools/Redistributables/DirectX 9.0c/JUN2008_XACT_x86.cab b/Tools/Redistributables/DirectX 9.0c/JUN2008_XACT_x86.cab deleted file mode 100644 index 1cc499a4cc..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/JUN2008_XACT_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f06de1eef8043f7919a50972df7d0653f9439b725769dae93536dea749b8e2d6 -size 93128 diff --git a/Tools/Redistributables/DirectX 9.0c/JUN2008_XAudio_x64.cab b/Tools/Redistributables/DirectX 9.0c/JUN2008_XAudio_x64.cab deleted file mode 100644 index a4c98b194a..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/JUN2008_XAudio_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9b15a27080204b3c36b787f919cefbf9d441f0b0b616f8b944feb42dc4eb2ff1 -size 269628 diff --git a/Tools/Redistributables/DirectX 9.0c/JUN2008_XAudio_x86.cab b/Tools/Redistributables/DirectX 9.0c/JUN2008_XAudio_x86.cab deleted file mode 100644 index 23ece1c14d..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/JUN2008_XAudio_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:564696443875b094baafb5f4a151c25876ca537c1834356eddb979be0ca247ac -size 269024 diff --git a/Tools/Redistributables/DirectX 9.0c/JUN2008_d3dx10_38_x64.cab b/Tools/Redistributables/DirectX 9.0c/JUN2008_d3dx10_38_x64.cab deleted file mode 100644 index 36e5e9e8f1..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/JUN2008_d3dx10_38_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:781eb9276ea0d737d82dc60753c6d6ff89e92d016b48a60e9b21d1a66b8eb545 -size 867828 diff --git a/Tools/Redistributables/DirectX 9.0c/JUN2008_d3dx10_38_x86.cab b/Tools/Redistributables/DirectX 9.0c/JUN2008_d3dx10_38_x86.cab deleted file mode 100644 index 9291c6bc10..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/JUN2008_d3dx10_38_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b9b4110bd8004f83c0bfcef378071fd49c895294f4583e0b164317a692d9783c -size 849919 diff --git a/Tools/Redistributables/DirectX 9.0c/JUN2008_d3dx9_38_x64.cab b/Tools/Redistributables/DirectX 9.0c/JUN2008_d3dx9_38_x64.cab deleted file mode 100644 index afff0849b2..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/JUN2008_d3dx9_38_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:72e7f92c20462c4746ce000bc909ed6b3f71467f9e5593ba7c074be47553596d -size 1792608 diff --git a/Tools/Redistributables/DirectX 9.0c/JUN2008_d3dx9_38_x86.cab b/Tools/Redistributables/DirectX 9.0c/JUN2008_d3dx9_38_x86.cab deleted file mode 100644 index 4e6c43868b..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/JUN2008_d3dx9_38_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5906932933e363acb1651a6b1f252662fb3512ed54dd6b0b87baa141ed6fb21a -size 1463878 diff --git a/Tools/Redistributables/DirectX 9.0c/Jun2005_d3dx9_26_x64.cab b/Tools/Redistributables/DirectX 9.0c/Jun2005_d3dx9_26_x64.cab deleted file mode 100644 index 35779534f9..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Jun2005_d3dx9_26_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7237630b897ce760948d9144151ef27c0699fb76150b5f157676fa2d220a236f -size 1336002 diff --git a/Tools/Redistributables/DirectX 9.0c/Jun2005_d3dx9_26_x86.cab b/Tools/Redistributables/DirectX 9.0c/Jun2005_d3dx9_26_x86.cab deleted file mode 100644 index e288c09019..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Jun2005_d3dx9_26_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b448d7ba5b6fe1dc27639d42eb6ba0a997a793135678c729ba6756cfe4efc38b -size 1064925 diff --git a/Tools/Redistributables/DirectX 9.0c/Jun2010_D3DCompiler_43_x64.cab b/Tools/Redistributables/DirectX 9.0c/Jun2010_D3DCompiler_43_x64.cab deleted file mode 100644 index e7e8091043..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Jun2010_D3DCompiler_43_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:213ad66ab9e469db1e6a49a646d082bfc3700db94172984e7e36801612af50c6 -size 944460 diff --git a/Tools/Redistributables/DirectX 9.0c/Jun2010_D3DCompiler_43_x86.cab b/Tools/Redistributables/DirectX 9.0c/Jun2010_D3DCompiler_43_x86.cab deleted file mode 100644 index afafdce4a8..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Jun2010_D3DCompiler_43_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:417eebd5b19f45c67c94c2d2ba8b774c0fc6d958b896d7b1ac12cf5a0ea06e0e -size 931471 diff --git a/Tools/Redistributables/DirectX 9.0c/Jun2010_XACT_x64.cab b/Tools/Redistributables/DirectX 9.0c/Jun2010_XACT_x64.cab deleted file mode 100644 index defb70d9ea..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Jun2010_XACT_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:06251ab76450feb7dc2ffb9be7615f5eb56960cefa4c990ef560f2c6f2a7551b -size 124596 diff --git a/Tools/Redistributables/DirectX 9.0c/Jun2010_XACT_x86.cab b/Tools/Redistributables/DirectX 9.0c/Jun2010_XACT_x86.cab deleted file mode 100644 index fd808be92b..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Jun2010_XACT_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:354c2e579ed00b391dd5d8be91b0f45115e7c232ed1b842747830be0fd26e915 -size 93686 diff --git a/Tools/Redistributables/DirectX 9.0c/Jun2010_XAudio_x64.cab b/Tools/Redistributables/DirectX 9.0c/Jun2010_XAudio_x64.cab deleted file mode 100644 index 75c30772ce..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Jun2010_XAudio_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:51500283f69e97f5beddb073ba2a9017de3d30379c0dcc4d11dd2236ce07b317 -size 277338 diff --git a/Tools/Redistributables/DirectX 9.0c/Jun2010_XAudio_x86.cab b/Tools/Redistributables/DirectX 9.0c/Jun2010_XAudio_x86.cab deleted file mode 100644 index aaa354134a..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Jun2010_XAudio_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7b4332207563beba1103744b6db5399ad150e9e6838f9d5a71497e7eb3645ebf -size 278060 diff --git a/Tools/Redistributables/DirectX 9.0c/Jun2010_d3dcsx_43_x64.cab b/Tools/Redistributables/DirectX 9.0c/Jun2010_d3dcsx_43_x64.cab deleted file mode 100644 index 9f0efcb902..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Jun2010_d3dcsx_43_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:cdbec7e3a5a0fef016eb294b036f93c75e45c6ead8d99397f859a32d23fe20cc -size 752783 diff --git a/Tools/Redistributables/DirectX 9.0c/Jun2010_d3dcsx_43_x86.cab b/Tools/Redistributables/DirectX 9.0c/Jun2010_d3dcsx_43_x86.cab deleted file mode 100644 index 47362daceb..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Jun2010_d3dcsx_43_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e2c5a2cbba7f211b6ca72ff8e5f69cba1f83be06357311b19e64f582fd3d14e4 -size 762188 diff --git a/Tools/Redistributables/DirectX 9.0c/Jun2010_d3dx10_43_x64.cab b/Tools/Redistributables/DirectX 9.0c/Jun2010_d3dx10_43_x64.cab deleted file mode 100644 index 1de2c119c0..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Jun2010_d3dx10_43_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:efce48d425c07f1faad4a55d7061a01ed6245aac17f43163cf2a23cbc9a3054b -size 235955 diff --git a/Tools/Redistributables/DirectX 9.0c/Jun2010_d3dx10_43_x86.cab b/Tools/Redistributables/DirectX 9.0c/Jun2010_d3dx10_43_x86.cab deleted file mode 100644 index e008cfcb55..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Jun2010_d3dx10_43_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a8cf71ffb80b683616d0621be96d3795b0ffda3877ed2d80cd958bfa393ddcfc -size 197283 diff --git a/Tools/Redistributables/DirectX 9.0c/Jun2010_d3dx11_43_x64.cab b/Tools/Redistributables/DirectX 9.0c/Jun2010_d3dx11_43_x64.cab deleted file mode 100644 index 752bbfce78..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Jun2010_d3dx11_43_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c1d0d56b83bfb09a5e1a89e1898bb74446a847b30a968f3664ec2d87368eb63e -size 138205 diff --git a/Tools/Redistributables/DirectX 9.0c/Jun2010_d3dx11_43_x86.cab b/Tools/Redistributables/DirectX 9.0c/Jun2010_d3dx11_43_x86.cab deleted file mode 100644 index 6d806e2f63..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Jun2010_d3dx11_43_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a58cefe822e371d078eaf89319f832693352ba7d62079320074397f0f3425961 -size 109445 diff --git a/Tools/Redistributables/DirectX 9.0c/Jun2010_d3dx9_43_x64.cab b/Tools/Redistributables/DirectX 9.0c/Jun2010_d3dx9_43_x64.cab deleted file mode 100644 index 996b0a7111..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Jun2010_d3dx9_43_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9b98a1269af7f3a0007bfdc73206a47a6ee158d34ba8a87009396c18186bb06a -size 937246 diff --git a/Tools/Redistributables/DirectX 9.0c/Jun2010_d3dx9_43_x86.cab b/Tools/Redistributables/DirectX 9.0c/Jun2010_d3dx9_43_x86.cab deleted file mode 100644 index d4b5470696..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Jun2010_d3dx9_43_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:fcc6cf0966b4853d6fa3d32ab299cde5a9824feaecb0d4f34ea452fb9fd1c867 -size 768036 diff --git a/Tools/Redistributables/DirectX 9.0c/Mar2008_X3DAudio_x64.cab b/Tools/Redistributables/DirectX 9.0c/Mar2008_X3DAudio_x64.cab deleted file mode 100644 index da8df8c0e5..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Mar2008_X3DAudio_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b0209ae7c140b3b3a7635a00d7364591d6b3d017d6bb007f9e347767b00b1671 -size 55058 diff --git a/Tools/Redistributables/DirectX 9.0c/Mar2008_X3DAudio_x86.cab b/Tools/Redistributables/DirectX 9.0c/Mar2008_X3DAudio_x86.cab deleted file mode 100644 index 4afa8817e6..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Mar2008_X3DAudio_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:15e0dcefc22fb6a09e3d8724fa5c17c23db01f10879f343e7da22938f568abd7 -size 21867 diff --git a/Tools/Redistributables/DirectX 9.0c/Mar2008_XACT_x64.cab b/Tools/Redistributables/DirectX 9.0c/Mar2008_XACT_x64.cab deleted file mode 100644 index 279af93cfc..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Mar2008_XACT_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:221a6a70898c8d513fac732dfa0ada137b268cffc90875c05d1049ba8f2e3e5b -size 122336 diff --git a/Tools/Redistributables/DirectX 9.0c/Mar2008_XACT_x86.cab b/Tools/Redistributables/DirectX 9.0c/Mar2008_XACT_x86.cab deleted file mode 100644 index 479e121922..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Mar2008_XACT_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d1a429a0725765a5b302b83af062d2780859f0a52369b200d1b031e14f030ea0 -size 93734 diff --git a/Tools/Redistributables/DirectX 9.0c/Mar2008_XAudio_x64.cab b/Tools/Redistributables/DirectX 9.0c/Mar2008_XAudio_x64.cab deleted file mode 100644 index 95cac597f2..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Mar2008_XAudio_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:35d20903b1b246afda8c5205bfa3b253fbad5d3255ce14b5a8d5aaa6b6909dbc -size 251194 diff --git a/Tools/Redistributables/DirectX 9.0c/Mar2008_XAudio_x86.cab b/Tools/Redistributables/DirectX 9.0c/Mar2008_XAudio_x86.cab deleted file mode 100644 index a4bfd9cb63..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Mar2008_XAudio_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:786e6417d105b1dedcb502a799d7cd30a65cbe59a2b41a411781bdafa7fb1917 -size 226250 diff --git a/Tools/Redistributables/DirectX 9.0c/Mar2008_d3dx10_37_x64.cab b/Tools/Redistributables/DirectX 9.0c/Mar2008_d3dx10_37_x64.cab deleted file mode 100644 index e4fe991eca..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Mar2008_d3dx10_37_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9eaba54ab5392802bee889982c585707797ae7810c1e7a66f98903fc963a9eab -size 844884 diff --git a/Tools/Redistributables/DirectX 9.0c/Mar2008_d3dx10_37_x86.cab b/Tools/Redistributables/DirectX 9.0c/Mar2008_d3dx10_37_x86.cab deleted file mode 100644 index 43386c0b1c..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Mar2008_d3dx10_37_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:de438d52b5f1141be26f7d06f283699d96827129da524a412e1605bd9c8e6b6a -size 818260 diff --git a/Tools/Redistributables/DirectX 9.0c/Mar2008_d3dx9_37_x64.cab b/Tools/Redistributables/DirectX 9.0c/Mar2008_d3dx9_37_x64.cab deleted file mode 100644 index cc77082f70..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Mar2008_d3dx9_37_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:33ed3e21fe9118bad3e11ee13a3f0b31c52ae7e22378ebf96de590b114c2ca02 -size 1769862 diff --git a/Tools/Redistributables/DirectX 9.0c/Mar2008_d3dx9_37_x86.cab b/Tools/Redistributables/DirectX 9.0c/Mar2008_d3dx9_37_x86.cab deleted file mode 100644 index 25c9afacd7..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Mar2008_d3dx9_37_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0be4fe173c7becbab42a25421f28d54629479e240a3378b37ac4b657bf60e128 -size 1443282 diff --git a/Tools/Redistributables/DirectX 9.0c/Mar2009_X3DAudio_x64.cab b/Tools/Redistributables/DirectX 9.0c/Mar2009_X3DAudio_x64.cab deleted file mode 100644 index 6be88e5590..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Mar2009_X3DAudio_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5fcb6f2d1dbf278c14813812448026a8d2bf2179bb4c2e807b9167fdb7966290 -size 54600 diff --git a/Tools/Redistributables/DirectX 9.0c/Mar2009_X3DAudio_x86.cab b/Tools/Redistributables/DirectX 9.0c/Mar2009_X3DAudio_x86.cab deleted file mode 100644 index 1d24996c1c..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Mar2009_X3DAudio_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:fd713dc9d50cb72508f0c416f6861588f1227bb9f2e1a40a6f0e774be248bb8d -size 21298 diff --git a/Tools/Redistributables/DirectX 9.0c/Mar2009_XACT_x64.cab b/Tools/Redistributables/DirectX 9.0c/Mar2009_XACT_x64.cab deleted file mode 100644 index 88492dfdd1..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Mar2009_XACT_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:63721ba32053e4f2b0905aab8e68fe63eadaae53543be89b2d5f082b10edf6a2 -size 121506 diff --git a/Tools/Redistributables/DirectX 9.0c/Mar2009_XACT_x86.cab b/Tools/Redistributables/DirectX 9.0c/Mar2009_XACT_x86.cab deleted file mode 100644 index 3cbdc6e86c..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Mar2009_XACT_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ba7f2b4e34c355dae4ca2aeae585985f2626c69e4cf857b9db009d50a23b620c -size 92740 diff --git a/Tools/Redistributables/DirectX 9.0c/Mar2009_XAudio_x64.cab b/Tools/Redistributables/DirectX 9.0c/Mar2009_XAudio_x64.cab deleted file mode 100644 index dd342cb861..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Mar2009_XAudio_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e470186155459daf0674a30450a4887f941ca7dbdf9aa311fc4d4c87352529ba -size 275044 diff --git a/Tools/Redistributables/DirectX 9.0c/Mar2009_XAudio_x86.cab b/Tools/Redistributables/DirectX 9.0c/Mar2009_XAudio_x86.cab deleted file mode 100644 index b85f698b26..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Mar2009_XAudio_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7c360b93d3e799d3502f0b6acf4139c058d7d47e63d41f4af0f2bff59b4742b2 -size 273018 diff --git a/Tools/Redistributables/DirectX 9.0c/Mar2009_d3dx10_41_x64.cab b/Tools/Redistributables/DirectX 9.0c/Mar2009_d3dx10_41_x64.cab deleted file mode 100644 index 74849d4c94..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Mar2009_d3dx10_41_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4e78a01a3a5d236f27cda4a66a9d8a59c06e8a9779fd2f2a3e1f9b416d2c4213 -size 1067160 diff --git a/Tools/Redistributables/DirectX 9.0c/Mar2009_d3dx10_41_x86.cab b/Tools/Redistributables/DirectX 9.0c/Mar2009_d3dx10_41_x86.cab deleted file mode 100644 index 23220b1467..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Mar2009_d3dx10_41_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:80736b3fe97947507a32bf7cd744e01a86424c4cc9977f7b4a7404268e83f8c1 -size 1040745 diff --git a/Tools/Redistributables/DirectX 9.0c/Mar2009_d3dx9_41_x64.cab b/Tools/Redistributables/DirectX 9.0c/Mar2009_d3dx9_41_x64.cab deleted file mode 100644 index c3a5196d64..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Mar2009_d3dx9_41_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:218929568334f78c93d3a111ad268ff56ed4a6fee83ce26dce0a2619a092f46b -size 1973702 diff --git a/Tools/Redistributables/DirectX 9.0c/Mar2009_d3dx9_41_x86.cab b/Tools/Redistributables/DirectX 9.0c/Mar2009_d3dx9_41_x86.cab deleted file mode 100644 index 7fe08e22a5..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Mar2009_d3dx9_41_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:74ff3ac77380b3a7271f22b21e019c50f6caa8585f0b59cca094e76ce170a28b -size 1612446 diff --git a/Tools/Redistributables/DirectX 9.0c/NOV2007_X3DAudio_x64.cab b/Tools/Redistributables/DirectX 9.0c/NOV2007_X3DAudio_x64.cab deleted file mode 100644 index 713f52616e..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/NOV2007_X3DAudio_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f954abaf7966b409d3db339f5dc491e103365f47b23faffca25d85ea3728f12f -size 46144 diff --git a/Tools/Redistributables/DirectX 9.0c/NOV2007_X3DAudio_x86.cab b/Tools/Redistributables/DirectX 9.0c/NOV2007_X3DAudio_x86.cab deleted file mode 100644 index d5c24ad5e2..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/NOV2007_X3DAudio_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:74a6d31a4c54d8c0fb2dcde922409c05db3219b7dcffa44c16f603ba054fb922 -size 18496 diff --git a/Tools/Redistributables/DirectX 9.0c/NOV2007_XACT_x64.cab b/Tools/Redistributables/DirectX 9.0c/NOV2007_XACT_x64.cab deleted file mode 100644 index 8d667fd54c..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/NOV2007_XACT_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d01b468ec66b36bea0e20503c01b93ac64d9e001c20d28cf7c71293e9f874af0 -size 196762 diff --git a/Tools/Redistributables/DirectX 9.0c/NOV2007_XACT_x86.cab b/Tools/Redistributables/DirectX 9.0c/NOV2007_XACT_x86.cab deleted file mode 100644 index 2d0c090be4..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/NOV2007_XACT_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c888a8a79249ab284a918c371f2fe6da81fdf432e65d3da3cd24fecede267aed -size 148264 diff --git a/Tools/Redistributables/DirectX 9.0c/Nov2007_d3dx10_36_x64.cab b/Tools/Redistributables/DirectX 9.0c/Nov2007_d3dx10_36_x64.cab deleted file mode 100644 index 340df57b33..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Nov2007_d3dx10_36_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0847e4034d70ccbea527e04d14d8d60c9854ecc89cb29b3e07139e65962fbce9 -size 864600 diff --git a/Tools/Redistributables/DirectX 9.0c/Nov2007_d3dx10_36_x86.cab b/Tools/Redistributables/DirectX 9.0c/Nov2007_d3dx10_36_x86.cab deleted file mode 100644 index ca8858d6c8..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Nov2007_d3dx10_36_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0da883c82456a5340411f222af5891fd370bf7efd919e90a48aec0f67f01ec80 -size 803884 diff --git a/Tools/Redistributables/DirectX 9.0c/Nov2007_d3dx9_36_x64.cab b/Tools/Redistributables/DirectX 9.0c/Nov2007_d3dx9_36_x64.cab deleted file mode 100644 index 54449d25c6..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Nov2007_d3dx9_36_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:39afab1a89bcf46806b422837da35ddc1b8eedf0393d875a89b47cde5fed79d4 -size 1802058 diff --git a/Tools/Redistributables/DirectX 9.0c/Nov2007_d3dx9_36_x86.cab b/Tools/Redistributables/DirectX 9.0c/Nov2007_d3dx9_36_x86.cab deleted file mode 100644 index 00309abc21..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Nov2007_d3dx9_36_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:89026e7e14fff8164de3c13a774d539e789637104d7bc84b8bb4e059b76a9679 -size 1709360 diff --git a/Tools/Redistributables/DirectX 9.0c/Nov2008_X3DAudio_x64.cab b/Tools/Redistributables/DirectX 9.0c/Nov2008_X3DAudio_x64.cab deleted file mode 100644 index e537dc31ea..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Nov2008_X3DAudio_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8de7aedf7f823e455c663cec42b158f6d5308efd356a9cf9295ae49f7c8a3fdb -size 54522 diff --git a/Tools/Redistributables/DirectX 9.0c/Nov2008_X3DAudio_x86.cab b/Tools/Redistributables/DirectX 9.0c/Nov2008_X3DAudio_x86.cab deleted file mode 100644 index 7125770d80..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Nov2008_X3DAudio_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f2264f092313682f4e274ad71030248fa2e23d202abc2d46ab09c7d6b580b81b -size 21851 diff --git a/Tools/Redistributables/DirectX 9.0c/Nov2008_XACT_x64.cab b/Tools/Redistributables/DirectX 9.0c/Nov2008_XACT_x64.cab deleted file mode 100644 index de505dcbda..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Nov2008_XACT_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9dda7b01517451b9ca53abc3a4e61277481c4e8a6404d15450b5a416416b8016 -size 121794 diff --git a/Tools/Redistributables/DirectX 9.0c/Nov2008_XACT_x86.cab b/Tools/Redistributables/DirectX 9.0c/Nov2008_XACT_x86.cab deleted file mode 100644 index 3eed967dba..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Nov2008_XACT_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7b5594c1146a7753e8aeb0d235a060360b3072ba7b0fa122536d85b42df73a2e -size 92684 diff --git a/Tools/Redistributables/DirectX 9.0c/Nov2008_XAudio_x64.cab b/Tools/Redistributables/DirectX 9.0c/Nov2008_XAudio_x64.cab deleted file mode 100644 index 81d46c7221..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Nov2008_XAudio_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:980e6bb91d20d90225405887ebec47a7b1deee21faab4c561faae323007f6c98 -size 273960 diff --git a/Tools/Redistributables/DirectX 9.0c/Nov2008_XAudio_x86.cab b/Tools/Redistributables/DirectX 9.0c/Nov2008_XAudio_x86.cab deleted file mode 100644 index ba56b5d3d7..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Nov2008_XAudio_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:00c28cd39034f7e1d434adc0bd39e4be29eabe8b73a2f3eaca6de11d2d22be95 -size 272611 diff --git a/Tools/Redistributables/DirectX 9.0c/Nov2008_d3dx10_40_x64.cab b/Tools/Redistributables/DirectX 9.0c/Nov2008_d3dx10_40_x64.cab deleted file mode 100644 index 6cb407859f..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Nov2008_d3dx10_40_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a318a71b953f87ef0f5fad91a153f7ee251c8f895581950022f38f63d5f66cba -size 994154 diff --git a/Tools/Redistributables/DirectX 9.0c/Nov2008_d3dx10_40_x86.cab b/Tools/Redistributables/DirectX 9.0c/Nov2008_d3dx10_40_x86.cab deleted file mode 100644 index c900f04c6d..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Nov2008_d3dx10_40_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4d7805c3db9fe72978fdd4c0c8ff973eed07ca6619d1c988cd01e08b70e1d137 -size 965421 diff --git a/Tools/Redistributables/DirectX 9.0c/Nov2008_d3dx9_40_x64.cab b/Tools/Redistributables/DirectX 9.0c/Nov2008_d3dx9_40_x64.cab deleted file mode 100644 index fc8f2d9201..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Nov2008_d3dx9_40_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:723e8fcfe969493e6c4f79d2634c052eed9cd1e7051cfbf4466643b964fea29c -size 1906878 diff --git a/Tools/Redistributables/DirectX 9.0c/Nov2008_d3dx9_40_x86.cab b/Tools/Redistributables/DirectX 9.0c/Nov2008_d3dx9_40_x86.cab deleted file mode 100644 index 541f1472e7..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Nov2008_d3dx9_40_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a259dd75611610bc0fd9c874e68ec89bbae4ac5f8db0857705a35de616604641 -size 1550796 diff --git a/Tools/Redistributables/DirectX 9.0c/OCT2006_XACT_x64.cab b/Tools/Redistributables/DirectX 9.0c/OCT2006_XACT_x64.cab deleted file mode 100644 index 33ff18117e..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/OCT2006_XACT_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:db037f2b07f00a7aa481b12ed35d52e3b7c18bb786590eb444b27cf69a675f0f -size 182361 diff --git a/Tools/Redistributables/DirectX 9.0c/OCT2006_XACT_x86.cab b/Tools/Redistributables/DirectX 9.0c/OCT2006_XACT_x86.cab deleted file mode 100644 index 8ab0e813f0..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/OCT2006_XACT_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:65916ca9db2d3eeb6a44f19a19c4254ca4fc1795bad81fda35e028d9b62e1d3d -size 138017 diff --git a/Tools/Redistributables/DirectX 9.0c/OCT2006_d3dx9_31_x64.cab b/Tools/Redistributables/DirectX 9.0c/OCT2006_d3dx9_31_x64.cab deleted file mode 100644 index ab691eea62..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/OCT2006_d3dx9_31_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3cf78eeedcddddaf131af35cc68c218685c133326ff2876cb821096ed7ebf0c8 -size 1412902 diff --git a/Tools/Redistributables/DirectX 9.0c/OCT2006_d3dx9_31_x86.cab b/Tools/Redistributables/DirectX 9.0c/OCT2006_d3dx9_31_x86.cab deleted file mode 100644 index acfb6f9c91..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/OCT2006_d3dx9_31_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:fd8c9c23aea007aa92eca130446913ef04d9fc78e0e6fc3c49c25d210889de61 -size 1127217 diff --git a/Tools/Redistributables/DirectX 9.0c/Oct2005_xinput_x64.cab b/Tools/Redistributables/DirectX 9.0c/Oct2005_xinput_x64.cab deleted file mode 100644 index 8baa374c45..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Oct2005_xinput_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:10f2bcfcc38d3150bc80eb0030a1cd40084f1ec028dc927543c485d54ec35022 -size 86037 diff --git a/Tools/Redistributables/DirectX 9.0c/Oct2005_xinput_x86.cab b/Tools/Redistributables/DirectX 9.0c/Oct2005_xinput_x86.cab deleted file mode 100644 index bb91ccaa94..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Oct2005_xinput_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f2d475864e34409fb586093f92390e1f47403867c39ac30918941f19f3fccb0f -size 45359 diff --git a/Tools/Redistributables/DirectX 9.0c/dsetup32.dll b/Tools/Redistributables/DirectX 9.0c/dsetup32.dll deleted file mode 100644 index 7fd6d69402..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/dsetup32.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:fb0e534f9b0926e518f1c2980640dfd29f14217cdfa37cf3a0c13349127ed9a8 -size 1566040 diff --git a/Tools/Redistributables/DirectX 9.0c/dxdllreg_x86.cab b/Tools/Redistributables/DirectX 9.0c/dxdllreg_x86.cab deleted file mode 100644 index 1a3f8d434c..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/dxdllreg_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4afe0249a13868b7c4a92b4d53c998adf6053eb5e2c47fd81020fd8d4bb11150 -size 44624 diff --git a/Tools/Redistributables/DirectX 9.0c/dxupdate.cab b/Tools/Redistributables/DirectX 9.0c/dxupdate.cab deleted file mode 100644 index b4be511234..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/dxupdate.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e18a5404b612e88fa8b403c9b33f064c0a89528db7ef9a79aa116908d0e6afed -size 97152 diff --git a/Tools/Redistributables/FFMpeg/win32/ffmpeg.exe b/Tools/Redistributables/FFMpeg/win32/ffmpeg.exe deleted file mode 100644 index 8a0d6de867..0000000000 --- a/Tools/Redistributables/FFMpeg/win32/ffmpeg.exe +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:178e2503062d15f3171953a39594854c31654f22c046faf019b77ff0a92302e3 -size 32841216 diff --git a/Tools/Redistributables/LuaCompiler/win32/LuaCompiler.exe b/Tools/Redistributables/LuaCompiler/win32/LuaCompiler.exe deleted file mode 100644 index d46fc8f5f8..0000000000 --- a/Tools/Redistributables/LuaCompiler/win32/LuaCompiler.exe +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:22b2527a7fd8e6ce35e54e8a1af7a86ce1036819db6764579f8840414ebd12e0 -size 315392 diff --git a/Tools/Redistributables/MSVC90/Microsoft.VC90.CRT.manifest b/Tools/Redistributables/MSVC90/Microsoft.VC90.CRT.manifest deleted file mode 100644 index 6e4241c925..0000000000 --- a/Tools/Redistributables/MSVC90/Microsoft.VC90.CRT.manifest +++ /dev/null @@ -1,6 +0,0 @@ - - - - - BYWvegEUfCyiVJwy7tplZYDLDYQ= VVIEvvi79NP3Y8CQaV7j2x7YotU= nS1i+ikFcD/ifqiOGZFwsZG9X/A= - \ No newline at end of file diff --git a/Tools/Redistributables/MSVC90/msvcr90.dll b/Tools/Redistributables/MSVC90/msvcr90.dll deleted file mode 100644 index c42cd731d8..0000000000 --- a/Tools/Redistributables/MSVC90/msvcr90.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5330682ae9c08e5f2e30c5e256b91028389bbbddaa8c38950df76616fca854ff -size 641360 diff --git a/Tools/Redistributables/OpenGL32/opengl32sw.dll b/Tools/Redistributables/OpenGL32/opengl32sw.dll deleted file mode 100644 index 05af1c04b7..0000000000 --- a/Tools/Redistributables/OpenGL32/opengl32sw.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c9531e42f5e5e16901c669b2a0ba6ed70ff07fa3ae473b2b0128f907d89f981e -size 17593856 diff --git a/Tools/Redistributables/SSLEAY/win32/libeay32.dll b/Tools/Redistributables/SSLEAY/win32/libeay32.dll deleted file mode 100644 index 17a31bb4d4..0000000000 --- a/Tools/Redistributables/SSLEAY/win32/libeay32.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:40b9eda31bdbb74f8e3007da61846516a64cfdbf45afd9f1b30b725e92ac82f2 -size 2087424 diff --git a/Tools/Redistributables/SSLEAY/win32/ssleay32.dll b/Tools/Redistributables/SSLEAY/win32/ssleay32.dll deleted file mode 100644 index 6a0f2895e2..0000000000 --- a/Tools/Redistributables/SSLEAY/win32/ssleay32.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:bc92d16d24ca27c0ca7c5bcd486f7f440ccb07ebde69206135edb58654bf6481 -size 350208 diff --git a/Tools/Redistributables/Visual Studio 2012/vcredist_x64.exe b/Tools/Redistributables/Visual Studio 2012/vcredist_x64.exe deleted file mode 100644 index b404397acc..0000000000 --- a/Tools/Redistributables/Visual Studio 2012/vcredist_x64.exe +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:681be3e5ba9fd3da02c09d7e565adfa078640ed66a0d58583efad2c1e3cc4064 -size 7186992 diff --git a/Tools/Redistributables/Visual Studio 2015-2019/VC_redist.x64.exe b/Tools/Redistributables/Visual Studio 2015-2019/VC_redist.x64.exe deleted file mode 100644 index 9040223c94..0000000000 --- a/Tools/Redistributables/Visual Studio 2015-2019/VC_redist.x64.exe +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:40ea2955391c9eae3e35619c4c24b5aaf3d17aeaa6d09424ee9672aa9372aeed -size 15060496 diff --git a/Tools/Redistributables/vc_mbcsmfc.exe b/Tools/Redistributables/vc_mbcsmfc.exe deleted file mode 100644 index 52b9d880ee..0000000000 --- a/Tools/Redistributables/vc_mbcsmfc.exe +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:184a8fdf7e8989aa3440b93b7b26da868c00544beb051c268a26eca505767757 -size 67453208 diff --git a/cmake/3rdParty/Platform/Android/BuiltInPackages_android.cmake b/cmake/3rdParty/Platform/Android/BuiltInPackages_android.cmake index 1f3d67a034..5224eb4a4b 100644 --- a/cmake/3rdParty/Platform/Android/BuiltInPackages_android.cmake +++ b/cmake/3rdParty/Platform/Android/BuiltInPackages_android.cmake @@ -19,7 +19,7 @@ ly_associate_package(PACKAGE_NAME lux_core-2.2-rev5-multiplatform TARGETS lux # platform-specific: ly_associate_package(PACKAGE_NAME freetype-2.10.4.14-android TARGETS freetype PACKAGE_HASH 74dd75382688323c3a2a5090f473840b5d7e9d2aed1a4fcdff05ed2a09a664f2) ly_associate_package(PACKAGE_NAME tiff-4.2.0.14-android TARGETS tiff PACKAGE_HASH a9b30a1980946390c2fad0ed94562476a1d7ba8c1f36934ae140a89c54a8efd0) -ly_associate_package(PACKAGE_NAME AWSNativeSDK-1.7.167-rev4-android TARGETS AWSNativeSDK PACKAGE_HASH 9d163696591a836881fc22dac3c94e57b0278771b6c6cec807ff6a5e96f2669d) +ly_associate_package(PACKAGE_NAME AWSNativeSDK-1.7.167-rev6-android TARGETS AWSNativeSDK PACKAGE_HASH 1624ba9aaf03d001ed0ffc57d2f945ff82590e75a7ea868de35043cf673e82fb) ly_associate_package(PACKAGE_NAME Lua-5.3.5-rev5-android TARGETS Lua PACKAGE_HASH 1f638e94a17a87fe9e588ea456d5893876094b4db191234380e4c4eb9e06c300) ly_associate_package(PACKAGE_NAME PhysX-4.1.2.29882248-rev3-android TARGETS PhysX PACKAGE_HASH b8cb6aa46b2a21671f6cb1f6a78713a3ba88824d0447560ff5ce6c01014b9f43) ly_associate_package(PACKAGE_NAME mikkelsen-1.0.0.4-android TARGETS mikkelsen PACKAGE_HASH 075e8e4940884971063b5a9963014e2e517246fa269c07c7dc55b8cf2cd99705) diff --git a/cmake/3rdPartyPackages.cmake b/cmake/3rdPartyPackages.cmake index c13eecbee4..9a632798e8 100644 --- a/cmake/3rdPartyPackages.cmake +++ b/cmake/3rdPartyPackages.cmake @@ -28,7 +28,7 @@ include(cmake/LySet.cmake) # also allowed: # "s3://bucketname" (it will use LYPackage_S3Downloader.cmake to download it from a s3 bucket) -set(LY_PACKAGE_SERVER_URLS "http://d3t6xeg4fgfoum.cloudfront.net" CACHE STRING "Server URLS to fetch packages from") +set(LY_PACKAGE_SERVER_URLS "https://d3t6xeg4fgfoum.cloudfront.net" CACHE STRING "Server URLS to fetch packages from") # Note: if you define the "LY_PACKAGE_SERVER_URLS" environment variable # it will be added to this value in the front, so that users can set # an env var and use that as an "additional" set of servers beyond the default set. diff --git a/cmake/Gems.cmake b/cmake/Gems.cmake index 634e09f596..b120c28db3 100644 --- a/cmake/Gems.cmake +++ b/cmake/Gems.cmake @@ -31,25 +31,29 @@ function(ly_create_alias) "Make sure the target wasn't copy and pasted here or elsewhere.") endif() - # easy version - if its juts one target, we can directly get the target, and make both aliases, + # easy version - if its just one target and it exist at the time of this call, + # we can directly get the target, and make both aliases, # the namespaced and non namespaced one, point at it. list(LENGTH ly_create_alias_TARGETS number_of_targets) if (number_of_targets EQUAL 1) - ly_de_alias_target(${ly_create_alias_TARGETS} de_aliased_target_name) - add_library(${ly_create_alias_NAMESPACE}::${ly_create_alias_NAME} ALIAS ${de_aliased_target_name}) - if (NOT TARGET ${ly_create_alias_NAME}) - add_library(${ly_create_alias_NAME} ALIAS ${de_aliased_target_name}) + if(TARGET ${ly_create_alias_TARGETS}) + ly_de_alias_target(${ly_create_alias_TARGETS} de_aliased_target_name) + add_library(${ly_create_alias_NAMESPACE}::${ly_create_alias_NAME} ALIAS ${de_aliased_target_name}) + if (NOT TARGET ${ly_create_alias_NAME}) + add_library(${ly_create_alias_NAME} ALIAS ${de_aliased_target_name}) + endif() + # Store off the arguments needed used ly_create_alias into a DIRECTORY property + # This will be used to re-create the calls in the generated CMakeLists.txt in the INSTALL step + string(REPLACE ";" " " create_alias_args "${ly_create_alias_NAME},${ly_create_alias_NAMESPACE},${ly_create_alias_TARGETS}") + set_property(DIRECTORY APPEND PROPERTY LY_CREATE_ALIAS_ARGUMENTS "${ly_create_alias_NAME},${ly_create_alias_NAMESPACE},${ly_create_alias_TARGETS}") + return() endif() - # Store off the arguments needed used ly_create_alias into a DIRECTORY property - # This will be used to re-create the calls in the generated CMakeLists.txt in the INSTALL step - string(REPLACE ";" " " create_alias_args "${ly_create_alias_NAME},${ly_create_alias_NAMESPACE},${ly_create_alias_TARGETS}") - set_property(DIRECTORY APPEND PROPERTY LY_CREATE_ALIAS_ARGUMENTS "${ly_create_alias_NAME},${ly_create_alias_NAMESPACE},${ly_create_alias_TARGETS}") - return() endif() - # more complex version - one alias to multiple targets. To actually achieve this - # we have to create an interface library with those dependencies, then we have to create an alias to that target. - # by convention we create one without a namespace then alias the namespaced one. + # more complex version - one alias to multiple targets or the alias is being made to a TARGET that doesn't exist yet. + # To actually achieve this we have to create an interface library with those dependencies, + # then we have to create an alias to that target. + # By convention we create one without a namespace then alias the namespaced one. if(TARGET ${ly_create_alias_NAME}) message(FATAL_ERROR "Internal alias target already exists, cannot create an alias for it: ${ly_create_alias_NAME}\n" diff --git a/scripts/o3de/o3de/manifest.py b/scripts/o3de/o3de/manifest.py index c4a7cf8f36..3d78c990a2 100644 --- a/scripts/o3de/o3de/manifest.py +++ b/scripts/o3de/o3de/manifest.py @@ -212,6 +212,28 @@ def save_o3de_manifest(json_data: dict, manifest_path: pathlib.Path = None) -> b return False + +def get_gems_from_subdirectories(external_subdirs: list) -> list: + ''' + Helper Method for scanning a set of external subdirectories for gem.json files + ''' + def is_gem_subdirectory(subdir_files): + for name in files: + if name == 'gem.json': + return True + return False + + gem_directories = [] + # Locate all subfolders with gem.json files within them + if external_subdirs: + for subdirectory in external_subdirs: + for root, dirs, files in os.walk(pathlib.Path(subdirectory).resolve()): + if is_gem_subdirectory(files): + gem_directories.append(pathlib.PurePath(root).as_posix()) + + return gem_directories + + # Data query methods def get_this_engine() -> dict: json_data = load_o3de_manifest() @@ -230,11 +252,7 @@ def get_projects() -> list: def get_gems() -> list: - def is_gem_subdirectory(subdir): - return (pathlib.Path(subdir) / 'gem.json').exists() - - external_subdirs = get_external_subdirectories() - return list(filter(is_gem_subdirectory, external_subdirs)) if external_subdirs else [] + return get_gems_from_subdirectories(get_external_subdirectories()) def get_external_subdirectories() -> list: @@ -265,11 +283,7 @@ def get_engine_projects() -> list: def get_engine_gems() -> list: - def is_gem_subdirectory(subdir): - return (pathlib.Path(subdir) / 'gem.json').exists() - - external_subdirs = get_engine_external_subdirectories() - return list(filter(is_gem_subdirectory, external_subdirs)) if external_subdirs else [] + return get_gems_from_subdirectories(get_engine_external_subdirectories()) def get_engine_external_subdirectories() -> list: @@ -295,11 +309,7 @@ def get_engine_restricted() -> list: # project.json queries def get_project_gems(project_path: pathlib.Path) -> list: - def is_gem_subdirectory(subdir): - return (pathlib.Path(subdir) / 'gem.json').exists() - - external_subdirs = get_project_external_subdirectories(project_path) - return list(filter(is_gem_subdirectory, external_subdirs)) if external_subdirs else [] + return get_gems_from_subdirectories(get_project_external_subdirectories(project_path)) def get_project_external_subdirectories(project_path: pathlib.Path) -> list: diff --git a/scripts/o3de/o3de/register.py b/scripts/o3de/o3de/register.py index 40556205de..ff4ccdc0a6 100644 --- a/scripts/o3de/o3de/register.py +++ b/scripts/o3de/o3de/register.py @@ -404,26 +404,27 @@ def register_project_path(json_data: dict, if result != 0: return result - # registering a project has the additional step of setting the project.json 'engine' field - this_engine_json = manifest.get_engine_json_data(engine_path=manifest.get_this_engine_path()) - if not this_engine_json: - return 1 - project_json_data = manifest.get_project_json_data(project_path=project_path) - if not project_json_data: - return 1 - - update_project_json = False - try: - update_project_json = project_json_data['engine'] != this_engine_json['engine_name'] - except KeyError as e: - update_project_json = True - - if update_project_json: - project_json_path = project_path / 'project.json' - project_json_data['engine'] = this_engine_json['engine_name'] - utils.backup_file(project_json_path) - if not manifest.save_o3de_manifest(project_json_data, project_json_path): + if not remove: + # registering a project has the additional step of setting the project.json 'engine' field + this_engine_json = manifest.get_engine_json_data(engine_path=manifest.get_this_engine_path()) + if not this_engine_json: return 1 + project_json_data = manifest.get_project_json_data(project_path=project_path) + if not project_json_data: + return 1 + + update_project_json = False + try: + update_project_json = project_json_data['engine'] != this_engine_json['engine_name'] + except KeyError as e: + update_project_json = True + + if update_project_json: + project_json_path = project_path / 'project.json' + project_json_data['engine'] = this_engine_json['engine_name'] + utils.backup_file(project_json_path) + if not manifest.save_o3de_manifest(project_json_data, project_json_path): + return 1 return 0 @@ -656,6 +657,22 @@ def register(engine_path: pathlib.Path = None, return result +def remove_invalid_o3de_projects(manifest_path: pathlib.Path = None) -> int: + if not manifest_path: + manifest_path = manifest.get_o3de_manifest() + + json_data = manifest.load_o3de_manifest(manifest_path) + + result = 0 + + for project in json_data['projects']: + if not validation.valid_o3de_project_json(pathlib.Path(project).resolve() / 'project.json'): + logger.warn(f"Project path {project} is invalid.") + # Attempt to unregister all invalid projects even if previous projects failed to unregister + # but combine the result codes of each command. + result = register(project_path=pathlib.Path(project), remove=True) or result + + return result def remove_invalid_o3de_objects() -> None: json_data = manifest.load_o3de_manifest() @@ -666,10 +683,7 @@ def remove_invalid_o3de_objects() -> None: logger.warn(f"Engine path {engine_path} is invalid.") register(engine_path=engine_path, remove=True) - for project in json_data['projects']: - if not validation.valid_o3de_project_json(pathlib.Path(project).resolve() / 'project.json'): - logger.warn(f"Project path {project} is invalid.") - register(project_path=project, remove=True) + remove_invalid_o3de_projects() for gem in json_data['gems']: if not validation.valid_o3de_gem_json(pathlib.Path(gem).resolve() / 'gem.json'):