diff --git a/Assets/Editor/Icons/Components/Viewport/Non Uniform Scale.svg b/Assets/Editor/Icons/Components/Viewport/NonUniformScale.svg
similarity index 100%
rename from Assets/Editor/Icons/Components/Viewport/Non Uniform Scale.svg
rename to Assets/Editor/Icons/Components/Viewport/NonUniformScale.svg
diff --git a/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_hydra_scripts/hydra_GPUTest_LightComponent.py b/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_hydra_scripts/hydra_GPUTest_LightComponent.py
index 08f921e68b..8063445608 100644
--- a/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_hydra_scripts/hydra_GPUTest_LightComponent.py
+++ b/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_hydra_scripts/hydra_GPUTest_LightComponent.py
@@ -23,8 +23,7 @@ import azlmbr.legacy.general as general
sys.path.append(os.path.join(azlmbr.paths.devroot, "AutomatedTesting", "Gem", "PythonTests"))
import editor_python_test_tools.hydra_editor_utils as hydra
-from atom_renderer.atom_utils import screenshot_utils
-from atom_renderer.atom_utils import atom_component_helper
+from atom_renderer.atom_utils import atom_component_helper, atom_constants, screenshot_utils
from editor_python_test_tools.editor_test_helper import EditorTestHelper
helper = EditorTestHelper(log_prefix="Atom_EditorTestHelper")
@@ -92,7 +91,7 @@ def area_light_test():
'SetComponentProperty',
light_component_id_pair,
LIGHT_TYPE_PROPERTY,
- atom_component_helper.LIGHT_TYPES['capsule']
+ atom_constants.LIGHT_TYPES['capsule']
)
# Update color and take screenshot in game mode
@@ -118,7 +117,7 @@ def area_light_test():
'SetComponentProperty',
light_component_id_pair,
LIGHT_TYPE_PROPERTY,
- atom_component_helper.LIGHT_TYPES['spot_disk']
+ atom_constants.LIGHT_TYPES['spot_disk']
)
area_light_rotation = math.Vector3(DEGREE_RADIAN_FACTOR * 90.0, 0.0, 0.0)
azlmbr.components.TransformBus(azlmbr.bus.Event, "SetLocalRotation", area_light.id, area_light_rotation)
@@ -131,7 +130,7 @@ def area_light_test():
'SetComponentProperty',
light_component_id_pair,
LIGHT_TYPE_PROPERTY,
- atom_component_helper.LIGHT_TYPES['sphere']
+ atom_constants.LIGHT_TYPES['sphere']
)
general.idle_wait(1.0)
screenshot_utils.take_screenshot_game_mode("AreaLight_5", area_light_entity_name)
@@ -210,7 +209,7 @@ def spot_light_test():
'SetComponentProperty',
light_component_type,
LIGHT_TYPE_PROPERTY,
- atom_component_helper.LIGHT_TYPES['spot_disk']
+ atom_constants.LIGHT_TYPES['spot_disk']
)
general.idle_wait(1.0)
diff --git a/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_utils/material_editor_utils.py b/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_utils/material_editor_utils.py
index 77d1285188..1d72885504 100644
--- a/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_utils/material_editor_utils.py
+++ b/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_utils/material_editor_utils.py
@@ -13,9 +13,9 @@ import os
import sys
import time
import azlmbr.atom
+import azlmbr.atomtools as atomtools
import azlmbr.materialeditor as materialeditor
import azlmbr.bus as bus
-import azlmbr.atomtools.general as general
def is_close(actual, expected, buffer=sys.float_info.min):
@@ -125,11 +125,11 @@ def is_pane_visible(pane_name):
"""
:return: bool
"""
- return materialeditor.MaterialEditorWindowRequestBus(bus.Broadcast, "IsDockWidgetVisible", pane_name)
+ return atomtools.AtomToolsWindowRequestBus(bus.Broadcast, "IsDockWidgetVisible", pane_name)
def set_pane_visibility(pane_name, value):
- materialeditor.MaterialEditorWindowRequestBus(bus.Broadcast, "SetDockWidgetVisible", pane_name, value)
+ atomtools.AtomToolsWindowRequestBus(bus.Broadcast, "SetDockWidgetVisible", pane_name, value)
def select_lighting_config(config_name):
@@ -175,7 +175,7 @@ def wait_for_condition(function, timeout_in_seconds=1.0):
with Timeout(timeout_in_seconds) as t:
while True:
try:
- general.idle_wait_frames(1)
+ atomtools.general.idle_wait_frames(1)
except Exception:
print("WARNING: Couldn't wait for frame")
@@ -269,6 +269,6 @@ class ScreenshotHelper:
def capture_screenshot(file_path):
- return ScreenshotHelper(azlmbr.atomtools.general.idle_wait_frames).capture_screenshot_blocking(
+ return ScreenshotHelper(atomtools.general.idle_wait_frames).capture_screenshot_blocking(
os.path.join(file_path)
)
diff --git a/AutomatedTesting/Gem/PythonTests/smoke/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/smoke/CMakeLists.txt
index 3fc4f3db0e..5374b0d318 100644
--- a/AutomatedTesting/Gem/PythonTests/smoke/CMakeLists.txt
+++ b/AutomatedTesting/Gem/PythonTests/smoke/CMakeLists.txt
@@ -73,5 +73,17 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
AutomatedTesting.GameLauncher
AutomatedTesting.Assets
)
+ ly_add_pytest(
+ NAME AutomatedTesting::LoadLevelCPU
+ TEST_SUITE sandbox
+ PATH ${CMAKE_CURRENT_LIST_DIR}/test_RemoteConsole_CPULoadLevel_Works.py
+ TIMEOUT 100
+ RUNTIME_DEPENDENCIES
+ AZ::AssetProcessor
+ AZ::PythonBindingsExample
+ Legacy::Editor
+ AutomatedTesting.GameLauncher
+ AutomatedTesting.Assets
+ )
endif()
diff --git a/AutomatedTesting/Gem/PythonTests/smoke/test_RemoteConsole_CPULoadLevel_Works.py b/AutomatedTesting/Gem/PythonTests/smoke/test_RemoteConsole_CPULoadLevel_Works.py
index 6522514f2f..701dcfab10 100644
--- a/AutomatedTesting/Gem/PythonTests/smoke/test_RemoteConsole_CPULoadLevel_Works.py
+++ b/AutomatedTesting/Gem/PythonTests/smoke/test_RemoteConsole_CPULoadLevel_Works.py
@@ -24,7 +24,7 @@ from ly_remote_console.remote_console_commands import (
@pytest.mark.parametrize("launcher_platform", ["windows"])
@pytest.mark.parametrize("project", ["AutomatedTesting"])
@pytest.mark.parametrize("level", ["Simple"])
-@pytest.mark.SUITE_smoke
+@pytest.mark.SUITE_sandbox
class TestRemoteConsoleLoadLevelWorks(object):
@pytest.fixture
def remote_console_instance(self, request):
diff --git a/AutomatedTesting/Objects/Characters/Jack/Jack.fbx b/AutomatedTesting/Objects/Characters/Jack/Jack.fbx
index bccd5cce24..2e55fdd1e7 100644
--- a/AutomatedTesting/Objects/Characters/Jack/Jack.fbx
+++ b/AutomatedTesting/Objects/Characters/Jack/Jack.fbx
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:ba9a2cd047a5ee696aaeed882869017a02fd4f5eeee91b6b2bfb830ad1e5ee15
-size 10927631
+oid sha256:c285cdf72ebe4c274f8d1fbab6ff558f9344d4fa62fb9d07cf11f7511ffaaac9
+size 2177072
diff --git a/AutomatedTesting/Objects/Characters/Jack/Jack.fbx.assetinfo b/AutomatedTesting/Objects/Characters/Jack/Jack.fbx.assetinfo
new file mode 100644
index 0000000000..2de6d987d7
--- /dev/null
+++ b/AutomatedTesting/Objects/Characters/Jack/Jack.fbx.assetinfo
@@ -0,0 +1,328 @@
+{
+ "values": [
+ {
+ "$type": "ActorGroup",
+ "name": "Jack",
+ "selectedRootBone": "RootNode.jack_root",
+ "id": "{B7194F91-D8A1-5D5D-AC6D-DDEBC087D80D}",
+ "rules": {
+ "rules": [
+ {
+ "$type": "MetaDataRule",
+ "metaData": "AdjustActor -actorID $(ACTORID) -name \"Jack\"\nActorSetCollisionMeshes -actorID $(ACTORID) -lod 0 -nodeList \"\"\nAdjustActor -actorID $(ACTORID) -nodesExcludedFromBounds \"\" -nodeAction \"select\"\nAdjustActor -actorID $(ACTORID) -nodeAction \"replace\" -attachmentNodes \"\"\nAdjustActor -actorID $(ACTORID) -motionExtractionNodeName \"jack_root\"\nAdjustActor -actorID $(ACTORID) -mirrorSetup \"\"\n"
+ }
+ ]
+ }
+ },
+ {
+ "$type": "{5B03C8E6-8CEE-4DA0-A7FA-CD88689DD45B} MeshGroup",
+ "id": "{BF2CCF49-9BE0-5103-987A-84649A974991}",
+ "name": "Jack",
+ "NodeSelectionList": {
+ "unselectedNodes": [
+ "RootNode",
+ "RootNode.jack_root",
+ "RootNode.jack_meshZUp",
+ "RootNode.jack_root.Bip01__pelvis",
+ "RootNode.jack_meshZUp.jack_meshZUp_1",
+ "RootNode.jack_meshZUp.jack_meshZUp_2",
+ "RootNode.jack_root.Bip01__pelvis.transform",
+ "RootNode.jack_root.Bip01__pelvis.l_upLeg",
+ "RootNode.jack_root.Bip01__pelvis.r_upLeg",
+ "RootNode.jack_root.Bip01__pelvis.spine1",
+ "RootNode.jack_meshZUp.jack_meshZUp_1.Bitangent",
+ "RootNode.jack_meshZUp.jack_meshZUp_1.SkinWeight_",
+ "RootNode.jack_meshZUp.jack_meshZUp_1.transform",
+ "RootNode.jack_meshZUp.jack_meshZUp_1.Tangent",
+ "RootNode.jack_meshZUp.jack_meshZUp_1.map1",
+ "RootNode.jack_meshZUp.jack_meshZUp_1.jack",
+ "RootNode.jack_meshZUp.jack_meshZUp_2.Bitangent",
+ "RootNode.jack_meshZUp.jack_meshZUp_2.SkinWeight_",
+ "RootNode.jack_meshZUp.jack_meshZUp_2.transform",
+ "RootNode.jack_meshZUp.jack_meshZUp_2.Tangent",
+ "RootNode.jack_meshZUp.jack_meshZUp_2.map1",
+ "RootNode.jack_meshZUp.jack_meshZUp_2.jack",
+ "RootNode.jack_root.Bip01__pelvis.l_upLeg.transform",
+ "RootNode.jack_root.Bip01__pelvis.l_upLeg.l_upLegRoll",
+ "RootNode.jack_root.Bip01__pelvis.l_upLeg.l_loLeg",
+ "RootNode.jack_root.Bip01__pelvis.r_upLeg.transform",
+ "RootNode.jack_root.Bip01__pelvis.r_upLeg.r_upLegRoll",
+ "RootNode.jack_root.Bip01__pelvis.r_upLeg.r_loLeg",
+ "RootNode.jack_root.Bip01__pelvis.spine1.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2",
+ "RootNode.jack_root.Bip01__pelvis.l_upLeg.l_upLegRoll.transform",
+ "RootNode.jack_root.Bip01__pelvis.l_upLeg.l_loLeg.transform",
+ "RootNode.jack_root.Bip01__pelvis.l_upLeg.l_loLeg.l_ankle",
+ "RootNode.jack_root.Bip01__pelvis.r_upLeg.r_upLegRoll.transform",
+ "RootNode.jack_root.Bip01__pelvis.r_upLeg.r_loLeg.transform",
+ "RootNode.jack_root.Bip01__pelvis.r_upLeg.r_loLeg.r_ankle",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3",
+ "RootNode.jack_root.Bip01__pelvis.l_upLeg.l_loLeg.l_ankle.transform",
+ "RootNode.jack_root.Bip01__pelvis.l_upLeg.l_loLeg.l_ankle.l_ball",
+ "RootNode.jack_root.Bip01__pelvis.r_upLeg.r_loLeg.r_ankle.transform",
+ "RootNode.jack_root.Bip01__pelvis.r_upLeg.r_loLeg.r_ankle.r_ball",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.neck",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr",
+ "RootNode.jack_root.Bip01__pelvis.l_upLeg.l_loLeg.l_ankle.l_ball.transform",
+ "RootNode.jack_root.Bip01__pelvis.r_upLeg.r_loLeg.r_ankle.r_ball.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.neck.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.neck.head",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.neck.head.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_upArmRoll",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_upArmRoll",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_upArmRoll.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_loArmRoll",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_upArmRoll.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_loArmRoll",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_loArmRoll.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_thumb1",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_index1",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_mid1",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_handProp",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_loArmRoll.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_thumb1",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_index1",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_mid1",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_handProp",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_thumb1.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_thumb1.l_thumb2",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_index1.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_index1.l_index2",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_mid1.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_mid1.l_mid2",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_ring1",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_pinky1",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_handProp.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_thumb1.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_thumb1.r_thumb2",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_index1.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_index1.r_index2",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_mid1.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_mid1.r_mid2",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_ring1",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_pinky1",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_handProp.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_thumb1.l_thumb2.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_thumb1.l_thumb2.l_thumb3",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_index1.l_index2.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_index1.l_index2.l_index3",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_mid1.l_mid2.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_mid1.l_mid2.l_mid3",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_ring1.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_ring1.l_ring2",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_pinky1.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_pinky1.l_pinky2",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_thumb1.r_thumb2.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_thumb1.r_thumb2.r_thumb3",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_index1.r_index2.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_index1.r_index2.r_index3",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_mid1.r_mid2.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_mid1.r_mid2.r_mid3",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_ring1.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_ring1.r_ring2",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_pinky1.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_pinky1.r_pinky2",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_thumb1.l_thumb2.l_thumb3.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_index1.l_index2.l_index3.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_mid1.l_mid2.l_mid3.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_ring1.l_ring2.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_ring1.l_ring2.l_ring3",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_pinky1.l_pinky2.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_pinky1.l_pinky2.l_pinky3",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_thumb1.r_thumb2.r_thumb3.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_index1.r_index2.r_index3.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_mid1.r_mid2.r_mid3.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_ring1.r_ring2.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_ring1.r_ring2.r_ring3",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_pinky1.r_pinky2.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_pinky1.r_pinky2.r_pinky3",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_ring1.l_ring2.l_ring3.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_pinky1.l_pinky2.l_pinky3.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_ring1.r_ring2.r_ring3.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_pinky1.r_pinky2.r_pinky3.transform"
+ ]
+ }
+ },
+ {
+ "$type": "{07B356B7-3635-40B5-878A-FAC4EFD5AD86} MeshGroup",
+ "name": "Jack",
+ "nodeSelectionList": {
+ "selectedNodes": [
+ "RootNode",
+ "RootNode.jack_root",
+ "RootNode.jack_meshZUp",
+ "RootNode.jack_root.Bip01__pelvis",
+ "RootNode.jack_meshZUp.jack_meshZUp_1",
+ "RootNode.jack_meshZUp.jack_meshZUp_2",
+ "RootNode.jack_root.Bip01__pelvis.transform",
+ "RootNode.jack_root.Bip01__pelvis.l_upLeg",
+ "RootNode.jack_root.Bip01__pelvis.r_upLeg",
+ "RootNode.jack_root.Bip01__pelvis.spine1",
+ "RootNode.jack_meshZUp.jack_meshZUp_1.Bitangent",
+ "RootNode.jack_meshZUp.jack_meshZUp_1.SkinWeight_",
+ "RootNode.jack_meshZUp.jack_meshZUp_1.transform",
+ "RootNode.jack_meshZUp.jack_meshZUp_1.Tangent",
+ "RootNode.jack_meshZUp.jack_meshZUp_1.map1",
+ "RootNode.jack_meshZUp.jack_meshZUp_1.jack",
+ "RootNode.jack_meshZUp.jack_meshZUp_2.Bitangent",
+ "RootNode.jack_meshZUp.jack_meshZUp_2.SkinWeight_",
+ "RootNode.jack_meshZUp.jack_meshZUp_2.transform",
+ "RootNode.jack_meshZUp.jack_meshZUp_2.Tangent",
+ "RootNode.jack_meshZUp.jack_meshZUp_2.map1",
+ "RootNode.jack_meshZUp.jack_meshZUp_2.jack",
+ "RootNode.jack_root.Bip01__pelvis.l_upLeg.transform",
+ "RootNode.jack_root.Bip01__pelvis.l_upLeg.l_upLegRoll",
+ "RootNode.jack_root.Bip01__pelvis.l_upLeg.l_loLeg",
+ "RootNode.jack_root.Bip01__pelvis.r_upLeg.transform",
+ "RootNode.jack_root.Bip01__pelvis.r_upLeg.r_upLegRoll",
+ "RootNode.jack_root.Bip01__pelvis.r_upLeg.r_loLeg",
+ "RootNode.jack_root.Bip01__pelvis.spine1.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2",
+ "RootNode.jack_root.Bip01__pelvis.l_upLeg.l_upLegRoll.transform",
+ "RootNode.jack_root.Bip01__pelvis.l_upLeg.l_loLeg.transform",
+ "RootNode.jack_root.Bip01__pelvis.l_upLeg.l_loLeg.l_ankle",
+ "RootNode.jack_root.Bip01__pelvis.r_upLeg.r_upLegRoll.transform",
+ "RootNode.jack_root.Bip01__pelvis.r_upLeg.r_loLeg.transform",
+ "RootNode.jack_root.Bip01__pelvis.r_upLeg.r_loLeg.r_ankle",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3",
+ "RootNode.jack_root.Bip01__pelvis.l_upLeg.l_loLeg.l_ankle.transform",
+ "RootNode.jack_root.Bip01__pelvis.l_upLeg.l_loLeg.l_ankle.l_ball",
+ "RootNode.jack_root.Bip01__pelvis.r_upLeg.r_loLeg.r_ankle.transform",
+ "RootNode.jack_root.Bip01__pelvis.r_upLeg.r_loLeg.r_ankle.r_ball",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.neck",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr",
+ "RootNode.jack_root.Bip01__pelvis.l_upLeg.l_loLeg.l_ankle.l_ball.transform",
+ "RootNode.jack_root.Bip01__pelvis.r_upLeg.r_loLeg.r_ankle.r_ball.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.neck.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.neck.head",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.neck.head.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_upArmRoll",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_upArmRoll",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_upArmRoll.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_loArmRoll",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_upArmRoll.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_loArmRoll",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_loArmRoll.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_thumb1",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_index1",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_mid1",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_handProp",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_loArmRoll.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_thumb1",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_index1",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_mid1",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_handProp",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_thumb1.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_thumb1.l_thumb2",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_index1.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_index1.l_index2",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_mid1.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_mid1.l_mid2",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_ring1",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_pinky1",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_handProp.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_thumb1.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_thumb1.r_thumb2",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_index1.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_index1.r_index2",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_mid1.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_mid1.r_mid2",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_ring1",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_pinky1",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_handProp.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_thumb1.l_thumb2.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_thumb1.l_thumb2.l_thumb3",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_index1.l_index2.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_index1.l_index2.l_index3",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_mid1.l_mid2.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_mid1.l_mid2.l_mid3",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_ring1.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_ring1.l_ring2",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_pinky1.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_pinky1.l_pinky2",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_thumb1.r_thumb2.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_thumb1.r_thumb2.r_thumb3",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_index1.r_index2.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_index1.r_index2.r_index3",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_mid1.r_mid2.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_mid1.r_mid2.r_mid3",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_ring1.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_ring1.r_ring2",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_pinky1.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_pinky1.r_pinky2",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_thumb1.l_thumb2.l_thumb3.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_index1.l_index2.l_index3.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_mid1.l_mid2.l_mid3.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_ring1.l_ring2.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_ring1.l_ring2.l_ring3",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_pinky1.l_pinky2.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_pinky1.l_pinky2.l_pinky3",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_thumb1.r_thumb2.r_thumb3.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_index1.r_index2.r_index3.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_mid1.r_mid2.r_mid3.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_ring1.r_ring2.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_ring1.r_ring2.r_ring3",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_pinky1.r_pinky2.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_pinky1.r_pinky2.r_pinky3",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_ring1.l_ring2.l_ring3.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_pinky1.l_pinky2.l_pinky3.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_ring1.r_ring2.r_ring3.transform",
+ "RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_pinky1.r_pinky2.r_pinky3.transform"
+ ]
+ },
+ "rules": {
+ "rules": [
+ {
+ "$type": "SkinRule"
+ },
+ {
+ "$type": "MaterialRule"
+ }
+ ]
+ },
+ "id": "{59B1DB76-5B27-5569-8DF6-55296FD0E5D8}"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/AutomatedTesting/Objects/Characters/Jack/Jack.mtl b/AutomatedTesting/Objects/Characters/Jack/Jack.mtl
deleted file mode 100644
index 2af23cc798..0000000000
--- a/AutomatedTesting/Objects/Characters/Jack/Jack.mtl
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/AutomatedTesting/Objects/Characters/Jack/attachments/arm_plates_lower_01.cgf b/AutomatedTesting/Objects/Characters/Jack/attachments/arm_plates_lower_01.cgf
deleted file mode 100644
index a9530b6d1b..0000000000
--- a/AutomatedTesting/Objects/Characters/Jack/attachments/arm_plates_lower_01.cgf
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:bb1c97394454a0a0c3b4aaf8380878aac3f7bedc9091ec920963932ad6ad2290
-size 30484
diff --git a/AutomatedTesting/Objects/Characters/Jack/attachments/arm_plates_upper_01.cgf b/AutomatedTesting/Objects/Characters/Jack/attachments/arm_plates_upper_01.cgf
deleted file mode 100644
index 781ff1fe50..0000000000
--- a/AutomatedTesting/Objects/Characters/Jack/attachments/arm_plates_upper_01.cgf
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:d090219fc20e7c1d9f0c187f976a7cb55e5b27b39e087aa8281ac794f314cb32
-size 22364
diff --git a/AutomatedTesting/Objects/Characters/Jack/attachments/back_pack_01.cgf b/AutomatedTesting/Objects/Characters/Jack/attachments/back_pack_01.cgf
deleted file mode 100644
index 0e59a1393d..0000000000
--- a/AutomatedTesting/Objects/Characters/Jack/attachments/back_pack_01.cgf
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:8fa78264ca46a2f201e24c3ba6a543e713bf9fd984df0a10f52b191d21077227
-size 106676
diff --git a/AutomatedTesting/Objects/Characters/Jack/attachments/head_aerial_01.cgf b/AutomatedTesting/Objects/Characters/Jack/attachments/head_aerial_01.cgf
deleted file mode 100644
index cc54ba4b64..0000000000
--- a/AutomatedTesting/Objects/Characters/Jack/attachments/head_aerial_01.cgf
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:ebf610eecec9a4da2d5c9260c48b81f6a04eaf7686d69850ad9f5d06fdbcf183
-size 12940
diff --git a/AutomatedTesting/Objects/Characters/Jack/attachments/jack_matGroup.mtl b/AutomatedTesting/Objects/Characters/Jack/attachments/jack_matGroup.mtl
deleted file mode 100644
index ebade464ec..0000000000
--- a/AutomatedTesting/Objects/Characters/Jack/attachments/jack_matGroup.mtl
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/AutomatedTesting/Objects/Characters/Jack/attachments/leg_plate_l_01.cgf b/AutomatedTesting/Objects/Characters/Jack/attachments/leg_plate_l_01.cgf
deleted file mode 100644
index 3ffabb1464..0000000000
--- a/AutomatedTesting/Objects/Characters/Jack/attachments/leg_plate_l_01.cgf
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:30afe8cf6e4aca846b07ef81747607afb47c0ff88283f363aca29ded9818c3db
-size 8148
diff --git a/AutomatedTesting/Objects/Characters/Jack/attachments/leg_plate_r_01.cgf b/AutomatedTesting/Objects/Characters/Jack/attachments/leg_plate_r_01.cgf
deleted file mode 100644
index e98083d030..0000000000
--- a/AutomatedTesting/Objects/Characters/Jack/attachments/leg_plate_r_01.cgf
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:dba25dd8b3840d01aefb69007919b07befc5365fff714493c87cf1eff644d5dc
-size 8148
diff --git a/AutomatedTesting/Objects/Characters/Jack/dummyPlane_mat_group.mtl b/AutomatedTesting/Objects/Characters/Jack/dummyPlane_mat_group.mtl
deleted file mode 100644
index 4545010b7e..0000000000
--- a/AutomatedTesting/Objects/Characters/Jack/dummyPlane_mat_group.mtl
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/AutomatedTesting/Objects/Characters/Jack/enemy_matGroup.mtl b/AutomatedTesting/Objects/Characters/Jack/enemy_matGroup.mtl
deleted file mode 100644
index 523dac897f..0000000000
--- a/AutomatedTesting/Objects/Characters/Jack/enemy_matGroup.mtl
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/AutomatedTesting/Objects/Characters/Jack/enemy_runner_matGroup.mtl b/AutomatedTesting/Objects/Characters/Jack/enemy_runner_matGroup.mtl
deleted file mode 100644
index 95c40eeb65..0000000000
--- a/AutomatedTesting/Objects/Characters/Jack/enemy_runner_matGroup.mtl
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/AutomatedTesting/Objects/Characters/Jack/enemy_tank_matGroup.mtl b/AutomatedTesting/Objects/Characters/Jack/enemy_tank_matGroup.mtl
deleted file mode 100644
index e0f18e9f69..0000000000
--- a/AutomatedTesting/Objects/Characters/Jack/enemy_tank_matGroup.mtl
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/AutomatedTesting/Objects/Characters/Jack/jack_matGroup.mtl b/AutomatedTesting/Objects/Characters/Jack/jack_matGroup.mtl
deleted file mode 100644
index 3927661f97..0000000000
--- a/AutomatedTesting/Objects/Characters/Jack/jack_matGroup.mtl
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_01_ddna.tif b/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_01_ddna.tif
deleted file mode 100644
index 378e0ea6ed..0000000000
--- a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_01_ddna.tif
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:ca5c900fabf8b5c8c9313a0144886f4da3f812c82e8cffd652d9c61b9bb5b953
-size 4221960
diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_01_ddna.tif.exportsettings b/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_01_ddna.tif.exportsettings
deleted file mode 100644
index 10f3182ac9..0000000000
--- a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_01_ddna.tif.exportsettings
+++ /dev/null
@@ -1 +0,0 @@
-/autooptimizefile=0 /preset=NormalsWithSmoothness /reduce=0
\ No newline at end of file
diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_White_diff.tif b/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_White_diff.tif
deleted file mode 100644
index 5b4a3c3518..0000000000
--- a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_White_diff.tif
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:80f40a78e4b21dd27f5ddf34337e7d0e2119b7cfa08f0eea38d4b1d63808821f
-size 3178996
diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_White_diff.tif.exportsettings b/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_White_diff.tif.exportsettings
deleted file mode 100644
index 2d1dccbf99..0000000000
--- a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_White_diff.tif.exportsettings
+++ /dev/null
@@ -1 +0,0 @@
-/autooptimizefile=0 /preset=Albedo /reduce=0
\ No newline at end of file
diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_White_emis.tif b/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_White_emis.tif
deleted file mode 100644
index a85ac62f6c..0000000000
--- a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_White_emis.tif
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:e5f5e327624e0f1fd35fac141019941b12ad0642c25853be9f7fd5b9b6f91bc5
-size 3168212
diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_White_emis.tif.exportsettings b/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_White_emis.tif.exportsettings
deleted file mode 100644
index 2d1dccbf99..0000000000
--- a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_White_emis.tif.exportsettings
+++ /dev/null
@@ -1 +0,0 @@
-/autooptimizefile=0 /preset=Albedo /reduce=0
\ No newline at end of file
diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_black_diff.tif b/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_black_diff.tif
deleted file mode 100644
index c861056eea..0000000000
--- a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_black_diff.tif
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:089e74ca9a41967038e16a9107099a73f8e93d39c487ff5bacdde18f418bf761
-size 3176732
diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_emis.tif b/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_emis.tif
deleted file mode 100644
index 6909252726..0000000000
--- a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_emis.tif
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:d45cd564d2b52575d1ad37b907a7d378871f05f6c9e5569ec73d7973d56599c9
-size 3167984
diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_emis.tif.exportsettings b/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_emis.tif.exportsettings
deleted file mode 100644
index 2d1dccbf99..0000000000
--- a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_emis.tif.exportsettings
+++ /dev/null
@@ -1 +0,0 @@
-/autooptimizefile=0 /preset=Albedo /reduce=0
\ No newline at end of file
diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_green_diff.tif b/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_green_diff.tif
deleted file mode 100644
index 3254f98355..0000000000
--- a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_green_diff.tif
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:83a872c07f7cbbcb868903429dd8d5a71e8c0b7b0e2cb16cb08b5cb26b02251c
-size 3177492
diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_green_diff.tif.exportsettings b/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_green_diff.tif.exportsettings
deleted file mode 100644
index 2d1dccbf99..0000000000
--- a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_green_diff.tif.exportsettings
+++ /dev/null
@@ -1 +0,0 @@
-/autooptimizefile=0 /preset=Albedo /reduce=0
\ No newline at end of file
diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_red_diff.tif b/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_red_diff.tif
deleted file mode 100644
index b00a8cd13b..0000000000
--- a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_red_diff.tif
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:81c1bc9545a17232523fd97561013534221b3bf8927feefa52bdc757e294c2e2
-size 3179140
diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_red_diff.tif.exportsettings b/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_red_diff.tif.exportsettings
deleted file mode 100644
index 2d1dccbf99..0000000000
--- a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_red_diff.tif.exportsettings
+++ /dev/null
@@ -1 +0,0 @@
-/autooptimizefile=0 /preset=Albedo /reduce=0
\ No newline at end of file
diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_spec.tif b/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_spec.tif
deleted file mode 100644
index 3e2fb9a003..0000000000
--- a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_spec.tif
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:99f476a56205c80878be7472857a6430ce6dc40f2eb1558de4933a5b79fa2420
-size 814244
diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_spec.tif.exportsettings b/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_spec.tif.exportsettings
deleted file mode 100644
index aaaf14a9fe..0000000000
--- a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_spec.tif.exportsettings
+++ /dev/null
@@ -1 +0,0 @@
-/autooptimizefile=0 /preset=Reflectance /reduce=0
\ No newline at end of file
diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_yellow_diff.tif b/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_yellow_diff.tif
deleted file mode 100644
index 2c44044576..0000000000
--- a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_yellow_diff.tif
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:366959c8a31356669d47f58d07157171ed369b3e7549b3b65a8b8d153a1477a6
-size 3179956
diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_yellow_diff.tif.exportsettings b/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_yellow_diff.tif.exportsettings
deleted file mode 100644
index 2d1dccbf99..0000000000
--- a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_yellow_diff.tif.exportsettings
+++ /dev/null
@@ -1 +0,0 @@
-/autooptimizefile=0 /preset=Albedo /reduce=0
\ No newline at end of file
diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_yellow_emis.tif b/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_yellow_emis.tif
deleted file mode 100644
index 4dea311abb..0000000000
--- a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_yellow_emis.tif
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:e839924e03ba99459547df1cf5334de3bdad75b18e76176e430e343a979d9f05
-size 3168472
diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_yellow_emis.tif.exportsettings b/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_yellow_emis.tif.exportsettings
deleted file mode 100644
index 2d1dccbf99..0000000000
--- a/AutomatedTesting/Objects/Characters/Jack/textures/BrokenRobot_yellow_emis.tif.exportsettings
+++ /dev/null
@@ -1 +0,0 @@
-/autooptimizefile=0 /preset=Albedo /reduce=0
\ No newline at end of file
diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/jack_ddna.tif b/AutomatedTesting/Objects/Characters/Jack/textures/jack_ddna.tif
deleted file mode 100644
index 57d61f505a..0000000000
--- a/AutomatedTesting/Objects/Characters/Jack/textures/jack_ddna.tif
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:36f537bb5be89fccba1502e9e8f8dfffbf05ea8aa82ac439305e8c2502b01691
-size 16804800
diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/jack_ddna.tif.exportsettings b/AutomatedTesting/Objects/Characters/Jack/textures/jack_ddna.tif.exportsettings
deleted file mode 100644
index a90d724812..0000000000
--- a/AutomatedTesting/Objects/Characters/Jack/textures/jack_ddna.tif.exportsettings
+++ /dev/null
@@ -1 +0,0 @@
-/autooptimizefile=0 /M=50,50,0,50,50,50 /preset=NormalsWithSmoothness /reduce=0
\ No newline at end of file
diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/jack_diff.tif b/AutomatedTesting/Objects/Characters/Jack/textures/jack_diff.tif
deleted file mode 100644
index a8f5db9a96..0000000000
--- a/AutomatedTesting/Objects/Characters/Jack/textures/jack_diff.tif
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:b0457cbbbe1fe7e52fdb9af7ee2bc32df96a453fe248738b35ffe0b8087a28c5
-size 12615988
diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/jack_diff.tif.exportsettings b/AutomatedTesting/Objects/Characters/Jack/textures/jack_diff.tif.exportsettings
deleted file mode 100644
index f35416077f..0000000000
--- a/AutomatedTesting/Objects/Characters/Jack/textures/jack_diff.tif.exportsettings
+++ /dev/null
@@ -1 +0,0 @@
-/autooptimizefile=0 /M=50,50,50,0,50,50 /preset=Albedo /reduce=0
\ No newline at end of file
diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/jack_emis.tif b/AutomatedTesting/Objects/Characters/Jack/textures/jack_emis.tif
deleted file mode 100644
index f5ee4b43b2..0000000000
--- a/AutomatedTesting/Objects/Characters/Jack/textures/jack_emis.tif
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:4ba741103d039bddf72d4834c92a5e069285e31b8be2e7f4e8103f9c5c81694f
-size 3167864
diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/jack_emis.tif.exportsettings b/AutomatedTesting/Objects/Characters/Jack/textures/jack_emis.tif.exportsettings
deleted file mode 100644
index 8177b5abe6..0000000000
--- a/AutomatedTesting/Objects/Characters/Jack/textures/jack_emis.tif.exportsettings
+++ /dev/null
@@ -1 +0,0 @@
-/autooptimizefile=0 /M=50,50,0,50,50,50 /preset=Albedo /reduce=0
\ No newline at end of file
diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/jack_spec.tif b/AutomatedTesting/Objects/Characters/Jack/textures/jack_spec.tif
deleted file mode 100644
index 20fb2114c0..0000000000
--- a/AutomatedTesting/Objects/Characters/Jack/textures/jack_spec.tif
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:4d7cb58f48e4df76214509fc01d5170fd38bc447d56af61f008c04a1653c2d20
-size 12614884
diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/jack_spec.tif.exportsettings b/AutomatedTesting/Objects/Characters/Jack/textures/jack_spec.tif.exportsettings
deleted file mode 100644
index 7fbb585758..0000000000
--- a/AutomatedTesting/Objects/Characters/Jack/textures/jack_spec.tif.exportsettings
+++ /dev/null
@@ -1 +0,0 @@
-/autooptimizefile=0 /M=50,50,50,0,50,50 /preset=Reflectance /reduce=0
\ No newline at end of file
diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/jack_spec_02_spec.tif b/AutomatedTesting/Objects/Characters/Jack/textures/jack_spec_02_spec.tif
deleted file mode 100644
index 3334a5c39b..0000000000
--- a/AutomatedTesting/Objects/Characters/Jack/textures/jack_spec_02_spec.tif
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:80a2c56bfcb8c98bf5a72ec9fdb5fcc6eae28ba1c3c26efad5c8a36e6105f1d0
-size 3173936
diff --git a/AutomatedTesting/Objects/Characters/Jack/textures/jack_spec_02_spec.tif.exportsettings b/AutomatedTesting/Objects/Characters/Jack/textures/jack_spec_02_spec.tif.exportsettings
deleted file mode 100644
index aaaf14a9fe..0000000000
--- a/AutomatedTesting/Objects/Characters/Jack/textures/jack_spec_02_spec.tif.exportsettings
+++ /dev/null
@@ -1 +0,0 @@
-/autooptimizefile=0 /preset=Reflectance /reduce=0
\ No newline at end of file
diff --git a/Code/Editor/CryEdit.cpp b/Code/Editor/CryEdit.cpp
index 9f37830e6f..8444f81317 100644
--- a/Code/Editor/CryEdit.cpp
+++ b/Code/Editor/CryEdit.cpp
@@ -891,8 +891,7 @@ CCrySingleDocTemplate::Confidence CCrySingleDocTemplate::MatchDocType(const char
/////////////////////////////////////////////////////////////////////////////
namespace
{
- CryMutex g_splashScreenStateLock;
- CryConditionVariable g_splashScreenStateChange;
+ AZStd::mutex g_splashScreenStateLock;
enum ESplashScreenState
{
eSplashScreenState_Init, eSplashScreenState_Started, eSplashScreenState_Destroy
@@ -923,7 +922,7 @@ QString FormatRichTextCopyrightNotice()
/////////////////////////////////////////////////////////////////////////////
void CCryEditApp::ShowSplashScreen(CCryEditApp* app)
{
- g_splashScreenStateLock.Lock();
+ g_splashScreenStateLock.lock();
CStartupLogoDialog* splashScreen = new CStartupLogoDialog(FormatVersion(app->m_pEditor->GetFileVersion()), FormatRichTextCopyrightNotice());
@@ -931,8 +930,7 @@ void CCryEditApp::ShowSplashScreen(CCryEditApp* app)
g_splashScreen = splashScreen;
g_splashScreenState = eSplashScreenState_Started;
- g_splashScreenStateLock.Unlock();
- g_splashScreenStateChange.Notify();
+ g_splashScreenStateLock.unlock();
splashScreen->show();
// Make sure the initial paint of the splash screen occurs so we dont get stuck with a blank window
@@ -940,10 +938,9 @@ void CCryEditApp::ShowSplashScreen(CCryEditApp* app)
QObject::connect(splashScreen, &QObject::destroyed, splashScreen, [=]
{
- g_splashScreenStateLock.Lock();
+ AZStd::scoped_lock lock(g_splashScreenStateLock);
g_pInitializeUIInfo = nullptr;
g_splashScreen = nullptr;
- g_splashScreenStateLock.Unlock();
});
}
@@ -973,9 +970,9 @@ void CCryEditApp::CloseSplashScreen()
if (CStartupLogoDialog::instance())
{
delete CStartupLogoDialog::instance();
- g_splashScreenStateLock.Lock();
+ g_splashScreenStateLock.lock();
g_splashScreenState = eSplashScreenState_Destroy;
- g_splashScreenStateLock.Unlock();
+ g_splashScreenStateLock.unlock();
}
GetIEditor()->Notify(eNotify_OnSplashScreenDestroyed);
@@ -984,12 +981,12 @@ void CCryEditApp::CloseSplashScreen()
/////////////////////////////////////////////////////////////////////////////
void CCryEditApp::OutputStartupMessage(QString str)
{
- g_splashScreenStateLock.Lock();
+ g_splashScreenStateLock.lock();
if (g_pInitializeUIInfo)
{
g_pInitializeUIInfo->SetInfoText(str.toUtf8().data());
}
- g_splashScreenStateLock.Unlock();
+ g_splashScreenStateLock.unlock();
}
//////////////////////////////////////////////////////////////////////////
diff --git a/Code/Editor/EditorPreferencesPageViewportMovement.cpp b/Code/Editor/EditorPreferencesPageViewportMovement.cpp
index 1efe64488d..988b4954d1 100644
--- a/Code/Editor/EditorPreferencesPageViewportMovement.cpp
+++ b/Code/Editor/EditorPreferencesPageViewportMovement.cpp
@@ -68,45 +68,21 @@ QIcon& CEditorPreferencesPage_ViewportMovement::GetIcon()
void CEditorPreferencesPage_ViewportMovement::OnApply()
{
- if (SandboxEditor::UsingNewCameraSystem())
- {
- SandboxEditor::SetCameraTranslateSpeed(m_cameraMovementSettings.m_moveSpeed);
- SandboxEditor::SetCameraRotateSpeed(m_cameraMovementSettings.m_rotateSpeed);
- SandboxEditor::SetCameraBoostMultiplier(m_cameraMovementSettings.m_fastMoveSpeed);
- SandboxEditor::SetCameraScrollSpeed(m_cameraMovementSettings.m_wheelZoomSpeed);
- SandboxEditor::SetCameraOrbitYawRotationInverted(m_cameraMovementSettings.m_invertYRotation);
- SandboxEditor::SetCameraPanInvertedX(m_cameraMovementSettings.m_invertPan);
- SandboxEditor::SetCameraPanInvertedY(m_cameraMovementSettings.m_invertPan);
- }
- else
- {
- gSettings.cameraMoveSpeed = m_cameraMovementSettings.m_moveSpeed;
- gSettings.cameraRotateSpeed = m_cameraMovementSettings.m_rotateSpeed;
- gSettings.cameraFastMoveSpeed = m_cameraMovementSettings.m_fastMoveSpeed;
- gSettings.wheelZoomSpeed = m_cameraMovementSettings.m_wheelZoomSpeed;
- gSettings.invertYRotation = m_cameraMovementSettings.m_invertYRotation;
- gSettings.invertPan = m_cameraMovementSettings.m_invertPan;
- }
+ SandboxEditor::SetCameraTranslateSpeed(m_cameraMovementSettings.m_moveSpeed);
+ SandboxEditor::SetCameraRotateSpeed(m_cameraMovementSettings.m_rotateSpeed);
+ SandboxEditor::SetCameraBoostMultiplier(m_cameraMovementSettings.m_fastMoveSpeed);
+ SandboxEditor::SetCameraScrollSpeed(m_cameraMovementSettings.m_wheelZoomSpeed);
+ SandboxEditor::SetCameraOrbitYawRotationInverted(m_cameraMovementSettings.m_invertYRotation);
+ SandboxEditor::SetCameraPanInvertedX(m_cameraMovementSettings.m_invertPan);
+ SandboxEditor::SetCameraPanInvertedY(m_cameraMovementSettings.m_invertPan);
}
void CEditorPreferencesPage_ViewportMovement::InitializeSettings()
{
- if (SandboxEditor::UsingNewCameraSystem())
- {
- m_cameraMovementSettings.m_moveSpeed = SandboxEditor::CameraTranslateSpeed();
- m_cameraMovementSettings.m_rotateSpeed = SandboxEditor::CameraRotateSpeed();
- m_cameraMovementSettings.m_fastMoveSpeed = SandboxEditor::CameraBoostMultiplier();
- m_cameraMovementSettings.m_wheelZoomSpeed = SandboxEditor::CameraScrollSpeed();
- m_cameraMovementSettings.m_invertYRotation = SandboxEditor::CameraOrbitYawRotationInverted();
- m_cameraMovementSettings.m_invertPan = SandboxEditor::CameraPanInvertedX() && SandboxEditor::CameraPanInvertedY();
- }
- else
- {
- m_cameraMovementSettings.m_moveSpeed = gSettings.cameraMoveSpeed;
- m_cameraMovementSettings.m_rotateSpeed = gSettings.cameraRotateSpeed;
- m_cameraMovementSettings.m_fastMoveSpeed = gSettings.cameraFastMoveSpeed;
- m_cameraMovementSettings.m_wheelZoomSpeed = gSettings.wheelZoomSpeed;
- m_cameraMovementSettings.m_invertYRotation = gSettings.invertYRotation;
- m_cameraMovementSettings.m_invertPan = gSettings.invertPan;
- }
+ m_cameraMovementSettings.m_moveSpeed = SandboxEditor::CameraTranslateSpeed();
+ m_cameraMovementSettings.m_rotateSpeed = SandboxEditor::CameraRotateSpeed();
+ m_cameraMovementSettings.m_fastMoveSpeed = SandboxEditor::CameraBoostMultiplier();
+ m_cameraMovementSettings.m_wheelZoomSpeed = SandboxEditor::CameraScrollSpeed();
+ m_cameraMovementSettings.m_invertYRotation = SandboxEditor::CameraOrbitYawRotationInverted();
+ m_cameraMovementSettings.m_invertPan = SandboxEditor::CameraPanInvertedX() && SandboxEditor::CameraPanInvertedY();
}
diff --git a/Code/Editor/EditorViewportSettings.h b/Code/Editor/EditorViewportSettings.h
index 1898cf642a..b1488c5528 100644
--- a/Code/Editor/EditorViewportSettings.h
+++ b/Code/Editor/EditorViewportSettings.h
@@ -118,8 +118,4 @@ namespace SandboxEditor
SANDBOX_API AzFramework::InputChannelId CameraOrbitPanChannelId();
SANDBOX_API void SetCameraOrbitPanChannelId(AZStd::string_view cameraOrbitPanId);
-
- //! Return if the new editor camera system is enabled or not.
- //! @note This is implemented in EditorViewportWidget.cpp
- SANDBOX_API bool UsingNewCameraSystem();
} // namespace SandboxEditor
diff --git a/Code/Editor/EditorViewportWidget.cpp b/Code/Editor/EditorViewportWidget.cpp
index dd89d96dc3..28e8cce33e 100644
--- a/Code/Editor/EditorViewportWidget.cpp
+++ b/Code/Editor/EditorViewportWidget.cpp
@@ -72,7 +72,6 @@
#include "IPostEffectGroup.h"
#include "EditorPreferencesPageGeneral.h"
#include "ViewportManipulatorController.h"
-#include "LegacyViewportCameraController.h"
#include "EditorViewportSettings.h"
#include "ViewPane.h"
@@ -105,17 +104,8 @@
AZ_CVAR(
bool, ed_visibility_logTiming, false, nullptr, AZ::ConsoleFunctorFlags::Null, "Output the timing of the new IVisibilitySystem query");
-AZ_CVAR(bool, ed_useNewCameraSystem, true, nullptr, AZ::ConsoleFunctorFlags::Null, "Use the new Editor camera system");
AZ_CVAR(bool, ed_showCursorCameraLook, true, nullptr, AZ::ConsoleFunctorFlags::Null, "Show the cursor when using free look with the new camera system");
-namespace SandboxEditor
-{
- bool UsingNewCameraSystem()
- {
- return ed_useNewCameraSystem;
- }
-} // namespace SandboxEditor
-
EditorViewportWidget* EditorViewportWidget::m_pPrimaryViewport = nullptr;
#if AZ_TRAIT_OS_PLATFORM_APPLE
@@ -640,7 +630,7 @@ void EditorViewportWidget::OnEditorNotifyEvent(EEditorNotifyEvent event)
if (m_renderViewport)
{
- m_renderViewport->GetControllerList()->SetEnabled(true);
+ m_renderViewport->SetInputProcessingEnabled(true);
}
break;
@@ -1274,15 +1264,8 @@ void EditorViewportWidget::SetViewportId(int id)
m_renderViewport->GetControllerList()->Add(AZStd::make_shared());
- if (ed_useNewCameraSystem)
- {
- m_renderViewport->GetControllerList()->Add(CreateModularViewportCameraController(AzFramework::ViewportId(id)));
- }
- else
- {
- m_renderViewport->GetControllerList()->Add(AZStd::make_shared());
- }
-
+ m_renderViewport->GetControllerList()->Add(CreateModularViewportCameraController(AzFramework::ViewportId(id)));
+
m_renderViewport->SetViewportSettings(&g_EditorViewportSettings);
UpdateScene();
@@ -2239,7 +2222,6 @@ void EditorViewportWidget::CenterOnAABB(const AABB& aabb)
orbitDistance = fabs(orbitDistance);
SetViewTM(newTM);
- SandboxEditor::OrbitCameraControlsBus::Event(GetViewportId(), &SandboxEditor::OrbitCameraControlsBus::Events::SetOrbitDistance, orbitDistance);
}
void EditorViewportWidget::CenterOnSliceInstance()
@@ -2715,8 +2697,7 @@ void EditorViewportWidget::RestoreViewportAfterGameMode()
QString(
tr("When leaving \" Game Mode \" the engine will automatically restore your camera position to the default position before you "
"had entered Game mode.
If you dislike this setting you can always change this anytime in the global "
- "preferences.
"))
- .arg(EditorPreferencesGeneralRestoreViewportCameraSettingName);
+ "preferences.
"));
QString restoreOnExitGameModePopupDisabledRegKey("Editor/AutoHide/ViewportCameraRestoreOnExitGameMode");
// Read the popup disabled registry value
diff --git a/Code/Editor/GameEngine.h b/Code/Editor/GameEngine.h
index 829baec55a..4d183cc38e 100644
--- a/Code/Editor/GameEngine.h
+++ b/Code/Editor/GameEngine.h
@@ -20,7 +20,6 @@
#include "LogFile.h"
#include "CryListenerSet.h"
#include "Util/ModalWindowDismisser.h"
-#include
#endif
class CStartupLogoDialog;
@@ -117,11 +116,11 @@ public:
//! mutex used by other threads to lock up the PAK modification,
//! so only one thread can modify the PAK at once
- static CryMutex& GetPakModifyMutex()
+ static AZStd::recursive_mutex& GetPakModifyMutex()
{
//! mutex used to halt copy process while the export to game
//! or other pak operation is done in the main thread
- static CryMutex s_pakModifyMutex;
+ static AZStd::recursive_mutex s_pakModifyMutex;
return s_pakModifyMutex;
}
diff --git a/Code/Editor/GameExporter.cpp b/Code/Editor/GameExporter.cpp
index 2b157c0e14..415103e10d 100644
--- a/Code/Editor/GameExporter.cpp
+++ b/Code/Editor/GameExporter.cpp
@@ -136,7 +136,7 @@ bool CGameExporter::Export(unsigned int flags, [[maybe_unused]] EEndian eExportE
m_settings.SetHiQuality();
}
- CryAutoLock autoLock(CGameEngine::GetPakModifyMutex());
+ AZStd::scoped_lock autoLock(CGameEngine::GetPakModifyMutex());
// Close this pak file.
if (!CloseLevelPack(m_levelPak, true))
diff --git a/Code/Editor/GotoPositionDlg.cpp b/Code/Editor/GotoPositionDlg.cpp
index c1e64ed1a9..aec5f03fbd 100644
--- a/Code/Editor/GotoPositionDlg.cpp
+++ b/Code/Editor/GotoPositionDlg.cpp
@@ -108,24 +108,12 @@ void GotoPositionDialog::OnUpdateNumbers()
void GotoPositionDialog::accept()
{
- if (SandboxEditor::UsingNewCameraSystem())
- {
- SandboxEditor::InterpolateDefaultViewportCameraToTransform(
- AZ::Vector3(
- aznumeric_cast(m_ui->m_dymX->value()), aznumeric_cast(m_ui->m_dymY->value()),
- aznumeric_cast(m_ui->m_dymZ->value())),
- AZ::DegToRad(aznumeric_cast(m_ui->m_dymAnglePitch->value())),
- AZ::DegToRad(aznumeric_cast(m_ui->m_dymAngleYaw->value())));
- }
- else
- {
- SandboxEditor::SetDefaultViewportCameraPosition(AZ::Vector3(
+ SandboxEditor::InterpolateDefaultViewportCameraToTransform(
+ AZ::Vector3(
aznumeric_cast(m_ui->m_dymX->value()), aznumeric_cast(m_ui->m_dymY->value()),
- aznumeric_cast(m_ui->m_dymZ->value())));
- SandboxEditor::SetDefaultViewportCameraRotation(
- AZ::DegToRad(aznumeric_cast(m_ui->m_dymAnglePitch->value())),
- AZ::DegToRad(aznumeric_cast(m_ui->m_dymAngleYaw->value())));
- }
+ aznumeric_cast(m_ui->m_dymZ->value())),
+ AZ::DegToRad(aznumeric_cast(m_ui->m_dymAnglePitch->value())),
+ AZ::DegToRad(aznumeric_cast(m_ui->m_dymAngleYaw->value())));
QDialog::accept();
}
diff --git a/Code/Editor/IEditorImpl.cpp b/Code/Editor/IEditorImpl.cpp
index 2571e8542a..1459139f66 100644
--- a/Code/Editor/IEditorImpl.cpp
+++ b/Code/Editor/IEditorImpl.cpp
@@ -252,7 +252,7 @@ void CEditorImpl::Uninitialize()
void CEditorImpl::UnloadPlugins()
{
- CryAutoLock lock(m_pluginMutex);
+ AZStd::scoped_lock lock(m_pluginMutex);
// Flush core buses. We're about to unload DLLs and need to ensure we don't have module-owned functions left behind.
AZ::Data::AssetBus::ExecuteQueuedEvents();
@@ -273,7 +273,7 @@ void CEditorImpl::UnloadPlugins()
void CEditorImpl::LoadPlugins()
{
- CryAutoLock lock(m_pluginMutex);
+ AZStd::scoped_lock lock(m_pluginMutex);
static const QString editor_plugins_folder("EditorPlugins");
@@ -1460,7 +1460,7 @@ void CEditorImpl::UnregisterNotifyListener(IEditorNotifyListener* listener)
ISourceControl* CEditorImpl::GetSourceControl()
{
- CryAutoLock lock(m_pluginMutex);
+ AZStd::scoped_lock lock(m_pluginMutex);
if (m_pSourceControl)
{
diff --git a/Code/Editor/IEditorImpl.h b/Code/Editor/IEditorImpl.h
index db963e83f1..02be8bb8e3 100644
--- a/Code/Editor/IEditorImpl.h
+++ b/Code/Editor/IEditorImpl.h
@@ -401,7 +401,7 @@ protected:
IImageUtil* m_pImageUtil; // Vladimir@conffx
ILogFile* m_pLogFile; // Vladimir@conffx
- CryMutex m_pluginMutex; // protect any pointers that come from plugins, such as the source control cached pointer.
+ AZStd::mutex m_pluginMutex; // protect any pointers that come from plugins, such as the source control cached pointer.
static const char* m_crashLogFileName;
};
diff --git a/Code/Editor/LegacyViewportCameraController.cpp b/Code/Editor/LegacyViewportCameraController.cpp
deleted file mode 100644
index eb7323b423..0000000000
--- a/Code/Editor/LegacyViewportCameraController.cpp
+++ /dev/null
@@ -1,537 +0,0 @@
-/*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
-
-#include "LegacyViewportCameraController.h"
-
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-#include
-#include "CryCommon/MathConversion.h"
-#include "SandboxAPI.h"
-#include "Settings.h"
-
-namespace SandboxEditor
-{
-
-LegacyViewportCameraControllerInstance::LegacyViewportCameraControllerInstance(AzFramework::ViewportId viewportId, LegacyViewportCameraController* controller)
- : AzFramework::MultiViewportControllerInstanceInterface(viewportId, controller)
-{
- OrbitCameraControlsBus::Handler::BusConnect(viewportId);
-}
-
-LegacyViewportCameraControllerInstance::~LegacyViewportCameraControllerInstance()
-{
- OrbitCameraControlsBus::Handler::BusDisconnect();
-}
-
-bool LegacyViewportCameraControllerInstance::JustAltHeld() const
-{
- return (m_modifiers ^ Qt::AltModifier) == 0;
-}
-
-bool LegacyViewportCameraControllerInstance::NoModifierHeld() const
-{
- return !m_modifiers;
-}
-
-bool LegacyViewportCameraControllerInstance::AllowDolly() const
-{
- return JustAltHeld();
-}
-
-bool LegacyViewportCameraControllerInstance::AllowOrbit() const
-{
- return JustAltHeld();
-}
-
-bool LegacyViewportCameraControllerInstance::AllowPan() const
-{
- // begin pan with alt (inverted movement) or no modifiers
- return JustAltHeld() || NoModifierHeld();
-}
-
-bool LegacyViewportCameraControllerInstance::InvertPan() const
-{
- return JustAltHeld();
-}
-
-void LegacyViewportCameraControllerInstance::SetOrbitDistance(float orbitDistance)
-{
- m_orbitDistance = orbitDistance;
-}
-
-
-AZ::RPI::ViewportContextPtr LegacyViewportCameraControllerInstance::GetViewportContext()
-{
- // This could be cached, if needed
- auto viewportContextManager = AZ::Interface::Get();
- if (!viewportContextManager)
- {
- return {};
- }
- return viewportContextManager->GetViewportContextById(GetViewportId());
-}
-
-bool LegacyViewportCameraControllerInstance::HandleMouseMove(
- int dx, int dy)
-{
- if (dx == 0 && dy == 0)
- {
- return false;
- }
-
- auto viewportContext = GetViewportContext();
- if (!viewportContext)
- {
- return false;
- }
-
- float speedScale = gSettings.cameraMoveSpeed;
-
- if (m_modifiers & Qt::Key_Control)
- {
- speedScale *= gSettings.cameraFastMoveSpeed;
- }
-
- if (m_inMoveMode || m_inOrbitMode || m_inRotateMode || m_inZoomMode)
- {
- m_totalMouseMoveDelta += AZStd::abs(dx) + AZStd::abs(dy);
- }
-
- if ((m_inRotateMode && m_inMoveMode) || m_inZoomMode)
- {
- Matrix34 m = AZTransformToLYTransform(viewportContext->GetCameraTransform());
-
- Vec3 ydir = m.GetColumn1().GetNormalized();
- Vec3 pos = m.GetTranslation();
-
- const float posDelta = 0.2f * dy * speedScale;
- pos = pos - ydir * posDelta;
- m_orbitDistance = m_orbitDistance + posDelta;
- m_orbitDistance = fabs(m_orbitDistance);
-
- m.SetTranslation(pos);
- viewportContext->SetCameraTransform(LYTransformToAZTransform(m));
- return true;
- }
- else if (m_inRotateMode)
- {
- Ang3 angles(dy, 0, dx);
- angles = angles * 0.002f * gSettings.cameraRotateSpeed;
- if (gSettings.invertYRotation)
- {
- angles.x = -angles.x;
- }
- Matrix34 camtm = AZTransformToLYTransform(viewportContext->GetCameraTransform());
- Ang3 ypr = CCamera::CreateAnglesYPR(Matrix33(camtm));
- ypr.x += angles.z;
- ypr.y += angles.x;
-
- ypr.y = AZStd::clamp(ypr.y, -1.5f, 1.5f); // to keep rotation in reasonable range
- ypr.z = 0; // to have camera always upward
-
- camtm = Matrix34(CCamera::CreateOrientationYPR(ypr), camtm.GetTranslation());
- viewportContext->SetCameraTransform(LYTransformToAZTransform(camtm));
- return true;
- }
- else if (m_inMoveMode)
- {
- // Slide.
- Matrix34 m = AZTransformToLYTransform(viewportContext->GetCameraTransform());
- Vec3 xdir = m.GetColumn0().GetNormalized();
- Vec3 zdir = m.GetColumn2().GetNormalized();
-
- if (InvertPan())
- {
- xdir = -xdir;
- zdir = -zdir;
- }
-
- Vec3 pos = m.GetTranslation();
- pos += 0.1f * xdir * dx * speedScale + 0.1f * zdir * dy * speedScale;
- m.SetTranslation(pos);
-
- AZ::Transform transform = viewportContext->GetCameraTransform();
- transform.SetTranslation(LYVec3ToAZVec3(pos));
- viewportContext->SetCameraTransform(transform);
- return true;
- }
- else if (m_inOrbitMode)
- {
- Ang3 angles(dy, 0, dx);
- angles = angles * 0.002f * gSettings.cameraRotateSpeed;
-
- if (gSettings.invertPan)
- {
- angles.z = -angles.z;
- }
-
- Matrix34 m = AZTransformToLYTransform(viewportContext->GetCameraTransform());
- Ang3 ypr = CCamera::CreateAnglesYPR(Matrix33(m));
- ypr.x += angles.z;
- ypr.y = AZStd::clamp(ypr.y, -1.5f, 1.5f); // to keep rotation in reasonable range
- ypr.y += angles.x;
-
- Matrix33 rotateTM = CCamera::CreateOrientationYPR(ypr);
-
- Vec3 src = m.GetTranslation();
- Vec3 trg(m_orbitTarget.GetX(), m_orbitTarget.GetY(), m_orbitTarget.GetZ());
- float fCameraRadius = (trg - src).GetLength();
-
- // Calc new source.
- src = trg - rotateTM * Vec3(0, 1, 0) * fCameraRadius;
- Matrix34 camTM = rotateTM;
- camTM.SetTranslation(src);
-
- viewportContext->SetCameraTransform(LYTransformToAZTransform(camTM));
- return true;
- }
- return false;
-}
-
-bool LegacyViewportCameraControllerInstance::HandleMouseWheel(float zDelta)
-{
- auto viewportContext = GetViewportContext();
- if (!viewportContext)
- {
- return false;
- }
-
- Matrix34 m = AZTransformToLYTransform(viewportContext->GetCameraTransform());
- const Vec3 ydir = m.GetColumn1().GetNormalized();
-
- Vec3 pos = m.GetTranslation();
-
- const float posDelta = 0.01f * zDelta * gSettings.wheelZoomSpeed;
- pos += ydir * posDelta;
- m_orbitDistance = m_orbitDistance - posDelta;
- m_orbitDistance = fabs(m_orbitDistance);
-
- m.SetTranslation(pos);
- viewportContext->SetCameraTransform(LYTransformToAZTransform(m));
- return true;
-}
-
-bool LegacyViewportCameraControllerInstance::IsKeyDown(Qt::Key key) const
-{
- return m_pressedKeys.contains(key);
-}
-
-Qt::Key LegacyViewportCameraControllerInstance::GetKeyboardKey(const AzFramework::InputChannel& inputChannel)
-{
- using Key = AzFramework::InputDeviceKeyboard::Key;
- const auto& id = inputChannel.GetInputChannelId();
- if (id == Key::AlphanumericW)
- {
- return Qt::Key_W;
- }
- else if (id == Key::AlphanumericA)
- {
- return Qt::Key_A;
- }
- else if (id == Key::AlphanumericS)
- {
- return Qt::Key_S;
- }
- else if (id == Key::AlphanumericD)
- {
- return Qt::Key_D;
- }
- else if (id == Key::AlphanumericQ)
- {
- return Qt::Key_Q;
- }
- else if (id == Key::AlphanumericE)
- {
- return Qt::Key_E;
- }
- else if (id == Key::NavigationArrowUp)
- {
- return Qt::Key_Up;
- }
- else if (id == Key::NavigationArrowUp)
- {
- return Qt::Key_Down;
- }
- else if (id == Key::NavigationArrowUp)
- {
- return Qt::Key_Left;
- }
- else if (id == Key::NavigationArrowUp)
- {
- return Qt::Key_Right;
- }
- return Qt::Key_unknown;
-}
-
-Qt::KeyboardModifier LegacyViewportCameraControllerInstance::GetKeyboardModifier(const AzFramework::InputChannel& inputChannel)
-{
- using Key = AzFramework::InputDeviceKeyboard::Key;
- const auto& id = inputChannel.GetInputChannelId();
- if (id == Key::ModifierAltL || id == Key::ModifierAltR)
- {
- return Qt::KeyboardModifier::AltModifier;
- }
- if (id == Key::ModifierCtrlL || id == Key::ModifierCtrlR)
- {
- return Qt::KeyboardModifier::ControlModifier;
- }
- if (id == Key::ModifierShiftL || id == Key::ModifierShiftR)
- {
- return Qt::KeyboardModifier::ShiftModifier;
- }
- return Qt::KeyboardModifier::NoModifier;
-}
-
-bool LegacyViewportCameraControllerInstance::HandleInputChannelEvent(const AzFramework::ViewportControllerInputEvent& event)
-{
- using AzFramework::InputChannel;
- using MouseButton = AzFramework::InputDeviceMouse::Button;
- const auto& id = event.m_inputChannel.GetInputChannelId();
- const auto& state = event.m_inputChannel.GetState();
- bool shouldCaptureCursor = m_capturingCursor;
- bool shouldConsumeEvent = false;
-
- if (id == AzFramework::InputDeviceMouse::Movement::X || id == AzFramework::InputDeviceMouse::Movement::Y)
- {
- int dx = 0;
- int dy = 0;
- if (id == AzFramework::InputDeviceMouse::Movement::X)
- {
- dx = -aznumeric_cast(event.m_inputChannel.GetValue());
- }
- else
- {
- dy = -aznumeric_cast(event.m_inputChannel.GetValue());
- }
- return HandleMouseMove(dx, dy);
- }
- else if (id == MouseButton::Left)
- {
- if (state == InputChannel::State::Began)
- {
- if (AllowOrbit())
- {
- AzFramework::CameraState cameraState;
- AzToolsFramework::ViewportInteraction::ViewportInteractionRequestBus::EventResult(
- cameraState, event.m_viewportId,
- &AzToolsFramework::ViewportInteraction::ViewportInteractionRequestBus::Events::GetCameraState);
-
- m_inOrbitMode = true;
- m_orbitTarget = cameraState.m_position + cameraState.m_forward * m_orbitDistance;
-
- shouldConsumeEvent = true;
- shouldCaptureCursor = true;
- }
- }
- else if (state == InputChannel::State::Ended)
- {
- m_inOrbitMode = false;
- shouldCaptureCursor = false;
- }
- }
- else if (id == MouseButton::Right)
- {
- if (state == InputChannel::State::Began)
- {
- if (AllowDolly())
- {
- m_inZoomMode = true;
- }
- else
- {
- m_inRotateMode = true;
- }
-
- shouldCaptureCursor = true;
- // Record how much the cursor has been moved to see if we should own the mouse up event.
- m_totalMouseMoveDelta = 0;
- }
- else if (state == InputChannel::State::Ended)
- {
- m_inZoomMode = false;
- m_inRotateMode = false;
- // If we've moved the cursor more than a couple pixels, we should eat this mouse up event to prevent the context menu controller from seeing it.
- shouldConsumeEvent = m_totalMouseMoveDelta > 2;
- shouldCaptureCursor = false;
- }
- }
- else if (id == MouseButton::Middle)
- {
- if (state == InputChannel::State::Began)
- {
- if (AllowPan())
- {
- m_inMoveMode = true;
- shouldConsumeEvent = true;
- shouldCaptureCursor = true;
- }
- }
- else if (state == InputChannel::State::Ended)
- {
- m_inMoveMode = false;
- shouldCaptureCursor = false;
- }
- }
- else if (auto modifier = GetKeyboardModifier(event.m_inputChannel); modifier != Qt::KeyboardModifier::NoModifier)
- {
- if (state == InputChannel::State::Ended)
- {
- m_modifiers &= ~modifier;
- }
- else
- {
- m_modifiers |= modifier;
- }
- }
- else if (id == AzFramework::InputDeviceMouse::Movement::Z)
- {
- if (state == InputChannel::State::Began || state == InputChannel::State::Updated)
- {
- shouldConsumeEvent = HandleMouseWheel(event.m_inputChannel.GetValue());
- }
- }
- else if (auto key = GetKeyboardKey(event.m_inputChannel); key != Qt::Key_unknown)
- {
- if (!event.m_inputChannel.IsActive())
- {
- m_pressedKeys.erase(key);
- }
- else
- {
- m_pressedKeys.insert(key);
- shouldConsumeEvent = true;
- }
- }
-
- UpdateCursorCapture(shouldCaptureCursor);
-
- return shouldConsumeEvent;
-}
-
-void LegacyViewportCameraControllerInstance::UpdateCursorCapture(bool shouldCaptureCursor)
-{
- if (m_capturingCursor != shouldCaptureCursor)
- {
- if (shouldCaptureCursor)
- {
- AzToolsFramework::ViewportInteraction::ViewportMouseCursorRequestBus::Event(
- GetViewportId(),
- &AzToolsFramework::ViewportInteraction::ViewportMouseCursorRequestBus::Events::BeginCursorCapture
- );
- }
- else
- {
- AzToolsFramework::ViewportInteraction::ViewportMouseCursorRequestBus::Event(
- GetViewportId(),
- &AzToolsFramework::ViewportInteraction::ViewportMouseCursorRequestBus::Events::EndCursorCapture
- );
- }
-
- m_capturingCursor = shouldCaptureCursor;
- }
-}
-
-void LegacyViewportCameraControllerInstance::ResetInputChannels()
-{
- m_modifiers = 0;
- m_pressedKeys.clear();
- UpdateCursorCapture(false);
- m_inRotateMode = m_inMoveMode = m_inOrbitMode = m_inZoomMode = false;
-}
-
-void LegacyViewportCameraControllerInstance::UpdateViewport(const AzFramework::ViewportControllerUpdateEvent& event)
-{
- auto viewportContext = GetViewportContext();
- if (!viewportContext)
- {
- return;
- }
-
- AZ::Transform transform = viewportContext->GetCameraTransform();
- AZ::Vector3 xdir = transform.GetBasisX();
- AZ::Vector3 ydir = transform.GetBasisY();
- AZ::Vector3 zdir = transform.GetBasisZ();
-
- AZ::Vector3 pos = transform.GetTranslation();
-
- float speedScale = AZStd::GetMin(30.0f * event.m_deltaTime.count(), 20.0f);
-
- // Use the global modifier keys instead of our keymap. It's more reliable.
- const bool shiftPressed = m_modifiers & Qt::ShiftModifier;
- const bool controlPressed = m_modifiers & Qt::ControlModifier;
-
- speedScale *= gSettings.cameraMoveSpeed;
- if (controlPressed)
- {
- return;
- }
-
- if (shiftPressed)
- {
- speedScale *= gSettings.cameraFastMoveSpeed;
- }
-
- bool cameraMoved = false;
-
- if (IsKeyDown(Qt::Key_Up) || IsKeyDown(Qt::Key_W))
- {
- // move forward
- cameraMoved = true;
- pos = pos + (speedScale * m_moveSpeed * ydir);
- }
-
- if (IsKeyDown(Qt::Key_Down) || IsKeyDown(Qt::Key_S))
- {
- // move backward
- cameraMoved = true;
- pos = pos - (speedScale * m_moveSpeed * ydir);
- }
-
- if (IsKeyDown(Qt::Key_Left) || IsKeyDown(Qt::Key_A))
- {
- // move left
- cameraMoved = true;
- pos = pos - (speedScale * m_moveSpeed * xdir);
- }
-
- if (IsKeyDown(Qt::Key_Right) || IsKeyDown(Qt::Key_D))
- {
- // move right
- cameraMoved = true;
- pos = pos + (speedScale * m_moveSpeed * xdir);
- }
-
- if (IsKeyDown(Qt::Key_E))
- {
- // move Up
- cameraMoved = true;
- pos = pos + (speedScale * m_moveSpeed * zdir);
- }
-
- if (IsKeyDown(Qt::Key_Q))
- {
- // move down
- cameraMoved = true;
- pos = pos - (speedScale * m_moveSpeed * zdir);
- }
-
- if (cameraMoved)
- {
- transform.SetTranslation(pos);
- viewportContext->SetCameraTransform(transform);
- }
-}
-
-} //namespace SandboxEditor
diff --git a/Code/Editor/LegacyViewportCameraController.h b/Code/Editor/LegacyViewportCameraController.h
deleted file mode 100644
index 6edd344f23..0000000000
--- a/Code/Editor/LegacyViewportCameraController.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
-
-#pragma once
-
-#include
-#include
-#include
-#include
-
-#include
-
-#include
-#include
-
-namespace AzFramework
-{
- struct ScreenPoint;
-}
-
-namespace SandboxEditor
-{
- class OrbitCameraControls
- : public AZ::EBusTraits
- {
- public:
- //////////////////////////////////////////////////////////////////////////
- // EBusTraits overrides
- static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Multiple;
- static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById;
- using BusIdType = AzFramework::ViewportId;
- //////////////////////////////////////////////////////////////////////////
-
- virtual void SetOrbitDistance(float orbitDistance [[maybe_unused]]) {;}
- };
- using OrbitCameraControlsBus = AZ::EBus;
-
- class LegacyViewportCameraControllerInstance;
- using LegacyViewportCameraController = AzFramework::MultiViewportController;
-
- class LegacyViewportCameraControllerInstance final
- : public AzFramework::MultiViewportControllerInstanceInterface
- , public OrbitCameraControlsBus::Handler
- {
- public:
- LegacyViewportCameraControllerInstance(AzFramework::ViewportId viewport, LegacyViewportCameraController* controller);
- ~LegacyViewportCameraControllerInstance();
-
- bool HandleInputChannelEvent(const AzFramework::ViewportControllerInputEvent& event) override;
- void ResetInputChannels() override;
- void UpdateViewport(const AzFramework::ViewportControllerUpdateEvent& event) override;
-
- void SetOrbitDistance(float orbitDistance) override;
-
- private:
- bool JustAltHeld() const;
- bool NoModifierHeld() const;
- bool AllowDolly() const;
- bool AllowOrbit() const;
- bool AllowPan() const;
- bool InvertPan() const;
-
- static Qt::KeyboardModifier GetKeyboardModifier(const AzFramework::InputChannel& inputChannel);
- static Qt::Key GetKeyboardKey(const AzFramework::InputChannel& inputChannel);
-
- AZ::RPI::ViewportContextPtr GetViewportContext();
-
- bool HandleMouseMove(int dx, int dy);
- bool HandleMouseWheel(float zDelta);
- bool IsKeyDown(Qt::Key key) const;
- void UpdateCursorCapture(bool shouldCaptureCursor);
-
- bool m_inRotateMode = false;
- bool m_inMoveMode = false;
- bool m_inOrbitMode = false;
- bool m_inZoomMode = false;
- int m_totalMouseMoveDelta = 0;
- float m_orbitDistance = 10.f;
- float m_moveSpeed = 1.f;
- AZ::Vector3 m_orbitTarget = {};
- unsigned int m_modifiers = {};
- AZStd::unordered_set m_pressedKeys;
- bool m_capturingCursor = false;
- };
-
-} //namespace SandboxEditor
diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/SandboxIntegration.cpp b/Code/Editor/Plugins/ComponentEntityEditorPlugin/SandboxIntegration.cpp
index 072625936b..66c57361be 100644
--- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/SandboxIntegration.cpp
+++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/SandboxIntegration.cpp
@@ -1452,7 +1452,7 @@ void SandboxIntegrationManager::ContextMenu_NewEntity()
if (view)
{
const QPoint viewPoint(m_contextMenuViewPoint.GetX(), m_contextMenuViewPoint.GetY());
- worldPosition = LYVec3ToAZVec3(view->SnapToGrid(view->ViewToWorld(viewPoint)));
+ worldPosition = view->GetHitLocation(viewPoint);
}
CreateNewEntityAtPosition(worldPosition);
@@ -1704,74 +1704,44 @@ void SandboxIntegrationManager::GoToEntitiesInViewports(const AzToolsFramework::
return;
}
- if (SandboxEditor::UsingNewCameraSystem())
+ const AZ::Aabb aabb = AZStd::accumulate(
+ AZStd::begin(entityIds), AZStd::end(entityIds), AZ::Aabb::CreateNull(), [](AZ::Aabb acc, const AZ::EntityId entityId) {
+ const AZ::Aabb aabb = AzFramework::CalculateEntityWorldBoundsUnion(AzToolsFramework::GetEntityById(entityId));
+ acc.AddAabb(aabb);
+ return acc;
+ });
+
+ float radius;
+ AZ::Vector3 center;
+ aabb.GetAsSphere(center, radius);
+
+ // minimum center size is 40cm
+ const float minSelectionRadius = 0.4f;
+ const float selectionSize = AZ::GetMax(minSelectionRadius, radius);
+
+ auto viewportContextManager = AZ::Interface::Get();
+
+ const int viewCount = GetIEditor()->GetViewManager()->GetViewCount(); // legacy call
+ for (int viewIndex = 0; viewIndex < viewCount; ++viewIndex)
{
- const AZ::Aabb aabb = AZStd::accumulate(
- AZStd::begin(entityIds), AZStd::end(entityIds), AZ::Aabb::CreateNull(), [](AZ::Aabb acc, const AZ::EntityId entityId) {
- const AZ::Aabb aabb = AzFramework::CalculateEntityWorldBoundsUnion(AzToolsFramework::GetEntityById(entityId));
- acc.AddAabb(aabb);
- return acc;
- });
-
- float radius;
- AZ::Vector3 center;
- aabb.GetAsSphere(center, radius);
-
- // minimum center size is 40cm
- const float minSelectionRadius = 0.4f;
- const float selectionSize = AZ::GetMax(minSelectionRadius, radius);
-
- auto viewportContextManager = AZ::Interface::Get();
-
- const int viewCount = GetIEditor()->GetViewManager()->GetViewCount(); // legacy call
- for (int viewIndex = 0; viewIndex < viewCount; ++viewIndex)
+ if (auto viewportContext = viewportContextManager->GetViewportContextById(viewIndex))
{
- if (auto viewportContext = viewportContextManager->GetViewportContextById(viewIndex))
- {
- const AZ::Transform cameraTransform = viewportContext->GetCameraTransform();
- const AZ::Vector3 forward = (center - cameraTransform.GetTranslation()).GetNormalized();
+ const AZ::Transform cameraTransform = viewportContext->GetCameraTransform();
+ const AZ::Vector3 forward = (center - cameraTransform.GetTranslation()).GetNormalized();
- // move camera 25% further back than required
- const float centerScale = 1.25f;
- // compute new camera transform
- const float fov = AzFramework::RetrieveFov(viewportContext->GetCameraProjectionMatrix());
- const float fovScale = (1.0f / AZStd::tan(fov * 0.5f));
- const float distanceToLookAt = selectionSize * fovScale * centerScale;
- const AZ::Transform nextCameraTransform =
- AZ::Transform::CreateLookAt(aabb.GetCenter() - (forward * distanceToLookAt), aabb.GetCenter());
+ // move camera 25% further back than required
+ const float centerScale = 1.25f;
+ // compute new camera transform
+ const float fov = AzFramework::RetrieveFov(viewportContext->GetCameraProjectionMatrix());
+ const float fovScale = (1.0f / AZStd::tan(fov * 0.5f));
+ const float distanceToLookAt = selectionSize * fovScale * centerScale;
+ const AZ::Transform nextCameraTransform =
+ AZ::Transform::CreateLookAt(aabb.GetCenter() - (forward * distanceToLookAt), aabb.GetCenter());
- AtomToolsFramework::ModularViewportCameraControllerRequestBus::Event(
- viewportContext->GetId(),
- &AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::InterpolateToTransform, nextCameraTransform,
- distanceToLookAt);
- }
- }
- }
- else
- {
- AABB selectionBounds;
- selectionBounds.Reset();
- bool entitiesAvailableForGoTo = false;
-
- for (const AZ::EntityId& entityId : entityIds)
- {
- if (CollectEntityBoundingBoxesForZoom(entityId, selectionBounds))
- {
- entitiesAvailableForGoTo = true;
- }
- }
-
- if (entitiesAvailableForGoTo)
- {
- int numViews = GetIEditor()->GetViewManager()->GetViewCount();
- for (int viewIndex = 0; viewIndex < numViews; ++viewIndex)
- {
- CViewport* viewport = GetIEditor()->GetViewManager()->GetView(viewIndex);
- if (viewport)
- {
- viewport->CenterOnAABB(selectionBounds);
- }
- }
+ AtomToolsFramework::ModularViewportCameraControllerRequestBus::Event(
+ viewportContext->GetId(),
+ &AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::InterpolateToTransform, nextCameraTransform,
+ distanceToLookAt);
}
}
}
diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerTreeView.cpp b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerTreeView.cpp
index 017f59cdc3..158e45d6e2 100644
--- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerTreeView.cpp
+++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerTreeView.cpp
@@ -20,7 +20,7 @@
#include
OutlinerTreeView::OutlinerTreeView(QWidget* pParent)
- : QTreeView(pParent)
+ : AzQtComponents::StyledTreeView(pParent)
, m_queuedMouseEvent(nullptr)
, m_draggingUnselectedItem(false)
{
@@ -135,16 +135,12 @@ void OutlinerTreeView::startDrag(Qt::DropActions supportedActions)
if (!selectionModel()->isSelected(index))
{
- startCustomDrag({ index }, supportedActions);
+ StartCustomDrag({ index }, supportedActions);
return;
}
}
- if (!selectionModel()->selectedIndexes().empty())
- {
- startCustomDrag(selectionModel()->selectedIndexes(), supportedActions);
- return;
- }
+ StyledTreeView::startDrag(supportedActions);
}
void OutlinerTreeView::dragMoveEvent(QDragMoveEvent* event)
@@ -336,14 +332,14 @@ void OutlinerTreeView::processQueuedMousePressedEvent(QMouseEvent* event)
QTreeView::mousePressEvent(&mousePressedEvent);
}
-void OutlinerTreeView::startCustomDrag(const QModelIndexList& indexList, Qt::DropActions supportedActions)
+void OutlinerTreeView::StartCustomDrag(const QModelIndexList& indexList, Qt::DropActions supportedActions)
{
m_draggingUnselectedItem = true;
//sort by container entity depth and order in hierarchy for proper drag image and drop order
QModelIndexList indexListSorted = indexList;
AZStd::unordered_map> locations;
- for (auto index : indexListSorted)
+ for (const auto& index : indexListSorted)
{
AZ::EntityId entityId(index.data(OutlinerListModel::EntityIdRole).value());
AzToolsFramework::GetEntityLocationInHierarchy(entityId, locations[entityId]);
@@ -356,74 +352,7 @@ void OutlinerTreeView::startCustomDrag(const QModelIndexList& indexList, Qt::Dro
return AZStd::lexicographical_compare(locationsE1.begin(), locationsE1.end(), locationsE2.begin(), locationsE2.end());
});
- //get the data for the unselected item(s)
- QMimeData* mimeData = model()->mimeData(indexListSorted);
- if (mimeData)
- {
- //initiate drag/drop for the item
- QDrag* drag = new QDrag(this);
- drag->setPixmap(QPixmap::fromImage(createDragImage(indexListSorted)));
- drag->setMimeData(mimeData);
- Qt::DropAction defDropAction = Qt::IgnoreAction;
- if (defaultDropAction() != Qt::IgnoreAction && (supportedActions & defaultDropAction()))
- {
- defDropAction = defaultDropAction();
- }
- else if (supportedActions & Qt::CopyAction && dragDropMode() != QAbstractItemView::InternalMove)
- {
- defDropAction = Qt::CopyAction;
- }
- drag->exec(supportedActions, defDropAction);
- }
-}
-
-QImage OutlinerTreeView::createDragImage(const QModelIndexList& indexList)
-{
- //generate a drag image of the item icon and text, normally done internally, and inaccessible
- QRect rect(0, 0, 0, 0);
- for (auto index : indexList)
- {
- if (index.column() != 0)
- {
- continue;
- }
- QRect itemRect = visualRect(index);
- rect.setHeight(rect.height() + itemRect.height());
- rect.setWidth(AZStd::GetMax(rect.width(), itemRect.width()));
- }
-
- QImage dragImage(rect.size(), QImage::Format_ARGB32_Premultiplied);
-
- QPainter dragPainter(&dragImage);
- dragPainter.setCompositionMode(QPainter::CompositionMode_Source);
- dragPainter.fillRect(dragImage.rect(), Qt::transparent);
- dragPainter.setCompositionMode(QPainter::CompositionMode_SourceOver);
- dragPainter.setOpacity(0.35f);
- dragPainter.fillRect(rect, QColor("#222222"));
- dragPainter.setOpacity(1.0f);
-
- int imageY = 0;
- for (auto index : indexList)
- {
- if (index.column() != 0)
- {
- continue;
- }
-
- QRect itemRect = visualRect(index);
- dragPainter.drawPixmap(QPoint(0, imageY),
- model()->data(index, Qt::DecorationRole).value().pixmap(QSize(16, 16)));
- dragPainter.setPen(
- model()->data(index, Qt::ForegroundRole).value().color());
- dragPainter.setFont(
- font());
- dragPainter.drawText(QRect(20, imageY, rect.width() - 20, rect.height()),
- model()->data(index, Qt::DisplayRole).value());
- imageY += itemRect.height();
- }
-
- dragPainter.end();
- return dragImage;
+ StyledTreeView::StartCustomDrag(indexListSorted, supportedActions);
}
#include
diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerTreeView.hxx b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerTreeView.hxx
index fe7a494be4..b597b70092 100644
--- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerTreeView.hxx
+++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerTreeView.hxx
@@ -15,7 +15,8 @@
#include
#include
-#include
+
+#include
#endif
#pragma once
@@ -31,7 +32,7 @@ class OutlinerTreeViewModel;
//! allow for dragging and dropping of entities from the outliner into the property editor
//! of other entities. If the selection updates instantly, this would never be possible.
class OutlinerTreeView
- : public QTreeView
+ : public AzQtComponents::StyledTreeView
{
Q_OBJECT;
public:
@@ -66,9 +67,7 @@ private:
void processQueuedMousePressedEvent(QMouseEvent* event);
- void startCustomDrag(const QModelIndexList& indexList, Qt::DropActions supportedActions);
-
- QImage createDragImage(const QModelIndexList& indexList);
+ void StartCustomDrag(const QModelIndexList& indexList, Qt::DropActions supportedActions) override;
void DrawLayerUI(QPainter* painter, const QRect& rect, const QModelIndex& index) const;
diff --git a/Code/Editor/Plugins/PerforcePlugin/PerforceSourceControl.cpp b/Code/Editor/Plugins/PerforcePlugin/PerforceSourceControl.cpp
index 1ea70e8c22..10c43c3d1b 100644
--- a/Code/Editor/Plugins/PerforcePlugin/PerforceSourceControl.cpp
+++ b/Code/Editor/Plugins/PerforcePlugin/PerforceSourceControl.cpp
@@ -9,7 +9,6 @@
#include "CryFile.h"
#include "PerforceSourceControl.h"
#include "PasswordDlg.h"
-#include
#include
#include
@@ -23,7 +22,7 @@
namespace
{
- CryCriticalSection g_cPerforceValues;
+ AZStd::mutex g_cPerforceValues;
}
////////////////////////////////////////////////////////////
@@ -31,9 +30,9 @@ ULONG STDMETHODCALLTYPE CPerforceSourceControl::Release()
{
if ((--m_ref) == 0)
{
- g_cPerforceValues.Lock();
+ g_cPerforceValues.lock();
delete this;
- g_cPerforceValues.Unlock();
+ g_cPerforceValues.unlock();
return 0;
}
else
@@ -57,7 +56,7 @@ void CPerforceSourceControl::ShowSettings()
void CPerforceSourceControl::SetSourceControlState(SourceControlState state)
{
- CryAutoLock lock(g_cPerforceValues);
+ AZStd::scoped_lock lock(g_cPerforceValues);
switch (state)
{
diff --git a/Code/Editor/Util/FileUtil.h b/Code/Editor/Util/FileUtil.h
index d4c9ebdd06..5820c32081 100644
--- a/Code/Editor/Util/FileUtil.h
+++ b/Code/Editor/Util/FileUtil.h
@@ -9,7 +9,6 @@
#pragma once
-#include "CryThread.h"
#include "../Include/SandboxAPI.h"
#include
#include
diff --git a/Code/Editor/Util/Variable.h b/Code/Editor/Util/Variable.h
index 83afee0924..ecd54e42ae 100644
--- a/Code/Editor/Util/Variable.h
+++ b/Code/Editor/Util/Variable.h
@@ -22,6 +22,8 @@ AZ_PUSH_DISABLE_WARNING(4458, "-Wunknown-warning-option")
AZ_POP_DISABLE_WARNING
#include
+#include
+
inline const char* to_c_str(const char* str) { return str; }
#define MAX_VAR_STRING_LENGTH 4096
diff --git a/Code/Editor/Viewport.cpp b/Code/Editor/Viewport.cpp
index 2bc1b21216..873f555c80 100644
--- a/Code/Editor/Viewport.cpp
+++ b/Code/Editor/Viewport.cpp
@@ -46,24 +46,7 @@ void QtViewport::BuildDragDropContext(AzQtComponents::ViewportDragContext& conte
PreWidgetRendering(); // required so that the current render cam is set.
- Vec3 pos = Vec3(ZERO);
- HitContext hit;
- if (HitTest(pt, hit))
- {
- pos = hit.raySrc + hit.rayDir * hit.dist;
- pos = SnapToGrid(pos);
- }
- else
- {
- bool hitTerrain;
- pos = ViewToWorld(pt, &hitTerrain);
- if (hitTerrain)
- {
- pos.z = GetIEditor()->GetTerrainElevation(pos.x, pos.y);
- }
- pos = SnapToGrid(pos);
- }
- context.m_hitLocation = AZ::Vector3(pos.x, pos.y, pos.z);
+ context.m_hitLocation = GetHitLocation(pt);
PostWidgetRendering();
}
@@ -1154,6 +1137,29 @@ bool QtViewport::HitTest(const QPoint& point, HitContext& hitInfo)
return false;
}
+AZ::Vector3 QtViewport::GetHitLocation(const QPoint& point)
+{
+ Vec3 pos = Vec3(ZERO);
+ HitContext hit;
+ if (HitTest(point, hit))
+ {
+ pos = hit.raySrc + hit.rayDir * hit.dist;
+ pos = SnapToGrid(pos);
+ }
+ else
+ {
+ bool hitTerrain;
+ pos = ViewToWorld(point, &hitTerrain);
+ if (hitTerrain)
+ {
+ pos.z = GetIEditor()->GetTerrainElevation(pos.x, pos.y);
+ }
+ pos = SnapToGrid(pos);
+ }
+
+ return AZ::Vector3(pos.x, pos.y, pos.z);
+}
+
//////////////////////////////////////////////////////////////////////////
void QtViewport::SetZoomFactor(float fZoomFactor)
{
diff --git a/Code/Editor/Viewport.h b/Code/Editor/Viewport.h
index 823b8c77b1..6b5bfb5c34 100644
--- a/Code/Editor/Viewport.h
+++ b/Code/Editor/Viewport.h
@@ -201,6 +201,7 @@ public:
//! Performs hit testing of 2d point in view to find which object hit.
virtual bool HitTest(const QPoint& point, HitContext& hitInfo) = 0;
+ virtual AZ::Vector3 GetHitLocation(const QPoint& point) = 0;
virtual void MakeConstructionPlane(int axis) = 0;
@@ -436,6 +437,7 @@ public:
//! Performs hit testing of 2d point in view to find which object hit.
bool HitTest(const QPoint& point, HitContext& hitInfo) override;
+ AZ::Vector3 GetHitLocation(const QPoint& point) override;
//! Do 2D hit testing of line in world space.
// pToCameraDistance is an optional output parameter in which distance from the camera to the line is returned.
diff --git a/Code/Editor/ViewportTitleDlg.cpp b/Code/Editor/ViewportTitleDlg.cpp
index 530e11b01b..f5515b9c18 100644
--- a/Code/Editor/ViewportTitleDlg.cpp
+++ b/Code/Editor/ViewportTitleDlg.cpp
@@ -172,8 +172,7 @@ void CViewportTitleDlg::SetupCameraDropdownMenu()
cameraSpeedActionWidget->setDefaultWidget(cameraSpeedContainer);
// Save off the move speed here since setting up the combo box can cause it to update values in the background.
- const float cameraMoveSpeed = SandboxEditor::UsingNewCameraSystem() ? SandboxEditor::CameraTranslateSpeed() : gSettings.cameraMoveSpeed;
-
+ const float cameraMoveSpeed = SandboxEditor::CameraTranslateSpeed();
// Populate the presets in the ComboBox
for (float presetValue : m_speedPresetValues)
{
@@ -947,21 +946,13 @@ void CViewportTitleDlg::OnSpeedComboBoxEnter()
void CViewportTitleDlg::OnUpdateMoveSpeedText(const QString& text)
{
- if (SandboxEditor::UsingNewCameraSystem())
- {
- SandboxEditor::SetCameraTranslateSpeed(aznumeric_cast(Round(text.toDouble(), m_speedStep)));
- }
- else
- {
- gSettings.cameraMoveSpeed = aznumeric_cast(Round(text.toDouble(), m_speedStep));
- }
+ SandboxEditor::SetCameraTranslateSpeed(aznumeric_cast(Round(text.toDouble(), m_speedStep)));
}
void CViewportTitleDlg::CheckForCameraSpeedUpdate()
{
- if (const float currentCameraMoveSpeed =
- SandboxEditor::UsingNewCameraSystem() ? SandboxEditor::CameraTranslateSpeed() : gSettings.cameraMoveSpeed;
- currentCameraMoveSpeed != m_prevMoveSpeed && !m_cameraSpeed->lineEdit()->hasFocus())
+ const float currentCameraMoveSpeed = SandboxEditor::CameraTranslateSpeed();
+ if (currentCameraMoveSpeed != m_prevMoveSpeed && !m_cameraSpeed->lineEdit()->hasFocus())
{
m_prevMoveSpeed = currentCameraMoveSpeed;
SetSpeedComboBox(currentCameraMoveSpeed);
diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake
index 4ad2ef23b9..4b80a5d461 100644
--- a/Code/Editor/editor_lib_files.cmake
+++ b/Code/Editor/editor_lib_files.cmake
@@ -799,8 +799,6 @@ set(FILES
EditorViewportCamera.h
ViewportManipulatorController.cpp
ViewportManipulatorController.h
- LegacyViewportCameraController.cpp
- LegacyViewportCameraController.h
TopRendererWnd.cpp
TopRendererWnd.h
ViewManager.cpp
diff --git a/Code/Framework/AzCore/AzCore/EBus/Event.h b/Code/Framework/AzCore/AzCore/EBus/Event.h
index b3c29b63a2..00310f4dbc 100644
--- a/Code/Framework/AzCore/AzCore/EBus/Event.h
+++ b/Code/Framework/AzCore/AzCore/EBus/Event.h
@@ -58,6 +58,12 @@ namespace AZ
Event& operator=(Event&& rhs);
+ //! Take the handlers registered with the other event
+ //! and move them to this event. The other will event
+ //! will be cleared after call
+ //! @param other event to move handlers
+ Event& ClaimHandlers(Event&& other);
+
//! Returns true if at least one handler is connected to this event.
bool HasHandlerConnected() const;
diff --git a/Code/Framework/AzCore/AzCore/EBus/Event.inl b/Code/Framework/AzCore/AzCore/EBus/Event.inl
index dfb1781991..ffa8c8b9c5 100644
--- a/Code/Framework/AzCore/AzCore/EBus/Event.inl
+++ b/Code/Framework/AzCore/AzCore/EBus/Event.inl
@@ -207,6 +207,32 @@ namespace AZ
}
+ template
+ auto Event::ClaimHandlers(Event&& other) -> Event&
+ {
+ auto handlers = AZStd::move(other.m_handlers);
+ auto addList = AZStd::move(other.m_addList);
+ other.m_freeList = {};
+ other.m_updating = false;
+
+ AZStd::array handlerContainers{ &handlers, &addList };
+ for (AZStd::vector* handlerList : handlerContainers)
+ {
+ for (Handler* handler : *handlerList)
+ {
+ if (handler != nullptr)
+ {
+ handler->m_index = 0;
+ handler->m_event = this;
+ Connect(*handler);
+ }
+ }
+ }
+
+ return *this;
+ }
+
+
template
bool Event::HasHandlerConnected() const
{
diff --git a/Code/Framework/AzCore/AzCore/Settings/SettingsRegistryImpl.cpp b/Code/Framework/AzCore/AzCore/Settings/SettingsRegistryImpl.cpp
index 8b10013408..6864dcd1c8 100644
--- a/Code/Framework/AzCore/AzCore/Settings/SettingsRegistryImpl.cpp
+++ b/Code/Framework/AzCore/AzCore/Settings/SettingsRegistryImpl.cpp
@@ -20,7 +20,7 @@
namespace AZ
{
template
- bool SettingsRegistryImpl::SetValueInternal(AZStd::string_view path, T value, SettingsRegistryInterface::Type type)
+ bool SettingsRegistryImpl::SetValueInternal(AZStd::string_view path, T value)
{
if (path.empty())
{
@@ -56,7 +56,6 @@ namespace AZ
static_assert(!AZStd::is_same_v, "SettingsRegistryImpl::SetValueInternal called with unsupported type.");
}
- m_notifiers.Signal(path, type);
return true;
}
return false;
@@ -157,11 +156,11 @@ namespace AZ
// Setting to empty string to prevent assert
path = "";
}
- AZStd::scoped_lock lock(m_settingMutex);
rapidjson::Pointer pointer(path.data(), path.length());
if (pointer.IsValid())
{
+ AZStd::scoped_lock lock(m_settingMutex);
const rapidjson::Value* value = pointer.Get(m_settings);
if (value)
{
@@ -207,7 +206,7 @@ namespace AZ
{
NotifyEventHandler notifyHandler{ callback };
{
- AZStd::scoped_lock lock(m_settingMutex);
+ AZStd::scoped_lock lock(m_notifierMutex);
notifyHandler.Connect(m_notifiers);
}
return notifyHandler;
@@ -217,7 +216,7 @@ namespace AZ
{
NotifyEventHandler notifyHandler{ AZStd::move(callback) };
{
- AZStd::scoped_lock lock(m_settingMutex);
+ AZStd::scoped_lock lock(m_notifierMutex);
notifyHandler.Connect(m_notifiers);
}
return notifyHandler;
@@ -225,7 +224,7 @@ namespace AZ
void SettingsRegistryImpl::ClearNotifiers()
{
- AZStd::scoped_lock lock(m_settingMutex);
+ AZStd::scoped_lock lock(m_notifierMutex);
m_notifiers.DisconnectAllHandlers();
}
@@ -276,6 +275,31 @@ namespace AZ
m_postMergeEvent.DisconnectAllHandlers();
}
+ void SettingsRegistryImpl::SignalNotifier(AZStd::string_view jsonPath, Type type)
+ {
+ // Move the Notifier AZ::Event to a local AZ::Event in order to allow
+ // the notifier handlers to be signaled outside of the notifier mutex
+ // This allows other threads to register notifiers while this thread
+ // is invoking the handlers
+ decltype(m_notifiers) localNotifierEvent;
+ {
+ AZStd::scoped_lock lock(m_notifierMutex);
+ localNotifierEvent = AZStd::move(m_notifiers);
+ }
+
+ localNotifierEvent.Signal(jsonPath, type);
+
+ {
+ // Swap the local handlers with the current m_notifiers which
+ // will contain any handlers added during the signaling of the
+ // local event
+ AZStd::scoped_lock lock(m_notifierMutex);
+ AZStd::swap(m_notifiers, localNotifierEvent);
+ // Append any added handlers to the m_notifier structure
+ m_notifiers.ClaimHandlers(AZStd::move(localNotifierEvent));
+ }
+ }
+
SettingsRegistryInterface::Type SettingsRegistryImpl::GetType(AZStd::string_view path) const
{
if (path.empty())
@@ -286,11 +310,11 @@ namespace AZ
path = "";
}
- AZStd::scoped_lock lock(m_settingMutex);
rapidjson::Pointer pointer(path.data(), path.length());
if (pointer.IsValid())
{
+ AZStd::scoped_lock lock(m_settingMutex);
const rapidjson::Value* value = pointer.Get(m_settings);
if (value)
{
@@ -363,11 +387,11 @@ namespace AZ
// Setting to empty string to prevent assert
path = "";
}
- AZStd::scoped_lock lock(m_settingMutex);
rapidjson::Pointer pointer(path.data(), path.length());
if (pointer.IsValid())
{
+ AZStd::scoped_lock lock(m_settingMutex);
const rapidjson::Value* value = pointer.Get(m_settings);
if (value)
{
@@ -380,32 +404,52 @@ namespace AZ
bool SettingsRegistryImpl::Set(AZStd::string_view path, bool value)
{
- AZStd::scoped_lock lock(m_settingMutex);
- return SetValueInternal(path, value, Type::Boolean);
+ if (AZStd::scoped_lock lock(m_settingMutex); !SetValueInternal(path, value))
+ {
+ return false;
+ }
+ SignalNotifier(path, Type::Boolean);
+ return true;
}
bool SettingsRegistryImpl::Set(AZStd::string_view path, s64 value)
{
- AZStd::scoped_lock lock(m_settingMutex);
- return SetValueInternal(path, value, Type::Integer);
+ if (AZStd::scoped_lock lock(m_settingMutex); !SetValueInternal(path, value))
+ {
+ return false;
+ }
+ SignalNotifier(path, Type::Integer);
+ return true;
}
bool SettingsRegistryImpl::Set(AZStd::string_view path, u64 value)
{
- AZStd::scoped_lock lock(m_settingMutex);
- return SetValueInternal(path, value, Type::Integer);
+ if (AZStd::scoped_lock lock(m_settingMutex); !SetValueInternal(path, value))
+ {
+ return false;
+ }
+ SignalNotifier(path, Type::Integer);
+ return true;
}
bool SettingsRegistryImpl::Set(AZStd::string_view path, double value)
{
- AZStd::scoped_lock lock(m_settingMutex);
- return SetValueInternal(path, value, Type::FloatingPoint);
+ if (AZStd::scoped_lock lock(m_settingMutex); !SetValueInternal(path, value))
+ {
+ return false;
+ }
+ SignalNotifier(path, Type::FloatingPoint);
+ return true;
}
bool SettingsRegistryImpl::Set(AZStd::string_view path, AZStd::string_view value)
{
- AZStd::scoped_lock lock(m_settingMutex);
- return SetValueInternal(path, value, Type::String);
+ if (AZStd::scoped_lock lock(m_settingMutex); !SetValueInternal(path, value))
+ {
+ return false;
+ }
+ SignalNotifier(path, Type::String);
+ return true;
}
bool SettingsRegistryImpl::Set(AZStd::string_view path, const char* value)
@@ -423,7 +467,6 @@ namespace AZ
path = "";
}
- AZStd::scoped_lock lock(m_settingMutex);
rapidjson::Pointer pointer(path.data(), path.length());
if (pointer.IsValid())
@@ -433,9 +476,10 @@ namespace AZ
value, nullptr, valueTypeID, m_serializationSettings);
if (jsonResult.GetProcessing() != JsonSerializationResult::Processing::Halted)
{
+ AZStd::scoped_lock lock(m_settingMutex);
rapidjson::Value& setting = pointer.Create(m_settings, m_settings.GetAllocator());
setting = AZStd::move(store);
- m_notifiers.Signal(path, Type::Object);
+ SignalNotifier(path, Type::Object);
return true;
}
}
@@ -451,13 +495,13 @@ namespace AZ
// Setting to empty string to prevent assert
path = "";
}
- AZStd::scoped_lock lock(m_settingMutex);
rapidjson::Pointer pointerPath(path.data(), path.size());
if (!pointerPath.IsValid())
{
return false;
}
+ AZStd::scoped_lock lock(m_settingMutex);
return pointerPath.Erase(m_settings);
}
@@ -587,7 +631,7 @@ namespace AZ
return false;
}
- m_notifiers.Signal("", Type::Object);
+ SignalNotifier("", Type::Object);
return true;
}
@@ -609,8 +653,6 @@ namespace AZ
scratchBuffer = &buffer;
}
- AZStd::scoped_lock lock(m_settingMutex);
-
bool result = false;
if (path[path.length()] == 0)
{
@@ -624,6 +666,8 @@ namespace AZ
R"(Path "%.*s" is too long. Either make sure that the provided path is terminated or use a shorter path.)",
static_cast(path.length()), path.data());
Pointer pointer(AZ_SETTINGS_REGISTRY_HISTORY_KEY "/-");
+
+ AZStd::scoped_lock lock(m_settingMutex);
Value pathValue(path.data(), aznumeric_caster(path.length()), m_settings.GetAllocator());
pointer.Create(m_settings, m_settings.GetAllocator()).SetObject()
.AddMember(StringRef("Error"), StringRef("Unable to read registry file."), m_settings.GetAllocator())
@@ -669,6 +713,7 @@ namespace AZ
{
AZ_Error("Settings Registry", false, "Folder path for the Setting Registry is too long: %.*s",
static_cast(path.size()), path.data());
+ AZStd::scoped_lock lock(m_settingMutex);
pointer.Create(m_settings, m_settings.GetAllocator()).SetObject()
.AddMember(StringRef("Error"), StringRef("Folder path for the Setting Registry is too long."), m_settings.GetAllocator())
.AddMember(StringRef("Path"), Value(path.data(), aznumeric_caster(path.length()), m_settings.GetAllocator()), m_settings.GetAllocator());
@@ -706,6 +751,7 @@ namespace AZ
if (fileList.size() >= MaxRegistryFolderEntries)
{
AZ_Error("Settings Registry", false, "Too many files in registry folder.");
+ AZStd::scoped_lock lock(m_settingMutex);
pointer.Create(m_settings, m_settings.GetAllocator()).SetObject()
.AddMember(StringRef("Error"), StringRef("Too many files in registry folder."), m_settings.GetAllocator())
.AddMember(StringRef("Path"), Value(folderPath.c_str(), aznumeric_caster(folderPath.size()), m_settings.GetAllocator()), m_settings.GetAllocator())
@@ -725,7 +771,6 @@ namespace AZ
SystemFile::FindFiles(folderPath.c_str(), callback);
- AZStd::scoped_lock lock(m_settingMutex);
if (!platform.empty())
{
// Move the folderPath prefix back to the supplied path before the wildcard
@@ -743,6 +788,7 @@ namespace AZ
if (fileList.size() >= MaxRegistryFolderEntries)
{
AZ_Error("Settings Registry", false, "Too many files in registry folder.");
+ AZStd::scoped_lock lock(m_settingMutex);
pointer.Create(m_settings, m_settings.GetAllocator()).SetObject()
.AddMember(StringRef("Error"), StringRef("Too many files in registry folder."), m_settings.GetAllocator())
.AddMember(StringRef("Path"), Value(folderPath.c_str(), aznumeric_caster(folderPath.size()), m_settings.GetAllocator()), m_settings.GetAllocator())
@@ -970,6 +1016,8 @@ namespace AZ
collisionFound = true;
AZ_Error("Settings Registry", false, R"(Two registry files in "%.*s" point to the same specialization: "%s" and "%s")",
AZ_STRING_ARG(folderPath), lhs.m_relativePath.c_str(), rhs.m_relativePath.c_str());
+
+ AZStd::scoped_lock lock(m_settingMutex);
historyPointer.Create(m_settings, m_settings.GetAllocator()).SetObject()
.AddMember(StringRef("Error"), StringRef("Too many files in registry folder."), m_settings.GetAllocator())
.AddMember(StringRef("Path"),
@@ -1124,6 +1172,7 @@ namespace AZ
}
}
+ AZStd::scoped_lock lock(m_settingMutex);
pointer.Create(m_settings, m_settings.GetAllocator()).SetObject()
.AddMember(StringRef("Error"), StringRef("Unable to parse registry file due to invalid json."), m_settings.GetAllocator())
.AddMember(StringRef("Path"), Value(path, m_settings.GetAllocator()), m_settings.GetAllocator())
@@ -1149,6 +1198,7 @@ namespace AZ
R"(To merge the supplied settings registry file, the settings within it must be placed within a JSON Object '{}')"
R"( in order to allow moving of its fields using the root-key as an anchor.)", path);
+ AZStd::scoped_lock lock(m_settingMutex);
pointer.Create(m_settings, m_settings.GetAllocator()).SetObject()
.AddMember(StringRef("Error"), StringRef("Cannot merge registry file with a root which is not a JSON Object,"
" an empty root key and a merge approach of JsonMergePatch. Otherwise the Settings Registry would be overridden."
@@ -1167,6 +1217,7 @@ namespace AZ
JsonSerializationResult::ResultCode mergeResult(JsonSerializationResult::Tasks::Merge);
if (rootKey.empty())
{
+ AZStd::scoped_lock lock(m_settingMutex);
mergeResult = JsonSerialization::ApplyPatch(m_settings, m_settings.GetAllocator(), jsonPatch, mergeApproach, m_applyPatchSettings);
}
else
@@ -1174,6 +1225,7 @@ namespace AZ
Pointer root(rootKey.data(), rootKey.length());
if (root.IsValid())
{
+ AZStd::scoped_lock lock(m_settingMutex);
Value& rootValue = root.Create(m_settings, m_settings.GetAllocator());
mergeResult = JsonSerialization::ApplyPatch(rootValue, m_settings.GetAllocator(), jsonPatch, mergeApproach, m_applyPatchSettings);
}
@@ -1181,6 +1233,7 @@ namespace AZ
{
AZ_Error("Settings Registry", false, R"(Failed to root path "%.*s" is invalid.)",
aznumeric_cast(rootKey.length()), rootKey.data());
+ AZStd::scoped_lock lock(m_settingMutex);
pointer.Create(m_settings, m_settings.GetAllocator()).SetObject()
.AddMember(StringRef("Error"), StringRef("Invalid root key."), m_settings.GetAllocator())
.AddMember(StringRef("Path"), Value(path, m_settings.GetAllocator()), m_settings.GetAllocator());
@@ -1190,15 +1243,19 @@ namespace AZ
if (mergeResult.GetProcessing() != JsonSerializationResult::Processing::Completed)
{
AZ_Error("Settings Registry", false, R"(Failed to fully merge registry file "%s".)", path);
+ AZStd::scoped_lock lock(m_settingMutex);
pointer.Create(m_settings, m_settings.GetAllocator()).SetObject()
.AddMember(StringRef("Error"), StringRef("Failed to fully merge registry file."), m_settings.GetAllocator())
.AddMember(StringRef("Path"), Value(path, m_settings.GetAllocator()), m_settings.GetAllocator());
return false;
}
- pointer.Create(m_settings, m_settings.GetAllocator()).SetString(path, m_settings.GetAllocator());
+ {
+ AZStd::scoped_lock lock(m_settingMutex);
+ pointer.Create(m_settings, m_settings.GetAllocator()).SetString(path, m_settings.GetAllocator());
+ }
- m_notifiers.Signal("", Type::Object);
+ SignalNotifier("", Type::Object);
return true;
}
diff --git a/Code/Framework/AzCore/AzCore/Settings/SettingsRegistryImpl.h b/Code/Framework/AzCore/AzCore/Settings/SettingsRegistryImpl.h
index babcafe701..036f5c6596 100644
--- a/Code/Framework/AzCore/AzCore/Settings/SettingsRegistryImpl.h
+++ b/Code/Framework/AzCore/AzCore/Settings/SettingsRegistryImpl.h
@@ -95,7 +95,7 @@ namespace AZ
using RegistryFileList = AZStd::fixed_vector;
template
- bool SetValueInternal(AZStd::string_view path, T value, SettingsRegistryInterface::Type type);
+ bool SetValueInternal(AZStd::string_view path, T value);
template
bool GetValueInternal(T& result, AZStd::string_view path) const;
VisitResponse Visit(Visitor& visitor, StackedString& path, AZStd::string_view valueName,
@@ -106,8 +106,11 @@ namespace AZ
const rapidjson::Pointer& historyPointer, AZStd::string_view folderPath);
bool ExtractFileDescription(RegistryFile& output, const char* filename, const Specializations& specializations);
bool MergeSettingsFileInternal(const char* path, Format format, AZStd::string_view rootKey, AZStd::vector& scratchBuffer);
+
+ void SignalNotifier(AZStd::string_view jsonPath, Type type);
mutable AZStd::recursive_mutex m_settingMutex;
+ mutable AZStd::recursive_mutex m_notifierMutex;
NotifyEvent m_notifiers;
PreMergeEvent m_preMergeEvent;
PostMergeEvent m_postMergeEvent;
diff --git a/Code/Framework/AzCore/Tests/EventTests.cpp b/Code/Framework/AzCore/Tests/EventTests.cpp
index 358c1a62ae..aaa70344e7 100644
--- a/Code/Framework/AzCore/Tests/EventTests.cpp
+++ b/Code/Framework/AzCore/Tests/EventTests.cpp
@@ -240,6 +240,37 @@ namespace UnitTest
static_assert(!AZStd::is_copy_assignable_v>, "AZ Events should not be copy assignable");
}
+ TEST_F(EventTests, TestClaimHandlers_TakesAllSourceHandlers)
+ {
+ AZ::Event<> testEvent1;
+ AZ::Event<> testEvent2;
+
+ int32_t handlerInvokeCount{};
+ auto handlerCallback = [&handlerInvokeCount]()
+ {
+ ++handlerInvokeCount;
+ };
+ AZ::Event<>::Handler testHandler1(handlerCallback);
+ AZ::Event<>::Handler testHandler2(handlerCallback);
+
+ testHandler1.Connect(testEvent1);
+ testHandler2.Connect(testEvent2);
+
+ EXPECT_TRUE(testEvent1.HasHandlerConnected());
+ EXPECT_TRUE(testEvent2.HasHandlerConnected());
+
+ testEvent1.ClaimHandlers(AZStd::move(testEvent2));
+ EXPECT_TRUE(testEvent1.HasHandlerConnected());
+ EXPECT_FALSE(testEvent2.HasHandlerConnected());
+
+ // testEvent1 should have both handlers
+ testEvent1.Signal();
+ EXPECT_EQ(2, handlerInvokeCount);
+ // testEvent2 should have neither of the handlers
+ testEvent2.Signal();
+ EXPECT_EQ(2, handlerInvokeCount);
+ }
+
TEST_F(EventTests, HandlerMoveAssignment_ProperlyDisconnectsFromOldEvent)
{
AZ::Event<> testEvent1;
diff --git a/Code/Framework/AzFramework/AzFramework/Windowing/NativeWindow.cpp b/Code/Framework/AzFramework/AzFramework/Windowing/NativeWindow.cpp
index df1549cc31..c89d12a8ae 100644
--- a/Code/Framework/AzFramework/AzFramework/Windowing/NativeWindow.cpp
+++ b/Code/Framework/AzFramework/AzFramework/Windowing/NativeWindow.cpp
@@ -10,6 +10,17 @@
#include
+void OnVsyncIntervalChanged(uint32_t const& interval)
+{
+ AzFramework::WindowNotificationBus::Broadcast(
+ &AzFramework::WindowNotificationBus::Events::OnVsyncIntervalChanged, AZ::GetClamp(interval, 0u, 4u));
+}
+
+// NOTE: On change, broadcasts the new requested vsync interval to all windows.
+// The value of the vsync interval is constrained between 0 and 4
+// Vsync intervals greater than 1 are not currently supported on the Vulkan RHI (see #2061 for discussion)
+AZ_CVAR(uint32_t, vsync_interval, 1, OnVsyncIntervalChanged, AZ::ConsoleFunctorFlags::Null, "Set swapchain vsync interval");
+
namespace AzFramework
{
//////////////////////////////////////////////////////////////////////////
@@ -122,6 +133,16 @@ namespace AzFramework
return m_pimpl->GetDpiScaleFactor();
}
+ uint32_t NativeWindow::GetDisplayRefreshRate() const
+ {
+ return m_pimpl->GetDisplayRefreshRate();
+ }
+
+ uint32_t NativeWindow::GetSyncInterval() const
+ {
+ return vsync_interval;
+ }
+
/*static*/ bool NativeWindow::GetFullScreenStateOfDefaultWindow()
{
NativeWindowHandle defaultWindowHandle = nullptr;
@@ -240,4 +261,10 @@ namespace AzFramework
return 1.0f;
}
+ uint32_t NativeWindow::Implementation::GetDisplayRefreshRate() const
+ {
+ // Default to 60
+ return 60;
+ }
+
} // namespace AzFramework
diff --git a/Code/Framework/AzFramework/AzFramework/Windowing/NativeWindow.h b/Code/Framework/AzFramework/AzFramework/Windowing/NativeWindow.h
index 52157d920f..7479b0d1e1 100644
--- a/Code/Framework/AzFramework/AzFramework/Windowing/NativeWindow.h
+++ b/Code/Framework/AzFramework/AzFramework/Windowing/NativeWindow.h
@@ -130,6 +130,8 @@ namespace AzFramework
bool CanToggleFullScreenState() const override;
void ToggleFullScreenState() override;
float GetDpiScaleFactor() const override;
+ uint32_t GetSyncInterval() const override;
+ uint32_t GetDisplayRefreshRate() const override;
//! Get the full screen state of the default window.
//! \return True if the default window is currently in full screen, false otherwise.
@@ -172,6 +174,7 @@ namespace AzFramework
virtual void SetFullScreenState(bool fullScreenState);
virtual bool CanToggleFullScreenState() const;
virtual float GetDpiScaleFactor() const;
+ virtual uint32_t GetDisplayRefreshRate() const;
protected:
uint32_t m_width = 0;
diff --git a/Code/Framework/AzFramework/AzFramework/Windowing/WindowBus.h b/Code/Framework/AzFramework/AzFramework/Windowing/WindowBus.h
index 776cd43787..d3bd0ce82c 100644
--- a/Code/Framework/AzFramework/AzFramework/Windowing/WindowBus.h
+++ b/Code/Framework/AzFramework/AzFramework/Windowing/WindowBus.h
@@ -74,6 +74,12 @@ namespace AzFramework
//! to a "standard" value of 96, the default for Windows in a DPI unaware setting. This can
//! be used to scale user interface elements to ensure legibility on high density displays.
virtual float GetDpiScaleFactor() const = 0;
+
+ //! Returns the sync interval which tells the drivers the number of v-blanks to synchronize with
+ virtual uint32_t GetSyncInterval() const = 0;
+
+ //! Returns the refresh rate of the main display
+ virtual uint32_t GetDisplayRefreshRate() const = 0;
};
using WindowRequestBus = AZ::EBus;
@@ -101,6 +107,9 @@ namespace AzFramework
//! This is called when vsync interval is changed.
virtual void OnVsyncIntervalChanged(uint32_t interval) { AZ_UNUSED(interval); };
+
+ //! This is called if the main display's refresh rate changes
+ virtual void OnRefreshRateChanged([[maybe_unused]] uint32_t refreshRate) {}
};
using WindowNotificationBus = AZ::EBus;
diff --git a/Code/Framework/AzFramework/Platform/Android/AzFramework/Windowing/NativeWindow_Android.cpp b/Code/Framework/AzFramework/Platform/Android/AzFramework/Windowing/NativeWindow_Android.cpp
index 8da63e9a5e..e655435011 100644
--- a/Code/Framework/AzFramework/Platform/Android/AzFramework/Windowing/NativeWindow_Android.cpp
+++ b/Code/Framework/AzFramework/Platform/Android/AzFramework/Windowing/NativeWindow_Android.cpp
@@ -25,7 +25,7 @@ namespace AzFramework
const WindowGeometry& geometry,
const WindowStyleMasks& styleMasks) override;
NativeWindowHandle GetWindowHandle() const override;
-
+ uint32_t GetDisplayRefreshRate() const override;
private:
ANativeWindow* m_nativeWindow = nullptr;
};
@@ -55,4 +55,9 @@ namespace AzFramework
return reinterpret_cast(m_nativeWindow);
}
+ uint32_t NativeWindowImpl_Android::GetDisplayRefreshRate() const
+ {
+ // Using 60 for now until proper support is added
+ return 60;
+ }
} // namespace AzFramework
diff --git a/Code/Framework/AzFramework/Platform/Linux/AzFramework/Windowing/NativeWindow_Linux.cpp b/Code/Framework/AzFramework/Platform/Linux/AzFramework/Windowing/NativeWindow_Linux.cpp
index 5d738f8bdd..0ab1281eda 100644
--- a/Code/Framework/AzFramework/Platform/Linux/AzFramework/Windowing/NativeWindow_Linux.cpp
+++ b/Code/Framework/AzFramework/Platform/Linux/AzFramework/Windowing/NativeWindow_Linux.cpp
@@ -23,6 +23,7 @@ namespace AzFramework
const WindowGeometry& geometry,
const WindowStyleMasks& styleMasks) override;
NativeWindowHandle GetWindowHandle() const override;
+ uint32_t GetDisplayRefreshRate() const override;
};
NativeWindow::Implementation* NativeWindow::Implementation::Create()
@@ -44,4 +45,9 @@ namespace AzFramework
return nullptr;
}
+ uint32_t NativeWindowImpl_Linux::GetDisplayRefreshRate() const
+ {
+ //Using 60 for now until proper support is added
+ return 60;
+ }
} // namespace AzFramework
diff --git a/Code/Framework/AzFramework/Platform/Mac/AzFramework/Windowing/NativeWindow_Mac.mm b/Code/Framework/AzFramework/Platform/Mac/AzFramework/Windowing/NativeWindow_Mac.mm
index 6e6b801e79..272faeb4c1 100644
--- a/Code/Framework/AzFramework/Platform/Mac/AzFramework/Windowing/NativeWindow_Mac.mm
+++ b/Code/Framework/AzFramework/Platform/Mac/AzFramework/Windowing/NativeWindow_Mac.mm
@@ -34,12 +34,14 @@ namespace AzFramework
bool GetFullScreenState() const override;
void SetFullScreenState(bool fullScreenState) override;
bool CanToggleFullScreenState() const override { return true; }
+ uint32_t GetDisplayRefreshRate() const override;
private:
static NSWindowStyleMask ConvertToNSWindowStyleMask(const WindowStyleMasks& styleMasks);
NSWindow* m_nativeWindow;
NSString* m_windowTitle;
+ uint32_t m_mainDisplayRefreshRate = 0;
};
NativeWindow::Implementation* NativeWindow::Implementation::Create()
@@ -76,6 +78,17 @@ namespace AzFramework
// Make the window active
[m_nativeWindow makeKeyAndOrderFront:nil];
m_nativeWindow.title = m_windowTitle;
+
+ CGDirectDisplayID display = CGMainDisplayID();
+ CGDisplayModeRef currentMode = CGDisplayCopyDisplayMode(display);
+ m_mainDisplayRefreshRate = CGDisplayModeGetRefreshRate(currentMode);
+
+ // Assume 60hz if 0 is returned.
+ // This can happen on OSX. In future we can hopefully use maximumFramesPerSecond which wont have this issue
+ if (m_mainDisplayRefreshRate == 0)
+ {
+ m_mainDisplayRefreshRate = 60;
+ }
}
NativeWindowHandle NativeWindowImpl_Darwin::GetWindowHandle() const
@@ -128,4 +141,9 @@ namespace AzFramework
const NSWindowStyleMask defaultMask = NSWindowStyleMaskResizable | NSWindowStyleMaskTitled | NSWindowStyleMaskClosable | NSWindowStyleMaskMiniaturizable;
return nativeMask ? nativeMask : defaultMask;
}
+
+ uint32_t NativeWindowImpl_Darwin::GetDisplayRefreshRate() const
+ {
+ return m_mainDisplayRefreshRate;
+ }
} // namespace AzFramework
diff --git a/Code/Framework/AzFramework/Platform/Windows/AzFramework/Input/Devices/Keyboard/InputDeviceKeyboard_Windows.cpp b/Code/Framework/AzFramework/Platform/Windows/AzFramework/Input/Devices/Keyboard/InputDeviceKeyboard_Windows.cpp
index f3112ab89c..650dd14a1c 100644
--- a/Code/Framework/AzFramework/Platform/Windows/AzFramework/Input/Devices/Keyboard/InputDeviceKeyboard_Windows.cpp
+++ b/Code/Framework/AzFramework/Platform/Windows/AzFramework/Input/Devices/Keyboard/InputDeviceKeyboard_Windows.cpp
@@ -117,9 +117,11 @@ namespace AzFramework
, m_hasFocus(false)
, m_hasTextEntryStarted(false)
{
+ static const char* s_keyboardCountEnvironmentVarName = "InputDeviceKeyboardInstanceCount";
+ s_instanceCount = AZ::Environment::FindVariable(s_keyboardCountEnvironmentVarName);
if (!s_instanceCount)
{
- s_instanceCount = AZ::Environment::CreateVariable("InputDeviceKeyboardInstanceCount", 1);
+ s_instanceCount = AZ::Environment::CreateVariable(s_keyboardCountEnvironmentVarName, 1);
// Register for raw keyboard input
RAWINPUTDEVICE rawInputDevice;
diff --git a/Code/Framework/AzFramework/Platform/Windows/AzFramework/Input/Devices/Mouse/InputDeviceMouse_Windows.cpp b/Code/Framework/AzFramework/Platform/Windows/AzFramework/Input/Devices/Mouse/InputDeviceMouse_Windows.cpp
index 464f49d620..d5d313eaab 100644
--- a/Code/Framework/AzFramework/Platform/Windows/AzFramework/Input/Devices/Mouse/InputDeviceMouse_Windows.cpp
+++ b/Code/Framework/AzFramework/Platform/Windows/AzFramework/Input/Devices/Mouse/InputDeviceMouse_Windows.cpp
@@ -138,9 +138,11 @@ namespace AzFramework
{
memset(&m_lastClientRect, 0, sizeof(m_lastClientRect));
+ static const char* s_mouseCountEnvironmentVarName = "InputDeviceMouseInstanceCount";
+ s_instanceCount = AZ::Environment::FindVariable(s_mouseCountEnvironmentVarName);
if (!s_instanceCount)
{
- s_instanceCount = AZ::Environment::CreateVariable("InputDeviceMouseInstanceCount", 1);
+ s_instanceCount = AZ::Environment::CreateVariable(s_mouseCountEnvironmentVarName, 1);
// Register for raw mouse input
RAWINPUTDEVICE rawInputDevice;
diff --git a/Code/Framework/AzFramework/Platform/Windows/AzFramework/Windowing/NativeWindow_Windows.cpp b/Code/Framework/AzFramework/Platform/Windows/AzFramework/Windowing/NativeWindow_Windows.cpp
index 22a293891c..2c1d97dcf6 100644
--- a/Code/Framework/AzFramework/Platform/Windows/AzFramework/Windowing/NativeWindow_Windows.cpp
+++ b/Code/Framework/AzFramework/Platform/Windows/AzFramework/Windowing/NativeWindow_Windows.cpp
@@ -37,6 +37,7 @@ namespace AzFramework
void SetFullScreenState(bool fullScreenState) override;
bool CanToggleFullScreenState() const override { return true; }
float GetDpiScaleFactor() const override;
+ uint32_t GetDisplayRefreshRate() const override;
private:
static DWORD ConvertToWin32WindowStyleMask(const WindowStyleMasks& styleMasks);
@@ -56,6 +57,7 @@ namespace AzFramework
using GetDpiForWindowType = UINT(HWND hwnd);
GetDpiForWindowType* m_getDpiFunction = nullptr;
+ uint32_t m_mainDisplayRefreshRate = 0;
};
const wchar_t* NativeWindowImpl_Win32::s_defaultClassName = L"O3DEWin32Class";
@@ -144,6 +146,10 @@ namespace AzFramework
{
SetWindowLongPtr(m_win32Handle, GWLP_USERDATA, reinterpret_cast(this));
}
+
+ DEVMODE DisplayConfig;
+ EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &DisplayConfig);
+ m_mainDisplayRefreshRate = DisplayConfig.dmDisplayFrequency;
}
void NativeWindowImpl_Win32::Activate()
@@ -263,6 +269,15 @@ namespace AzFramework
WindowNotificationBus::Event(nativeWindowImpl->GetWindowHandle(), &WindowNotificationBus::Events::OnDpiScaleFactorChanged, newScaleFactor);
break;
}
+ case WM_WINDOWPOSCHANGED:
+ {
+ DEVMODE DisplayConfig;
+ EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &DisplayConfig);
+ uint32_t refreshRate = DisplayConfig.dmDisplayFrequency;
+ WindowNotificationBus::Event(
+ nativeWindowImpl->GetWindowHandle(), &WindowNotificationBus::Events::OnRefreshRateChanged, refreshRate);
+ break;
+ }
default:
return DefWindowProc(hWnd, message, wParam, lParam);
break;
@@ -367,6 +382,11 @@ namespace AzFramework
return aznumeric_cast(dotsPerInch) / aznumeric_cast(defaultDotsPerInch);
}
+ uint32_t NativeWindowImpl_Win32::GetDisplayRefreshRate() const
+ {
+ return m_mainDisplayRefreshRate;
+ }
+
void NativeWindowImpl_Win32::EnterBorderlessWindowFullScreen()
{
if (m_isInBorderlessWindowFullScreenState)
diff --git a/Code/Framework/AzFramework/Platform/iOS/AzFramework/Windowing/NativeWindow_ios.mm b/Code/Framework/AzFramework/Platform/iOS/AzFramework/Windowing/NativeWindow_ios.mm
index b14db37d23..0486ca1b92 100644
--- a/Code/Framework/AzFramework/Platform/iOS/AzFramework/Windowing/NativeWindow_ios.mm
+++ b/Code/Framework/AzFramework/Platform/iOS/AzFramework/Windowing/NativeWindow_ios.mm
@@ -27,9 +27,11 @@ namespace AzFramework
const WindowGeometry& geometry,
const WindowStyleMasks& styleMasks) override;
NativeWindowHandle GetWindowHandle() const override;
-
+ uint32_t GetDisplayRefreshRate() const override;
+
private:
UIWindow* m_nativeWindow;
+ uint32_t m_mainDisplayRefreshRate = 0;
};
NativeWindow::Implementation* NativeWindow::Implementation::Create()
@@ -56,6 +58,7 @@ namespace AzFramework
m_width = geometry.m_width;
m_height = geometry.m_height;
+ m_mainDisplayRefreshRate = [[UIScreen mainScreen] maximumFramesPerSecond];
}
NativeWindowHandle NativeWindowImpl_Ios::GetWindowHandle() const
@@ -63,5 +66,9 @@ namespace AzFramework
return m_nativeWindow;
}
+ uint32_t NativeWindowImpl_Ios::GetDisplayRefreshRate() const
+ {
+ return m_mainDisplayRefreshRate;
+ }
} // namespace AzFramework
diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/TreeView.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/TreeView.cpp
index 3d0b78ece7..e4d10a321d 100644
--- a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/TreeView.cpp
+++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/TreeView.cpp
@@ -8,10 +8,13 @@
#include
+#include
#include
#include
#include
+#include
+
#include
#include
#include
@@ -252,5 +255,109 @@ namespace AzQtComponents
return qobject_cast(widget) && !qobject_cast(widget);
}
+ StyledTreeView::StyledTreeView(QWidget* parent)
+ : QTreeView(parent)
+ {
+ }
+
+ void StyledTreeView::startDrag(Qt::DropActions supportedActions)
+ {
+ if (!selectionModel()->selectedIndexes().empty())
+ {
+ StartCustomDrag(selectionModel()->selectedIndexes(), supportedActions);
+ }
+ }
+
+ void StyledTreeView::StartCustomDrag(const QModelIndexList& indexList, Qt::DropActions supportedActions)
+ {
+ StartCustomDragInternal(this, indexList, supportedActions);
+ }
+
+ void StyledTreeView::StartCustomDragInternal(QAbstractItemView* itemView, const QModelIndexList& indexList, Qt::DropActions supportedActions)
+ {
+ QMimeData* mimeData = itemView->model()->mimeData(indexList);
+ if (mimeData)
+ {
+ QDrag* drag = new QDrag(itemView);
+ drag->setPixmap(QPixmap::fromImage(CreateDragImage(itemView, indexList)));
+ drag->setMimeData(mimeData);
+
+ Qt::DropAction defDropAction = Qt::IgnoreAction;
+ if (itemView->defaultDropAction() != Qt::IgnoreAction && (supportedActions & itemView->defaultDropAction()))
+ {
+ defDropAction = itemView->defaultDropAction();
+ }
+ else if (supportedActions & Qt::CopyAction && itemView->dragDropMode() != QAbstractItemView::InternalMove)
+ {
+ defDropAction = Qt::CopyAction;
+ }
+
+ drag->exec(supportedActions, defDropAction);
+ }
+ }
+
+ QImage StyledTreeView::CreateDragImage(QAbstractItemView* itemView, const QModelIndexList& indexList)
+ {
+ // Generate a drag image of the item icon and text, normally done internally, and inaccessible
+ QRect rect(0, 0, 0, 0);
+ for (const auto& index : indexList)
+ {
+ if (index.column() != 0)
+ {
+ continue;
+ }
+
+ QRect itemRect = itemView->visualRect(index);
+ rect.setHeight(rect.height() + itemRect.height());
+ rect.setWidth(AZStd::GetMax(rect.width(), itemRect.width()));
+ }
+
+ QImage dragImage(rect.size(), QImage::Format_ARGB32_Premultiplied);
+
+ QPainter dragPainter(&dragImage);
+ dragPainter.setCompositionMode(QPainter::CompositionMode_Source);
+ dragPainter.fillRect(dragImage.rect(), Qt::transparent);
+ dragPainter.setCompositionMode(QPainter::CompositionMode_SourceOver);
+ dragPainter.setOpacity(0.35f);
+ dragPainter.fillRect(rect, QColor("#222222"));
+ dragPainter.setOpacity(1.0f);
+
+ int imageY = 0;
+ for (const auto& index : indexList)
+ {
+ if (index.column() != 0)
+ {
+ continue;
+ }
+
+ QRect itemRect = itemView->visualRect(index);
+ dragPainter.drawPixmap(QPoint(0, imageY),
+ itemView->model()->data(index, Qt::DecorationRole).value().pixmap(QSize(16, 16)));
+ dragPainter.setPen(
+ itemView->model()->data(index, Qt::ForegroundRole).value().color());
+ dragPainter.setFont(
+ itemView->font());
+ dragPainter.drawText(QRect(20, imageY, rect.width() - 20, rect.height()),
+ itemView->model()->data(index, Qt::DisplayRole).value());
+ imageY += itemRect.height();
+ }
+
+ dragPainter.end();
+ return dragImage;
+ }
+
+ StyledTreeWidget::StyledTreeWidget(QWidget* parent)
+ : QTreeWidget(parent)
+ {
+ }
+
+ void StyledTreeWidget::startDrag(Qt::DropActions supportedActions)
+ {
+ if (!selectionModel()->selectedIndexes().empty())
+ {
+ StyledTreeView::StartCustomDragInternal(this, selectionModel()->selectedIndexes(), supportedActions);
+ }
+ }
+
} // namespace AzQtComponents
#include
diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/TreeView.h b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/TreeView.h
index 8fdcc24a8b..7510819e23 100644
--- a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/TreeView.h
+++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/TreeView.h
@@ -9,8 +9,11 @@
#pragma once
#if !defined(Q_MOC_RUN)
+#include
#include
#include
+
+#include
#endif
namespace AzQtComponents
@@ -68,4 +71,46 @@ namespace AzQtComponents
void updateEditorGeometry(QWidget* editor, const QStyleOptionViewItem& option, const QModelIndex& index) const override;
};
+ //! For most of the custom QTreeView styling, we override in AzQtComponents::Style class,
+ //! but there are some cases (e.g. drag/drop) that can only be overriden by an actual
+ //! subclass of the QTreeView
+ class AZ_QT_COMPONENTS_API StyledTreeView
+ : public QTreeView
+ {
+ Q_OBJECT
+
+ public:
+ AZ_CLASS_ALLOCATOR(StyledTreeView, AZ::SystemAllocator, 0);
+
+ explicit StyledTreeView(QWidget* parent = nullptr);
+
+ //! NOTE: QTreeWidget derives from QTreeView, but because we need a custom dervied class
+ //! of QTreeView, then we can't inherit our custom drag methods in our custom derived
+ //! class of QTreeWidget, so these functions are made static so they can be shared
+ static void StartCustomDragInternal(QAbstractItemView* itemView, const QModelIndexList& indexList, Qt::DropActions supportedActions);
+ static QImage CreateDragImage(QAbstractItemView* itemView, const QModelIndexList& indexList);
+
+ protected:
+ void startDrag(Qt::DropActions supportedActions) override;
+
+ virtual void StartCustomDrag(const QModelIndexList& indexList, Qt::DropActions supportedActions);
+ };
+
+ //! For most of the custom QTreeWidget styling, we override in AzQtComponents::Style class,
+ //! but there are some cases (e.g. drag/drop) that can only be overriden by an actual
+ //! subclass of the QTreeWidget.
+ class AZ_QT_COMPONENTS_API StyledTreeWidget
+ : public QTreeWidget
+ {
+ Q_OBJECT
+
+ public:
+ AZ_CLASS_ALLOCATOR(StyledTreeWidget, AZ::SystemAllocator, 0);
+
+ explicit StyledTreeWidget(QWidget* parent = nullptr);
+
+ protected:
+ void startDrag(Qt::DropActions supportedActions) override;
+ };
+
} // namespace AzQtComponents
diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerTreeView.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerTreeView.cpp
index eaee196c09..0549c600d3 100644
--- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerTreeView.cpp
+++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerTreeView.cpp
@@ -27,7 +27,7 @@
namespace AzToolsFramework
{
EntityOutlinerTreeView::EntityOutlinerTreeView(QWidget* pParent)
- : QTreeView(pParent)
+ : AzQtComponents::StyledTreeView(pParent)
, m_queuedMouseEvent(nullptr)
, m_draggingUnselectedItem(false)
{
@@ -144,16 +144,12 @@ namespace AzToolsFramework
if (!selectionModel()->isSelected(index))
{
- startCustomDrag({ index }, supportedActions);
+ StartCustomDrag({ index }, supportedActions);
return;
}
}
- if (!selectionModel()->selectedIndexes().empty())
- {
- startCustomDrag(selectionModel()->selectedIndexes(), supportedActions);
- return;
- }
+ StyledTreeView::startDrag(supportedActions);
}
void EntityOutlinerTreeView::dragMoveEvent(QDragMoveEvent* event)
@@ -243,14 +239,14 @@ namespace AzToolsFramework
QTreeView::mousePressEvent(&mousePressedEvent);
}
- void EntityOutlinerTreeView::startCustomDrag(const QModelIndexList& indexList, Qt::DropActions supportedActions)
+ void EntityOutlinerTreeView::StartCustomDrag(const QModelIndexList& indexList, Qt::DropActions supportedActions)
{
m_draggingUnselectedItem = true;
//sort by container entity depth and order in hierarchy for proper drag image and drop order
QModelIndexList indexListSorted = indexList;
AZStd::unordered_map> locations;
- for (auto index : indexListSorted)
+ for (const auto& index : indexListSorted)
{
AZ::EntityId entityId(index.data(EntityOutlinerListModel::EntityIdRole).value());
AzToolsFramework::GetEntityLocationInHierarchy(entityId, locations[entityId]);
@@ -263,76 +259,8 @@ namespace AzToolsFramework
return AZStd::lexicographical_compare(locationsE1.begin(), locationsE1.end(), locationsE2.begin(), locationsE2.end());
});
- //get the data for the unselected item(s)
- QMimeData* mimeData = model()->mimeData(indexListSorted);
- if (mimeData)
- {
- //initiate drag/drop for the item
- QDrag* drag = new QDrag(this);
- drag->setPixmap(QPixmap::fromImage(createDragImage(indexListSorted)));
- drag->setMimeData(mimeData);
- Qt::DropAction defDropAction = Qt::IgnoreAction;
- if (defaultDropAction() != Qt::IgnoreAction && (supportedActions & defaultDropAction()))
- {
- defDropAction = defaultDropAction();
- }
- else if (supportedActions & Qt::CopyAction && dragDropMode() != QAbstractItemView::InternalMove)
- {
- defDropAction = Qt::CopyAction;
- }
- drag->exec(supportedActions, defDropAction);
- }
+ StyledTreeView::StartCustomDrag(indexListSorted, supportedActions);
}
-
- QImage EntityOutlinerTreeView::createDragImage(const QModelIndexList& indexList)
- {
- //generate a drag image of the item icon and text, normally done internally, and inaccessible
- QRect rect(0, 0, 0, 0);
- for (auto index : indexList)
- {
- if (index.column() != 0)
- {
- continue;
- }
- QRect itemRect = visualRect(index);
- rect.setHeight(rect.height() + itemRect.height());
- rect.setWidth(AZStd::GetMax(rect.width(), itemRect.width()));
- }
-
- QImage dragImage(rect.size(), QImage::Format_ARGB32_Premultiplied);
-
- QPainter dragPainter(&dragImage);
- dragPainter.setCompositionMode(QPainter::CompositionMode_Source);
- dragPainter.fillRect(dragImage.rect(), Qt::transparent);
- dragPainter.setCompositionMode(QPainter::CompositionMode_SourceOver);
- dragPainter.setOpacity(0.35f);
- dragPainter.fillRect(rect, QColor("#222222"));
- dragPainter.setOpacity(1.0f);
-
- int imageY = 0;
- for (auto index : indexList)
- {
- if (index.column() != 0)
- {
- continue;
- }
-
- QRect itemRect = visualRect(index);
- dragPainter.drawPixmap(QPoint(0, imageY),
- model()->data(index, Qt::DecorationRole).value().pixmap(QSize(16, 16)));
- dragPainter.setPen(
- model()->data(index, Qt::ForegroundRole).value().color());
- dragPainter.setFont(
- font());
- dragPainter.drawText(QRect(20, imageY, rect.width() - 20, rect.height()),
- model()->data(index, Qt::DisplayRole).value());
- imageY += itemRect.height();
- }
-
- dragPainter.end();
- return dragImage;
- }
-
}
#include
diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerTreeView.hxx b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerTreeView.hxx
index 89471de228..66cd082407 100644
--- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerTreeView.hxx
+++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerTreeView.hxx
@@ -14,7 +14,8 @@
#include
#include
-#include
+
+#include
#endif
#pragma once
@@ -33,7 +34,7 @@ namespace AzToolsFramework
//! allow for dragging and dropping of entities from the outliner into the property editor
//! of other entities. If the selection updates instantly, this would never be possible.
class EntityOutlinerTreeView
- : public QTreeView
+ : public AzQtComponents::StyledTreeView
{
Q_OBJECT;
public:
@@ -68,9 +69,7 @@ namespace AzToolsFramework
void processQueuedMousePressedEvent(QMouseEvent* event);
- void startCustomDrag(const QModelIndexList& indexList, Qt::DropActions supportedActions);
-
- QImage createDragImage(const QModelIndexList& indexList);
+ void StartCustomDrag(const QModelIndexList& indexList, Qt::DropActions supportedActions) override;
void PaintBranchBackground(QPainter* painter, const QRect& rect, const QModelIndex& index) const;
diff --git a/Code/Framework/GridMate/Platform/Android/GridMate/Session/LANSession_Android.cpp b/Code/Framework/GridMate/Platform/Android/GridMate/Session/LANSession_Android.cpp
index 05fb56dfc1..3fa2a369a6 100644
--- a/Code/Framework/GridMate/Platform/Android/GridMate/Session/LANSession_Android.cpp
+++ b/Code/Framework/GridMate/Platform/Android/GridMate/Session/LANSession_Android.cpp
@@ -7,6 +7,7 @@
*/
#include
+#include
namespace GridMate
{
diff --git a/Code/Framework/GridMate/Platform/iOS/GridMate/Session/LANSession_iOS.cpp b/Code/Framework/GridMate/Platform/iOS/GridMate/Session/LANSession_iOS.cpp
index 05fb56dfc1..3fa2a369a6 100644
--- a/Code/Framework/GridMate/Platform/iOS/GridMate/Session/LANSession_iOS.cpp
+++ b/Code/Framework/GridMate/Platform/iOS/GridMate/Session/LANSession_iOS.cpp
@@ -7,6 +7,7 @@
*/
#include
+#include
namespace GridMate
{
diff --git a/Code/LauncherUnified/Platform/Mac/Launcher_Mac.mm b/Code/LauncherUnified/Platform/Mac/Launcher_Mac.mm
index cfba0d8aac..cbd5a043e1 100644
--- a/Code/LauncherUnified/Platform/Mac/Launcher_Mac.mm
+++ b/Code/LauncherUnified/Platform/Mac/Launcher_Mac.mm
@@ -10,6 +10,7 @@
#include
#include <../Common/Apple/Launcher_Apple.h>
#include <../Common/UnixLike/Launcher_UnixLike.h>
+#include
#if AZ_TESTS_ENABLED
diff --git a/Code/LauncherUnified/Platform/Windows/Launcher_Windows.cpp b/Code/LauncherUnified/Platform/Windows/Launcher_Windows.cpp
index 5cc3070cdb..44426f6d01 100644
--- a/Code/LauncherUnified/Platform/Windows/Launcher_Windows.cpp
+++ b/Code/LauncherUnified/Platform/Windows/Launcher_Windows.cpp
@@ -9,6 +9,7 @@
#include
#include
+#include
int APIENTRY WinMain([[maybe_unused]] HINSTANCE hInstance, [[maybe_unused]] HINSTANCE hPrevInstance, [[maybe_unused]] LPSTR lpCmdLine, [[maybe_unused]] int nCmdShow)
{
diff --git a/Code/Legacy/CryCommon/AppleSpecific.h b/Code/Legacy/CryCommon/AppleSpecific.h
index c572250b26..cd3146403a 100644
--- a/Code/Legacy/CryCommon/AppleSpecific.h
+++ b/Code/Legacy/CryCommon/AppleSpecific.h
@@ -226,6 +226,21 @@ typedef uint64 __uint64;
#define _PTRDIFF_T_DEFINED 1
+typedef union _LARGE_INTEGER
+{
+ struct
+ {
+ DWORD LowPart;
+ LONG HighPart;
+ };
+ struct
+ {
+ DWORD LowPart;
+ LONG HighPart;
+ } u;
+ long long QuadPart;
+} LARGE_INTEGER;
+
#define _A_RDONLY (0x01) /* Read only file */
#define _A_HIDDEN (0x02) /* Hidden file */
#define _A_SUBDIR (0x10) /* Subdirectory */
diff --git a/Code/Legacy/CryCommon/CryAssert_Linux.h b/Code/Legacy/CryCommon/CryAssert_Linux.h
index 3debe2bd5d..112c60a80c 100644
--- a/Code/Legacy/CryCommon/CryAssert_Linux.h
+++ b/Code/Legacy/CryCommon/CryAssert_Linux.h
@@ -72,7 +72,7 @@ bool CryAssert(const char* szCondition, const char* szFile, unsigned int line, b
static const int max_len = 4096;
static char gs_command_str[4096];
- static CryLockT lock;
+ static AZStd::recursive_mutex lock;
gEnv->pSystem->OnAssert(szCondition, gs_szMessage, szFile, line);
@@ -80,7 +80,7 @@ bool CryAssert(const char* szCondition, const char* szFile, unsigned int line, b
if (!gEnv->bNoAssertDialog && !gEnv->bIgnoreAllAsserts)
{
- CryAutoLock< CryLockT > lk (lock);
+ AZStd::scoped_lock lk(lock);
snprintf(gs_command_str, max_len, "xterm -geometry 100x20 -n 'Assert Dialog [Linux Launcher]' -T 'Assert Dialog [Linux Launcher]' -e 'BinLinux/assert_term \"%s\" \"%s\" %d \"%s\"; echo \"$?\" > .assert_return'",
szCondition, (file_len > 60) ? szFile + (file_len - 61) : szFile, line, gs_szMessage);
int ret = system(gs_command_str);
diff --git a/Code/Legacy/CryCommon/CryAssert_Mac.h b/Code/Legacy/CryCommon/CryAssert_Mac.h
index ce65b352ab..f0a893630e 100644
--- a/Code/Legacy/CryCommon/CryAssert_Mac.h
+++ b/Code/Legacy/CryCommon/CryAssert_Mac.h
@@ -70,8 +70,6 @@ bool CryAssert(const char* szCondition, const char* szFile, unsigned int line, b
static const int max_len = 4096;
static char gs_command_str[4096];
- static CryLockT lock;
-
gEnv->pSystem->OnAssert(szCondition, gs_szMessage, szFile, line);
size_t file_len = strlen(szFile);
diff --git a/Code/Legacy/CryCommon/CryLibrary.h b/Code/Legacy/CryCommon/CryLibrary.h
index 787085af00..a034a2a04b 100644
--- a/Code/Legacy/CryCommon/CryLibrary.h
+++ b/Code/Legacy/CryCommon/CryLibrary.h
@@ -49,7 +49,7 @@
*/
#include
-#include
+#include
#include
#define INJECT_ENVIRONMENT_FUNCTION "InjectEnvironment"
diff --git a/Code/Legacy/CryCommon/CryThread.h b/Code/Legacy/CryCommon/CryThread.h
deleted file mode 100644
index 5929bed352..0000000000
--- a/Code/Legacy/CryCommon/CryThread.h
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
-
-
-// Description : Public include file for the multi-threading API.
-
-
-#pragma once
-
-
-// Include basic multithread primitives.
-#include "MultiThread.h"
-#include "BitFiddling.h"
-#include
-//////////////////////////////////////////////////////////////////////////
-// Lock types:
-//
-// CRYLOCK_FAST
-// A fast potentially (non-recursive) mutex.
-// CRYLOCK_RECURSIVE
-// A recursive mutex.
-//////////////////////////////////////////////////////////////////////////
-enum CryLockType
-{
- CRYLOCK_FAST = 1,
- CRYLOCK_RECURSIVE = 2,
-};
-
-#define CRYLOCK_HAVE_FASTLOCK 1
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Primitive locks and conditions.
-//
-// Primitive locks are represented by instance of class CryLockT
-//
-//
-template
-class CryLockT
-{
- /* Unsupported lock type. */
-};
-
-//////////////////////////////////////////////////////////////////////////
-// Typedefs.
-//////////////////////////////////////////////////////////////////////////
-typedef CryLockT CryCriticalSection;
-typedef CryLockT CryCriticalSectionNonRecursive;
-//////////////////////////////////////////////////////////////////////////
-
-
-//////////////////////////////////////////////////////////////////////////
-//
-// CryAutoCriticalSection implements a helper class to automatically
-// lock critical section in constructor and release on destructor.
-//
-//////////////////////////////////////////////////////////////////////////
-template
-class CryAutoLock
-{
-private:
- LockClass* m_pLock;
-
- CryAutoLock();
- CryAutoLock(const CryAutoLock&);
- CryAutoLock& operator = (const CryAutoLock&);
-
-public:
- CryAutoLock(LockClass& Lock)
- : m_pLock(&Lock) { m_pLock->Lock(); }
- CryAutoLock(const LockClass& Lock)
- : m_pLock(const_cast(&Lock)) { m_pLock->Lock(); }
- ~CryAutoLock() { m_pLock->Unlock(); }
-};
-
-//////////////////////////////////////////////////////////////////////////
-//
-// Auto critical section is the most commonly used type of auto lock.
-//
-//////////////////////////////////////////////////////////////////////////
-typedef CryAutoLock CryAutoCriticalSection;
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Threads.
-
-// Base class for runnable objects.
-//
-// A runnable is an object with a Run() and a Cancel() method. The Run()
-// method should perform the runnable's job. The Cancel() method may be
-// called by another thread requesting early termination of the Run() method.
-// The runnable may ignore the Cancel() call, the default implementation of
-// Cancel() does nothing.
-class CryRunnable
-{
-public:
- virtual ~CryRunnable() { }
- virtual void Run() = 0;
- virtual void Cancel() { }
-};
-
-// Class holding information about a thread.
-//
-// A reference to the thread information can be obtained by calling GetInfo()
-// on the CrySimpleThread (or derived class) instance.
-//
-// NOTE:
-// If the code is compiled with NO_THREADINFO defined, then the GetInfo()
-// method will return a reference to a static dummy instance of this
-// structure. It is currently undecided if NO_THREADINFO will be defined for
-// release builds!
-
-struct CryThreadInfo
-{
- // The symbolic name of the thread.
- //
- // You may set this name directly or through the SetName() method of
- // CrySimpleThread (or derived class).
- AZStd::string m_Name;
-
-
- // A thread identification number.
- // The number is unique but architecture specific. Do not assume anything
- // about that number except for being unique.
- //
- // This field is filled when the thread is started (i.e. before the Run()
- // method or thread routine is called). It is advised that you do not
- // change this number manually.
- uint32 m_ID;
-};
-
-// Simple thread class.
-//
-// CrySimpleThread is a simple wrapper around a system thread providing
-// nothing but system-level functionality of a thread. There are two typical
-// ways to use a simple thread:
-//
-// 1. Derive from the CrySimpleThread class and provide an implementation of
-// the Run() (and optionally Cancel()) methods.
-// 2. Specify a runnable object when the thread is started. The default
-// runnable type is CryRunnable.
-//
-// The Runnable class specfied as the template argument must provide Run()
-// and Cancel() methods compatible with the following signatures:
-//
-// void Runnable::Run();
-// void Runnable::Cancel();
-//
-// If the Runnable does not support cancellation, then the Cancel() method
-// should do nothing.
-//
-// The same instance of CrySimpleThread may be used for multiple thread
-// executions /in sequence/, i.e. it is valid to re-start the thread by
-// calling Start() after the thread has been joined by calling WaitForThread().
-template
-class CrySimpleThread;
-
-///////////////////////////////////////////////////////////////////////////////
-// Include architecture specific code.
-#if AZ_LEGACY_CRYCOMMON_TRAIT_USE_PTHREADS
-#include
-#define AZ_RESTRICTED_SECTION_IMPLEMENTED
-#elif defined(WIN32) || defined(WIN64)
-#include
-#define AZ_RESTRICTED_SECTION_IMPLEMENTED
-#elif defined(AZ_RESTRICTED_PLATFORM)
- #include AZ_RESTRICTED_FILE(CryThread_h)
-#endif
-#if defined(AZ_RESTRICTED_SECTION_IMPLEMENTED)
-#undef AZ_RESTRICTED_SECTION_IMPLEMENTED
-#else
-// Put other platform specific includes here!
-#include
-#endif
-
-#if !defined _CRYTHREAD_CONDLOCK_GLITCH
-typedef CryLockT CryMutex;
-#endif // !_CRYTHREAD_CONDLOCK_GLITCH
-
-// Include all multithreading containers.
-#include "MultiThread_Containers.h"
diff --git a/Code/Legacy/CryCommon/CryThreadImpl.h b/Code/Legacy/CryCommon/CryThreadImpl.h
deleted file mode 100644
index 0226b73716..0000000000
--- a/Code/Legacy/CryCommon/CryThreadImpl.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
-
-
-#pragma once
-
-
-#include
-
-// Include architecture specific code.
-#if defined(LINUX) || defined(APPLE)
-#include
-#define AZ_RESTRICTED_SECTION_IMPLEMENTED
-#elif defined(WIN32) || defined(WIN64)
-#include
-#define AZ_RESTRICTED_SECTION_IMPLEMENTED
-#elif defined(AZ_RESTRICTED_PLATFORM)
- #include AZ_RESTRICTED_FILE(CryThreadImpl_h)
-#endif
-#if defined(AZ_RESTRICTED_SECTION_IMPLEMENTED)
-#undef AZ_RESTRICTED_SECTION_IMPLEMENTED
-#else
-// Put other platform specific includes here!
-#endif
diff --git a/Code/Legacy/CryCommon/CryThreadImpl_pthreads.h b/Code/Legacy/CryCommon/CryThreadImpl_pthreads.h
deleted file mode 100644
index c3dee7339f..0000000000
--- a/Code/Legacy/CryCommon/CryThreadImpl_pthreads.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
-
-
-#ifndef CRYINCLUDE_CRYCOMMON_CRYTHREADIMPL_PTHREADS_H
-#define CRYINCLUDE_CRYCOMMON_CRYTHREADIMPL_PTHREADS_H
-#pragma once
-
-
-#include "CryThread_pthreads.h"
-
-AZ_THREAD_LOCAL CrySimpleThreadSelf* CrySimpleThreadSelf::m_Self = NULL;
-
-//////////////////////////////////////////////////////////////////////////
-// CryEvent(Timed) implementation
-//////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////
-void CryEventTimed::Reset()
-{
- m_lockNotify.Lock();
- m_flag = false;
- m_lockNotify.Unlock();
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CryEventTimed::Set()
-{
- m_lockNotify.Lock();
- m_flag = true;
- m_cond.Notify();
- m_lockNotify.Unlock();
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CryEventTimed::Wait()
-{
- m_lockNotify.Lock();
- if (!m_flag)
- {
- m_cond.Wait(m_lockNotify);
- }
- m_flag = false;
- m_lockNotify.Unlock();
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool CryEventTimed::Wait(const uint32 timeoutMillis)
-{
- bool bResult = true;
- m_lockNotify.Lock();
- if (!m_flag)
- {
- bResult = m_cond.TimedWait(m_lockNotify, timeoutMillis);
- }
- m_flag = false;
- m_lockNotify.Unlock();
- return bResult;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// CryCriticalSection implementation
-///////////////////////////////////////////////////////////////////////////////
-typedef CryLockT TCritSecType;
-
-void CryDeleteCriticalSection(void* cs)
-{
- delete ((TCritSecType*)cs);
-}
-
-void CryEnterCriticalSection(void* cs)
-{
- ((TCritSecType*)cs)->Lock();
-}
-
-bool CryTryCriticalSection(void* cs)
-{
- return false;
-}
-
-void CryLeaveCriticalSection(void* cs)
-{
- ((TCritSecType*)cs)->Unlock();
-}
-
-void CryCreateCriticalSectionInplace(void* pCS)
-{
- new (pCS) TCritSecType;
-}
-
-void CryDeleteCriticalSectionInplace(void*)
-{
-}
-
-void* CryCreateCriticalSection()
-{
- return (void*) new TCritSecType;
-}
-
-#endif // CRYINCLUDE_CRYCOMMON_CRYTHREADIMPL_PTHREADS_H
diff --git a/Code/Legacy/CryCommon/CryThreadImpl_windows.h b/Code/Legacy/CryCommon/CryThreadImpl_windows.h
deleted file mode 100644
index 4ddbaedac5..0000000000
--- a/Code/Legacy/CryCommon/CryThreadImpl_windows.h
+++ /dev/null
@@ -1,345 +0,0 @@
-/*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
-
-
-#pragma once
-
-#include
-#include // for CreateSemaphore
-
-struct SThreadNameDesc
-{
- DWORD dwType;
- LPCSTR szName;
- DWORD dwThreadID;
- DWORD dwFlags;
-};
-
-AZ_THREAD_LOCAL CrySimpleThreadSelf* CrySimpleThreadSelf::m_Self = NULL;
-
-//////////////////////////////////////////////////////////////////////////
-CryEvent::CryEvent()
-{
- m_handle = (void*)CreateEvent(NULL, FALSE, FALSE, NULL);
-}
-
-//////////////////////////////////////////////////////////////////////////
-CryEvent::~CryEvent()
-{
- CloseHandle(m_handle);
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CryEvent::Reset()
-{
- ResetEvent(m_handle);
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CryEvent::Set()
-{
- SetEvent(m_handle);
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CryEvent::Wait() const
-{
- WaitForSingleObject(m_handle, INFINITE);
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool CryEvent::Wait(const uint32 timeoutMillis) const
-{
- if (WaitForSingleObject(m_handle, timeoutMillis) == WAIT_TIMEOUT)
- {
- return false;
- }
- return true;
-}
-
-//////////////////////////////////////////////////////////////////////////
-// CryLock_WinMutex
-//////////////////////////////////////////////////////////////////////////
-
-//////////////////////////////////////////////////////////////////////////
-CryLock_WinMutex::CryLock_WinMutex()
- : m_hdl(CreateMutex(NULL, FALSE, NULL)) {}
-CryLock_WinMutex::~CryLock_WinMutex()
-{
- CloseHandle(m_hdl);
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CryLock_WinMutex::Lock()
-{
- WaitForSingleObject(m_hdl, INFINITE);
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CryLock_WinMutex::Unlock()
-{
- ReleaseMutex(m_hdl);
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool CryLock_WinMutex::TryLock()
-{
- return WaitForSingleObject(m_hdl, 0) != WAIT_TIMEOUT;
-}
-
-//////////////////////////////////////////////////////////////////////////
-// CryLock_CritSection
-//////////////////////////////////////////////////////////////////////////
-
-//////////////////////////////////////////////////////////////////////////
-CryLock_CritSection::CryLock_CritSection()
-{
- InitializeCriticalSection((CRITICAL_SECTION*)&m_cs);
-}
-
-//////////////////////////////////////////////////////////////////////////
-CryLock_CritSection::~CryLock_CritSection()
-{
- DeleteCriticalSection((CRITICAL_SECTION*)&m_cs);
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CryLock_CritSection::Lock()
-{
- EnterCriticalSection((CRITICAL_SECTION*)&m_cs);
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CryLock_CritSection::Unlock()
-{
- LeaveCriticalSection((CRITICAL_SECTION*)&m_cs);
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool CryLock_CritSection::TryLock()
-{
- return TryEnterCriticalSection((CRITICAL_SECTION*)&m_cs) != FALSE;
-}
-
-//////////////////////////////////////////////////////////////////////////
-// most of this is taken from http://www.cs.wustl.edu/~schmidt/win32-cv-1.html
-//////////////////////////////////////////////////////////////////////////
-CryConditionVariable::CryConditionVariable()
-{
- m_waitersCount = 0;
- m_wasBroadcast = 0;
- m_sema = CreateSemaphore(NULL, 0, 0x7fffffff, NULL);
- InitializeCriticalSection((CRITICAL_SECTION*)&m_waitersCountLock);
- m_waitersDone = CreateEvent(NULL, FALSE, FALSE, NULL);
-}
-
-//////////////////////////////////////////////////////////////////////////
-CryConditionVariable::~CryConditionVariable()
-{
- CloseHandle(m_sema);
- DeleteCriticalSection((CRITICAL_SECTION*)&m_waitersCountLock);
- CloseHandle(m_waitersDone);
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CryConditionVariable::Wait(LockType& lock)
-{
- EnterCriticalSection((CRITICAL_SECTION*)&m_waitersCountLock);
- m_waitersCount++;
- LeaveCriticalSection((CRITICAL_SECTION*)&m_waitersCountLock);
-
- SignalObjectAndWait(lock._get_win32_handle(), m_sema, INFINITE, FALSE);
-
- EnterCriticalSection((CRITICAL_SECTION*)&m_waitersCountLock);
- m_waitersCount--;
- bool lastWaiter = m_wasBroadcast && m_waitersCount == 0;
- LeaveCriticalSection((CRITICAL_SECTION*)&m_waitersCountLock);
-
- if (lastWaiter)
- {
- SignalObjectAndWait(m_waitersDone, lock._get_win32_handle(), INFINITE, FALSE);
- }
- else
- {
- WaitForSingleObject(lock._get_win32_handle(), INFINITE);
- }
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool CryConditionVariable::TimedWait(LockType& lock, uint32 millis)
-{
- EnterCriticalSection((CRITICAL_SECTION*)&m_waitersCountLock);
- m_waitersCount++;
- LeaveCriticalSection((CRITICAL_SECTION*)&m_waitersCountLock);
-
- bool ok = true;
- if (WAIT_TIMEOUT == SignalObjectAndWait(lock._get_win32_handle(), m_sema, millis, FALSE))
- {
- ok = false;
- }
-
- EnterCriticalSection((CRITICAL_SECTION*)&m_waitersCountLock);
- m_waitersCount--;
- bool lastWaiter = m_wasBroadcast && m_waitersCount == 0;
- LeaveCriticalSection((CRITICAL_SECTION*)&m_waitersCountLock);
-
- if (lastWaiter)
- {
- SignalObjectAndWait(m_waitersDone, lock._get_win32_handle(), INFINITE, FALSE);
- }
- else
- {
- WaitForSingleObject(lock._get_win32_handle(), INFINITE);
- }
-
- return ok;
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CryConditionVariable::NotifySingle()
-{
- EnterCriticalSection((CRITICAL_SECTION*)&m_waitersCountLock);
- bool haveWaiters = m_waitersCount > 0;
- LeaveCriticalSection((CRITICAL_SECTION*)&m_waitersCountLock);
- if (haveWaiters)
- {
- ReleaseSemaphore(m_sema, 1, 0);
- }
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CryConditionVariable::Notify()
-{
- EnterCriticalSection((CRITICAL_SECTION*)&m_waitersCountLock);
- bool haveWaiters = false;
- if (m_waitersCount > 0)
- {
- m_wasBroadcast = 1;
- haveWaiters = true;
- }
- if (haveWaiters)
- {
- ReleaseSemaphore(m_sema, m_waitersCount, 0);
- LeaveCriticalSection((CRITICAL_SECTION*)&m_waitersCountLock);
- WaitForSingleObject(m_waitersDone, INFINITE);
- m_wasBroadcast = 0;
- }
- else
- {
- LeaveCriticalSection((CRITICAL_SECTION*)&m_waitersCountLock);
- }
-}
-
-//////////////////////////////////////////////////////////////////////////
-CrySemaphore::CrySemaphore(int nMaximumCount, int nInitialCount)
-{
- m_Semaphore = (void*)CreateSemaphore(NULL, nInitialCount, nMaximumCount, NULL);
-}
-
-//////////////////////////////////////////////////////////////////////////
-CrySemaphore::~CrySemaphore()
-{
- CloseHandle((HANDLE)m_Semaphore);
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CrySemaphore::Acquire()
-{
- WaitForSingleObject((HANDLE)m_Semaphore, INFINITE);
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CrySemaphore::Release()
-{
- ReleaseSemaphore((HANDLE)m_Semaphore, 1, NULL);
-}
-
-//////////////////////////////////////////////////////////////////////////
-CryFastSemaphore::CryFastSemaphore(int nMaximumCount, int nInitialCount)
- : m_Semaphore(nMaximumCount)
- , m_nCounter(nInitialCount)
-{
-}
-
-//////////////////////////////////////////////////////////////////////////
-CryFastSemaphore::~CryFastSemaphore()
-{
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CryFastSemaphore::Acquire()
-{
- int nCount = ~0;
- do
- {
- nCount = *const_cast(&m_nCounter);
- } while (CryInterlockedCompareExchange(alias_cast(&m_nCounter), nCount - 1, nCount) != nCount);
-
- // if the count would have been 0 or below, go to kernel semaphore
- if ((nCount - 1) < 0)
- {
- m_Semaphore.Acquire();
- }
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CryFastSemaphore::Release()
-{
- int nCount = ~0;
- do
- {
- nCount = *const_cast(&m_nCounter);
- } while (CryInterlockedCompareExchange(alias_cast(&m_nCounter), nCount + 1, nCount) != nCount);
-
- // wake up kernel semaphore if we have waiter
- if (nCount < 0)
- {
- m_Semaphore.Release();
- }
-}
-
-//////////////////////////////////////////////////////////////////////////
-CrySimpleThreadSelf::CrySimpleThreadSelf()
- : m_thread(NULL)
- , m_threadId(0)
-{
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CrySimpleThreadSelf::WaitForThread()
-{
- assert(m_thread);
- PREFAST_ASSUME(m_thread);
- if (GetCurrentThreadId() != m_threadId)
- {
- WaitForSingleObject((HANDLE)m_thread, INFINITE);
- }
-}
-
-CrySimpleThreadSelf::~CrySimpleThreadSelf()
-{
- if (m_thread)
- {
- CloseHandle(m_thread);
- }
-}
-
-void CrySimpleThreadSelf::StartThread(unsigned (__stdcall * func)(void*), void* argList)
-{
-#if defined(AZ_RESTRICTED_PLATFORM)
- #include AZ_RESTRICTED_FILE(CryThreadImpl_windows_h)
-#endif
-#if defined(AZ_RESTRICTED_SECTION_IMPLEMENTED)
-#undef AZ_RESTRICTED_SECTION_IMPLEMENTED
-#else
- m_thread = (void*)_beginthreadex(NULL, 0, func, argList, CREATE_SUSPENDED, &m_threadId);
-#endif
- assert(m_thread);
- PREFAST_ASSUME(m_thread);
- ResumeThread((HANDLE)m_thread);
-}
diff --git a/Code/Legacy/CryCommon/CryThread_dummy.h b/Code/Legacy/CryCommon/CryThread_dummy.h
deleted file mode 100644
index d97b6c5b55..0000000000
--- a/Code/Legacy/CryCommon/CryThread_dummy.h
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
-
-
-#ifndef CRYINCLUDE_CRYCOMMON_CRYTHREAD_DUMMY_H
-#define CRYINCLUDE_CRYCOMMON_CRYTHREAD_DUMMY_H
-#pragma once
-
-#include
-
-//////////////////////////////////////////////////////////////////////////
-CryEvent::CryEvent() {}
-CryEvent::~CryEvent() {}
-void CryEvent::Reset() {}
-void CryEvent::Set() {}
-void CryEvent::Wait() const {}
-bool CryEvent::Wait(const uint32 timeoutMillis) const {}
-typedef CryEvent CryEventTimed;
-
-//////////////////////////////////////////////////////////////////////////
-class _DummyLock
-{
-public:
- _DummyLock();
-
- void Lock();
- bool TryLock();
- void Unlock();
-
-#if defined(AZ_DEBUG_BUILD)
- bool IsLocked();
-#endif
-};
-
-template<>
-class CryLock
- : public _DummyLock
-{
- CryLock(const CryLock&);
- void operator = (const CryLock&);
-
-public:
- CryLock();
-};
-
-template<>
-class CryLock
- : public _DummyLock
-{
- CryLock(const CryLock&);
- void operator = (const CryLock&);
-
-public:
- CryLock();
-};
-
-template<>
-class CryCondLock
- : public CryLock
-{
-};
-
-template<>
-class CryCondLock
- : public CryLock
-{
-};
-
-template<>
-class CryCond< CryLock >
-{
- typedef CryLock LockT;
- CryCond(const CryCond&);
- void operator = (const CryCond&);
-
-public:
- CryCond();
-
- void Notify();
- void NotifySingle();
- void Wait(LockT&);
- bool TimedWait(LockT &, uint32);
-};
-
-template<>
-class CryCond< CryLock >
-{
- typedef CryLock LockT;
- CryCond(const CryCond&);
- void operator = (const CryCond&);
-
-public:
- CryCond();
-
- void Notify();
- void NotifySingle();
- void Wait(LockT&);
- bool TimedWait(LockT &, uint32);
-};
-
-class _DummyRWLock
-{
-public:
- _DummyRWLock() { }
-
- void RLock();
- bool TryRLock();
- void WLock();
- bool TryWLock();
- void Lock() { WLock(); }
- bool TryLock() { return TryWLock(); }
- void Unlock();
-};
-
-template
-class CrySimpleThread
- : public CryRunnable
-{
-public:
- typedef void (* ThreadFunction)(void*);
-
- CrySimpleThread();
- virtual ~CrySimpleThread();
-#if !defined(NO_THREADINFO)
- CryThreadInfo& GetInfo();
-#endif
- const char* GetName();
- void SetName(const char*);
-
- virtual void Run();
- virtual void Cancel();
- virtual void Start(Runnable&, unsigned = 0, const char* = NULL);
- virtual void Start(unsigned = 0, const char* = NULL);
- void StartFunction(ThreadFunction, void* = NULL, unsigned = 0);
-
- void Exit();
- void Join();
- unsigned SetCpuMask(unsigned);
- unsigned GetCpuMask();
-
- void Stop();
- bool IsStarted() const;
- bool IsRunning() const;
-};
-
-#endif // CRYINCLUDE_CRYCOMMON_CRYTHREAD_DUMMY_H
-
diff --git a/Code/Legacy/CryCommon/CryThread_pthreads.h b/Code/Legacy/CryCommon/CryThread_pthreads.h
deleted file mode 100644
index 17f7e5d2a0..0000000000
--- a/Code/Legacy/CryCommon/CryThread_pthreads.h
+++ /dev/null
@@ -1,1076 +0,0 @@
-/*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
-
-
-#pragma once
-
-#include
-
-
-#include
-#include
-#include
-#include
-#include
-
-#include
-#include
-#include
-
-// Section dictionary
-#if defined(AZ_RESTRICTED_PLATFORM)
-#define CRYTHREAD_PTHREADS_H_SECTION_REGISTER_THREAD 1
-#define CRYTHREAD_PTHREADS_H_SECTION_TRAITS 2
-#define CRYTHREAD_PTHREADS_H_SECTION_PTHREADCOND 3
-#define CRYTHREAD_PTHREADS_H_SECTION_SEMAPHORE_CONSTRUCT 4
-#define CRYTHREAD_PTHREADS_H_SECTION_SEMAPHORE_DESTROY 5
-#define CRYTHREAD_PTHREADS_H_SECTION_SEMAPHORE_ACQUIRE 6
-#define CRYTHREAD_PTHREADS_H_SECTION_SEMAPHORE_RELEASE 7
-#define CRYTHREAD_PTHREADS_H_SECTION_TRY_RLOCK 8
-#define CRYTHREAD_PTHREADS_H_SECTION_TRY_WLOCK 9
-#define CRYTHREAD_PTHREADS_H_SECTION_START_RUNNABLE 10
-#define CRYTHREAD_PTHREADS_H_SECTION_START_CPUMASK 11
-#define CRYTHREAD_PTHREADS_H_SECTION_START_CPUMASK_POSTCREATE 12
-#define CRYTHREAD_PTHREADS_H_SECTION_SETCPUMASK 13
-#define CRYTHREAD_PTHREADS_H_SECTION_START_RUNNABLE_CPUMASK_POSTCREATE 14
-#endif
-
-#if defined(AZ_RESTRICTED_PLATFORM)
- #define AZ_RESTRICTED_SECTION CRYTHREAD_PTHREADS_H_SECTION_REGISTER_THREAD
- #include AZ_RESTRICTED_FILE(CryThread_pthreads_h)
-#endif
-#if defined(AZ_RESTRICTED_SECTION_IMPLEMENTED)
- #undef AZ_RESTRICTED_SECTION_IMPLEMENTED
-#endif
-
-#if !defined(RegisterThreadName)
- #define RegisterThreadName(id, name)
- #define UnRegisterThreadName(id)
-#endif
-
-#if defined(APPLE) || defined(ANDROID)
-// PTHREAD_MUTEX_FAST_NP is only defined by Pthreads-w32, thus not on MAC
- #define PTHREAD_MUTEX_FAST_NP PTHREAD_MUTEX_NORMAL
-#endif
-
-// Define LARGE_THREAD_STACK to use larger than normal per-thread stack
-#if defined(_DEBUG) && (defined(MAC) || defined(LINUX) || defined(AZ_PLATFORM_IOS))
-#define LARGE_THREAD_STACK
-#endif
-
-#if defined(LINUX)
-#undef RegisterThreadName
-ILINE void RegisterThreadName(pthread_t id, const char* name)
-{
- if ((!name) || (!id))
- {
- return;
- }
- int ret;
- // pthread names on linux are limited to 16 char
- if (strlen(name) >= 16)
- {
- char thread_name[16];
- memcpy(thread_name, name, 15);
- thread_name[15] = 0;
- ret = pthread_setname_np(id, thread_name);
- }
- else
- {
- ret = pthread_setname_np(id, name);
- }
- if (ret != 0)
- {
- CryLog("Failed to set thread name for %" PRI_THREADID ", name: %s", id, name);
- }
-}
-#endif
-
-#if !defined _CRYTHREAD_HAVE_LOCK
-template
-class _PthreadCond;
-template
-class _PthreadLockBase;
-
-template
-class _PthreadLockAttr
-{
- friend class _PthreadLockBase;
-
-protected:
- _PthreadLockAttr()
- {
- pthread_mutexattr_init(&m_Attr);
- pthread_mutexattr_settype(&m_Attr, PthreadMutexType);
- }
- ~_PthreadLockAttr()
- {
- pthread_mutexattr_destroy(&m_Attr);
- }
- pthread_mutexattr_t m_Attr;
-};
-
-template
-class _PthreadLockBase
-{
-protected:
- static pthread_mutexattr_t& GetAttr()
- {
- static _PthreadLockAttr m_Attr;
- return m_Attr.m_Attr;
- }
-};
-
-template
-class _PthreadLock
- : public _PthreadLockBase
-{
- friend class _PthreadCond;
-
- //#if defined(_DEBUG)
-public:
- //#endif
- pthread_mutex_t m_Lock;
-
-public:
- _PthreadLock()
- : LockCount(0)
- {
- pthread_mutex_init(
- &m_Lock,
- &_PthreadLockBase::GetAttr());
- }
- ~_PthreadLock() { pthread_mutex_destroy(&m_Lock); }
-
- void Lock() { pthread_mutex_lock(&m_Lock); CryInterlockedIncrement(&LockCount); }
-
- bool TryLock()
- {
- const int rc = pthread_mutex_trylock(&m_Lock);
- if (0 == rc)
- {
- CryInterlockedIncrement(&LockCount);
- return true;
- }
- return false;
- }
-
- void Unlock() { CryInterlockedDecrement(&LockCount); pthread_mutex_unlock(&m_Lock); }
-
- // Get the POSIX pthread_mutex_t.
- // Warning:
- // This method will not be available in the Win32 port of CryThread.
- pthread_mutex_t& Get_pthread_mutex_t() { return m_Lock; }
-
- bool IsLocked()
- {
-#if defined(LINUX) || defined(APPLE)
- // implementation taken from CrysisWars
- return LockCount > 0;
-#else
- return true;
-#endif
- }
-
-private:
- volatile int LockCount;
-};
-
-#if defined CRYLOCK_HAVE_FASTLOCK
- #if defined(_DEBUG) && defined(PTHREAD_MUTEX_ERRORCHECK_NP)
-template<>
-class CryLockT
- : public _PthreadLock, PTHREAD_MUTEX_ERRORCHECK_NP>
- #else
-template<>
-class CryLockT
- : public _PthreadLock, PTHREAD_MUTEX_FAST_NP>
- #endif
-{
- CryLockT(const CryLockT&);
- void operator = (const CryLockT&);
-
-public:
- CryLockT() { }
-};
-#endif // CRYLOCK_HAVE_FASTLOCK
-
-template<>
-class CryLockT
- : public _PthreadLock, PTHREAD_MUTEX_RECURSIVE>
-{
- CryLockT(const CryLockT&);
- void operator = (const CryLockT&);
-
-public:
- CryLockT() { }
-};
-
-#if defined(AZ_RESTRICTED_PLATFORM)
- #define AZ_RESTRICTED_SECTION CRYTHREAD_PTHREADS_H_SECTION_TRAITS
- #include AZ_RESTRICTED_FILE(CryThread_pthreads_h)
-#else
-#if !defined(LINUX) && !defined(APPLE)
-#define CRYTHREAD_PTHREADS_H_TRAIT_DEFINE_CRYMUTEX 1
-#endif
-#if !defined(LINUX) && !defined(APPLE)
-#define CRYTHREAD_PTHREADS_H_TRAIT_SET_THREAD_NAME 1
-#endif
-#endif
-
-#if CRYTHREAD_PTHREADS_H_TRAIT_DEFINE_CRYMUTEX
-#if defined CRYLOCK_HAVE_FASTLOCK
-class CryMutex
- : public CryLockT
-{
-};
-#else
-class CryMutex
- : public CryLockT
-{
-};
-#endif
-#endif // CRYTHREAD_PTHREADS_TRAIT_DEFINE_CRYMUTEX
-
-template
-class _PthreadCond
-{
- pthread_cond_t m_Cond;
-
-public:
- _PthreadCond() { pthread_cond_init(&m_Cond, NULL); }
- ~_PthreadCond() { pthread_cond_destroy(&m_Cond); }
- void Notify() { pthread_cond_broadcast(&m_Cond); }
- void NotifySingle() { pthread_cond_signal(&m_Cond); }
- void Wait(LockClass& Lock) { pthread_cond_wait(&m_Cond, &Lock.m_Lock); }
- bool TimedWait(LockClass& Lock, uint32 milliseconds)
- {
- struct timeval now;
- struct timespec timeout;
- int err;
-
- gettimeofday(&now, NULL);
- while (true)
- {
- timeout.tv_sec = now.tv_sec + milliseconds / 1000;
- uint64 nsec = (uint64)now.tv_usec * 1000 + (uint64)milliseconds * 1000000;
- if (nsec >= 1000000000)
- {
- timeout.tv_sec += (long)(nsec / 1000000000);
- nsec %= 1000000000;
- }
- timeout.tv_nsec = (long)nsec;
-#if defined(AZ_RESTRICTED_PLATFORM)
- #define AZ_RESTRICTED_SECTION CRYTHREAD_PTHREADS_H_SECTION_PTHREADCOND
- #include AZ_RESTRICTED_FILE(CryThread_pthreads_h)
-#endif
-#if defined(AZ_RESTRICTED_SECTION_IMPLEMENTED)
- #undef AZ_RESTRICTED_SECTION_IMPLEMENTED
-#else
- err = pthread_cond_timedwait(&m_Cond, &Lock.m_Lock, &timeout);
- if (err == EINTR)
- {
- // Interrupted by a signal.
- continue;
- }
- else if (err == ETIMEDOUT)
- {
- return false;
- }
-#endif
- else
- {
- assert(err == 0);
- }
- break;
- }
- return true;
- }
-
- // Get the POSIX pthread_cont_t.
- // Warning:
- // This method will not be available in the Win32 port of CryThread.
- pthread_cond_t& Get_pthread_cond_t() { return m_Cond; }
-};
-
-#if AZ_LEGACY_CRYCOMMON_TRAIT_USE_PTHREADS
-template
-class CryConditionVariableT
- : public _PthreadCond
-{
-};
-
-#if defined CRYLOCK_HAVE_FASTTLOCK
-template<>
-class CryConditionVariableT< CryLockT >
- : public _PthreadCond< CryLockT >
-{
- typedef CryLockT LockClass;
- CryConditionVariableT(const CryConditionVariableT&);
- CryConditionVariableT& operator = (const CryConditionVariableT&);
-
-public:
- CryConditionVariableT() { }
-};
-#endif // CRYLOCK_HAVE_FASTLOCK
-
-template<>
-class CryConditionVariableT< CryLockT >
- : public _PthreadCond< CryLockT >
-{
- typedef CryLockT LockClass;
- CryConditionVariableT(const CryConditionVariableT&);
- CryConditionVariableT& operator = (const CryConditionVariableT&);
-
-public:
- CryConditionVariableT() { }
-};
-
-#if !defined(_CRYTHREAD_CONDLOCK_GLITCH)
-typedef CryConditionVariableT< CryLockT > CryConditionVariable;
-#else
-typedef CryConditionVariableT< CryLockT > CryConditionVariable;
-#endif
-
-#define _CRYTHREAD_HAVE_LOCK 1
-
-#else // LINUX MAC
-
-#if defined CRYLOCK_HAVE_FASTLOCK
-template<>
-class CryConditionVariable
- : public _PthreadCond< CryLockT >
-{
- typedef CryLockT LockClass;
- CryConditionVariable(const CryConditionVariable&);
- CryConditionVariable& operator = (const CryConditionVariable&);
-
-public:
- CryConditionVariable() { }
-};
-#endif // CRYLOCK_HAVE_FASTLOCK
-
-template<>
-class CryConditionVariable
- : public _PthreadCond< CryLockT >
-{
- typedef CryLockT LockClass;
- CryConditionVariable(const CryConditionVariable&);
- CryConditionVariable& operator = (const CryConditionVariable&);
-
-public:
- CryConditionVariable() { }
-};
-
-#define _CRYTHREAD_HAVE_LOCK 1
-
-#endif // LINUX MAC
-#endif // !defined _CRYTHREAD_HAVE_LOCK
-
-//////////////////////////////////////////////////////////////////////////
-// Platform independet wrapper for a counting semaphore
-class CrySemaphore
-{
-public:
- CrySemaphore(int nMaximumCount, int nInitialCount = 0);
- ~CrySemaphore();
-
- void Acquire();
- void Release();
-
-private:
-#if defined(APPLE)
- // Apple only supports named semaphores so have to use sem_open/unlink/sem_close instead
- // of sem_open/sem_destroy, passing in this array for the name.
- char m_semaphoreName[L_tmpnam];
-#endif
- sem_t* m_Semaphore;
-};
-
-//////////////////////////////////////////////////////////////////////////
-inline CrySemaphore::CrySemaphore(int nMaximumCount, int nInitialCount)
-{
-#if defined(AZ_RESTRICTED_PLATFORM)
- #define AZ_RESTRICTED_SECTION CRYTHREAD_PTHREADS_H_SECTION_SEMAPHORE_CONSTRUCT
- #include AZ_RESTRICTED_FILE(CryThread_pthreads_h)
-#endif
-#if defined(AZ_RESTRICTED_SECTION_IMPLEMENTED)
- #undef AZ_RESTRICTED_SECTION_IMPLEMENTED
-#elif defined(APPLE)
-# pragma clang diagnostic push
-# pragma clang diagnostic ignored "-Wdeprecated-declarations"
- tmpnam(m_semaphoreName);
-# pragma clang diagnostic pop
- m_Semaphore = sem_open(m_semaphoreName, O_CREAT | O_EXCL, 0644, nInitialCount);
-#else
- m_Semaphore = new sem_t;
- sem_init(m_Semaphore, 0, nInitialCount);
-#endif
-}
-
-//////////////////////////////////////////////////////////////////////////
-inline CrySemaphore::~CrySemaphore()
-{
-#if defined(AZ_RESTRICTED_PLATFORM)
- #define AZ_RESTRICTED_SECTION CRYTHREAD_PTHREADS_H_SECTION_SEMAPHORE_DESTROY
- #include AZ_RESTRICTED_FILE(CryThread_pthreads_h)
-#endif
-#if defined(AZ_RESTRICTED_SECTION_IMPLEMENTED)
- #undef AZ_RESTRICTED_SECTION_IMPLEMENTED
-#elif defined(APPLE)
- sem_close(m_Semaphore);
- sem_unlink(m_semaphoreName);
-#else
- sem_destroy(m_Semaphore);
- delete m_Semaphore;
-#endif
-}
-
-//////////////////////////////////////////////////////////////////////////
-inline void CrySemaphore::Acquire()
-{
-#if defined(AZ_RESTRICTED_PLATFORM)
- #define AZ_RESTRICTED_SECTION CRYTHREAD_PTHREADS_H_SECTION_SEMAPHORE_ACQUIRE
- #include AZ_RESTRICTED_FILE(CryThread_pthreads_h)
-#endif
-#if defined(AZ_RESTRICTED_SECTION_IMPLEMENTED)
- #undef AZ_RESTRICTED_SECTION_IMPLEMENTED
-#else
- while (sem_wait(m_Semaphore) != 0 && errno == EINTR)
- {
- ;
- }
-#endif
-}
-
-//////////////////////////////////////////////////////////////////////////
-inline void CrySemaphore::Release()
-{
-#if defined(AZ_RESTRICTED_PLATFORM)
- #define AZ_RESTRICTED_SECTION CRYTHREAD_PTHREADS_H_SECTION_SEMAPHORE_RELEASE
- #include AZ_RESTRICTED_FILE(CryThread_pthreads_h)
-#endif
-#if defined(AZ_RESTRICTED_SECTION_IMPLEMENTED)
- #undef AZ_RESTRICTED_SECTION_IMPLEMENTED
-#else
- sem_post(m_Semaphore);
-#endif
-}
-
-//////////////////////////////////////////////////////////////////////////
-// Platform independet wrapper for a counting semaphore
-// except that this version uses C-A-S only until a blocking call is needed
-// -> No kernel call if there are object in the semaphore
-
-class CryFastSemaphore
-{
-public:
- CryFastSemaphore(int nMaximumCount, int nInitialCount = 0);
- ~CryFastSemaphore();
- void Acquire();
- void Release();
-
-private:
- CrySemaphore m_Semaphore;
- volatile int32 m_nCounter;
-};
-
-//////////////////////////////////////////////////////////////////////////
-inline CryFastSemaphore::CryFastSemaphore(int nMaximumCount, int nInitialCount)
- : m_Semaphore(nMaximumCount)
- , m_nCounter(nInitialCount)
-{
-}
-
-//////////////////////////////////////////////////////////////////////////
-inline CryFastSemaphore::~CryFastSemaphore()
-{
-}
-
-/////////////////////////////////////////////////////////////////////////
-inline void CryFastSemaphore::Acquire()
-{
- int nCount = ~0;
- do
- {
- nCount = *const_cast(&m_nCounter);
- } while (CryInterlockedCompareExchange(alias_cast(&m_nCounter), nCount - 1, nCount) != nCount);
-
- // if the count would have been 0 or below, go to kernel semaphore
- if ((nCount - 1) < 0)
- {
- m_Semaphore.Acquire();
- }
-}
-
-//////////////////////////////////////////////////////////////////////////
-inline void CryFastSemaphore::Release()
-{
- int nCount = ~0;
- do
- {
- nCount = *const_cast(&m_nCounter);
- } while (CryInterlockedCompareExchange(alias_cast(&m_nCounter), nCount + 1, nCount) != nCount);
-
- // wake up kernel semaphore if we have waiter
- if (nCount < 0)
- {
- m_Semaphore.Release();
- }
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// Provide TLS implementation using pthreads for those platforms without __thread
-////////////////////////////////////////////////////////////////////////////////
-
-struct SCryPthreadTLSBase
-{
- SCryPthreadTLSBase(void (*pDestructor)(void*))
- {
- pthread_key_create(&m_kKey, pDestructor);
- }
-
- ~SCryPthreadTLSBase()
- {
- pthread_key_delete(m_kKey);
- }
-
- void* GetSpecific()
- {
- return pthread_getspecific(m_kKey);
- }
-
- void SetSpecific(const void* pValue)
- {
- pthread_setspecific(m_kKey, pValue);
- }
-
- pthread_key_t m_kKey;
-};
-
-template
-struct SCryPthreadTLSImpl{};
-
-template
-struct SCryPthreadTLSImpl
- : private SCryPthreadTLSBase
-{
- SCryPthreadTLSImpl()
- : SCryPthreadTLSBase(NULL)
- {
- }
-
- T Get()
- {
- void* pSpecific(GetSpecific());
- return *reinterpret_cast(&pSpecific);
- }
-
- void Set(const T& kValue)
- {
- SetSpecific(*reinterpret_cast(&kValue));
- }
-};
-
-template
-struct SCryPthreadTLSImpl
- : private SCryPthreadTLSBase
-{
- SCryPthreadTLSImpl()
- : SCryPthreadTLSBase(&Destroy)
- {
- }
-
- T* GetPtr()
- {
- T* pPtr(static_cast(GetSpecific()));
- if (pPtr == NULL)
- {
- pPtr = new T();
- SetSpecific(pPtr);
- }
- return pPtr;
- }
-
- static void Destroy(void* pPointer)
- {
- delete static_cast(pPointer);
- }
-
- const T& Get()
- {
- return *GetPtr();
- }
-
- void Set(const T& kValue)
- {
- *GetPtr() = kValue;
- }
-};
-
-template
-struct SCryPthreadTLS
- : SCryPthreadTLSImpl
-{
-};
-
-
-//////////////////////////////////////////////////////////////////////////
-// CryEvent(Timed) represent a synchronization event
-//////////////////////////////////////////////////////////////////////////
-class CryEventTimed
-{
-public:
- ILINE CryEventTimed(){m_flag = false; }
- ILINE ~CryEventTimed(){}
-
- // Reset the event to the unsignalled state.
- void Reset();
- // Set the event to the signalled state.
- void Set();
- // Access a HANDLE to wait on.
- void* GetHandle() const { return NULL; };
- // Wait indefinitely for the object to become signalled.
- void Wait();
- // Wait, with a time limit, for the object to become signalled.
- bool Wait(const uint32 timeoutMillis);
-
-private:
- // Lock for synchronization of notifications.
- CryCriticalSection m_lockNotify;
-#if defined(LINUX) || defined(APPLE)
- CryConditionVariableT< CryLockT > m_cond;
-#else
- CryConditionVariable m_cond;
-#endif
- volatile bool m_flag;
-};
-
-typedef CryEventTimed CryEvent;
-
-class CrySimpleThreadSelf
-{
-protected:
- static CrySimpleThreadSelf* GetSelf()
- {
- return m_Self;
- }
-
- static void SetSelf(CrySimpleThreadSelf* pSelf)
- {
- m_Self = pSelf;
- }
-private:
- static AZ_THREAD_LOCAL CrySimpleThreadSelf* m_Self;
-};
-
-template