diff --git a/.gitignore b/.gitignore
index c3af907e97..664680c5bf 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,6 +4,7 @@ __pycache__
AssetProcessorTemp/**
[Bb]uild/**
[Cc]ache/
+/install/
Editor/EditorEventLog.xml
Editor/EditorLayout.xml
**/*egg-info/**
@@ -19,3 +20,4 @@ _savebackup/
TestResults/**
*.swatches
/imgui.ini
+/scripts/project_manager/logs/
diff --git a/Assets/Engine/SeedAssetList.seed b/Assets/Engine/SeedAssetList.seed
index 45a02f7682..77ec509721 100644
--- a/Assets/Engine/SeedAssetList.seed
+++ b/Assets/Engine/SeedAssetList.seed
@@ -67,106 +67,98 @@
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
-
-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -264,109 +256,101 @@
-
-
-
-
-
-
-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -387,498 +371,474 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
-
-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
-
-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
-
-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -896,14 +856,6 @@
-
-
-
-
-
-
-
-
@@ -928,29 +880,13 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
@@ -1451,146 +1387,146 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -1699,42 +1635,42 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/AutomatedTesting/EngineFinder.cmake b/AutomatedTesting/EngineFinder.cmake
index 1fdcef2b56..fbbe3d8cfe 100644
--- a/AutomatedTesting/EngineFinder.cmake
+++ b/AutomatedTesting/EngineFinder.cmake
@@ -20,31 +20,49 @@ if(json_error)
message(FATAL_ERROR "Unable to read key 'engine' from 'project.json', error: ${json_error}")
endif()
-# Read the list of paths from ~.o3de/o3de_manifest.json
-file(TO_CMAKE_PATH "$ENV{USERPROFILE}" home_directory) # Windows
-if((NOT home_directory) OR (NOT EXISTS ${home_directory}))
- file(TO_CMAKE_PATH "$ENV{HOME}" home_directory)# Unix
+if(DEFINED ENV{USERPROFILE} AND EXISTS $ENV{USERPROFILE})
+ set(manifest_path $ENV{USERPROFILE}/.o3de/o3de_manifest.json) # Windows
+else()
+ set(manifest_path $ENV{HOME}/.o3de/o3de_manifest.json) # Unix
endif()
-if (NOT home_directory)
- message(FATAL_ERROR "Cannot find user home directory, the o3de manifest cannot be found")
-endif()
-# Set manifest path to path in the user home directory
-set(manifest_path ${home_directory}/.o3de/o3de_manifest.json)
-
+# Read the ~/.o3de/o3de_manifest.json file and look through the 'engines_path' object.
+# Find a key that matches LY_ENGINE_NAME_TO_USE and use that as the engine path.
if(EXISTS ${manifest_path})
file(READ ${manifest_path} manifest_json)
- string(JSON engines_count ERROR_VARIABLE json_error LENGTH ${manifest_json} engines)
+
+ string(JSON engines_path_count ERROR_VARIABLE json_error LENGTH ${manifest_json} engines_path)
if(json_error)
- message(FATAL_ERROR "Unable to read key 'engines' from '${manifest_path}', error: ${json_error}")
+ message(FATAL_ERROR "Unable to read key 'engines_path' from '${manifest_path}', error: ${json_error}")
endif()
- math(EXPR engines_count "${engines_count}-1")
- foreach(engine_path_index RANGE ${engines_count})
- string(JSON engine_path ERROR_VARIABLE json_error GET ${manifest_json} engines ${engine_path_index})
- if(${json_error})
- message(FATAL_ERROR "Unable to read engines[${engine_path_index}] '${manifest_path}', error: ${json_error}")
+ string(JSON engines_path_type ERROR_VARIABLE json_error TYPE ${manifest_json} engines_path)
+ if(json_error OR NOT ${engines_path_type} STREQUAL "OBJECT")
+ message(FATAL_ERROR "Type of 'engines_path' in '${manifest_path}' is not a JSON Object, error: ${json_error}")
+ endif()
+
+ math(EXPR engines_path_count "${engines_path_count}-1")
+ foreach(engine_path_index RANGE ${engines_path_count})
+ string(JSON engine_name ERROR_VARIABLE json_error MEMBER ${manifest_json} engines_path ${engine_path_index})
+ if(json_error)
+ message(FATAL_ERROR "Unable to read 'engines_path/${engine_path_index}' from '${manifest_path}', error: ${json_error}")
+ endif()
+
+ if(LY_ENGINE_NAME_TO_USE STREQUAL engine_name)
+ string(JSON engine_path ERROR_VARIABLE json_error GET ${manifest_json} engines_path ${engine_name})
+ if(json_error)
+ message(FATAL_ERROR "Unable to read value from 'engines_path/${engine_name}', error: ${json_error}")
+ endif()
+
+ if(engine_path)
+ list(APPEND CMAKE_MODULE_PATH "${engine_path}/cmake")
+ break()
+ endif()
endif()
- list(APPEND CMAKE_MODULE_PATH "${engine_path}/cmake")
endforeach()
+else()
+ # If the user is passing CMAKE_MODULE_PATH we assume thats where we will find the engine
+ if(NOT CMAKE_MODULE_PATH)
+ message(FATAL_ERROR "Engine registration is required before configuring a project. Please register an engine by running 'scripts/o3de register --this-engine'")
+ endif()
endif()
diff --git a/AutomatedTesting/Gem/Code/CMakeLists.txt b/AutomatedTesting/Gem/Code/CMakeLists.txt
index 2bcc304bde..548aa51ad1 100644
--- a/AutomatedTesting/Gem/Code/CMakeLists.txt
+++ b/AutomatedTesting/Gem/Code/CMakeLists.txt
@@ -28,30 +28,41 @@ ly_add_target(
Gem::Atom_AtomBridge.Static
)
+# if enabled, AutomatedTesting is used by all kinds of applications
+ly_create_alias(NAME AutomatedTesting.Builders NAMESPACE Gem TARGETS Gem::AutomatedTesting)
+ly_create_alias(NAME AutomatedTesting.Tools NAMESPACE Gem TARGETS Gem::AutomatedTesting)
+ly_create_alias(NAME AutomatedTesting.Clients NAMESPACE Gem TARGETS Gem::AutomatedTesting)
+ly_create_alias(NAME AutomatedTesting.Servers NAMESPACE Gem TARGETS Gem::AutomatedTesting)
+
################################################################################
# Gem dependencies
################################################################################
-ly_add_project_dependencies(
- PROJECT_NAME
- AutomatedTesting
- TARGETS
- AutomatedTesting.GameLauncher
- DEPENDENCIES_FILES
- runtime_dependencies.cmake
- ${pal_dir}/runtime_dependencies.cmake
-)
-if(PAL_TRAIT_BUILD_HOST_TOOLS)
- ly_add_project_dependencies(
- PROJECT_NAME
- AutomatedTesting
- TARGETS
- AssetBuilder
- AssetProcessor
- AssetProcessorBatch
- Editor
- DEPENDENCIES_FILES
- tool_dependencies.cmake
- ${pal_dir}/tool_dependencies.cmake
- )
+# The GameLauncher uses "Clients" gem variants:
+ly_enable_gems(PROJECT_NAME AutomatedTesting GEM_FILE enabled_gems.cmake
+ TARGETS AutomatedTesting.GameLauncher
+ VARIANTS Clients)
+
+# If we build a server, then apply the gems to the server
+if(PAL_TRAIT_BUILD_SERVER_SUPPORTED)
+ # if we're making a server, then add the "Server" gem variants to it:
+ ly_enable_gems(PROJECT_NAME AutomatedTesting GEM_FILE enabled_gems.cmake
+ TARGETS AutomatedTesting.ServerLauncher
+ VARIANTS Servers)
+
+ set_property(GLOBAL APPEND PROPERTY LY_LAUNCHER_SERVER_PROJECTS AutomatedTesting)
+endif()
+
+if (PAL_TRAIT_BUILD_HOST_TOOLS)
+ # The Editor uses "Tools" gem variants:
+ ly_enable_gems(
+ PROJECT_NAME AutomatedTesting GEM_FILE enabled_gems.cmake
+ TARGETS Editor
+ VARIANTS Tools)
+
+ # The pipeline tools use "Builders" gem variants:
+ ly_enable_gems(
+ PROJECT_NAME AutomatedTesting GEM_FILE enabled_gems.cmake
+ TARGETS AssetBuilder AssetProcessor AssetProcessorBatch
+ VARIANTS Builders)
endif()
diff --git a/AutomatedTesting/Gem/Code/enabled_gems.cmake b/AutomatedTesting/Gem/Code/enabled_gems.cmake
new file mode 100644
index 0000000000..d99d17b55e
--- /dev/null
+++ b/AutomatedTesting/Gem/Code/enabled_gems.cmake
@@ -0,0 +1,58 @@
+#
+# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
+# its licensors.
+#
+# For complete copyright and license terms please see the LICENSE at the root of this
+# distribution (the "License"). All use of this software is governed by the License,
+# or, if provided, by the license below or the license accompanying this file. Do not
+# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#
+
+set(ENABLED_GEMS
+ ImGui
+ ScriptEvents
+ ExpressionEvaluation
+ Gestures
+ CertificateManager
+ DebugDraw
+ SceneProcessing
+ GraphCanvas
+ InAppPurchases
+ AutomatedTesting
+ EditorPythonBindings
+ QtForPython
+ PythonAssetBuilder
+ Metastream
+ AudioSystem
+ Camera
+ EMotionFX
+ PhysX
+ CameraFramework
+ StartingPointMovement
+ StartingPointCamera
+ ScriptCanvas
+ ScriptCanvasPhysics
+ ScriptCanvasTesting
+ LyShineExamples
+ StartingPointInput
+ PhysXDebug
+ WhiteBox
+ FastNoise
+ SurfaceData
+ GradientSignal
+ Vegetation
+ GraphModel
+ LandscapeCanvas
+ NvCloth
+ Blast
+ Maestro
+ TextureAtlas
+ LmbrCentral
+ LyShine
+ HttpRequestor
+ Atom_AtomBridge
+ AWSCore
+ AWSClientAuth
+ AWSMetrics
+)
diff --git a/AutomatedTesting/Gem/Code/runtime_dependencies.cmake b/AutomatedTesting/Gem/Code/runtime_dependencies.cmake
deleted file mode 100644
index 280c25bcf7..0000000000
--- a/AutomatedTesting/Gem/Code/runtime_dependencies.cmake
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
-# its licensors.
-#
-# For complete copyright and license terms please see the LICENSE at the root of this
-# distribution (the License). All use of this software is governed by the License,
-# or, if provided, by the license below or the license accompanying this file. Do not
-# remove or modify any license notices. This file is distributed on an AS IS BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#
-
-# Extracted from Game
-set(GEM_DEPENDENCIES
- Gem::Maestro
- Gem::TextureAtlas
- Gem::LmbrCentral
- Gem::LyShine
- Gem::HttpRequestor
- Gem::ScriptEvents
- Gem::ExpressionEvaluation
- Gem::Gestures
- Gem::CertificateManager
- Gem::DebugDraw
- Gem::AudioSystem
- Gem::InAppPurchases
- Gem::AutomatedTesting
- Gem::Metastream
- Gem::Camera
- Gem::EMotionFX
- Gem::PhysX
- Gem::CameraFramework
- Gem::StartingPointMovement
- Gem::StartingPointCamera
- Gem::ScriptCanvas
- Gem::ImGui
- Gem::LyShineExamples
- Gem::StartingPointInput
- Gem::ScriptCanvasPhysics
- Gem::PhysXDebug
- Gem::WhiteBox
- Gem::FastNoise
- Gem::SurfaceData
- Gem::GradientSignal
- Gem::Vegetation
- Gem::Atom_AtomBridge
- Gem::NvCloth
- Gem::Blast
-)
diff --git a/AutomatedTesting/Gem/Code/tool_dependencies.cmake b/AutomatedTesting/Gem/Code/tool_dependencies.cmake
deleted file mode 100644
index 1d70c02b1c..0000000000
--- a/AutomatedTesting/Gem/Code/tool_dependencies.cmake
+++ /dev/null
@@ -1,60 +0,0 @@
-#
-# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
-# its licensors.
-#
-# For complete copyright and license terms please see the LICENSE at the root of this
-# distribution (the License). All use of this software is governed by the License,
-# or, if provided, by the license below or the license accompanying this file. Do not
-# remove or modify any license notices. This file is distributed on an AS IS BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#
-
-# Extracted from Editor.xml
-set(GEM_DEPENDENCIES
- Gem::Maestro.Editor
- Gem::TextureAtlas.Editor
- Gem::LmbrCentral.Editor
- Gem::LyShine.Editor
- Gem::HttpRequestor
- Gem::ScriptEvents.Editor
- Gem::ExpressionEvaluation
- Gem::Gestures
- Gem::CertificateManager
- Gem::DebugDraw.Editor
- Gem::SceneProcessing.Editor
- Gem::GraphCanvas.Editor
- Gem::InAppPurchases
- Gem::AutomatedTesting
- Gem::EditorPythonBindings.Editor
- Gem::PythonAssetBuilder.Editor
- Gem::Metastream
- Gem::AudioSystem.Editor
- Gem::Camera.Editor
- Gem::EMotionFX.Editor
- Gem::PhysX.Editor
- Gem::CameraFramework
- Gem::StartingPointMovement
- Gem::StartingPointCamera
- Gem::ScriptCanvas.Editor
- Gem::ScriptEvents.Editor
- Gem::ImGui.Editor
- Gem::LyShineExamples
- Gem::StartingPointInput.Editor
- Gem::ScriptCanvasPhysics
- Gem::ScriptCanvasTesting.Editor
- Gem::PhysXDebug.Editor
- Gem::WhiteBox.Editor
- Gem::FastNoise.Editor
- Gem::SurfaceData.Editor
- Gem::GradientSignal.Editor
- Gem::Vegetation.Editor
- Gem::GraphModel.Editor
- Gem::LandscapeCanvas.Editor
- Gem::EMotionFX.Editor
- Gem::ImGui.Editor
- Gem::Atom_RHI.Private
- Gem::Atom_Feature_Common.Editor
- Gem::Atom_AtomBridge.Editor
- Gem::NvCloth.Editor
- Gem::Blast.Editor
-)
diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/bundler_batch_setup_fixture.py b/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/bundler_batch_setup_fixture.py
index 7a85cb1813..34af4d9115 100755
--- a/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/bundler_batch_setup_fixture.py
+++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/bundler_batch_setup_fixture.py
@@ -162,7 +162,7 @@ def bundler_batch_setup_fixture(request, workspace, asset_processor, timeout) ->
else:
cmd.append(f"--{key}")
if append_defaults:
- cmd.append(f"--project={workspace.project}")
+ cmd.append(f"--project-path={workspace.project}")
return cmd
# ******
@@ -300,9 +300,9 @@ def bundler_batch_setup_fixture(request, workspace, asset_processor, timeout) ->
workspace.paths.engine_root(),
"Code",
"Framework",
- "AzFramework",
- "AzFramework",
- "Platform",
+ "AzCore",
+ "AzCore",
+ "PlatformId",
"PlatformDefaults.h",
)
@@ -318,7 +318,7 @@ def bundler_batch_setup_fixture(request, workspace, asset_processor, timeout) ->
if start_gathering:
result = get_platform.match(line) # Try the regex
if result:
- platform_values[result.group(1).lower()] = counter
+ platform_values[result.group(1).replace("_ID", "").lower()] = counter
counter = counter << 1
elif "(Invalid, -1)" in line: # The line right before the first platform
start_gathering = True
diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_bundler_batch_tests.py b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_bundler_batch_tests.py
index 8738e8acdf..1043bbaefa 100755
--- a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_bundler_batch_tests.py
+++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_bundler_batch_tests.py
@@ -302,7 +302,7 @@ class TestsAssetBundlerBatch_WindowsAndMac(object):
that generating debug information does not affect asset list creation
"""
helper = bundler_batch_helper
- seed_list = os.path.join(workspace.paths.engine_root(), "Engine", "SeedAssetList.seed") # Engine seed list
+ seed_list = os.path.join(workspace.paths.engine_root(), "Assets", "Engine", "SeedAssetList.seed") # Engine seed list
asset = r"levels\testdependencieslevel\level.pak"
# Create Asset list
@@ -377,7 +377,7 @@ class TestsAssetBundlerBatch_WindowsAndMac(object):
subcommands.
"""
helper = bundler_batch_helper
- seed_list = os.path.join(workspace.paths.engine_root(), "Engine", "SeedAssetList.seed") # Engine seed list
+ seed_list = os.path.join(workspace.paths.engine_root(), "Assets", "Engine", "SeedAssetList.seed") # Engine seed list
asset = r"levels\testdependencieslevel\level.pak"
# Useful bundle locations / names (2 for comparing contents)
@@ -465,7 +465,7 @@ class TestsAssetBundlerBatch_WindowsAndMac(object):
"Please rerun with commandline option: '--bundle_platforms=pc,mac'"
# fmt:on
- seed_list = os.path.join(workspace.paths.engine_root(), "Engine", "SeedAssetList.seed") # Engine seed list
+ seed_list = os.path.join(workspace.paths.engine_root(), "Assets", "Engine", "SeedAssetList.seed") # Engine seed list
# Useful bundle / asset list locations
bundle_dir = os.path.dirname(helper["bundle_file"])
@@ -502,13 +502,13 @@ class TestsAssetBundlerBatch_WindowsAndMac(object):
for bundle_file in bundle_files.values():
assert os.path.isfile(bundle_file)
- # This asset is created on mac platform but not on windows
- file_to_check = b"engineassets/shading/defaultprobe_cm.dds.5" # [use byte str because file is in binary]
+ # This asset is created both on mac and windows platform
+ file_to_check = b"engineassets/shading/defaultprobe_cm_ibldiffuse.tif.streamingimage" # [use byte str because file is in binary]
# Extract the delta catalog file from pc archive. {file_to_check} SHOULD NOT be present for PC
file_contents = helper.extract_file_content(bundle_files["pc"], "DeltaCatalog.xml")
# fmt:off
- assert file_to_check not in file_contents, \
+ assert file_to_check in file_contents, \
f"{file_to_check} was found in DeltaCatalog.xml in pc bundle file {bundle_files['pc']}"
# fmt:on
@@ -619,7 +619,7 @@ class TestsAssetBundlerBatch_WindowsAndMac(object):
# Validate both mac and pc are activated for seed
# fmt:off
check_seed_platform(helper["seed_list_file"], test_asset,
- helper["platform_values"]["pc"] + helper["platform_values"]["osx"])
+ helper["platform_values"]["pc"] + helper["platform_values"]["mac"])
# fmt:on
# Remove MAC platform
@@ -651,7 +651,7 @@ class TestsAssetBundlerBatch_WindowsAndMac(object):
# Validate Mac platform was added back on. Save file contents
# fmt:off
all_lines = check_seed_platform(helper["seed_list_file"], test_asset,
- helper["platform_values"]["pc"] + helper["platform_values"]["osx"])
+ helper["platform_values"]["pc"] + helper["platform_values"]["mac"])
# fmt:on
# Try to remove platform without specifying a platform to remove (should fail)
@@ -1046,7 +1046,7 @@ class TestsAssetBundlerBatch_WindowsAndMac(object):
"--addDefaultSeedListFiles",
"--platform=pc",
"--print",
- f"--project={workspace.project}"
+ f"--project-path={workspace.project}"
],
universal_newlines=True,
)
@@ -1115,7 +1115,7 @@ class TestsAssetBundlerBatch_WindowsAndMac(object):
bundle_result_path = os.path.join(bundles_folder,
helper.platform_file_name("bundle.pak", workspace.asset_processor_platform))
- bundle_cache_path = os.path.join(workspace.paths.platform_cache(), workspace.project,
+ bundle_cache_path = os.path.join(workspace.paths.platform_cache(),
"Bundles",
helper.platform_file_name("bundle.pak", workspace.asset_processor_platform))
@@ -1156,13 +1156,15 @@ class TestsAssetBundlerBatch_WindowsAndMac(object):
# fmt:off
def test_WindowsAndMac_FilesMarkedSkip_FilesAreSkipped(self, workspace, bundler_batch_helper):
expected_assets = [
- "libs/particles/milestone2particles.xml",
- "textures/milestone2/particles/fx_sparkstreak_01.dds"
+ "ui/canvases/lyshineexamples/animation/multiplesequences.uicanvas",
+ "ui/textures/prefab/button_normal.sprite"
]
bundler_batch_helper.call_assetLists(
assetListFile=bundler_batch_helper['asset_info_file_request'],
- addSeed="libs/particles/milestone2particles.xml",
- skip="textures/milestone2/particles/fx_launchermuzzlering_01.dds,textures/milestone2/particles/fx_launchermuzzlefront_01.dds"
+ addSeed="ui/canvases/lyshineexamples/animation/multiplesequences.uicanvas",
+ skip="ui/textures/prefab/button_disabled.sprite,ui/scripts/lyshineexamples/animation/multiplesequences.luac,"
+ "ui/textures/prefab/tooltip_sliced.sprite,ui/scripts/lyshineexamples/unloadthiscanvasbutton.luac,fonts/vera.fontfamily,fonts/vera-italic.font,"
+ "fonts/vera.font,fonts/vera-bold.font,fonts/vera-bold-italic.font,fonts/vera-italic.ttf,fonts/vera.ttf,fonts/vera-bold.ttf,fonts/vera-bold-italic.ttf"
)
assert os.path.isfile(bundler_batch_helper["asset_info_file_result"])
assets_in_list = []
diff --git a/AutomatedTesting/Gem/PythonTests/physics/TestSuite_Main.py b/AutomatedTesting/Gem/PythonTests/physics/TestSuite_Main.py
index 8f1f2f7481..2cf55c7a58 100644
--- a/AutomatedTesting/Gem/PythonTests/physics/TestSuite_Main.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/TestSuite_Main.py
@@ -42,6 +42,7 @@ class TestAutomation(TestAutomationBase):
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
+ @fm.file_override('physxsystemconfiguration.setreg','C4044459_Material_DynamicFriction.setreg_override', 'AutomatedTesting/Registry')
def test_C4044459_Material_DynamicFriction(self, request, workspace, editor, launcher_platform):
from . import C4044459_Material_DynamicFriction as test_module
self._run_test(request, workspace, editor, test_module)
diff --git a/AutomatedTesting/Gem/PythonTests/smoke/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/smoke/CMakeLists.txt
index d351ec0e6c..a3b6e36250 100644
--- a/AutomatedTesting/Gem/PythonTests/smoke/CMakeLists.txt
+++ b/AutomatedTesting/Gem/PythonTests/smoke/CMakeLists.txt
@@ -14,6 +14,24 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
TEST_SUITE smoke
TEST_SERIAL
PATH ${CMAKE_CURRENT_LIST_DIR}
+ PYTEST_MARKS "SUITE_smoke"
+ TIMEOUT 1500
+ RUNTIME_DEPENDENCIES
+ AZ::AssetProcessor
+ AZ::PythonBindingsExample
+ Legacy::Editor
+ AutomatedTesting.GameLauncher
+ AutomatedTesting.Assets
+ COMPONENT
+ Smoke
+ )
+
+ ly_add_pytest(
+ NAME AutomatedTesting::SandboxTest
+ TEST_SUITE sandbox
+ TEST_SERIAL
+ PATH ${CMAKE_CURRENT_LIST_DIR}
+ PYTEST_MARKS "SUITE_sandbox"
TIMEOUT 1500
RUNTIME_DEPENDENCIES
AZ::AssetProcessor
diff --git a/AutomatedTesting/Gem/PythonTests/smoke/test_Editor_NewExistingLevels_Works.py b/AutomatedTesting/Gem/PythonTests/smoke/test_Editor_NewExistingLevels_Works.py
index 985740307f..e6b072ba58 100644
--- a/AutomatedTesting/Gem/PythonTests/smoke/test_Editor_NewExistingLevels_Works.py
+++ b/AutomatedTesting/Gem/PythonTests/smoke/test_Editor_NewExistingLevels_Works.py
@@ -15,7 +15,7 @@ from automatedtesting_shared.base import TestAutomationBase
import ly_test_tools.environment.file_system as file_system
-@pytest.mark.SUITE_smoke
+@pytest.mark.SUITE_sandbox
@pytest.mark.parametrize("launcher_platform", ["windows_editor"])
@pytest.mark.parametrize("project", ["AutomatedTesting"])
@pytest.mark.parametrize("level", ["temp_level"])
diff --git a/AutomatedTesting/Registry/C3510644_Collider_CollisionGroups.setreg_override b/AutomatedTesting/Registry/C3510644_Collider_CollisionGroups.setreg_override
index 9fa5e26768..696a0a74da 100644
--- a/AutomatedTesting/Registry/C3510644_Collider_CollisionGroups.setreg_override
+++ b/AutomatedTesting/Registry/C3510644_Collider_CollisionGroups.setreg_override
@@ -119,6 +119,9 @@
]
}
},
+ "DefaultMaterial": {
+ "SurfaceType": "Default_1"
+ },
"MaterialLibrary": {
"assetId": {
"guid": "{3A055A3F-8CB7-5FEE-B437-EB365FACD0D4}"
diff --git a/AutomatedTesting/Registry/C4044459_Material_DynamicFriction.setreg_override b/AutomatedTesting/Registry/C4044459_Material_DynamicFriction.setreg_override
new file mode 100644
index 0000000000..c53b04e5c2
--- /dev/null
+++ b/AutomatedTesting/Registry/C4044459_Material_DynamicFriction.setreg_override
@@ -0,0 +1,118 @@
+{
+ "Amazon": {
+ "Gems": {
+ "PhysX": {
+ "PhysXSystemConfiguration": {
+ "CollisionConfig": {
+ "Layers": {
+ "LayerNames": [
+ "Default",
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ {},
+ "TouchBend"
+ ]
+ },
+ "Groups": {
+ "GroupPresets": [
+ {
+ "Name": "All",
+ "ReadOnly": true
+ },
+ {
+ "Id": {
+ "GroupId": "{CDB6B8D8-5CD0-40A8-874D-839B00A92EBB}"
+ },
+ "Name": "None",
+ "Group": {
+ "Mask": 0
+ },
+ "ReadOnly": true
+ },
+ {
+ "Id": {
+ "GroupId": "{22769429-5D46-429B-829A-0115239D9AAA}"
+ },
+ "Name": "All_NoTouchBend",
+ "Group": {
+ "Mask": 9223372036854775807
+ },
+ "ReadOnly": true
+ }
+ ]
+ }
+ },
+ "DefaultMaterial": {
+ "SurfaceType": "Default_1"
+ },
+ "MaterialLibrary": {
+ "assetId": {
+ "guid": "{6AA79EE4-7EC3-5717-87AE-EDD7D886FD7F}"
+ },
+ "loadBehavior": "QueueLoad",
+ "assetHint": "levels/physics/c4044459_material_dynamicfriction/dynamic_friction.physmaterial"
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/AutomatedTesting/Registry/C4976227_Collider_NewGroup.setreg_override b/AutomatedTesting/Registry/C4976227_Collider_NewGroup.setreg_override
index afbe6a9d38..5e98e08ede 100644
--- a/AutomatedTesting/Registry/C4976227_Collider_NewGroup.setreg_override
+++ b/AutomatedTesting/Registry/C4976227_Collider_NewGroup.setreg_override
@@ -107,6 +107,9 @@
]
}
},
+ "DefaultMaterial": {
+ "SurfaceType": "Default_1"
+ },
"MaterialLibrary": {
"assetId": {
"guid": "{3A055A3F-8CB7-5FEE-B437-EB365FACD0D4}"
diff --git a/AutomatedTesting/Registry/C4976244_Collider_SameGroupSameLayerCollision.setreg_override b/AutomatedTesting/Registry/C4976244_Collider_SameGroupSameLayerCollision.setreg_override
index 9fa5e26768..696a0a74da 100644
--- a/AutomatedTesting/Registry/C4976244_Collider_SameGroupSameLayerCollision.setreg_override
+++ b/AutomatedTesting/Registry/C4976244_Collider_SameGroupSameLayerCollision.setreg_override
@@ -119,6 +119,9 @@
]
}
},
+ "DefaultMaterial": {
+ "SurfaceType": "Default_1"
+ },
"MaterialLibrary": {
"assetId": {
"guid": "{3A055A3F-8CB7-5FEE-B437-EB365FACD0D4}"
diff --git a/AutomatedTesting/Registry/C4976245_PhysXCollider_CollisionLayerTest.setreg_override b/AutomatedTesting/Registry/C4976245_PhysXCollider_CollisionLayerTest.setreg_override
index 9fa5e26768..696a0a74da 100644
--- a/AutomatedTesting/Registry/C4976245_PhysXCollider_CollisionLayerTest.setreg_override
+++ b/AutomatedTesting/Registry/C4976245_PhysXCollider_CollisionLayerTest.setreg_override
@@ -119,6 +119,9 @@
]
}
},
+ "DefaultMaterial": {
+ "SurfaceType": "Default_1"
+ },
"MaterialLibrary": {
"assetId": {
"guid": "{3A055A3F-8CB7-5FEE-B437-EB365FACD0D4}"
diff --git a/AutomatedTesting/Registry/C4982593_PhysXCollider_CollisionLayer.setreg_override b/AutomatedTesting/Registry/C4982593_PhysXCollider_CollisionLayer.setreg_override
index 9fa5e26768..696a0a74da 100644
--- a/AutomatedTesting/Registry/C4982593_PhysXCollider_CollisionLayer.setreg_override
+++ b/AutomatedTesting/Registry/C4982593_PhysXCollider_CollisionLayer.setreg_override
@@ -119,6 +119,9 @@
]
}
},
+ "DefaultMaterial": {
+ "SurfaceType": "Default_1"
+ },
"MaterialLibrary": {
"assetId": {
"guid": "{3A055A3F-8CB7-5FEE-B437-EB365FACD0D4}"
diff --git a/AutomatedTesting/Registry/physxsystemconfiguration.setreg b/AutomatedTesting/Registry/physxsystemconfiguration.setreg
index 02f65b685b..30e9dced44 100644
--- a/AutomatedTesting/Registry/physxsystemconfiguration.setreg
+++ b/AutomatedTesting/Registry/physxsystemconfiguration.setreg
@@ -101,6 +101,9 @@
]
}
},
+ "DefaultMaterial": {
+ "SurfaceType": "Default_1"
+ },
"MaterialLibrary": {
"assetId": {
"guid": "{3A055A3F-8CB7-5FEE-B437-EB365FACD0D4}"
diff --git a/AutomatedTesting/surfacetypemateriallibrary.physmaterial b/AutomatedTesting/surfacetypemateriallibrary.physmaterial
index 3c39d5521e..434d673998 100644
--- a/AutomatedTesting/surfacetypemateriallibrary.physmaterial
+++ b/AutomatedTesting/surfacetypemateriallibrary.physmaterial
@@ -1,18 +1,19 @@
-
+
-
-
-
+
+
+
+
-
+
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a7e42613cb..387f536966 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -25,34 +25,13 @@ include(cmake/LySet.cmake)
include(cmake/Version.cmake)
include(cmake/OutputDirectory.cmake)
-# Set the engine_path and engine_json
-set(o3de_engine_path ${CMAKE_CURRENT_LIST_DIR})
-set(o3de_engine_json ${o3de_engine_path}/engine.json)
-
if(NOT PROJECT_NAME)
project(O3DE
LANGUAGES C CXX
VERSION ${LY_VERSION_STRING}
)
-
- # o3de manifest
- include(cmake/o3de_manifest.cmake)
endif()
-################################################################################
-# Resolve this engines name and restricted path
-################################################################################
-o3de_engine_name(${o3de_engine_json} o3de_engine_name)
-o3de_restricted_path(${o3de_engine_json} o3de_engine_restricted_path)
-message(STATUS "O3DE Engine Name: ${o3de_engine_name}")
-message(STATUS "O3DE Engine Path: ${o3de_engine_path}")
-if(o3de_engine_restricted_path)
- message(STATUS "O3DE Engine Restricted Path: ${o3de_engine_restricted_path}")
-endif()
-
-# add the engines cmake folder to the CMAKE_MODULE_PATH
-list(APPEND CMAKE_MODULE_PATH "${o3de_engine_path}/cmake")
-
################################################################################
# Initialize
################################################################################
@@ -60,6 +39,7 @@ include(cmake/GeneralSettings.cmake)
include(cmake/FileUtil.cmake)
include(cmake/PAL.cmake)
include(cmake/PALTools.cmake)
+include(cmake/RuntimeDependencies.cmake)
include(cmake/Install.cmake)
include(cmake/Configurations.cmake) # Requires to be after PAL so we get platform variable definitions
include(cmake/Dependencies.cmake)
@@ -67,92 +47,106 @@ include(cmake/Deployment.cmake)
include(cmake/3rdParty.cmake)
include(cmake/LYPython.cmake)
include(cmake/LYWrappers.cmake)
+include(cmake/Gems.cmake)
include(cmake/UnitTest.cmake)
include(cmake/LYTestWrappers.cmake)
include(cmake/Monolithic.cmake)
include(cmake/SettingsRegistry.cmake)
include(cmake/TestImpactFramework/LYTestImpactFramework.cmake)
include(cmake/CMakeFiles.cmake)
+include(cmake/O3DEJson.cmake)
################################################################################
# Subdirectory processing
################################################################################
+function(add_engine_json_external_subdirectories)
+ read_json_external_subdirs(external_subdis ${LY_ROOT_FOLDER}/engine.json)
+ foreach(external_subdir ${external_subdis})
+ file(REAL_PATH ${external_subdir} real_external_subdir BASE_DIRECTORY ${LY_ROOT_FOLDER})
+ list(APPEND engine_external_subdirs ${real_external_subdir})
+ endforeach()
+
+ set_property(GLOBAL APPEND PROPERTY LY_EXTERNAL_SUBDIRS ${engine_external_subdirs})
+endfunction()
+
# Add the projects first so the Launcher can find them
include(cmake/Projects.cmake)
if(NOT INSTALLED_ENGINE)
+
# Add the rest of the targets
add_subdirectory(Code)
+ add_subdirectory(scripts)
+
+ # SPEC-1417 will investigate and fix this
+ if(NOT PAL_PLATFORM_NAME STREQUAL "Mac")
+ add_subdirectory(Tools/LyTestTools/tests/)
+ add_subdirectory(Tools/RemoteConsole/ly_remote_console/tests/)
+ endif()
+
+ # Add external subdirectories listed in the engine.json. LY_EXTERNAL_SUBDIRS is a cache variable so the user can add extra
+ # external subdirectories
+ add_engine_json_external_subdirectories()
+ get_property(external_subdirs GLOBAL PROPERTY LY_EXTERNAL_SUBDIRS)
+ list(APPEND LY_EXTERNAL_SUBDIRS ${external_subdirs})
+
+ # Loop over the additional external subdirectories and invoke add_subdirectory on them
+ foreach(external_directory ${LY_EXTERNAL_SUBDIRS})
+ # Hash the extenal_directory name and append it to the Binary Directory section of add_subdirectory
+ # This is to deal with potential situations where multiple external directories has the same last directory name
+ # For example if D:/Company1/RayTracingGem and F:/Company2/Path/RayTracingGem were both added as a subdirectory
+ file(REAL_PATH ${external_directory} full_directory_path)
+ string(SHA256 full_directory_hash ${full_directory_path})
+ # Truncate the full_directory_hash down to 8 characters to avoid hitting the Windows 260 character path limit
+ # when the external subdirectory contains relative paths of significant length
+ string(SUBSTRING ${full_directory_hash} 0 8 full_directory_hash)
+ # Use the last directory as the suffix path to use for the Binary Directory
+ get_filename_component(directory_name ${external_directory} NAME)
+ add_subdirectory(${external_directory} ${CMAKE_BINARY_DIR}/External/${directory_name}-${full_directory_hash})
+ endforeach()
+
else()
ly_find_o3de_packages()
endif()
-# Add external subdirectories listed in the manifest
-list(APPEND LY_EXTERNAL_SUBDIRS ${o3de_engine_external_subdirectories})
-
-set(enabled_platforms
- ${PAL_PLATFORM_NAME}
- ${LY_PAL_TOOLS_ENABLED})
-
-# Add any engine restricted platforms as external subdirs
-o3de_add_engine_restricted_platform_external_subdirs()
-
-if(NOT INSTALLED_ENGINE)
- add_subdirectory(scripts)
-endif()
-
-# SPEC-1417 will investigate and fix this
-if(NOT PAL_PLATFORM_NAME STREQUAL "Mac")
- add_subdirectory(Tools/LyTestTools/tests/)
- add_subdirectory(Tools/RemoteConsole/ly_remote_console/tests/)
-endif()
-
################################################################################
# Post-processing
################################################################################
-
-# Loop over the additional external subdirectories and invoke add_subdirectory on them
-foreach(external_directory ${LY_EXTERNAL_SUBDIRS})
- # Hash the extenal_directory name and append it to the Binary Directory section of add_subdirectory
- # This is to deal with potential situations where multiple external directories has the same last directory name
- # For example if D:/Company1/RayTracingGem and F:/Company2/Path/RayTracingGem were both added as a subdirectory
- file(REAL_PATH ${external_directory} full_directory_path)
- string(SHA256 full_directory_hash ${full_directory_path})
- # Truncate the full_directory_hash down to 8 characters to avoid hitting the Windows 260 character path limit
- # when the external subdirectory contains relative paths of significant length
- string(SUBSTRING ${full_directory_hash} 0 8 full_directory_hash)
- # Use the last directory as the suffix path to use for the Binary Directory
- get_filename_component(directory_name ${external_directory} NAME)
- add_subdirectory(${external_directory} ${CMAKE_BINARY_DIR}/External/${directory_name}-${full_directory_hash})
-endforeach()
-
# The following steps have to be done after all targets are registered:
# Defer generation of the StaticModules.inl file which is needed to create the AZ::Module derived class in monolithic
# builds until after all the targets are known
ly_delayed_generate_static_modules_inl()
-# 1. generate a settings registry .setreg file for all ly_add_project_dependencies() and ly_add_target_dependencies() calls
+# 1. Add any dependencies registered via ly_enable_gems
+ly_enable_gems_delayed()
+
+# 2. generate a settings registry .setreg file for all ly_add_project_dependencies() and ly_add_target_dependencies() calls
# to provide applications with the filenames of gem modules to load
# This must be done before ly_delayed_target_link_libraries() as that inserts BUILD_DEPENDENCIES as MANUALLY_ADDED_DEPENDENCIES
# if the build dependency is a MODULE_LIBRARY. That would cause a false load dependency to be generated
ly_delayed_generate_settings_registry()
-# 2. link targets where the dependency was yet not declared, we need to have the declaration so we do different
+
+# 3. link targets where the dependency was yet not declared, we need to have the declaration so we do different
# linking logic depending on the type of target
ly_delayed_target_link_libraries()
-# 3. generate a registry file for unit testing for platforms that support unit testing
+
+# 4. generate a registry file for unit testing for platforms that support unit testing
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED)
ly_delayed_generate_unit_test_module_registry()
endif()
-# 4. inject runtime dependencies to the targets. We need to do this after (1) since we are going to walk through
-# the dependencies
-include(cmake/RuntimeDependencies.cmake)
-# 5. Perform test impact framework post steps once all of the targets have been enumerated
-ly_test_impact_post_step()
-# 6. Generate the O3DE find file and setup install locations for scripts, tools, assets etc., required by the engine
-if(NOT INSTALLED_ENGINE)
- ly_setup_o3de_install()
- # IMPORTANT: must be included last
+# 5. inject runtime dependencies to the targets. We need to do this after (1) since we are going to walk through
+# the dependencies
+ly_delayed_generate_runtime_dependencies()
+
+# 6. Perform test impact framework post steps once all of the targets have been enumerated
+ly_test_impact_post_step()
+
+# 7. Generate the O3DE find file and setup install locations for scripts, tools, assets etc., required by the engine
+if(NOT INSTALLED_ENGINE)
+ # 8. Generate the O3DE find file and setup install locations for scripts, tools, assets etc., required by the engine
+ ly_setup_o3de_install()
+ # 9. CPack information (to be included after install)
include(cmake/Packaging.cmake)
endif()
diff --git a/Code/CryEngine/CrySystem/LevelSystem/SpawnableLevelSystem.cpp b/Code/CryEngine/CrySystem/LevelSystem/SpawnableLevelSystem.cpp
index ff6ebc0d17..31d1540d77 100644
--- a/Code/CryEngine/CrySystem/LevelSystem/SpawnableLevelSystem.cpp
+++ b/Code/CryEngine/CrySystem/LevelSystem/SpawnableLevelSystem.cpp
@@ -36,8 +36,8 @@ namespace LegacyLevelSystem
//------------------------------------------------------------------------
static void LoadLevel(const AZ::ConsoleCommandContainer& arguments)
{
- AZ_Error("SpawnableLevelSystem", arguments.empty(), "LoadLevel requires a level file name to be provided.");
- AZ_Error("SpawnableLevelSystem", arguments.size() > 1, "LoadLevel requires a single level file name to be provided.");
+ AZ_Error("SpawnableLevelSystem", !arguments.empty(), "LoadLevel requires a level file name to be provided.");
+ AZ_Error("SpawnableLevelSystem", arguments.size() == 1, "LoadLevel requires a single level file name to be provided.");
if (!arguments.empty() && gEnv->pSystem && gEnv->pSystem->GetILevelSystem() && !gEnv->IsEditor())
{
diff --git a/Code/CryEngine/CrySystem/SystemInit.cpp b/Code/CryEngine/CrySystem/SystemInit.cpp
index 25d6b9c601..79041fa233 100644
--- a/Code/CryEngine/CrySystem/SystemInit.cpp
+++ b/Code/CryEngine/CrySystem/SystemInit.cpp
@@ -864,11 +864,6 @@ bool CSystem::InitShine([[maybe_unused]] const SSystemInitParams& initParams)
EBUS_EVENT(UiSystemBus, InitializeSystem);
- if (!m_env.pLyShine)
- {
- AZ_Error(AZ_TRACE_SYSTEM_WINDOW, false, "LYShine System did not initialize correctly. Please check that the LyShine gem is enabled for this project in *_dependencies.cmake.");
- return false;
- }
return true;
}
diff --git a/Code/Framework/AzCore/AzCore/Component/ComponentApplication.cpp b/Code/Framework/AzCore/AzCore/Component/ComponentApplication.cpp
index f03b1aac76..1010ae3473 100644
--- a/Code/Framework/AzCore/AzCore/Component/ComponentApplication.cpp
+++ b/Code/Framework/AzCore/AzCore/Component/ComponentApplication.cpp
@@ -1260,7 +1260,7 @@ namespace AZ
// So auto load is turned off if option "AutoLoad" key is bool that is false
if (valueName == "AutoLoad" && !value)
{
- // Strip off the AutoLoead entry from the path
+ // Strip off the AutoLoad entry from the path
auto autoLoadKey = AZ::StringFunc::TokenizeLast(path, "/");
if (!autoLoadKey)
{
@@ -1330,7 +1330,7 @@ namespace AZ
{
auto CompareDynamicModuleDescriptor = [&dynamicLibraryPath](const DynamicModuleDescriptor& entry)
{
- return entry.m_dynamicLibraryPath.contains(dynamicLibraryPath);
+ return AZ::IO::PathView(entry.m_dynamicLibraryPath).Stem() == AZ::IO::PathView(dynamicLibraryPath).Stem();
};
if (auto moduleIter = AZStd::find_if(gemModules.begin(), gemModules.end(), CompareDynamicModuleDescriptor);
moduleIter == gemModules.end())
diff --git a/Code/Framework/AzCore/AzCore/Component/TransformBus.h b/Code/Framework/AzCore/AzCore/Component/TransformBus.h
index b180e97332..2a8d82c34c 100644
--- a/Code/Framework/AzCore/AzCore/Component/TransformBus.h
+++ b/Code/Framework/AzCore/AzCore/Component/TransformBus.h
@@ -219,18 +219,11 @@ namespace AZ
//! Scale modifiers
//! @{
- //! Set local scale of the transform.
- //! @param scale The new scale to set.
- virtual void SetLocalScale([[maybe_unused]] const AZ::Vector3& scale) {}
-
- //! Get the scale value in local space.
+ //! @deprecated GetLocalScale is deprecated, and is left only to allow migration of legacy vector scale.
+ //! Get the legacy vector scale value in local space.
//! @return The scale value in local space.
virtual AZ::Vector3 GetLocalScale() { return AZ::Vector3(FLT_MAX); }
- //! Get the scale value in world space.
- //! @return The scale value in world space.
- virtual AZ::Vector3 GetWorldScale() { return AZ::Vector3(FLT_MAX); }
-
//! Set the uniform scale value in local space.
virtual void SetLocalUniformScale([[maybe_unused]] float scale) {}
diff --git a/Code/Framework/AzCore/AzCore/IO/Path/Path.h b/Code/Framework/AzCore/AzCore/IO/Path/Path.h
index 61294cd637..6c1b519224 100644
--- a/Code/Framework/AzCore/AzCore/IO/Path/Path.h
+++ b/Code/Framework/AzCore/AzCore/IO/Path/Path.h
@@ -95,6 +95,12 @@ namespace AZ::IO
constexpr int Compare(AZStd::string_view pathString) const noexcept;
constexpr int Compare(const value_type* pathString) const noexcept;
+ // Extension for fixed strings
+ //! extension: fixed string types with MaxPathLength capacity
+ //! Returns a new instance of an AZStd::fixed_string with capacity of MaxPathLength
+ //! made from the internal string
+ constexpr AZStd::fixed_string FixedMaxPathString() const noexcept;
+
// decomposition
//! Given a windows path of "C:\O3DE\foo\bar\name.txt" and a posix path of
//! "/O3DE/foo/bar/name.txt"
diff --git a/Code/Framework/AzCore/AzCore/IO/Path/Path.inl b/Code/Framework/AzCore/AzCore/IO/Path/Path.inl
index 1e42fc9df7..05a92c5247 100644
--- a/Code/Framework/AzCore/AzCore/IO/Path/Path.inl
+++ b/Code/Framework/AzCore/AzCore/IO/Path/Path.inl
@@ -915,6 +915,11 @@ namespace AZ::IO
return compare_string_view(path);
}
+ constexpr AZStd::fixed_string PathView::FixedMaxPathString() const noexcept
+ {
+ return AZStd::fixed_string(m_path.begin(), m_path.end());
+ }
+
// decomposition
constexpr auto PathView::RootName() const -> PathView
{
diff --git a/Code/Framework/AzCore/AzCore/Math/Aabb.cpp b/Code/Framework/AzCore/AzCore/Math/Aabb.cpp
index 3f7cb4ecf5..367594be63 100644
--- a/Code/Framework/AzCore/AzCore/Math/Aabb.cpp
+++ b/Code/Framework/AzCore/AzCore/Math/Aabb.cpp
@@ -227,7 +227,7 @@ namespace AZ
// the min and max of each part and sum them to get the min and max co-ordinate of the transformed box. For a given new axis,
// the coefficients for what proportion of each original axis is rotated onto that new axis are the same as the components we
// would get by performing the inverse rotation on the new axis, so we need to take the conjugate to get the inverse rotation.
- axisCoeffs = transform.GetScale() * (transform.GetRotation().GetConjugate().TransformVector(axis));
+ axisCoeffs = transform.GetUniformScale() * (transform.GetRotation().GetConjugate().TransformVector(axis));
a = axisCoeffs * m_min;
b = axisCoeffs * m_max;
diff --git a/Code/Framework/AzCore/AzCore/Math/Obb.cpp b/Code/Framework/AzCore/AzCore/Math/Obb.cpp
index eb511669d0..9226ddd28f 100644
--- a/Code/Framework/AzCore/AzCore/Math/Obb.cpp
+++ b/Code/Framework/AzCore/AzCore/Math/Obb.cpp
@@ -154,7 +154,7 @@ namespace AZ
return Obb::CreateFromPositionRotationAndHalfLengths(
transform.TransformPoint(obb.GetPosition()),
transform.GetRotation() * obb.GetRotation(),
- transform.GetScale() * obb.GetHalfLengths()
+ transform.GetUniformScale() * obb.GetHalfLengths()
);
}
}
diff --git a/Code/Framework/AzCore/AzCore/Math/Transform.cpp b/Code/Framework/AzCore/AzCore/Math/Transform.cpp
index 9090a9e94e..62a390c138 100644
--- a/Code/Framework/AzCore/AzCore/Math/Transform.cpp
+++ b/Code/Framework/AzCore/AzCore/Math/Transform.cpp
@@ -130,8 +130,8 @@ namespace AZ
const Transform* transform = reinterpret_cast(classPtr);
float data[NumFloats];
transform->GetRotation().StoreToFloat4(data);
- transform->GetScale().StoreToFloat3(&data[4]);
- transform->GetTranslation().StoreToFloat3(&data[7]);
+ data[4] = transform->GetUniformScale();
+ transform->GetTranslation().StoreToFloat3(&data[5]);
for (int i = 0; i < NumFloats; i++)
{
@@ -159,8 +159,8 @@ namespace AZ
size_t TransformSerializer::TextToData(const char* text, unsigned int textVersion, IO::GenericStream& stream, bool isDataBigEndian)
{
- const size_t dataBufferSize = AZStd::max(NumFloatsVersion0, NumFloats);
- const size_t numElements = textVersion < 1 ? NumFloatsVersion0 : NumFloats;
+ const size_t dataBufferSize = AZStd::max(AZStd::max(NumFloatsVersion1, NumFloatsVersion0), NumFloats);
+ const size_t numElements = textVersion < 1 ? NumFloatsVersion0 : (textVersion == 1 ? NumFloatsVersion1 : NumFloats);
size_t nextNumberIndex = 0;
AZStd::array data;
@@ -201,7 +201,34 @@ namespace AZ
return true;
}
- // otherwise load as a separate rotation, scale and translation
+ // version 1 had a quaternion rotation, vector3 scale and vector3 translation
+ else if (version == 1)
+ {
+ float data[NumFloatsVersion1];
+ if (stream.GetLength() < sizeof(data))
+ {
+ return false;
+ }
+
+ stream.Read(sizeof(data), reinterpret_cast(data));
+
+ for (unsigned int i = 0; i < AZ_ARRAY_SIZE(data); ++i)
+ {
+ AZ_SERIALIZE_SWAP_ENDIAN(data[i], isDataBigEndian);
+ }
+
+ Quaternion rotation = Quaternion::CreateFromFloat4(data);
+ Vector3 vectorScale = Vector3::CreateFromFloat3(&data[4]);
+ Vector3 translation = Vector3::CreateFromFloat3(&data[7]);
+
+ float uniformScale = vectorScale.GetMaxElement();
+
+ *reinterpret_cast(classPtr) =
+ Transform::CreateFromQuaternionAndTranslation(rotation, translation) * Transform::CreateUniformScale(uniformScale);
+ return true;
+ }
+
+ // otherwise load as a quaternion rotation, float scale and vector3 translation
float data[NumFloats];
if (stream.GetLength() < sizeof(data))
{
@@ -216,11 +243,11 @@ namespace AZ
}
Quaternion rotation = Quaternion::CreateFromFloat4(data);
- Vector3 scale = Vector3::CreateFromFloat3(&data[4]);
- Vector3 translation = Vector3::CreateFromFloat3(&data[7]);
+ float scale = data[4];
+ Vector3 translation = Vector3::CreateFromFloat3(&data[5]);
*reinterpret_cast(classPtr) =
- Transform::CreateFromQuaternionAndTranslation(rotation, translation) * Transform::CreateScale(scale);
+ Transform::CreateFromQuaternionAndTranslation(rotation, translation) * Transform::CreateUniformScale(scale);
return true;
}
@@ -237,7 +264,7 @@ namespace AZ
if (serializeContext)
{
serializeContext->Class()
- ->Version(1)
+ ->Version(2)
->Serializer();
}
@@ -250,7 +277,7 @@ namespace AZ
Attribute(Script::Attributes::ExcludeFrom, Script::Attributes::ExcludeFlags::All)->
Attribute(Script::Attributes::Storage, Script::Attributes::StorageType::Value)->
Attribute(Script::Attributes::GenericConstructorOverride, &Internal::TransformDefaultConstructor)->
- Constructor()->
+ Constructor()->
Method("GetBasis", &Transform::GetBasis)->
Method("GetBasisX", &Transform::GetBasisX)->
Method("GetBasisY", &Transform::GetBasisY)->
@@ -283,15 +310,10 @@ namespace AZ
Attribute(Script::Attributes::ExcludeFrom, Script::Attributes::ExcludeFlags::All)->
Method("GetRotation", &Transform::GetRotation)->
Method("SetRotation", &Transform::SetRotation)->
- Method("GetScale", &Transform::GetScale)->
Method("GetUniformScale", &Transform::GetUniformScale)->
- Method("SetScale", &Transform::SetScale)->
Method("SetUniformScale", &Transform::SetUniformScale)->
- Method("ExtractScale", &Transform::ExtractScale)->
- Attribute(Script::Attributes::ExcludeFrom, Script::Attributes::ExcludeFlags::All)->
Method("ExtractUniformScale", &Transform::ExtractUniformScale)->
Attribute(Script::Attributes::ExcludeFrom, Script::Attributes::ExcludeFlags::All)->
- Method("MultiplyByScale", &Transform::MultiplyByScale)->
Method("MultiplyByUniformScale", &Transform::MultiplyByUniformScale)->
Method("GetInverse", &Transform::GetInverse)->
Method("Invert", &Transform::Invert)->
@@ -310,7 +332,6 @@ namespace AZ
Method("CreateFromQuaternionAndTranslation", &Transform::CreateFromQuaternionAndTranslation)->
Method("CreateFromMatrix3x3", &Transform::CreateFromMatrix3x3)->
Method("CreateFromMatrix3x3AndTranslation", &Transform::CreateFromMatrix3x3AndTranslation)->
- Method("CreateScale", &Transform::CreateScale)->
Method("CreateUniformScale", &Transform::CreateUniformScale)->
Method("CreateTranslation", &Transform::CreateTranslation)->
Method("ConstructFromValuesNumeric", &Internal::ConstructTransformFromValues);
@@ -321,7 +342,7 @@ namespace AZ
{
Transform result;
Matrix3x3 tmp = value;
- result.m_scale = tmp.ExtractScale();
+ result.m_scale = tmp.ExtractScale().GetMaxElement();
result.m_rotation = Quaternion::CreateFromMatrix3x3(tmp);
result.m_translation = Vector3::CreateZero();
return result;
@@ -331,7 +352,7 @@ namespace AZ
{
Transform result;
Matrix3x3 tmp = value;
- result.m_scale = tmp.ExtractScale();
+ result.m_scale = tmp.ExtractScale().GetMaxElement();
result.m_rotation = Quaternion::CreateFromMatrix3x3(tmp);
result.m_translation = p;
return result;
@@ -341,7 +362,7 @@ namespace AZ
{
Transform result;
Matrix3x4 tmp = value;
- result.m_scale = tmp.ExtractScale();
+ result.m_scale = tmp.ExtractScale().GetMaxElement();
result.m_rotation = Quaternion::CreateFromMatrix3x4(tmp);
result.m_translation = value.GetTranslation();
return result;
diff --git a/Code/Framework/AzCore/AzCore/Math/Transform.h b/Code/Framework/AzCore/AzCore/Math/Transform.h
index 7ae86edd89..3fe6ddc98a 100644
--- a/Code/Framework/AzCore/AzCore/Math/Transform.h
+++ b/Code/Framework/AzCore/AzCore/Math/Transform.h
@@ -25,10 +25,13 @@ namespace AZ
: public SerializeContext::IDataSerializer
{
public:
- // number of floats in the serialized representation, 4 for rotation, 3 for scale and 3 for translation
- static constexpr int NumFloats = 10;
+ // number of floats in the serialized representation, 4 for rotation, 1 for scale and 3 for translation
+ static constexpr int NumFloats = 8;
- // number of floats in the old format, which stored a 3x4 matrix
+ // number of floats in version 1, which used 4 for rotation, 3 for scale and 3 for translation
+ static constexpr int NumFloatsVersion1 = 10;
+
+ // number of floats in version 0, which stored a 3x4 matrix
static constexpr int NumFloatsVersion0 = 12;
size_t Save(const void* classPtr, IO::GenericStream& stream, bool isDataBigEndian) override;
@@ -45,7 +48,7 @@ namespace AZ
static constexpr float MaxTransformScale = 1e9f;
//! @}
- //! The basic transformation class, represented using a quaternion rotation, vector scale and vector translation.
+ //! The basic transformation class, represented using a quaternion rotation, float scale and vector translation.
//! By design, cannot represent skew transformations.
class Transform
{
@@ -63,7 +66,7 @@ namespace AZ
Transform() = default;
//! Construct a transform from components.
- Transform(const Vector3& translation, const Quaternion& rotation, const Vector3& scale);
+ Transform(const Vector3& translation, const Quaternion& rotation, float scale);
//! Creates an identity transform.
static Transform CreateIdentity();
@@ -82,16 +85,20 @@ namespace AZ
static Transform CreateFromQuaternionAndTranslation(const class Quaternion& q, const Vector3& p);
//! Constructs from a Matrix3x3, translation is set to zero.
+ //! Note that Transform only allows uniform scale, so if the matrix has different scale values along its axes,
+ //! the largest matrix scale value will be used to uniformly scale the Transform.
static Transform CreateFromMatrix3x3(const class Matrix3x3& value);
- //! Constructs from a Matrix3x3, translation is set to zero.
+ //! Constructs from a Matrix3x3 and translation Vector3.
+ //! Note that Transform only allows uniform scale, so if the matrix has different scale values along its axes,
+ //! the largest matrix scale value will be used to uniformly scale the Transform.
static Transform CreateFromMatrix3x3AndTranslation(const class Matrix3x3& value, const Vector3& p);
+ //! Constructs from a Matrix3x4.
+ //! Note that Transform only allows uniform scale, so if the matrix has different scale values along its axes,
+ //! the largest matrix scale value will be used to uniformly scale the Transform.
static Transform CreateFromMatrix3x4(const Matrix3x4& value);
- //! Sets the transform to apply scale only, no rotation or translation.
- static Transform CreateScale(const AZ::Vector3& scale);
-
//! Sets the transform to apply (uniform) scale only, no rotation or translation.
static Transform CreateUniformScale(const float scale);
@@ -122,18 +129,12 @@ namespace AZ
const Quaternion& GetRotation() const;
void SetRotation(const Quaternion& rotation);
- Vector3 GetScale() const;
float GetUniformScale() const;
- void SetScale(const Vector3& v);
void SetUniformScale(const float scale);
- //! Sets the transform's scale to a unit value and returns the previous scale value.
- Vector3 ExtractScale();
-
//! Sets the transform's scale to a unit value and returns the previous scale value.
float ExtractUniformScale();
- void MultiplyByScale(const AZ::Vector3& scale);
void MultiplyByUniformScale(float scale);
Transform operator*(const Transform& rhs) const;
@@ -168,7 +169,7 @@ namespace AZ
private:
Quaternion m_rotation;
- Vector3 m_scale;
+ float m_scale;
Vector3 m_translation;
};
diff --git a/Code/Framework/AzCore/AzCore/Math/Transform.inl b/Code/Framework/AzCore/AzCore/Math/Transform.inl
index a7d5e72749..5f71316b52 100644
--- a/Code/Framework/AzCore/AzCore/Math/Transform.inl
+++ b/Code/Framework/AzCore/AzCore/Math/Transform.inl
@@ -12,7 +12,7 @@
namespace AZ
{
- AZ_MATH_INLINE Transform::Transform(const Vector3& translation, const Quaternion& rotation, const Vector3& scale)
+ AZ_MATH_INLINE Transform::Transform(const Vector3& translation, const Quaternion& rotation, float scale)
: m_translation(translation)
, m_rotation(rotation)
, m_scale(scale)
@@ -25,7 +25,7 @@ namespace AZ
{
Transform result;
result.m_rotation = Quaternion::CreateIdentity();
- result.m_scale = Vector3::CreateOne();
+ result.m_scale = 1.0f;
result.m_translation = Vector3::CreateZero();
return result;
}
@@ -49,7 +49,7 @@ namespace AZ
{
Transform result;
result.m_rotation = q;
- result.m_scale = Vector3::CreateOne();
+ result.m_scale = 1.0f;
result.m_translation = Vector3::CreateZero();
return result;
}
@@ -58,26 +58,16 @@ namespace AZ
{
Transform result;
result.m_rotation = q;
- result.m_scale = Vector3::CreateOne();
+ result.m_scale = 1.0f;
result.m_translation = p;
return result;
}
- AZ_MATH_INLINE Transform Transform::CreateScale(const Vector3& scale)
- {
- AZ_WarningOnce("Transform", false, "CreateScale is deprecated, please use CreateUniformScale instead.");
- Transform result;
- result.m_rotation = Quaternion::CreateIdentity();
- result.m_scale = scale;
- result.m_translation = Vector3::CreateZero();
- return result;
- }
-
AZ_MATH_INLINE Transform Transform::CreateUniformScale(float scale)
{
Transform result;
result.m_rotation = Quaternion::CreateIdentity();
- result.m_scale = Vector3(scale);
+ result.m_scale = scale;
result.m_translation = Vector3::CreateZero();
return result;
}
@@ -86,7 +76,7 @@ namespace AZ
{
Transform result;
result.m_rotation = Quaternion::CreateIdentity();
- result.m_scale = Vector3::CreateOne();
+ result.m_scale = 1.0f;
result.m_translation = translation;
return result;
}
@@ -114,17 +104,17 @@ namespace AZ
AZ_MATH_INLINE Vector3 Transform::GetBasisX() const
{
- return m_rotation.TransformVector(Vector3::CreateAxisX(m_scale.GetX()));
+ return m_rotation.TransformVector(Vector3::CreateAxisX(m_scale));
}
AZ_MATH_INLINE Vector3 Transform::GetBasisY() const
{
- return m_rotation.TransformVector(Vector3::CreateAxisY(m_scale.GetY()));
+ return m_rotation.TransformVector(Vector3::CreateAxisY(m_scale));
}
AZ_MATH_INLINE Vector3 Transform::GetBasisZ() const
{
- return m_rotation.TransformVector(Vector3::CreateAxisZ(m_scale.GetZ()));
+ return m_rotation.TransformVector(Vector3::CreateAxisZ(m_scale));
}
AZ_MATH_INLINE void Transform::GetBasisAndTranslation(Vector3* basisX, Vector3* basisY, Vector3* basisZ, Vector3* pos) const
@@ -160,49 +150,23 @@ namespace AZ
m_rotation = rotation;
}
- AZ_MATH_INLINE Vector3 Transform::GetScale() const
- {
- AZ_WarningOnce("Transform", false, "GetScale is deprecated, please use GetUniformScale instead.");
- return m_scale;
- }
-
AZ_MATH_INLINE float Transform::GetUniformScale() const
{
- return m_scale.GetMaxElement();
- }
-
- AZ_MATH_INLINE void Transform::SetScale(const Vector3& scale)
- {
- AZ_WarningOnce("Transform", false, "SetScale is deprecated, please use SetUniformScale instead.");
- m_scale = scale;
+ return m_scale;
}
AZ_MATH_INLINE void Transform::SetUniformScale(const float scale)
{
- m_scale = Vector3(scale);
- }
-
- AZ_MATH_INLINE Vector3 Transform::ExtractScale()
- {
- AZ_WarningOnce("Transform", false, "ExtractScale is deprecated, please use ExtractUniformScale instead.");
- const Vector3 scale = m_scale;
- m_scale = Vector3::CreateOne();
- return scale;
+ m_scale = scale;
}
AZ_MATH_INLINE float Transform::ExtractUniformScale()
{
- const float scale = m_scale.GetMaxElement();
- m_scale = Vector3::CreateOne();
+ const float scale = m_scale;
+ m_scale = 1.0f;
return scale;
}
- AZ_MATH_INLINE void Transform::MultiplyByScale(const Vector3& scale)
- {
- AZ_WarningOnce("Transform", false, "MultiplyByScale is deprecated, please use MultiplyByUniformScale instead.");
- m_scale *= scale;
- }
-
AZ_MATH_INLINE void Transform::MultiplyByUniformScale(float scale)
{
m_scale *= scale;
@@ -240,10 +204,9 @@ namespace AZ
AZ_MATH_INLINE Transform Transform::GetInverse() const
{
- // note - need to be careful about how to calculate inverse when there is non-uniform scale
Transform out;
out.m_rotation = m_rotation.GetConjugate();
- out.m_scale = m_scale.GetReciprocal();
+ out.m_scale = 1.0f / m_scale;
out.m_translation = -out.m_scale * (out.m_rotation.TransformVector(m_translation));
return out;
}
@@ -255,27 +218,27 @@ namespace AZ
AZ_MATH_INLINE bool Transform::IsOrthogonal(float tolerance) const
{
- return m_scale.IsClose(Vector3::CreateOne(), tolerance);
+ return AZ::IsClose(m_scale, 1.0f, tolerance);
}
AZ_MATH_INLINE Transform Transform::GetOrthogonalized() const
{
Transform result;
result.m_rotation = m_rotation;
- result.m_scale = Vector3::CreateOne();
+ result.m_scale = 1.0f;
result.m_translation = m_translation;
return result;
}
AZ_MATH_INLINE void Transform::Orthogonalize()
{
- m_scale = Vector3::CreateOne();
+ m_scale = 1.0f;
}
AZ_MATH_INLINE bool Transform::IsClose(const Transform& rhs, float tolerance) const
{
return m_rotation.IsClose(rhs.m_rotation, tolerance)
- && m_scale.IsClose(rhs.m_scale, tolerance)
+ && AZ::IsClose(m_scale, rhs.m_scale, tolerance)
&& m_translation.IsClose(rhs.m_translation, tolerance);
}
@@ -304,21 +267,21 @@ namespace AZ
AZ_MATH_INLINE void Transform::SetFromEulerDegrees(const Vector3& eulerDegrees)
{
m_translation = Vector3::CreateZero();
- m_scale = Vector3::CreateOne();
+ m_scale = 1.0f;
m_rotation.SetFromEulerDegrees(eulerDegrees);
}
AZ_MATH_INLINE void Transform::SetFromEulerRadians(const Vector3& eulerRadians)
{
m_translation = Vector3::CreateZero();
- m_scale = Vector3::CreateOne();
+ m_scale = 1.0f;
m_rotation.SetFromEulerRadians(eulerRadians);
}
AZ_MATH_INLINE bool Transform::IsFinite() const
{
return m_rotation.IsFinite()
- && m_scale.IsFinite()
+ && AZ::IsFiniteFloat(m_scale)
&& m_translation.IsFinite();
}
diff --git a/Code/Framework/AzCore/AzCore/Math/TransformSerializer.cpp b/Code/Framework/AzCore/AzCore/Math/TransformSerializer.cpp
index 86bc1c36ea..36c40265af 100644
--- a/Code/Framework/AzCore/AzCore/Math/TransformSerializer.cpp
+++ b/Code/Framework/AzCore/AzCore/Math/TransformSerializer.cpp
@@ -67,7 +67,7 @@ namespace AZ
result.Combine(loadResult);
- transformInstance->SetScale(AZ::Vector3(scale));
+ transformInstance->SetUniformScale(scale);
}
return context.Report(
diff --git a/Code/Framework/AzCore/AzCore/Module/ModuleManager.cpp b/Code/Framework/AzCore/AzCore/Module/ModuleManager.cpp
index fe41050b00..0ce3ee5d8d 100644
--- a/Code/Framework/AzCore/AzCore/Module/ModuleManager.cpp
+++ b/Code/Framework/AzCore/AzCore/Module/ModuleManager.cpp
@@ -512,7 +512,7 @@ namespace AZ
// Load DLLs specified in the application descriptor
for (const auto& moduleDescriptor : modules)
{
- // For each module that is loaded, attempt to set the module's folder as a path for dependent module resolution
+ // For each module that is loaded, attempt to set the module's folder as a path for dependent module resolution
moduleSearchPathHelper.SetModuleSearchPath(moduleDescriptor);
LoadModuleOutcome result = LoadDynamicModule(moduleDescriptor.m_dynamicLibraryPath.c_str(), lastStepToPerform, maintainReferences);
diff --git a/Code/Framework/AzCore/AzCore/Serialization/EditContextConstants.inl b/Code/Framework/AzCore/AzCore/Serialization/EditContextConstants.inl
index 1016027966..dfd0707ed2 100644
--- a/Code/Framework/AzCore/AzCore/Serialization/EditContextConstants.inl
+++ b/Code/Framework/AzCore/AzCore/Serialization/EditContextConstants.inl
@@ -123,6 +123,7 @@ namespace AZ
const static AZ::Crc32 NameLabelOverride = AZ_CRC("NameLabelOverride", 0x9ff79cab);
const static AZ::Crc32 AssetPickerTitle = AZ_CRC_CE("AssetPickerTitle");
+ const static AZ::Crc32 HideProductFilesInAssetPicker = AZ_CRC_CE("HideProductFilesInAssetPicker");
const static AZ::Crc32 ChildNameLabelOverride = AZ_CRC("ChildNameLabelOverride", 0x73dd2909);
//! Container attribute that is used to override labels for its elements given the index of the element
const static AZ::Crc32 IndexedChildNameLabelOverride = AZ_CRC("IndexedChildNameLabelOverride", 0x5f313ac2);
diff --git a/Code/Framework/AzCore/AzCore/Settings/SettingsRegistryMergeUtils.cpp b/Code/Framework/AzCore/AzCore/Settings/SettingsRegistryMergeUtils.cpp
index 5870c66633..2abef3f808 100644
--- a/Code/Framework/AzCore/AzCore/Settings/SettingsRegistryMergeUtils.cpp
+++ b/Code/Framework/AzCore/AzCore/Settings/SettingsRegistryMergeUtils.cpp
@@ -88,6 +88,35 @@ namespace AZ::Internal
m_enginePaths.emplace_back(EngineInfo{AZ::IO::FixedMaxPath{value}.LexicallyNormal(), {}});
}
+ AZ::SettingsRegistryInterface::VisitResponse Traverse(
+ [[maybe_unused]] AZStd::string_view path, AZStd::string_view valueName,
+ AZ::SettingsRegistryInterface::VisitAction action, AZ::SettingsRegistryInterface::Type type) override
+ {
+ auto response = AZ::SettingsRegistryInterface::VisitResponse::Continue;
+ if (action == AZ::SettingsRegistryInterface::VisitAction::Begin)
+ {
+ if (type == AZ::SettingsRegistryInterface::Type::Array)
+ {
+ if (valueName.compare("engines") != 0)
+ {
+ response = AZ::SettingsRegistryInterface::VisitResponse::Skip;
+ }
+ }
+ }
+ else if (action == AZ::SettingsRegistryInterface::VisitAction::Value)
+ {
+ if (type == AZ::SettingsRegistryInterface::Type::String)
+ {
+ if (valueName.compare("path") != 0)
+ {
+ response = AZ::SettingsRegistryInterface::VisitResponse::Skip;
+ }
+ }
+ }
+
+ return response;
+ }
+
AZStd::vector m_enginePaths{};
};
diff --git a/Code/Framework/AzCore/Tests/AZTestShared/Math/MathTestHelpers.cpp b/Code/Framework/AzCore/Tests/AZTestShared/Math/MathTestHelpers.cpp
index 42b77f6976..f9616702f1 100644
--- a/Code/Framework/AzCore/Tests/AZTestShared/Math/MathTestHelpers.cpp
+++ b/Code/Framework/AzCore/Tests/AZTestShared/Math/MathTestHelpers.cpp
@@ -68,7 +68,7 @@ namespace AZ
return os
<< "translation: " << transform.GetTranslation()
<< " rotation: " << transform.GetRotation()
- << " scale: " << transform.GetScale();
+ << " scale: " << transform.GetUniformScale();
}
std::ostream& operator<<(std::ostream& os, const Color& color)
diff --git a/Code/Framework/AzCore/Tests/Serialization/Json/TransformSerializerTests.cpp b/Code/Framework/AzCore/Tests/Serialization/Json/TransformSerializerTests.cpp
index 7eabd6e5e0..750f2ebc9c 100644
--- a/Code/Framework/AzCore/Tests/Serialization/Json/TransformSerializerTests.cpp
+++ b/Code/Framework/AzCore/Tests/Serialization/Json/TransformSerializerTests.cpp
@@ -44,7 +44,7 @@ namespace JsonSerializationTests
AZStd::shared_ptr CreateFullySetInstance() override
{
return AZStd::make_shared(
- AZ::Vector3(1.0f, 2.0f, 3.0f), AZ::Quaternion(0.25f, 0.5f, 0.75f, 1.0f), AZ::Vector3(9.0f));
+ AZ::Vector3(1.0f, 2.0f, 3.0f), AZ::Quaternion(0.25f, 0.5f, 0.75f, 1.0f), 9.0f);
}
AZStd::string_view GetJsonForFullySetInstance() override
@@ -95,7 +95,7 @@ namespace JsonSerializationTests
AZ::Transform expectedTransform(
AZ::Vector3(2.25f, 3.5f, 4.75f),
AZ::Quaternion(0.25f, 0.5f, 0.75f, 1.0f),
- AZ::Vector3(5.5f));
+ 5.5f);
rapidjson::Document json;
json.Parse(R"({ "Translation": [ 2.25, 3.5, 4.75 ], "Rotation": [ 0.25, 0.5, 0.75, 1.0 ], "Scale": 5.5 })");
diff --git a/Code/Framework/AzFramework/AzFramework/Components/TransformComponent.cpp b/Code/Framework/AzFramework/AzFramework/Components/TransformComponent.cpp
index 49adab2252..b3c4f1b256 100644
--- a/Code/Framework/AzFramework/AzFramework/Components/TransformComponent.cpp
+++ b/Code/Framework/AzFramework/AzFramework/Components/TransformComponent.cpp
@@ -406,21 +406,10 @@ namespace AzFramework
return m_localTM.GetRotation();
}
- void TransformComponent::SetLocalScale(const AZ::Vector3& scale)
- {
- AZ::Transform newLocalTM = m_localTM;
- newLocalTM.SetScale(scale);
- SetLocalTM(newLocalTM);
- }
-
AZ::Vector3 TransformComponent::GetLocalScale()
{
- return m_localTM.GetScale();
- }
-
- AZ::Vector3 TransformComponent::GetWorldScale()
- {
- return m_worldTM.GetScale();
+ AZ_WarningOnce("TransformComponent", false, "GetLocalScale is deprecated, please use GetLocalUniformScale instead");
+ return AZ::Vector3(m_localTM.GetUniformScale());
}
void TransformComponent::SetLocalUniformScale(float scale)
@@ -756,11 +745,11 @@ namespace AzFramework
->Event("GetLocalRotationQuaternion", &AZ::TransformBus::Events::GetLocalRotationQuaternion)
->Attribute("Rotation", AZ::Edit::Attributes::PropertyRotation)
->VirtualProperty("Rotation", "GetLocalRotationQuaternion", "SetLocalRotationQuaternion")
- ->Event("SetLocalScale", &AZ::TransformBus::Events::SetLocalScale)
->Event("GetLocalScale", &AZ::TransformBus::Events::GetLocalScale)
->Attribute("Scale", AZ::Edit::Attributes::PropertyScale)
- ->VirtualProperty("Scale", "GetLocalScale", "SetLocalScale")
- ->Event("GetWorldScale", &AZ::TransformBus::Events::GetWorldScale)
+ ->Event("SetLocalUniformScale", &AZ::TransformBus::Events::SetLocalUniformScale)
+ ->Event("GetLocalUniformScale", &AZ::TransformBus::Events::GetLocalUniformScale)
+ ->VirtualProperty("Uniform Scale", "GetLocalUniformScale", "SetLocalUniformScale")
->Event("GetChildren", &AZ::TransformBus::Events::GetChildren)
->Event("GetAllDescendants", &AZ::TransformBus::Events::GetAllDescendants)
->Event("GetEntityAndAllDescendants", &AZ::TransformBus::Events::GetEntityAndAllDescendants)
diff --git a/Code/Framework/AzFramework/AzFramework/Components/TransformComponent.h b/Code/Framework/AzFramework/AzFramework/Components/TransformComponent.h
index 9009c6bff9..0301334a0d 100644
--- a/Code/Framework/AzFramework/AzFramework/Components/TransformComponent.h
+++ b/Code/Framework/AzFramework/AzFramework/Components/TransformComponent.h
@@ -128,9 +128,7 @@ namespace AzFramework
AZ::Quaternion GetLocalRotationQuaternion() override;
// Scale Modifiers
- void SetLocalScale(const AZ::Vector3& scale) override;
AZ::Vector3 GetLocalScale() override;
- AZ::Vector3 GetWorldScale() override;
void SetLocalUniformScale(float scale) override;
float GetLocalUniformScale() override;
diff --git a/Code/Framework/AzFramework/AzFramework/Physics/ClassConverters.cpp b/Code/Framework/AzFramework/AzFramework/Physics/ClassConverters.cpp
index e43bda4c88..4f206858af 100644
--- a/Code/Framework/AzFramework/AzFramework/Physics/ClassConverters.cpp
+++ b/Code/Framework/AzFramework/AzFramework/Physics/ClassConverters.cpp
@@ -259,11 +259,18 @@ namespace Physics
if (success)
{
- success = success && dataElement.RemoveElementByName(AZ_CRC("MaterialId", 0x9360e002));
+ dataElement.RemoveElementByName(AZ_CRC("MaterialId", 0x9360e002));
+ success = success && (dataElement.FindElement(AZ_CRC("MaterialId", 0x9360e002)) < 0);
success = success && dataElement.AddElementWithData(context, "MaterialIds", AZStd::vector { materialId });
}
}
+ if (success && dataElement.GetVersion() <= 2)
+ {
+ dataElement.RemoveElementByName(AZ_CRC_CE("Material"));
+ success = success && (dataElement.FindElement(AZ_CRC_CE("Material")) < 0);
+ }
+
return success;
}
} // namespace ClassConverters
diff --git a/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsEvents.h b/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsEvents.h
index d5a82c0367..a3a34dc1df 100644
--- a/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsEvents.h
+++ b/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsEvents.h
@@ -58,9 +58,18 @@ namespace AzPhysics
//! When triggered will send the handle to the old Scene (after this call, the Handle will be invalid).
using OnSceneRemovedEvent = AZ::Event;
- //! Event that triggers when the default material library changes.
+ //! Event that triggers when the material library changes.
//! When triggered the event will send the Asset Id of the new material library.
- using OnDefaultMaterialLibraryChangedEvent = AZ::Event;
+ using OnMaterialLibraryChangedEvent = AZ::Event;
+
+ enum class MaterialLibraryLoadErrorType : uint8_t
+ {
+ InvalidId,
+ ErrorLoading
+ };
+
+ //! Event that triggers when the default material library has loaded with errors.
+ using OnMaterialLibraryLoadErrorEvent = AZ::Event;
//! Event that triggers when the default scene configuration changes.
//! When triggered the event will send the new default scene configuration.
diff --git a/Code/Framework/AzFramework/AzFramework/Physics/Configuration/SystemConfiguration.cpp b/Code/Framework/AzFramework/AzFramework/Physics/Configuration/SystemConfiguration.cpp
index cd250b71a9..d7532cbfea 100644
--- a/Code/Framework/AzFramework/AzFramework/Physics/Configuration/SystemConfiguration.cpp
+++ b/Code/Framework/AzFramework/AzFramework/Physics/Configuration/SystemConfiguration.cpp
@@ -39,6 +39,8 @@ namespace AzPhysics
->Field("ShapecastBufferSize", &SystemConfiguration::m_shapecastBufferSize)
->Field("OverlapBufferSize", &SystemConfiguration::m_overlapBufferSize)
->Field("CollisionConfig", &SystemConfiguration::m_collisionConfig)
+ ->Field("DefaultMaterial", &SystemConfiguration::m_defaultMaterialConfiguration)
+ ->Field("MaterialLibrary", &SystemConfiguration::m_materialLibraryAsset)
;
if (AZ::EditContext* editContext = serializeContext->GetEditContext())
@@ -79,7 +81,9 @@ namespace AzPhysics
m_overlapBufferSize == other.m_overlapBufferSize &&
AZ::IsClose(m_maxTimestep, other.m_maxTimestep) &&
AZ::IsClose(m_fixedTimestep, other.m_fixedTimestep) &&
- m_collisionConfig == other.m_collisionConfig
+ m_collisionConfig == other.m_collisionConfig &&
+ m_defaultMaterialConfiguration == other.m_defaultMaterialConfiguration &&
+ m_materialLibraryAsset == other.m_materialLibraryAsset
;
}
diff --git a/Code/Framework/AzFramework/AzFramework/Physics/Configuration/SystemConfiguration.h b/Code/Framework/AzFramework/AzFramework/Physics/Configuration/SystemConfiguration.h
index 0a00d627a7..56fe9a68c4 100644
--- a/Code/Framework/AzFramework/AzFramework/Physics/Configuration/SystemConfiguration.h
+++ b/Code/Framework/AzFramework/AzFramework/Physics/Configuration/SystemConfiguration.h
@@ -13,6 +13,7 @@
#include
#include
+#include
namespace AZ
{
@@ -45,6 +46,9 @@ namespace AzPhysics
//! Each Physics Scene uses this as a base and will override as needed.
CollisionConfiguration m_collisionConfig;
+ Physics::MaterialConfiguration m_defaultMaterialConfiguration; //!< Default material parameters for the project.
+ AZ::Data::Asset m_materialLibraryAsset = AZ::Data::AssetLoadBehavior::NoLoad; //!< Material Library exposed by the system component SystemBus API.
+
//! Controls whether the Physics System will self register to the TickBus and call StartSimulation / FinishSimulation on each Scene.
//! Disable this to manually control Physics Scene simulation logic.
bool m_autoManageSimulationUpdate = true;
diff --git a/Code/Framework/AzFramework/AzFramework/Physics/Material.cpp b/Code/Framework/AzFramework/AzFramework/Physics/Material.cpp
index 5552cef448..78e0431753 100644
--- a/Code/Framework/AzFramework/AzFramework/Physics/Material.cpp
+++ b/Code/Framework/AzFramework/AzFramework/Physics/Material.cpp
@@ -49,10 +49,7 @@ namespace Physics
{
materialSelection->SetMaterialSlots(Physics::MaterialSelection::SlotsArray());
}
- if (materialSelection->IsDefaultMaterialLibraryAsset())
- {
- materialSelection->SyncSelectionToMaterialLibrary();
- }
+ materialSelection->SyncSelectionToMaterialLibrary();
}
};
@@ -122,6 +119,24 @@ namespace Physics
}
}
+ bool MaterialConfiguration::operator==(const MaterialConfiguration& other) const
+ {
+ return m_surfaceType == other.m_surfaceType &&
+ AZ::IsClose(m_dynamicFriction, other.m_dynamicFriction) &&
+ AZ::IsClose(m_staticFriction, other.m_staticFriction) &&
+ AZ::IsClose(m_restitution, other.m_restitution) &&
+ AZ::IsClose(m_density, other.m_density) &&
+ m_restitutionCombine == other.m_restitutionCombine &&
+ m_frictionCombine == other.m_frictionCombine &&
+ m_debugColor == other.m_debugColor
+ ;
+ }
+
+ bool MaterialConfiguration::operator!=(const MaterialConfiguration& other) const
+ {
+ return !(*this == other);
+ }
+
AZ::Color MaterialConfiguration::GenerateDebugColor(const char* materialName)
{
static const AZ::Color colors[] =
@@ -191,51 +206,25 @@ namespace Physics
//////////////////////////////////////////////////////////////////////////
- void MaterialLibraryAssetReflectionWrapper::Reflect(AZ::ReflectContext* context)
- {
- AZ::SerializeContext* serializeContext = azrtti_cast(context);
- if (serializeContext)
- {
- serializeContext->Class()
- ->Version(1)
- ->Field("Asset", &MaterialLibraryAssetReflectionWrapper::m_asset)
- ;
-
- AZ::EditContext* editContext = serializeContext->GetEditContext();
- if (editContext)
- {
- editContext->Class("", "")
- ->ClassElement(AZ::Edit::ClassElements::EditorData, "")
- ->Attribute(AZ::Edit::Attributes::AutoExpand, "")
- ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly)
- ->DataElement(AZ::Edit::UIHandlers::Default, &MaterialLibraryAssetReflectionWrapper::m_asset, "Physics Material Library", "Physics Material Library")
- ->Attribute("EditButton", "")
- ;
- }
- }
- }
-
- //////////////////////////////////////////////////////////////////////////
-
-
- void DefaultMaterialLibraryAssetReflectionWrapper::Reflect(AZ::ReflectContext* context)
+ void MaterialInfoReflectionWrapper::Reflect(AZ::ReflectContext* context)
{
AZ::SerializeContext* serializeContext = azrtti_cast(context);
if (serializeContext)
{
- serializeContext->Class()
+ serializeContext->Class()
->Version(1)
- ->Field("Asset", &DefaultMaterialLibraryAssetReflectionWrapper::m_asset)
+ ->Field("DefaultMaterial", &MaterialInfoReflectionWrapper::m_defaultMaterialConfiguration)
+ ->Field("Asset", &MaterialInfoReflectionWrapper::m_materialLibraryAsset)
;
AZ::EditContext* editContext = serializeContext->GetEditContext();
if (editContext)
{
- editContext->Class("", "")
+ editContext->Class("Physics Materials", "")
->ClassElement(AZ::Edit::ClassElements::EditorData, "")
- ->Attribute(AZ::Edit::Attributes::AutoExpand, "")
- ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly)
- ->DataElement(AZ::Edit::UIHandlers::Default, &DefaultMaterialLibraryAssetReflectionWrapper::m_asset, "Default Physics Material Library", "Library to use by default")
+ ->Attribute(AZ::Edit::Attributes::AutoExpand, true)
+ ->DataElement(AZ::Edit::UIHandlers::Default, &MaterialInfoReflectionWrapper::m_defaultMaterialConfiguration, "Default Physics Material", "Material used by default")
+ ->DataElement(AZ::Edit::UIHandlers::Default, &MaterialInfoReflectionWrapper::m_materialLibraryAsset, "Physics Material Library", "Library to use for the project")
->Attribute(AZ::Edit::Attributes::AllowClearAsset, false)
->Attribute("EditButton", "")
;
@@ -269,6 +258,17 @@ namespace Physics
}
}
+ bool MaterialFromAssetConfiguration::operator==(const MaterialFromAssetConfiguration& other) const
+ {
+ return m_configuration == other.m_configuration &&
+ m_id == other.m_id;
+ }
+
+ bool MaterialFromAssetConfiguration::operator!=(const MaterialFromAssetConfiguration& other) const
+ {
+ return !(*this == other);
+ }
+
//////////////////////////////////////////////////////////////////////////
bool MaterialLibraryAsset::GetDataForMaterialId(const MaterialId& materialId, MaterialFromAssetConfiguration& configuration) const
@@ -370,9 +370,8 @@ namespace Physics
if (auto serializeContext = azrtti_cast(context))
{
serializeContext->Class()
- ->Version(2, &ClassConverters::MaterialSelectionConverter)
+ ->Version(3, &ClassConverters::MaterialSelectionConverter)
->EventHandler()
- ->Field("Material", &MaterialSelection::m_materialLibrary)
->Field("MaterialIds", &MaterialSelection::m_materialIdsAssignedToSlots)
;
@@ -381,14 +380,8 @@ namespace Physics
editContext->Class("Physics Material", "Select physics material library and which materials to use for the object")
->ClassElement(AZ::Edit::ClassElements::EditorData, "")
->Attribute(AZ::Edit::Attributes::AutoExpand, true)
- ->DataElement(AZ::Edit::UIHandlers::Default, &MaterialSelection::m_materialLibrary, "Library", "Physics material library to use for this object")
- ->Attribute(AZ::Edit::Attributes::ContainerCanBeModified, true)
- ->Attribute("EditButton", "")
- ->Attribute("EditDescription", "Open in Asset Editor")
- ->Attribute(AZ::Edit::Attributes::DefaultAsset, &MaterialSelection::GetDefaultMaterialLibraryId)
- ->Attribute(AZ::Edit::Attributes::ChangeNotify, &MaterialSelection::OnMaterialLibraryChanged)
->DataElement(AZ::Edit::UIHandlers::Default, &MaterialSelection::m_materialIdsAssignedToSlots, "Mesh Surfaces", "Specify which Physics Material to use for each element of this object")
- ->ElementAttribute(Attributes::MaterialLibraryAssetId, &MaterialSelection::GetMaterialLibraryAssetId)
+ ->ElementAttribute(Attributes::MaterialLibraryAssetId, &MaterialSelection::GetMaterialLibraryId)
->Attribute(AZ::Edit::Attributes::IndexedChildNameLabelOverride, &MaterialSelection::GetMaterialSlotLabel)
->Attribute(AZ::Edit::Attributes::AutoExpand, true)
->ElementAttribute(AZ::Edit::Attributes::ReadOnly, &MaterialSelection::AreMaterialSlotsReadOnly)
@@ -398,12 +391,6 @@ namespace Physics
}
}
- AZ::u32 MaterialSelection::OnMaterialLibraryChanged()
- {
- SyncSelectionToMaterialLibrary();
- return AZ::Edit::PropertyRefreshLevels::EntireTree;
- }
-
AZStd::string MaterialSelection::GetMaterialSlotLabel(int index)
{
if (index < m_materialSlots.size())
@@ -425,28 +412,9 @@ namespace Physics
}
}
- AZ::Data::AssetId MaterialSelection::GetMaterialLibraryAssetId() const
+ void MaterialSelection::OnMaterialLibraryChanged([[maybe_unused]] const AZ::Data::AssetId& defaultMaterialLibraryId)
{
- return GetMaterialLibraryAsset().GetId();
- }
-
- const Physics::MaterialLibraryAsset* MaterialSelection::GetMaterialLibraryAssetData() const
- {
- return GetMaterialLibraryAsset().Get();
- }
-
- const AZStd::string& MaterialSelection::GetMaterialLibraryAssetHint() const
- {
- return m_materialLibrary.GetHint();
- }
-
- void MaterialSelection::OnDefaultMaterialLibraryChanged(const AZ::Data::AssetId& defaultMaterialLibraryId)
- {
- AZ_UNUSED(defaultMaterialLibraryId);
- if (IsDefaultMaterialLibraryAsset())
- {
- OnMaterialLibraryChanged();
- }
+ SyncSelectionToMaterialLibrary();
}
void MaterialSelection::SetSlotsReadOnly(bool readOnly)
@@ -454,45 +422,6 @@ namespace Physics
m_slotsReadOnly = readOnly;
}
- bool MaterialSelection::IsMaterialLibraryValid() const
- {
- if (GetMaterialLibraryAssetId().IsValid())
- {
- auto materialAsset = LoadAsset();
- const auto& materialsData = materialAsset.Get()->GetMaterialsData();
-
- if (materialsData.size() != 0)
- {
- return true;
- }
- }
- return false;
- }
-
- bool MaterialSelection::GetMaterialConfiguration(Physics::MaterialFromAssetConfiguration& configuration, const Physics::MaterialId& materialId) const
- {
- if (IsMaterialLibraryValid())
- {
- auto materialAsset = LoadAsset();
- if (materialAsset.Get())
- {
- return materialAsset.Get()->GetDataForMaterialId(materialId, configuration);
- }
- }
- return false;
- }
-
- void MaterialSelection::SetMaterialLibrary(const AZ::Data::AssetId& assetId)
- {
- m_materialLibrary = AZ::Data::AssetManager::Instance().GetAsset(assetId, m_materialLibrary.GetAutoLoadBehavior());
- m_materialLibrary.BlockUntilLoadComplete();
- }
-
- void MaterialSelection::ResetToDefaultMaterialLibrary()
- {
- m_materialLibrary = {};
- }
-
void MaterialSelection::SetMaterialSlots(const SlotsArray& slots)
{
if (slots.empty())
@@ -533,74 +462,45 @@ namespace Physics
m_materialIdsAssignedToSlots[slotIndex] = materialId;
}
- AZ::Data::Asset MaterialSelection::LoadAsset() const
- {
- AZ::Data::Asset asset = AZ::Data::AssetManager::Instance()
- .GetAsset(GetMaterialLibraryAssetId(), AZ::Data::AssetLoadBehavior::Default);
-
- asset.BlockUntilLoadComplete();
-
- return asset;
- }
-
void MaterialSelection::SyncSelectionToMaterialLibrary()
{
- if (GetMaterialLibraryAssetId().IsValid())
+ auto* materialLibrary = GetMaterialLibrary().Get();
+ if (!materialLibrary)
{
- auto materialLibraryAsset = AZ::Data::AssetManager::Instance().GetAsset(GetMaterialLibraryAssetId(), AZ::Data::AssetLoadBehavior::Default);
+ return;
+ }
- materialLibraryAsset.BlockUntilLoadComplete();
-
- // We try to check whether existing selection matches any materials in the newly assigned library and do one of the following:
- // 1. If previous MaterialId is invalid for this material library, and it is not the Default material, we set it to the Default material from the library.
- // 2. If it's valid, or it is the Default material, we don't change it (useful when user accidentally re-assigns the same library: previous selection won't go away).
-
- if (materialLibraryAsset.Get())
+ for (Physics::MaterialId& materialId : m_materialIdsAssignedToSlots)
+ {
+ // Leave nulls (default) unchanged.
+ if (materialId.IsNull())
{
- for (Physics::MaterialId& materialId : m_materialIdsAssignedToSlots)
- {
- if (!materialLibraryAsset.Get()->HasDataForMaterialId(materialId)
- && !materialId.IsNull()) // Null materialId is the Default material.
- {
- materialId = MaterialId();
- }
- }
+ continue;
}
- else
+
+ // If the material id is not present in the library anymore, set it to default
+ if (!materialLibrary->HasDataForMaterialId(materialId))
{
- AZ_Warning("PhysX", false, "MaterialSelection: invalid material library");
+ materialId = MaterialId();
}
}
}
- const AZ::Data::Asset& MaterialSelection::GetMaterialLibraryAsset() const
- {
- if (IsDefaultMaterialLibraryAsset())
- {
- const AZ::Data::Asset& defaultMaterialLibrary = GetDefaultMaterialLibrary();
- return defaultMaterialLibrary;
- }
-
- return m_materialLibrary;
- }
-
- bool MaterialSelection::IsDefaultMaterialLibraryAsset() const
- {
- return !m_materialLibrary.GetId().IsValid();
- }
-
- const AZ::Data::Asset& MaterialSelection::GetDefaultMaterialLibrary()
+ const AZ::Data::Asset& MaterialSelection::GetMaterialLibrary()
{
if (auto* physicsSystem = AZ::Interface::Get())
{
- return physicsSystem->GetDefaultMaterialLibrary();
+ if (const auto* physicsConfiguration = physicsSystem->GetConfiguration())
+ {
+ return physicsConfiguration->m_materialLibraryAsset;
+ }
}
return s_invalidMaterialLibrary;
}
- const AZ::Data::AssetId& MaterialSelection::GetDefaultMaterialLibraryId()
+ const AZ::Data::AssetId& MaterialSelection::GetMaterialLibraryId()
{
- return GetDefaultMaterialLibrary().GetId();
+ return GetMaterialLibrary().GetId();
}
bool MaterialSelection::AreMaterialSlotsReadOnly() const
diff --git a/Code/Framework/AzFramework/AzFramework/Physics/Material.h b/Code/Framework/AzFramework/AzFramework/Physics/Material.h
index e9eaae929f..69edf3ed25 100644
--- a/Code/Framework/AzFramework/AzFramework/Physics/Material.h
+++ b/Code/Framework/AzFramework/AzFramework/Physics/Material.h
@@ -29,7 +29,6 @@ namespace Physics
/// =========================
/// This is the interface to the wrapper around native material type (such as PxMaterial in PhysX gem)
/// that stores extra metadata, like Surface Type name.
- /// To see more details about PhysX implementation please refer to PhysX::Material class
///
/// Usage example
/// -------------------------
@@ -37,14 +36,7 @@ namespace Physics
///
/// Physics::MaterialConfiguration materialProperties;
/// AZStd::shared_ptr newMaterial = AZ::Interface::Get()->CreateMaterial(materialProperties);
- ///
- /// To get PxMaterial use GetNativePointer function
- ///
- /// physx::PxMaterial* material = static_cast(newMaterial->GetNativePointer());
- ///
- /// You can use retrieved PxMaterial pointer on its own, provided you increment its reference count.
- /// If this class goes out of scope, the PxMaterial pointer will be valid, but its userData
- /// will be cleaned up to point to nullptr.
+ ///
class Material
{
public:
@@ -63,9 +55,9 @@ namespace Physics
/// Returns AZ::Crc32 of the surface name.
virtual AZ::Crc32 GetSurfaceType() const = 0;
- virtual void SetSurfaceType(AZ::Crc32 surfaceType) = 0;
virtual const AZStd::string& GetSurfaceTypeName() const = 0;
+ virtual void SetSurfaceTypeName(const AZStd::string& surfaceTypeName) = 0;
virtual float GetDynamicFriction() const = 0;
virtual void SetDynamicFriction(float dynamicFriction) = 0;
@@ -85,6 +77,9 @@ namespace Physics
virtual float GetDensity() const = 0;
virtual void SetDensity(float density) = 0;
+ virtual AZ::Color GetDebugColor() const = 0;
+ virtual void SetDebugColor(const AZ::Color& debugColor) = 0;
+
/// If the name of this material matches the name of one of the CrySurface types, it will return its CrySurface Id.\n
/// If there's no match it will return default CrySurface Id.\n
/// CrySurface types are defined in libs/materialeffects/surfacetypes.xml
@@ -122,6 +117,10 @@ namespace Physics
Material::CombineMode m_frictionCombine = Material::CombineMode::Average;
AZ::Color m_debugColor = AZ::Colors::White;
+
+ bool operator==(const MaterialConfiguration& other) const;
+ bool operator!=(const MaterialConfiguration& other) const;
+
private:
static bool VersionConverter(AZ::SerializeContext& context, AZ::SerializeContext::DataElementNode& classElement);
static AZ::Color GenerateDebugColor(const char* materialName);
@@ -147,6 +146,7 @@ namespace Physics
static MaterialId FromUUID(const AZ::Uuid& uuid);
bool IsNull() const { return m_id.IsNull(); }
bool operator==(const MaterialId& other) const { return m_id == other.m_id; }
+ bool operator!=(const MaterialId& other) const { return !(*this == other); }
const AZ::Uuid& GetUuid() const { return m_id; }
private:
@@ -166,6 +166,9 @@ namespace Physics
MaterialConfiguration m_configuration;
MaterialId m_id;
+
+ bool operator==(const MaterialFromAssetConfiguration& other) const;
+ bool operator!=(const MaterialFromAssetConfiguration& other) const;
};
/// An asset that holds a list of materials to be edited and assigned in Open 3D Engine Editor
@@ -222,40 +225,27 @@ namespace Physics
AZStd::vector m_materialLibrary;
};
- /// The class is used to expose a MaterialLibraryAsset to Edit Context
+ /// The class is used to expose a default material and material library asset to Edit Context
/// =======================================================================
///
/// Since AZ::Data::Asset doesn't reflect the data to EditContext
/// we have to have a wrapper doing it.
- class MaterialLibraryAssetReflectionWrapper
+ class MaterialInfoReflectionWrapper
{
public:
- AZ_CLASS_ALLOCATOR(MaterialLibraryAssetReflectionWrapper, AZ::SystemAllocator, 0);
- AZ_TYPE_INFO(Physics::MaterialLibraryAssetReflectionWrapper, "{3D2EF5DF-EFD0-47EB-B88F-3E6FE1FEE5B0}");
+ AZ_CLASS_ALLOCATOR(MaterialInfoReflectionWrapper, AZ::SystemAllocator, 0);
+ AZ_TYPE_INFO(Physics::MaterialInfoReflectionWrapper, "{02AB8CBC-D35B-4E0F-89BA-A96D94DAD4F9}");
static void Reflect(AZ::ReflectContext* context);
- AZ::Data::Asset m_asset =
+ Physics::MaterialConfiguration m_defaultMaterialConfiguration;
+ AZ::Data::Asset m_materialLibraryAsset =
AZ::Data::AssetLoadBehavior::NoLoad;
};
- /// Customized material library for use as default material library
- class DefaultMaterialLibraryAssetReflectionWrapper : public Physics::MaterialLibraryAssetReflectionWrapper
- {
- public:
- AZ_CLASS_ALLOCATOR(MaterialLibraryAssetReflectionWrapper, AZ::SystemAllocator, 0);
- AZ_TYPE_INFO(Physics::DefaultMaterialLibraryAssetReflectionWrapper, "{02AB8CBC-D35B-4E0F-89BA-A96D94DAD4F9}");
- static void Reflect(AZ::ReflectContext* context);
-
- AZ::Data::Asset m_asset =
- AZ::Data::AssetLoadBehavior::NoLoad;
- };
-
- /// The class is used to store a MaterialLibraryAsset and a vector of MaterialIds selected from the library
+ /// The class is used to store a vector of MaterialIds selected from the library
/// =======================================================================
///
- /// This class is used to store a reference to the library asset and user's
- /// selection of the materials from this library.\n
- /// It also reflects UI controls for assigning MaterialLibraryAsset and selecting a material from it.
+ /// This class is used to store the user's selection of the materials from this library.
/// You can reflect this class in EditorContext to provide UI for selecting materials
/// on any custom component or QWidget.
class MaterialSelection
@@ -269,27 +259,6 @@ namespace Physics
static void Reflect(AZ::ReflectContext* context);
- /// Returns whether MaterialLibraryAsset assigned to this selection exists and valid. Attempts to load
- /// the library if it's not loaded yet.
- /// @return true if MaterialLibraryAsset has a valid AssetId, loaded and isn't empty
- bool IsMaterialLibraryValid() const;
-
- /// Looks up MaterialLibraryAsset for MaterialFromAssetConfiguration with MaterialId that is stored intrenally.
- /// @param configuration contains material data if there is a material selected by user
- /// and if it exists in the MaterialLibraryAsset
- /// @param materialId MaterialId to retrieve MaterialFromAssetConfiguration for
- /// @return true if lookup was successful.
- bool GetMaterialConfiguration(Physics::MaterialFromAssetConfiguration& configuration, const Physics::MaterialId& materialId) const;
-
- /// Sets and loads MaterialLibraryAsset with specified AssetId.
- /// It is used to construct MaterialSelection at runtime.
- /// It is not a typical use case and mostly needed to convert legacy entities and auto-generate material libraries
- /// @param assetId AssetId to create MaterialLibraryAsset with
- void SetMaterialLibrary(const AZ::Data::AssetId& assetId);
-
- /// Sets the material library to none, this will cause to use the project-wide default material library
- void ResetToDefaultMaterialLibrary();
-
/// Sets an array of material slots to pick MaterialIds for. Having multiple slots is required for assigning multiple materials on a mesh
/// or heightfield object. SlotsArray can be empty and in this case Default slot will be created.
/// @param slots Array of names for slots. Can be empty, in this case Default slot will be created
@@ -298,48 +267,34 @@ namespace Physics
/// Returns a list of MaterialId that were assigned for each corresponding slot.
const AZStd::vector& GetMaterialIdsAssignedToSlots() const;
- /// Sets the MaterialId from MaterialLibraryAsset as the selected material at a specific slotIndex.
- /// @param materialId MaterialId that user selected from the MaterialLibraryAsset
- /// @param slotIndex index of the slot to set MaterialId for
+ /// Sets the MaterialId as the selected material at a specific slotIndex.
+ /// @param materialId MaterialId that user selected
+ /// @param slotIndex Index of the slot to set the MaterialId
void SetMaterialId(const Physics::MaterialId& materialId, int slotIndex = 0);
- /// Returns the material library asset id.
- AZ::Data::AssetId GetMaterialLibraryAssetId() const;
-
/// Returns the material id assigned to this selection at a specific slotIndex.
- /// @param slotIndex index of the slot to retrieve MaterialId for
+ /// @param slotIndex Index of the slot to retrieve the MaterialId
Physics::MaterialId GetMaterialId(int slotIndex = 0) const;
- /// Returns the material library asset.
- const Physics::MaterialLibraryAsset* GetMaterialLibraryAssetData() const;
-
- /// Returns the material library asset hint(UI display string)
- const AZStd::string& GetMaterialLibraryAssetHint() const;
-
/// Called when the material library has changed
- void OnDefaultMaterialLibraryChanged(const AZ::Data::AssetId& defaultMaterialLibraryId);
+ void OnMaterialLibraryChanged(const AZ::Data::AssetId& defaultMaterialLibraryId);
/// Set if the material slots are editable in the edit context
void SetSlotsReadOnly(bool readOnly);
private:
- AZ::Data::Asset m_materialLibrary { AZ::Data::AssetLoadBehavior::NoLoad };
AZStd::vector m_materialIdsAssignedToSlots;
SlotsArray m_materialSlots;
bool m_slotsReadOnly = false;
- const AZ::Data::Asset& GetMaterialLibraryAsset() const;
- AZ::Data::Asset LoadAsset() const;
- bool IsDefaultMaterialLibraryAsset() const;
void SyncSelectionToMaterialLibrary();
- static const AZ::Data::Asset& GetDefaultMaterialLibrary();
- static const AZ::Data::AssetId& GetDefaultMaterialLibraryId();
+ static const AZ::Data::Asset& GetMaterialLibrary();
+ static const AZ::Data::AssetId& GetMaterialLibraryId();
bool AreMaterialSlotsReadOnly() const;
// EditorContext callbacks
- AZ::u32 OnMaterialLibraryChanged();
AZStd::string GetMaterialSlotLabel(int index);
};
diff --git a/Code/Framework/AzFramework/AzFramework/Physics/MaterialBus.h b/Code/Framework/AzFramework/AzFramework/Physics/MaterialBus.h
index edfa3096d3..a7e4869df1 100644
--- a/Code/Framework/AzFramework/AzFramework/Physics/MaterialBus.h
+++ b/Code/Framework/AzFramework/AzFramework/Physics/MaterialBus.h
@@ -25,21 +25,26 @@ namespace Physics
static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single;
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single; // Implemented by sole owner of materials, e.g. class MaterialManager in PhysX gem.
- /// Get default material
+ /// Get default material.
virtual AZStd::shared_ptr GetGenericDefaultMaterial() = 0;
/// Returns weak pointers to physics materials.
/// Connect to PhysicsMaterialNotifications::MaterialsReleased to be informed when material pointers are deleted by owner.
virtual void GetMaterials(const MaterialSelection& materialSelection
- , AZStd::vector>& outMaterials) = 0;
+ , AZStd::vector>& outMaterials) = 0;
+
+ /// Returns a weak pointer to physics material with the given id.
+ virtual AZStd::shared_ptr GetMaterialById(Physics::MaterialId id) = 0;
/// Returns a weak pointer to physics material with the given name.
- virtual AZStd::weak_ptr GetMaterialByName(const AZStd::string& name) = 0;
+ virtual AZStd::shared_ptr GetMaterialByName(const AZStd::string& name) = 0;
- /// Returns index of the first selected material in MaterialSelection's material library.
- /// A MaterialSelection can contain multiple material selections.
- /// Returned index is 0-based where 0 is the Default material, and materials from the material library are 1 and onwards.
- virtual AZ::u32 GetFirstSelectedMaterialIndex(const MaterialSelection& materialSelection) = 0;
+ /// Updates the material selection from the physics asset or sets it to default if there's no asset provided.
+ /// @param shapeConfiguration The shape information that contains the physics asset.
+ /// @param materialSelection The material selection to update.
+ virtual void UpdateMaterialSelectionFromPhysicsAsset(
+ const ShapeConfiguration& shapeConfiguration,
+ MaterialSelection& materialSelection) = 0;
};
using PhysicsMaterialRequestBus = AZ::EBus;
diff --git a/Code/Framework/AzFramework/AzFramework/Physics/PhysicsSystem.h b/Code/Framework/AzFramework/AzFramework/Physics/PhysicsSystem.h
index e3ed449046..36ae4dbecb 100644
--- a/Code/Framework/AzFramework/AzFramework/Physics/PhysicsSystem.h
+++ b/Code/Framework/AzFramework/AzFramework/Physics/PhysicsSystem.h
@@ -130,13 +130,6 @@ namespace AzPhysics
//! @param forceReinitialization Flag to force a reinitialization of the physics system. Default false.
virtual void UpdateConfiguration(const SystemConfiguration* newConfig, bool forceReinitialization = false) = 0;
- //! Update the default material library.
- //! @param materialLibrary The new material library asset to use.
- virtual void UpdateDefaultMaterialLibrary(const AZ::Data::Asset& materialLibrary) = 0;
-
- //! Accessor to get the current Material Library. This is also available in the PhysXSystemConfiguration.
- virtual const AZ::Data::Asset& GetDefaultMaterialLibrary() const = 0;
-
//! Update the current default scene configuration.
//! This is the configuration used to to create scenes without a custom configuration.
//! @param sceneConfiguration The new configuration to apply.
@@ -169,9 +162,12 @@ namespace AzPhysics
//! Register to receive notifications when the SystemConfiguration changes.
//! @param handler The handler to receive the event.
void RegisterSystemConfigurationChangedEvent(SystemEvents::OnConfigurationChangedEvent::Handler& handler) { handler.Connect(m_configChangeEvent); }
- //! Register a handler to receive an event when the default material library changes.
+ //! Register a handler to receive an event when the material library changes.
//! @param handler The handler to receive the event.
- void RegisterOnDefaultMaterialLibraryChangedEventHandler(SystemEvents::OnDefaultMaterialLibraryChangedEvent::Handler& handler) { handler.Connect(m_onDefaultMaterialLibraryChangedEvent); }
+ void RegisterOnMaterialLibraryChangedEventHandler(SystemEvents::OnMaterialLibraryChangedEvent::Handler& handler) { handler.Connect(m_onMaterialLibraryChangedEvent); }
+ //! Register a handler to receive an event when the material library fails to load on startup.
+ //! @param handler The handler to receive the event.
+ void RegisterOnMaterialLibraryLoadErrorEventHandler(SystemEvents::OnMaterialLibraryLoadErrorEvent::Handler& handler) { handler.Connect(m_onMaterialLibraryLoadErrorEvent); }
//! Register a handler to receive an event when the default SceneConfiguration changes.
//! @param handler The handler to receive the event.
void RegisterOnDefaultSceneConfigurationChangedEventHandler(SystemEvents::OnDefaultSceneConfigurationChangedEvent::Handler& handler) { handler.Connect(m_onDefaultSceneConfigurationChangedEvent); }
@@ -185,7 +181,8 @@ namespace AzPhysics
SystemEvents::OnSceneAddedEvent m_sceneAddedEvent;
SystemEvents::OnSceneRemovedEvent m_sceneRemovedEvent;
SystemEvents::OnConfigurationChangedEvent m_configChangeEvent;
- SystemEvents::OnDefaultMaterialLibraryChangedEvent m_onDefaultMaterialLibraryChangedEvent;
+ SystemEvents::OnMaterialLibraryChangedEvent m_onMaterialLibraryChangedEvent;
+ SystemEvents::OnMaterialLibraryLoadErrorEvent m_onMaterialLibraryLoadErrorEvent;
SystemEvents::OnDefaultSceneConfigurationChangedEvent m_onDefaultSceneConfigurationChangedEvent;
};
} // namespace AzPhysics
diff --git a/Code/Framework/AzFramework/AzFramework/Physics/ShapeConfiguration.cpp b/Code/Framework/AzFramework/AzFramework/Physics/ShapeConfiguration.cpp
index a535f5f65d..275103bc28 100644
--- a/Code/Framework/AzFramework/AzFramework/Physics/ShapeConfiguration.cpp
+++ b/Code/Framework/AzFramework/AzFramework/Physics/ShapeConfiguration.cpp
@@ -17,6 +17,21 @@
namespace Physics
{
+ namespace Internal
+ {
+ bool ShapeConfigurationVersionConverter(
+ [[maybe_unused]] AZ::SerializeContext& context,
+ AZ::SerializeContext::DataElementNode& classElement)
+ {
+ if (classElement.GetVersion() <= 1)
+ {
+ classElement.RemoveElementByName(AZ_CRC_CE("UseMaterialsFromAsset"));
+ }
+
+ return true;
+ }
+ }
+
void ShapeConfiguration::Reflect(AZ::ReflectContext* context)
{
if (auto serializeContext = azrtti_cast(context))
@@ -166,10 +181,9 @@ namespace Physics
->RegisterGenericType>();
serializeContext->Class()
- ->Version(1)
+ ->Version(2, &Internal::ShapeConfigurationVersionConverter)
->Field("PhysicsAsset", &PhysicsAssetShapeConfiguration::m_asset)
->Field("AssetScale", &PhysicsAssetShapeConfiguration::m_assetScale)
- ->Field("UseMaterialsFromAsset", &PhysicsAssetShapeConfiguration::m_useMaterialsFromAsset)
->Field("SubdivisionLevel", &PhysicsAssetShapeConfiguration::m_subdivisionLevel)
;
@@ -182,7 +196,6 @@ namespace Physics
->DataElement(AZ::Edit::UIHandlers::Default, &PhysicsAssetShapeConfiguration::m_assetScale, "Asset Scale", "The scale of the asset shape")
->Attribute(AZ::Edit::Attributes::Min, 0.0f)
->Attribute(AZ::Edit::Attributes::Step, 0.01f)
- ->DataElement(AZ::Edit::UIHandlers::Default, &PhysicsAssetShapeConfiguration::m_useMaterialsFromAsset, "Physics Materials from Mesh", "Auto-set physics materials using Mesh's material surfaces names")
;
}
}
diff --git a/Code/Framework/AzFramework/AzFramework/Physics/ShapeConfiguration.h b/Code/Framework/AzFramework/AzFramework/Physics/ShapeConfiguration.h
index b3d04a10c9..8234ef9173 100644
--- a/Code/Framework/AzFramework/AzFramework/Physics/ShapeConfiguration.h
+++ b/Code/Framework/AzFramework/AzFramework/Physics/ShapeConfiguration.h
@@ -140,7 +140,7 @@ namespace Physics
AZ::Data::Asset m_asset{ AZ::Data::AssetLoadBehavior::PreLoad };
AZ::Vector3 m_assetScale = AZ::Vector3::CreateOne();
- bool m_useMaterialsFromAsset = true;
+ bool m_useMaterialsFromAsset = false; // Not reflected or exposed to the user until there is a way to auto-match mesh's materials with physics materials
AZ::u8 m_subdivisionLevel = 4; ///< The level of subdivision if a primitive shape is replaced with a convex mesh due to scaling.
};
diff --git a/Code/Framework/AzFramework/AzFramework/Physics/SystemBus.h b/Code/Framework/AzFramework/AzFramework/Physics/SystemBus.h
index f198551148..8cdd0e0cf0 100644
--- a/Code/Framework/AzFramework/AzFramework/Physics/SystemBus.h
+++ b/Code/Framework/AzFramework/AzFramework/Physics/SystemBus.h
@@ -142,24 +142,12 @@ namespace Physics
virtual AZStd::shared_ptr CreateShape(const ColliderConfiguration& colliderConfiguration, const ShapeConfiguration& configuration) = 0;
+ virtual AZStd::shared_ptr CreateMaterial(const Physics::MaterialConfiguration& materialConfiguration) = 0;
+
/// Releases the mesh object created by the physics backend.
/// @param nativeMeshObject Pointer to the mesh object.
virtual void ReleaseNativeMeshObject(void* nativeMeshObject) = 0;
- //////////////////////////////////////////////////////////////////////////
- //// Physics Materials
-
- virtual AZStd::shared_ptr CreateMaterial(const Physics::MaterialConfiguration& materialConfiguration) = 0;
- virtual AZStd::shared_ptr GetDefaultMaterial() = 0;
- virtual AZStd::vector> CreateMaterialsFromLibrary(const Physics::MaterialSelection& materialSelection) = 0;
-
-
- /// Updates the collider material selection from the physics asset or sets it to default if there's no asset provided.
- /// @param shapeConfiguration The shape information
- /// @param colliderConfiguration The collider information
- virtual bool UpdateMaterialSelection(const Physics::ShapeConfiguration& shapeConfiguration,
- Physics::ColliderConfiguration& colliderConfiguration) = 0;
-
//////////////////////////////////////////////////////////////////////////
//// Joints
diff --git a/Code/Framework/AzFramework/AzFramework/Physics/Utils.cpp b/Code/Framework/AzFramework/AzFramework/Physics/Utils.cpp
index b5f113582b..2c3b62bb88 100644
--- a/Code/Framework/AzFramework/AzFramework/Physics/Utils.cpp
+++ b/Code/Framework/AzFramework/AzFramework/Physics/Utils.cpp
@@ -119,8 +119,7 @@ namespace Physics
AzPhysics::SceneConfiguration::Reflect(context);
MaterialConfiguration::Reflect(context);
MaterialLibraryAsset::Reflect(context);
- MaterialLibraryAssetReflectionWrapper::Reflect(context);
- DefaultMaterialLibraryAssetReflectionWrapper::Reflect(context);
+ MaterialInfoReflectionWrapper::Reflect(context);
JointLimitConfiguration::Reflect(context);
AzPhysics::SimulatedBodyConfiguration::Reflect(context);
AzPhysics::RigidBodyConfiguration::Reflect(context);
diff --git a/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableAssetHandler.cpp b/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableAssetHandler.cpp
index b3ba1568bd..da046ff172 100644
--- a/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableAssetHandler.cpp
+++ b/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableAssetHandler.cpp
@@ -10,6 +10,7 @@
*
*/
+#include
#include
#include
#include
@@ -88,4 +89,10 @@ namespace AzFramework
{
extensions.push_back(Spawnable::FileExtension);
}
+
+ uint32_t SpawnableAssetHandler::BuildSubId(AZStd::string_view id)
+ {
+ AZ::Uuid subIdHash = AZ::Uuid::CreateData(id.data(), id.size());
+ return azlossy_caster(subIdHash.GetHash());
+ }
} // namespace AzFramework
diff --git a/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableAssetHandler.h b/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableAssetHandler.h
index deef314955..78268bf71a 100644
--- a/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableAssetHandler.h
+++ b/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableAssetHandler.h
@@ -47,6 +47,7 @@ namespace AzFramework
const char* GetGroup() const override;
const char* GetBrowserIcon() const override;
void GetAssetTypeExtensions(AZStd::vector& extensions) override;
+ static uint32_t BuildSubId(AZStd::string_view id);
protected:
LoadResult LoadAssetData(
diff --git a/Code/Framework/AzFramework/Platform/Linux/AzFramework/Asset/AssetSystemComponentHelper_Linux.cpp b/Code/Framework/AzFramework/Platform/Linux/AzFramework/Asset/AssetSystemComponentHelper_Linux.cpp
index 1ae3945bd6..d501271f59 100644
--- a/Code/Framework/AzFramework/Platform/Linux/AzFramework/Asset/AssetSystemComponentHelper_Linux.cpp
+++ b/Code/Framework/AzFramework/Platform/Linux/AzFramework/Asset/AssetSystemComponentHelper_Linux.cpp
@@ -35,7 +35,8 @@ namespace AzFramework::AssetSystem::Platform
if (!AZ::IO::SystemFile::Exists(assetProcessorPath.c_str()))
{
// Check for existence of one under a "bin" directory, i.e. engineRoot is an SDK structure.
- assetProcessorPath = AZ::IO::FixedMaxPath{engineRoot} / "bin" / AZ_BUILD_CONFIGURATION_TYPE / "AssetProcessor";
+ assetProcessorPath =
+ AZ::IO::FixedMaxPath{engineRoot} / "bin" / AZ_TRAIT_OS_PLATFORM_NAME / AZ_BUILD_CONFIGURATION_TYPE / "AssetProcessor";
if (!AZ::IO::SystemFile::Exists(assetProcessorPath.c_str()))
{
diff --git a/Code/Framework/AzFramework/Platform/Mac/AzFramework/Asset/AssetSystemComponentHelper_Mac.cpp b/Code/Framework/AzFramework/Platform/Mac/AzFramework/Asset/AssetSystemComponentHelper_Mac.cpp
index 6f1f860932..890b6b32c3 100644
--- a/Code/Framework/AzFramework/Platform/Mac/AzFramework/Asset/AssetSystemComponentHelper_Mac.cpp
+++ b/Code/Framework/AzFramework/Platform/Mac/AzFramework/Asset/AssetSystemComponentHelper_Mac.cpp
@@ -34,7 +34,8 @@ namespace AzFramework::AssetSystem::Platform
if (!AZ::IO::SystemFile::Exists(assetProcessorPath.c_str()))
{
// Check for existence of one under a "bin" directory, i.e. engineRoot is an SDK structure.
- assetProcessorPath = AZ::IO::FixedMaxPath{engineRoot} / "bin" / AZ_BUILD_CONFIGURATION_TYPE / "AssetProcessor.app";
+ assetProcessorPath =
+ AZ::IO::FixedMaxPath{engineRoot} / "bin" / AZ_TRAIT_OS_PLATFORM_NAME / AZ_BUILD_CONFIGURATION_TYPE / "AssetProcessor.app";
if (!AZ::IO::SystemFile::Exists(assetProcessorPath.c_str()))
{
diff --git a/Code/Framework/AzFramework/Platform/Windows/AzFramework/Asset/AssetSystemComponentHelper_Windows.cpp b/Code/Framework/AzFramework/Platform/Windows/AzFramework/Asset/AssetSystemComponentHelper_Windows.cpp
index b716778cf4..b0debfd3b0 100644
--- a/Code/Framework/AzFramework/Platform/Windows/AzFramework/Asset/AssetSystemComponentHelper_Windows.cpp
+++ b/Code/Framework/AzFramework/Platform/Windows/AzFramework/Asset/AssetSystemComponentHelper_Windows.cpp
@@ -71,7 +71,8 @@ namespace AzFramework::AssetSystem::Platform
if (!AZ::IO::SystemFile::Exists(assetProcessorPath.c_str()))
{
// Check for existence of one under a "bin" directory, i.e. engineRoot is an SDK structure.
- assetProcessorPath = AZ::IO::FixedMaxPath{engineRoot} / "bin" / AZ_BUILD_CONFIGURATION_TYPE / "AssetProcessor.exe";
+ assetProcessorPath =
+ AZ::IO::FixedMaxPath{engineRoot} / "bin" / AZ_TRAIT_OS_PLATFORM_NAME / AZ_BUILD_CONFIGURATION_TYPE / "AssetProcessor.exe";
if (!AZ::IO::SystemFile::Exists(assetProcessorPath.c_str()))
{
diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/Menu.qss b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/Menu.qss
index af9c675f23..7f48637cc8 100644
--- a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/Menu.qss
+++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/Menu.qss
@@ -49,7 +49,7 @@ QMenu::right-arrow
QMenu::icon
{
- right: 8px;
+ right: 20px;
}
QMenu::indicator:checked
diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Images/Notifications/link.svg b/Code/Framework/AzQtComponents/AzQtComponents/Images/Notifications/link.svg
new file mode 100644
index 0000000000..dfd21d157f
--- /dev/null
+++ b/Code/Framework/AzQtComponents/AzQtComponents/Images/Notifications/link.svg
@@ -0,0 +1,4 @@
+
diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Images/resources.qrc b/Code/Framework/AzQtComponents/AzQtComponents/Images/resources.qrc
index dbbf0e78e2..7b0c6530ab 100644
--- a/Code/Framework/AzQtComponents/AzQtComponents/Images/resources.qrc
+++ b/Code/Framework/AzQtComponents/AzQtComponents/Images/resources.qrc
@@ -13,5 +13,6 @@
Notifications/checkmark.svg
Notifications/download.svg
+ Notifications/link.svg
diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetEditor/AssetEditorWidget.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetEditor/AssetEditorWidget.cpp
index 706d8243e2..a59b29ddf8 100644
--- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetEditor/AssetEditorWidget.cpp
+++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetEditor/AssetEditorWidget.cpp
@@ -483,6 +483,8 @@ namespace AzToolsFramework
}
}
+ m_dirty = false;
+
AddRecentPath(targetFilePath);
SetStatusText(Status::assetCreated);
diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/ManipulatorSpace.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/ManipulatorSpace.cpp
index cd08a95af7..b3f691a62f 100644
--- a/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/ManipulatorSpace.cpp
+++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/ManipulatorSpace.cpp
@@ -39,7 +39,7 @@ namespace AzToolsFramework
AZ::Transform result;
result.SetRotation(m_space.GetRotation() * localTransform.GetRotation());
result.SetTranslation(m_space.TransformPoint(m_nonUniformScale * localTransform.GetTranslation()));
- result.SetScale(m_space.GetScale() * localTransform.GetUniformScale());
+ result.SetUniformScale(m_space.GetUniformScale() * localTransform.GetUniformScale());
return result;
}
diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/ProcesedObjectStore.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/ProcesedObjectStore.cpp
index 78d1332a71..050afd813d 100644
--- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/ProcesedObjectStore.cpp
+++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/ProcesedObjectStore.cpp
@@ -10,7 +10,7 @@
*
*/
-#include
+#include
#include
namespace AzToolsFramework::Prefab::PrefabConversionUtils
@@ -73,8 +73,7 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils
uint32_t ProcessedObjectStore::BuildSubId(AZStd::string_view id)
{
- AZ::Uuid subIdHash = AZ::Uuid::CreateData(id.data(), id.size());
- return azlossy_caster(subIdHash.GetHash());
+ return AzFramework::SpawnableAssetHandler::BuildSubId(id);
}
const AZStd::string& ProcessedObjectStore::GetId() const
diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorNonUniformScaleComponentMode.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorNonUniformScaleComponentMode.cpp
index 97e27ac748..497bcf15d7 100644
--- a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorNonUniformScaleComponentMode.cpp
+++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorNonUniformScaleComponentMode.cpp
@@ -28,7 +28,7 @@ namespace AzToolsFramework
AZ::Transform worldFromLocal = AZ::Transform::CreateIdentity();
AZ::TransformBus::EventResult(worldFromLocal, m_entityComponentIdPair.GetEntityId(), &AZ::TransformBus::Events::GetWorldTM);
- worldFromLocal.ExtractScale();
+ worldFromLocal.ExtractUniformScale();
m_manipulators = AZStd::make_unique(worldFromLocal);
m_manipulators->Register(g_mainManipulatorManagerId);
m_manipulators->SetAxes(AZ::Vector3::CreateAxisX(), AZ::Vector3::CreateAxisY(), AZ::Vector3::CreateAxisZ());
diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/TransformComponent.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/TransformComponent.cpp
index 285d962b46..3e13e6226b 100644
--- a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/TransformComponent.cpp
+++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/TransformComponent.cpp
@@ -32,7 +32,6 @@
#include
#include
#include
-#include
#include
#include
#include
@@ -50,10 +49,10 @@ namespace AzToolsFramework
{
const AZ::u32 ParentEntityCRC = AZ_CRC("Parent Entity", 0x5b1b276c);
- // Decompose a transform into euler angles in degrees, scale (along basis, any shear will be dropped), and translation.
- void DecomposeTransform(const AZ::Transform& transform, AZ::Vector3& translation, AZ::Vector3& rotation, AZ::Vector3& scale)
+ // Decompose a transform into euler angles in degrees, uniform scale, and translation.
+ void DecomposeTransform(const AZ::Transform& transform, AZ::Vector3& translation, AZ::Vector3& rotation, float& scale)
{
- scale = transform.GetScale();
+ scale = transform.GetUniformScale();
translation = transform.GetTranslation();
rotation = transform.GetRotation().GetEulerDegrees();
}
@@ -120,7 +119,7 @@ namespace AzToolsFramework
// Decompose the old slice-relative transform and set it as a our editor transform,
// since the entity is now our parent.
EditorTransform editorTransform;
- DecomposeTransform(sliceRelTransform, editorTransform.m_translate, editorTransform.m_rotate, editorTransform.m_scale);
+ DecomposeTransform(sliceRelTransform, editorTransform.m_translate, editorTransform.m_rotate, editorTransform.m_uniformScale);
editorTransformElement.Convert(context);
editorTransformElement.SetData(context, editorTransform);
}
@@ -170,6 +169,23 @@ namespace AzToolsFramework
return true;
}
+
+ bool EditorTransformDataConverter(AZ::SerializeContext& context, AZ::SerializeContext::DataElementNode& classElement)
+ {
+ if (classElement.GetVersion() < 3)
+ {
+ // version 3 replaces vector scale with uniform scale but does not yet delete the legacy scale data
+ // in order to allow for migration
+ AZ::Vector3 vectorScale;
+ if (classElement.FindSubElementAndGetData(AZ_CRC_CE("Scale"), vectorScale))
+ {
+ const float uniformScale = vectorScale.GetMaxElement();
+ classElement.AddElementWithData(context, "UniformScale", uniformScale);
+ }
+ }
+
+ return true;
+ }
} // namespace Internal
TransformComponent::TransformComponent()
@@ -357,7 +373,7 @@ namespace AzToolsFramework
AZ::Transform TransformComponent::GetLocalScaleTM() const
{
- return AZ::Transform::CreateUniformScale(m_editorTransform.m_scale.GetMaxElement());
+ return AZ::Transform::CreateUniformScale(m_editorTransform.m_uniformScale);
}
const AZ::Transform& TransformComponent::GetLocalTM()
@@ -374,12 +390,13 @@ namespace AzToolsFramework
// given a local transform, update local transform.
void TransformComponent::SetLocalTM(const AZ::Transform& finalTx)
{
- AZ::Vector3 tx, rot, scale;
- Internal::DecomposeTransform(finalTx, tx, rot, scale);
+ AZ::Vector3 tx, rot;
+ float uniformScale;
+ Internal::DecomposeTransform(finalTx, tx, rot, uniformScale);
m_editorTransform.m_translate = tx;
m_editorTransform.m_rotate = rot;
- m_editorTransform.m_scale = scale;
+ m_editorTransform.m_uniformScale = uniformScale;
TransformChanged();
}
@@ -599,31 +616,21 @@ namespace AzToolsFramework
return result;
}
- void TransformComponent::SetLocalScale(const AZ::Vector3& scale)
- {
- m_editorTransform.m_scale = scale;
- TransformChanged();
- }
-
AZ::Vector3 TransformComponent::GetLocalScale()
{
- return m_editorTransform.m_scale;
- }
-
- AZ::Vector3 TransformComponent::GetWorldScale()
- {
- return GetWorldTM().GetScale();
+ AZ_WarningOnce("TransformComponent", false, "GetLocalScale is deprecated, please use GetLocalUniformScale instead");
+ return m_editorTransform.m_legacyScale;
}
void TransformComponent::SetLocalUniformScale(float scale)
{
- m_editorTransform.m_scale = AZ::Vector3(scale);
+ m_editorTransform.m_uniformScale = scale;
TransformChanged();
}
float TransformComponent::GetLocalUniformScale()
{
- return m_editorTransform.m_scale.GetMaxElement();
+ return m_editorTransform.m_uniformScale;
}
float TransformComponent::GetWorldUniformScale()
@@ -1141,9 +1148,10 @@ namespace AzToolsFramework
serializeContext->Class()->
Field("Translate", &EditorTransform::m_translate)->
Field("Rotate", &EditorTransform::m_rotate)->
- Field("Scale", &EditorTransform::m_scale)->
+ Field("Scale", &EditorTransform::m_legacyScale)->
Field("Locked", &EditorTransform::m_locked)->
- Version(2);
+ Field("UniformScale", &EditorTransform::m_uniformScale)->
+ Version(3, &Internal::EditorTransformDataConverter);
serializeContext->Class()->
Field("Parent Entity", &TransformComponent::m_parentEntityId)->
@@ -1202,7 +1210,7 @@ namespace AzToolsFramework
Attribute(AZ::Edit::Attributes::Suffix, " deg")->
Attribute(AZ::Edit::Attributes::ReadOnly, &EditorTransform::m_locked)->
Attribute(AZ::Edit::Attributes::SliceFlags, AZ::Edit::SliceFlags::NotPushableOnSliceRoot)->
- DataElement(TransformScaleHandler, &EditorTransform::m_scale, "Scale", "Local Scale")->
+ DataElement(AZ::Edit::UIHandlers::Default, &EditorTransform::m_uniformScale, "Uniform Scale", "Local Uniform Scale")->
Attribute(AZ::Edit::Attributes::Step, 0.1f)->
Attribute(AZ::Edit::Attributes::ReadOnly, &EditorTransform::m_locked)
;
@@ -1230,7 +1238,8 @@ namespace AzToolsFramework
{
AzToolsFramework::ScopedUndoBatch undo("Reset transform values");
m_editorTransform.m_translate = AZ::Vector3::CreateZero();
- m_editorTransform.m_scale = AZ::Vector3::CreateOne();
+ m_editorTransform.m_legacyScale = AZ::Vector3::CreateOne();
+ m_editorTransform.m_uniformScale = 1.0f;
m_editorTransform.m_rotate = AZ::Vector3::CreateZero();
OnTransformChanged();
SetDirty();
diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/TransformComponent.h b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/TransformComponent.h
index f772b608c1..80db5e10fb 100644
--- a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/TransformComponent.h
+++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/TransformComponent.h
@@ -115,9 +115,7 @@ namespace AzToolsFramework
AZ::Quaternion GetLocalRotationQuaternion() override;
// Scale Modifiers
- void SetLocalScale(const AZ::Vector3& scale) override;
AZ::Vector3 GetLocalScale() override;
- AZ::Vector3 GetWorldScale() override;
void SetLocalUniformScale(float scale) override;
float GetLocalUniformScale() override;
diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/TransformComponentBus.h b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/TransformComponentBus.h
index 437a39b1a0..26fa4d758e 100644
--- a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/TransformComponentBus.h
+++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/TransformComponentBus.h
@@ -30,7 +30,8 @@ namespace AzToolsFramework
EditorTransform()
{
m_translate = AZ::Vector3::CreateZero();
- m_scale = AZ::Vector3::CreateOne();
+ m_legacyScale = AZ::Vector3::CreateOne();
+ m_uniformScale = 1.0f;
m_rotate = AZ::Vector3::CreateZero();
m_locked = false;
}
@@ -40,9 +41,10 @@ namespace AzToolsFramework
return EditorTransform();
}
- AZ::Vector3 m_translate; //! Translation in engine units (meters)
- AZ::Vector3 m_scale;
- AZ::Vector3 m_rotate; //! Rotation in degrees
+ AZ::Vector3 m_translate; //!< Translation in engine units (meters)
+ AZ::Vector3 m_legacyScale; //!< Legacy vector scale value, retained only for migration.
+ float m_uniformScale; //!< Single scale value applied uniformly.
+ AZ::Vector3 m_rotate; //!< Rotation in degrees
bool m_locked;
};
diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/TransformScalePropertyHandler.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/TransformScalePropertyHandler.cpp
deleted file mode 100644
index 94d0113bcf..0000000000
--- a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/TransformScalePropertyHandler.cpp
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
-* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
-* its licensors.
-*
-* For complete copyright and license terms please see the LICENSE at the root of this
-* distribution (the "License"). All use of this software is governed by the License,
-* or, if provided, by the license below or the license accompanying this file. Do not
-* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-*
-*/
-
-#include "AzToolsFramework_precompiled.h"
-#include
-#include
-#include
-
-namespace AzToolsFramework
-{
- void RegisterTransformScaleHandler()
- {
- PropertyTypeRegistrationMessages::Bus::Broadcast(&PropertyTypeRegistrationMessages::RegisterPropertyType, aznew Components::TransformScalePropertyHandler());
- }
-
- namespace Components
- {
- AZ::u32 TransformScalePropertyHandler::GetHandlerName(void) const
- {
- return TransformScaleHandler;
- }
-
- QWidget* TransformScalePropertyHandler::CreateGUI(QWidget* parent)
- {
- AzQtComponents::DoubleSpinBox* newCtrl = new AzQtComponents::DoubleSpinBox(parent);
- connect(newCtrl, QOverload::of(&AzQtComponents::DoubleSpinBox::valueChanged), newCtrl, [newCtrl]()
- {
- AzToolsFramework::PropertyEditorGUIMessages::Bus::Broadcast(&AzToolsFramework::PropertyEditorGUIMessages::RequestWrite, newCtrl);
- });
-
- newCtrl->setMinimum(AZ::MinTransformScale);
- newCtrl->setMaximum(AZ::MaxTransformScale);
-
- return newCtrl;
- }
-
- void TransformScalePropertyHandler::ConsumeAttribute(AzQtComponents::DoubleSpinBox* GUI, AZ::u32 attrib,
- AzToolsFramework::PropertyAttributeReader* attrValue, [[maybe_unused]] const char* debugName)
- {
- if (attrib == AZ::Edit::Attributes::Suffix)
- {
- AZStd::string label;
- if (attrValue->Read(label))
- {
- GUI->setSuffix(label.c_str());
- }
- }
- }
-
- void TransformScalePropertyHandler::WriteGUIValuesIntoProperty([[maybe_unused]] size_t index, AzQtComponents::DoubleSpinBox* GUI,
- AZ::Vector3& instance, [[maybe_unused]] AzToolsFramework::InstanceDataNode* node)
- {
- const float value = aznumeric_cast(GUI->value());
- const float currentMaxElement = instance.GetMaxElement();
- if (currentMaxElement != 0.0f)
- {
- instance *= value / currentMaxElement;
- }
- else
- {
- instance = AZ::Vector3(value);
- }
- }
-
- bool TransformScalePropertyHandler::ReadValuesIntoGUI([[maybe_unused]] size_t index, AzQtComponents::DoubleSpinBox* GUI,
- const AZ::Vector3& instance, [[maybe_unused]] AzToolsFramework::InstanceDataNode* node)
- {
- QSignalBlocker signalBlocker(GUI);
- GUI->setValue(instance.GetMaxElement());
- return true;
- }
- } // namespace Components
-} // namespace AzToolsFramework
diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/TransformScalePropertyHandler.h b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/TransformScalePropertyHandler.h
deleted file mode 100644
index f13aa37904..0000000000
--- a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/TransformScalePropertyHandler.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
-* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
-* its licensors.
-*
-* For complete copyright and license terms please see the LICENSE at the root of this
-* distribution (the "License"). All use of this software is governed by the License,
-* or, if provided, by the license below or the license accompanying this file. Do not
-* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-*
-*/
-
-#pragma once
-
-#if !defined(Q_MOC_RUN)
-#include
-#include
-#include
-#endif
-
-namespace AzToolsFramework
-{
- namespace Components
- {
- static const AZ::Crc32 TransformScaleHandler = AZ_CRC_CE("TransformScale");
-
- //! Handler to allow the scale field inside the Transform Component to be represented as a single value in
- //! the editor, but stored internally as a Vector3.
- //! The purpose for this is to prevent any new entities being created with non-uniform scale on the Transform
- //! Component, but preserve the data required for migrating any existing entities to use the Non-Uniform Scale
- //! Component, until all migration work is completed.
- //! The value shown in the editor will be the maximum value from the scale vector, and changing the value in
- //! the editor will update the vector so that its maximum value matches the newly edited value, but its
- //! components retain their existing proportion.
- //! For example, if the current vector scale is (2, 3, 4), the value in the editor will appear as 4. If the value
- //! in the editor is updated to 2, then the vector scale will update to (1, 1.5, 2), keeping the same proportion
- //! between the x, y and z components.
- class TransformScalePropertyHandler
- : public QObject
- , public AzToolsFramework::PropertyHandler
- {
- Q_OBJECT //AUTOMOC
- public:
- AZ_CLASS_ALLOCATOR(TransformScalePropertyHandler, AZ::SystemAllocator, 0);
-
- AZ::u32 GetHandlerName(void) const override;
- QWidget* CreateGUI(QWidget* parent) override;
- void ConsumeAttribute(AzQtComponents::DoubleSpinBox* GUI, AZ::u32 attrib,
- AzToolsFramework::PropertyAttributeReader* attrValue, const char* debugName) override;
- void WriteGUIValuesIntoProperty(size_t index, AzQtComponents::DoubleSpinBox* GUI,
- AZ::Vector3& instance, AzToolsFramework::InstanceDataNode* node) override;
- bool ReadValuesIntoGUI(size_t index, AzQtComponents::DoubleSpinBox* GUI,
- const AZ::Vector3& instance, AzToolsFramework::InstanceDataNode* node) override;
- };
- } // namespace Components
-} // namespace AzToolsFramework
diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyAssetCtrl.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyAssetCtrl.cpp
index 23f8378df5..169a90497b 100644
--- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyAssetCtrl.cpp
+++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyAssetCtrl.cpp
@@ -777,6 +777,23 @@ namespace AzToolsFramework
selection.SetDefaultDirectory(defaultDirectory);
}
+ if (m_hideProductFilesInAssetPicker)
+ {
+ FilterConstType displayFilter = selection.GetDisplayFilter();
+
+ EntryTypeFilter* productsFilter = new EntryTypeFilter();
+ productsFilter->SetEntryType(AssetBrowserEntry::AssetEntryType::Product);
+
+ InverseFilter* noProductsFilter = new InverseFilter();
+ noProductsFilter->SetFilter(FilterConstType(productsFilter));
+
+ CompositeFilter* compFilter = new CompositeFilter(CompositeFilter::LogicOperatorType::AND);
+ compFilter->AddFilter(FilterConstType(displayFilter));
+ compFilter->AddFilter(FilterConstType(noProductsFilter));
+
+ selection.SetDisplayFilter(FilterConstType(compFilter));
+ }
+
AssetBrowserComponentRequestBus::Broadcast(&AssetBrowserComponentRequests::PickAssets, selection, parentWidget());
if (selection.IsValid())
{
@@ -936,11 +953,16 @@ namespace AzToolsFramework
return;
}
- const AZ::Data::AssetId assetID = GetCurrentAssetID();
- m_currentAssetHint = "";
-
- if (!m_unnamedType)
+ const AZStd::string& folderPath = GetFolderSelection();
+ if (!folderPath.empty())
{
+ m_currentAssetHint = folderPath;
+ }
+ else
+ {
+ const AZ::Data::AssetId assetID = GetCurrentAssetID();
+ m_currentAssetHint = "";
+
AZ::Outcome jobOutcome = AZ::Failure();
AssetSystemJobRequestBus::BroadcastResult(jobOutcome, &AssetSystemJobRequestBus::Events::GetAssetJobsInfoByAssetID, assetID, false, false);
@@ -954,7 +976,7 @@ namespace AzToolsFramework
if (!jobs.empty())
{
- // The default behavior is show to the source filename.
+ // The default behavior is to show the source filename.
assetPath = jobs[0].m_sourceFile;
AZStd::string errorLog;
@@ -1172,6 +1194,16 @@ namespace AzToolsFramework
return m_showProductAssetName;
}
+ void PropertyAssetCtrl::SetHideProductFilesInAssetPicker(bool hide)
+ {
+ m_hideProductFilesInAssetPicker = hide;
+ }
+
+ bool PropertyAssetCtrl::GetHideProductFilesInAssetPicker() const
+ {
+ return m_hideProductFilesInAssetPicker;
+ }
+
void PropertyAssetCtrl::SetShowThumbnail(bool enable)
{
m_showThumbnail = enable;
@@ -1297,6 +1329,14 @@ namespace AzToolsFramework
GUI->SetShowProductAssetName(showProductAssetName);
}
}
+ else if(attrib == AZ::Edit::Attributes::HideProductFilesInAssetPicker)
+ {
+ bool hideProductFilesInAssetPicker = false;
+ if (attrValue->Read(hideProductFilesInAssetPicker))
+ {
+ GUI->SetHideProductFilesInAssetPicker(hideProductFilesInAssetPicker);
+ }
+ }
else if (attrib == AZ::Edit::Attributes::ClearNotify)
{
PropertyAssetCtrl::ClearCallbackType* func = azdynamic_cast(attrValue->GetAttribute());
diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyAssetCtrl.hxx b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyAssetCtrl.hxx
index 37af3d0594..5a6310eb35 100644
--- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyAssetCtrl.hxx
+++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyAssetCtrl.hxx
@@ -158,6 +158,10 @@ namespace AzToolsFramework
//! Assets can be either source or product assets generated from source assets. By default, source assets are shown in the property asset. You can override that with this flag.
bool m_showProductAssetName = true;
+ //! Assets can be either source or product assets generated from source assets.
+ //! By default the asset picker shows both on an AZ::Asset<> property. You can hide product assets with this flag.
+ bool m_hideProductFilesInAssetPicker = false;
+
bool m_showThumbnail = false;
bool m_showThumbnailDropDownButton = false;
EditCallbackType* m_thumbnailCallback = nullptr;
@@ -211,6 +215,9 @@ namespace AzToolsFramework
void SetShowProductAssetName(bool enable);
bool GetShowProductAssetName() const;
+ void SetHideProductFilesInAssetPicker(bool hide);
+ bool GetHideProductFilesInAssetPicker() const;
+
void SetShowThumbnail(bool enable);
bool GetShowThumbnail() const;
void SetShowThumbnailDropDownButton(bool enable);
diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyManagerComponent.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyManagerComponent.cpp
index bd61e6ceed..6dc5bdd001 100644
--- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyManagerComponent.cpp
+++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyManagerComponent.cpp
@@ -16,7 +16,6 @@
#include
#include
#include
-#include
namespace AzToolsFramework
{
@@ -38,7 +37,6 @@ namespace AzToolsFramework
void RegisterButtonPropertyHandlers();
void RegisterMultiLineEditHandler();
void RegisterCrcHandler();
- void RegisterTransformScaleHandler();
void ReflectPropertyEditor(AZ::ReflectContext* context);
namespace Components
@@ -192,7 +190,6 @@ namespace AzToolsFramework
RegisterVectorHandlers();
RegisterButtonPropertyHandlers();
RegisterMultiLineEditHandler();
- RegisterTransformScaleHandler();
// GenericComboBoxHandlers
RegisterGenericComboBoxHandler();
diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake
index aaf5c86d33..8d0180f6ce 100644
--- a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake
+++ b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake
@@ -293,8 +293,6 @@ set(FILES
ToolsComponents/TransformComponent.h
ToolsComponents/TransformComponent.cpp
ToolsComponents/TransformComponentBus.h
- ToolsComponents/TransformScalePropertyHandler.cpp
- ToolsComponents/TransformScalePropertyHandler.h
ToolsComponents/ScriptEditorComponent.cpp
ToolsComponents/ScriptEditorComponent.h
ToolsComponents/ToolsAssetCatalogComponent.cpp
diff --git a/Code/Framework/AzToolsFramework/Tests/SliceStabilityTests/SliceStabilityTestFramework.cpp b/Code/Framework/AzToolsFramework/Tests/SliceStabilityTests/SliceStabilityTestFramework.cpp
index 8455e6d669..5dcdaa045c 100644
--- a/Code/Framework/AzToolsFramework/Tests/SliceStabilityTests/SliceStabilityTestFramework.cpp
+++ b/Code/Framework/AzToolsFramework/Tests/SliceStabilityTests/SliceStabilityTestFramework.cpp
@@ -141,7 +141,7 @@ namespace UnitTest
// Set the new entity's transform to non zero values
// This helps validate in comparison tests that the transform values of created entities persist during slice operations
- entityTransform->SetLocalScale(AZ::Vector3(5, 5, 5));
+ entityTransform->SetLocalUniformScale(5);
entityTransform->SetLocalRotation(AZ::Vector3RadToDeg(AZ::Vector3(90, 90, 90)));
entityTransform->SetLocalTranslation(AZ::Vector3(100, 100, 100));
diff --git a/Code/LauncherUnified/Launcher.cpp b/Code/LauncherUnified/Launcher.cpp
index 1f29478399..922397c325 100644
--- a/Code/LauncherUnified/Launcher.cpp
+++ b/Code/LauncherUnified/Launcher.cpp
@@ -488,8 +488,8 @@ namespace O3DELauncher
const AZStd::string_view buildTargetName = GetBuildTargetName();
AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddBuildSystemTargetSpecialization(*settingsRegistry, buildTargetName);
- AZ_TracePrintf("Launcher", R"(Running project "%.*s.)" "\n"
- R"(The project name value has been successfully set in the Settings Registry at key "%s/project_name)"
+ AZ_TracePrintf("Launcher", R"(Running project "%.*s")" "\n"
+ R"(The project name has been successfully set in the Settings Registry at key "%s/project_name")"
R"( for Launcher target "%.*s")" "\n",
aznumeric_cast(launcherProjectName.size()), launcherProjectName.data(),
AZ::SettingsRegistryMergeUtils::ProjectSettingsRootKey,
@@ -643,7 +643,8 @@ namespace O3DELauncher
if (gEnv && gEnv->pConsole)
{
// Execute autoexec.cfg to load the initial level
- AZ::Interface::Get()->ExecuteConfigFile("autoexec.cfg");
+ auto autoExecFile = AZ::IO::FixedMaxPath{pathToAssets} / "autoexec.cfg";
+ AZ::Interface::Get()->ExecuteConfigFile(autoExecFile.Native());
// Find out if console command file was passed
// via --console-command-file=%filename% and execute it
diff --git a/Code/LauncherUnified/Platform/Windows/launcher_project_windows.cmake b/Code/LauncherUnified/Platform/Windows/launcher_project_windows.cmake
index bcef59ec5a..35c89caf15 100644
--- a/Code/LauncherUnified/Platform/Windows/launcher_project_windows.cmake
+++ b/Code/LauncherUnified/Platform/Windows/launcher_project_windows.cmake
@@ -10,6 +10,11 @@
#
set(ICON_FILE ${project_real_path}/Gem/Resources/GameSDK.ico)
+if(NOT EXISTS ${ICON_FILE})
+ # Try another project-relative path
+ set(ICON_FILE ${project_real_path}/Resources/GameSDK.ico)
+endif()
+
if(NOT EXISTS ${ICON_FILE})
# Try the common LauncherUnified icon instead
set(ICON_FILE Resources/GameSDK.ico)
diff --git a/Code/LauncherUnified/launcher_generator.cmake b/Code/LauncherUnified/launcher_generator.cmake
index edb6655411..c5d60eb29e 100644
--- a/Code/LauncherUnified/launcher_generator.cmake
+++ b/Code/LauncherUnified/launcher_generator.cmake
@@ -179,6 +179,7 @@ function(ly_delayed_generate_static_modules_inl)
${launcher_unified_binary_dir}/${project_name}.GameLauncher/Includes/StaticModules.inl
)
+ ly_target_link_libraries(${project_name}.GameLauncher PRIVATE ${all_game_gem_dependencies})
if(PAL_TRAIT_BUILD_SERVER_SUPPORTED)
get_property(server_gem_dependencies GLOBAL PROPERTY LY_STATIC_MODULE_PROJECTS_DEPENDENCIES_${project_name}.ServerLauncher)
@@ -204,6 +205,7 @@ function(ly_delayed_generate_static_modules_inl)
${launcher_unified_binary_dir}/${project_name}.ServerLauncher/Includes/StaticModules.inl
)
+ ly_target_link_libraries(${project_name}.ServerLauncher PRIVATE ${all_server_gem_dependencies})
endif()
endforeach()
endif()
diff --git a/Code/Sandbox/Editor/CMakeLists.txt b/Code/Sandbox/Editor/CMakeLists.txt
index 4706a61d08..7be9947e99 100644
--- a/Code/Sandbox/Editor/CMakeLists.txt
+++ b/Code/Sandbox/Editor/CMakeLists.txt
@@ -129,6 +129,8 @@ ly_add_target(
3rdParty::AWSNativeSDK::Core
3rdParty::Qt::Network
Legacy::EditorCore
+ RUNTIME_DEPENDENCIES
+ Gem::AtomViewportDisplayInfo
)
ly_add_source_properties(
SOURCES CryEdit.cpp
@@ -244,7 +246,8 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED)
Legacy::CryCommon
AZ::AzToolsFramework
Legacy::EditorLib
- Gem::LmbrCentral
+ RUNTIME_DEPENDENCIES
+ Gem::LmbrCentral
)
ly_add_googletest(
NAME Legacy::EditorLib.Tests
diff --git a/Code/Sandbox/Editor/RenderViewport.cpp b/Code/Sandbox/Editor/RenderViewport.cpp
index f199590e4f..8cef9e802c 100644
--- a/Code/Sandbox/Editor/RenderViewport.cpp
+++ b/Code/Sandbox/Editor/RenderViewport.cpp
@@ -1259,9 +1259,6 @@ CBaseObject* CRenderViewport::GetCameraObject() const
//////////////////////////////////////////////////////////////////////////
void CRenderViewport::OnEditorNotifyEvent(EEditorNotifyEvent event)
{
- static ICVar* outputToHMD = gEnv->pConsole->GetCVar("output_to_hmd");
- AZ_Assert(outputToHMD, "cvar output_to_hmd is undeclared");
-
switch (event)
{
case eNotify_OnBeginGameMode:
@@ -1282,7 +1279,6 @@ void CRenderViewport::OnEditorNotifyEvent(EEditorNotifyEvent event)
if (deviceInfo)
{
- outputToHMD->Set(1);
m_previousContext = SetCurrentContext(deviceInfo->renderWidth, deviceInfo->renderHeight);
if (m_renderer->GetIStereoRenderer())
{
@@ -1313,10 +1309,6 @@ void CRenderViewport::OnEditorNotifyEvent(EEditorNotifyEvent event)
// failed to set the context back when done, or set it back to the wrong one.
CryWarning(VALIDATOR_MODULE_3DENGINE, VALIDATOR_WARNING, "RenderViewport render context was not correctly restored by someone else.");
}
- if (gSettings.bEnableGameModeVR)
- {
- outputToHMD->Set(0);
- }
RestorePreviousContext(m_previousContext);
m_bInRotateMode = false;
m_bInMoveMode = false;
diff --git a/Code/Sandbox/Editor/TrackView/TrackViewAnimNode.cpp b/Code/Sandbox/Editor/TrackView/TrackViewAnimNode.cpp
index ae7077b4fc..35306b9535 100644
--- a/Code/Sandbox/Editor/TrackView/TrackViewAnimNode.cpp
+++ b/Code/Sandbox/Editor/TrackView/TrackViewAnimNode.cpp
@@ -2012,9 +2012,9 @@ void CTrackViewAnimNode::SetPosRotScaleTracksDefaultValues(bool positionAllowed,
}
if (scaleAllowed)
{
- AZ::Vector3 scale = AZ::Vector3::CreateOne();
- AZ::TransformBus::EventResult(scale, entityId, &AZ::TransformBus::Events::GetWorldScale);
- m_animNode->SetScale(time, AZVec3ToLYVec3(scale));
+ float scale = 1.0f;
+ AZ::TransformBus::EventResult(scale, entityId, &AZ::TransformBus::Events::GetWorldUniformScale);
+ m_animNode->SetScale(time, Vec3(scale, scale, scale));
}
}
}
diff --git a/Code/Sandbox/Editor/TrackView/TrackViewSequence.cpp b/Code/Sandbox/Editor/TrackView/TrackViewSequence.cpp
index f915c804f8..d26c8fd973 100644
--- a/Code/Sandbox/Editor/TrackView/TrackViewSequence.cpp
+++ b/Code/Sandbox/Editor/TrackView/TrackViewSequence.cpp
@@ -828,7 +828,7 @@ void CTrackViewSequence::SyncSelectedTracksToBase()
const Vec3 scale = pAnimNode->GetScale();
AZ::Transform transform = AZ::Transform::CreateIdentity();
- transform.SetScale(LYVec3ToAZVec3(scale));
+ transform.SetUniformScale(LYVec3ToAZVec3(scale).GetMaxElement());
transform.SetRotation(LYQuaternionToAZQuaternion(rotation));
transform.SetTranslation(LYVec3ToAZVec3(position));
@@ -870,7 +870,7 @@ void CTrackViewSequence::SyncSelectedTracksFromBase()
pAnimNode->SetPos(AZVec3ToLYVec3(transform.GetTranslation()));
pAnimNode->SetRotation(AZQuaternionToLYQuaternion(transform.GetRotation()));
- pAnimNode->SetScale(AZVec3ToLYVec3(transform.GetScale()));
+ pAnimNode->SetScale(AZVec3ToLYVec3(AZ::Vector3(transform.GetUniformScale())));
bNothingWasSynced = false;
}
diff --git a/Code/Sandbox/Plugins/ComponentEntityEditorPlugin/CMakeLists.txt b/Code/Sandbox/Plugins/ComponentEntityEditorPlugin/CMakeLists.txt
index d02c656b8f..53e04e1dee 100644
--- a/Code/Sandbox/Plugins/ComponentEntityEditorPlugin/CMakeLists.txt
+++ b/Code/Sandbox/Plugins/ComponentEntityEditorPlugin/CMakeLists.txt
@@ -35,10 +35,12 @@ ly_add_target(
AZ::AzToolsFramework
Legacy::CryCommon
Legacy::EditorLib
- Gem::LmbrCentral
AZ::AtomCore
Gem::Atom_RPI.Public
Gem::AtomToolsFramework.Static
+ Gem::LmbrCentral.Editor
+ RUNTIME_DEPENDENCIES
+ Gem::LmbrCentral.Editor
)
ly_add_dependencies(Editor ComponentEntityEditorPlugin)
@@ -68,7 +70,9 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED)
AZ::AzToolsFrameworkTestCommon
Legacy::CryCommon
Legacy::EditorLib
- Gem::LmbrCentral
+ Gem::LmbrCentral.Editor
+ RUNTIME_DEPENDENCIES
+ Gem::LmbrCentral.Editor
)
ly_add_googletest(
NAME Legacy::ComponentEntityEditorPlugin.Tests
diff --git a/Code/Tools/AssetProcessor/native/ui/ProductAssetTreeModel.cpp b/Code/Tools/AssetProcessor/native/ui/ProductAssetTreeModel.cpp
index 5efef8166c..68ba64ea1a 100644
--- a/Code/Tools/AssetProcessor/native/ui/ProductAssetTreeModel.cpp
+++ b/Code/Tools/AssetProcessor/native/ui/ProductAssetTreeModel.cpp
@@ -14,6 +14,7 @@
#include "ProductAssetTreeItemData.h"
#include
+#include
#include
namespace AssetProcessor
@@ -159,31 +160,33 @@ namespace AssetProcessor
return;
}
+ AZ::IO::Path productNamePath(product.m_productName, AZ::IO::PosixPathSeparator);
- AZStd::vector tokens;
- AzFramework::StringFunc::Tokenize(product.m_productName.c_str(), tokens, AZ_CORRECT_DATABASE_SEPARATOR, false, true);
-
- if (tokens.empty())
+ if (productNamePath.empty())
{
AZ_Warning("AssetProcessor", false, "Product id %d has an invalid name: %s", product.m_productID, product.m_productName.c_str());
return;
}
AssetTreeItem* parentItem = m_root.get();
- AZStd::string fullFolderName;
- for (int i = 0; i < tokens.size() - 1; ++i)
+ AZ::IO::Path currentFullFolderPath;
+ const AZ::IO::PathView filename = productNamePath.Filename();
+ const AZ::IO::PathView fullPathWithoutFilename = productNamePath.RemoveFilename();
+ AZStd::fixed_string currentPath;
+ for (auto pathIt = fullPathWithoutFilename.begin(); pathIt != fullPathWithoutFilename.end(); ++pathIt)
{
- AzFramework::StringFunc::AssetDatabasePath::Join(fullFolderName.c_str(), tokens[i].c_str(), fullFolderName);
- AssetTreeItem* nextParent = parentItem->GetChildFolder(tokens[i].c_str());
+ currentPath = pathIt->FixedMaxPathString();
+ currentFullFolderPath /= currentPath;
+ AssetTreeItem* nextParent = parentItem->GetChildFolder(currentPath.c_str());
if (!nextParent)
{
if (!modelIsResetting)
{
- QModelIndex parentIndex = parentItem == m_root.get() ? QModelIndex() : createIndex(parentItem->GetRow(), 0, parentItem);
+ QModelIndex parentIndex = createIndex(parentItem->GetRow(), 0, parentItem);
beginInsertRows(parentIndex, parentItem->getChildCount(), parentItem->getChildCount());
}
- nextParent = parentItem->CreateChild(ProductAssetTreeItemData::MakeShared(nullptr, fullFolderName, tokens[i].c_str(), true, AZ::Uuid::CreateNull()));
- m_productToTreeItem[fullFolderName] = nextParent;
+ nextParent = parentItem->CreateChild(ProductAssetTreeItemData::MakeShared(nullptr, currentFullFolderPath.Native(), currentPath.c_str(), true, AZ::Uuid::CreateNull()));
+ m_productToTreeItem[currentFullFolderPath.Native()] = nextParent;
// m_productIdToTreeItem is not used for folders, folders don't have product IDs.
if (!modelIsResetting)
@@ -205,12 +208,12 @@ namespace AssetProcessor
if (!modelIsResetting)
{
- QModelIndex parentIndex = parentItem == m_root.get() ? QModelIndex() : createIndex(parentItem->GetRow(), 0, parentItem);
+ QModelIndex parentIndex = createIndex(parentItem->GetRow(), 0, parentItem);
beginInsertRows(parentIndex, parentItem->getChildCount(), parentItem->getChildCount());
}
AZStd::shared_ptr productItemData =
- ProductAssetTreeItemData::MakeShared(&product, product.m_productName, tokens[tokens.size() - 1].c_str(), false, sourceId);
+ ProductAssetTreeItemData::MakeShared(&product, product.m_productName, AZStd::fixed_string(filename.Native()).c_str(), false, sourceId);
m_productToTreeItem[product.m_productName] =
parentItem->CreateChild(productItemData);
m_productIdToTreeItem[product.m_productID] = m_productToTreeItem[product.m_productName];
diff --git a/Code/Tools/AssetProcessor/native/ui/SourceAssetTreeModel.cpp b/Code/Tools/AssetProcessor/native/ui/SourceAssetTreeModel.cpp
index dda0a58837..69e60f6733 100644
--- a/Code/Tools/AssetProcessor/native/ui/SourceAssetTreeModel.cpp
+++ b/Code/Tools/AssetProcessor/native/ui/SourceAssetTreeModel.cpp
@@ -63,8 +63,7 @@ namespace AssetProcessor
}
- auto fullPath = AZ::IO::Path(scanFolder.m_scanFolder) / source.m_sourceName;
-
+ AZ::IO::Path fullPath = AZ::IO::Path(scanFolder.m_scanFolder, AZ::IO::PosixPathSeparator) / source.m_sourceName;
// It's common for Open 3D Engine game projects and scan folders to be in a subfolder
// of the engine install. To improve readability of the source files, strip out
@@ -78,34 +77,35 @@ namespace AssetProcessor
AzFramework::StringFunc::Replace(fullPath.Native(), m_assetRoot.absolutePath().toUtf8(), "");
}
-
- AZStd::vector tokens;
- AzFramework::StringFunc::Tokenize(fullPath.c_str(), tokens, AZ_CORRECT_DATABASE_SEPARATOR, false, true);
-
- if (tokens.empty())
+ if (fullPath.empty())
{
- AZ_Warning("AssetProcessor", false, "Source id %s has an invalid name: %s",
- source.m_sourceGuid.ToString().c_str(), source.m_sourceName.c_str());
+ AZ_Warning(
+ "AssetProcessor", false, "Source id %s has an invalid name: %s", source.m_sourceGuid.ToString().c_str(),
+ source.m_sourceName.c_str());
return;
}
QModelIndex newIndicesStart;
AssetTreeItem* parentItem = m_root.get();
- AZStd::string fullFolderName;
- for (int i = 0; i < tokens.size() - 1; ++i)
+ AZ::IO::Path currentFullFolderPath;
+ const AZ::IO::PathView filename = fullPath.Filename();
+ const AZ::IO::PathView fullPathWithoutFilename = fullPath.RemoveFilename();
+ AZStd::fixed_string currentPath;
+ for (auto pathIt = fullPathWithoutFilename.begin(); pathIt != fullPathWithoutFilename.end(); ++pathIt)
{
- AzFramework::StringFunc::AssetDatabasePath::Join(fullFolderName.c_str(), tokens[i].c_str(), fullFolderName);
- AssetTreeItem* nextParent = parentItem->GetChildFolder(tokens[i].c_str());
+ currentPath = pathIt->FixedMaxPathString();
+ currentFullFolderPath /= currentPath;
+ AssetTreeItem* nextParent = parentItem->GetChildFolder(currentPath.c_str());
if (!nextParent)
{
if (!modelIsResetting)
{
- QModelIndex parentIndex = parentItem == m_root.get() ? QModelIndex() : createIndex(parentItem->GetRow(), 0, parentItem);
+ QModelIndex parentIndex = createIndex(parentItem->GetRow(), 0, parentItem);
beginInsertRows(parentIndex, parentItem->getChildCount(), parentItem->getChildCount());
}
- nextParent = parentItem->CreateChild(SourceAssetTreeItemData::MakeShared(nullptr, nullptr, fullFolderName, tokens[i].c_str(), true));
- m_sourceToTreeItem[fullFolderName] = nextParent;
+ nextParent = parentItem->CreateChild(SourceAssetTreeItemData::MakeShared(nullptr, nullptr, currentFullFolderPath.Native(), currentPath.c_str(), true));
+ m_sourceToTreeItem[currentFullFolderPath.Native()] = nextParent;
// Folders don't have source IDs, don't add to m_sourceIdToTreeItem
if (!modelIsResetting)
{
@@ -117,12 +117,12 @@ namespace AssetProcessor
if (!modelIsResetting)
{
- QModelIndex parentIndex = parentItem == m_root.get() ? QModelIndex() : createIndex(parentItem->GetRow(), 0, parentItem);
+ QModelIndex parentIndex = createIndex(parentItem->GetRow(), 0, parentItem);
beginInsertRows(parentIndex, parentItem->getChildCount(), parentItem->getChildCount());
}
m_sourceToTreeItem[source.m_sourceName] =
- parentItem->CreateChild(SourceAssetTreeItemData::MakeShared(&source, &scanFolder, source.m_sourceName, tokens[tokens.size() - 1].c_str(), false));
+ parentItem->CreateChild(SourceAssetTreeItemData::MakeShared(&source, &scanFolder, source.m_sourceName, AZStd::fixed_string(filename.Native()).c_str(), false));
m_sourceIdToTreeItem[source.m_sourceID] = m_sourceToTreeItem[source.m_sourceName];
if (!modelIsResetting)
{
diff --git a/Code/Tools/ProjectManager/CMakeLists.txt b/Code/Tools/ProjectManager/CMakeLists.txt
index e2b5aaf696..a655600325 100644
--- a/Code/Tools/ProjectManager/CMakeLists.txt
+++ b/Code/Tools/ProjectManager/CMakeLists.txt
@@ -37,11 +37,8 @@ ly_add_target(
PRIVATE
PY_PACKAGE="${python_package_name}"
INCLUDE_DIRECTORIES
- PUBLIC
- .
PRIVATE
Source
-
BUILD_DEPENDENCIES
PRIVATE
3rdParty::Qt::Core
diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemInfo.cpp b/Code/Tools/ProjectManager/Source/GemCatalog/GemInfo.cpp
index 791085f47a..bc44928868 100644
--- a/Code/Tools/ProjectManager/Source/GemCatalog/GemInfo.cpp
+++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemInfo.cpp
@@ -25,7 +25,7 @@ namespace O3DE::ProjectManager
bool GemInfo::IsValid() const
{
- return !m_path.isEmpty() && !m_uuid.IsNull();
+ return !m_name.isEmpty() && !m_path.isEmpty();
}
QString GemInfo::GetPlatformString(Platform platform)
diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemInfo.h b/Code/Tools/ProjectManager/Source/GemCatalog/GemInfo.h
index 06b0adad32..1032ca5eaf 100644
--- a/Code/Tools/ProjectManager/Source/GemCatalog/GemInfo.h
+++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemInfo.h
@@ -64,7 +64,6 @@ namespace O3DE::ProjectManager
QString m_path;
QString m_name = "Unknown Gem Name";
QString m_displayName = "Unknown Gem Name";
- AZ::Uuid m_uuid;
QString m_creator = "Unknown Creator";
GemOrigin m_gemOrigin = Local;
bool m_isAdded = false; //! Is the gem currently added and enabled in the project?
diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemModel.cpp b/Code/Tools/ProjectManager/Source/GemCatalog/GemModel.cpp
index 724a8fa630..df11c4c7a6 100644
--- a/Code/Tools/ProjectManager/Source/GemCatalog/GemModel.cpp
+++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemModel.cpp
@@ -33,8 +33,6 @@ namespace O3DE::ProjectManager
item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
item->setData(gemInfo.m_name, RoleName);
- const QString uuidString = gemInfo.m_uuid.ToString().c_str();
- item->setData(uuidString, RoleUuid);
item->setData(gemInfo.m_creator, RoleCreator);
item->setData(gemInfo.m_gemOrigin, RoleGemOrigin);
item->setData(aznumeric_cast(gemInfo.m_platforms), RolePlatforms);
@@ -53,7 +51,7 @@ namespace O3DE::ProjectManager
appendRow(item);
const QModelIndex modelIndex = index(rowCount()-1, 0);
- m_uuidToIndexMap[uuidString] = modelIndex;
+ m_nameToIndexMap[gemInfo.m_name] = modelIndex;
}
void GemModel::Clear()
@@ -76,11 +74,6 @@ namespace O3DE::ProjectManager
return static_cast(modelIndex.data(RoleGemOrigin).toInt());
}
- QString GemModel::GetUuidString(const QModelIndex& modelIndex)
- {
- return modelIndex.data(RoleUuid).toString();
- }
-
GemInfo::Platforms GemModel::GetPlatforms(const QModelIndex& modelIndex)
{
return static_cast(modelIndex.data(RolePlatforms).toInt());
@@ -111,10 +104,10 @@ namespace O3DE::ProjectManager
return modelIndex.data(RoleDocLink).toString();
}
- QModelIndex GemModel::FindIndexByUuidString(const QString& uuidString) const
+ QModelIndex GemModel::FindIndexByNameString(const QString& nameString) const
{
- const auto iterator = m_uuidToIndexMap.find(uuidString);
- if (iterator != m_uuidToIndexMap.end())
+ const auto iterator = m_nameToIndexMap.find(nameString);
+ if (iterator != m_nameToIndexMap.end())
{
return iterator.value();
}
@@ -122,11 +115,11 @@ namespace O3DE::ProjectManager
return {};
}
- void GemModel::FindGemNamesByUuidStrings(QStringList& inOutGemNames)
+ void GemModel::FindGemNamesByNameStrings(QStringList& inOutGemNames)
{
for (QString& dependingGemString : inOutGemNames)
{
- QModelIndex modelIndex = FindIndexByUuidString(dependingGemString);
+ QModelIndex modelIndex = FindIndexByNameString(dependingGemString);
if (modelIndex.isValid())
{
dependingGemString = GetName(modelIndex);
@@ -147,7 +140,7 @@ namespace O3DE::ProjectManager
return {};
}
- FindGemNamesByUuidStrings(result);
+ FindGemNamesByNameStrings(result);
return result;
}
@@ -164,7 +157,7 @@ namespace O3DE::ProjectManager
return {};
}
- FindGemNamesByUuidStrings(result);
+ FindGemNamesByNameStrings(result);
return result;
}
diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemModel.h b/Code/Tools/ProjectManager/Source/GemCatalog/GemModel.h
index 480f4c74d3..0caa399b58 100644
--- a/Code/Tools/ProjectManager/Source/GemCatalog/GemModel.h
+++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemModel.h
@@ -33,8 +33,8 @@ namespace O3DE::ProjectManager
void AddGem(const GemInfo& gemInfo);
void Clear();
- QModelIndex FindIndexByUuidString(const QString& uuidString) const;
- void FindGemNamesByUuidStrings(QStringList& inOutGemNames);
+ QModelIndex FindIndexByNameString(const QString& nameString) const;
+ void FindGemNamesByNameStrings(QStringList& inOutGemNames);
QStringList GetDependingGemUuids(const QModelIndex& modelIndex);
QStringList GetDependingGemNames(const QModelIndex& modelIndex);
QStringList GetConflictingGemUuids(const QModelIndex& modelIndex);
@@ -43,7 +43,6 @@ namespace O3DE::ProjectManager
static QString GetName(const QModelIndex& modelIndex);
static QString GetCreator(const QModelIndex& modelIndex);
static GemInfo::GemOrigin GetGemOrigin(const QModelIndex& modelIndex);
- static QString GetUuidString(const QModelIndex& modelIndex);
static GemInfo::Platforms GetPlatforms(const QModelIndex& modelIndex);
static GemInfo::Types GetTypes(const QModelIndex& modelIndex);
static QString GetSummary(const QModelIndex& modelIndex);
@@ -59,7 +58,6 @@ namespace O3DE::ProjectManager
enum UserRole
{
RoleName = Qt::UserRole,
- RoleUuid,
RoleCreator,
RoleGemOrigin,
RolePlatforms,
@@ -76,7 +74,7 @@ namespace O3DE::ProjectManager
RoleTypes
};
- QHash m_uuidToIndexMap;
+ QHash m_nameToIndexMap;
QItemSelectionModel* m_selectionModel = nullptr;
};
} // namespace O3DE::ProjectManager
diff --git a/Code/Tools/ProjectManager/Source/PythonBindings.cpp b/Code/Tools/ProjectManager/Source/PythonBindings.cpp
index 9279ad1291..8db8492cae 100644
--- a/Code/Tools/ProjectManager/Source/PythonBindings.cpp
+++ b/Code/Tools/ProjectManager/Source/PythonBindings.cpp
@@ -220,7 +220,7 @@ namespace RedirectOutput
}
} // namespace RedirectOutput
-namespace O3DE::ProjectManager
+namespace O3DE::ProjectManager
{
PythonBindings::PythonBindings(const AZ::IO::PathView& enginePath)
: m_enginePath(enginePath)
@@ -283,8 +283,11 @@ namespace O3DE::ProjectManager
AZ_Warning("ProjectManagerWindow", result != -1, "Append to sys path failed");
// import required modules
- m_registration = pybind11::module::import("cmake.Tools.registration");
- m_engineTemplate = pybind11::module::import("cmake.Tools.engine_template");
+ m_register = pybind11::module::import("o3de.register");
+ m_manifest = pybind11::module::import("o3de.manifest");
+ m_engineTemplate = pybind11::module::import("o3de.engine_template");
+ m_enableGemProject = pybind11::module::import("o3de.enable_gem");
+ m_disableGemProject = pybind11::module::import("o3de.disable_gem");
return result == 0 && !PyErr_Occurred();
} catch ([[maybe_unused]] const std::exception& e)
@@ -326,30 +329,30 @@ namespace O3DE::ProjectManager
}
}
- AZ::Outcome PythonBindings::GetEngineInfo()
+ AZ::Outcome PythonBindings::GetEngineInfo()
{
EngineInfo engineInfo;
bool result = ExecuteWithLock([&] {
- pybind11::str enginePath = m_registration.attr("get_this_engine_path")();
+ pybind11::str enginePath = m_manifest.attr("get_this_engine_path")();
- auto o3deData = m_registration.attr("load_o3de_manifest")();
+ auto o3deData = m_manifest.attr("load_o3de_manifest")();
if (pybind11::isinstance(o3deData))
{
- engineInfo.m_path = Py_To_String(enginePath);
- engineInfo.m_defaultGemsFolder = Py_To_String(o3deData["default_gems_folder"]);
- engineInfo.m_defaultProjectsFolder = Py_To_String(o3deData["default_projects_folder"]);
- engineInfo.m_defaultRestrictedFolder = Py_To_String(o3deData["default_restricted_folder"]);
- engineInfo.m_defaultTemplatesFolder = Py_To_String(o3deData["default_templates_folder"]);
- engineInfo.m_thirdPartyPath = Py_To_String_Optional(o3deData,"third_party_path","");
+ engineInfo.m_path = Py_To_String(enginePath);
+ engineInfo.m_defaultGemsFolder = Py_To_String(o3deData["default_gems_folder"]);
+ engineInfo.m_defaultProjectsFolder = Py_To_String(o3deData["default_projects_folder"]);
+ engineInfo.m_defaultRestrictedFolder = Py_To_String(o3deData["default_restricted_folder"]);
+ engineInfo.m_defaultTemplatesFolder = Py_To_String(o3deData["default_templates_folder"]);
+ engineInfo.m_thirdPartyPath = Py_To_String_Optional(o3deData,"third_party_path","");
}
- auto engineData = m_registration.attr("get_engine_data")(pybind11::none(), enginePath);
+ auto engineData = m_manifest.attr("get_engine_json_data")(pybind11::none(), enginePath);
if (pybind11::isinstance(engineData))
{
try
{
- engineInfo.m_version = Py_To_String_Optional(engineData,"O3DEVersion","0.0.0.0");
- engineInfo.m_name = Py_To_String_Optional(engineData,"engine_name","O3DE");
+ engineInfo.m_version = Py_To_String_Optional(engineData,"O3DEVersion","0.0.0.0");
+ engineInfo.m_name = Py_To_String_Optional(engineData,"engine_name","O3DE");
}
catch ([[maybe_unused]] const std::exception& e)
{
@@ -364,13 +367,13 @@ namespace O3DE::ProjectManager
}
else
{
- return AZ::Success(AZStd::move(engineInfo));
+ return AZ::Success(AZStd::move(engineInfo));
}
return AZ::Failure();
}
- bool PythonBindings::SetEngineInfo(const EngineInfo& engineInfo)
+ bool PythonBindings::SetEngineInfo(const EngineInfo& engineInfo)
{
bool result = ExecuteWithLock([&] {
pybind11::str enginePath = engineInfo.m_path.toStdString();
@@ -378,17 +381,18 @@ namespace O3DE::ProjectManager
pybind11::str defaultGemsFolder = engineInfo.m_defaultGemsFolder.toStdString();
pybind11::str defaultTemplatesFolder = engineInfo.m_defaultTemplatesFolder.toStdString();
- auto registrationResult = m_registration.attr("register")(
- enginePath, // engine_path
- pybind11::none(), // project_path
- pybind11::none(), // gem_path
- pybind11::none(), // template_path
- pybind11::none(), // restricted_path
- pybind11::none(), // repo_uri
- pybind11::none(), // default_engines_folder
+ auto registrationResult = m_register.attr("register")(
+ enginePath, // engine_path
+ pybind11::none(), // project_path
+ pybind11::none(), // gem_path
+ pybind11::none(), // external_subdir_path
+ pybind11::none(), // template_path
+ pybind11::none(), // restricted_path
+ pybind11::none(), // repo_uri
+ pybind11::none(), // default_engines_folder
defaultProjectsFolder,
- defaultGemsFolder,
- defaultTemplatesFolder
+ defaultGemsFolder,
+ defaultTemplatesFolder
);
if (registrationResult.cast() != 0)
@@ -396,13 +400,13 @@ namespace O3DE::ProjectManager
result = false;
}
- auto manifest = m_registration.attr("load_o3de_manifest")();
+ auto manifest = m_manifest.attr("load_o3de_manifest")();
if (pybind11::isinstance(manifest))
{
try
{
manifest["third_party_path"] = engineInfo.m_thirdPartyPath.toStdString();
- m_registration.attr("save_o3de_manifest")(manifest);
+ m_manifest.attr("save_o3de_manifest")(manifest);
}
catch ([[maybe_unused]] const std::exception& e)
{
@@ -415,12 +419,12 @@ namespace O3DE::ProjectManager
return result;
}
- AZ::Outcome PythonBindings::GetGem(const QString& path)
+ AZ::Outcome PythonBindings::GetGem(const QString& path)
{
GemInfo gemInfo = GemInfoFromPath(pybind11::str(path.toStdString()));
if (gemInfo.IsValid())
{
- return AZ::Success(AZStd::move(gemInfo));
+ return AZ::Success(AZStd::move(gemInfo));
}
else
{
@@ -428,19 +432,19 @@ namespace O3DE::ProjectManager
}
}
- AZ::Outcome> PythonBindings::GetGems()
+ AZ::Outcome> PythonBindings::GetGems()
{
QVector gems;
bool result = ExecuteWithLock([&] {
- // external gems
- for (auto path : m_registration.attr("get_gems")())
+ // external gems
+ for (auto path : m_manifest.attr("get_gems")())
{
gems.push_back(GemInfoFromPath(path));
}
- // gems from the engine
- for (auto path : m_registration.attr("get_engine_gems")())
+ // gems from the engine
+ for (auto path : m_manifest.attr("get_engine_gems")())
{
gems.push_back(GemInfoFromPath(path));
}
@@ -452,7 +456,7 @@ namespace O3DE::ProjectManager
}
else
{
- return AZ::Success(AZStd::move(gems));
+ return AZ::Success(AZStd::move(gems));
}
}
@@ -463,7 +467,7 @@ namespace O3DE::ProjectManager
[&]
{
pybind11::str projectPath = path.toStdString();
- auto pythonRegistrationResult = m_registration.attr("register")(pybind11::none(), projectPath);
+ auto pythonRegistrationResult = m_register.attr("register")(pybind11::none(), projectPath);
// Returns an exit code so boolify it then invert result
registrationResult = !pythonRegistrationResult.cast();
@@ -479,19 +483,23 @@ namespace O3DE::ProjectManager
[&]
{
pybind11::str projectPath = path.toStdString();
- auto pythonRegistrationResult = m_registration.attr("register")(
+ auto pythonRegistrationResult = m_register.attr("register")(
pybind11::none(), // engine_path
projectPath, // project_path
pybind11::none(), // gem_path
+ pybind11::none(), // external_subdir_path
pybind11::none(), // template_path
pybind11::none(), // restricted_path
pybind11::none(), // repo_uri
pybind11::none(), // default_engines_folder
+ pybind11::none(), // default_projects_folder
pybind11::none(), // default_gems_folder
pybind11::none(), // default_templates_folder
pybind11::none(), // default_restricted_folder
- pybind11::none(), // default_restricted_folder
- true // remove
+ pybind11::none(), // external_subdir_engine_path
+ pybind11::none(), // external_subdir_project_path
+ true, // remove
+ false // force
);
// Returns an exit code so boolify it then invert result
@@ -501,7 +509,7 @@ namespace O3DE::ProjectManager
return result && registrationResult;
}
- AZ::Outcome PythonBindings::CreateProject(const QString& projectTemplatePath, const ProjectInfo& projectInfo)
+ AZ::Outcome PythonBindings::CreateProject(const QString& projectTemplatePath, const ProjectInfo& projectInfo)
{
ProjectInfo createdProjectInfo;
bool result = ExecuteWithLock([&] {
@@ -521,16 +529,16 @@ namespace O3DE::ProjectManager
}
else
{
- return AZ::Success(AZStd::move(createdProjectInfo));
+ return AZ::Success(AZStd::move(createdProjectInfo));
}
}
- AZ::Outcome PythonBindings::GetProject(const QString& path)
+ AZ::Outcome PythonBindings::GetProject(const QString& path)
{
ProjectInfo projectInfo = ProjectInfoFromPath(pybind11::str(path.toStdString()));
if (projectInfo.IsValid())
{
- return AZ::Success(AZStd::move(projectInfo));
+ return AZ::Success(AZStd::move(projectInfo));
}
else
{
@@ -541,30 +549,21 @@ namespace O3DE::ProjectManager
GemInfo PythonBindings::GemInfoFromPath(pybind11::handle path)
{
GemInfo gemInfo;
- gemInfo.m_path = Py_To_String(path);
+ gemInfo.m_path = Py_To_String(path);
- auto data = m_registration.attr("get_gem_data")(pybind11::none(), path);
+ auto data = m_manifest.attr("get_gem_json_data")(pybind11::none(), path);
if (pybind11::isinstance(data))
{
try
{
// required
- gemInfo.m_name = Py_To_String(data["Name"]);
- gemInfo.m_uuid = AZ::Uuid(Py_To_String(data["Uuid"]));
+ gemInfo.m_name = Py_To_String(data["gem_name"]);
// optional
- gemInfo.m_displayName = Py_To_String_Optional(data, "DisplayName", gemInfo.m_name);
- gemInfo.m_summary = Py_To_String_Optional(data, "Summary", "");
- gemInfo.m_version = Py_To_String_Optional(data, "Version", "");
+ gemInfo.m_displayName = Py_To_String_Optional(data, "DisplayName", gemInfo.m_name);
+ gemInfo.m_summary = Py_To_String_Optional(data, "Summary", "");
+ gemInfo.m_version = Py_To_String_Optional(data, "Version", "");
- if (data.contains("Dependencies"))
- {
- for (auto dependency : data["Dependencies"])
- {
- const AZ::Uuid uuid = Py_To_String(dependency["Uuid"]);
- gemInfo.m_dependingGemUuids.push_back(uuid.ToString().c_str());
- }
- }
if (data.contains("Tags"))
{
for (auto tag : data["Tags"])
@@ -588,13 +587,13 @@ namespace O3DE::ProjectManager
projectInfo.m_path = Py_To_String(path);
projectInfo.m_isNew = false;
- auto projectData = m_registration.attr("get_project_data")(pybind11::none(), path);
+ auto projectData = m_manifest.attr("get_project_json_data")(pybind11::none(), path);
if (pybind11::isinstance(projectData))
{
try
{
- projectInfo.m_projectName = Py_To_String(projectData["project_name"]);
- projectInfo.m_displayName = Py_To_String_Optional(projectData,"display_name", projectInfo.m_projectName);
+ projectInfo.m_projectName = Py_To_String(projectData["project_name"]);
+ projectInfo.m_displayName = Py_To_String_Optional(projectData,"display_name", projectInfo.m_projectName);
}
catch ([[maybe_unused]] const std::exception& e)
{
@@ -605,19 +604,19 @@ namespace O3DE::ProjectManager
return projectInfo;
}
- AZ::Outcome> PythonBindings::GetProjects()
+ AZ::Outcome> PythonBindings::GetProjects()
{
QVector projects;
bool result = ExecuteWithLock([&] {
- // external projects
- for (auto path : m_registration.attr("get_projects")())
+ // external projects
+ for (auto path : m_manifest.attr("get_projects")())
{
projects.push_back(ProjectInfoFromPath(path));
}
- // projects from the engine
- for (auto path : m_registration.attr("get_engine_projects")())
+ // projects from the engine
+ for (auto path : m_manifest.attr("get_engine_projects")())
{
projects.push_back(ProjectInfoFromPath(path));
}
@@ -629,7 +628,7 @@ namespace O3DE::ProjectManager
}
else
{
- return AZ::Success(AZStd::move(projects));
+ return AZ::Success(AZStd::move(projects));
}
}
@@ -639,10 +638,9 @@ namespace O3DE::ProjectManager
pybind11::str pyGemPath = gemPath.toStdString();
pybind11::str pyProjectPath = projectPath.toStdString();
- m_registration.attr("add_gem_to_project")(
+ m_enableGemProject.attr("enable_gem_in_project")(
pybind11::none(), // gem_name
pyGemPath,
- pybind11::none(), // gem_target
pybind11::none(), // project_name
pyProjectPath
);
@@ -657,10 +655,9 @@ namespace O3DE::ProjectManager
pybind11::str pyGemPath = gemPath.toStdString();
pybind11::str pyProjectPath = projectPath.toStdString();
- m_registration.attr("remove_gem_to_project")(
+ m_disableGemProject.attr("disable_gem_in_project")(
pybind11::none(), // gem_name
pyGemPath,
- pybind11::none(), // gem_target
pybind11::none(), // project_name
pyProjectPath
);
@@ -669,7 +666,7 @@ namespace O3DE::ProjectManager
return result;
}
- bool PythonBindings::UpdateProject([[maybe_unused]] const ProjectInfo& projectInfo)
+ bool PythonBindings::UpdateProject([[maybe_unused]] const ProjectInfo& projectInfo)
{
return false;
}
@@ -677,18 +674,18 @@ namespace O3DE::ProjectManager
ProjectTemplateInfo PythonBindings::ProjectTemplateInfoFromPath(pybind11::handle path)
{
ProjectTemplateInfo templateInfo;
- templateInfo.m_path = Py_To_String(path);
+ templateInfo.m_path = Py_To_String(path);
- auto data = m_registration.attr("get_template_data")(pybind11::none(), path);
+ auto data = m_manifest.attr("get_template_json_data")(pybind11::none(), path);
if (pybind11::isinstance(data))
{
try
{
// required
- templateInfo.m_displayName = Py_To_String(data["display_name"]);
- templateInfo.m_name = Py_To_String(data["template_name"]);
- templateInfo.m_summary = Py_To_String(data["summary"]);
-
+ templateInfo.m_displayName = Py_To_String(data["display_name"]);
+ templateInfo.m_name = Py_To_String(data["template_name"]);
+ templateInfo.m_summary = Py_To_String(data["summary"]);
+
// optional
if (data.contains("canonical_tags"))
{
@@ -714,12 +711,12 @@ namespace O3DE::ProjectManager
return templateInfo;
}
- AZ::Outcome> PythonBindings::GetProjectTemplates()
+ AZ::Outcome> PythonBindings::GetProjectTemplates()
{
QVector templates;
bool result = ExecuteWithLock([&] {
- for (auto path : m_registration.attr("get_project_templates")())
+ for (auto path : m_manifest.attr("get_project_templates")())
{
templates.push_back(ProjectTemplateInfoFromPath(path));
}
@@ -731,7 +728,7 @@ namespace O3DE::ProjectManager
}
else
{
- return AZ::Success(AZStd::move(templates));
+ return AZ::Success(AZStd::move(templates));
}
}
}
diff --git a/Code/Tools/ProjectManager/Source/PythonBindings.h b/Code/Tools/ProjectManager/Source/PythonBindings.h
index fb2303c495..18122f484b 100644
--- a/Code/Tools/ProjectManager/Source/PythonBindings.h
+++ b/Code/Tools/ProjectManager/Source/PythonBindings.h
@@ -12,7 +12,7 @@
#pragma once
#include
-#include
+#include
#include
// Qt defines slots, which interferes with the use here.
@@ -25,7 +25,7 @@
namespace O3DE::ProjectManager
{
- class PythonBindings
+ class PythonBindings
: public PythonBindingsInterface::Registrar
{
public:
@@ -68,6 +68,9 @@ namespace O3DE::ProjectManager
AZ::IO::FixedMaxPath m_enginePath;
pybind11::handle m_engineTemplate;
AZStd::recursive_mutex m_lock;
- pybind11::handle m_registration;
+ pybind11::handle m_register;
+ pybind11::handle m_manifest;
+ pybind11::handle m_enableGemProject;
+ pybind11::handle m_disableGemProject;
};
}
diff --git a/Code/Tools/SceneAPI/SDKWrapper/AssImpSceneWrapper.cpp b/Code/Tools/SceneAPI/SDKWrapper/AssImpSceneWrapper.cpp
index 2cda1e68ae..791af4bf68 100644
--- a/Code/Tools/SceneAPI/SDKWrapper/AssImpSceneWrapper.cpp
+++ b/Code/Tools/SceneAPI/SDKWrapper/AssImpSceneWrapper.cpp
@@ -17,6 +17,13 @@
#include
#include
+#if AZ_TRAIT_COMPILER_SUPPORT_CSIGNAL
+#include
+#include
+#include
+#include
+#endif // AZ_TRAIT_COMPILER_SUPPORT_CSIGNAL
+
namespace AZ
{
namespace AssImpSDKWrapper
@@ -34,10 +41,31 @@ namespace AZ
{
}
+#if AZ_TRAIT_COMPILER_SUPPORT_CSIGNAL
+ void signal_handler(int signal)
+ {
+ AZ_TracePrintf(
+ SceneAPI::Utilities::ErrorWindow,
+ "Failed to import scene with Asset Importer library. An %s has occured in the library, this scene file cannot be parsed by the library.",
+ signal == SIGABRT ? "assert" : "unknown error");
+ }
+#endif // AZ_TRAIT_COMPILER_SUPPORT_CSIGNAL
+
bool AssImpSceneWrapper::LoadSceneFromFile(const char* fileName)
{
AZ_TracePrintf(SceneAPI::Utilities::LogWindow, "AssImpSceneWrapper::LoadSceneFromFile %s", fileName);
AZ_TraceContext("Filename", fileName);
+
+#if AZ_TRAIT_COMPILER_SUPPORT_CSIGNAL
+ // Turn off the abort popup because it can disrupt automation.
+ // AssImp calls abort when asserts are enabled, and an assert is encountered.
+#ifdef _WRITE_ABORT_MSG
+ _set_abort_behavior(0, _WRITE_ABORT_MSG);
+#endif // #ifdef _WRITE_ABORT_MSG
+ // Instead, capture any calls to abort with a signal handler, and report them.
+ auto previous_handler = std::signal(SIGABRT, signal_handler);
+#endif // AZ_TRAIT_COMPILER_SUPPORT_CSIGNAL
+
// aiProcess_JoinIdenticalVertices is not enabled because O3DE has a mesh optimizer that also does this,
// this flag is disabled to keep AssImp output similar to FBX SDK to reduce downstream bugs for the initial AssImp release.
// There's currently a minimum of properties and flags set to maximize compatibility with the existing node graph.
@@ -49,6 +77,15 @@ namespace AZ
| aiProcess_LimitBoneWeights //Limits the number of bones that can affect a vertex to a maximum value
//dropping the least important and re-normalizing
| aiProcess_GenNormals); //Generate normals for meshes
+
+#if AZ_TRAIT_COMPILER_SUPPORT_CSIGNAL
+ // Reset abort behavior for anything else that may call abort.
+ std::signal(SIGABRT, previous_handler);
+#ifdef _WRITE_ABORT_MSG
+ _set_abort_behavior(1, _WRITE_ABORT_MSG);
+#endif // #ifdef _WRITE_ABORT_MSG
+#endif // AZ_TRAIT_COMPILER_SUPPORT_CSIGNAL
+
if (!m_assImpScene)
{
AZ_TracePrintf(SceneAPI::Utilities::ErrorWindow, "Failed to import Asset Importer Scene. Error returned: %s", m_importer.GetErrorString());
diff --git a/Code/Tools/SceneAPI/SceneUI/RowWidgets/TransformRowHandler.cpp b/Code/Tools/SceneAPI/SceneUI/RowWidgets/TransformRowHandler.cpp
index 322aa9ac51..640c092070 100644
--- a/Code/Tools/SceneAPI/SceneUI/RowWidgets/TransformRowHandler.cpp
+++ b/Code/Tools/SceneAPI/SceneUI/RowWidgets/TransformRowHandler.cpp
@@ -13,6 +13,7 @@
#include
#include
#include
+#include
#include
namespace AZ
@@ -58,10 +59,11 @@ namespace AZ
}
else
{
- AzToolsFramework::Vector3PropertyHandler handler;
- handler.ConsumeAttribute(widget->GetTranslationWidget(), attrib, attrValue, debugName);
- handler.ConsumeAttribute(widget->GetRotationWidget(), attrib, attrValue, debugName);
- handler.ConsumeAttribute(widget->GetScaleWidget(), attrib, attrValue, debugName);
+ AzToolsFramework::Vector3PropertyHandler vector3Handler;
+ vector3Handler.ConsumeAttribute(widget->GetTranslationWidget(), attrib, attrValue, debugName);
+ vector3Handler.ConsumeAttribute(widget->GetRotationWidget(), attrib, attrValue, debugName);
+ AzToolsFramework::doublePropertySpinboxHandler spinboxHandler;
+ spinboxHandler.ConsumeAttribute(widget->GetScaleWidget(), attrib, attrValue, debugName);
}
}
diff --git a/Code/Tools/SceneAPI/SceneUI/RowWidgets/TransformRowWidget.cpp b/Code/Tools/SceneAPI/SceneUI/RowWidgets/TransformRowWidget.cpp
index 10e0fd2a68..e8ecaa0c27 100644
--- a/Code/Tools/SceneAPI/SceneUI/RowWidgets/TransformRowWidget.cpp
+++ b/Code/Tools/SceneAPI/SceneUI/RowWidgets/TransformRowWidget.cpp
@@ -15,6 +15,7 @@
#include
#include
#include
+#include
#include
#include
@@ -47,7 +48,7 @@ namespace AZ
ExpandedTransform::ExpandedTransform()
: m_translation(0, 0, 0)
, m_rotation(0, 0, 0)
- , m_scale(1, 1, 1)
+ , m_scale(1)
{
}
@@ -60,14 +61,14 @@ namespace AZ
{
m_translation = transform.GetTranslation();
m_rotation = transform.GetEulerDegrees();
- m_scale = transform.GetScale();
+ m_scale = transform.GetUniformScale();
}
void ExpandedTransform::GetTransform(AZ::Transform& transform) const
{
transform = Transform::CreateTranslation(m_translation);
transform *= AZ::ConvertEulerDegreesToTransform(m_rotation);
- transform.MultiplyByScale(m_scale);
+ transform.MultiplyByUniformScale(m_scale);
}
const AZ::Vector3& ExpandedTransform::GetTranslation() const
@@ -90,12 +91,12 @@ namespace AZ
m_rotation = rotation;
}
- const AZ::Vector3& ExpandedTransform::GetScale() const
+ const float ExpandedTransform::GetScale() const
{
return m_scale;
}
- void ExpandedTransform::SetScale(const AZ::Vector3& scale)
+ void ExpandedTransform::SetScale(const float scale)
{
m_scale = scale;
}
@@ -131,7 +132,7 @@ namespace AZ
m_rotationWidget->setMaximum(360);
m_rotationWidget->setSuffix(" degrees");
- m_scaleWidget = new AzQtComponents::VectorInput(this, 3);
+ m_scaleWidget = new AzToolsFramework::PropertyDoubleSpinCtrl(this);
m_scaleWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
m_scaleWidget->setMinimum(0);
m_scaleWidget->setMaximum(10000);
@@ -191,13 +192,10 @@ namespace AZ
AzToolsFramework::PropertyEditorGUIMessages::Bus::Broadcast(&AzToolsFramework::PropertyEditorGUIMessages::RequestWrite, this);
});
- QObject::connect(m_scaleWidget, &AzQtComponents::VectorInput::valueChanged, this, [this]
+ QObject::connect(m_scaleWidget, &AzToolsFramework::PropertyDoubleSpinCtrl::valueChanged, this, [this]
{
- AzQtComponents::VectorInput* widget = this->GetScaleWidget();
- AZ::Vector3 scale;
-
- PopulateVector3(widget, scale);
-
+ AzToolsFramework::PropertyDoubleSpinCtrl* widget = this->GetScaleWidget();
+ float scale = aznumeric_cast(widget->value());
m_transform.SetScale(scale);
AzToolsFramework::PropertyEditorGUIMessages::Bus::Broadcast(&AzToolsFramework::PropertyEditorGUIMessages::RequestWrite, this);
});
@@ -224,9 +222,7 @@ namespace AZ
m_rotationWidget->setValuebyIndex(m_transform.GetRotation().GetY(), 1);
m_rotationWidget->setValuebyIndex(m_transform.GetRotation().GetZ(), 2);
- m_scaleWidget->setValuebyIndex(m_transform.GetScale().GetX(), 0);
- m_scaleWidget->setValuebyIndex(m_transform.GetScale().GetY(), 1);
- m_scaleWidget->setValuebyIndex(m_transform.GetScale().GetZ(), 2);
+ m_scaleWidget->setValue(m_transform.GetScale());
blockSignals(false);
}
@@ -251,7 +247,7 @@ namespace AZ
return m_rotationWidget;
}
- AzQtComponents::VectorInput* TransformRowWidget::GetScaleWidget()
+ AzToolsFramework::PropertyDoubleSpinCtrl* TransformRowWidget::GetScaleWidget()
{
return m_scaleWidget;
}
diff --git a/Code/Tools/SceneAPI/SceneUI/RowWidgets/TransformRowWidget.h b/Code/Tools/SceneAPI/SceneUI/RowWidgets/TransformRowWidget.h
index dc3286f80e..3977d26c7c 100644
--- a/Code/Tools/SceneAPI/SceneUI/RowWidgets/TransformRowWidget.h
+++ b/Code/Tools/SceneAPI/SceneUI/RowWidgets/TransformRowWidget.h
@@ -21,6 +21,7 @@
#include
#include
#include
+
#endif
namespace AzQtComponents
@@ -28,6 +29,11 @@ namespace AzQtComponents
class VectorInput;
}
+namespace AzToolsFramework
+{
+ class PropertyDoubleSpinCtrl;
+}
+
namespace AZ
{
namespace SceneAPI
@@ -51,14 +57,14 @@ namespace AZ
const AZ::Vector3& GetRotation() const;
void SetRotation(const AZ::Vector3& translation);
- const AZ::Vector3& GetScale() const;
- void SetScale(const AZ::Vector3& scale);
+ const float GetScale() const;
+ void SetScale(const float scale);
private:
AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING
AZ::Vector3 m_translation;
AZ::Vector3 m_rotation;
- AZ::Vector3 m_scale;
+ float m_scale;
AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING
};
@@ -78,7 +84,7 @@ namespace AZ
AzQtComponents::VectorInput* GetTranslationWidget();
AzQtComponents::VectorInput* GetRotationWidget();
- AzQtComponents::VectorInput* GetScaleWidget();
+ AzToolsFramework::PropertyDoubleSpinCtrl* GetScaleWidget();
protected:
ExpandedTransform m_transform;
@@ -87,7 +93,7 @@ namespace AZ
AzQtComponents::VectorInput* m_translationWidget;
AzQtComponents::VectorInput* m_rotationWidget;
- AzQtComponents::VectorInput* m_scaleWidget;
+ AzToolsFramework::PropertyDoubleSpinCtrl* m_scaleWidget;
};
} // namespace SceneUI
} // namespace SceneAPI
diff --git a/Code/Tools/SceneAPI/SceneUI/Tests/RowWidgets/TransformRowWidgetTests.cpp b/Code/Tools/SceneAPI/SceneUI/Tests/RowWidgets/TransformRowWidgetTests.cpp
index 05082f29fb..cda6582e63 100644
--- a/Code/Tools/SceneAPI/SceneUI/Tests/RowWidgets/TransformRowWidgetTests.cpp
+++ b/Code/Tools/SceneAPI/SceneUI/Tests/RowWidgets/TransformRowWidgetTests.cpp
@@ -30,7 +30,7 @@ namespace AZ
Vector3 m_translation = Vector3(10.0f, 20.0f, 30.0f);
Vector3 m_rotation = Vector3(30.0f, 45.0f, 60.0f);
- Vector3 m_scale = Vector3(2.0f, 3.0f, 4.0f);
+ float m_scale = 3.0f;
};
TEST_F(TransformRowWidgetTest, GetTranslation_TranslationInMatrix_TranslationCanBeRetrievedDirectly)
@@ -83,26 +83,22 @@ namespace AZ
TEST_F(TransformRowWidgetTest, GetScale_ScaleInMatrix_ScaleCanBeRetrievedDirectly)
{
- m_transform = Transform::CreateScale(m_scale);
+ m_transform = Transform::CreateUniformScale(m_scale);
m_expanded.SetTransform(m_transform);
- const Vector3& returned = m_expanded.GetScale();
- EXPECT_NEAR(m_scale.GetX(), returned.GetX(), 0.1f);
- EXPECT_NEAR(m_scale.GetY(), returned.GetY(), 0.1f);
- EXPECT_NEAR(m_scale.GetZ(), returned.GetZ(), 0.1f);
+ const float returned = m_expanded.GetScale();
+ EXPECT_NEAR(m_scale, returned, 0.1f);
}
TEST_F(TransformRowWidgetTest, GetScale_ScaleInMatrix_ScaleCanBeRetrievedFromTransform)
{
- m_transform = Transform::CreateScale(m_scale);
+ m_transform = Transform::CreateUniformScale(m_scale);
m_expanded.SetTransform(m_transform);
Transform rebuild;
m_expanded.GetTransform(rebuild);
- Vector3 returned = rebuild.GetScale();
- EXPECT_NEAR(m_scale.GetX(), returned.GetX(), 0.1f);
- EXPECT_NEAR(m_scale.GetY(), returned.GetY(), 0.1f);
- EXPECT_NEAR(m_scale.GetZ(), returned.GetZ(), 0.1f);
+ float returned = rebuild.GetUniformScale();
+ EXPECT_NEAR(m_scale, returned, 0.1f);
}
TEST_F(TransformRowWidgetTest, GetTransform_RotateAndTranslateInMatrix_ReconstructedTransformMatchesOriginal)
@@ -121,7 +117,7 @@ namespace AZ
{
Quaternion quaternion = AZ::ConvertEulerDegreesToQuaternion(m_rotation);
m_transform = Transform::CreateFromQuaternionAndTranslation(quaternion, m_translation);
- m_transform.MultiplyByScale(m_scale);
+ m_transform.MultiplyByUniformScale(m_scale);
m_expanded.SetTransform(m_transform);
Transform rebuild;
diff --git a/Gems/AWSClientAuth/Code/CMakeLists.txt b/Gems/AWSClientAuth/Code/CMakeLists.txt
index e9f2a4ed84..40f6e0fe36 100644
--- a/Gems/AWSClientAuth/Code/CMakeLists.txt
+++ b/Gems/AWSClientAuth/Code/CMakeLists.txt
@@ -29,6 +29,9 @@ ly_add_target(
Gem::HttpRequestor
3rdParty::AWSNativeSDK::AWSClientAuth
3rdParty::AWSNativeSDK::Core
+ RUNTIME_DEPENDENCIES
+ Gem::AWSCore
+ Gem::HttpRequestor
)
ly_add_target(
@@ -44,13 +47,19 @@ ly_add_target(
AZ::AzCore
AZ::AzFramework
Gem::AWSCore
- Gem::HttpRequestor
3rdParty::AWSNativeSDK::AWSClientAuth
3rdParty::AWSNativeSDK::Core
PUBLIC
Gem::AWSClientAuth.Static
+ RUNTIME_DEPENDENCIES
+ Gem::AWSCore
+ Gem::HttpRequestor
)
+# servers and clients use the above module.
+ly_create_alias(NAME AWSClientAuth.Servers NAMESPACE Gem TARGETS Gem::AWSClientAuth)
+ly_create_alias(NAME AWSClientAuth.Clients NAMESPACE Gem TARGETS Gem::AWSClientAuth)
+
################################################################################
# Tests
################################################################################
@@ -71,10 +80,14 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED)
3rdParty::AWSNativeSDK::AWSClientAuth
AZ::AzCore
AZ::AzFramework
- Gem::AWSCore
- Gem::AWSClientAuth.Static
AZ::AWSNativeSDKInit
+ Gem::AWSClientAuth.Static
+ Gem::AWSCore
Gem::HttpRequestor
+ RUNTIME_DEPENDENCIES
+ Gem::AWSCore
+ AZ::AWSNativeSDKInit
+ Gem::HttpRequestor
)
ly_add_googletest(
NAME Gem::AWSClientAuth.Tests
diff --git a/Gems/AWSCore/Code/CMakeLists.txt b/Gems/AWSCore/Code/CMakeLists.txt
index a58b02d1d4..46046c0791 100644
--- a/Gems/AWSCore/Code/CMakeLists.txt
+++ b/Gems/AWSCore/Code/CMakeLists.txt
@@ -45,6 +45,10 @@ ly_add_target(
Gem::AWSCore.Static
)
+# clients and servers will use the above Gem::AWSCore module.
+ly_create_alias(NAME AWSCore.Servers NAMESPACE Gem TARGETS Gem::AWSCore)
+ly_create_alias(NAME AWSCore.Clients NAMESPACE Gem TARGETS Gem::AWSCore)
+
if (PAL_TRAIT_BUILD_HOST_TOOLS)
ly_add_target(
NAME AWSCore.Editor.Static STATIC
@@ -99,6 +103,11 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS)
Gem::AWSCore.Editor.Static
)
ly_add_dependencies(AWSCore.Editor AWSCore.ResourceMappingTool)
+
+ # Builders and Tools (such as the Editor use AWSCore.Editor) use the .Editor module above.
+ ly_create_alias(NAME AWSCore.Tools NAMESPACE Gem TARGETS Gem::AWSCore.Editor)
+ ly_create_alias(NAME AWSCore.Builders NAMESPACE Gem TARGETS Gem::AWSCore.Editor)
+
endif()
################################################################################
diff --git a/Gems/AWSCore/Code/Include/Private/AWSCoreInternalBus.h b/Gems/AWSCore/Code/Include/Private/AWSCoreInternalBus.h
index 738d41c796..27487ed481 100644
--- a/Gems/AWSCore/Code/Include/Private/AWSCoreInternalBus.h
+++ b/Gems/AWSCore/Code/Include/Private/AWSCoreInternalBus.h
@@ -38,6 +38,11 @@ namespace AWSCore
//! @return The path of AWS resource mapping config file
virtual AZStd::string GetResourceMappingConfigFilePath() const = 0;
+ //! GetResourceMappingConfigFolderPath
+ //! Get the path of AWS resource mapping config folder
+ //! @return The path of AWS resource mapping config folder
+ virtual AZStd::string GetResourceMappingConfigFolderPath() const = 0;
+
//! ReloadConfiguration
//! Reload AWSCore configuration without restarting application
virtual void ReloadConfiguration() = 0;
diff --git a/Gems/AWSCore/Code/Include/Private/Configuration/AWSCoreConfiguration.h b/Gems/AWSCore/Code/Include/Private/Configuration/AWSCoreConfiguration.h
index bd30af3ce7..92082617b7 100644
--- a/Gems/AWSCore/Code/Include/Private/Configuration/AWSCoreConfiguration.h
+++ b/Gems/AWSCore/Code/Include/Private/Configuration/AWSCoreConfiguration.h
@@ -53,6 +53,7 @@ namespace AWSCore
// AWSCoreInternalRequestBus interface implementation
AZStd::string GetResourceMappingConfigFilePath() const override;
+ AZStd::string GetResourceMappingConfigFolderPath() const override;
AZStd::string GetProfileName() const override;
void ReloadConfiguration() override;
diff --git a/Gems/AWSCore/Code/Include/Private/Editor/AWSCoreEditorManager.h b/Gems/AWSCore/Code/Include/Private/Editor/AWSCoreEditorManager.h
index 721cd6dd6a..98467727ea 100644
--- a/Gems/AWSCore/Code/Include/Private/Editor/AWSCoreEditorManager.h
+++ b/Gems/AWSCore/Code/Include/Private/Editor/AWSCoreEditorManager.h
@@ -18,7 +18,7 @@ namespace AWSCore
class AWSCoreEditorManager
{
public:
- static constexpr const char CLOUD_SERVICES_MENU_TEXT[] = "&Cloud services";
+ static constexpr const char AWS_MENU_TEXT[] = "&AWS";
AWSCoreEditorManager();
virtual ~AWSCoreEditorManager();
diff --git a/Gems/AWSCore/Code/Include/Private/Editor/Constants/AWSCoreEditorMenuLinks.h b/Gems/AWSCore/Code/Include/Private/Editor/Constants/AWSCoreEditorMenuLinks.h
new file mode 100644
index 0000000000..46acfbd4a3
--- /dev/null
+++ b/Gems/AWSCore/Code/Include/Private/Editor/Constants/AWSCoreEditorMenuLinks.h
@@ -0,0 +1,53 @@
+/*
+ * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
+ * its licensors.
+ *
+ * For complete copyright and license terms please see the LICENSE at the root of this
+ * distribution (the "License"). All use of this software is governed by the License,
+ * or, if provided, by the license below or the license accompanying this file. Do not
+ * remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ */
+
+#pragma once
+
+namespace AWSCore
+{
+ static constexpr const char NewToAWSUrl[] = "https://docs.o3de.org/docs/user-guide/gems/reference/aws/";
+
+ static constexpr const char AWSAndScriptCanvasUrl[] = "https://docs.o3de.org/docs/user-guide/components/reference/aws/";
+ static constexpr const char AWSAndComponentsUrl[] = "https://docs.o3de.org/docs/user-guide/components/reference/aws/";
+ static constexpr const char CallAWSResourcesUrl[] = "https://docs.o3de.org/docs/user-guide/components/reference/aws/";
+
+ static constexpr const char AWSCredentialConfigurationUrl[] =
+ "https://docs.o3de.org/docs/user-guide/gems/reference/aws/aws-core/configuring-credentials/";
+
+ static constexpr const char AWSClientAuthGemOverviewUrl[] =
+ "https://docs.o3de.org/docs/user-guide/gems/reference/aws/aws-client-auth/";
+ static constexpr const char AWSClientAuthCDKAndResourcesUrl[] =
+ "https://docs.o3de.org/docs/user-guide/gems/reference/aws/aws-client-auth/";
+ static constexpr const char AWSClientAuthScriptCanvasAndLuaUrl[] =
+ "https://docs.o3de.org/docs/user-guide/gems/reference/aws/aws-client-auth/";
+ static constexpr const char AWSClientAuth3rdPartyAuthProviderUrl[] =
+ "https://docs.o3de.org/docs/user-guide/gems/reference/aws/aws-client-auth/";
+ static constexpr const char AWSClientAuthCustomAuthProviderUrl[] =
+ "https://docs.o3de.org/docs/user-guide/gems/reference/aws/aws-client-auth/";
+ static constexpr const char AWSClientAuthPlatformSpecificUrl[] =
+ "https://docs.o3de.org/docs/user-guide/gems/reference/aws/aws-client-auth/";
+ static constexpr const char AWSClientAuthAPIReferenceUrl[] =
+ "https://docs.o3de.org/docs/user-guide/gems/reference/aws/aws-client-auth/";
+
+ static constexpr const char AWSMetricsGemOverviewUrl[] =
+ "https://docs.o3de.org/docs/user-guide/gems/reference/aws/aws-metrics/";
+ static constexpr const char AWSMetricsSetupGemUrl[] =
+ "https://docs.o3de.org/docs/user-guide/gems/reference/aws/aws-metrics/";
+ static constexpr const char AWSMetricsScriptingUrl[] =
+ "https://docs.o3de.org/docs/user-guide/gems/reference/aws/aws-metrics/";
+ static constexpr const char AWSMetricsAPIReferenceUrl[] =
+ "https://docs.o3de.org/docs/user-guide/gems/reference/aws/aws-metrics/";
+ static constexpr const char AWSMetricsAdvancedTopicsUrl[] =
+ "https://docs.o3de.org/docs/user-guide/gems/reference/aws/aws-metrics/";
+ static constexpr const char AWSMetricsSettingsUrl[] =
+ "https://docs.o3de.org/docs/user-guide/gems/reference/aws/aws-metrics/";
+} // namespace AWSCore
diff --git a/Gems/AWSCore/Code/Include/Private/Editor/Constants/AWSCoreEditorMenuNames.h b/Gems/AWSCore/Code/Include/Private/Editor/Constants/AWSCoreEditorMenuNames.h
new file mode 100644
index 0000000000..a9a8198e52
--- /dev/null
+++ b/Gems/AWSCore/Code/Include/Private/Editor/Constants/AWSCoreEditorMenuNames.h
@@ -0,0 +1,44 @@
+/*
+ * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
+ * its licensors.
+ *
+ * For complete copyright and license terms please see the LICENSE at the root of this
+ * distribution (the "License"). All use of this software is governed by the License,
+ * or, if provided, by the license below or the license accompanying this file. Do not
+ * remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ */
+
+#pragma once
+
+namespace AWSCore
+{
+ static constexpr const char NewToAWSActionText[] = "Getting started with AWS?";
+
+ static constexpr const char AWSAndO3DEGlobalDocsText[] = "AWS & O3DE global docs";
+ static constexpr const char AWSAndScriptCanvasActionText[] = "AWS && ScriptCanvas";
+ static constexpr const char AWSAndComponentsActionText[] = "AWS & Components";
+ static constexpr const char CallAWSResourcesActionText[] = "Call AWS resources";
+
+ static constexpr const char AWSCredentialConfigurationActionText[] = "AWS credential configuration";
+
+ static constexpr const char AWSResourceMappingToolActionText[] = "AWS Resource Mapping Tool...";
+
+ static constexpr const char AWSClientAuthActionText[] = "Client Auth";
+ static constexpr const char AWSClientAuthGemOverviewActionText[] = "Gem Overview";
+ static constexpr const char AWSClientAuthCDKAndResourcesActionText[] = "CDK Application and Resource Mappings";
+ static constexpr const char AWSClientAuthScriptCanvasAndLuaActionText[] = "Script Canvas and Lua";
+ static constexpr const char AWSClientAuth3rdPartyAuthProviderActionText[] = "3rd Party developer Authentication Provider support";
+ static constexpr const char AWSClientAuthCustomAuthProviderActionText[] = "Custom developer Authentication Provider support";
+ static constexpr const char AWSClientAuthPlatformSpecificActionText[] = "Platform specific Callouts";
+ static constexpr const char AWSClientAuthAPIReferenceActionText[] = "API Reference";
+
+ static constexpr const char AWSMetricsActionText[] = "Metrics";
+ static constexpr const char AWSMetricsGemOverviewActionText[] = "Metrics Overview";
+ static constexpr const char AWSMetricsSetupGemActionText[] = "Setup Metrics Gem";
+ static constexpr const char AWSMetricsScriptingActionText[] = "Scripting with AWS Metrics";
+ static constexpr const char AWSMetricsAPIReferenceActionText[] = "C++ API with AWS Metrics Gem";
+ static constexpr const char AWSMetricsAdvancedTopicsActionText[] = "Advanced topics";
+ static constexpr const char AWSMetricsSettingsActionText[] = "Metrics Settings";
+} // namespace AWSCore
diff --git a/Gems/AWSCore/Code/Include/Private/Editor/UI/AWSCoreEditorMenu.h b/Gems/AWSCore/Code/Include/Private/Editor/UI/AWSCoreEditorMenu.h
index 19f241e368..c892f86b66 100644
--- a/Gems/AWSCore/Code/Include/Private/Editor/UI/AWSCoreEditorMenu.h
+++ b/Gems/AWSCore/Code/Include/Private/Editor/UI/AWSCoreEditorMenu.h
@@ -35,29 +35,23 @@ namespace AWSCore
static constexpr const char AWSResourceMappingToolIsRunningText[] = "Resource Mapping Tool is running...";
static constexpr const char AWSResourceMappingToolLogWarningText[] =
"Failed to launch Resource Mapping Tool, please check logs for details.";
- static constexpr const char AWSResourceMappingToolActionText[] = "AWS Resource Mapping Tool...";
- static constexpr const char CredentialConfigurationActionText[] = "Credential Configuration";
- static constexpr const char CredentialConfigurationUrl[] = "https://docs.aws.amazon.com/sdk-for-cpp/v1/developer-guide/credentials.html";
- static constexpr const char NewToAWSActionText[] = "New to AWS?";
- static constexpr const char NewToAWSUrl[] = "https://o3deorg.netlify.app/docs/user-guide/gems/reference/aws";
- static constexpr const char AWSAndScriptCanvasActionText[] = "AWS && ScriptCanvas";
- static constexpr const char AWSAndScriptCanvasUrl[] = "https://o3deorg.netlify.app/docs/user-guide/gems/reference/aws";
- static constexpr const char AWSClientAuthActionText[] = "Client Auth";
- static constexpr const char AWSMetricsActionText[] = "Metrics";
AWSCoreEditorMenu(const QString& text);
~AWSCoreEditorMenu();
private:
+ QAction* AddExternalLinkAction(const AZStd::string& name, const AZStd::string& url, const AZStd::string& icon = "");
+
void InitializeResourceMappingToolAction();
void InitializeAWSDocActions();
+ void InitializeAWSGlobalDocsSubMenu();
void InitializeAWSFeatureGemActions();
// AWSCoreEditorRequestBus interface implementation
void SetAWSClientAuthEnabled() override;
void SetAWSMetricsEnabled() override;
- void SetAWSFeatureActionsEnabled(const AZStd::string actionText);
+ QMenu* SetAWSFeatureSubMenu(const AZStd::string& menuText);
// To improve experience, use process watcher to keep track of ongoing tool process
AZStd::unique_ptr m_resourceMappingToolWatcher;
diff --git a/Gems/AWSCore/Code/Source/Configuration/AWSCoreConfiguration.cpp b/Gems/AWSCore/Code/Source/Configuration/AWSCoreConfiguration.cpp
index 3c0f48c058..b22749dbaa 100644
--- a/Gems/AWSCore/Code/Source/Configuration/AWSCoreConfiguration.cpp
+++ b/Gems/AWSCore/Code/Source/Configuration/AWSCoreConfiguration.cpp
@@ -58,6 +58,19 @@ namespace AWSCore
return configFilePath;
}
+ AZStd::string AWSCoreConfiguration::GetResourceMappingConfigFolderPath() const
+ {
+ if (m_sourceProjectFolder.empty())
+ {
+ AZ_Warning(AWSCoreConfigurationName, false, ProjectSourceFolderNotFoundErrorMessage);
+ return "";
+ }
+ AZStd::string configFolderPath = AZStd::string::format(
+ "%s/%s", m_sourceProjectFolder.c_str(), AWSCoreResourceMappingConfigFolderName);
+ AzFramework::StringFunc::Path::Normalize(configFolderPath);
+ return configFolderPath;
+ }
+
void AWSCoreConfiguration::InitConfig()
{
InitSourceProjectFolderPath();
@@ -123,7 +136,7 @@ namespace AWSCore
auto profileNamePath = AZStd::string::format("%s%s",
AZ::SettingsRegistryMergeUtils::OrganizationRootKey, AWSCoreProfileNameKey);
m_settingsRegistry.Remove(profileNamePath);
- m_profileName.clear();
+ m_profileName = AWSCoreDefaultProfileName;
auto resourceMappingConfigFileNamePath = AZStd::string::format("%s%s",
AZ::SettingsRegistryMergeUtils::OrganizationRootKey, AWSCoreResourceMappingConfigFileNameKey);
diff --git a/Gems/AWSCore/Code/Source/Editor/AWSCoreEditorManager.cpp b/Gems/AWSCore/Code/Source/Editor/AWSCoreEditorManager.cpp
index 1e3e44255a..89956d61b8 100644
--- a/Gems/AWSCore/Code/Source/Editor/AWSCoreEditorManager.cpp
+++ b/Gems/AWSCore/Code/Source/Editor/AWSCoreEditorManager.cpp
@@ -16,7 +16,7 @@
namespace AWSCore
{
AWSCoreEditorManager::AWSCoreEditorManager()
- : m_awsCoreEditorMenu(new AWSCoreEditorMenu(CLOUD_SERVICES_MENU_TEXT))
+ : m_awsCoreEditorMenu(new AWSCoreEditorMenu(AWS_MENU_TEXT))
{
}
diff --git a/Gems/AWSCore/Code/Source/Editor/UI/AWSCoreEditorMenu.cpp b/Gems/AWSCore/Code/Source/Editor/UI/AWSCoreEditorMenu.cpp
index 754cc32751..c319788547 100644
--- a/Gems/AWSCore/Code/Source/Editor/UI/AWSCoreEditorMenu.cpp
+++ b/Gems/AWSCore/Code/Source/Editor/UI/AWSCoreEditorMenu.cpp
@@ -13,10 +13,13 @@
#include
#include
#include
+#include
#include
#include
#include
+#include
+#include
#include
#include
@@ -36,8 +39,8 @@ namespace AWSCore
: QMenu(text)
, m_resourceMappingToolWatcher(nullptr)
{
- InitializeResourceMappingToolAction();
InitializeAWSDocActions();
+ InitializeResourceMappingToolAction();
this->addSeparator();
InitializeAWSFeatureGemActions();
@@ -58,6 +61,21 @@ namespace AWSCore
this->clear();
}
+ QAction* AWSCoreEditorMenu::AddExternalLinkAction(
+ const AZStd::string& name, const AZStd::string& url, const AZStd::string& icon)
+ {
+ QAction* linkAction = new QAction(QObject::tr(name.c_str()));
+ QObject::connect(linkAction, &QAction::triggered, this,
+ [url]() {
+ QDesktopServices::openUrl(QUrl(url.c_str()));
+ });
+ if (!icon.empty())
+ {
+ linkAction->setIcon(QIcon(icon.c_str()));
+ }
+ return linkAction;
+ }
+
void AWSCoreEditorMenu::InitializeResourceMappingToolAction()
{
#ifdef AWSCORE_EDITOR_RESOURCE_MAPPING_TOOL_ENABLED
@@ -103,21 +121,21 @@ namespace AWSCore
void AWSCoreEditorMenu::InitializeAWSDocActions()
{
- QAction* credentialConfiguration = new QAction(QObject::tr(CredentialConfigurationActionText));
- QObject::connect(credentialConfiguration, &QAction::triggered, this, []() {
- QDesktopServices::openUrl(QUrl(CredentialConfigurationUrl));
- });
- this->addAction(credentialConfiguration);
+ this->addAction(AddExternalLinkAction(NewToAWSActionText, NewToAWSUrl, ":/Notifications/link.svg"));
- QAction* newToAWS = new QAction(QObject::tr(NewToAWSActionText));
- QObject::connect(newToAWS, &QAction::triggered, this, []() {
- QDesktopServices::openUrl(QUrl(NewToAWSUrl)); });
- this->addAction(newToAWS);
+ InitializeAWSGlobalDocsSubMenu();
- QAction* awsAndScriptCanvas = new QAction(QObject::tr(AWSAndScriptCanvasActionText));
- QObject::connect(awsAndScriptCanvas, &QAction::triggered, this, []() {
- QDesktopServices::openUrl(QUrl(AWSAndScriptCanvasUrl)); });
- this->addAction(awsAndScriptCanvas);
+ this->addAction(AddExternalLinkAction(
+ AWSCredentialConfigurationActionText, AWSCredentialConfigurationUrl, ":/Notifications/link.svg"));
+ }
+
+ void AWSCoreEditorMenu::InitializeAWSGlobalDocsSubMenu()
+ {
+ QMenu* globalDocsMenu = this->addMenu(QObject::tr(AWSAndO3DEGlobalDocsText));
+
+ globalDocsMenu->addAction(AddExternalLinkAction(AWSAndScriptCanvasActionText, AWSAndScriptCanvasUrl, ":/Notifications/link.svg"));
+ globalDocsMenu->addAction(AddExternalLinkAction(AWSAndComponentsActionText, AWSAndComponentsUrl, ":/Notifications/link.svg"));
+ globalDocsMenu->addAction(AddExternalLinkAction(CallAWSResourcesActionText, CallAWSResourcesUrl, ":/Notifications/link.svg"));
}
void AWSCoreEditorMenu::InitializeAWSFeatureGemActions()
@@ -135,25 +153,67 @@ namespace AWSCore
void AWSCoreEditorMenu::SetAWSClientAuthEnabled()
{
- SetAWSFeatureActionsEnabled(AWSClientAuthActionText);
+ // TODO: instead of creating submenu in core editor, aws feature gem should return submenu component directly
+ QMenu* subMenu = SetAWSFeatureSubMenu(AWSClientAuthActionText);
+
+ subMenu->addAction(AddExternalLinkAction(
+ AWSClientAuthGemOverviewActionText, AWSClientAuthGemOverviewUrl, ":/Notifications/link.svg"));
+ subMenu->addAction(AddExternalLinkAction(
+ AWSClientAuthCDKAndResourcesActionText, AWSClientAuthCDKAndResourcesUrl, ":/Notifications/link.svg"));
+ subMenu->addAction(AddExternalLinkAction(
+ AWSClientAuthScriptCanvasAndLuaActionText, AWSClientAuthScriptCanvasAndLuaUrl, ":/Notifications/link.svg"));
+ subMenu->addAction(AddExternalLinkAction(
+ AWSClientAuth3rdPartyAuthProviderActionText, AWSClientAuth3rdPartyAuthProviderUrl, ":/Notifications/link.svg"));
+ subMenu->addAction(AddExternalLinkAction(
+ AWSClientAuthCustomAuthProviderActionText, AWSClientAuthCustomAuthProviderUrl, ":/Notifications/link.svg"));
+ subMenu->addAction(AddExternalLinkAction(
+ AWSClientAuthPlatformSpecificActionText, AWSClientAuthPlatformSpecificUrl, ":/Notifications/link.svg"));
+ subMenu->addAction(AddExternalLinkAction(
+ AWSClientAuthAPIReferenceActionText, AWSClientAuthAPIReferenceUrl, ":/Notifications/link.svg"));
}
void AWSCoreEditorMenu::SetAWSMetricsEnabled()
{
- SetAWSFeatureActionsEnabled(AWSMetricsActionText);
+ // TODO: instead of creating submenu in core editor, aws feature gem should return submenu component directly
+ QMenu* subMenu = SetAWSFeatureSubMenu(AWSMetricsActionText);
+
+ subMenu->addAction(AddExternalLinkAction(
+ AWSMetricsGemOverviewActionText, AWSMetricsGemOverviewUrl, ":/Notifications/link.svg"));
+ subMenu->addAction(AddExternalLinkAction(
+ AWSMetricsSetupGemActionText, AWSMetricsSetupGemUrl, ":/Notifications/link.svg"));
+ subMenu->addAction(AddExternalLinkAction(
+ AWSMetricsScriptingActionText, AWSMetricsScriptingUrl, ":/Notifications/link.svg"));
+ subMenu->addAction(AddExternalLinkAction(
+ AWSMetricsAPIReferenceActionText, AWSMetricsAPIReferenceUrl, ":/Notifications/link.svg"));
+ subMenu->addAction(AddExternalLinkAction(
+ AWSMetricsAdvancedTopicsActionText, AWSMetricsAdvancedTopicsUrl, ":/Notifications/link.svg"));
+
+ AZStd::string priorAlias = AZ::IO::FileIOBase::GetInstance()->GetAlias("@devroot@");
+ AZStd::string configFilePath = priorAlias + "\\Gems\\AWSMetrics\\Code\\" + AZ::SettingsRegistryInterface::RegistryFolder;
+ AzFramework::StringFunc::Path::Normalize(configFilePath);
+
+ QAction* settingsAction = new QAction(QObject::tr(AWSMetricsSettingsActionText));
+ QObject::connect(settingsAction, &QAction::triggered, this,
+ [configFilePath](){
+ QDesktopServices::openUrl(QUrl::fromLocalFile(configFilePath.c_str()));
+ });
+ subMenu->addAction(settingsAction);
}
- void AWSCoreEditorMenu::SetAWSFeatureActionsEnabled(const AZStd::string actionText)
+ QMenu* AWSCoreEditorMenu::SetAWSFeatureSubMenu(const AZStd::string& menuText)
{
auto actionList = this->actions();
for (QList::iterator itr = actionList.begin(); itr != actionList.end(); itr++)
{
- if (QString::compare((*itr)->text(), actionText.c_str()) == 0)
+ if (QString::compare((*itr)->text(), menuText.c_str()) == 0)
{
- (*itr)->setIcon(QIcon(QString(":/Notifications/checkmark.svg")));
- (*itr)->setEnabled(true);
- break;
+ QMenu* subMenu = new QMenu(QObject::tr(menuText.c_str()));
+ subMenu->setIcon(QIcon(QString(":/Notifications/checkmark.svg")));
+ this->insertMenu(*itr, subMenu);
+ this->removeAction(*itr);
+ return subMenu;
}
}
+ return nullptr;
}
} // namespace AWSCore
diff --git a/Gems/AWSCore/Code/Source/Editor/UI/AWSCoreResourceMappingToolAction.cpp b/Gems/AWSCore/Code/Source/Editor/UI/AWSCoreResourceMappingToolAction.cpp
index fb46a8a700..18d437a66c 100644
--- a/Gems/AWSCore/Code/Source/Editor/UI/AWSCoreResourceMappingToolAction.cpp
+++ b/Gems/AWSCore/Code/Source/Editor/UI/AWSCoreResourceMappingToolAction.cpp
@@ -14,6 +14,7 @@
#include
#include
+#include
#include
namespace AWSCore
@@ -108,17 +109,24 @@ namespace AWSCore
{
return "";
}
+
+ AZStd::string profileName = "default";
+ AWSCoreInternalRequestBus::BroadcastResult(profileName, &AWSCoreInternalRequests::GetProfileName);
+
+ AZStd::string configPath = "";
+ AWSCoreInternalRequestBus::BroadcastResult(configPath, &AWSCoreInternalRequests::GetResourceMappingConfigFolderPath);
+
if (m_isDebug)
{
return AZStd::string::format(
- "%s debug %s --binaries_path %s --debug",
- m_enginePythonEntryPath.c_str(), m_toolScriptPath.c_str(), m_toolQtBinDirectoryPath.c_str());
+ "%s debug %s --binaries_path %s --debug --profile %s --config_path %s", m_enginePythonEntryPath.c_str(),
+ m_toolScriptPath.c_str(), m_toolQtBinDirectoryPath.c_str(), profileName.c_str(), configPath.c_str());
}
else
{
return AZStd::string::format(
- "%s %s --binaries_path %s",
- m_enginePythonEntryPath.c_str(), m_toolScriptPath.c_str(), m_toolQtBinDirectoryPath.c_str());
+ "%s %s --binaries_path %s --profile %s --config_path %s", m_enginePythonEntryPath.c_str(),
+ m_toolScriptPath.c_str(), m_toolQtBinDirectoryPath.c_str(), profileName.c_str(), configPath.c_str());
}
}
diff --git a/Gems/AWSCore/Code/Tests/AWSCoreEditorSystemComponentTest.cpp b/Gems/AWSCore/Code/Tests/AWSCoreEditorSystemComponentTest.cpp
index e9c249f1c8..ff78d8e252 100644
--- a/Gems/AWSCore/Code/Tests/AWSCoreEditorSystemComponentTest.cpp
+++ b/Gems/AWSCore/Code/Tests/AWSCoreEditorSystemComponentTest.cpp
@@ -85,7 +85,7 @@ TEST_F(AWSCoreEditorSystemComponentTest, NotifyMainWindowInitialized_HaveDummyMe
testMenuBar->addMenu("dummy menu");
AzToolsFramework::EditorEvents::Bus::Broadcast(&AzToolsFramework::EditorEvents::NotifyMainWindowInitialized, &testMainWindow);
EXPECT_TRUE(testMenuBar->actions().size() == 2);
- EXPECT_TRUE(QString::compare(testMenuBar->actions()[1]->text(), AWSCoreEditorManager::CLOUD_SERVICES_MENU_TEXT) == 0);
+ EXPECT_TRUE(QString::compare(testMenuBar->actions()[1]->text(), AWSCoreEditorManager::AWS_MENU_TEXT) == 0);
}
TEST_F(AWSCoreEditorSystemComponentTest, NotifyMainWindowInitialized_HaveHelpMenuInMenuBar_ExpectedMenuGetsAddedAtFront)
@@ -95,5 +95,5 @@ TEST_F(AWSCoreEditorSystemComponentTest, NotifyMainWindowInitialized_HaveHelpMen
testMenuBar->addMenu(AWSCoreEditorSystemComponent::EDITOR_HELP_MENU_TEXT);
AzToolsFramework::EditorEvents::Bus::Broadcast(&AzToolsFramework::EditorEvents::NotifyMainWindowInitialized, &testMainWindow);
EXPECT_TRUE(testMenuBar->actions().size() == 2);
- EXPECT_TRUE(QString::compare(testMenuBar->actions()[0]->text(), AWSCoreEditorManager::CLOUD_SERVICES_MENU_TEXT) == 0);
+ EXPECT_TRUE(QString::compare(testMenuBar->actions()[0]->text(), AWSCoreEditorManager::AWS_MENU_TEXT) == 0);
}
diff --git a/Gems/AWSCore/Code/Tests/Credential/AWSDefaultCredentialHandlerTest.cpp b/Gems/AWSCore/Code/Tests/Credential/AWSDefaultCredentialHandlerTest.cpp
index 297e56fc33..7f00adaae7 100644
--- a/Gems/AWSCore/Code/Tests/Credential/AWSDefaultCredentialHandlerTest.cpp
+++ b/Gems/AWSCore/Code/Tests/Credential/AWSDefaultCredentialHandlerTest.cpp
@@ -34,7 +34,8 @@ public:
MOCK_METHOD0(GetAWSCredentials, Aws::Auth::AWSCredentials());
};
-class AWSDefaultCredentialHandlerMock : public AWSDefaultCredentialHandler
+class AWSDefaultCredentialHandlerMock
+ : public AWSDefaultCredentialHandler
{
public:
void SetupMocks(
@@ -76,6 +77,7 @@ public:
// AWSCoreInternalRequestBus interface implementation
AZStd::string GetProfileName() const override { return m_profileName; }
AZStd::string GetResourceMappingConfigFilePath() const override { return ""; }
+ AZStd::string GetResourceMappingConfigFolderPath() const override { return ""; }
void ReloadConfiguration() override {}
std::shared_ptr m_environmentCredentialsProviderMock;
diff --git a/Gems/AWSCore/Code/Tests/Editor/UI/AWSCoreEditorMenuTest.cpp b/Gems/AWSCore/Code/Tests/Editor/UI/AWSCoreEditorMenuTest.cpp
index 7a578d2bbe..bde2a43993 100644
--- a/Gems/AWSCore/Code/Tests/Editor/UI/AWSCoreEditorMenuTest.cpp
+++ b/Gems/AWSCore/Code/Tests/Editor/UI/AWSCoreEditorMenuTest.cpp
@@ -14,6 +14,7 @@
#include
#include
+#include
#include
#include
#include
@@ -35,6 +36,7 @@ class AWSCoreEditorMenuTest
{
AWSCoreEditorUIFixture::SetUp();
AWSCoreFixture::SetUp();
+ m_localFileIO->SetAlias("@devroot@", "dummy engine root");
}
void TearDown() override
@@ -77,12 +79,12 @@ TEST_F(AWSCoreEditorMenuTest, AWSCoreEditorMenu_BroadcastFeatureGemsAreEnabled_C
QList actualActions = testMenu.actions();
for (QList::iterator itr = actualActions.begin(); itr != actualActions.end(); itr++)
{
- if (QString::compare((*itr)->text(), AWSCoreEditorMenu::AWSClientAuthActionText) == 0)
+ if (QString::compare((*itr)->text(), AWSClientAuthActionText) == 0)
{
EXPECT_TRUE((*itr)->isEnabled());
}
- if (QString::compare((*itr)->text(), AWSCoreEditorMenu::AWSMetricsActionText) == 0)
+ if (QString::compare((*itr)->text(), AWSMetricsActionText) == 0)
{
EXPECT_TRUE((*itr)->isEnabled());
}
diff --git a/Gems/AWSCore/Code/Tests/ResourceMapping/AWSResourceMappingManagerTest.cpp b/Gems/AWSCore/Code/Tests/ResourceMapping/AWSResourceMappingManagerTest.cpp
index 3adebc9a24..b46a840d40 100644
--- a/Gems/AWSCore/Code/Tests/ResourceMapping/AWSResourceMappingManagerTest.cpp
+++ b/Gems/AWSCore/Code/Tests/ResourceMapping/AWSResourceMappingManagerTest.cpp
@@ -119,6 +119,7 @@ public:
// AWSCoreInternalRequestBus interface implementation
AZStd::string GetProfileName() const override { return ""; }
AZStd::string GetResourceMappingConfigFilePath() const override { return m_normalizedConfigFilePath; }
+ AZStd::string GetResourceMappingConfigFolderPath() const override { return m_normalizedConfigFolderPath; }
void ReloadConfiguration() override { m_reloadConfigurationCounter++; }
AZStd::unique_ptr m_resourceMappingManager;
diff --git a/Gems/AWSCore/Code/Tools/ResourceMappingTool/manager/configuration_manager.py b/Gems/AWSCore/Code/Tools/ResourceMappingTool/manager/configuration_manager.py
index ee305c750a..b679921196 100755
--- a/Gems/AWSCore/Code/Tools/ResourceMappingTool/manager/configuration_manager.py
+++ b/Gems/AWSCore/Code/Tools/ResourceMappingTool/manager/configuration_manager.py
@@ -48,11 +48,14 @@ class ConfigurationManager(object):
def configuration(self, new_configuration: ConfigurationManager) -> None:
self._configuration = new_configuration
- def setup(self) -> None:
+ def setup(self, config_path: str) -> None:
logger.info("Setting up default configuration ...")
- # TODO: remove config directory and files default setup once integrating with user input
try:
- self._configuration.config_directory = file_utils.get_current_directory_path()
+ normalized_config_path: str = file_utils.normalize_file_path(config_path);
+ if normalized_config_path:
+ self._configuration.config_directory = normalized_config_path
+ else:
+ self._configuration.config_directory = file_utils.get_current_directory_path()
self._configuration.config_files = \
file_utils.find_files_with_suffix_under_directory(self._configuration.config_directory,
constants.RESOURCE_MAPPING_CONFIG_FILE_NAME_SUFFIX)
diff --git a/Gems/AWSCore/Code/Tools/ResourceMappingTool/resource_mapping_tool.py b/Gems/AWSCore/Code/Tools/ResourceMappingTool/resource_mapping_tool.py
index 0ee7455e6c..e99bf5d441 100755
--- a/Gems/AWSCore/Code/Tools/ResourceMappingTool/resource_mapping_tool.py
+++ b/Gems/AWSCore/Code/Tools/ResourceMappingTool/resource_mapping_tool.py
@@ -13,13 +13,16 @@ from argparse import (ArgumentParser, Namespace)
import logging
import sys
+from utils import aws_utils
from utils import environment_utils
from utils import file_utils
# arguments setup
argument_parser: ArgumentParser = ArgumentParser()
argument_parser.add_argument('--binaries_path', help='Path to QT Binaries necessary for PySide.')
+argument_parser.add_argument('--config_path', help='Path to resource mapping config directory.')
argument_parser.add_argument('--debug', action='store_true', help='Execute on debug mode to enable DEBUG logging level')
+argument_parser.add_argument('--profile', default='default', help='Named AWS profile to use for querying AWS resources')
arguments: Namespace = argument_parser.parse_args()
# logging setup
@@ -70,9 +73,12 @@ if __name__ == "__main__":
except FileNotFoundError:
logger.warning("Failed to load style sheet for resource mapping tool")
+ logger.info("Initializing boto3 default session ...")
+ aws_utils.setup_default_session(arguments.profile)
+
logger.info("Initializing configuration manager ...")
configuration_manager: ConfigurationManager = ConfigurationManager()
- configuration_manager.setup()
+ configuration_manager.setup(arguments.config_path)
logger.info("Initializing thread manager ...")
thread_manager: ThreadManager = ThreadManager()
diff --git a/Gems/AWSCore/Code/Tools/ResourceMappingTool/tests/unit/manager/test_configuration_manager.py b/Gems/AWSCore/Code/Tools/ResourceMappingTool/tests/unit/manager/test_configuration_manager.py
index a9dcf97af9..552f9fff01 100755
--- a/Gems/AWSCore/Code/Tools/ResourceMappingTool/tests/unit/manager/test_configuration_manager.py
+++ b/Gems/AWSCore/Code/Tools/ResourceMappingTool/tests/unit/manager/test_configuration_manager.py
@@ -43,7 +43,7 @@ class TestConfigurationManager(TestCase):
mock_find_files_with_suffix_under_directory: MagicMock,
mock_get_default_account_id: MagicMock,
mock_get_default_region: MagicMock) -> None:
- TestConfigurationManager._expected_configuration_manager.setup()
+ TestConfigurationManager._expected_configuration_manager.setup("")
mock_get_current_directory_path.assert_called_once()
mock_check_path_exists.assert_called_once_with(TestConfigurationManager._expected_directory_path)
mock_find_files_with_suffix_under_directory.assert_called_once_with(
@@ -58,3 +58,29 @@ class TestConfigurationManager(TestCase):
TestConfigurationManager._expected_account_id
assert TestConfigurationManager._expected_configuration_manager.configuration.region == \
TestConfigurationManager._expected_region
+
+ @patch("utils.aws_utils.get_default_region", return_value=_expected_region)
+ @patch("utils.aws_utils.get_default_account_id", return_value=_expected_account_id)
+ @patch("utils.file_utils.find_files_with_suffix_under_directory", return_value=_expected_config_files)
+ @patch("utils.file_utils.check_path_exists", return_value=True)
+ @patch("utils.file_utils.normalize_file_path", return_value=_expected_directory_path)
+ def test_setup_get_configuration_setup_with_path_as_expected(self, mock_normalize_file_path: MagicMock,
+ mock_check_path_exists: MagicMock,
+ mock_find_files_with_suffix_under_directory: MagicMock,
+ mock_get_default_account_id: MagicMock,
+ mock_get_default_region: MagicMock) -> None:
+ TestConfigurationManager._expected_configuration_manager.setup(TestConfigurationManager._expected_directory_path)
+ mock_normalize_file_path.assert_called_once()
+ mock_check_path_exists.assert_called_once_with(TestConfigurationManager._expected_directory_path)
+ mock_find_files_with_suffix_under_directory.assert_called_once_with(
+ TestConfigurationManager._expected_directory_path, constants.RESOURCE_MAPPING_CONFIG_FILE_NAME_SUFFIX)
+ mock_get_default_account_id.assert_called_once()
+ mock_get_default_region.assert_called_once()
+ assert TestConfigurationManager._expected_configuration_manager.configuration.config_directory == \
+ TestConfigurationManager._expected_directory_path
+ assert TestConfigurationManager._expected_configuration_manager.configuration.config_files == \
+ TestConfigurationManager._expected_config_files
+ assert TestConfigurationManager._expected_configuration_manager.configuration.account_id == \
+ TestConfigurationManager._expected_account_id
+ assert TestConfigurationManager._expected_configuration_manager.configuration.region == \
+ TestConfigurationManager._expected_region
diff --git a/Gems/AWSCore/Code/Tools/ResourceMappingTool/tests/unit/manager/test_view_manager.py b/Gems/AWSCore/Code/Tools/ResourceMappingTool/tests/unit/manager/test_view_manager.py
index eb8304182f..e5c84c6579 100755
--- a/Gems/AWSCore/Code/Tools/ResourceMappingTool/tests/unit/manager/test_view_manager.py
+++ b/Gems/AWSCore/Code/Tools/ResourceMappingTool/tests/unit/manager/test_view_manager.py
@@ -36,7 +36,7 @@ class TestViewManager(TestCase):
main_window_patcher: patch = patch("manager.view_manager.QMainWindow")
cls._mock_main_window = main_window_patcher.start()
- window_icon_patcher: patch = patch("manager.view_manager.QPixmap")
+ window_icon_patcher: patch = patch("manager.view_manager.QIcon")
window_icon_patcher.start()
stacked_pages_patcher: patch = patch("manager.view_manager.QStackedWidget")
diff --git a/Gems/AWSCore/Code/Tools/ResourceMappingTool/tests/unit/utils/test_aws_utils.py b/Gems/AWSCore/Code/Tools/ResourceMappingTool/tests/unit/utils/test_aws_utils.py
index 7244431e76..51bd6ade23 100755
--- a/Gems/AWSCore/Code/Tools/ResourceMappingTool/tests/unit/utils/test_aws_utils.py
+++ b/Gems/AWSCore/Code/Tools/ResourceMappingTool/tests/unit/utils/test_aws_utils.py
@@ -37,13 +37,12 @@ class TestAWSUtils(TestCase):
.build()
def setUp(self) -> None:
- client_patcher: patch = patch("boto3.client")
- self.addCleanup(client_patcher.stop)
- self._mock_client: MagicMock = client_patcher.start()
-
session_patcher: patch = patch("boto3.session.Session")
self.addCleanup(session_patcher.stop)
self._mock_session: MagicMock = session_patcher.start()
+ self._mock_client: MagicMock = self._mock_session.return_value.client
+
+ aws_utils.setup_default_session("default")
def test_get_default_account_id_return_expected_account_id(self) -> None:
mocked_sts_client: MagicMock = self._mock_client.return_value
diff --git a/Gems/AWSCore/Code/Tools/ResourceMappingTool/utils/aws_utils.py b/Gems/AWSCore/Code/Tools/ResourceMappingTool/utils/aws_utils.py
index 329d3ff44e..b0c3c9c1b3 100755
--- a/Gems/AWSCore/Code/Tools/ResourceMappingTool/utils/aws_utils.py
+++ b/Gems/AWSCore/Code/Tools/ResourceMappingTool/utils/aws_utils.py
@@ -26,6 +26,8 @@ aws account, region, resources, etc.
_PAGINATION_MAX_ITEMS: int = 10
_PAGINATION_PAGE_SIZE: int = 10
+default_session: boto3.session.Session = None
+
class AWSConstants(object):
CLOUDFORMATION_SERVICE_NAME: str = "cloudformation"
@@ -53,15 +55,20 @@ def _close_client_connection(client: BaseClient) -> None:
def _initialize_boto3_aws_client(service: str, region: str = "") -> BaseClient:
if region:
- boto3_client: BaseClient = boto3.client(service, region_name=region)
+ boto3_client: BaseClient = default_session.client(service, region_name=region)
else:
- boto3_client: BaseClient = boto3.client(service)
+ boto3_client: BaseClient = default_session.client(service)
boto3_client.meta.events.register(
f"after-call.{service}.*", lambda **kwargs: _close_client_connection(boto3_client)
)
return boto3_client
+def setup_default_session(profile: str) -> None:
+ global default_session
+ default_session = boto3.session.Session(profile_name=profile)
+
+
def get_default_account_id() -> str:
sts_client: BaseClient = _initialize_boto3_aws_client(AWSConstants.STS_SERVICE_NAME)
try:
@@ -72,7 +79,7 @@ def get_default_account_id() -> str:
def get_default_region() -> str:
- region: str = boto3.session.Session().region_name
+ region: str = default_session.region_name
if region:
return region
diff --git a/Gems/AWSCore/Code/awscore_editor_files.cmake b/Gems/AWSCore/Code/awscore_editor_files.cmake
index 652f0455e1..13bfbb6102 100644
--- a/Gems/AWSCore/Code/awscore_editor_files.cmake
+++ b/Gems/AWSCore/Code/awscore_editor_files.cmake
@@ -12,6 +12,8 @@
set(FILES
Include/Private/AWSCoreEditorSystemComponent.h
Include/Private/Editor/AWSCoreEditorManager.h
+ Include/Private/Editor/Constants/AWSCoreEditorMenuLinks.h
+ Include/Private/Editor/Constants/AWSCoreEditorMenuNames.h
Include/Private/Editor/UI/AWSCoreEditorMenu.h
Include/Private/Editor/UI/AWSCoreResourceMappingToolAction.h
Source/AWSCoreEditorSystemComponent.cpp
diff --git a/Gems/AWSMetrics/Code/CMakeLists.txt b/Gems/AWSMetrics/Code/CMakeLists.txt
index ffa9ac0408..aa790371d2 100644
--- a/Gems/AWSMetrics/Code/CMakeLists.txt
+++ b/Gems/AWSMetrics/Code/CMakeLists.txt
@@ -23,6 +23,7 @@ ly_add_target(
PRIVATE
AZ::AzCore
AZ::AzFramework
+ PUBLIC
Gem::AWSCore
)
@@ -40,10 +41,15 @@ ly_add_target(
PRIVATE
AZ::AzCore
AZ::AzFramework
- Gem::AWSCore
Gem::AWSMetrics.Static
+ RUNTIME_DEPENDENCIES
+ Gem::AWSCore
)
+# Servers and Clients use the above metrics module
+ly_create_alias(NAME AWSMetrics.Servers NAMESPACE Gem TARGETS Gem::AWSMetrics)
+ly_create_alias(NAME AWSMetrics.Clients NAMESPACE Gem TARGETS Gem::AWSMetrics)
+
################################################################################
# Tests
################################################################################
@@ -63,8 +69,9 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED)
AZ::AzTest
AZ::AzCore
AZ::AzFramework
- Gem::AWSCore
Gem::AWSMetrics.Static
+ RUNTIME_DEPENDENCIES
+ Gem::AWSCore
)
ly_add_googletest(
NAME Gem::AWSMetrics.Tests
diff --git a/Gems/Achievements/Code/CMakeLists.txt b/Gems/Achievements/Code/CMakeLists.txt
index b49409bd5e..4b2aa07dab 100644
--- a/Gems/Achievements/Code/CMakeLists.txt
+++ b/Gems/Achievements/Code/CMakeLists.txt
@@ -44,3 +44,6 @@ ly_add_target(
PRIVATE
Gem::Achievements.Static
)
+
+# we'll load the above "Gem::Achievements" module in clients only.
+ly_create_alias(NAME Achievements.Clients NAMESPACE Gem TARGETS Gem::Achievements)
diff --git a/Gems/AssetMemoryAnalyzer/Code/CMakeLists.txt b/Gems/AssetMemoryAnalyzer/Code/CMakeLists.txt
index df97feaa3f..bdf76eca60 100644
--- a/Gems/AssetMemoryAnalyzer/Code/CMakeLists.txt
+++ b/Gems/AssetMemoryAnalyzer/Code/CMakeLists.txt
@@ -43,6 +43,10 @@ ly_add_target(
Gem::ImGui
)
+# AssetMemoryAnalyzer is available in clients and servers.
+ly_create_alias(NAME AssetMemoryAnalyzer.Clients NAMESPACE Gem TARGETS Gem::AssetMemoryAnalyzer)
+ly_create_alias(NAME AssetMemoryAnalyzer.Servers NAMESPACE Gem TARGETS Gem::AssetMemoryAnalyzer)
+
################################################################################
# Tests
################################################################################
@@ -65,3 +69,4 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED)
NAME Gem::AssetMemoryAnalyzer.Tests
)
endif()
+
diff --git a/Gems/AssetValidation/Code/CMakeLists.txt b/Gems/AssetValidation/Code/CMakeLists.txt
index 983ddd9e9d..f62baf57f5 100644
--- a/Gems/AssetValidation/Code/CMakeLists.txt
+++ b/Gems/AssetValidation/Code/CMakeLists.txt
@@ -65,3 +65,8 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
NAME Gem::AssetValidation.Tests
)
endif()
+
+# AssetValidation should be active in all clients plus tools
+ly_create_alias(NAME AssetValidation.Clients NAMESPACE Gem TARGETS Gem::AssetValidation)
+ly_create_alias(NAME AssetValidation.Tools NAMESPACE Gem TARGETS Gem::AssetValidation)
+
diff --git a/Gems/Atom/Asset/ImageProcessingAtom/gem.json b/Gems/Atom/Asset/ImageProcessingAtom/gem.json
new file mode 100644
index 0000000000..86256bff9d
--- /dev/null
+++ b/Gems/Atom/Asset/ImageProcessingAtom/gem.json
@@ -0,0 +1,10 @@
+{
+ "gem_name": "ImageProcessingAtom",
+ "display_name": "Atom Image Processing",
+ "summary": "",
+ "canonical_tags": [
+ "Gem"
+ ],
+ "user_tags": [
+ ]
+}
diff --git a/Gems/Atom/Asset/Shader/gem.json b/Gems/Atom/Asset/Shader/gem.json
new file mode 100644
index 0000000000..71c741f436
--- /dev/null
+++ b/Gems/Atom/Asset/Shader/gem.json
@@ -0,0 +1,10 @@
+{
+ "gem_name": "AtomShader",
+ "display_name": "Atom Shader Builder",
+ "summary": "",
+ "canonical_tags": [
+ "Gem"
+ ],
+ "user_tags": [
+ ]
+}
diff --git a/Gems/Atom/Bootstrap/gem.json b/Gems/Atom/Bootstrap/gem.json
new file mode 100644
index 0000000000..8aa5cade6e
--- /dev/null
+++ b/Gems/Atom/Bootstrap/gem.json
@@ -0,0 +1,10 @@
+{
+ "gem_name": "Atom_Bootstrap",
+ "display_name": "Atom Bootstrap",
+ "summary": "",
+ "canonical_tags": [
+ "Gem"
+ ],
+ "user_tags": [
+ ]
+}
diff --git a/Gems/Atom/Component/DebugCamera/gem.json b/Gems/Atom/Component/DebugCamera/gem.json
new file mode 100644
index 0000000000..06d39d1fc0
--- /dev/null
+++ b/Gems/Atom/Component/DebugCamera/gem.json
@@ -0,0 +1,10 @@
+{
+ "gem_name": "Atom_Component_DebugCamera",
+ "display_name": "Atom Debug Camera Component",
+ "summary": "",
+ "canonical_tags": [
+ "Gem"
+ ],
+ "user_tags": [
+ ]
+}
diff --git a/Gems/Atom/Feature/Common/gem.json b/Gems/Atom/Feature/Common/gem.json
new file mode 100644
index 0000000000..6980863b4c
--- /dev/null
+++ b/Gems/Atom/Feature/Common/gem.json
@@ -0,0 +1,10 @@
+{
+ "gem_name": "Atom_Feature_Common",
+ "display_name": "Atom Feature Common",
+ "summary": "",
+ "canonical_tags": [
+ "Gem"
+ ],
+ "user_tags": [
+ ]
+}
diff --git a/Gems/Atom/RHI/DX12/gem.json b/Gems/Atom/RHI/DX12/gem.json
new file mode 100644
index 0000000000..683ccfb43a
--- /dev/null
+++ b/Gems/Atom/RHI/DX12/gem.json
@@ -0,0 +1,10 @@
+{
+ "gem_name": "Atom_RHI_DX12",
+ "display_name": "Atom RHI DX12",
+ "summary": "",
+ "canonical_tags": [
+ "Gem"
+ ],
+ "user_tags": [
+ ]
+}
diff --git a/Gems/Atom/RHI/Metal/gem.json b/Gems/Atom/RHI/Metal/gem.json
new file mode 100644
index 0000000000..3e1726e8fa
--- /dev/null
+++ b/Gems/Atom/RHI/Metal/gem.json
@@ -0,0 +1,10 @@
+{
+ "gem_name": "Atom_RHI_Metal",
+ "display_name": "Atom RHI Metal",
+ "summary": "",
+ "canonical_tags": [
+ "Gem"
+ ],
+ "user_tags": [
+ ]
+}
diff --git a/Gems/Atom/RHI/Null/gem.json b/Gems/Atom/RHI/Null/gem.json
new file mode 100644
index 0000000000..4fa5f1e480
--- /dev/null
+++ b/Gems/Atom/RHI/Null/gem.json
@@ -0,0 +1,10 @@
+{
+ "gem_name": "Atom_RHI_Null",
+ "display_name": "Atom RHI Null",
+ "summary": "",
+ "canonical_tags": [
+ "Gem"
+ ],
+ "user_tags": [
+ ]
+}
diff --git a/Gems/Atom/RHI/Vulkan/gem.json b/Gems/Atom/RHI/Vulkan/gem.json
new file mode 100644
index 0000000000..1f2fcd7f30
--- /dev/null
+++ b/Gems/Atom/RHI/Vulkan/gem.json
@@ -0,0 +1,10 @@
+{
+ "gem_name": "Atom_RHI_Vulkan",
+ "display_name": "Atom RHI Vulkan",
+ "summary": "",
+ "canonical_tags": [
+ "Gem"
+ ],
+ "user_tags": [
+ ]
+}
diff --git a/Gems/Atom/RHI/gem.json b/Gems/Atom/RHI/gem.json
new file mode 100644
index 0000000000..eb67e40a4a
--- /dev/null
+++ b/Gems/Atom/RHI/gem.json
@@ -0,0 +1,10 @@
+{
+ "gem_name": "Atom_RHI",
+ "display_name": "Atom RHI",
+ "summary": "",
+ "canonical_tags": [
+ "Gem"
+ ],
+ "user_tags": [
+ ]
+}
diff --git a/Gems/Atom/RPI/gem.json b/Gems/Atom/RPI/gem.json
new file mode 100644
index 0000000000..7e822611a9
--- /dev/null
+++ b/Gems/Atom/RPI/gem.json
@@ -0,0 +1,10 @@
+{
+ "gem_name": "Atom_RPI",
+ "display_name": "Atom API",
+ "summary": "",
+ "canonical_tags": [
+ "Gem"
+ ],
+ "user_tags": [
+ ]
+}
diff --git a/Gems/Atom/Tools/AtomToolsFramework/gem.json b/Gems/Atom/Tools/AtomToolsFramework/gem.json
new file mode 100644
index 0000000000..3060d3f51a
--- /dev/null
+++ b/Gems/Atom/Tools/AtomToolsFramework/gem.json
@@ -0,0 +1,10 @@
+{
+ "gem_name": "AtomToolsFramework",
+ "display_name": "Atom Tools Framework",
+ "summary": "",
+ "canonical_tags": [
+ "Gem"
+ ],
+ "user_tags": [
+ ]
+}
diff --git a/Gems/Atom/gem.json b/Gems/Atom/gem.json
index c74a9013f3..91bc9bcf53 100644
--- a/Gems/Atom/gem.json
+++ b/Gems/Atom/gem.json
@@ -1,3 +1,5 @@
{
- "gem_name": "Atom"
+ "gem_name": "Atom",
+ "display_name": "Atom",
+ "summary": "Next-Gen Rendering Package for the O3DE engine"
}
diff --git a/AutomatedTesting/Gem/Code/Platform/Android/runtime_dependencies.cmake b/Gems/AtomContent/CMakeLists.txt
similarity index 100%
rename from AutomatedTesting/Gem/Code/Platform/Android/runtime_dependencies.cmake
rename to Gems/AtomContent/CMakeLists.txt
diff --git a/Gems/AtomContent/gem.json b/Gems/AtomContent/gem.json
new file mode 100644
index 0000000000..941e7dea20
--- /dev/null
+++ b/Gems/AtomContent/gem.json
@@ -0,0 +1,14 @@
+{
+ "gem_name": "AtomContent",
+ "origin": "The primary repo for Atom goes here: i.e. http://www.mydomain.com",
+ "license": "What license Atom uses goes here: i.e. https://opensource.org/licenses/MIT",
+ "display_name": "Atom Content",
+ "summary": "ontains multiple packages containing source Assets that can be used with Atom",
+ "canonical_tags": [
+ "Gem"
+ ],
+ "user_tags": [
+ "AtomConent"
+ ],
+ "icon_path": "preview.png"
+}
diff --git a/Gems/AtomLyIntegration/AtomBridge/Code/CMakeLists.txt b/Gems/AtomLyIntegration/AtomBridge/Code/CMakeLists.txt
index 0723ca46b7..4df40e3d13 100644
--- a/Gems/AtomLyIntegration/AtomBridge/Code/CMakeLists.txt
+++ b/Gems/AtomLyIntegration/AtomBridge/Code/CMakeLists.txt
@@ -66,6 +66,10 @@ ly_add_target(
Gem::AtomViewportDisplayInfo
)
+# Any 'runtime-like' applications should use Gem::Atom_AtomBridge:
+ly_create_alias(NAME Atom_AtomBridge.Clients NAMESPACE Gem TARGETS Gem::Atom_AtomBridge)
+ly_create_alias(NAME Atom_AtomBridge.Servers NAMESPACE Gem TARGETS Gem::Atom_AtomBridge)
+
if(PAL_TRAIT_BUILD_HOST_TOOLS)
ly_add_target(
NAME Atom_AtomBridge.Editor ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE}
@@ -108,4 +112,9 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS)
Gem::AtomViewportDisplayInfo
Gem::AtomViewportDisplayIcons.Editor
)
+
+
+ # Any 'tool' and 'builder' type applications should use Gem::Atom_AtomBridge.Editor:
+ ly_create_alias(NAME Atom_AtomBridge.Builders NAMESPACE Gem TARGETS Gem::Atom_AtomBridge.Editor)
+ ly_create_alias(NAME Atom_AtomBridge.Tools NAMESPACE Gem TARGETS Gem::Atom_AtomBridge.Editor)
endif()
diff --git a/Gems/AtomLyIntegration/AtomBridge/gem.json b/Gems/AtomLyIntegration/AtomBridge/gem.json
new file mode 100644
index 0000000000..329741bb8e
--- /dev/null
+++ b/Gems/AtomLyIntegration/AtomBridge/gem.json
@@ -0,0 +1,10 @@
+{
+ "gem_name": "Atom_AtomBridge",
+ "display_name": "Atom Bridge",
+ "summary": "",
+ "canonical_tags": [
+ "Gem"
+ ],
+ "user_tags": [
+ ]
+}
diff --git a/Gems/AtomLyIntegration/AtomFont/gem.json b/Gems/AtomLyIntegration/AtomFont/gem.json
new file mode 100644
index 0000000000..a609061ea3
--- /dev/null
+++ b/Gems/AtomLyIntegration/AtomFont/gem.json
@@ -0,0 +1,10 @@
+{
+ "gem_name": "AtomFont",
+ "display_name": "Atom Font",
+ "summary": "",
+ "canonical_tags": [
+ "Gem"
+ ],
+ "user_tags": [
+ ]
+}
diff --git a/Gems/AtomLyIntegration/AtomImGuiTools/gem.json b/Gems/AtomLyIntegration/AtomImGuiTools/gem.json
new file mode 100644
index 0000000000..5cee62f7bb
--- /dev/null
+++ b/Gems/AtomLyIntegration/AtomImGuiTools/gem.json
@@ -0,0 +1,10 @@
+{
+ "gem_name": "AtomImGuiTools",
+ "display_name": "Atom ImGui",
+ "summary": "",
+ "canonical_tags": [
+ "Gem"
+ ],
+ "user_tags": [
+ ]
+}
diff --git a/Gems/AtomLyIntegration/AtomViewportDisplayIcons/gem.json b/Gems/AtomLyIntegration/AtomViewportDisplayIcons/gem.json
new file mode 100644
index 0000000000..41f69e33a0
--- /dev/null
+++ b/Gems/AtomLyIntegration/AtomViewportDisplayIcons/gem.json
@@ -0,0 +1,10 @@
+{
+ "gem_name": "AtomViewportDisplayIcons",
+ "display_name": "Atom Viewport Display Icons",
+ "summary": "",
+ "canonical_tags": [
+ "Gem"
+ ],
+ "user_tags": [
+ ]
+}
diff --git a/Gems/AtomLyIntegration/AtomViewportDisplayInfo/Code/CMakeLists.txt b/Gems/AtomLyIntegration/AtomViewportDisplayInfo/Code/CMakeLists.txt
index de4ee9b4b5..0f134d4218 100644
--- a/Gems/AtomLyIntegration/AtomViewportDisplayInfo/Code/CMakeLists.txt
+++ b/Gems/AtomLyIntegration/AtomViewportDisplayInfo/Code/CMakeLists.txt
@@ -10,7 +10,7 @@
#
ly_add_target(
- NAME AtomViewportDisplayInfo GEM_MODULE
+ NAME AtomViewportDisplayInfo ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE}
NAMESPACE Gem
FILES_CMAKE
atomviewportdisplayinfo_files.cmake
diff --git a/Gems/AtomLyIntegration/AtomViewportDisplayInfo/Code/Source/AtomViewportDisplayInfoSystemComponent.cpp b/Gems/AtomLyIntegration/AtomViewportDisplayInfo/Code/Source/AtomViewportDisplayInfoSystemComponent.cpp
index 7d830b4ca9..146c0c67d0 100644
--- a/Gems/AtomLyIntegration/AtomViewportDisplayInfo/Code/Source/AtomViewportDisplayInfoSystemComponent.cpp
+++ b/Gems/AtomLyIntegration/AtomViewportDisplayInfo/Code/Source/AtomViewportDisplayInfoSystemComponent.cpp
@@ -303,7 +303,10 @@ namespace AZ::Render
lastTime = time;
}
- const double averageFPS = aznumeric_cast(m_fpsHistory.size()) / actualInterval.count();
+ const double averageFPS = (actualInterval.count() != 0.0)
+ ? aznumeric_cast(m_fpsHistory.size()) / actualInterval.count()
+ : 0.0;
+
const double frameIntervalSeconds = m_fpsInterval.count();
DrawLine(
diff --git a/Gems/AtomLyIntegration/AtomViewportDisplayInfo/gem.json b/Gems/AtomLyIntegration/AtomViewportDisplayInfo/gem.json
new file mode 100644
index 0000000000..04e2464a26
--- /dev/null
+++ b/Gems/AtomLyIntegration/AtomViewportDisplayInfo/gem.json
@@ -0,0 +1,10 @@
+{
+ "gem_name": "AtomViewportDisplayInfo",
+ "display_name": "Atom Viewport Display Info",
+ "summary": "",
+ "canonical_tags": [
+ "Gem"
+ ],
+ "user_tags": [
+ ]
+}
diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/ReflectionProbe/EditorReflectionProbeComponent.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/ReflectionProbe/EditorReflectionProbeComponent.cpp
index 735eab5368..7880d5e88c 100644
--- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/ReflectionProbe/EditorReflectionProbeComponent.cpp
+++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/ReflectionProbe/EditorReflectionProbeComponent.cpp
@@ -209,8 +209,8 @@ namespace AZ
AZ::Vector3 position = AZ::Vector3::CreateZero();
AZ::TransformBus::EventResult(position, GetEntityId(), &AZ::TransformBus::Events::GetWorldTranslation);
- AZ::Vector3 scale = AZ::Vector3::CreateOne();
- AZ::TransformBus::EventResult(scale, GetEntityId(), &AZ::TransformBus::Events::GetLocalScale);
+ float scale = 1.0f;
+ AZ::TransformBus::EventResult(scale, GetEntityId(), &AZ::TransformBus::Events::GetLocalUniformScale);
// draw AABB at probe position using the inner dimensions
Color color(0.0f, 0.0f, 1.0f, 1.0f);
diff --git a/Gems/AtomLyIntegration/CommonFeatures/gem.json b/Gems/AtomLyIntegration/CommonFeatures/gem.json
new file mode 100644
index 0000000000..306c61e6d7
--- /dev/null
+++ b/Gems/AtomLyIntegration/CommonFeatures/gem.json
@@ -0,0 +1,10 @@
+{
+ "gem_name": "CommonFeaturesAtom",
+ "display_name": "Common Features Atom",
+ "summary": "",
+ "canonical_tags": [
+ "Gem"
+ ],
+ "user_tags": [
+ ]
+}
diff --git a/Gems/AtomLyIntegration/EMotionFXAtom/Code/CMakeLists.txt b/Gems/AtomLyIntegration/EMotionFXAtom/Code/CMakeLists.txt
index 6492f4f13a..9a9b389227 100644
--- a/Gems/AtomLyIntegration/EMotionFXAtom/Code/CMakeLists.txt
+++ b/Gems/AtomLyIntegration/EMotionFXAtom/Code/CMakeLists.txt
@@ -43,6 +43,8 @@ ly_add_target(
PRIVATE
AZ::AzCore
Gem::EMotionFX_Atom.Static
+ RUNTIME_DEPENDENCIES
+ Gem::EMotionFX
)
if(PAL_TRAIT_BUILD_HOST_TOOLS)
diff --git a/Gems/AtomLyIntegration/EMotionFXAtom/gem.json b/Gems/AtomLyIntegration/EMotionFXAtom/gem.json
new file mode 100644
index 0000000000..e2a81d0a5e
--- /dev/null
+++ b/Gems/AtomLyIntegration/EMotionFXAtom/gem.json
@@ -0,0 +1,10 @@
+{
+ "gem_name": "EMotionFX_Atom",
+ "display_name": "EMotionFX Atom",
+ "summary": "",
+ "canonical_tags": [
+ "Gem"
+ ],
+ "user_tags": [
+ ]
+}
diff --git a/Gems/AtomLyIntegration/ImguiAtom/gem.json b/Gems/AtomLyIntegration/ImguiAtom/gem.json
new file mode 100644
index 0000000000..6d6551b5fa
--- /dev/null
+++ b/Gems/AtomLyIntegration/ImguiAtom/gem.json
@@ -0,0 +1,10 @@
+{
+ "gem_name": "ImguiAtom",
+ "display_name": "Imgui Atom",
+ "summary": "",
+ "canonical_tags": [
+ "Gem"
+ ],
+ "user_tags": [
+ ]
+}
diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/gem.json b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/gem.json
index ca80c62dd0..a867fe0f0f 100644
--- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/gem.json
+++ b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/gem.json
@@ -1,17 +1,14 @@
{
- "gem_name": "Atom_DccScriptingInterface",
- "GemFormatVersion": 4,
- "Uuid": "7bf5a77dacd8438bb4966a66b5a678d8",
- "Name": "Atom_DccScriptingInterface",
- "DisplayName": "Atom DccScriptingInterface (DCCsi)",
- "Version": "0.1.0",
- "Summary": "A python framework for working with various DCC tools and workflows.",
- "Tags": ["DCC","Digital","Content","Creation"],
- "IconPath": "preview.png",
- "Modules": [
- {
- "Name": "Editor",
- "Type": "EditorModule"
- }
+ "gem_name": "DccScriptingInterface",
+ "display_name": "Atom DccScriptingInterface (DCCsi)",
+ "summary": "A python framework for working with various DCC tools and workflows.",
+ "canonical_tags": [
+ "Gem"
+ ],
+ "user_tags": [
+ "DCC",
+ "Digital",
+ "Content",
+ "Creation"
]
}
diff --git a/Gems/AtomLyIntegration/gem.json b/Gems/AtomLyIntegration/gem.json
index 0971ad53c2..4f587a8806 100644
--- a/Gems/AtomLyIntegration/gem.json
+++ b/Gems/AtomLyIntegration/gem.json
@@ -1,3 +1,5 @@
{
- "gem_name": "AtomLyIntegration"
+ "gem_name": "AtomLyIntegration",
+ "display_name": "Atom O3DE Integration",
+ "summary": "Collection of module targets for integrating Atom with the O3DE engine"
}
diff --git a/AutomatedTesting/Gem/Code/Platform/Android/tool_dependencies.cmake b/Gems/AtomTressFX/CMakeLists.txt
similarity index 100%
rename from AutomatedTesting/Gem/Code/Platform/Android/tool_dependencies.cmake
rename to Gems/AtomTressFX/CMakeLists.txt
diff --git a/Gems/AudioEngineWwise/Code/CMakeLists.txt b/Gems/AudioEngineWwise/Code/CMakeLists.txt
index 5ea6a6d461..f90064908a 100644
--- a/Gems/AudioEngineWwise/Code/CMakeLists.txt
+++ b/Gems/AudioEngineWwise/Code/CMakeLists.txt
@@ -93,6 +93,9 @@ ly_add_target(
Gem::AudioEngineWwise.Static
)
+# we'll load the above "Gem::AudioEngineWwise" module in clients.
+ly_create_alias(NAME AudioEngineWwise.Clients NAMESPACE Gem TARGETS Gem::AudioEngineWwise)
+
################################################################################
# Tests
################################################################################
@@ -206,6 +209,8 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS)
AZ::AssetBuilderSDK
Gem::AudioEngineWwise.Static
Gem::AudioSystem.Editor
+ RUNTIME_DEPENDENCIES
+ Gem::AudioSystem.Editor
)
ly_add_target(
@@ -230,6 +235,10 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS)
Gem::AudioSystem.Editor
)
+ # by default, we'll load the above "Gem::AudioEngineWwise.Editor" module in builders and tools.
+ ly_create_alias(NAME AudioEngineWwise.Builders NAMESPACE Gem TARGETS Gem::AudioEngineWwise.Editor)
+ ly_create_alias(NAME AudioEngineWwise.Tools NAMESPACE Gem TARGETS Gem::AudioEngineWwise.Editor)
+
if (PAL_TRAIT_BUILD_TESTS_SUPPORTED)
ly_add_target(
NAME AudioEngineWwise.Editor.Tests ${PAL_TRAIT_TEST_TARGET_TYPE}
diff --git a/Gems/AudioSystem/Code/CMakeLists.txt b/Gems/AudioSystem/Code/CMakeLists.txt
index 8a6f2c417e..3963a71ad0 100644
--- a/Gems/AudioSystem/Code/CMakeLists.txt
+++ b/Gems/AudioSystem/Code/CMakeLists.txt
@@ -61,22 +61,8 @@ ly_add_target(
Gem::AudioSystem.Static
)
-################################################################################
-# Server
-################################################################################
-if (PAL_TRAIT_BUILD_SERVER_SUPPORTED)
- # Stub gem for server. Audio system is client only
- ly_add_target(
- NAME AudioSystem.Server GEM_MODULE
-
- NAMESPACE Gem
- FILES_CMAKE
- audiosystem_stub_files.cmake
- BUILD_DEPENDENCIES
- PRIVATE
- AZ::AzCore
- )
-endif ()
+# AudioSystem should use the above target on clients.
+ly_create_alias(NAME AudioSystem.Clients NAMESPACE Gem TARGETS Gem::AudioSystem)
################################################################################
# Tests
@@ -101,7 +87,8 @@ if (PAL_TRAIT_BUILD_TESTS_SUPPORTED)
AZ::AzFramework
Legacy::CryCommon
Gem::AudioSystem.Static
- Gem::LmbrCentral
+ RUNTIME_DEPENDENCIES
+ Gem::LmbrCentral
)
ly_add_googletest(
NAME Gem::AudioSystem.Tests
@@ -230,6 +217,10 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS)
Gem::AudioSystem.Editor.Static
)
+ # use the above "Editor" target in tools and builders:
+ ly_create_alias(NAME AudioSystem.Tools NAMESPACE Gem TARGETS Gem::AudioSystem.Editor)
+ ly_create_alias(NAME AudioSystem.Builders NAMESPACE Gem TARGETS Gem::AudioSystem.Editor)
+
if (PAL_TRAIT_BUILD_TESTS_SUPPORTED)
ly_add_target(
NAME AudioSystem.Editor.Tests ${PAL_TRAIT_TEST_TARGET_TYPE}
@@ -253,3 +244,6 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS)
)
endif()
endif ()
+
+
+
diff --git a/Gems/AutomatedLauncherTesting/Code/CMakeLists.txt b/Gems/AutomatedLauncherTesting/Code/CMakeLists.txt
index 551f76da02..6215ae7697 100644
--- a/Gems/AutomatedLauncherTesting/Code/CMakeLists.txt
+++ b/Gems/AutomatedLauncherTesting/Code/CMakeLists.txt
@@ -42,3 +42,7 @@ ly_add_target(
RUNTIME_DEPENDENCIES
Gem::LmbrCentral
)
+
+# servers and clients use the above module.
+ly_create_alias(NAME AutomatedLauncherTesting.Servers NAMESPACE Gem TARGETS Gem::AutomatedLauncherTesting)
+ly_create_alias(NAME AutomatedLauncherTesting.Clients NAMESPACE Gem TARGETS Gem::AutomatedLauncherTesting)
diff --git a/Gems/Blast/Code/CMakeLists.txt b/Gems/Blast/Code/CMakeLists.txt
index 6c90357364..143e3af095 100644
--- a/Gems/Blast/Code/CMakeLists.txt
+++ b/Gems/Blast/Code/CMakeLists.txt
@@ -59,6 +59,11 @@ ly_add_target(
Gem::PhysX
)
+# clients and servers use the above Gem module.
+ly_create_alias(NAME Blast.Servers NAMESPACE Gem TARGETS Gem::Blast)
+ly_create_alias(NAME Blast.Clients NAMESPACE Gem TARGETS Gem::Blast)
+
+
if(PAL_TRAIT_BUILD_HOST_TOOLS)
ly_add_target(
@@ -110,6 +115,9 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS)
Gem::PhysX.Editor
)
+ # tools and builders use the above module.
+ ly_create_alias(NAME Blast.Tools NAMESPACE Gem TARGETS Gem::Blast.Editor)
+ ly_create_alias(NAME Blast.Builders NAMESPACE Gem TARGETS Gem::Blast.Editor)
endif()
################################################################################
diff --git a/Gems/Blast/Code/Source/Actor/BlastActorImpl.cpp b/Gems/Blast/Code/Source/Actor/BlastActorImpl.cpp
index 6c4c78c412..8f82f3366f 100644
--- a/Gems/Blast/Code/Source/Actor/BlastActorImpl.cpp
+++ b/Gems/Blast/Code/Source/Actor/BlastActorImpl.cpp
@@ -151,8 +151,6 @@ namespace Blast
colliderConfiguration.m_position = transform.GetTranslation();
colliderConfiguration.m_rotation = transform.GetRotation();
colliderConfiguration.m_isExclusive = true;
- colliderConfiguration.m_materialSelection.SetMaterialLibrary(
- AZ::Interface::Get()->GetDefaultMaterialLibrary()->GetId());
colliderConfiguration.m_materialSelection.SetMaterialId(material);
colliderConfiguration.m_collisionGroupId = actorConfiguration.m_collisionGroupId;
colliderConfiguration.m_collisionLayer = actorConfiguration.m_collisionLayer;
diff --git a/Gems/Blast/Code/Source/Components/BlastFamilyComponent.cpp b/Gems/Blast/Code/Source/Components/BlastFamilyComponent.cpp
index 0f2668442c..1da9663b8f 100644
--- a/Gems/Blast/Code/Source/Components/BlastFamilyComponent.cpp
+++ b/Gems/Blast/Code/Source/Components/BlastFamilyComponent.cpp
@@ -21,6 +21,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -265,16 +266,29 @@ namespace Blast
auto solverPtr = Nv::Blast::ExtStressSolver::create(
const_cast(*m_family->GetTkFamily()->getFamilyLL()), stressSolverSettings);
m_solver = physx::unique_ptr(solverPtr);
- Physics::MaterialFromAssetConfiguration material;
- AZ::Interface::Get()->GetDefaultMaterialLibrary()->GetDataForMaterialId(
- m_physicsMaterialId, material);
- m_solver->setAllNodesInfoFromLL(material.m_configuration.m_density);
+
+ AZStd::shared_ptr physicsMaterial;
+ Physics::PhysicsMaterialRequestBus::BroadcastResult(
+ physicsMaterial,
+ &Physics::PhysicsMaterialRequestBus::Events::GetMaterialById,
+ m_physicsMaterialId);
+ if (!physicsMaterial)
+ {
+ AZ_Warning("BlastFamilyComponent", false, "Material Id %s was not found, using default material instead.",
+ m_physicsMaterialId.GetUuid().ToString().c_str());
+
+ Physics::PhysicsMaterialRequestBus::BroadcastResult(
+ physicsMaterial,
+ &Physics::PhysicsMaterialRequestBus::Events::GetGenericDefaultMaterial);
+ AZ_Assert(physicsMaterial, "BlastFamilyComponent: Invalid default physics material");
+ }
+ m_solver->setAllNodesInfoFromLL(physicsMaterial->GetDensity());
// Create damage and actor render managers
m_damageManager = AZStd::make_unique(blastMaterial, m_family->GetActorTracker());
m_actorRenderManager = AZStd::make_unique(
AZ::RPI::Scene::GetFeatureProcessorForEntity(GetEntityId()),
- m_meshDataComponent, GetEntityId(), m_blastAsset->GetPxAsset()->getChunkCount(), transform.GetScale());
+ m_meshDataComponent, GetEntityId(), m_blastAsset->GetPxAsset()->getChunkCount(), AZ::Vector3(transform.GetUniformScale()));
// Spawn the family
m_family->Spawn(transform);
diff --git a/Gems/Blast/Code/Source/Editor/EditorBlastFamilyComponent.cpp b/Gems/Blast/Code/Source/Editor/EditorBlastFamilyComponent.cpp
index 9241449483..873ef7248d 100644
--- a/Gems/Blast/Code/Source/Editor/EditorBlastFamilyComponent.cpp
+++ b/Gems/Blast/Code/Source/Editor/EditorBlastFamilyComponent.cpp
@@ -131,6 +131,6 @@ namespace Blast
AZ::Data::AssetId EditorBlastFamilyComponent::GetPhysicsMaterialLibraryAssetId() const
{
- return AZ::Interface::Get()->GetDefaultMaterialLibrary()->GetId();
+ return AZ::Interface::Get()->GetConfiguration()->m_materialLibraryAsset.GetId();
}
} // namespace Blast
diff --git a/Gems/Blast/Code/Tests/Mocks/BlastMocks.h b/Gems/Blast/Code/Tests/Mocks/BlastMocks.h
index 00aa12cb84..ca78623a8a 100644
--- a/Gems/Blast/Code/Tests/Mocks/BlastMocks.h
+++ b/Gems/Blast/Code/Tests/Mocks/BlastMocks.h
@@ -654,9 +654,7 @@ namespace Blast
MOCK_METHOD1(RotateAroundLocalZ, void(float));
MOCK_METHOD0(GetLocalRotation, AZ::Vector3());
MOCK_METHOD0(GetLocalRotationQuaternion, AZ::Quaternion());
- MOCK_METHOD1(SetLocalScale, void(const AZ::Vector3&));
MOCK_METHOD0(GetLocalScale, AZ::Vector3());
- MOCK_METHOD0(GetWorldScale, AZ::Vector3());
MOCK_METHOD1(SetLocalUniformScale, void(float));
MOCK_METHOD0(GetLocalUniformScale, float());
MOCK_METHOD0(GetWorldUniformScale, float());
diff --git a/Gems/Camera/Code/CMakeLists.txt b/Gems/Camera/Code/CMakeLists.txt
index 950ff451ff..703424416b 100644
--- a/Gems/Camera/Code/CMakeLists.txt
+++ b/Gems/Camera/Code/CMakeLists.txt
@@ -39,6 +39,10 @@ ly_add_target(
Gem::Camera.Static
)
+# clients and servers use the above module:
+ly_create_alias(NAME Camera.Clients NAMESPACE Gem TARGETS Gem::Camera)
+ly_create_alias(NAME Camera.Servers NAMESPACE Gem TARGETS Gem::Camera)
+
if (PAL_TRAIT_BUILD_HOST_TOOLS)
ly_add_target(
@@ -62,4 +66,7 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS)
Gem::Camera.Static
)
+ # tools and builders use the above module.
+ ly_create_alias(NAME Camera.Tools NAMESPACE Gem TARGETS Gem::Camera.Editor)
+ ly_create_alias(NAME Camera.Builders NAMESPACE Gem TARGETS Gem::Camera.Editor)
endif()
diff --git a/Gems/CameraFramework/Code/CMakeLists.txt b/Gems/CameraFramework/Code/CMakeLists.txt
index 1ec9dc0ad9..6b0d084e28 100644
--- a/Gems/CameraFramework/Code/CMakeLists.txt
+++ b/Gems/CameraFramework/Code/CMakeLists.txt
@@ -38,3 +38,9 @@ ly_add_target(
PRIVATE
Gem::CameraFramework.Static
)
+
+# Every kind of application uses the above target module.
+ly_create_alias(NAME CameraFramework.Clients NAMESPACE Gem TARGETS Gem::CameraFramework)
+ly_create_alias(NAME CameraFramework.Servers NAMESPACE Gem TARGETS Gem::CameraFramework)
+ly_create_alias(NAME CameraFramework.Tools NAMESPACE Gem TARGETS Gem::CameraFramework)
+ly_create_alias(NAME CameraFramework.Builders NAMESPACE Gem TARGETS Gem::CameraFramework)
diff --git a/Gems/CertificateManager/Code/CMakeLists.txt b/Gems/CertificateManager/Code/CMakeLists.txt
index 93e78bb86a..2307ebed40 100644
--- a/Gems/CertificateManager/Code/CMakeLists.txt
+++ b/Gems/CertificateManager/Code/CMakeLists.txt
@@ -41,3 +41,7 @@ ly_add_target(
PRIVATE
Gem::CertificateManager.Static
)
+
+# we'll load the above "Gem::CertificateManager" module in Clients and Servers
+ly_create_alias(NAME CertificateManager.Clients NAMESPACE Gem TARGETS Gem::CertificateManager)
+ly_create_alias(NAME CertificateManager.Servers NAMESPACE Gem TARGETS Gem::CertificateManager)
diff --git a/Gems/CrashReporting/Code/CMakeLists.txt b/Gems/CrashReporting/Code/CMakeLists.txt
index d52600ea9b..2d77d563d9 100644
--- a/Gems/CrashReporting/Code/CMakeLists.txt
+++ b/Gems/CrashReporting/Code/CMakeLists.txt
@@ -33,6 +33,11 @@ ly_add_target(
AZ::CrashHandler
)
+# Load the "Gem::CrashReporting" module in Clients and Servers
+ly_create_alias(NAME CrashReporting.Clients NAMESPACE Gem TARGETS Gem::CrashReporting)
+ly_create_alias(NAME CrashReporting.Servers NAMESPACE Gem TARGETS Gem::CrashReporting)
+
+
ly_add_target(
NAME CrashReporting.Uploader APPLICATION
NAMESPACE AZ
diff --git a/Gems/CustomAssetExample/Code/CMakeLists.txt b/Gems/CustomAssetExample/Code/CMakeLists.txt
index 661b1950ce..3debe27919 100644
--- a/Gems/CustomAssetExample/Code/CMakeLists.txt
+++ b/Gems/CustomAssetExample/Code/CMakeLists.txt
@@ -22,6 +22,10 @@ ly_add_target(
AZ::AzCore
)
+# clients and servers use the above module.
+ly_create_alias(NAME CustomAssetExample.Clients NAMESPACE Gem TARGETS CustomAssetExample)
+ly_create_alias(NAME CustomAssetExample.Servers NAMESPACE Gem TARGETS CustomAssetExample)
+
if(PAL_TRAIT_BUILD_HOST_TOOLS)
ly_add_target(
NAME CustomAssetExample.Editor GEM_MODULE
@@ -37,4 +41,9 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS)
AZ::AzCore
AZ::AssetBuilderSDK
)
+
+ # other tools use the above tools module:
+ ly_create_alias(NAME CustomAssetExample.Builders NAMESPACE Gem TARGETS CustomAssetExample.Editor)
+ ly_create_alias(NAME CustomAssetExample.Tools NAMESPACE Gem TARGETS CustomAssetExample.Editor)
+
endif()
diff --git a/Gems/DebugDraw/Code/CMakeLists.txt b/Gems/DebugDraw/Code/CMakeLists.txt
index 0954d6366c..69488b1493 100644
--- a/Gems/DebugDraw/Code/CMakeLists.txt
+++ b/Gems/DebugDraw/Code/CMakeLists.txt
@@ -42,6 +42,9 @@ ly_add_target(
Gem::DebugDraw.Static
)
+# servers do not need debug draw components, only clients
+ly_create_alias(NAME DebugDraw.Clients NAMESPACE Gem TARGETS DebugDraw)
+
if(PAL_TRAIT_BUILD_HOST_TOOLS)
ly_add_target(
NAME DebugDraw.Editor GEM_MODULE
@@ -62,4 +65,9 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS)
Gem::DebugDraw.Static
AZ::AzToolsFramework
)
+
+ # builders and tools use DebugDraw.Editor
+ ly_create_alias(NAME DebugDraw.Builders NAMESPACE Gem TARGETS DebugDraw.Editor)
+ ly_create_alias(NAME DebugDraw.Tools NAMESPACE Gem TARGETS DebugDraw.Editor)
+
endif()
diff --git a/AutomatedTesting/Gem/Code/Platform/Linux/runtime_dependencies.cmake b/Gems/DevTextures/CMakeLists.txt
similarity index 100%
rename from AutomatedTesting/Gem/Code/Platform/Linux/runtime_dependencies.cmake
rename to Gems/DevTextures/CMakeLists.txt
diff --git a/Gems/EMotionFX/Code/CMakeLists.txt b/Gems/EMotionFX/Code/CMakeLists.txt
index b90902a948..bc0268cd60 100644
--- a/Gems/EMotionFX/Code/CMakeLists.txt
+++ b/Gems/EMotionFX/Code/CMakeLists.txt
@@ -36,10 +36,10 @@ ly_add_target(
AZ::AzCore
AZ::AzFramework
Legacy::CryCommon
- Gem::LmbrCentral
PUBLIC
AZ::AtomCore
Gem::Atom_RPI.Public
+ Gem::LmbrCentral
COMPILE_DEFINITIONS
PUBLIC
EMFX_DEVELOPMENT_BUILD
@@ -67,6 +67,10 @@ ly_add_target(
Gem::LmbrCentral
)
+# Clients and servers use the above EMotionFX module
+ly_create_alias(NAME EMotionFX.Clients NAMESPACE Gem TARGETS EMotionFX)
+ly_create_alias(NAME EMotionFX.Servers NAMESPACE Gem TARGETS EMotionFX)
+
if (PAL_TRAIT_BUILD_HOST_TOOLS)
ly_add_target(
@@ -129,6 +133,11 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS)
RUNTIME_DEPENDENCIES
Gem::LmbrCentral.Editor
)
+
+ # builders and tools use the above EMotionFX.Editor module
+ ly_create_alias(NAME EMotionFX.Builders NAMESPACE Gem TARGETS EMotionFX.Editor)
+ ly_create_alias(NAME EMotionFX.Tools NAMESPACE Gem TARGETS EMotionFX.Editor)
+
endif()
################################################################################
diff --git a/Gems/EMotionFX/Code/Tests/Mocks/PhysicsSystem.h b/Gems/EMotionFX/Code/Tests/Mocks/PhysicsSystem.h
index 22102fd38a..3aafdb4e2b 100644
--- a/Gems/EMotionFX/Code/Tests/Mocks/PhysicsSystem.h
+++ b/Gems/EMotionFX/Code/Tests/Mocks/PhysicsSystem.h
@@ -35,9 +35,6 @@ namespace Physics
MOCK_METHOD2(CreateShape, AZStd::shared_ptr(const Physics::ColliderConfiguration& colliderConfiguration, const Physics::ShapeConfiguration& configuration));
MOCK_METHOD1(ReleaseNativeMeshObject, void(void* nativeMeshObject));
MOCK_METHOD1(CreateMaterial, AZStd::shared_ptr(const Physics::MaterialConfiguration& materialConfiguration));
- MOCK_METHOD0(GetDefaultMaterial, AZStd::shared_ptr());
- MOCK_METHOD1(CreateMaterialsFromLibrary, AZStd::vector