Merge branch 'main' into pruiksma/halton_update

This commit is contained in:
pruiksma
2021-05-26 13:05:50 -05:00
120 changed files with 1024 additions and 934 deletions
@@ -13,22 +13,21 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_
## DynVeg ##
# Temporarily moving all tests to periodic suite - SPEC-6553
#ly_add_pytest(
# NAME AutomatedTesting::DynamicVegetationTests_Main
# TEST_SERIAL
# TEST_SUITE main
# PATH ${CMAKE_CURRENT_LIST_DIR}/dyn_veg
# PYTEST_MARKS "not SUITE_sandbox and not SUITE_periodic and not SUITE_benchmark"
# TIMEOUT 1500
# RUNTIME_DEPENDENCIES
# AZ::AssetProcessor
# Legacy::Editor
# AutomatedTesting.GameLauncher
# AutomatedTesting.Assets
# COMPONENT
# LargeWorlds
#)
ly_add_pytest(
NAME AutomatedTesting::DynamicVegetationTests_Main
TEST_SERIAL
TEST_SUITE main
PATH ${CMAKE_CURRENT_LIST_DIR}/dyn_veg
PYTEST_MARKS "not SUITE_sandbox and not SUITE_periodic and not SUITE_benchmark"
TIMEOUT 1500
RUNTIME_DEPENDENCIES
AZ::AssetProcessor
Legacy::Editor
AutomatedTesting.GameLauncher
AutomatedTesting.Assets
COMPONENT
LargeWorlds
)
ly_add_pytest(
@@ -137,21 +136,21 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_
LargeWorlds
)
## LandscapeCanvas ##
# Temporarily moving all tests to periodic suite - SPEC-6553
#ly_add_pytest(
# NAME AutomatedTesting::LandscapeCanvasTests_Main
# TEST_SERIAL
# TEST_SUITE main
# PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/landscape_canvas
# PYTEST_MARKS "not SUITE_sandbox and not SUITE_periodic and not SUITE_benchmark"
# TIMEOUT 1500
# RUNTIME_DEPENDENCIES
# AZ::AssetProcessor
# Legacy::Editor
# AutomatedTesting.Assets
# COMPONENT
# LargeWorlds
#)
ly_add_pytest(
NAME AutomatedTesting::LandscapeCanvasTests_Main
TEST_SERIAL
TEST_SUITE main
PATH ${CMAKE_CURRENT_LIST_DIR}/landscape_canvas
PYTEST_MARKS "not SUITE_sandbox and not SUITE_periodic and not SUITE_benchmark"
TIMEOUT 1500
RUNTIME_DEPENDENCIES
AZ::AssetProcessor
Legacy::Editor
AutomatedTesting.Assets
COMPONENT
LargeWorlds
)
ly_add_pytest(
NAME AutomatedTesting::LandscapeCanvasTests_Periodic
@@ -41,7 +41,7 @@ class TestDynamicSliceInstanceSpawner(object):
return console
@pytest.mark.test_case_id("C28851763")
@pytest.mark.SUITE_periodic
@pytest.mark.SUITE_main
@pytest.mark.dynveg_area
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
def test_DynamicSliceInstanceSpawner_DynamicSliceSpawnerWorks(self, request, editor, level, workspace, project,
@@ -37,7 +37,7 @@ class TestEmptyInstanceSpawner(object):
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
@pytest.mark.test_case_id("C28851762")
@pytest.mark.SUITE_periodic
@pytest.mark.SUITE_main
@pytest.mark.dynveg_area
def test_EmptyInstanceSpawner_EmptySpawnerWorks(self, request, editor, level, launcher_platform):
cfg_args = [level]
@@ -118,7 +118,7 @@ class TestGraphComponentSync(object):
@pytest.mark.test_case_id('C15987206')
@pytest.mark.SUITE_main
def test_LandscapeCanvas_GradientMixerNodeConstruction(self, request, editor, level, launcher_platform):
def test_LandscapeCanvas_GradientMixer_NodeConstruction(self, request, editor, level, launcher_platform):
"""
Verifies a Gradient Mixer can be setup in Landscape Canvas and all references are property set.
"""
@@ -141,7 +141,7 @@ class TestGraphComponentSync(object):
@pytest.mark.test_case_id('C21333743')
@pytest.mark.SUITE_periodic
def test_LandscapeCanvas_LayerBlenderNodeConstruction(self, request, editor, level, launcher_platform):
def test_LandscapeCanvas_LayerBlender_NodeConstruction(self, request, editor, level, launcher_platform):
"""
Verifies a Layer Blender can be setup in Landscape Canvas and all references are property set.
"""
+4
View File
@@ -128,6 +128,10 @@ foreach(external_directory ${LY_EXTERNAL_SUBDIRS})
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
# 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
@@ -244,7 +244,7 @@ public class LumberyardActivity extends NativeActivity
boolean useMainObb = GetBooleanResource("use_main_obb");
boolean usePatchObb = GetBooleanResource("use_patch_obb");
if (IsBootstrapInAPK() && (useMainObb || usePatchObb))
if (AreAssetsInAPK() && (useMainObb || usePatchObb))
{
Log.d(TAG, "Using OBB expansion files for game assets");
@@ -421,12 +421,12 @@ public class LumberyardActivity extends NativeActivity
}
////////////////////////////////////////////////////////////////
private boolean IsBootstrapInAPK()
private boolean AreAssetsInAPK()
{
try
{
InputStream bootstrap = getAssets().open("bootstrap.cfg", AssetManager.ACCESS_UNKNOWN);
bootstrap.close();
InputStream engine = getAssets().open("engine.json", AssetManager.ACCESS_UNKNOWN);
engine.close();
return true;
}
catch (IOException exception)
@@ -148,7 +148,7 @@ namespace AZ
}
}
AZ_Assert(false, "Failed to locate the bootstrap.cfg path");
AZ_Assert(false, "Failed to locate the engine.json path");
return nullptr;
}
+2 -2
View File
@@ -73,8 +73,8 @@ namespace AZ
//! \return The pointer position of the relative asset path
AZ::IO::FixedMaxPath StripApkPrefix(const char* filePath);
//! Searches application storage and the APK for bootstrap.cfg. Will return nullptr
//! if bootstrap.cfg is not found.
//! Searches application storage and the APK for engine.json. Will return nullptr
//! if engine.json is not found.
const char* FindAssetsDirectory();
//! Calls into Java to show the splash screen on the main UI (Java) thread
@@ -462,8 +462,6 @@ namespace AZ
// for the application root.
CalculateAppRoot();
// Merge the bootstrap.cfg file into the Settings Registry as soon as the OSAllocator has been created.
SettingsRegistryMergeUtils::MergeSettingsToRegistry_Bootstrap(*m_settingsRegistry);
SettingsRegistryMergeUtils::MergeSettingsToRegistry_O3deUserRegistry(*m_settingsRegistry, AZ_TRAIT_OS_PLATFORM_CODENAME, {});
SettingsRegistryMergeUtils::MergeSettingsToRegistry_CommandLine(*m_settingsRegistry, m_commandLine, executeRegDumpCommands);
SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*m_settingsRegistry);
@@ -494,13 +494,6 @@ namespace AZ::SettingsRegistryMergeUtils
return configFileParsed;
}
void MergeSettingsToRegistry_Bootstrap(SettingsRegistryInterface& registry)
{
ConfigParserSettings parserSettings;
parserSettings.m_registryRootPointerPath = BootstrapSettingsRootKey;
MergeSettingsToRegistry_ConfigFile(registry, "bootstrap.cfg", parserSettings);
}
void MergeSettingsToRegistry_AddRuntimeFilePaths(SettingsRegistryInterface& registry)
{
using FixedValueString = AZ::SettingsRegistryInterface::FixedValueString;
@@ -172,9 +172,6 @@ namespace AZ::SettingsRegistryMergeUtils
bool MergeSettingsToRegistry_ConfigFile(SettingsRegistryInterface& registry, AZStd::string_view filePath,
const ConfigParserSettings& configParserSettings);
//! Loads bootstrap.cfg into the Settings Registry. This file does not support specializations.
void MergeSettingsToRegistry_Bootstrap(SettingsRegistryInterface& registry);
//! Extracts file path information from the environment and bootstrap to calculate the various file paths and adds those
//! to the Settings Registry under the FilePathsRootKey.
void MergeSettingsToRegistry_AddRuntimeFilePaths(SettingsRegistryInterface& registry);
@@ -112,7 +112,7 @@ namespace JsonSerializationTests
AZ::Transform testTransform = AZ::Transform::CreateIdentity();
AZ::Transform expectedTransform =
AZ::Transform::CreateFromQuaternion(AZ::Quaternion(0.25f, 0.5f, 0.75f, 1.0f));
expectedTransform.SetScale(AZ::Vector3(5.5f));
expectedTransform.SetUniformScale(5.5f);
rapidjson::Document json;
json.Parse(R"({ "Rotation": [ 0.25, 0.5, 0.75, 1.0 ], "Scale": 5.5 })");
@@ -128,7 +128,7 @@ namespace JsonSerializationTests
{
AZ::Transform testTransform = AZ::Transform::CreateIdentity();
AZ::Transform expectedTransform = AZ::Transform::CreateTranslation(AZ::Vector3(2.25f, 3.5f, 4.75f));
expectedTransform.SetScale(AZ::Vector3(5.5f));
expectedTransform.SetUniformScale(5.5f);
rapidjson::Document json;
json.Parse(R"({ "Translation": [ 2.25, 3.5, 4.75 ], "Scale": 5.5 })");
@@ -679,8 +679,6 @@ namespace AzFramework
{
auto fileIoBase = m_archiveFileIO.get();
// Set up the default file aliases based on the settings registry
fileIoBase->SetAlias("@assets@", "");
fileIoBase->SetAlias("@root@", GetEngineRoot());
fileIoBase->SetAlias("@engroot@", GetEngineRoot());
fileIoBase->SetAlias("@projectroot@", GetEngineRoot());
fileIoBase->SetAlias("@exefolder@", GetExecutableFolder());
@@ -694,8 +692,8 @@ namespace AzFramework
pathAliases.clear();
if (m_settingsRegistry->Get(pathAliases.Native(), AZ::SettingsRegistryMergeUtils::FilePathKey_CacheRootFolder))
{
fileIoBase->SetAlias("@projectplatformcache@", pathAliases.c_str());
fileIoBase->SetAlias("@assets@", pathAliases.c_str());
fileIoBase->SetAlias("@projectplatformcache@", pathAliases.c_str());
fileIoBase->SetAlias("@root@", pathAliases.c_str()); // Deprecated Use @projectplatformcache@
}
pathAliases.clear();
@@ -46,7 +46,6 @@ namespace AzFramework::ProjectManager
// Store the Command line to the Setting Registry
AZ::SettingsRegistryImpl settingsRegistry;
AZ::SettingsRegistryMergeUtils::StoreCommandLineToRegistry(settingsRegistry, commandLine);
AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_Bootstrap(settingsRegistry);
AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_O3deUserRegistry(settingsRegistry, AZ_TRAIT_OS_PLATFORM_CODENAME, {});
// Retrieve Command Line from Settings Registry, it may have been updated by the call to FindEngineRoot()
// in MergeSettingstoRegistry_ConfigFile
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Icon / Local</title>
<g id="Icon-/-Local" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<rect id="Rectangle" x="0" y="0" width="24" height="24"></rect>
<polygon id="L" fill="#FFFFFF" fill-rule="nonzero" points="16.9658203 19 16.9658203 16.5 11.1748047 16.5 11.1748047 4.72265625 8.14746094 4.72265625 8.14746094 19"></polygon>
</g>
</svg>

After

Width:  |  Height:  |  Size: 575 B

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Icon / Parent</title>
<g id="Icon-/-Parent" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<rect id="Rectangle" x="0" y="0" width="24" height="24"></rect>
<path d="M10.5449219,19 L10.5449219,13.921875 L11.84375,13.921875 C13.6145833,13.921875 14.9801432,13.514974 15.9404297,12.7011719 C16.9007161,11.8873698 17.3808594,10.7122396 17.3808594,9.17578125 C17.3808594,7.69791667 16.930013,6.58626302 16.0283203,5.84082031 C15.1266276,5.0953776 13.8098958,4.72265625 12.078125,4.72265625 L12.078125,4.72265625 L7.51757812,4.72265625 L7.51757812,19 L10.5449219,19 Z M11.5410156,11.4414062 L10.5449219,11.4414062 L10.5449219,7.203125 L11.921875,7.203125 C12.7486979,7.203125 13.3557943,7.37239583 13.7431641,7.7109375 C14.1305339,8.04947917 14.3242188,8.57356771 14.3242188,9.28320312 C14.3242188,9.98632812 14.093099,10.5218099 13.6308594,10.8896484 C13.1686198,11.257487 12.4720052,11.4414062 11.5410156,11.4414062 L11.5410156,11.4414062 Z" id="P" fill="#FFFFFF" fill-rule="nonzero"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Icon / World</title>
<g id="Icon-/-World" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<rect id="Rectangle" x="0" y="0" width="24" height="24"></rect>
<path d="M9.41210938,19 L11.3359375,11.5195312 C11.4205729,11.1875 11.5410156,10.632487 11.6972656,9.85449219 C11.8535156,9.0764974 11.9511719,8.51171875 11.9902344,8.16015625 C12.016276,8.44661458 12.1155599,9.00813802 12.2880859,9.84472656 C12.460612,10.6813151 12.5826823,11.2330729 12.6542969,11.5 L12.6542969,11.5 L14.5878906,19 L18.0351562,19 L21.6679688,4.72265625 L18.6894531,4.72265625 L16.8730469,12.515625 C16.7558594,12.984375 16.625651,13.5979818 16.4824219,14.3564453 C16.3391927,15.1149089 16.235026,15.7480469 16.1699219,16.2558594 C16.0983073,15.7285156 15.9941406,15.0970052 15.8574219,14.3613281 C15.7207031,13.625651 15.6067708,13.078776 15.515625,12.7207031 L15.515625,12.7207031 L13.4355469,4.72265625 L10.5742188,4.72265625 L8.49414062,12.7207031 C8.37044271,13.1503906 8.23860677,13.7542318 8.09863281,14.5322266 C7.95865885,15.3102214 7.86914062,15.8847656 7.83007812,16.2558594 C7.68684896,15.2011719 7.45572917,13.9544271 7.13671875,12.515625 L7.13671875,12.515625 L5.31054688,4.72265625 L2.33203125,4.72265625 L5.97460938,19 L9.41210938,19 Z" id="W" fill="#FFFFFF" fill-rule="nonzero"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

@@ -354,6 +354,7 @@
<file>img/UI20/toolbar/Grid.svg</file>
<file>img/UI20/toolbar/Lighting.svg</file>
<file>img/UI20/toolbar/Load.svg</file>
<file>img/UI20/toolbar/Local.svg</file>
<file>img/UI20/toolbar/Locked.svg</file>
<file>img/UI20/toolbar/LUA.svg</file>
<file>img/UI20/toolbar/Material.svg</file>
@@ -362,6 +363,7 @@
<file>img/UI20/toolbar/Object_follow_terrain.svg</file>
<file>img/UI20/toolbar/Object_height.svg</file>
<file>img/UI20/toolbar/Object_list.svg</file>
<file>img/UI20/toolbar/Parent.svg</file>
<file>img/UI20/toolbar/particle.svg</file>
<file>img/UI20/toolbar/Play.svg</file>
<file>img/UI20/toolbar/Redo.svg</file>
@@ -380,6 +382,7 @@
<file>img/UI20/toolbar/undo.svg</file>
<file>img/UI20/toolbar/Unlocked.svg</file>
<file>img/UI20/toolbar/Vertex_snapping.svg</file>
<file>img/UI20/toolbar/World.svg</file>
<file>img/UI20/toolbar/X_axis.svg</file>
<file>img/UI20/toolbar/Y_axis.svg</file>
<file>img/UI20/toolbar/Z_axis.svg</file>
@@ -23,7 +23,7 @@ namespace AzToolsFramework
inline AZ::Transform TransformNormalizedScale(const AZ::Transform& transform)
{
AZ::Transform transformNormalizedScale = transform;
transformNormalizedScale.SetScale(AZ::Vector3::CreateOne());
transformNormalizedScale.SetUniformScale(1.0f);
return transformNormalizedScale;
}
@@ -41,7 +41,7 @@ namespace AzToolsFramework
[[maybe_unused]] bool result =
settingsRegistry->Get(m_projectPathWithOsSeparator.Native(), AZ::SettingsRegistryMergeUtils::FilePathKey_ProjectPath);
AZ_Assert(result, "Couldn't retrieve project root path");
AZ_Warning("Prefab", result, "Couldn't retrieve project root path");
m_projectPathWithSlashSeparator = AZ::IO::Path(m_projectPathWithOsSeparator.Native(), '/').MakePreferred();
AZ::Interface<PrefabLoaderInterface>::Register(this);
@@ -435,7 +435,7 @@ namespace AzToolsFramework
}
}
static void DestroyTransformModeSelectionCluster(const ViewportUi::ClusterId clusterId)
static void DestroyCluster(const ViewportUi::ClusterId clusterId)
{
ViewportUi::ViewportUiRequestBus::Event(
ViewportUi::DefaultViewportId,
@@ -483,6 +483,26 @@ namespace AzToolsFramework
return worldFromLocal.TransformPoint(CalculateCenterOffset(entityId, pivot));
}
void EditorTransformComponentSelection::UpdateSpaceCluster(const ReferenceFrame referenceFrame)
{
auto buttonIdFromFrameFn = [this](const ReferenceFrame referenceFrame) {
switch (referenceFrame)
{
case ReferenceFrame::Local:
return m_spaceCluster.m_localButtonId;
case ReferenceFrame::Parent:
return m_spaceCluster.m_parentButtonId;
case ReferenceFrame::World:
return m_spaceCluster.m_worldButtonId;
}
return m_spaceCluster.m_parentButtonId;
};
ViewportUi::ViewportUiRequestBus::Event(
ViewportUi::DefaultViewportId, &ViewportUi::ViewportUiRequestBus::Events::SetClusterActiveButton, m_spaceCluster.m_spaceClusterId,
buttonIdFromFrameFn(referenceFrame));
}
namespace ETCS
{
PivotOrientationResult CalculatePivotOrientation(
@@ -789,13 +809,13 @@ namespace AzToolsFramework
EntityIdManipulators& entityIdManipulators,
OptionalFrame& pivotOverrideFrame,
ViewportInteraction::KeyboardModifiers& prevModifiers,
bool& transformChangedInternally)
bool& transformChangedInternally, SpaceCluster spaceCluster)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
entityIdManipulators.m_manipulators->SetLocalPosition(action.LocalPosition());
const ReferenceFrame referenceFrame = ReferenceFrameFromModifiers(action.m_modifiers);
const ReferenceFrame referenceFrame = spaceCluster.m_spaceLock ? spaceCluster.m_currentSpace : ReferenceFrameFromModifiers(action.m_modifiers);
if (action.m_modifiers.Ctrl())
{
@@ -1027,6 +1047,7 @@ namespace AzToolsFramework
EditorManipulatorCommandUndoRedoRequestBus::Handler::BusConnect(entityContextId);
CreateTransformModeSelectionCluster();
CreateSpaceSelectionCluster();
RegisterActions();
SetupBoxSelect();
RefreshSelectedEntityIdsAndRegenerateManipulators();
@@ -1037,7 +1058,9 @@ namespace AzToolsFramework
m_selectedEntityIds.clear();
DestroyManipulators(m_entityIdManipulators);
DestroyTransformModeSelectionCluster(m_transformModeClusterId);
DestroyCluster(m_transformModeClusterId);
DestroyCluster(m_spaceCluster.m_spaceClusterId);
UnregisterActions();
m_pivotOverrideFrame.Reset();
@@ -1274,8 +1297,8 @@ namespace AzToolsFramework
[this, prevModifiers, manipulatorEntityIds](const LinearManipulator::Action& action) mutable -> void
{
UpdateTranslationManipulator(
action, manipulatorEntityIds->m_entityIds, m_entityIdManipulators,
m_pivotOverrideFrame, prevModifiers, m_transformChangedInternally);
action, manipulatorEntityIds->m_entityIds, m_entityIdManipulators, m_pivotOverrideFrame, prevModifiers,
m_transformChangedInternally, m_spaceCluster);
});
translationManipulators->InstallLinearManipulatorMouseUpCallback(
@@ -1305,8 +1328,8 @@ namespace AzToolsFramework
[this, prevModifiers, manipulatorEntityIds](const PlanarManipulator::Action& action) mutable -> void
{
UpdateTranslationManipulator(
action, manipulatorEntityIds->m_entityIds, m_entityIdManipulators,
m_pivotOverrideFrame, prevModifiers, m_transformChangedInternally);
action, manipulatorEntityIds->m_entityIds, m_entityIdManipulators, m_pivotOverrideFrame, prevModifiers,
m_transformChangedInternally, m_spaceCluster);
});
translationManipulators->InstallPlanarManipulatorMouseUpCallback(
@@ -1335,8 +1358,8 @@ namespace AzToolsFramework
[this, prevModifiers, manipulatorEntityIds](const SurfaceManipulator::Action& action) mutable -> void
{
UpdateTranslationManipulator(
action, manipulatorEntityIds->m_entityIds, m_entityIdManipulators,
m_pivotOverrideFrame, prevModifiers, m_transformChangedInternally);
action, manipulatorEntityIds->m_entityIds, m_entityIdManipulators, m_pivotOverrideFrame, prevModifiers,
m_transformChangedInternally, m_spaceCluster);
});
translationManipulators->InstallSurfaceManipulatorMouseUpCallback(
@@ -1414,7 +1437,7 @@ namespace AzToolsFramework
[this, prevModifiers, sharedRotationState]
(const AngularManipulator::Action& action) mutable -> void
{
const ReferenceFrame referenceFrame = ReferenceFrameFromModifiers(action.m_modifiers);
const ReferenceFrame referenceFrame = m_spaceCluster.m_spaceLock ? m_spaceCluster.m_currentSpace : ReferenceFrameFromModifiers(action.m_modifiers);
const AZ::Quaternion manipulatorOrientation = action.m_start.m_rotation * action.m_current.m_delta;
// store the pivot override frame when positioning the manipulator manually (ctrl)
@@ -2566,6 +2589,67 @@ namespace AzToolsFramework
m_transformModeSelectionHandler);
}
void EditorTransformComponentSelection::CreateSpaceSelectionCluster()
{
// create the cluster for switching spaces/reference frames
ViewportUi::ViewportUiRequestBus::EventResult(
m_spaceCluster.m_spaceClusterId, ViewportUi::DefaultViewportId, &ViewportUi::ViewportUiRequestBus::Events::CreateCluster,
ViewportUi::Alignment::TopRight);
// create and register the buttons (strings correspond to icons even if the values appear different)
m_spaceCluster.m_worldButtonId = RegisterClusterButton(m_spaceCluster.m_spaceClusterId, "World");
m_spaceCluster.m_parentButtonId = RegisterClusterButton(m_spaceCluster.m_spaceClusterId, "Parent");
m_spaceCluster.m_localButtonId = RegisterClusterButton(m_spaceCluster.m_spaceClusterId, "Local");
auto onButtonClicked = [this](ViewportUi::ButtonId buttonId) {
if (buttonId == m_spaceCluster.m_localButtonId)
{
// Unlock
if (m_spaceCluster.m_spaceLock && m_spaceCluster.m_currentSpace == ReferenceFrame::Local)
{
m_spaceCluster.m_spaceLock = false;
}
else
{
m_spaceCluster.m_spaceLock = true;
m_spaceCluster.m_currentSpace = ReferenceFrame::Local;
}
}
else if (buttonId == m_spaceCluster.m_parentButtonId)
{
// Unlock
if (m_spaceCluster.m_spaceLock && m_spaceCluster.m_currentSpace == ReferenceFrame::Parent)
{
m_spaceCluster.m_spaceLock = false;
}
else
{
m_spaceCluster.m_spaceLock = true;
m_spaceCluster.m_currentSpace = ReferenceFrame::Parent;
}
}
else if (buttonId == m_spaceCluster.m_worldButtonId)
{
// Unlock
if (m_spaceCluster.m_spaceLock && m_spaceCluster.m_currentSpace == ReferenceFrame::World)
{
m_spaceCluster.m_spaceLock = false;
}
else
{
m_spaceCluster.m_spaceLock = true;
m_spaceCluster.m_currentSpace = ReferenceFrame::World;
}
}
};
m_spaceCluster.m_spaceSelectionHandler = AZ::Event<ViewportUi::ButtonId>::Handler(onButtonClicked);
ViewportUi::ViewportUiRequestBus::Event(
ViewportUi::DefaultViewportId, &ViewportUi::ViewportUiRequestBus::Events::RegisterClusterEventHandler,
m_spaceCluster.m_spaceClusterId, m_spaceCluster.m_spaceSelectionHandler);
}
EditorTransformComponentSelectionRequests::Mode EditorTransformComponentSelection::GetTransformMode()
{
return m_mode;
@@ -2963,7 +3047,7 @@ namespace AzToolsFramework
if (transformIt != transformsBefore.end())
{
AZ::Transform transformBefore = transformIt->second;
transformBefore.ExtractScale();
transformBefore.ExtractUniformScale();
AZ::Transform newWorldFromLocal = transformBefore * scaleTransform;
SetEntityWorldTransform(entityId, newWorldFromLocal);
@@ -3277,7 +3361,10 @@ namespace AzToolsFramework
ViewportInteraction::BuildMouseButtons(
QGuiApplication::mouseButtons()), m_boxSelect.Active());
const ReferenceFrame referenceFrame = ReferenceFrameFromModifiers(modifiers);
const ReferenceFrame referenceFrame =
m_spaceCluster.m_spaceLock ? m_spaceCluster.m_currentSpace : ReferenceFrameFromModifiers(modifiers);
UpdateSpaceCluster(referenceFrame);
bool refresh = false;
if (referenceFrame != m_referenceFrame)
@@ -106,6 +106,17 @@ namespace AzToolsFramework
World, //!< World space (space aligned to world axes - identity).
};
struct SpaceCluster
{
ViewportUi::ClusterId m_spaceClusterId;
ViewportUi::ButtonId m_localButtonId;
ViewportUi::ButtonId m_parentButtonId;
ViewportUi::ButtonId m_worldButtonId;
AZ::Event<ViewportUi::ButtonId>::Handler m_spaceSelectionHandler;
ReferenceFrame m_currentSpace = ReferenceFrame::Parent;
bool m_spaceLock = false;
};
//! Entity selection/interaction handling.
//! Provide a suite of functionality for manipulating entities, primarily through their TransformComponent.
class EditorTransformComponentSelection
@@ -160,6 +171,7 @@ namespace AzToolsFramework
void RegenerateManipulators();
void CreateTransformModeSelectionCluster();
void CreateSpaceSelectionCluster();
void ClearManipulatorTranslationOverride();
void ClearManipulatorOrientationOverride();
@@ -285,6 +297,9 @@ namespace AzToolsFramework
AZ::Event<ViewportUi::ButtonId>::Handler m_transformModeSelectionHandler; //!< Event handler for the Viewport UI cluster.
AzFramework::ClickDetector m_clickDetector; //!< Detect different types of mouse click.
AzFramework::CursorState m_cursorState; //!< Track the mouse position and delta movement each frame.
SpaceCluster m_spaceCluster;
void UpdateSpaceCluster(ReferenceFrame referenceFrame);
};
//! The ETCS (EntityTransformComponentSelection) namespace contains functions and data used exclusively by
@@ -15,6 +15,7 @@
#include <AzToolsFramework/Asset/AssetSeedManager.h>
#include <AzFramework/Asset/AssetRegistry.h>
#include <AzCore/IO/FileIO.h>
#include <AzCore/Settings/SettingsRegistryMergeUtils.h>
#include <AzFramework/IO/LocalFileIO.h>
#include <AzFramework/Asset/AssetCatalog.h>
#include <AzFramework/StringFunc/StringFunc.h>
@@ -62,6 +63,12 @@ namespace UnitTest
m_assetSeedManager = new AzToolsFramework::AssetSeedManager();
m_assetRegistry = new AzFramework::AssetRegistry();
AZ::SettingsRegistryInterface* registry = AZ::SettingsRegistry::Get();
auto projectPathKey =
AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_path";
registry->Set(projectPathKey, "AutomatedTesting");
AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*registry);
m_application->Start(AzFramework::Application::Descriptor());
for (int idx = 0; idx < s_totalAssets; idx++)
@@ -10,6 +10,8 @@
*
*/
#include <AzCore/Settings/SettingsRegistryImpl.h>
#include <AzCore/Settings/SettingsRegistryMergeUtils.h>
#include <AzCore/UnitTest/TestTypes.h>
#include <AzToolsFramework/AssetCatalog/PlatformAddressedAssetCatalogManager.h>
#include <AzFramework/Asset/AssetRegistry.h>
@@ -49,6 +51,14 @@ namespace UnitTest
using namespace AZ::Data;
m_application = new ToolsTestApplication("AddressedAssetCatalogManager"); // Shorter name because Setting Registry
// specialization are 32 characters max.
AZ::SettingsRegistryInterface* registry = AZ::SettingsRegistry::Get();
auto projectPathKey =
AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_path";
registry->Set(projectPathKey, "AutomatedTesting");
AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*registry);
m_application->Start(AzFramework::Application::Descriptor());
// Without this, the user settings component would attempt to save on finalize/shutdown. Since the file is
// shared across the whole engine, if multiple tests are run in parallel, the saving could cause a crash
@@ -488,18 +488,17 @@ void TransformCompressor::Marshal(WriteBuffer& wb, const AZ::Transform& value) c
{
AZ::u8 flags = 0;
auto flagsMarker = wb.InsertMarker(flags);
AZ::Matrix3x3 m33 = AZ::Matrix3x3::CreateFromTransform(value);
AZ::Vector3 scale = m33.ExtractScale();
AZ::Quaternion rot = AZ::Quaternion::CreateFromMatrix3x3(m33.GetOrthogonalized());
float scale = value.GetUniformScale();
AZ::Quaternion rot = value.GetRotation();
if (!rot.IsIdentity())
{
flags |= HAS_ROT;
wb.Write(rot, QuatCompMarshaler());
}
if (!scale.IsClose(AZ::Vector3::CreateOne()))
if (!AZ::IsClose(scale, 1.0f, AZ::Constants::Tolerance))
{
flags |= HAS_SCALE;
wb.Write(scale, Vec3CompMarshaler());
wb.Write(scale, HalfMarshaler());
}
AZ::Vector3 pos = value.GetTranslation();
if (!pos.IsZero())
@@ -527,9 +526,9 @@ void TransformCompressor::Unmarshal(AZ::Transform& value, ReadBuffer& rb) const
}
if (flags & HAS_SCALE)
{
AZ::Vector3 scale;
rb.Read(scale, Vec3CompMarshaler());
xform.MultiplyByScale(scale);
float scale;
rb.Read(scale, HalfMarshaler());
xform.MultiplyByUniformScale(scale);
}
if (flags & HAS_POS)
{
@@ -11,6 +11,7 @@
*/
#include <AzTest/AzTest.h>
#include <AzCore/Settings/SettingsRegistryMergeUtils.h>
#include <AzCore/UnitTest/TestTypes.h>
#include <AzCore/UnitTest/UnitTest.h>
#include <AzCore/UserSettings/UserSettingsComponent.h>
@@ -40,6 +41,13 @@ namespace UnitTest
void SetUp() override
{
AZ::SettingsRegistryInterface* registry = AZ::SettingsRegistry::Get();
auto projectPathKey =
AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_path";
registry->Set(projectPathKey, "AutomatedTesting");
AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*registry);
m_application->Start({});
// Without this, the user settings component would attempt to save on finalize/shutdown. Since the file is
// shared across the whole engine, if multiple tests are run in parallel, the saving could cause a crash
+9
View File
@@ -16,6 +16,7 @@
#include <AzCore/UnitTest/UnitTest.h>
#include <AzCore/IO/SystemFile.h> // for max path decl
#include <AzCore/Settings/SettingsRegistryMergeUtils.h>
#include <AzCore/std/parallel/thread.h>
#include <AzCore/std/parallel/semaphore.h>
#include <AzCore/std/functional.h> // for function<> in the find files callback.
@@ -42,6 +43,14 @@ namespace UnitTest
{
AZ::ComponentApplication::Descriptor descriptor;
descriptor.m_stackRecordLevels = 30;
AZ::SettingsRegistryInterface* registry = AZ::SettingsRegistry::Get();
auto projectPathKey =
AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_path";
registry->Set(projectPathKey, "AutomatedTesting");
AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*registry);
m_application->Start(descriptor);
// Without this, the user settings component would attempt to save on finalize/shutdown. Since the file is
// shared across the whole engine, if multiple tests are run in parallel, the saving could cause a crash
+8
View File
@@ -23,6 +23,7 @@
#include <AzCore/Math/Uuid.h>
#include <AzCore/Memory/Memory.h>
#include <AzCore/Memory/PoolAllocator.h>
#include <AzCore/Settings/SettingsRegistryMergeUtils.h>
#include <AzCore/std/containers/vector.h>
#include <AzCore/UnitTest/TestTypes.h>
#include <AzCore/UserSettings/UserSettingsComponent.h>
@@ -304,6 +305,13 @@ namespace UnitTest
m_app.reset(aznew AzFramework::Application());
AZ::ComponentApplication::Descriptor desc;
desc.m_useExistingAllocator = true;
AZ::SettingsRegistryInterface* registry = AZ::SettingsRegistry::Get();
auto projectPathKey =
AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_path";
registry->Set(projectPathKey, "AutomatedTesting");
AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*registry);
m_app->Start(desc);
// Without this, the user settings component would attempt to save on finalize/shutdown. Since the file is
@@ -12,6 +12,7 @@
#include <AzCore/Component/ComponentApplicationBus.h>
#include <AzCore/Outcome/Outcome.h>
#include <AzCore/Settings/SettingsRegistryMergeUtils.h>
#include <AzCore/UnitTest/TestTypes.h>
#include <AzCore/UserSettings/UserSettingsComponent.h>
@@ -572,6 +573,12 @@ namespace UnitTest
{
AllocatorsTestFixture::SetUp();
AZ::SettingsRegistryInterface* registry = AZ::SettingsRegistry::Get();
auto projectPathKey =
AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_path";
registry->Set(projectPathKey, "AutomatedTesting");
AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*registry);
AzFramework::Application::Descriptor descriptor;
descriptor.m_enableDrilling = false;
m_app.Start(descriptor);
+7
View File
@@ -17,6 +17,7 @@
#include <AzCore/Serialization/Json/JsonSerialization.h>
#include <AzCore/Serialization/Json/JsonSystemComponent.h>
#include <AzCore/Serialization/Json/RegistrationContext.h>
#include <AzCore/Settings/SettingsRegistryMergeUtils.h>
#include <AzCore/UnitTest/TestTypes.h>
#include <AzCore/Utils/Utils.h>
#include <AzFramework/FileFunc/FileFunc.h>
@@ -278,6 +279,12 @@ namespace UnitTest
{
FrameworkApplicationFixture::SetUp();
AZ::SettingsRegistryInterface* registry = AZ::SettingsRegistry::Get();
auto projectPathKey =
AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_path";
registry->Set(projectPathKey, "AutomatedTesting");
AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*registry);
m_serializeContext = AZStd::make_unique<AZ::SerializeContext>();
m_jsonRegistrationContext = AZStd::make_unique<AZ::JsonRegistrationContext>();
m_jsonSystemComponent = AZStd::make_unique<AZ::JsonSystemComponent>();
+1
View File
@@ -83,6 +83,7 @@ namespace UnitTest
void SetUp() override
{
AllocatorsFixture::SetUp();
m_data = AZStd::make_unique<StaticData>();
using namespace AzFramework::FileTag;
AZ::ComponentApplication::Descriptor desc;
@@ -54,7 +54,7 @@ namespace UnitTest
};
void SetUp() override
{
{
m_appDescriptor.m_allocationRecords = true;
m_appDescriptor.m_allocationRecordsSaveNames = true;
m_appDescriptor.m_recordingMode = AZ::Debug::AllocationRecords::Mode::RECORD_FULL;
@@ -12,6 +12,7 @@
#include <AzTest/AzTest.h>
#include <AzCore/Slice/SliceComponent.h>
#include <AzCore/Serialization/Utils.h>
#include <AzCore/Settings/SettingsRegistryMergeUtils.h>
#include <AzCore/UserSettings/UserSettingsComponent.h>
#include <AzToolsFramework/ToolsComponents/GenericComponentWrapper.h>
#include <AzToolsFramework/Application/ToolsApplication.h>
@@ -59,6 +60,12 @@ class WrappedEditorComponentTest
protected:
void SetUp() override
{
AZ::SettingsRegistryInterface* registry = AZ::SettingsRegistry::Get();
auto projectPathKey =
AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_path";
registry->Set(projectPathKey, "AutomatedTesting");
AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*registry);
m_app.Start(AZ::ComponentApplication::Descriptor());
// Without this, the user settings component would attempt to save on finalize/shutdown. Since the file is
@@ -178,6 +185,12 @@ class FindWrappedComponentsTest
public:
void SetUp() override
{
AZ::SettingsRegistryInterface* registry = AZ::SettingsRegistry::Get();
auto projectPathKey =
AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_path";
registry->Set(projectPathKey, "AutomatedTesting");
AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*registry);
m_app.Start(AzFramework::Application::Descriptor());
// Without this, the user settings component would attempt to save on finalize/shutdown. Since the file is
+7
View File
@@ -22,6 +22,7 @@
#include <AzCore/Slice/SliceAssetHandler.h>
#include <AzCore/Script/ScriptSystemComponent.h>
#include <AzCore/Script/ScriptAsset.h>
#include <AzCore/Settings/SettingsRegistryMergeUtils.h>
#include <AzCore/std/chrono/chrono.h>
#include <AzCore/RTTI/TypeInfo.h>
#include <AzCore/UnitTest/TestTypes.h>
@@ -1059,6 +1060,12 @@ namespace UnitTest
void SetUp() override
{
AZ::SettingsRegistryInterface* registry = AZ::SettingsRegistry::Get();
auto projectPathKey =
AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_path";
registry->Set(projectPathKey, "AutomatedTesting");
AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*registry);
m_app.Start(AzFramework::Application::Descriptor());
// Without this, the user settings component would attempt to save on finalize/shutdown. Since the file is
+64 -42
View File
@@ -9,6 +9,8 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#
set_property(GLOBAL PROPERTY LAUNCHER_UNIFIED_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
# Launcher targets for a project need to be generated when configuring a project.
# When building the engine source, this file will be included by LauncherUnified's CMakeLists.txt
# When using an installed engine, this file will be included by the FindLauncherGenerator.cmake script
@@ -40,28 +42,8 @@ foreach(project_name project_path IN ZIP_LISTS LY_PROJECTS_TARGET_NAME LY_PROJEC
# In the monolithic case, we need to register the gem modules, to do so we will generate a StaticModules.inl
# file from StaticModules.in
set_property(GLOBAL APPEND PROPERTY LY_STATIC_MODULE_PROJECTS_NAME ${project_name})
get_property(game_gem_dependencies GLOBAL PROPERTY LY_DELAYED_DEPENDENCIES_${project_name}.GameLauncher)
unset(extern_module_declarations)
unset(module_invocations)
foreach(game_gem_dependency ${game_gem_dependencies})
# To match the convention on how gems targets vs gem modules are named, we remove the "Gem::" from prefix
# and remove the ".Static" from the suffix
string(REGEX REPLACE "^Gem::" "Gem_" game_gem_dependency ${game_gem_dependency})
string(REGEX REPLACE "^Project::" "Project_" game_gem_dependency ${game_gem_dependency})
# Replace "." with "_"
string(REPLACE "." "_" game_gem_dependency ${game_gem_dependency})
string(APPEND extern_module_declarations "extern \"C\" AZ::Module* CreateModuleClass_${game_gem_dependency}();\n")
string(APPEND module_invocations " modulesOut.push_back(CreateModuleClass_${game_gem_dependency}());\n")
endforeach()
configure_file(StaticModules.in
${CMAKE_CURRENT_BINARY_DIR}/${project_name}.GameLauncher/Includes/StaticModules.inl
)
set(game_build_dependencies
${game_gem_dependencies}
@@ -70,29 +52,9 @@ foreach(project_name project_path IN ZIP_LISTS LY_PROJECTS_TARGET_NAME LY_PROJEC
if(PAL_TRAIT_BUILD_SERVER_SUPPORTED)
get_property(server_gem_dependencies GLOBAL PROPERTY LY_DELAYED_DEPENDENCIES_${project_name}.ServerLauncher)
unset(extern_module_declarations)
unset(module_invocations)
foreach(server_gem_dependency ${server_gem_dependencies})
# To match the convention on how gems targets vs gem modules are named, we remove the "Gem::" from prefix
# and remove the ".Static" from the suffix
string(REGEX REPLACE "^Gem::" "Gem_" server_gem_dependency ${server_gem_dependency})
string(REGEX REPLACE "^Project::" "Project_" server_gem_dependency ${server_gem_dependency})
# Replace "." with "_"
string(REPLACE "." "_" server_gem_dependency ${server_gem_dependency})
string(APPEND extern_module_declarations "extern \"C\" AZ::Module* CreateModuleClass_${server_gem_dependency}();\n")
string(APPEND module_invocations " modulesOut.push_back(CreateModuleClass_${server_gem_dependency}());\n")
endforeach()
configure_file(StaticModules.in
${CMAKE_CURRENT_BINARY_DIR}/${project_name}.ServerLauncher/Includes/StaticModules.inl
)
set(server_build_dependencies
${game_gem_dependencies}
${server_gem_dependencies}
Legacy::CrySystem
)
endif()
@@ -186,3 +148,63 @@ foreach(project_name project_path IN ZIP_LISTS LY_PROJECTS_TARGET_NAME LY_PROJEC
endif()
endforeach()
#! Defer generation of the StaticModules.inl file needed in monolithic builds until after all the CMake targets are known
# This is that the GEM_MODULE target runtime dependencies can be parsed to discover the list of dependent modules
# to load
function(ly_delayed_generate_static_modules_inl)
if(LY_MONOLITHIC_GAME)
get_property(launcher_unified_binary_dir GLOBAL PROPERTY LAUNCHER_UNIFIED_BINARY_DIR)
get_property(project_names GLOBAL PROPERTY LY_STATIC_MODULE_PROJECTS_NAME)
foreach(project_name ${project_names})
unset(extern_module_declarations)
unset(module_invocations)
unset(all_game_gem_dependencies)
ly_get_gem_load_dependencies(all_game_gem_dependencies ${project_name}.GameLauncher)
foreach(game_gem_dependency ${all_game_gem_dependencies})
# To match the convention on how gems targets vs gem modules are named,
# we remove the ".Static" from the suffix
# Replace "." with "_"
string(REPLACE "." "_" game_gem_dependency ${game_gem_dependency})
string(APPEND extern_module_declarations "extern \"C\" AZ::Module* CreateModuleClass_Gem_${game_gem_dependency}();\n")
string(APPEND module_invocations " modulesOut.push_back(CreateModuleClass_Gem_${game_gem_dependency}());\n")
endforeach()
configure_file(${CMAKE_CURRENT_FUNCTION_LIST_DIR}/StaticModules.in
${launcher_unified_binary_dir}/${project_name}.GameLauncher/Includes/StaticModules.inl
)
if(PAL_TRAIT_BUILD_SERVER_SUPPORTED)
get_property(server_gem_dependencies GLOBAL PROPERTY LY_STATIC_MODULE_PROJECTS_DEPENDENCIES_${project_name}.ServerLauncher)
unset(extern_module_declarations)
unset(module_invocations)
unset(all_server_gem_dependencies)
ly_get_gem_load_dependencies(all_server_gem_dependencies ${project_name}.ServerLauncher)
foreach(server_gem_dependency ${server_gem_dependencies})
ly_get_gem_load_dependencies(server_gem_load_dependencies ${server_gem_dependency})
list(APPEND all_server_gem_dependencies ${server_gem_load_dependencies} ${server_gem_dependency})
endforeach()
foreach(server_gem_dependency ${all_server_gem_dependencies})
# Replace "." with "_"
string(REPLACE "." "_" server_gem_dependency ${server_gem_dependency})
string(APPEND extern_module_declarations "extern \"C\" AZ::Module* CreateModuleClass_Gem_${server_gem_dependency}();\n")
string(APPEND module_invocations " modulesOut.push_back(CreateModuleClass_Gem_${server_gem_dependency}());\n")
endforeach()
configure_file(${CMAKE_CURRENT_FUNCTION_LIST_DIR}/StaticModules.in
${launcher_unified_binary_dir}/${project_name}.ServerLauncher/Includes/StaticModules.inl
)
endif()
endforeach()
endif()
endfunction()
@@ -17,6 +17,7 @@
#include <AzToolsFramework/Application/ToolsApplication.h>
#include <AzToolsFramework/Asset/AssetBundler.h>
#include <AzCore/IO/Path/Path.h>
#include <AzCore/Settings/SettingsRegistryImpl.h>
#include <AzCore/Settings/SettingsRegistryMergeUtils.h>
#include <AzCore/UserSettings/UserSettingsComponent.h>
@@ -57,6 +58,22 @@ namespace AssetBundler
UnitTest::ScopedAllocatorSetupFixture::SetUp();
m_data = AZStd::make_unique<StaticData>();
AZ::SettingsRegistryInterface* registry = nullptr;
if (!AZ::SettingsRegistry::Get())
{
AZ::SettingsRegistry::Register(&m_registry);
registry = &m_registry;
}
else
{
registry = AZ::SettingsRegistry::Get();
}
auto projectPathKey = AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey)
+ "/project_path";
registry->Set(projectPathKey, "AutomatedTesting");
AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*registry);
m_data->m_applicationManager.reset(aznew MockApplicationManagerTest(0, 0));
m_data->m_applicationManager->Start(AzFramework::Application::Descriptor());
@@ -84,6 +101,12 @@ namespace AssetBundler
delete m_data->m_localFileIO;
AZ::IO::FileIOBase::SetInstance(m_data->m_priorFileIO);
auto settingsRegistry = AZ::SettingsRegistry::Get();
if(settingsRegistry == &m_registry)
{
AZ::SettingsRegistry::Unregister(settingsRegistry);
}
m_data->m_applicationManager->Stop();
m_data->m_applicationManager.reset();
m_data.reset();
@@ -99,6 +122,7 @@ namespace AssetBundler
};
AZStd::unique_ptr<StaticData> m_data;
AZ::SettingsRegistryImpl m_registry;
};
TEST_F(ApplicationManagerTest, ValidatePlatformFlags_ReadConfigFiles_OK)
+39 -21
View File
@@ -97,7 +97,28 @@ namespace AssetBundler
{
public:
void SetUp() override
{
{
AZ::SettingsRegistryInterface* registry = nullptr;
if (!AZ::SettingsRegistry::Get())
{
AZ::SettingsRegistry::Register(&m_registry);
registry = &m_registry;
}
else
{
registry = AZ::SettingsRegistry::Get();
}
auto projectPathKey = AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey)
+ "/project_path";
registry->Set(projectPathKey, "AutomatedTesting");
AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*registry);
AZ::IO::FixedMaxPath engineRoot = AZ::Utils::GetEnginePath();
if (engineRoot.empty())
{
GTEST_FATAL_FAILURE_(AZStd::string::format("Unable to locate engine root.\n").c_str());
}
m_data = AZStd::make_unique<StaticData>();
m_data->m_application.reset(aznew AzToolsFramework::ToolsApplication());
m_data->m_application.get()->Start(AzFramework::Application::Descriptor());
@@ -107,19 +128,6 @@ namespace AssetBundler
// in the unit tests.
AZ::UserSettingsComponentRequestBus::Broadcast(&AZ::UserSettingsComponentRequests::DisableSaveOnFinalize);
if (!AZ::SettingsRegistry::Get())
{
AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_Bootstrap(m_registry);
AZ::SettingsRegistry::Register(&m_registry);
}
AZ::IO::FixedMaxPath engineRoot = AZ::Utils::GetEnginePath();
if (engineRoot.empty())
{
GTEST_FATAL_FAILURE_(AZStd::string::format("Unable to locate engine root.\n").c_str());
}
m_data->m_testEngineRoot = (engineRoot / RelativeTestFolder).LexicallyNormal().String();
m_data->m_localFileIO = aznew AZ::IO::LocalFileIO();
@@ -144,14 +152,24 @@ namespace AssetBundler
}
void TearDown() override
{
AZ::IO::FileIOBase::SetInstance(nullptr);
delete m_data->m_localFileIO;
AZ::IO::FileIOBase::SetInstance(m_data->m_priorFileIO);
if (m_data)
{
AZ::IO::FileIOBase::SetInstance(nullptr);
delete m_data->m_localFileIO;
AZ::IO::FileIOBase::SetInstance(m_data->m_priorFileIO);
m_data->m_gemInfoList.set_capacity(0);
m_data->m_gemSeedFilePairList.set_capacity(0);
m_data->m_application.get()->Stop();
m_data->m_application.reset();
}
if(auto settingsRegistry = AZ::SettingsRegistry::Get();
settingsRegistry == &m_registry)
{
AZ::SettingsRegistry::Unregister(settingsRegistry);
}
m_data->m_gemInfoList.set_capacity(0);
m_data->m_gemSeedFilePairList.set_capacity(0);
m_data->m_application.get()->Stop();
m_data->m_application.reset();
}
void AddGemData(const char* engineRoot, const char* gemName, bool seedFileExists = true)
@@ -291,7 +291,6 @@ namespace AssetProcessor
}
}
AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_Bootstrap(registry);
AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_EngineRegistry(registry, platform, specialization, &scratchBuffer);
AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_GemRegistries(registry, platform, specialization, &scratchBuffer);
AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_ProjectRegistry(registry, platform, specialization, &scratchBuffer);
@@ -130,6 +130,9 @@ namespace AssetProcessor
auto cacheRootKey =
AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_cache_path";
settingsRegistry->Set(cacheRootKey, m_data->m_temporarySourceDir.absoluteFilePath("Cache").toUtf8().constData());
auto projectPathKey =
AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_path";
settingsRegistry->Set(projectPathKey, "AutomatedTesting");
AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*settingsRegistry);
AssetUtilities::ComputeProjectCacheRoot(m_data->m_cacheRootDir);
QString normalizedCacheRoot = AssetUtilities::NormalizeDirectoryPath(m_data->m_cacheRootDir.absolutePath());
@@ -12,7 +12,7 @@
#include "AssetProcessorTest.h"
#include <AzCore/Settings/SettingsRegistryMergeUtils.h>
#include <AzCore/UserSettings/UserSettingsComponent.h>
#include "BaseAssetProcessorTest.h"
@@ -67,6 +67,12 @@ namespace AssetProcessor
static char processName[] = {"AssetProcessorBatch"};
static char* namePtr = &processName[0];
static char** paramStringArray = &namePtr;
auto registry = AZ::SettingsRegistry::Get();
auto projectPathKey =
AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_path";
registry->Set(projectPathKey, "AutomatedTesting");
AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*registry);
m_application.reset(new UnitTestAppManager(&numParams, &paramStringArray));
ASSERT_EQ(m_application->BeforeRun(), ApplicationManager::Status_Success);
@@ -14,6 +14,7 @@
#include <AzTest/AzTest.h>
#include <AzCore/Memory/Memory.h>
#include <AzCore/Memory/SystemAllocator.h>
#include <AzCore/Settings/SettingsRegistryMergeUtils.h>
#include <AzFramework/Application/Application.h>
#include <native/utilities/assetUtils.h>
#include <native/unittests/UnitTestRunner.h> // for the assert absorber.
@@ -44,7 +45,18 @@ namespace AssetProcessor
AZ::AllocatorInstance<AZ::SystemAllocator>::Create();
}
m_errorAbsorber = new UnitTestUtils::AssertAbsorber();
m_application = AZStd::make_unique<AzFramework::Application>();
// Inject the AutomatedTesting project as a project path into test fixture
using FixedValueString = AZ::SettingsRegistryInterface::FixedValueString;
constexpr auto projectPathKey = FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey)
+ "/project_path";
if(auto settingsRegistry = AZ::SettingsRegistry::Get(); settingsRegistry != nullptr)
{
settingsRegistry->Set(projectPathKey, "AutomatedTesting");
AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*settingsRegistry);
}
}
void TearDown() override
@@ -204,6 +204,9 @@ void AssetProcessorManagerTest::SetUp()
auto cacheRootKey =
AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_cache_path";
registry->Set(cacheRootKey, tempPath.absoluteFilePath("Cache").toUtf8().constData());
auto projectPathKey =
AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_path";
registry->Set(projectPathKey, "AutomatedTesting");
AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*registry);
m_data->m_databaseLocationListener.BusConnect();
@@ -39,7 +39,6 @@ void PlatformConfigurationUnitTests::SetUp()
m_qApp = new QCoreApplication(m_argc, m_argv);
AssetProcessorTest::SetUp();
AssetUtilities::ResetAssetRoot();
}
void PlatformConfigurationUnitTests::TearDown()
@@ -37,6 +37,5 @@ private:
int m_argc;
char** m_argv;
QCoreApplication* m_qApp;
};
@@ -13,6 +13,7 @@
#include <AzTest/AzTest.h>
#include <AzCore/Memory/OSAllocator.h>
#include <AzCore/Memory/SystemAllocator.h>
#include <AzCore/Settings/SettingsRegistryMergeUtils.h>
#include <AzCore/std/containers/vector.h>
#include <AzCore/std/string/string.h>
#include <AzFramework/Asset/AssetBundleManifest.h>
@@ -45,6 +46,12 @@ public:
protected:
void SetUp() override
{
AZ::SettingsRegistryInterface* registry = AZ::SettingsRegistry::Get();
auto projectPathKey =
AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_path";
registry->Set(projectPathKey, "AutomatedTesting");
AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*registry);
AZ::ComponentApplication::Descriptor desc;
desc.m_useExistingAllocator = true;
desc.m_enableDrilling = false; // we already created a memory driller for the test (AllocatorsFixture)
@@ -15,5 +15,7 @@
<file>ArrowDownLine.svg</file>
<file>ArrowUpLine.svg</file>
<file>Backgrounds/FirstTimeBackgroundImage.jpg</file>
<file>ArrowDownLine.svg</file>
<file>ArrowUpLine.svg</file>
</qresource>
</RCC>
@@ -0,0 +1,49 @@
/*
* 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 <AzQtComponents/Components/SearchLineEdit.h>
#include <GemCatalog/GemCatalogHeaderWidget.h>
#include <QHBoxLayout>
#include <QLabel>
namespace O3DE::ProjectManager
{
GemCatalogHeaderWidget::GemCatalogHeaderWidget(GemSortFilterProxyModel* filterProxyModel, QWidget* parent)
: QFrame(parent)
{
QHBoxLayout* hLayout = new QHBoxLayout();
hLayout->setAlignment(Qt::AlignLeft);
hLayout->setMargin(0);
setLayout(hLayout);
setStyleSheet("background-color: #1E252F;");
QLabel* titleLabel = new QLabel(tr("Gem Catalog"));
titleLabel->setStyleSheet("font-size: 21px;");
hLayout->addWidget(titleLabel);
hLayout->addSpacerItem(new QSpacerItem(0, 0, QSizePolicy::Expanding));
AzQtComponents::SearchLineEdit* filterLineEdit = new AzQtComponents::SearchLineEdit();
filterLineEdit->setStyleSheet("background-color: #DDDDDD;");
connect(filterLineEdit, &QLineEdit::textChanged, this, [=](const QString& text)
{
filterProxyModel->SetSearchString(text);
});
hLayout->addWidget(filterLineEdit);
hLayout->addSpacerItem(new QSpacerItem(0, 0, QSizePolicy::Expanding));
hLayout->addSpacerItem(new QSpacerItem(220, 0, QSizePolicy::Fixed));
setFixedHeight(60);
}
} // namespace O3DE::ProjectManager
@@ -0,0 +1,31 @@
/*
* 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 <GemCatalog/GemSortFilterProxyModel.h>
#include <QFrame>
#endif
namespace O3DE::ProjectManager
{
class GemCatalogHeaderWidget
: public QFrame
{
Q_OBJECT // AUTOMOC
public:
explicit GemCatalogHeaderWidget(GemSortFilterProxyModel* filterProxyModel, QWidget* parent = nullptr);
~GemCatalogHeaderWidget() = default;
};
} // namespace O3DE::ProjectManager
@@ -12,6 +12,8 @@
#include <GemCatalog/GemCatalogScreen.h>
#include <PythonBindingsInterface.h>
#include <GemCatalog/GemCatalogHeaderWidget.h>
#include <GemCatalog/GemListHeaderWidget.h>
#include <GemCatalog/GemSortFilterProxyModel.h>
#include <GemCatalog/GemFilterWidget.h>
#include <QVBoxLayout>
@@ -34,6 +36,9 @@ namespace O3DE::ProjectManager
vLayout->setSpacing(0);
setLayout(vLayout);
GemCatalogHeaderWidget* headerWidget = new GemCatalogHeaderWidget(proxyModel);
vLayout->addWidget(headerWidget);
QHBoxLayout* hLayout = new QHBoxLayout();
hLayout->setMargin(0);
vLayout->addLayout(hLayout);
@@ -64,9 +69,12 @@ namespace O3DE::ProjectManager
GemFilterWidget* filterWidget = new GemFilterWidget(proxyModel);
filterWidget->setFixedWidth(250);
GemListHeaderWidget* listHeaderWidget = new GemListHeaderWidget(proxyModel);
QVBoxLayout* middleVLayout = new QVBoxLayout();
middleVLayout->setMargin(0);
middleVLayout->setSpacing(0);
middleVLayout->addWidget(listHeaderWidget);
middleVLayout->addWidget(m_gemListView);
hLayout->addWidget(filterWidget);
@@ -124,12 +124,12 @@ namespace O3DE::ProjectManager
{
if (m_collapseButton->isChecked())
{
m_collapseButton->setIcon(QIcon(":/Resources/ArrowDownLine.svg"));
m_collapseButton->setIcon(QIcon(":/ArrowDownLine.svg"));
m_mainWidget->hide();
}
else
{
m_collapseButton->setIcon(QIcon(":/Resources/ArrowUpLine.svg"));
m_collapseButton->setIcon(QIcon(":/ArrowUpLine.svg"));
m_mainWidget->show();
}
}
@@ -62,20 +62,20 @@ namespace O3DE::ProjectManager
bool IsValid() const;
QString m_path;
QString m_name;
QString m_displayName;
QString m_name = "Unknown Gem Name";
QString m_displayName = "Unknown Gem Name";
AZ::Uuid m_uuid;
QString m_creator;
QString m_creator = "Unknown Creator";
GemOrigin m_gemOrigin = Local;
bool m_isAdded = false; //! Is the gem currently added and enabled in the project?
QString m_summary;
QString m_summary = "No summary provided.";
Platforms m_platforms;
Types m_types; //! Asset and/or Code and/or Tool
QStringList m_features;
QString m_directoryLink;
QString m_documentationLink;
QString m_version;
QString m_lastUpdatedDate;
QString m_version = "Unknown Version";
QString m_lastUpdatedDate = "Unknown Date";
int m_binarySizeInKB = 0;
QStringList m_dependingGemUuids;
QStringList m_conflictingGemUuids;
@@ -0,0 +1,78 @@
/*
* 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 <GemCatalog/GemItemDelegate.h>
#include <GemCatalog/GemListHeaderWidget.h>
#include <QStandardItemModel>
#include <QLabel>
#include <QVBoxLayout>
namespace O3DE::ProjectManager
{
GemListHeaderWidget::GemListHeaderWidget(GemSortFilterProxyModel* proxyModel, QWidget* parent)
: QFrame(parent)
{
QVBoxLayout* vLayout = new QVBoxLayout();
vLayout->setMargin(0);
setLayout(vLayout);
setStyleSheet("background-color: #333333;");
vLayout->addSpacing(20);
// Top section
QHBoxLayout* topLayout = new QHBoxLayout();
topLayout->setMargin(0);
topLayout->addSpacerItem(new QSpacerItem(0, 0, QSizePolicy::Expanding));
QLabel* showCountLabel = new QLabel();
showCountLabel->setStyleSheet("font-size: 11pt; font: italic;");
topLayout->addWidget(showCountLabel);
connect(proxyModel, &GemSortFilterProxyModel::OnInvalidated, this, [=]
{
const int numGemsShown = proxyModel->rowCount();
showCountLabel->setText(QString(tr("showing %1 Gems")).arg(numGemsShown));
});
topLayout->addSpacing(GemItemDelegate::s_contentMargins.right() + GemItemDelegate::s_borderWidth);
vLayout->addLayout(topLayout);
vLayout->addSpacing(20);
// Separating line
QFrame* hLine = new QFrame();
hLine->setFrameShape(QFrame::HLine);
hLine->setStyleSheet("color: #666666;");
vLayout->addWidget(hLine);
vLayout->addSpacing(GemItemDelegate::s_contentMargins.top());
// Bottom section
QHBoxLayout* columnHeaderLayout = new QHBoxLayout();
columnHeaderLayout->setAlignment(Qt::AlignLeft);
columnHeaderLayout->addSpacing(31);
QLabel* gemNameLabel = new QLabel(tr("Gem Name"));
gemNameLabel->setStyleSheet("font-size: 11pt;");
columnHeaderLayout->addWidget(gemNameLabel);
columnHeaderLayout->addSpacing(111);
QLabel* gemSummaryLabel = new QLabel(tr("Gem Summary"));
gemSummaryLabel->setStyleSheet("font-size: 11pt;");
columnHeaderLayout->addWidget(gemSummaryLabel);
vLayout->addLayout(columnHeaderLayout);
}
} // namespace O3DE::ProjectManager
@@ -0,0 +1,33 @@
/*
* 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 <GemCatalog/GemSortFilterProxyModel.h>
#include <QAbstractItemModel>
#include <QItemSelectionModel>
#include <QFrame>
#endif
namespace O3DE::ProjectManager
{
class GemListHeaderWidget
: public QFrame
{
Q_OBJECT // AUTOMOC
public:
explicit GemListHeaderWidget(GemSortFilterProxyModel* proxyModel, QWidget* parent = nullptr);
~GemListHeaderWidget() = default;
};
} // namespace O3DE::ProjectManager
@@ -58,6 +58,8 @@ set(FILES
Source/LinkWidget.cpp
Source/TagWidget.h
Source/TagWidget.cpp
Source/GemCatalog/GemCatalogHeaderWidget.h
Source/GemCatalog/GemCatalogHeaderWidget.cpp
Source/GemCatalog/GemCatalogScreen.h
Source/GemCatalog/GemCatalogScreen.cpp
Source/GemCatalog/GemFilterWidget.h
@@ -70,6 +72,8 @@ set(FILES
Source/GemCatalog/GemItemDelegate.cpp
Source/GemCatalog/GemListView.h
Source/GemCatalog/GemListView.cpp
Source/GemCatalog/GemListHeaderWidget.h
Source/GemCatalog/GemListHeaderWidget.cpp
Source/GemCatalog/GemModel.h
Source/GemCatalog/GemModel.cpp
Source/GemCatalog/GemSortFilterProxyModel.h
@@ -152,8 +152,11 @@ struct AssetValidationTest
{
AZ::SettingsRegistry::Register(&m_registry);
AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_Bootstrap(m_registry);
auto projectPathKey = AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey)
+ "/project_path";
m_registry.Set(projectPathKey, "AutomatedTesting");
AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(m_registry);
// Set the engine root to the temporary directory and re-update the runtime file paths
auto enginePathKey = AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey)
+ "/engine_path";
@@ -886,7 +886,7 @@ namespace AZ
}
RHI::Ptr<RHI::PipelineLayoutDescriptor> BuildPipelineLayoutDescriptorForApi(
const char* builderName, const RPI::ShaderResourceGroupLayoutList& srgLayoutList, const MapOfStringToStageType& shaderEntryPoints,
[[maybe_unused]] const char* builderName, const RPI::ShaderResourceGroupLayoutList& srgLayoutList, const MapOfStringToStageType& shaderEntryPoints,
const RHI::ShaderCompilerArguments& shaderCompilerArguments, const RootConstantData& rootConstantData,
RHI::ShaderPlatformInterface* shaderPlatformInterface, BindingDependencies& bindingDependencies /*inout*/)
{
@@ -318,7 +318,7 @@ namespace AZ
{
AZ::Transform meshTransform = transformFeatureProcessor->GetTransformForId(TransformServiceFeatureProcessorInterface::ObjectId(mesh.first));
AZ::Transform noScaleTransform = meshTransform;
noScaleTransform.ExtractScale();
noScaleTransform.ExtractUniformScale();
AZ::Matrix3x3 rotationMatrix = Matrix3x3::CreateFromTransform(noScaleTransform);
rotationMatrix = rotationMatrix.GetInverseFull().GetTranspose();
@@ -231,7 +231,7 @@ namespace AZ
AZ_Error("TransformServiceFeatureProcessor", id.IsValid(), "Attempting to get the transform for an invalid handle.");
AZ::Matrix3x4 matrix3x4 = AZ::Matrix3x4::CreateFromRowMajorFloat12(m_objectToWorldTransforms.at(id.GetIndex()).m_transform);
AZ::Transform transform = AZ::Transform::CreateFromMatrix3x4(matrix3x4);
transform.ExtractScale();
transform.ExtractUniformScale();
return transform;
}
+4
View File
@@ -60,7 +60,9 @@ namespace UnitTest
TEST_F(UtilsTests, LoadFileString_Error_DoesNotExist)
{
AZ_TEST_START_TRACE_SUPPRESSION;
auto outcome = AZ::RHI::LoadFileString("FileDoesNotExist");
AZ_TEST_STOP_TRACE_SUPPRESSION_NO_COUNT;
EXPECT_FALSE(outcome.IsSuccess());
EXPECT_TRUE(outcome.GetError().find("Could not open file") != AZStd::string::npos);
EXPECT_TRUE(outcome.GetError().find("FileDoesNotExist") != AZStd::string::npos);
@@ -68,7 +70,9 @@ namespace UnitTest
TEST_F(UtilsTests, LoadFileBytes_Error_DoesNotExist)
{
AZ_TEST_START_TRACE_SUPPRESSION;
auto outcome = AZ::RHI::LoadFileBytes("FileDoesNotExist");
AZ_TEST_STOP_TRACE_SUPPRESSION_NO_COUNT;
EXPECT_FALSE(outcome.IsSuccess());
EXPECT_TRUE(outcome.GetError().find("Could not open file") != AZStd::string::npos);
EXPECT_TRUE(outcome.GetError().find("FileDoesNotExist") != AZStd::string::npos);
@@ -158,47 +158,8 @@ namespace AZ
void AtomBridgeSystemComponent::OnBootstrapSceneReady(AZ::RPI::Scene* bootstrapScene)
{
AZStd::shared_ptr<AZ::RPI::WindowContext> windowContext;
AZ::Render::Bootstrap::DefaultWindowBus::BroadcastResult(windowContext, &AZ::Render::Bootstrap::DefaultWindowInterface::GetDefaultWindowContext);
if (!windowContext)
{
AZ_Warning("Atom", false, "Cannot initialize Atom because no window context is available");
return;
}
AZ::RPI::RenderPipelinePtr renderPipeline = bootstrapScene->GetDefaultRenderPipeline();
// If RenderPipeline doesn't have a default view, create a view and make it the default view.
// These settings will be overridden by the editor or game camera.
if (renderPipeline->GetDefaultView() == nullptr)
{
auto viewContextManager = AZ::Interface<RPI::ViewportContextRequestsInterface>::Get();
m_view = AZ::RPI::View::CreateView(AZ::Name("AtomSystem Default View"), RPI::View::UsageCamera);
viewContextManager->PushView(viewContextManager->GetDefaultViewportContextName(), m_view);
const auto& viewport = windowContext->GetViewport();
const float aspectRatio = viewport.m_maxX / viewport.m_maxY;
// Note: This is projection assumes a setup for reversed depth
AZ::Matrix4x4 viewToClipMatrix;
AZ::MakePerspectiveFovMatrixRH(viewToClipMatrix, AZ::Constants::HalfPi, aspectRatio, 0.1f, 100.f, true);
m_view->SetViewToClipMatrix(viewToClipMatrix);
renderPipeline = bootstrapScene->GetDefaultRenderPipeline();
renderPipeline->SetDefaultView(m_view);
}
else
{
m_view = renderPipeline->GetDefaultView();
}
auto auxGeomFP = bootstrapScene->GetFeatureProcessor<RPI::AuxGeomFeatureProcessorInterface>();
if (auxGeomFP)
{
auxGeomFP->GetOrCreateDrawQueueForView(m_view.get());
}
// Make default AtomDebugDisplayViewportInterface for the scene
AZ_UNUSED(bootstrapScene);
// Make default AtomDebugDisplayViewportInterface
AZStd::shared_ptr<AtomDebugDisplayViewportInterface> mainEntityDebugDisplay = AZStd::make_shared<AtomDebugDisplayViewportInterface>(AzFramework::g_defaultSceneEntityDebugDisplayId);
m_activeViewportsList[AzFramework::g_defaultSceneEntityDebugDisplayId] = mainEntityDebugDisplay;
}
@@ -243,14 +243,14 @@ namespace AZ
{
// apply offset in world-space
finalTransform = m_targetEntityTransform * m_targetBoneTransform;
finalTransform.SetScale(AZ::Vector3::CreateOne());
finalTransform.SetUniformScale(1.0f);
finalTransform *= m_targetOffset;
}
else if (m_scaleSource == AttachmentConfiguration::ScaleSource::TargetEntityScale)
{
// apply offset in target-entity-space (ignoring bone scale)
AZ::Transform boneNoScale = m_targetBoneTransform;
boneNoScale.SetScale(AZ::Vector3::CreateOne());
boneNoScale.SetUniformScale(1.0f);
finalTransform = m_targetEntityTransform * boneNoScale * m_targetOffset;
}
@@ -35,7 +35,7 @@ namespace AZ
// This equation is based off of the integration of a line segment against a perpendicular normal pointing at the center of the
// line segment from some distance away.
float scale = GetTransform().GetScale().GetMaxElement();
float scale = GetTransform().GetUniformScale();
float h = GetInteriorHeight() * scale;
float t2 = lightThreshold * lightThreshold;
float h2 = h * h;
@@ -54,7 +54,7 @@ namespace AZ
const auto endpoints = m_shapeBus->GetCapsulePoints();
GetFeatureProcessor()->SetCapsuleLineSegment(GetLightHandle(), endpoints.m_begin, endpoints.m_end);
float scale = GetTransform().GetScale().GetMaxElement();
float scale = GetTransform().GetUniformScale();
float radius = m_shapeBus->GetRadius();
GetFeatureProcessor()->SetCapsuleRadius(GetLightHandle(), scale * radius);
}
@@ -62,7 +62,7 @@ namespace AZ
float CapsuleLightDelegate::GetSurfaceArea() const
{
float scale = GetTransform().GetScale().GetMaxElement();
float scale = GetTransform().GetUniformScale();
float radius = m_shapeBus->GetRadius();
float capsArea = 4.0f * Constants::Pi * radius * radius; // both caps make a sphere
float sideArea = 2.0f * Constants::Pi * radius * GetInteriorHeight(); // cylindrical area of capsule
@@ -77,7 +77,7 @@ namespace AZ
float radius = CalculateAttenuationRadius(AreaLightComponentConfig::CutoffIntensity);
// Add on the caps for the attenuation radius
float scale = GetTransform().GetScale().GetMaxElement();
float scale = GetTransform().GetUniformScale();
float height = m_shapeBus->GetHeight() * scale;
debugDisplay.SetColor(color);
@@ -48,7 +48,7 @@ namespace AZ::Render
float DiskLightDelegate::GetRadius() const
{
return m_shapeBus->GetRadius() * GetTransform().GetScale().GetMaxElement();
return m_shapeBus->GetRadius() * GetTransform().GetUniformScale();
}
void DiskLightDelegate::DrawDebugDisplay(const Transform& transform, const Color& /*color*/, AzFramework::DebugDisplayRequests& debugDisplay, bool isSelected) const
@@ -217,7 +217,7 @@ namespace AZ
GetEntityId(),
&TransformBus::Events::GetWorldTM);
transform.ExtractScale();
transform.ExtractUniformScale();
const Vector3 origin = transform.GetTranslation();
const Vector3 originOffset = origin - (transform.TransformVector(forward) * arrowOffset);
const Vector3 target = origin - (transform.TransformVector(forward) * (arrowLength + arrowOffset));
@@ -73,7 +73,7 @@ namespace AZ
twiceArea += vertices.at(i).GetX() * vertices.at(j).GetY();
twiceArea -= vertices.at(i).GetY() * vertices.at(j).GetX();
}
float scale = GetTransform().GetScale().GetMaxElement();
float scale = GetTransform().GetUniformScale();
return GetAbs(twiceArea * 0.5f * scale * scale);
}
@@ -50,7 +50,7 @@ namespace AZ
float SphereLightDelegate::GetRadius() const
{
return m_shapeBus->GetRadius() * GetTransform().GetScale().GetMaxElement();
return m_shapeBus->GetRadius() * GetTransform().GetUniformScale();
}
void SphereLightDelegate::DrawDebugDisplay(const Transform& transform, const Color& color, AzFramework::DebugDisplayRequests& debugDisplay, bool isSelected) const
@@ -228,7 +228,7 @@ namespace AZ
// remove scale
Transform worldNoScale = world;
worldNoScale.ExtractScale();
worldNoScale.ExtractUniformScale();
AZ::Matrix3x4 transformMatrix = AZ::Matrix3x4::CreateFromTransform(worldNoScale);
transformMatrix.StoreToRowMajorFloat12(matrix);
@@ -218,7 +218,7 @@ namespace AZ
SunPosition PhysicalSkyComponentController::GetSunTransform(const AZ::Transform& world)
{
Transform worldNoScale = world;
worldNoScale.ExtractScale();
worldNoScale.ExtractUniformScale();
AZ::Vector3 sunPositionAtom = worldNoScale.TransformVector(AZ::Vector3(0, -1, 0)); // transform Sun from default position
// Convert sun position to Y-up coordinate
@@ -384,8 +384,7 @@ def stash_env(_SYNTH_ENV_DICT = OrderedDict()):
# changed to just make the fallback what is set in boostrap
# so now it's less of a fallnack and more correct if not
# explicitly set
_LY_PROJECT = os.getenv(ENVAR_LY_PROJECT,
get_current_project(_LY_DEV))
_LY_PROJECT = os.getenv(ENVAR_LY_PROJECT)
_SYNTH_ENV_DICT[ENVAR_LY_PROJECT] = _LY_PROJECT
_LY_BUILD_DIR_NAME = os.getenv(ENVAR_LY_BUILD_DIR_NAME,
@@ -68,7 +68,7 @@ namespace Blast
auto transform = AZ::Transform::CreateFromQuaternionAndTranslation(
m_bodyConfiguration.m_orientation, m_bodyConfiguration.m_position);
transform.MultiplyByScale(AZ::Vector3(m_scale));
transform.MultiplyByUniformScale(m_scale);
AZ::TransformBus::Event(m_entity->GetId(), &AZ::TransformInterface::SetWorldTM, transform);
@@ -202,7 +202,7 @@ namespace Blast
if (parentBody)
{
parentTransform = parentBody->GetTransform();
parentTransform.MultiplyByScale(AZ::Vector3(m_initialTransform.GetScale().GetMaxElement()));
parentTransform.MultiplyByUniformScale(m_initialTransform.GetUniformScale());
}
else
{
@@ -254,7 +254,7 @@ namespace Blast
actorDesc.m_parentCenterOfMass = transform.GetTranslation();
actorDesc.m_parentLinearVelocity = AZ::Vector3::CreateZero();
actorDesc.m_bodyConfiguration = configuration;
actorDesc.m_scale = transform.GetScale().GetMaxElement();
actorDesc.m_scale = transform.GetUniformScale();
return actorDesc;
}
@@ -274,12 +274,15 @@ namespace DebugDraw
AzFramework::DebugDisplayRequests* debugDisplay =
AzFramework::DebugDisplayRequestBus::FindFirstHandler(debugDisplayBus);
OnTickAabbs(*debugDisplay);
OnTickLines(*debugDisplay);
OnTickObbs(*debugDisplay);
OnTickRays(*debugDisplay);
OnTickSpheres(*debugDisplay);
OnTickText(*debugDisplay);
if (debugDisplay)
{
OnTickAabbs(*debugDisplay);
OnTickLines(*debugDisplay);
OnTickObbs(*debugDisplay);
OnTickRays(*debugDisplay);
OnTickSpheres(*debugDisplay);
OnTickText(*debugDisplay);
}
}
template <typename F>
@@ -59,7 +59,16 @@ namespace EMotionFX
{
public:
ComponentFixtureApp() = default;
ComponentFixtureApp()
{
using FixedValueString = AZ::SettingsRegistryInterface::FixedValueString;
constexpr auto projectPathKey = FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_path";
if(auto settingsRegistry = AZ::SettingsRegistry::Get(); settingsRegistry != nullptr)
{
settingsRegistry->Set(projectPathKey, "AutomatedTesting");
AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*settingsRegistry);
}
}
AZ::ComponentTypeList GetRequiredSystemComponents() const override
{
@@ -77,7 +77,6 @@ namespace EMotionFX
{
auto testAssetsPath = AZ::IO::Path(GetEMotionFX().GetAssetCacheFolder()) / "TmpTestAssets";
QString dataDir = QString::fromUtf8(testAssetsPath.c_str(), aznumeric_cast<int>(testAssetsPath.Native().size()));
dataDir += "TmpTestAssets";
if (!QDir(dataDir).exists())
{
@@ -18,6 +18,7 @@
#include <EditorPythonBindings/EditorPythonBindingsBus.h>
#include <AzCore/Debug/TraceMessageBus.h>
#include <AzCore/Settings/SettingsRegistryMergeUtils.h>
#include <AzFramework/StringFunc/StringFunc.h>
#include <AzToolsFramework/API/EditorPythonRunnerRequestsBus.h>
@@ -322,6 +323,13 @@ sys.version
void SetUp() override
{
PythonTestingFixture::SetUp();
auto registry = AZ::SettingsRegistry::Get();
auto projectPathKey = AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey)
+ "/project_path";
registry->Set(projectPathKey, "AutomatedTesting");
AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*registry);
m_app.RegisterComponentDescriptor(EditorPythonBindings::PythonSystemComponent::CreateDescriptor());
}
@@ -203,7 +203,7 @@ namespace LmbrCentral
const AZ::Transform& currentTransform, const CapsuleShapeConfig& configuration,
[[maybe_unused]] const AZ::Vector3& currentNonUniformScale)
{
const float entityScale = currentTransform.GetScale().GetMaxElement();
const float entityScale = currentTransform.GetUniformScale();
m_axisVector = currentTransform.GetBasisZ().GetNormalizedSafe() * entityScale;
const float internalCylinderHeight = configuration.m_height - configuration.m_radius * 2.0f;
@@ -273,7 +273,7 @@ namespace LmbrCentral
const AZ::Transform& currentTransform, const CylinderShapeConfig& configuration,
[[maybe_unused]] const AZ::Vector3& currentNonUniformScale)
{
const float entityScale = currentTransform.GetScale().GetMaxElement();
const float entityScale = currentTransform.GetUniformScale();
m_axisVector = currentTransform.GetBasisZ().GetNormalizedSafe() * entityScale;
m_baseCenterPoint = currentTransform.GetTranslation() - m_axisVector * (configuration.m_height * 0.5f);
m_axisVector = m_axisVector * configuration.m_height;
@@ -167,7 +167,7 @@ namespace LmbrCentral
{
m_position = currentTransform.GetTranslation();
m_normal = currentTransform.GetBasisZ().GetNormalized();
m_radius = configuration.m_radius * currentTransform.GetScale().GetMaxElement();
m_radius = configuration.m_radius * currentTransform.GetUniformScale();
}
const DiskShapeConfig& DiskShape::GetDiskConfiguration() const
@@ -174,6 +174,6 @@ namespace LmbrCentral
AZ::Vector3 EditorBoxShapeComponent::GetBoxScale()
{
return AZ::Vector3(m_boxShape.GetCurrentTransform().GetScale().GetMaxElement() * m_boxShape.GetCurrentNonUniformScale());
return AZ::Vector3(m_boxShape.GetCurrentTransform().GetUniformScale() * m_boxShape.GetCurrentNonUniformScale());
}
} // namespace LmbrCentral
@@ -349,7 +349,7 @@ namespace LmbrCentral
const AZ::Vector3& src, const AZ::Vector3& dir, float& distance)
{
const auto rayIntersectData = IntersectSpline(m_cachedUniformScaleTransform, src, dir, *m_splineCommon.m_spline);
distance = rayIntersectData.m_rayDistance * m_cachedUniformScaleTransform.GetScale().GetMaxElement();
distance = rayIntersectData.m_rayDistance * m_cachedUniformScaleTransform.GetUniformScale();
AzFramework::CameraState cameraState;
AzToolsFramework::ViewportInteraction::ViewportInteractionRequestBus::EventResult(
@@ -136,7 +136,7 @@ namespace LmbrCentral
[[maybe_unused]] const AZ::Vector3& currentNonUniformScale)
{
m_position = currentTransform.GetTranslation();
m_radius = configuration.m_radius * currentTransform.GetScale().GetMaxElement();
m_radius = configuration.m_radius * currentTransform.GetUniformScale();
}
void DrawSphereShape(
@@ -15,6 +15,7 @@
#include <Builders/LevelBuilder/LevelBuilderWorker.h>
#include <AzTest/Utils.h>
#include <AzCore/IO/Path/Path.h>
#include <AzCore/Settings/SettingsRegistryMergeUtils.h>
#include <AzCore/Slice/SliceAssetHandler.h>
#include <AzCore/UnitTest/TestTypes.h>
#include <AzCore/UserSettings/UserSettingsComponent.h>
@@ -98,6 +99,12 @@ class LevelBuilderTest
protected:
void SetUp() override
{
AZ::SettingsRegistryInterface* registry = AZ::SettingsRegistry::Get();
auto projectPathKey =
AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_path";
registry->Set(projectPathKey, "AutomatedTesting");
AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*registry);
m_app.Start(m_descriptor);
// Without this, the user settings component would attempt to save on finalize/shutdown. Since the file is
// shared across the whole engine, if multiple tests are run in parallel, the saving could cause a crash
@@ -15,6 +15,7 @@
#include <Builders/LuaBuilder/LuaBuilderWorker.h>
#include <AzTest/Utils.h>
#include <AssetBuilderSDK/AssetBuilderSDK.h>
#include <AzCore/Settings/SettingsRegistryMergeUtils.h>
#include <AzCore/UnitTest/TestTypes.h>
#include <AzCore/UserSettings/UserSettingsComponent.h>
#include <AzCore/Utils/Utils.h>
@@ -32,6 +33,12 @@ namespace UnitTest
{
void SetUp() override
{
AZ::SettingsRegistryInterface* registry = AZ::SettingsRegistry::Get();
auto projectPathKey =
AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_path";
registry->Set(projectPathKey, "AutomatedTesting");
AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*registry);
m_app.Start(m_descriptor);
// Without this, the user settings component would attempt to save on finalize/shutdown. Since the file is
// shared across the whole engine, if multiple tests are run in parallel, the saving could cause a crash
@@ -12,6 +12,7 @@
#include "LmbrCentral_precompiled.h"
#include <AzTest/AzTest.h>
#include <AzCore/Settings/SettingsRegistryMergeUtils.h>
#include <AzCore/UnitTest/TestTypes.h>
#include <AzToolsFramework/Application/ToolsApplication.h>
#include <Builders/DependencyBuilder/SeedBuilderWorker/SeedBuilderWorker.h>
@@ -22,6 +23,12 @@ class SeedBuilderTests
{
void SetUp() override
{
AZ::SettingsRegistryInterface* registry = AZ::SettingsRegistry::Get();
auto projectPathKey =
AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_path";
registry->Set(projectPathKey, "AutomatedTesting");
AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*registry);
m_app.Start(AZ::ComponentApplication::Descriptor());
// Without this, the user settings component would attempt to save on finalize/shutdown. Since the file is
@@ -16,6 +16,7 @@
#include <CryCommon/Mocks/ISystemMock.h>
#include <LyShineBuilder/UiCanvasBuilderWorker.h>
#include <AzCore/IO/Path/Path.h>
#include <AzCore/Settings/SettingsRegistryMergeUtils.h>
#include <AzCore/UserSettings/UserSettingsComponent.h>
#include <AzCore/Utils/Utils.h>
#include <AzToolsFramework/Application/ToolsApplication.h>
@@ -88,6 +89,12 @@ protected:
m_data->m_stubEnv.pSystem = &m_data->m_mockSystem;
gEnv = &m_data->m_stubEnv;
AZ::SettingsRegistryInterface* registry = AZ::SettingsRegistry::Get();
auto projectPathKey =
AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_path";
registry->Set(projectPathKey, "AutomatedTesting");
AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*registry);
m_app.Start(m_descriptor);
// Without this, the user settings component would attempt to save on finalize/shutdown. Since the file is
// shared across the whole engine, if multiple tests are run in parallel, the saving could cause a crash
@@ -34,11 +34,11 @@ namespace Multiplayer
private:
void OnRotationChangedEvent(const AZ::Quaternion& rotation);
void OnTranslationChangedEvent(const AZ::Vector3& translation);
void OnScaleChangedEvent(const AZ::Vector3& scale);
void OnScaleChangedEvent(float scale);
AZ::Event<AZ::Quaternion>::Handler m_rotationEventHandler;
AZ::Event<AZ::Vector3>::Handler m_translationEventHandler;
AZ::Event<AZ::Vector3>::Handler m_scaleEventHandler;
AZ::Event<float>::Handler m_scaleEventHandler;
};
class NetworkTransformComponentController
@@ -14,7 +14,7 @@
<NetworkProperty Type="AZ::Quaternion" Name="rotation" Init="AZ::Quaternion::CreateIdentity()" ReplicateFrom="Authority" ReplicateTo="Client" IsRewindable="true" IsPredictable="true" IsPublic="true" Container="Object" ExposeToEditor="false" GenerateEventBindings="true" />
<NetworkProperty Type="AZ::Vector3" Name="translation" Init="AZ::Vector3::CreateZero()" ReplicateFrom="Authority" ReplicateTo="Client" IsRewindable="true" IsPredictable="true" IsPublic="true" Container="Object" ExposeToEditor="false" GenerateEventBindings="true" />
<NetworkProperty Type="AZ::Vector3" Name="scale" Init="AZ::Vector3::CreateZero()" ReplicateFrom="Authority" ReplicateTo="Client" IsRewindable="true" IsPredictable="true" IsPublic="true" Container="Object" ExposeToEditor="false" GenerateEventBindings="true" />
<NetworkProperty Type="float" Name="scale" Init="1.0f" ReplicateFrom="Authority" ReplicateTo="Client" IsRewindable="true" IsPredictable="true" IsPublic="true" Container="Object" ExposeToEditor="false" GenerateEventBindings="true" />
<NetworkProperty Type="uint8_t" Name="resetCount" Init="0" ReplicateFrom="Authority" ReplicateTo="Client" IsRewindable="false" IsPredictable="true" IsPublic="true" Container="Object" ExposeToEditor="false" GenerateEventBindings="true" />
<NetworkProperty Type="NetEntityId" Name="parentEntityId" Init="InvalidNetEntityId" ReplicateFrom="Authority" ReplicateTo="Client" IsRewindable="true" IsPredictable="true" IsPublic="true" Container="Object" ExposeToEditor="false" GenerateEventBindings="true" />
<NetworkProperty Type="int32_t" Name="parentAttachmentBoneId" Init="-1" ReplicateFrom="Authority" ReplicateTo="Client" IsRewindable="true" IsPredictable="true" IsPublic="true" Container="Object" ExposeToEditor="false" GenerateEventBindings="true" />
@@ -32,7 +32,7 @@ namespace Multiplayer
NetworkTransformComponent::NetworkTransformComponent()
: m_rotationEventHandler([this](const AZ::Quaternion& rotation) { OnRotationChangedEvent(rotation); })
, m_translationEventHandler([this](const AZ::Vector3& translation) { OnTranslationChangedEvent(translation); })
, m_scaleEventHandler([this](const AZ::Vector3& scale) { OnScaleChangedEvent(scale); })
, m_scaleEventHandler([this](float scale) { OnScaleChangedEvent(scale); })
{
;
}
@@ -68,10 +68,10 @@ namespace Multiplayer
GetTransformComponent()->SetWorldTM(worldTm);
}
void NetworkTransformComponent::OnScaleChangedEvent(const AZ::Vector3& scale)
void NetworkTransformComponent::OnScaleChangedEvent(float scale)
{
AZ::Transform worldTm = GetTransformComponent()->GetWorldTM();
worldTm.SetScale(scale);
worldTm.SetUniformScale(scale);
GetTransformComponent()->SetWorldTM(worldTm);
}
@@ -100,7 +100,7 @@ namespace Multiplayer
{
SetRotation(worldTm.GetRotation());
SetTranslation(worldTm.GetTranslation());
SetScale(worldTm.GetScale());
SetScale(worldTm.GetUniformScale());
}
}
}
+1 -1
View File
@@ -685,7 +685,7 @@ namespace PhysX
// Let each collider decide how to scale itself, so extract the scale here.
AZ::Transform entityWorldTransformWithoutScale = AZ::Transform::CreateIdentity();
AZ::TransformBus::EventResult(entityWorldTransformWithoutScale, m_entityId, &AZ::TransformInterface::GetWorldTM);
entityWorldTransformWithoutScale.ExtractScale();
entityWorldTransformWithoutScale.ExtractUniformScale();
auto* physXDebug = AZ::Interface<Debug::PhysXDebugInterface>::Get();
if (physXDebug == nullptr)
@@ -89,7 +89,7 @@ namespace PhysX
AZ::Transform worldTransform = AZ::Transform::CreateIdentity();
AZ::TransformBus::EventResult(
worldTransform, m_entityComponentId.GetEntityId(), &AZ::TransformInterface::GetWorldTM);
worldTransform.ExtractScale();
worldTransform.ExtractUniformScale();
AZ::Transform localTransform = AZ::Transform::CreateIdentity();
EditorJointRequestBus::EventResult(
@@ -603,7 +603,7 @@ namespace PhysX
}
AZ::Transform colliderTransform = GetWorldTM();
colliderTransform.ExtractScale();
colliderTransform.ExtractUniformScale();
AzPhysics::StaticRigidBodyConfiguration configuration;
configuration.m_orientation = colliderTransform.GetRotation();
configuration.m_position = colliderTransform.GetTranslation();
@@ -365,7 +365,7 @@ namespace PhysX
}
AZ::Transform colliderTransform = GetWorldTM();
colliderTransform.ExtractScale();
colliderTransform.ExtractUniformScale();
AzPhysics::RigidBodyConfiguration configuration = m_config;
configuration.m_orientation = colliderTransform.GetRotation();
@@ -205,7 +205,7 @@ namespace PhysX
}
AZ::Transform transform = GetWorldTM();
transform.ExtractScale();
transform.ExtractUniformScale();
const size_t numPoints = m_geometryCache.m_cachedSamplePoints.size();
for (size_t pointIndex = 0; pointIndex < numPoints; ++pointIndex)
{
@@ -105,39 +105,55 @@ namespace PhysX
AZ::Vector3 CharacterControllerComponent::GetBasePosition() const
{
return IsPhysicsEnabled() ? m_controller->GetBasePosition() : AZ::Vector3::CreateZero();
if (auto* controller = GetControllerConst())
{
return controller->GetBasePosition();
}
return AZ::Vector3::CreateZero();
}
void CharacterControllerComponent::SetBasePosition(const AZ::Vector3& position)
{
if (IsPhysicsEnabled())
if (auto* controller = GetController())
{
m_controller->SetBasePosition(position);
controller->SetBasePosition(position);
AZ::TransformBus::Event(GetEntityId(), &AZ::TransformBus::Events::SetWorldTranslation, position);
}
}
AZ::Vector3 CharacterControllerComponent::GetCenterPosition() const
{
return IsPhysicsEnabled() ? m_controller->GetCenterPosition() : AZ::Vector3::CreateZero();
if (auto* controller = GetControllerConst())
{
return controller->GetCenterPosition();
}
return AZ::Vector3::CreateZero();
}
float CharacterControllerComponent::GetStepHeight() const
{
return IsPhysicsEnabled() ? m_controller->GetStepHeight() : 0.0f;
if (auto* controller = GetControllerConst())
{
return controller->GetStepHeight();
}
return 0.0f;
}
void CharacterControllerComponent::SetStepHeight(float stepHeight)
{
if (IsPhysicsEnabled())
if (auto* controller = GetController())
{
m_controller->SetStepHeight(stepHeight);
controller->SetStepHeight(stepHeight);
}
}
AZ::Vector3 CharacterControllerComponent::GetUpDirection() const
{
return IsPhysicsEnabled() ? m_controller->GetUpDirection() : AZ::Vector3::CreateZero();
if (auto* controller = GetControllerConst())
{
return controller->GetUpDirection();
}
return AZ::Vector3::CreateZero();
}
void CharacterControllerComponent::SetUpDirection([[maybe_unused]] const AZ::Vector3& upDirection)
@@ -147,51 +163,58 @@ namespace PhysX
float CharacterControllerComponent::GetSlopeLimitDegrees() const
{
return IsPhysicsEnabled() ? m_controller->GetSlopeLimitDegrees() : 0.0f;
if (auto* controller = GetControllerConst())
{
return controller->GetSlopeLimitDegrees();
}
return 0.0f;
}
void CharacterControllerComponent::SetSlopeLimitDegrees(float slopeLimitDegrees)
{
if (IsPhysicsEnabled())
if (auto* controller = GetController())
{
m_controller->SetSlopeLimitDegrees(slopeLimitDegrees);
controller->SetSlopeLimitDegrees(slopeLimitDegrees);
}
}
float CharacterControllerComponent::GetMaximumSpeed() const
{
if (IsPhysicsEnabled())
if (auto* controller = GetControllerConst())
{
return m_controller->GetMaximumSpeed();
return controller->GetMaximumSpeed();
}
return 0.0f;
}
void CharacterControllerComponent::SetMaximumSpeed(float maximumSpeed)
{
if (IsPhysicsEnabled())
if (auto* controller = GetController())
{
m_controller->SetMaximumSpeed(maximumSpeed);
controller->SetMaximumSpeed(maximumSpeed);
}
}
AZ::Vector3 CharacterControllerComponent::GetVelocity() const
{
return IsPhysicsEnabled() ? m_controller->GetVelocity() : AZ::Vector3::CreateZero();
if (auto* controller = GetControllerConst())
{
return controller->GetVelocity();
}
return AZ::Vector3::CreateZero();
}
void CharacterControllerComponent::AddVelocity(const AZ::Vector3& velocity)
{
if (IsPhysicsEnabled())
if (auto* controller = GetController())
{
m_controller->AddVelocity(velocity);
controller->AddVelocity(velocity);
}
}
Physics::Character* CharacterControllerComponent::GetCharacter()
{
return m_controller;
return GetController();
}
void CharacterControllerComponent::EnablePhysics()
@@ -206,14 +229,14 @@ namespace PhysX
bool CharacterControllerComponent::IsPhysicsEnabled() const
{
return m_controller != nullptr;
return GetControllerConst() != nullptr;
}
AZ::Aabb CharacterControllerComponent::GetAabb() const
{
if (m_controller)
if (auto* controller = GetControllerConst())
{
return m_controller->GetAabb();
return controller->GetAabb();
}
return AZ::Aabb::CreateNull();
}
@@ -225,94 +248,121 @@ namespace PhysX
AzPhysics::SimulatedBodyHandle CharacterControllerComponent::GetSimulatedBodyHandle() const
{
if (m_controller)
{
return m_controller->m_bodyHandle;
}
return AzPhysics::InvalidSimulatedBodyHandle;
return m_controllerBodyHandle;
}
AzPhysics::SceneQueryHit CharacterControllerComponent::RayCast(const AzPhysics::RayCastRequest& request)
{
if (m_controller)
if (auto* controller = GetController())
{
return m_controller->RayCast(request);
return controller->RayCast(request);
}
return AzPhysics::SceneQueryHit();
}
// CharacterControllerRequestBus
void CharacterControllerComponent::Resize(float height)
{
return m_controller->Resize(height);
if (auto* controller = GetController())
{
controller->Resize(height);
}
}
float CharacterControllerComponent::GetHeight()
{
return m_controller->GetHeight();
if (auto* controller = GetController())
{
return controller->GetHeight();
}
return 0.0f;
}
void CharacterControllerComponent::SetHeight(float height)
{
return m_controller->SetHeight(height);
if (auto* controller = GetController())
{
controller->SetHeight(height);
}
}
float CharacterControllerComponent::GetRadius()
{
return m_controller->GetRadius();
if (auto* controller = GetController())
{
return controller->GetRadius();
}
return 0.0f;
}
void CharacterControllerComponent::SetRadius(float radius)
{
return m_controller->SetRadius(radius);
if (auto* controller = GetController())
{
controller->SetRadius(radius);
}
}
float CharacterControllerComponent::GetHalfSideExtent()
{
return m_controller->GetHalfSideExtent();
if (auto* controller = GetController())
{
return controller->GetHalfSideExtent();
}
return 0.0f;
}
void CharacterControllerComponent::SetHalfSideExtent(float halfSideExtent)
{
return m_controller->SetHalfSideExtent(halfSideExtent);
if (auto* controller = GetController())
{
controller->SetHalfSideExtent(halfSideExtent);
}
}
float CharacterControllerComponent::GetHalfForwardExtent()
{
return m_controller->GetHalfForwardExtent();
if (auto* controller = GetController())
{
return controller->GetHalfForwardExtent();
}
return 0.0f;
}
void CharacterControllerComponent::SetHalfForwardExtent(float halfForwardExtent)
{
return m_controller->SetHalfForwardExtent(halfForwardExtent);
if (auto* controller = GetController())
{
controller->SetHalfForwardExtent(halfForwardExtent);
}
}
// TransformNotificationBus
void CharacterControllerComponent::OnTransformChanged(const AZ::Transform& /*local*/, const AZ::Transform& world)
{
if (!IsPhysicsEnabled())
if (auto* controller = GetController())
{
return;
controller->SetBasePosition(world.GetTranslation());
}
m_controller->SetBasePosition(world.GetTranslation());
}
void CharacterControllerComponent::SetCollisionLayer(const AZStd::string& layerName, AZ::Crc32 colliderTag)
{
if (!IsPhysicsEnabled())
auto* controller = GetController();
if (controller == nullptr)
{
return;
}
if (Physics::Utils::FilterTag(m_controller->GetColliderTag(), colliderTag))
if (Physics::Utils::FilterTag(controller->GetColliderTag(), colliderTag))
{
bool success = false;
AzPhysics::CollisionLayer collisionLayer;
Physics::CollisionRequestBus::BroadcastResult(success, &Physics::CollisionRequests::TryGetCollisionLayerByName, layerName, collisionLayer);
if (success)
{
m_controller->SetCollisionLayer(collisionLayer);
controller->SetCollisionLayer(collisionLayer);
}
}
}
@@ -320,30 +370,33 @@ namespace PhysX
AZStd::string CharacterControllerComponent::GetCollisionLayerName()
{
AZStd::string layerName;
if (!IsPhysicsEnabled())
auto* controller = GetControllerConst();
if (controller == nullptr)
{
return layerName;
}
Physics::CollisionRequestBus::BroadcastResult(layerName, &Physics::CollisionRequests::GetCollisionLayerName, m_controller->GetCollisionLayer());
Physics::CollisionRequestBus::BroadcastResult(
layerName, &Physics::CollisionRequests::GetCollisionLayerName, controller->GetCollisionLayer());
return layerName;
}
void CharacterControllerComponent::SetCollisionGroup(const AZStd::string& groupName, AZ::Crc32 colliderTag)
{
if (!IsPhysicsEnabled())
auto* controller = GetController();
if (controller == nullptr)
{
return;
}
if (Physics::Utils::FilterTag(m_controller->GetColliderTag(), colliderTag))
if (Physics::Utils::FilterTag(controller->GetColliderTag(), colliderTag))
{
bool success = false;
AzPhysics::CollisionGroup collisionGroup;
Physics::CollisionRequestBus::BroadcastResult(success, &Physics::CollisionRequests::TryGetCollisionGroupByName, groupName, collisionGroup);
if (success)
{
m_controller->SetCollisionGroup(collisionGroup);
controller->SetCollisionGroup(collisionGroup);
}
}
}
@@ -351,23 +404,26 @@ namespace PhysX
AZStd::string CharacterControllerComponent::GetCollisionGroupName()
{
AZStd::string groupName;
if (!IsPhysicsEnabled())
auto* controller = GetControllerConst();
if (controller == nullptr)
{
return groupName;
}
Physics::CollisionRequestBus::BroadcastResult(groupName, &Physics::CollisionRequests::GetCollisionGroupName, m_controller->GetCollisionGroup());
Physics::CollisionRequestBus::BroadcastResult(
groupName, &Physics::CollisionRequests::GetCollisionGroupName, controller->GetCollisionGroup());
return groupName;
}
void CharacterControllerComponent::ToggleCollisionLayer(const AZStd::string& layerName, AZ::Crc32 colliderTag, bool enabled)
{
if (!IsPhysicsEnabled())
auto* controller = GetController();
if (controller == nullptr)
{
return;
}
if (Physics::Utils::FilterTag(m_controller->GetColliderTag(), colliderTag))
if (Physics::Utils::FilterTag(controller->GetColliderTag(), colliderTag))
{
bool success = false;
AzPhysics::CollisionLayer collisionLayer;
@@ -375,23 +431,43 @@ namespace PhysX
if (success)
{
AzPhysics::CollisionLayer layer(layerName);
AzPhysics::CollisionGroup group = m_controller->GetCollisionGroup();
AzPhysics::CollisionGroup group = controller->GetCollisionGroup();
group.SetLayer(layer, enabled);
m_controller->SetCollisionGroup(group);
controller->SetCollisionGroup(group);
}
}
}
void CharacterControllerComponent::OnPreSimulate(float deltaTime)
{
if (m_controller)
if (auto* controller = GetController())
{
m_controller->ApplyRequestedVelocity(deltaTime);
const AZ::Vector3 newPosition = GetBasePosition();
controller->ApplyRequestedVelocity(deltaTime);
const AZ::Vector3 newPosition = controller->GetBasePosition();
AZ::TransformBus::Event(GetEntityId(), &AZ::TransformBus::Events::SetWorldTranslation, newPosition);
}
}
const PhysX::CharacterController* CharacterControllerComponent::GetControllerConst() const
{
if (m_controllerBodyHandle == AzPhysics::InvalidSimulatedBodyHandle || m_attachedSceneHandle == AzPhysics::InvalidSceneHandle)
{
return nullptr;
}
if (auto* sceneInterface = AZ::Interface<AzPhysics::SceneInterface>::Get())
{
return azdynamic_cast<PhysX::CharacterController*>(
sceneInterface->GetSimulatedBodyFromHandle(m_attachedSceneHandle, m_controllerBodyHandle));
}
return nullptr;
}
PhysX::CharacterController* CharacterControllerComponent::GetController()
{
return const_cast<PhysX::CharacterController*>(GetControllerConst());
}
void CharacterControllerComponent::CreateController()
{
if (IsPhysicsEnabled())
@@ -399,9 +475,8 @@ namespace PhysX
return;
}
AzPhysics::SceneHandle defaultSceneHandle = AzPhysics::InvalidSceneHandle;
Physics::DefaultWorldBus::BroadcastResult(defaultSceneHandle, &Physics::DefaultWorldRequests::GetDefaultSceneHandle);
if (defaultSceneHandle == AzPhysics::InvalidSceneHandle)
Physics::DefaultWorldBus::BroadcastResult(m_attachedSceneHandle, &Physics::DefaultWorldRequests::GetDefaultSceneHandle);
if (m_attachedSceneHandle == AzPhysics::InvalidSceneHandle)
{
AZ_Error("PhysX Character Controller Component", false, "Failed to retrieve default scene.");
return;
@@ -427,11 +502,9 @@ namespace PhysX
auto* sceneInterface = AZ::Interface<AzPhysics::SceneInterface>::Get();
if (sceneInterface != nullptr)
{
m_controllerBodyHandle = sceneInterface->AddSimulatedBody(defaultSceneHandle, m_characterConfig.get());
m_controller = azdynamic_cast<PhysX::CharacterController*>(
sceneInterface->GetSimulatedBodyFromHandle(defaultSceneHandle, m_controllerBodyHandle));
m_controllerBodyHandle = sceneInterface->AddSimulatedBody(m_attachedSceneHandle, m_characterConfig.get());
}
if (m_controller == nullptr)
if (m_controllerBodyHandle == AzPhysics::InvalidSimulatedBodyHandle)
{
AZ_Error("PhysX Character Controller Component", false, "Failed to create character controller.");
return;
@@ -447,7 +520,7 @@ namespace PhysX
DestroyController();
}
});
sceneInterface->RegisterSimulationBodyRemovedHandler(defaultSceneHandle, m_onSimulatedBodyRemovedHandler);
sceneInterface->RegisterSimulationBodyRemovedHandler(m_attachedSceneHandle, m_onSimulatedBodyRemovedHandler);
}
CharacterControllerRequestBus::Handler::BusConnect(GetEntityId());
@@ -467,24 +540,23 @@ namespace PhysX
void CharacterControllerComponent::DisableController()
{
if (!IsPhysicsEnabled())
if (auto* controller = GetController())
{
return;
controller->DisablePhysics();
if (auto* sceneInterface = AZ::Interface<AzPhysics::SceneInterface>::Get())
{
sceneInterface->RemoveSimulatedBody(m_attachedSceneHandle, controller->m_bodyHandle);
}
DestroyController();
}
m_controller->DisablePhysics();
if (auto* sceneInterface = AZ::Interface<AzPhysics::SceneInterface>::Get())
{
sceneInterface->RemoveSimulatedBody(m_controller->m_sceneOwner, m_controller->m_bodyHandle);
}
DestroyController();
}
void CharacterControllerComponent::DestroyController()
{
m_controller = nullptr;
m_controllerBodyHandle = AzPhysics::InvalidSimulatedBodyHandle;
m_attachedSceneHandle = AzPhysics::InvalidSceneHandle;
m_preSimulateHandler.Disconnect();
m_onSimulatedBodyRemovedHandler.Disconnect();
CharacterControllerRequestBus::Handler::BusDisconnect();
@@ -131,6 +131,8 @@ namespace PhysX
void ToggleCollisionLayer(const AZStd::string& layerName, AZ::Crc32 colliderTag, bool enabled) override;
private:
const PhysX::CharacterController* GetControllerConst() const;
PhysX::CharacterController* GetController();
// Creates the physics character controller in the current default physics scene.
// This will do nothing if the controller is already created.
void CreateController();
@@ -143,8 +145,8 @@ namespace PhysX
AZStd::unique_ptr<Physics::CharacterConfiguration> m_characterConfig;
AZStd::shared_ptr<Physics::ShapeConfiguration> m_shapeConfig;
PhysX::CharacterController* m_controller = nullptr;
AzPhysics::SimulatedBodyHandle m_controllerBodyHandle = AzPhysics::InvalidSimulatedBodyHandle;
AzPhysics::SceneHandle m_attachedSceneHandle = AzPhysics::InvalidSceneHandle;
AzPhysics::SystemEvents::OnPresimulateEvent::Handler m_preSimulateHandler;
AzPhysics::SceneEvents::OnSimulationBodyRemoved::Handler m_onSimulatedBodyRemovedHandler;
};
@@ -196,7 +196,7 @@ namespace PhysX
AZ::Transform::CreateFromQuaternionAndTranslation(colliderConfiguration.m_rotation, colliderConfiguration.m_position);
AZ::Transform shapeTransform = *m_transform;
shapeTransform.ExtractScale();
shapeTransform.ExtractUniformScale();
shapeTransform = existingTransform * shapeTransform;
+6 -6
View File
@@ -718,7 +718,7 @@ namespace PhysX
const float boundsInflationFactor = 1.0f;
AZ::Transform overallTransformNoScale = GetColliderWorldTransform(worldTransform,
colliderConfiguration.m_position, colliderConfiguration.m_rotation);
overallTransformNoScale.ExtractScale();
overallTransformNoScale.ExtractUniformScale();
const physx::PxBounds3 bounds = physx::PxGeometryQuery::getWorldBounds(geometryHolder.any(),
PxMathConvert(overallTransformNoScale),
boundsInflationFactor);
@@ -1378,7 +1378,7 @@ namespace PhysX
AZ::TransformBus::EventResult(worldTransformWithoutScale
, entityId
, &AZ::TransformInterface::GetWorldTM);
worldTransformWithoutScale.ExtractScale();
worldTransformWithoutScale.ExtractUniformScale();
return worldTransformWithoutScale;
}
@@ -1386,10 +1386,10 @@ namespace PhysX
const AZ::Transform& entityWorldTransform)
{
AZ::Transform jointWorldTransformWithoutScale = jointWorldTransform;
jointWorldTransformWithoutScale.ExtractScale();
jointWorldTransformWithoutScale.ExtractUniformScale();
AZ::Transform entityWorldTransformWithoutScale = entityWorldTransform;
entityWorldTransformWithoutScale.ExtractScale();
entityWorldTransformWithoutScale.ExtractUniformScale();
AZ::Transform entityWorldTransformInverse = entityWorldTransformWithoutScale.GetInverse();
return entityWorldTransformInverse * jointWorldTransformWithoutScale;
@@ -1399,10 +1399,10 @@ namespace PhysX
const AZ::Transform& entityWorldTransform)
{
AZ::Transform jointLocalTransformWithoutScale = jointLocalTransform;
jointLocalTransformWithoutScale.ExtractScale();
jointLocalTransformWithoutScale.ExtractUniformScale();
AZ::Transform entityWorldTransformWithoutScale = entityWorldTransform;
entityWorldTransformWithoutScale.ExtractScale();
entityWorldTransformWithoutScale.ExtractUniformScale();
return entityWorldTransformWithoutScale * jointLocalTransformWithoutScale;
}
@@ -14,6 +14,7 @@
#include <AzCore/Component/TransformBus.h>
#include <AzCore/Serialization/Json/JsonSystemComponent.h>
#include <AzCore/Serialization/Json/RegistrationContext.h>
#include <AzCore/Settings/SettingsRegistryMergeUtils.h>
#include <AzCore/UserSettings/UserSettingsComponent.h>
namespace UnitTest
@@ -172,6 +173,12 @@ namespace UnitTest
void PrefabBuilderTests::SetUp()
{
AZ::SettingsRegistryInterface* registry = AZ::SettingsRegistry::Get();
auto projectPathKey =
AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_path";
registry->Set(projectPathKey, "AutomatedTesting");
AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*registry);
AZ::ComponentApplication::Descriptor desc;
m_app.Start(desc);
m_app.CreateReflectionManager();
@@ -16,6 +16,7 @@
#include <AzCore/Component/ComponentApplication.h>
#include <AzCore/Module/Environment.h>
#include <AzCore/RTTI/ReflectContext.h>
#include <AzCore/Settings/SettingsRegistryMergeUtils.h>
#include <AzCore/UnitTest/TestTypes.h>
#include <AzCore/UserSettings/UserSettingsComponent.h>
#include <AzCore/std/smart_ptr/make_shared.h>
@@ -139,6 +140,12 @@ class SceneBuilderPhasesFixture
public:
void SetUp() override
{
AZ::SettingsRegistryInterface* registry = AZ::SettingsRegistry::Get();
auto projectPathKey =
AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_path";
registry->Set(projectPathKey, "AutomatedTesting");
AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*registry);
m_app.Start(AZ::ComponentApplication::Descriptor());
// Without this, the user settings component would attempt to save on finalize/shutdown. Since the file is
@@ -13,6 +13,7 @@
#include <AssetBuilderSDK/AssetBuilderSDK.h>
#include <AzCore/IO/FileIO.h>
#include <AzCore/IO/Path/Path.h>
#include <AzCore/Settings/SettingsRegistryMergeUtils.h>
#include <AzCore/UnitTest/TestTypes.h>
#include <AzCore/UserSettings/UserSettingsComponent.h>
#include <AzFramework/StringFunc/StringFunc.h>
@@ -30,6 +31,12 @@ class SceneBuilderTests
protected:
void SetUp() override
{
AZ::SettingsRegistryInterface* registry = AZ::SettingsRegistry::Get();
auto projectPathKey =
AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_path";
registry->Set(projectPathKey, "AutomatedTesting");
AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*registry);
m_app.Start(AZ::ComponentApplication::Descriptor());
AZ::Debug::TraceMessageBus::Handler::BusConnect();
// Without this, the user settings component would attempt to save on finalize/shutdown. Since the file is

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