diff --git a/.github/ISSUE_TEMPLATE/ar_bug_report.md b/.github/ISSUE_TEMPLATE/ar_bug_report.md
index 0d4aee9397..93b6e70b03 100644
--- a/.github/ISSUE_TEMPLATE/ar_bug_report.md
+++ b/.github/ISSUE_TEMPLATE/ar_bug_report.md
@@ -1,5 +1,5 @@
---
-name: ar_bug_report.md
+name: Automated Review bug report
about: Create a bug for a an issue found in the Automated Review
title: 'AR Bug Report'
labels: 'needs-triage,kind/bug,kind/automation'
diff --git a/.gitignore b/.gitignore
index 5f6172cd76..9012ec7576 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,7 +3,7 @@
.vscode/
__pycache__
AssetProcessorTemp/**
-[Bb]uild/**
+[Bb]uild/
[Oo]ut/**
CMakeUserPresets.json
[Cc]ache/
diff --git a/Assets/Editor/Scripts/export_all_project_levels.py b/Assets/Editor/Scripts/export_all_project_levels.py
deleted file mode 100755
index ba900b37a8..0000000000
--- a/Assets/Editor/Scripts/export_all_project_levels.py
+++ /dev/null
@@ -1,78 +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
-#
-#
-"""
-This script loads every level in a game project and exports them. You will be prompted with the standard
-Check-Out/Overwrite/Cancel dialog for each level.
-This is useful when there is a version update to a file that requires re-exporting.
-"""
-import sys, os
-import azlmbr.legacy.general as general
-import azlmbr.legacy.checkout_dialog as checkout_dialog
-
-
-class CheckOutDialogEnableAll:
- """
- Helper class to wrap enabling the "Apply to all" checkbox in the CheckOutDialog.
- Guarantees that the old setting will be restored.
- To use, do:
-
- with CheckOutDialogEnableAll():
- # your code here
- """
-
- def __init__(self):
- self.old_setting = False
-
- def __enter__(self):
- self.old_setting = checkout_dialog.enable_for_all(True)
- print(self.old_setting)
-
- def __exit__(self, type, value, traceback):
- checkout_dialog.enable_for_all(self.old_setting)
-
-
-level_list = []
-
-
-def is_in_special_folder(file_full_path):
- if file_full_path.find("_savebackup") >= 0:
- return True
- if file_full_path.find("_autobackup") >= 0:
- return True
- if file_full_path.find("_hold") >= 0:
- return True
- if file_full_path.find("_tmpresize") >= 0:
- return True
-
- return False
-
-
-game_folder = general.get_game_folder()
-
-
-# Recursively search every directory in the game project for files ending with .cry and .ly
-for root, dirs, files in os.walk(game_folder):
- for file in files:
- if file.endswith(".cry") or file.endswith(".ly"):
- # The engine expects the full path of the .cry file
- file_full_path = os.path.abspath(os.path.join(root, file))
- # Exclude files in special directories
- if not is_in_special_folder(file_full_path):
- level_list.append(file_full_path)
-
-# make the checkout dialog enable the 'Apply to all' checkbox
-with CheckOutDialogEnableAll():
-
- # For each valid .cry file found, open it in the editor and export it
- for level in level_list:
- if not isinstance(level, str):
- # general.open_level_no_prompt expects the file path in utf8 format
- level = level.encode("utf-8")
-
- general.open_level_no_prompt(level)
- general.export_to_engine()
diff --git a/Assets/Editor/Scripts/generatelod.py b/Assets/Editor/Scripts/generatelod.py
deleted file mode 100755
index 618827c5b4..0000000000
--- a/Assets/Editor/Scripts/generatelod.py
+++ /dev/null
@@ -1,40 +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
-#
-#
-'''
-Generates a 50% lod for the selected model
-
-@argument name="Lod Percentage", type="string", default="50.0f"
-'''
-
-import sys
-import time
-
-percentage = float(sys.argv[1])
-
-selectedcgf = lodtools.getselected()
-selectedmaterial = lodtools.getselectedmaterial()
-
-loadedmodel = lodtools.loadcgf(selectedcgf)
-loadedmaterial = lodtools.loadmaterial(selectedmaterial)
-
-if loadedmodel == True and loadedmaterial == True:
- lodtools.generatelodchain()
- finished = 0.0
- while finished >= 0.0:
- finished = lodtools.generatetick()
- print 'Lod Chain Generation progress: ' + str(finished)
- time.sleep(1)
- if finished == 1.0:
- break
-
- lodtools.createlod(1,percentage)
- lodtools.generatematerials(1,512,512)
- lodtools.savetextures(1)
- lodtools.savesettings()
- lodtools.reloadmodel()
-
diff --git a/Assets/Editor/Scripts/lua_symbols.py b/Assets/Editor/Scripts/lua_symbols.py
deleted file mode 100644
index b21edb41d0..0000000000
--- a/Assets/Editor/Scripts/lua_symbols.py
+++ /dev/null
@@ -1,116 +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
-#
-#
-
-
-# This script shows basic usage of LuaSymbolsReporterBus,
-# Which can be used to report all symbols available for
-# game scripting with Lua.
-
-import sys
-import os
-
-import azlmbr.bus as azbus
-import azlmbr.script as azscript
-import azlmbr.legacy.general as azgeneral
-
-
-def _dump_class_symbol(class_symbol: azlmbr.script.LuaClassSymbol):
- print(f"** {class_symbol}")
- print("Properties:")
- for property_symbol in class_symbol.properties:
- print(f" - {property_symbol}")
- print("Methods:")
- for method_symbol in class_symbol.methods:
- print(f" - {method_symbol}")
-
-
-def _dump_lua_classes():
- class_symbols = azscript.LuaSymbolsReporterBus(azbus.Broadcast,
- "GetListOfClasses")
- print("======== Classes ==========")
- sorted_classes_by_named = sorted(class_symbols, key=lambda class_symbol: class_symbol.name)
- for class_symbol in sorted_classes_by_named:
- _dump_class_symbol(class_symbol)
- print("\n\n")
-
-
-def _dump_lua_globals():
- global_properties = azscript.LuaSymbolsReporterBus(azbus.Broadcast,
- "GetListOfGlobalProperties")
- print("======== Global Properties ==========")
- sorted_properties_by_name = sorted(global_properties, key=lambda symbol: symbol.name)
- for property_symbol in sorted_properties_by_name:
- print(f"- {property_symbol}")
- print("\n\n")
- global_functions = azscript.LuaSymbolsReporterBus(azbus.Broadcast,
- "GetListOfGlobalFunctions")
- print("======== Global Functions ==========")
- sorted_functions_by_name = sorted(global_functions, key=lambda symbol: symbol.name)
- for function_symbol in sorted_functions_by_name:
- print(f"- {function_symbol}")
- print("\n\n")
-
-
-def _dump_lua_ebus(ebus_symbol: azlmbr.script.LuaEBusSymbol):
- print(f">> {ebus_symbol}")
- sorted_senders = sorted(ebus_symbol.senders, key=lambda symbol: symbol.name)
- for sender in sorted_senders:
- print(f" - {sender}")
- print("\n")
-
-
-def _dump_lua_ebuses():
- ebuses = azscript.LuaSymbolsReporterBus(azbus.Broadcast,
- "GetListOfEBuses")
- print("======== Ebus List ==========")
- sorted_ebuses_by_name = sorted(ebuses, key=lambda symbol: symbol.name)
- for ebus_symbol in sorted_ebuses_by_name:
- _dump_lua_ebus(ebus_symbol)
- print("\n\n")
-
-
-class WhatToDo:
- DumpClasses = "c"
- DumpGlobals = "g"
- DumpEBuses = "e"
-
-if __name__ == "__main__":
- redirecting_stdout = False
- orig_stdout = sys.stdout
- if len(sys.argv) > 1:
- output_file_name = sys.argv[1]
- if not os.path.isabs(output_file_name):
- game_root_path = os.path.normpath(azgeneral.get_game_folder())
- output_file_name = os.path.join(game_root_path, output_file_name)
- try:
- file_obj = open(output_file_name, 'wt')
- sys.stdout = file_obj
- redirecting_stdout = True
- except Exception as e:
- print(f"Failed to open {output_file_name}: {e}")
- sys.exit(-1)
-
- what_to_do = [action.lower() for action in sys.argv[2:]]
-
- # If the user did not specify what to do, then let's dump
- # all the symbols.
- if len(what_to_do) < 1:
- what_to_do = [WhatToDo.DumpClasses, WhatToDo.DumpGlobals, WhatToDo.DumpEBuses]
-
- for action in what_to_do:
- if action == WhatToDo.DumpClasses:
- _dump_lua_classes()
- elif action == WhatToDo.DumpGlobals:
- _dump_lua_globals()
- elif action == WhatToDo.DumpEBuses:
- _dump_lua_ebuses()
-
- if redirecting_stdout:
- sys.stdout.close()
- sys.stdout = orig_stdout
- print(f" Lua Symbols Are available in: {output_file_name}")
diff --git a/Assets/Editor/Scripts/rename_cgf.py b/Assets/Editor/Scripts/rename_cgf.py
deleted file mode 100755
index 1196c4c6a2..0000000000
--- a/Assets/Editor/Scripts/rename_cgf.py
+++ /dev/null
@@ -1,14 +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
-#
-#
-objects = general.get_all_objects("", "") # Get the name list of all objects in the level.
-# If there is any object with the geometry file of "objects\\default\\primitive_box.cgf",
-# change it to "objects\\default\\primitive_cube.cgf".
-for obj in objects:
- geometry_file = general.get_entity_geometry_file(obj)
- if geometry_file == "objects\\default\\primitive_box.cgf":
- general.set_entity_geometry_file(obj, "objects\\default\\primitive_cube.cgf")
diff --git a/Assets/Editor/Scripts/select_story_anim_objects.py b/Assets/Editor/Scripts/select_story_anim_objects.py
deleted file mode 100755
index 93021baac4..0000000000
--- a/Assets/Editor/Scripts/select_story_anim_objects.py
+++ /dev/null
@@ -1,14 +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
-#
-#
-objects = general.get_all_objects("AnimObject", "") # Get the name list of all anim objects in the level.
-general.clear_selection()
-# If there is any object with the geometry file whose name contains "\\story\\", select it
-for obj in objects:
- geometry_file = general.get_entity_geometry_file(obj)
- if geometry_file.find("\\story\\") != -1:
- general.select_object(obj)
diff --git a/Assets/Editor/Scripts/tools_shelf_actions.py b/Assets/Editor/Scripts/tools_shelf_actions.py
deleted file mode 100755
index 8b99d76e1f..0000000000
--- a/Assets/Editor/Scripts/tools_shelf_actions.py
+++ /dev/null
@@ -1,508 +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
-#
-#
-import __future__
-import time, re, os, sys, itertools, ast
-import azlmbr.legacy.general as general
-
-global ctrlFile
-ctrlFile = 'setState.txt'
-global logfile
-logfile = 'Editor.log'
-
-global HIDDEN_MASK_PREFIX
-HIDDEN_MASK_PREFIX= 'hidden_mask_for_'
-global HIDDEN_MASK_PREFIX_LENGTH
-HIDDEN_MASK_PREFIX_LENGTH = len(HIDDEN_MASK_PREFIX)
-
-def getLogList(logfile):
- logList = [x for x in open(logfile, 'r')]
- return logList
-
-def getCheckList(ctrlFile):
- try:
- with open(ctrlFile):
- stateList = open(ctrlFile, 'r')
-
- except:
- open(ctrlFile, 'w').close()
- stateList = open(ctrlFile, 'r')
-
- checkList = [x for x in stateList]
- return checkList
-
-#Store/Restore CVars default values -----------------------------------------------------------------#
-if 'CVARS' not in globals():
- CVARS = {}
-
-def saveDefaultValue(cVars, value):
- if cVars not in CVARS:
- CVARS[cVars] = value
-
-def restoreDefaultValue(cVars):
- if cVars not in CVARS:
- return
-
- defaultValue = CVARS[cVars]
- del CVARS[cVars]
- if cVars.startswith(HIDDEN_MASK_PREFIX):
- type = cVars[HIDDEN_MASK_PREFIX_LENGTH:]
- general.set_hidemask(type, defaultValue)
- else:
- general.set_cvar(cVars, defaultValue)
-
-#toggle CVars--------------------------------------------------------------------#
-
-def updateCvars(cVars, value):
- saveDefaultValue(cVars, value)
- general.set_cvar(cVars, value)
-
-def toggleCvarsRestartCheck(log, state, mode, cVars, onValue, offValue, ctrlFile):
- if log in state:
- toggleCvarsV(mode, cVars, onValue, offValue, ctrlFile)
- else:
- stateList = open(ctrlFile, 'w')
- stateList.write(log)
- stateList = open(ctrlFile, 'r')
- toggleCvarsV(mode, cVars, onValue, offValue, ctrlFile)
-
-def toggleCvarsV(mode, cVars, onValue, offValue, ctrlFile):
- stateList = open(ctrlFile, 'r')
- setState = [x for x in enumerate(stateList)]
- blankCheck = [x for x in setState]
- getList = [x for x in stateList]
-
- if blankCheck == []:
- stateList = open(ctrlFile, 'w')
- stateList.write(''.join(str("%s,{'%s': %s}" % (mode, cVars, offValue))+'\n'))
- general.set_cvar(cVars, offValue)
- else:
- stateList = open(ctrlFile, 'r')
- checkFor = str([x for x in stateList])
-
- if mode not in str(checkFor):
- stateList = open(ctrlFile, 'r')
- getList = [x for x in stateList]
- getList.insert(1, str("%s,{'%s': %s}\n" % (mode, cVars , offValue)))
- print (str("{'%s': %s}\n" % (cVars , offValue)))
- stateList = open(ctrlFile, 'w')
- stateList.write(''.join(getList))
- general.set_cvar(cVars, offValue)
-
- else:
- stateList = open(ctrlFile, 'r')
- for d in enumerate(stateList):
- values = d[1].split(',')
- stateList = open(ctrlFile, 'r')
- getList = [x for x in stateList]
-
- if mode in values[0]:
- getDict = ast.literal_eval(values[1])
- getState = getDict.get(cVars)
-
- if getState == offValue:
- getDict[cVars] = onValue
- joinStr = [mode,",",str(getDict), '\n']
- newLine = ''.join(joinStr)
- print (getDict)
- getList[d[0]] = newLine
- stateList = open(ctrlFile, 'w')
- stateList.write(''.join(str(''.join(getList))))
- general.set_cvar(cVars, onValue)
- else:
- getDict[cVars] = offValue
- joinStr = [mode,",",str(getDict), '\n']
- newLine = ''.join(joinStr)
- print (getDict)
- getList[d[0]] = newLine
- stateList = open(ctrlFile, 'w')
- stateList.write(''.join(str(''.join(getList))))
- general.set_cvar(cVars, offValue)
-
-def toggleCvarsValue(mode, cVars, onValue, offValue):
- currentValue = general.get_cvar(cVars)
-
- if type(onValue) is str:
- saveDefaultValue(cVars, currentValue)
- elif type(onValue) is int:
- saveDefaultValue(cVars, int(currentValue))
- elif type(onValue) is float:
- saveDefaultValue(cVars, float(currentValue))
- else:
- general.log('Failed to store default value for {0}'.format(cVars))
-
- if currentValue == str(onValue):
- general.set_cvar(cVars, offValue)
- else:
- general.set_cvar(cVars, onValue)
-
-#toggleConsol--------------------------------------------------------------------#
-
-def toggleConsolRestartCheck(log,state, mode, onValue, offValue, ctrlFile):
- if log in state:
- toggleConsolV(mode, onValue, offValue, ctrlFile)
- else:
- stateList = open(ctrlFile, 'w')
- stateList.write(log)
- stateList = open(ctrlFile, 'r')
- toggleConsolV(mode, onValue, offValue, ctrlFile)
-
-def toggleConsolV(mode, onValue, offValue):
- stateList = open(ctrlFile, 'r')
- setState = [x for x in enumerate(stateList)]
- blankCheck = [x for x in setState]
- getList = [x for x in stateList]
- onOffList = [onValue, offValue]
-
- if blankCheck == []:
- stateList = open(ctrlFile, 'w')
- stateList.write(''.join(str("%s,'%s'" % (mode, offValue))+'\n'))
- general.run_console(offValue)
- else:
- stateList = open(ctrlFile, 'r')
- checkFor = str([x for x in stateList])
-
- if mode not in str(checkFor):
- stateList = open(ctrlFile, 'r')
- getList = [x for x in stateList]
- getList.insert(1, str("%s,'%s'\n" % (mode, offValue)))
- print (str("{'%s': %s}\n" % (cVars , offValue)))
- stateList = open(ctrlFile, 'w')
- stateList.write(''.join(getList))
- general.run_console(onValue)
-
- else:
- stateList = open(ctrlFile, 'r')
- for d in enumerate(stateList):
-
- values = d[1].split(',')
-
- stateList = open(ctrlFile, 'r')
- getList = [x for x in stateList]
-
- if mode in values[0]:
- getDict = values[1]
- off = ["'",str(offValue),"'", '\n']
- joinoff = ''.join(off)
-
- if values[1] == joinoff:
- getDict = onValue
- joinStr = [mode,",","'",getDict,"'", '\n']
- newLine = ''.join(joinStr)
- print (getDict)
- getList[d[0]] = str(newLine)
- stateList = open(ctrlFile, 'w')
- stateList.write(''.join(str(''.join(getList))))
- general.run_console(onValue)
- else:
- getDict = offValue
- joinStr = [mode,",","'",getDict,"'", '\n']
- newLine = ''.join(joinStr)
- print (getDict)
- getList[d[0]] = str(newLine)
- stateList = open(ctrlFile, 'w')
- stateList.write(''.join(str(''.join(getList))))
- general.run_console(offValue)
-
-def toggleConsolValue(log, state, mode, onValue, offValue):
- logList = getLogList(logfile)
- checkList = getCheckList(ctrlFile)
- toggleConsolRestartCheck(logList[1],checkList, mode, onValue, offValue, ctrlFile)
-
-#cycleCvars----------------------------------------------------------------------#
-
-def cycleCvarsRestartCheck(log, state, mode, cVars, cycleList, ctrlFile):
- if log in state:
- cycleCvarsV(mode, cVars, cycleList, ctrlFile)
- else:
- stateList = open(ctrlFile, 'w')
- stateList.write(log)
- stateList = open(ctrlFile, 'r')
- cycleCvarsV(mode, cVars, cycleList, ctrlFile)
-
-def cycleCvarsV(mode, cVars, cycleList, ctrlFile):
- stateList = open(ctrlFile, 'r')
- setState = [x for x in enumerate(stateList)]
- blankCheck = [x for x in setState]
- getList = [x for x in stateList]
-
- if blankCheck == []:
- stateList = open(ctrlFile, 'w')
- stateList.write(''.join(str("%s,{'%s': %s}" % (mode, cVars, cycleList[1]))+'\n'))
- general.set_cvar(cVars, cycleList[1])
- else:
- stateList = open(ctrlFile, 'r')
- checkFor = str([x for x in stateList])
-
- if mode not in str(checkFor):
- stateList = open(ctrlFile, 'r')
- getList = [x for x in stateList]
- getList.insert(1, str("%s,{'%s': %s}\n" % (mode, cVars , cycleList[1])))
- stateList = open(ctrlFile, 'w')
- stateList.write(''.join(getList))
- general.set_cvar(cVars, cycleList[1])
-
- else:
- stateList = open(ctrlFile, 'r')
-
- for d in enumerate(stateList):
- stateList = open(ctrlFile, 'r')
- getList = [x for x in stateList]
- values = d[1].split(',')
-
- if mode in values[0]:
- getDict = ast.literal_eval(values[1])
- getState = getDict.get(cVars)
-
- cycleL = [x for x in enumerate(cycleList)]
-
- for x in cycleL:
- if getState == x[1]:
- number = [n[1] for n in cycleL]
- getMax = max(number)
- nextNum = x[0]+1
-
- if nextNum > getMax:
- getDict[cVars] = cycleList[0]
- joinStr = [mode,",",str(getDict), '\n']
- newLine = ''.join(joinStr)
- getList[d[0]] = newLine
- print (getDict)
- stateList = open(ctrlFile, 'w')
- stateList.write(''.join(str(''.join(getList))))
- general.set_cvar(cVars, cycleList[0])
- else:
- getDict[cVars] = cycleList[x[0]+1]
- joinStr = [mode,",",str(getDict), '\n']
- newLine = ''.join(joinStr)
- getList[d[0]] = newLine
- print (getDict)
- stateList = open(ctrlFile, 'w')
- stateList.write(''.join(str(''.join(getList))))
- general.set_cvar(cVars, cycleList[x[0]+1])
-
-def cycleCvarsValue(log, state, mode, cVars, cycleList):
- logList = getLogList(logfile)
- checkList = getCheckList(ctrlFile)
- cycleCvarsRestartCheck(logList[1],checkList, mode, cVars, cycleList, ctrlFile)
-
-def cycleCvarsFloatValue(cVars, cycleList):
- currentValueAsString = general.get_cvar(cVars)
- try:
- currentValue = float(currentValueAsString)
- except:
- currentValue = -1.0
-
- saveDefaultValue(cVars, currentValue)
-
- # make sure we sort the list in ascending fashion
- cycleList = sorted(cycleList)
-
- # find out what the next closest index is
- newIndex = 0
- for x in cycleList:
- if (currentValue < x):
- break
- newIndex = newIndex + 1
-
- # loop around, if we need to
- if newIndex >= len(cycleList):
- newIndex = 0
-
- general.set_cvar(cVars, cycleList[newIndex])
-
-
-def cycleCvarsIntValue(cVars, cycleList):
- currentValueAsString = general.get_cvar(cVars)
- try:
- currentValue = int(currentValueAsString)
- except:
- currentValue = 0
-
- saveDefaultValue(cVars, currentValue)
-
- # find out what index we're on already
- # default to -1 so that when we increment to the next, we'll be at 0
- newIndex = -1
- for x in cycleList:
- if (currentValue == x):
- break
- newIndex = newIndex + 1
-
- # move to the next item
- newIndex = newIndex + 1
-
- # validate
- if newIndex >= len(cycleList):
- newIndex = 0
-
- general.set_cvar(cVars, cycleList[newIndex])
-
-#cycleConsol----------------------------------------------------------------------#
-
-def cycleConsolRestartCheck(log, state, mode, cycleList, ctrlFile):
- if log in state:
- cycleConsolV(mode, cycleList, ctrlFile)
- else:
- stateList = open(ctrlFile, 'w')
- stateList.write(log)
- stateList = open(ctrlFile, 'r')
- cycleConsolV(mode, cycleList, ctrlFile)
-
-def cycleConsolV(mode, cycleList, ctrlFile):
- stateList = open(ctrlFile, 'r')
- setState = [x for x in enumerate(stateList)]
- blankCheck = [x for x in setState]
- getList = [x for x in stateList]
-
- if blankCheck == []:
- stateList = open(ctrlFile, 'w')
- stateList.write(''.join(str("%s,'%s'" % (mode, cycleList[0]))+'\n'))
- general.run_console(cycleList[0])
- else:
- stateList = open(ctrlFile, 'r')
- checkFor = str([x for x in stateList])
-
- if mode not in str(checkFor):
- stateList = open(ctrlFile, 'r')
- getList = [x for x in stateList]
- getList.insert(1, str("%s,'%s'\n" % (mode, cycleList[0])))
- stateList = open(ctrlFile, 'w')
- stateList.write(''.join(getList))
- general.run_console(cycleList[0])
-
- else:
- stateList = open(ctrlFile, 'r')
- for d in enumerate(stateList):
- stateList = open(ctrlFile, 'r')
- getList = [x for x in stateList]
- values = d[1].split(',')
-
- if mode in values[0]:
- newValue = ''.join(values[1].split('\n'))
- cycleL = [e for e in enumerate(cycleList)]
- getDict = ''.join(values[1].split('\n'))
-
- for x in cycleL:
-
- if newValue in "'%s'" % x[1]:
- number = [n[0] for n in cycleL]
- getMax = max(number)
- nextNum = x[0]+1
-
- if nextNum > getMax:
- getDict = '%s' % cycleList[0]
- joinStr = [mode,",","'",getDict,"'", '\n']
- newLine = ''.join(joinStr)
- getList[d[0]] = newLine
- print (getDict)
- stateList = open(ctrlFile, 'w')
- stateList.write(''.join(str(''.join(getList))))
- general.run_console(getDict)
- else:
- getDict = '%s' % cycleList[x[0]+1]
- joinStr = [mode,",","'",getDict,"'", '\n']
- newLine = ''.join(joinStr)
- getList[d[0]] = newLine
- print (getDict)
- stateList = open(ctrlFile, 'w')
- stateList.write(''.join(str(''.join(getList))))
- general.run_console(getDict)
-
-def cycleConsolValue(mode, cycleList):
- logList = getLogList(logfile)
- checkList = getCheckList(ctrlFile)
- cycleConsolRestartCheck(logList[1],checkList, mode, cycleList, ctrlFile)
-
-def toggleHideMaskValues(type):
- cVars = "%s%s" % (HIDDEN_MASK_PREFIX, type)
- currentValue = general.get_hidemask(type)
- saveDefaultValue(cVars, int(currentValue))
- if (currentValue):
- general.set_hidemask(type, 0)
- else:
- general.set_hidemask(type, 1)
-
-#toggleHide------------------------------------------------------------------------#
-
-def toggleHideRestartCheck(log, state, mode, type, onValue, offValue, ctrlFile):
- if log in state:
- toggleHideByT(mode, type, onValue, offValue, ctrlFile)
- else:
- stateList = open(ctrlFile, 'w')
- stateList.write(log)
- stateList = open(ctrlFile, 'r')
- toggleHideByT(mode, type, onValue, offValue, ctrlFile)
-
-def toggleHideByType(mode, type, onValue, offValue):
- logList = getLogList(logfile)
- checkList = getCheckList(ctrlFile)
- toggleHideRestartCheck(logList[1],checkList, mode, type, onValue, offValue, ctrlFile)
-
-def toggleHideByT(mode, type, onValue, offValue, ctrlFile):
- stateList = open(ctrlFile, 'r')
- setState = [x for x in enumerate(stateList)]
- blankCheck = [x for x in setState]
- getList = [x for x in stateList]
-
- if blankCheck == []:
- stateList = open(ctrlFile, 'w')
- stateList.write(''.join(str("%s,{'%s': %s}" % (mode, type, offValue))+'\n'))
-
- hideByType(type)
- else:
- stateList = open(ctrlFile, 'r')
- checkFor = str([x for x in stateList])
-
- if mode not in str(checkFor):
- stateList = open(ctrlFile, 'r')
- getList = [x for x in stateList]
- getList.insert(1, str("%s,{'%s': %s}\n" % (mode, type , offValue)))
- print (str("{'%s': %s}\n" % (type , offValue)))
- stateList = open(ctrlFile, 'w')
- stateList.write(''.join(getList))
- hideByType(type)
-
- else:
- stateList = open(ctrlFile, 'r')
- for d in enumerate(stateList):
- values = d[1].split(',')
- stateList = open(ctrlFile, 'r')
- getList = [x for x in stateList]
-
- if mode in values[0]:
- getDict = ast.literal_eval(values[1])
- getState = getDict.get(type)
-
- if getState == offValue:
- getDict[type] = onValue
- joinStr = [mode,",",str(getDict), '\n']
- newLine = ''.join(joinStr)
- print (getDict)
- getList[d[0]] = newLine
- stateList = open(ctrlFile, 'w')
- stateList.write(''.join(str(''.join(getList))))
- unHideByType(type)
- else:
- getDict[type] = offValue
- joinStr = [mode,",",str(getDict), '\n']
- newLine = ''.join(joinStr)
- print (getDict)
- getList[d[0]] = newLine
- stateList = open(ctrlFile, 'w')
- stateList.write(''.join(str(''.join(getList))))
- hideByType(type)
-
-def hideByType(type):
- typeList = general.get_all_objects(str(type), "")
- for x in typeList:
- general.hide_object(x)
-
-def unHideByType(type):
- typeList = general.get_all_objects(str(type), "")
- for x in typeList:
- general.unhide_object(x)
diff --git a/Assets/Editor/Translation/scriptcanvas_en_us.ts b/Assets/Editor/Translation/scriptcanvas_en_us.ts
index 7b8361c879..6d436b7caf 100644
--- a/Assets/Editor/Translation/scriptcanvas_en_us.ts
+++ b/Assets/Editor/Translation/scriptcanvas_en_us.ts
@@ -62164,7 +62164,7 @@ An Entity can be selected by using the pick button, or by dragging an Entity fro
HANDLER_TAGGLOBALNOTIFICATIONBUS_ONENTITYTAGADDED_OUTPUT0_NAME
Simple Type: EntityID C++ Type: const EntityId&
- Entity
+ EntityID
HANDLER_TAGGLOBALNOTIFICATIONBUS_ONENTITYTAGADDED_OUTPUT0_TOOLTIP
@@ -62202,7 +62202,7 @@ An Entity can be selected by using the pick button, or by dragging an Entity fro
HANDLER_TAGGLOBALNOTIFICATIONBUS_ONENTITYTAGREMOVED_OUTPUT0_NAME
Simple Type: EntityID C++ Type: const EntityId&
- Entity
+ EntityId
HANDLER_TAGGLOBALNOTIFICATIONBUS_ONENTITYTAGREMOVED_OUTPUT0_TOOLTIP
@@ -81852,7 +81852,7 @@ The element is removed from its current parent and added as a child of the new p
HANDLER_SPAWNERCOMPONENTNOTIFICATIONBUS_ONENTITYSPAWNED_OUTPUT1_NAME
Simple Type: EntityID C++ Type: const EntityId&
- Entity
+ EntityID
HANDLER_SPAWNERCOMPONENTNOTIFICATIONBUS_ONENTITYSPAWNED_OUTPUT1_TOOLTIP
@@ -89198,7 +89198,7 @@ The element is removed from its current parent and added as a child of the new p
HANDLER_ENTITYBUS_ONENTITYACTIVATED_OUTPUT0_NAME
Simple Type: EntityID C++ Type: const EntityId&
- Entity
+ EntityID
HANDLER_ENTITYBUS_ONENTITYACTIVATED_OUTPUT0_TOOLTIP
@@ -89236,7 +89236,7 @@ The element is removed from its current parent and added as a child of the new p
HANDLER_ENTITYBUS_ONENTITYDEACTIVATED_OUTPUT0_NAME
Simple Type: EntityID C++ Type: const EntityId&
- Entity
+ EntityID
HANDLER_ENTITYBUS_ONENTITYDEACTIVATED_OUTPUT0_TOOLTIP
diff --git a/Assets/Engine/EngineAssets/Slices/DefaultLevelSetup.slice b/Assets/Engine/EngineAssets/Slices/DefaultLevelSetup.slice
index 1b7dfdf40d..b82c482c4f 100644
--- a/Assets/Engine/EngineAssets/Slices/DefaultLevelSetup.slice
+++ b/Assets/Engine/EngineAssets/Slices/DefaultLevelSetup.slice
@@ -145,7 +145,7 @@
-
+
diff --git a/Assets/Engine/Entities/GeomCache.ent b/Assets/Engine/Entities/GeomCache.ent
deleted file mode 100644
index e7a63190c3..0000000000
--- a/Assets/Engine/Entities/GeomCache.ent
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:cf441215a769562f88aa20711aee68dadcbf02597d1e2270547055e8e6aec6a3
-size 77
diff --git a/Assets/Engine/Scripts/Entities/Render/GeomCache.lua b/Assets/Engine/Scripts/Entities/Render/GeomCache.lua
deleted file mode 100644
index b496aecd8d..0000000000
--- a/Assets/Engine/Scripts/Entities/Render/GeomCache.lua
+++ /dev/null
@@ -1,178 +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
---
---
---
-----------------------------------------------------------------------------------------------------
-Script.ReloadScript("scripts/Utils/EntityUtils.lua")
-
-GeomCache =
-{
- Properties = {
- geomcacheFile = "EngineAssets/GeomCaches/defaultGeomCache.cax",
- bPlaying = 0,
- fStartTime = 0,
- bLooping = 0,
- objectStandIn = "",
- materialStandInMaterial = "",
- objectFirstFrameStandIn = "",
- materialFirstFrameStandInMaterial = "",
- objectLastFrameStandIn = "",
- materialLastFrameStandInMaterial = "",
- fStandInDistance = 0,
- fStreamInDistance = 0,
- Physics = {
- bPhysicalize = 0,
- }
- },
-
- Editor={
- Icon = "animobject.bmp",
- IconOnTop = 1,
- },
-
- bPlaying = 0,
- currentTime = 0,
- precacheTime = 0,
- bPrecachedOutputTriggered = false,
-}
-
-function GeomCache:OnLoad(table)
- self.currentTime = table.currentTime;
-end
-
-function GeomCache:OnSave(table)
- table.currentTime = self.currentTime;
-end
-
-function GeomCache:OnSpawn()
- self.currentTime = self.Properties.fStartTime;
- self:SetFromProperties();
-end
-
-function GeomCache:OnReset()
- self.currentTime = self.Properties.fStartTime;
- self.bPrecachedOutputTriggered = true;
- self:SetFromProperties();
-end
-
-function GeomCache:SetFromProperties()
- local Properties = self.Properties;
-
- if (Properties.geomcacheFile == "") then
- do return end;
- end
-
- self:LoadGeomCache(0, Properties.geomcacheFile);
-
- self.bPlaying = Properties.bPlaying;
- if (self.bPlaying == 0) then
- self.currentTime = Properties.fStartTime;
- end
-
- self:SetGeomCachePlaybackTime(self.currentTime);
- self:SetGeomCacheParams(Properties.bLooping, Properties.objectStandIn, Properties.materialStandInMaterial, Properties.objectFirstFrameStandIn,
- Properties.materialFirstFrameStandInMaterial, Properties.objectLastFrameStandIn, Properties.materialLastFrameStandInMaterial,
- Properties.fStandInDistance, Properties.fStreamInDistance);
- self:SetGeomCacheStreaming(false, 0);
-
- if (Properties.Physics.bPhysicalize == 1) then
- local tempPhysParams = EntityCommon.TempPhysParams;
- self:Physicalize(0, PE_ARTICULATED, tempPhysParams);
- end
-
- self:Activate(1);
-end
-
-function GeomCache:PhysicalizeThis()
- local Physics = self.Properties.Physics;
- EntityCommon.PhysicalizeRigid(self, 0, Physics, false);
-end
-
-function GeomCache:OnUpdate(dt)
- if (self.bPlaying == 1) then
- self:SetGeomCachePlaybackTime(self.currentTime);
- end
-
- if (self:IsGeomCacheStreaming() and not self.bPrecachedOutputTriggered) then
- local precachedTime = self:GetGeomCachePrecachedTime();
- if (precachedTime >= self.precacheTime) then
- self:ActivateOutput("Precached", true);
- self.bPrecachedOutputTriggered = true;
- end
- end
-
- if (self.bPlaying == 1) then
- self.currentTime = self.currentTime + dt;
- end
-end
-
-function GeomCache:OnPropertyChange()
- self:SetFromProperties();
-end
-
-function GeomCache:Event_Start(sender, val)
- self.bPlaying = 1;
-end
-
-function GeomCache:Event_Stop(sender, value)
- self.bPlaying = 0;
-end
-
-function GeomCache:Event_SetTime(sender, value)
- self.currentTime = value;
-end
-
-function GeomCache:Event_StartStreaming(sender, value)
- self.bPrecachedOutputTriggered = false;
- self:SetGeomCacheStreaming(true, self.currentTime);
-end
-
-function GeomCache:Event_StopStreaming(sender, value)
- self:SetGeomCacheStreaming(false, 0);
-end
-
-function GeomCache:Event_PrecacheTime(sender, value)
- self.precacheTime = value;
-end
-
-function GeomCache:Event_Hide(sender, value)
- self:Hide(1);
-end
-
-function GeomCache:Event_Unhide(sender, value)
- self:Hide(0);
-end
-
-function GeomCache:Event_StopDrawing(sender, value)
- self:SetGeomCacheDrawing(false);
-end
-
-function GeomCache:Event_StartDrawing(sender, value)
- self:SetGeomCacheDrawing(true);
-end
-
-GeomCache.FlowEvents =
-{
- Inputs =
- {
- Start = { GeomCache.Event_Start, "any" },
- Stop = { GeomCache.Event_Stop, "any" },
- SetTime = { GeomCache.Event_SetTime, "float" },
- StartStreaming = { GeomCache.Event_StartStreaming, "any" },
- StopStreaming = { GeomCache.Event_StopStreaming, "any" },
- PrecacheTime = { GeomCache.Event_PrecacheTime, "float" },
- Hide = { GeomCache.Event_Hide, "any" },
- Unhide = { GeomCache.Event_Unhide, "any" },
- StopDrawing = { GeomCache.Event_StopDrawing, "any" },
- StartDrawing = { GeomCache.Event_StartDrawing, "any" },
- },
- Outputs =
- {
- Precached = "bool",
- },
-}
diff --git a/AutomatedTesting/Assets/Physics/Collider_PxMeshAutoAssigned/SphereBot/r0-b_body.fbx.assetinfo b/AutomatedTesting/Assets/Physics/Collider_PxMeshAutoAssigned/SphereBot/R0-B_Body.fbx.assetinfo
similarity index 100%
rename from AutomatedTesting/Assets/Physics/Collider_PxMeshAutoAssigned/SphereBot/r0-b_body.fbx.assetinfo
rename to AutomatedTesting/Assets/Physics/Collider_PxMeshAutoAssigned/SphereBot/R0-B_Body.fbx.assetinfo
diff --git a/AutomatedTesting/Assets/Physics/Collider_PxMeshConvexMeshCollides/SphereBot/r0-b_body.fbx.assetinfo b/AutomatedTesting/Assets/Physics/Collider_PxMeshConvexMeshCollides/SphereBot/R0-B_Body.fbx.assetinfo
similarity index 100%
rename from AutomatedTesting/Assets/Physics/Collider_PxMeshConvexMeshCollides/SphereBot/r0-b_body.fbx.assetinfo
rename to AutomatedTesting/Assets/Physics/Collider_PxMeshConvexMeshCollides/SphereBot/R0-B_Body.fbx.assetinfo
diff --git a/AutomatedTesting/CMakeLists.txt b/AutomatedTesting/CMakeLists.txt
index dee9d73aea..1c5382ba4b 100644
--- a/AutomatedTesting/CMakeLists.txt
+++ b/AutomatedTesting/CMakeLists.txt
@@ -8,11 +8,12 @@
if(NOT PROJECT_NAME)
cmake_minimum_required(VERSION 3.20)
+ include(cmake/CompilerSettings.cmake)
project(AutomatedTesting
LANGUAGES C CXX
VERSION 1.0.0.0
)
- include(EngineFinder.cmake OPTIONAL)
+ include(cmake/EngineFinder.cmake OPTIONAL)
find_package(o3de REQUIRED)
o3de_initialize()
else()
diff --git a/AutomatedTesting/Editor/Scripts/auto_lod.py b/AutomatedTesting/Editor/Scripts/auto_lod.py
new file mode 100644
index 0000000000..058303242a
--- /dev/null
+++ b/AutomatedTesting/Editor/Scripts/auto_lod.py
@@ -0,0 +1,124 @@
+#
+# 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
+#
+#
+import os, traceback, binascii, sys, json, pathlib, logging
+import azlmbr.math
+import azlmbr.bus
+from scene_helpers import *
+
+#
+# SceneAPI Processor
+#
+
+def update_manifest(scene):
+ import uuid
+ import azlmbr.scene as sceneApi
+ import azlmbr.scene.graph
+ from scene_api import scene_data as sceneData
+
+ graph = sceneData.SceneGraph(scene.graph)
+ # Get a list of all the mesh nodes, as well as all the nodes
+ mesh_name_list, all_node_paths = get_mesh_node_names(graph)
+ mesh_name_list.sort(key=lambda node: str.casefold(node.get_path()))
+ scene_manifest = sceneData.SceneManifest()
+
+ clean_filename = scene.sourceFilename.replace('.', '_')
+
+ # Compute the filename of the scene file
+ source_basepath = scene.watchFolder
+ source_relative_path = os.path.dirname(os.path.relpath(clean_filename, source_basepath))
+ source_filename_only = os.path.basename(clean_filename)
+
+ created_entities = []
+ previous_entity_id = azlmbr.entity.InvalidEntityId
+ first_mesh = True
+
+ # Make a list of mesh node paths
+ mesh_path_list = list(map(lambda node: node.get_path(), mesh_name_list))
+
+ # Assume the first mesh is the main mesh
+ main_mesh = mesh_name_list[0]
+ mesh_path = main_mesh.get_path()
+
+ # Create a unique mesh group name using the filename + node name
+ mesh_group_name = '{}_{}'.format(source_filename_only, main_mesh.get_name())
+ # Remove forbidden filename characters from the name since this will become a file on disk later
+ mesh_group_name = "".join(char for char in mesh_group_name if char not in "|<>:\"/?*\\")
+ # Add the MeshGroup to the manifest and give it a unique ID
+ mesh_group = scene_manifest.add_mesh_group(mesh_group_name)
+ mesh_group['id'] = '{' + str(uuid.uuid5(uuid.NAMESPACE_DNS, source_filename_only + mesh_path)) + '}'
+ # Set our current node as the only node that is included in this MeshGroup
+ scene_manifest.mesh_group_select_node(mesh_group, mesh_path)
+
+ # Explicitly remove all other nodes to prevent implicit inclusions
+ for node in mesh_path_list:
+ if node != mesh_path:
+ scene_manifest.mesh_group_unselect_node(mesh_group, node)
+
+ # Create a LOD rule
+ lod_rule = scene_manifest.mesh_group_add_lod_rule(mesh_group)
+
+ # Loop all the mesh nodes after the first
+ for x in mesh_path_list[1:]:
+ # Add a new LOD level
+ lod = scene_manifest.lod_rule_add_lod(lod_rule)
+ # Select the current mesh for this LOD level
+ scene_manifest.lod_select_node(lod, x)
+
+ # Unselect every other mesh for this LOD level
+ for y in mesh_path_list:
+ if y != x:
+ scene_manifest.lod_unselect_node(lod, y)
+
+ # Create an editor entity
+ entity_id = azlmbr.entity.EntityUtilityBus(azlmbr.bus.Broadcast, "CreateEditorReadyEntity", mesh_group_name)
+ # Add an EditorMeshComponent to the entity
+ editor_mesh_component = azlmbr.entity.EntityUtilityBus(azlmbr.bus.Broadcast, "GetOrAddComponentByTypeName", entity_id, "AZ::Render::EditorMeshComponent")
+ # Set the ModelAsset assetHint to the relative path of the input asset + the name of the MeshGroup we just created + the azmodel extension
+ # The MeshGroup we created will be output as a product in the asset's path named mesh_group_name.azmodel
+ # The assetHint will be converted to an AssetId later during prefab loading
+ json_update = json.dumps({
+ "Controller": { "Configuration": { "ModelAsset": {
+ "assetHint": os.path.join(source_relative_path, mesh_group_name) + ".azmodel" }}}
+ });
+ # Apply the JSON above to the component we created
+ result = azlmbr.entity.EntityUtilityBus(azlmbr.bus.Broadcast, "UpdateComponentForEntity", entity_id, editor_mesh_component, json_update)
+
+ if not result:
+ raise RuntimeError("UpdateComponentForEntity failed for Mesh component")
+
+ create_prefab(scene_manifest, source_filename_only, [entity_id])
+
+ # Convert the manifest to a JSON string and return it
+ new_manifest = scene_manifest.export()
+
+ return new_manifest
+
+sceneJobHandler = None
+
+def on_update_manifest(args):
+ try:
+ scene = args[0]
+ return update_manifest(scene)
+ except RuntimeError as err:
+ print (f'ERROR - {err}')
+ log_exception_traceback()
+ except:
+ log_exception_traceback()
+
+ global sceneJobHandler
+ sceneJobHandler = None
+
+# try to create SceneAPI handler for processing
+try:
+ import azlmbr.scene as sceneApi
+ if (sceneJobHandler == None):
+ sceneJobHandler = sceneApi.ScriptBuildingNotificationBusHandler()
+ sceneJobHandler.connect()
+ sceneJobHandler.add_callback('OnUpdateManifest', on_update_manifest)
+except:
+ sceneJobHandler = None
diff --git a/AutomatedTesting/Editor/Scripts/scene_helpers.py b/AutomatedTesting/Editor/Scripts/scene_helpers.py
new file mode 100644
index 0000000000..761068e796
--- /dev/null
+++ b/AutomatedTesting/Editor/Scripts/scene_helpers.py
@@ -0,0 +1,95 @@
+"""
+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
+"""
+
+import traceback, logging, json
+from typing import Tuple, List
+
+import azlmbr.bus
+from scene_api import scene_data as sceneData
+from scene_api.scene_data import SceneGraphName
+
+
+def log_exception_traceback():
+ """
+ Outputs an exception stacktrace.
+ """
+ data = traceback.format_exc()
+ logger = logging.getLogger('python')
+ logger.error(data)
+
+
+def sanitize_name_for_disk(name: str):
+ """
+ Removes illegal filename characters from a string.
+
+ :param name: String to clean.
+ :return: Name with illegal characters removed.
+ """
+ return "".join(char for char in name if char not in "|<>:\"/?*\\")
+
+
+def get_mesh_node_names(scene_graph: sceneData.SceneGraph) -> Tuple[List[SceneGraphName], List[str]]:
+ """
+ Returns a tuple of all the mesh nodes as well as all the node paths
+
+ :param scene_graph: Scene graph to search
+ :return: Tuple of [Mesh Nodes, All Node Paths]
+ """
+ import azlmbr.scene as sceneApi
+ import azlmbr.scene.graph
+
+ mesh_data_list = []
+ node = scene_graph.get_root()
+ children = []
+ paths = []
+
+ while node.IsValid():
+ # store children to process after siblings
+ if scene_graph.has_node_child(node):
+ children.append(scene_graph.get_node_child(node))
+
+ node_name = sceneData.SceneGraphName(scene_graph.get_node_name(node))
+ paths.append(node_name.get_path())
+
+ # store any node that has mesh data content
+ node_content = scene_graph.get_node_content(node)
+ if node_content.CastWithTypeName('MeshData'):
+ if scene_graph.is_node_end_point(node) is False:
+ if len(node_name.get_path()):
+ mesh_data_list.append(sceneData.SceneGraphName(scene_graph.get_node_name(node)))
+
+ # advance to next node
+ if scene_graph.has_node_sibling(node):
+ node = scene_graph.get_node_sibling(node)
+ elif children:
+ node = children.pop()
+ else:
+ node = azlmbr.scene.graph.NodeIndex()
+
+ return mesh_data_list, paths
+
+
+def create_prefab(scene_manifest: sceneData.SceneManifest, prefab_name: str, entities: list) -> None:
+ prefab_filename = prefab_name + ".prefab"
+ created_template_id = azlmbr.prefab.PrefabSystemScriptingBus(azlmbr.bus.Broadcast, "CreatePrefab", entities,
+ prefab_filename)
+
+ if created_template_id is None or created_template_id == azlmbr.prefab.InvalidTemplateId:
+ raise RuntimeError("CreatePrefab {} failed".format(prefab_filename))
+
+ # Convert the prefab to a JSON string
+ output = azlmbr.prefab.PrefabLoaderScriptingBus(azlmbr.bus.Broadcast, "SaveTemplateToString", created_template_id)
+
+ if output is not None and output.IsSuccess():
+ json_string = output.GetValue()
+ uuid = azlmbr.math.Uuid_CreateRandom().ToString()
+ json_result = json.loads(json_string)
+ # Add a PrefabGroup to the manifest and store the JSON on it
+ scene_manifest.add_prefab_group(prefab_name, uuid, json_result)
+ else:
+ raise RuntimeError(
+ "SaveTemplateToString failed for template id {}, prefab {}".format(created_template_id, prefab_filename))
diff --git a/AutomatedTesting/Editor/Scripts/scene_mesh_to_prefab.py b/AutomatedTesting/Editor/Scripts/scene_mesh_to_prefab.py
index e832b1f82b..6151585f26 100644
--- a/AutomatedTesting/Editor/Scripts/scene_mesh_to_prefab.py
+++ b/AutomatedTesting/Editor/Scripts/scene_mesh_to_prefab.py
@@ -5,55 +5,16 @@
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
#
-import os, traceback, binascii, sys, json, pathlib
-import azlmbr.math
import azlmbr.bus
+import azlmbr.math
+
+from scene_helpers import *
+
#
# SceneAPI Processor
#
-
-def log_exception_traceback():
- exc_type, exc_value, exc_tb = sys.exc_info()
- data = traceback.format_exception(exc_type, exc_value, exc_tb)
- print(str(data))
-
-def get_mesh_node_names(sceneGraph):
- import azlmbr.scene as sceneApi
- import azlmbr.scene.graph
- from scene_api import scene_data as sceneData
-
- meshDataList = []
- node = sceneGraph.get_root()
- children = []
- paths = []
-
- while node.IsValid():
- # store children to process after siblings
- if sceneGraph.has_node_child(node):
- children.append(sceneGraph.get_node_child(node))
-
- nodeName = sceneData.SceneGraphName(sceneGraph.get_node_name(node))
- paths.append(nodeName.get_path())
-
- # store any node that has mesh data content
- nodeContent = sceneGraph.get_node_content(node)
- if nodeContent.CastWithTypeName('MeshData'):
- if sceneGraph.is_node_end_point(node) is False:
- if (len(nodeName.get_path())):
- meshDataList.append(sceneData.SceneGraphName(sceneGraph.get_node_name(node)))
-
- # advance to next node
- if sceneGraph.has_node_sibling(node):
- node = sceneGraph.get_node_sibling(node)
- elif children:
- node = children.pop()
- else:
- node = azlmbr.scene.graph.NodeIndex()
-
- return meshDataList, paths
-
def add_material_component(entity_id):
# Create an override AZ::Render::EditorMaterialComponent
editor_material_component = azlmbr.entity.EntityUtilityBus(
@@ -64,24 +25,24 @@ def add_material_component(entity_id):
# this fills out the material asset to a known product AZMaterial asset relative path
json_update = json.dumps({
- "Controller": { "Configuration": { "materials": [
- {
- "Key": {},
- "Value": { "MaterialAsset":{
- "assetHint": "materials/basic_grey.azmaterial"
- }}
- }]
- }}
- });
- result = azlmbr.entity.EntityUtilityBus(azlmbr.bus.Broadcast, "UpdateComponentForEntity", entity_id, editor_material_component, json_update)
+ "Controller": {"Configuration": {"materials": [
+ {
+ "Key": {},
+ "Value": {"MaterialAsset": {
+ "assetHint": "materials/basic_grey.azmaterial"
+ }}
+ }]
+ }}
+ })
+ result = azlmbr.entity.EntityUtilityBus(azlmbr.bus.Broadcast, "UpdateComponentForEntity", entity_id,
+ editor_material_component, json_update)
if not result:
raise RuntimeError("UpdateComponentForEntity for editor_material_component failed")
+
def update_manifest(scene):
- import json
import uuid, os
- import azlmbr.scene as sceneApi
import azlmbr.scene.graph
from scene_api import scene_data as sceneData
@@ -89,9 +50,9 @@ def update_manifest(scene):
# Get a list of all the mesh nodes, as well as all the nodes
mesh_name_list, all_node_paths = get_mesh_node_names(graph)
scene_manifest = sceneData.SceneManifest()
-
+
clean_filename = scene.sourceFilename.replace('.', '_')
-
+
# Compute the filename of the scene file
source_basepath = scene.watchFolder
source_relative_path = os.path.dirname(os.path.relpath(clean_filename, source_basepath))
@@ -108,31 +69,39 @@ def update_manifest(scene):
# Create a unique mesh group name using the filename + node name
mesh_group_name = '{}_{}'.format(source_filename_only, mesh_name.get_name())
# Remove forbidden filename characters from the name since this will become a file on disk later
- mesh_group_name = "".join(char for char in mesh_group_name if char not in "|<>:\"/?*\\")
+ mesh_group_name = sanitize_name_for_disk(mesh_group_name)
# Add the MeshGroup to the manifest and give it a unique ID
mesh_group = scene_manifest.add_mesh_group(mesh_group_name)
mesh_group['id'] = '{' + str(uuid.uuid5(uuid.NAMESPACE_DNS, source_filename_only + mesh_path)) + '}'
# Set our current node as the only node that is included in this MeshGroup
scene_manifest.mesh_group_select_node(mesh_group, mesh_path)
+ scene_manifest.mesh_group_add_comment(mesh_group, "Hello World")
# Explicitly remove all other nodes to prevent implicit inclusions
for node in all_node_paths:
if node != mesh_path:
scene_manifest.mesh_group_unselect_node(mesh_group, node)
+ scene_manifest.mesh_group_add_cloth_rule(mesh_group, mesh_path, "Col0", 1, "Col0", 2, "Col0", 2, 3)
+ scene_manifest.mesh_group_add_advanced_mesh_rule(mesh_group, True, False, True, "Col0")
+ scene_manifest.mesh_group_add_skin_rule(mesh_group, 3, 0.002)
+ scene_manifest.mesh_group_add_tangent_rule(mesh_group, 1, 0)
+
# Create an editor entity
entity_id = azlmbr.entity.EntityUtilityBus(azlmbr.bus.Broadcast, "CreateEditorReadyEntity", mesh_group_name)
# Add an EditorMeshComponent to the entity
- editor_mesh_component = azlmbr.entity.EntityUtilityBus(azlmbr.bus.Broadcast, "GetOrAddComponentByTypeName", entity_id, "AZ::Render::EditorMeshComponent")
- # Set the ModelAsset assetHint to the relative path of the input asset + the name of the MeshGroup we just created + the azmodel extension
- # The MeshGroup we created will be output as a product in the asset's path named mesh_group_name.azmodel
- # The assetHint will be converted to an AssetId later during prefab loading
+ editor_mesh_component = azlmbr.entity.EntityUtilityBus(azlmbr.bus.Broadcast, "GetOrAddComponentByTypeName",
+ entity_id, "AZ::Render::EditorMeshComponent")
+ # Set the ModelAsset assetHint to the relative path of the input asset + the name of the MeshGroup we just
+ # created + the azmodel extension The MeshGroup we created will be output as a product in the asset's path
+ # named mesh_group_name.azmodel The assetHint will be converted to an AssetId later during prefab loading
json_update = json.dumps({
- "Controller": { "Configuration": { "ModelAsset": {
- "assetHint": os.path.join(source_relative_path, mesh_group_name) + ".azmodel" }}}
- });
+ "Controller": {"Configuration": {"ModelAsset": {
+ "assetHint": os.path.join(source_relative_path, mesh_group_name) + ".azmodel"}}}
+ })
# Apply the JSON above to the component we created
- result = azlmbr.entity.EntityUtilityBus(azlmbr.bus.Broadcast, "UpdateComponentForEntity", entity_id, editor_mesh_component, json_update)
+ result = azlmbr.entity.EntityUtilityBus(azlmbr.bus.Broadcast, "UpdateComponentForEntity", entity_id,
+ editor_mesh_component, json_update)
if not result:
raise RuntimeError("UpdateComponentForEntity failed for Mesh component")
@@ -143,17 +112,19 @@ def update_manifest(scene):
add_material_component(entity_id)
# Get the transform component
- transform_component = azlmbr.entity.EntityUtilityBus(azlmbr.bus.Broadcast, "GetOrAddComponentByTypeName", entity_id, "27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0")
+ transform_component = azlmbr.entity.EntityUtilityBus(azlmbr.bus.Broadcast, "GetOrAddComponentByTypeName",
+ entity_id, "27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0")
# Set this entity to be a child of the last entity we created
# This is just an example of how to do parenting and isn't necessarily useful to parent everything like this
if previous_entity_id is not None:
transform_json = json.dumps({
- "Parent Entity" : previous_entity_id.to_json()
- });
+ "Parent Entity": previous_entity_id.to_json()
+ })
# Apply the JSON update
- result = azlmbr.entity.EntityUtilityBus(azlmbr.bus.Broadcast, "UpdateComponentForEntity", entity_id, transform_component, transform_json)
+ result = azlmbr.entity.EntityUtilityBus(azlmbr.bus.Broadcast, "UpdateComponentForEntity", entity_id,
+ transform_component, transform_json)
if not result:
raise RuntimeError("UpdateComponentForEntity failed for Transform component")
@@ -165,37 +136,23 @@ def update_manifest(scene):
created_entities.append(entity_id)
# Create a prefab with all our entities
- prefab_filename = source_filename_only + ".prefab"
- created_template_id = azlmbr.prefab.PrefabSystemScriptingBus(azlmbr.bus.Broadcast, "CreatePrefab", created_entities, prefab_filename)
-
- if created_template_id == azlmbr.prefab.InvalidTemplateId:
- raise RuntimeError("CreatePrefab {} failed".format(prefab_filename))
-
- # Convert the prefab to a JSON string
- output = azlmbr.prefab.PrefabLoaderScriptingBus(azlmbr.bus.Broadcast, "SaveTemplateToString", created_template_id)
-
- if output.IsSuccess():
- jsonString = output.GetValue()
- uuid = azlmbr.math.Uuid_CreateRandom().ToString()
- jsonResult = json.loads(jsonString)
- # Add a PrefabGroup to the manifest and store the JSON on it
- scene_manifest.add_prefab_group(source_filename_only, uuid, jsonResult)
- else:
- raise RuntimeError("SaveTemplateToString failed for template id {}, prefab {}".format(created_template_id, prefab_filename))
+ create_prefab(scene_manifest, source_filename_only, created_entities)
# Convert the manifest to a JSON string and return it
new_manifest = scene_manifest.export()
return new_manifest
+
sceneJobHandler = None
+
def on_update_manifest(args):
try:
scene = args[0]
return update_manifest(scene)
except RuntimeError as err:
- print (f'ERROR - {err}')
+ print(f'ERROR - {err}')
log_exception_traceback()
except:
log_exception_traceback()
@@ -203,10 +160,12 @@ def on_update_manifest(args):
global sceneJobHandler
sceneJobHandler = None
+
# try to create SceneAPI handler for processing
try:
import azlmbr.scene as sceneApi
- if (sceneJobHandler == None):
+
+ if sceneJobHandler is None:
sceneJobHandler = sceneApi.ScriptBuildingNotificationBusHandler()
sceneJobHandler.connect()
sceneJobHandler.add_callback('OnUpdateManifest', on_update_manifest)
diff --git a/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml b/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml
index 12c222add6..46d6191835 100644
--- a/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml
+++ b/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml
@@ -13,4 +13,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/AutomatedTesting/Gem/Code/enabled_gems.cmake b/AutomatedTesting/Gem/Code/enabled_gems.cmake
index e6a4d6ca37..3915fd36da 100644
--- a/AutomatedTesting/Gem/Code/enabled_gems.cmake
+++ b/AutomatedTesting/Gem/Code/enabled_gems.cmake
@@ -54,6 +54,7 @@ set(ENABLED_GEMS
AWSMetrics
PrefabBuilder
AudioSystem
+ Terrain
Profiler
Multiplayer
)
diff --git a/AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_automation_test.py b/AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_automation_test.py
index 34b2217916..6f3113d771 100644
--- a/AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_automation_test.py
+++ b/AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_automation_test.py
@@ -14,6 +14,7 @@ from datetime import datetime
import ly_test_tools.log.log_monitor
from AWS.common import constants
+from AWS.common.resource_mappings import AWS_RESOURCE_MAPPINGS_ACCOUNT_ID_KEY
from .aws_metrics_custom_thread import AWSMetricsThread
# fixture imports
@@ -200,6 +201,59 @@ class TestAWSMetricsWindows(object):
for thread in operational_threads:
thread.join()
+ @pytest.mark.parametrize('level', ['AWS/Metrics'])
+ def test_realtime_and_batch_analytics_no_global_accountid(self,
+ level: str,
+ launcher: pytest.fixture,
+ asset_processor: pytest.fixture,
+ workspace: pytest.fixture,
+ aws_utils: pytest.fixture,
+ resource_mappings: pytest.fixture,
+ aws_metrics_utils: pytest.fixture):
+ """
+ Verify that the metrics events are sent to CloudWatch and S3 for analytics.
+ """
+ # Remove top-level account ID from resource mappings
+ resource_mappings.clear_select_keys([AWS_RESOURCE_MAPPINGS_ACCOUNT_ID_KEY])
+ # Start Kinesis analytics application on a separate thread to avoid blocking the test.
+ kinesis_analytics_application_thread = AWSMetricsThread(target=update_kinesis_analytics_application_status,
+ args=(aws_metrics_utils, resource_mappings, True))
+ kinesis_analytics_application_thread.start()
+
+ log_monitor = setup(launcher, asset_processor)
+
+ # Kinesis analytics application needs to be in the running state before we start the game launcher.
+ kinesis_analytics_application_thread.join()
+ launcher.args = ['+LoadLevel', level]
+ launcher.args.extend(['-rhi=null'])
+ start_time = datetime.utcnow()
+ with launcher.start(launch_ap=False):
+ monitor_metrics_submission(log_monitor)
+
+ # Verify that real-time analytics metrics are delivered to CloudWatch.
+ aws_metrics_utils.verify_cloud_watch_delivery(
+ AWS_METRICS_FEATURE_NAME,
+ 'TotalLogins',
+ [],
+ start_time)
+ logger.info('Real-time metrics are sent to CloudWatch.')
+
+ # Run time-consuming operations on separate threads to avoid blocking the test.
+ operational_threads = list()
+ operational_threads.append(
+ AWSMetricsThread(target=query_metrics_from_s3,
+ args=(aws_metrics_utils, resource_mappings)))
+ operational_threads.append(
+ AWSMetricsThread(target=verify_operational_metrics,
+ args=(aws_metrics_utils, resource_mappings, start_time)))
+ operational_threads.append(
+ AWSMetricsThread(target=update_kinesis_analytics_application_status,
+ args=(aws_metrics_utils, resource_mappings, False)))
+ for thread in operational_threads:
+ thread.start()
+ for thread in operational_threads:
+ thread.join()
+
@pytest.mark.parametrize('level', ['AWS/Metrics'])
def test_unauthorized_user_request_rejected(self,
level: str,
diff --git a/AutomatedTesting/Gem/PythonTests/AWS/Windows/client_auth/aws_client_auth_automation_test.py b/AutomatedTesting/Gem/PythonTests/AWS/Windows/client_auth/aws_client_auth_automation_test.py
index 198fb934d9..077a068a18 100644
--- a/AutomatedTesting/Gem/PythonTests/AWS/Windows/client_auth/aws_client_auth_automation_test.py
+++ b/AutomatedTesting/Gem/PythonTests/AWS/Windows/client_auth/aws_client_auth_automation_test.py
@@ -12,6 +12,7 @@ import pytest
import ly_test_tools.log.log_monitor
from AWS.common import constants
+from AWS.common.resource_mappings import AWS_RESOURCE_MAPPINGS_ACCOUNT_ID_KEY
# fixture imports
from assetpipeline.ap_fixtures.asset_processor_fixture import asset_processor
@@ -70,6 +71,41 @@ class TestAWSClientAuthWindows(object):
halt_on_unexpected=True,
)
assert result, 'Anonymous credentials fetched successfully.'
+
+ @pytest.mark.parametrize('level', ['AWS/ClientAuth'])
+ def test_anonymous_credentials_no_global_accountid(self,
+ level: str,
+ launcher: pytest.fixture,
+ resource_mappings: pytest.fixture,
+ workspace: pytest.fixture,
+ asset_processor: pytest.fixture
+ ):
+ """
+ Test to verify AWS Cognito Identity pool anonymous authorization.
+
+ Setup: Updates resource mapping file using existing CloudFormation stacks.
+ Tests: Getting credentials when no credentials are configured
+ Verification: Log monitor looks for success credentials log.
+ """
+ # Remove top-level account ID from resource mappings
+ resource_mappings.clear_select_keys([AWS_RESOURCE_MAPPINGS_ACCOUNT_ID_KEY])
+
+ asset_processor.start()
+ asset_processor.wait_for_idle()
+
+ file_to_monitor = os.path.join(launcher.workspace.paths.project_log(), constants.GAME_LOG_NAME)
+ log_monitor = ly_test_tools.log.log_monitor.LogMonitor(launcher=launcher, log_file_path=file_to_monitor)
+
+ launcher.args = ['+LoadLevel', level]
+ launcher.args.extend(['-rhi=null'])
+
+ with launcher.start(launch_ap=False):
+ result = log_monitor.monitor_log_for_lines(
+ expected_lines=['(Script) - Success anonymous credentials'],
+ unexpected_lines=['(Script) - Fail anonymous credentials'],
+ halt_on_unexpected=True,
+ )
+ assert result, 'Anonymous credentials fetched successfully.'
def test_password_signin_credentials(self,
launcher: pytest.fixture,
diff --git a/AutomatedTesting/Gem/PythonTests/AWS/Windows/core/test_aws_resource_interaction.py b/AutomatedTesting/Gem/PythonTests/AWS/Windows/core/test_aws_resource_interaction.py
index 949186ad50..59c517fd1c 100644
--- a/AutomatedTesting/Gem/PythonTests/AWS/Windows/core/test_aws_resource_interaction.py
+++ b/AutomatedTesting/Gem/PythonTests/AWS/Windows/core/test_aws_resource_interaction.py
@@ -18,6 +18,7 @@ import ly_test_tools.environment.process_utils as process_utils
import ly_test_tools.o3de.asset_processor_utils as asset_processor_utils
from AWS.common import constants
+from AWS.common.resource_mappings import AWS_RESOURCE_MAPPINGS_ACCOUNT_ID_KEY
# fixture imports
from assetpipeline.ap_fixtures.asset_processor_fixture import asset_processor
@@ -141,3 +142,51 @@ class TestAWSCoreAWSResourceInteraction(object):
'The expected file wasn\'t successfully downloaded.'
# clean up the file directories.
shutil.rmtree(s3_download_dir)
+
+ @pytest.mark.parametrize('expected_lines', [
+ ['(Script) - [S3] Head object request is done',
+ '(Script) - [S3] Head object success: Object example.txt is found.',
+ '(Script) - [S3] Get object success: Object example.txt is downloaded.',
+ '(Script) - [Lambda] Completed Invoke',
+ '(Script) - [Lambda] Invoke success: {"statusCode": 200, "body": {}}',
+ '(Script) - [DynamoDB] Results finished']])
+ @pytest.mark.parametrize('unexpected_lines', [
+ ['(Script) - [S3] Head object error: No response body.',
+ '(Script) - [S3] Get object error: Request validation failed, output file directory doesn\'t exist.',
+ '(Script) - Request validation failed, output file miss full path.',
+ '(Script) - ']])
+ def test_scripting_behavior_no_global_accountid(self,
+ level: str,
+ launcher: pytest.fixture,
+ workspace: pytest.fixture,
+ asset_processor: pytest.fixture,
+ resource_mappings: pytest.fixture,
+ aws_utils: pytest.fixture,
+ expected_lines: typing.List[str],
+ unexpected_lines: typing.List[str]):
+ """
+ Setup: Updates resource mapping file using existing CloudFormation stacks.
+ Tests: Interact with AWS S3, DynamoDB and Lambda services.
+ Verification: Script canvas nodes can communicate with AWS services successfully.
+ """
+
+ resource_mappings.clear_select_keys([AWS_RESOURCE_MAPPINGS_ACCOUNT_ID_KEY])
+ log_monitor, s3_download_dir = setup(launcher, asset_processor)
+ write_test_data_to_dynamodb_table(resource_mappings, aws_utils)
+
+ launcher.args = ['+LoadLevel', level]
+ launcher.args.extend(['-rhi=null'])
+
+ with launcher.start(launch_ap=False):
+ result = log_monitor.monitor_log_for_lines(
+ expected_lines=expected_lines,
+ unexpected_lines=unexpected_lines,
+ halt_on_unexpected=True
+ )
+
+ assert result, "Expected lines weren't found."
+
+ assert os.path.exists(os.path.join(s3_download_dir, 'output.txt')), \
+ 'The expected file wasn\'t successfully downloaded.'
+ # clean up the file directories.
+ shutil.rmtree(s3_download_dir)
diff --git a/AutomatedTesting/Gem/PythonTests/AWS/common/resource_mappings.py b/AutomatedTesting/Gem/PythonTests/AWS/common/resource_mappings.py
index 5f01ecdbf8..988d5bf1fc 100644
--- a/AutomatedTesting/Gem/PythonTests/AWS/common/resource_mappings.py
+++ b/AutomatedTesting/Gem/PythonTests/AWS/common/resource_mappings.py
@@ -102,3 +102,17 @@ class ResourceMappings:
def get_resource_name_id(self, resource_key: str):
return self._resource_mappings[AWS_RESOURCE_MAPPINGS_KEY][resource_key]['Name/ID']
+
+ def clear_select_keys(self, resource_keys=None) -> None:
+ """
+ Clears values from select resource mapping keys.
+ :param resource_keys: list of keys to clear out
+ """
+ with open(self._resource_mapping_file_path) as file_content:
+ resource_mappings = json.load(file_content)
+
+ for key in resource_keys:
+ resource_mappings[key] = ''
+
+ with open(self._resource_mapping_file_path, 'w') as file_content:
+ json.dump(resource_mappings, file_content, indent=4)
\ No newline at end of file
diff --git a/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Main.py b/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Main.py
index 402a6fd8f0..d79e144ae0 100644
--- a/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Main.py
+++ b/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Main.py
@@ -13,6 +13,8 @@ from ly_test_tools.o3de.editor_test import EditorSharedTest, EditorTestSuite
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
class TestAutomation(EditorTestSuite):
+ enable_prefab_system = False
+
@pytest.mark.test_case_id("C36525657")
class AtomEditorComponents_BloomAdded(EditorSharedTest):
from Atom.tests import hydra_AtomEditorComponents_BloomAdded as test_module
@@ -61,10 +63,18 @@ class TestAutomation(EditorTestSuite):
class AtomEditorComponents_HDRColorGradingAdded(EditorSharedTest):
from Atom.tests import hydra_AtomEditorComponents_HDRColorGradingAdded as test_module
+ @pytest.mark.test_case_id("C32078116")
+ class AtomEditorComponents_HDRiSkyboxAdded(EditorSharedTest):
+ from Atom.tests import hydra_AtomEditorComponents_HDRiSkyboxAdded as test_module
+
@pytest.mark.test_case_id("C32078117")
class AtomEditorComponents_LightAdded(EditorSharedTest):
from Atom.tests import hydra_AtomEditorComponents_LightAdded as test_module
+ @pytest.mark.test_case_id("C36525662")
+ class AtomEditorComponents_LookModificationAdded(EditorSharedTest):
+ from Atom.tests import hydra_AtomEditorComponents_LookModificationAdded as test_module
+
@pytest.mark.test_case_id("C32078123")
class AtomEditorComponents_MaterialAdded(EditorSharedTest):
from Atom.tests import hydra_AtomEditorComponents_MaterialAdded as test_module
diff --git a/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Main_GPU.py b/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Main_GPU.py
index f0e92c7e3e..6a220d1bd8 100644
--- a/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Main_GPU.py
+++ b/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Main_GPU.py
@@ -104,6 +104,7 @@ class TestAllComponentsIndepthTests(object):
halt_on_unexpected=True,
cfg_args=[level],
null_renderer=False,
+ enable_prefab_system=False,
)
similarity_threshold = 0.99
@@ -158,6 +159,7 @@ class TestAllComponentsIndepthTests(object):
halt_on_unexpected=True,
cfg_args=[level],
null_renderer=False,
+ enable_prefab_system=False,
)
similarity_threshold = 0.99
@@ -205,6 +207,7 @@ class TestPerformanceBenchmarkSuite(object):
halt_on_unexpected=True,
cfg_args=[level],
null_renderer=False,
+ enable_prefab_system=False,
)
aggregator = BenchmarkDataAggregator(workspace, logger, 'periodic')
@@ -242,5 +245,6 @@ class TestMaterialEditor(object):
halt_on_unexpected=False,
null_renderer=False,
cfg_args=[cfg_args],
- log_file_name="MaterialEditor.log"
+ log_file_name="MaterialEditor.log",
+ enable_prefab_system=False,
)
diff --git a/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Main_GPU_Optimized.py b/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Main_GPU_Optimized.py
index 568768e12e..7f97c132bb 100644
--- a/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Main_GPU_Optimized.py
+++ b/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Main_GPU_Optimized.py
@@ -23,6 +23,8 @@ class TestAutomation(EditorTestSuite):
# Remove -autotest_mode from global_extra_cmdline_args since we need rendering for these tests.
global_extra_cmdline_args = ["-BatchMode"] # Default is ["-BatchMode", "-autotest_mode"]
+ enable_prefab_system = False
+
@pytest.mark.test_case_id("C34603773")
class AtomGPU_BasicLevelSetup_SetsUpLevel(EditorSharedTest):
use_null_renderer = False # Default is True
diff --git a/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Sandbox.py b/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Sandbox.py
index 9ceb3c951f..292bb9c19c 100644
--- a/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Sandbox.py
+++ b/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Sandbox.py
@@ -85,6 +85,7 @@ class TestAtomEditorComponentsMain(object):
halt_on_unexpected=True,
null_renderer=True,
cfg_args=cfg_args,
+ enable_prefab_system=False,
)
@@ -155,5 +156,6 @@ class TestMaterialEditorBasicTests(object):
halt_on_unexpected=True,
null_renderer=True,
log_file_name="MaterialEditor.log",
+ enable_prefab_system=False,
)
diff --git a/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/atom_component_helper.py b/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/atom_component_helper.py
index 50cc15f7e8..9f37873557 100644
--- a/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/atom_component_helper.py
+++ b/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/atom_component_helper.py
@@ -172,8 +172,7 @@ def create_basic_atom_level(level_name):
entity_position=default_position,
components=["HDRi Skybox", "Global Skylight (IBL)"],
parent_id=default_level.id)
- global_skylight_asset_path = os.path.join(
- "LightingPresets", "greenwich_park_02_4k_iblskyboxcm_iblspecular.exr.streamingimage")
+ global_skylight_asset_path = os.path.join("LightingPresets", "default_iblskyboxcm.exr.streamingimage")
global_skylight_asset_value = asset.AssetCatalogRequestBus(
bus.Broadcast, "GetAssetIdByPath", global_skylight_asset_path, math.Uuid(), False)
global_skylight.get_set_test(0, "Controller|Configuration|Cubemap Texture", global_skylight_asset_value)
diff --git a/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/atom_constants.py b/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/atom_constants.py
index 817ff1fad0..290e1cd2e4 100644
--- a/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/atom_constants.py
+++ b/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/atom_constants.py
@@ -57,11 +57,13 @@ class AtomComponentProperties:
def camera(property: str = 'name') -> str:
"""
Camera component properties.
+ - 'Field of view': Sets the value for the camera's FOV (Field of View) in degrees, i.e. 60.0
:param property: From the last element of the property tree path. Default 'name' for component name string.
:return: Full property path OR component name if no property specified.
"""
properties = {
'name': 'Camera',
+ 'Field of view': 'Controller|Configuration|Field of view'
}
return properties[property]
@@ -147,11 +149,14 @@ class AtomComponentProperties:
def display_mapper(property: str = 'name') -> str:
"""
Display Mapper component properties.
+ - 'LDR color Grading LUT' is the Low Definition Range (LDR) color grading for Look-up Textures (LUT) which is
+ an Asset.id value corresponding to a lighting asset file.
:param property: From the last element of the property tree path. Default 'name' for component name string.
:return: Full property path OR component name if no property specified.
"""
properties = {
'name': 'Display Mapper',
+ 'LDR color Grading LUT': 'Controller|Configuration|LDR color Grading LUT',
}
return properties[property]
@@ -202,11 +207,13 @@ class AtomComponentProperties:
def grid(property: str = 'name') -> str:
"""
Grid component properties.
+ - 'Secondary Grid Spacing': The spacing value for the secondary grid, i.e. 1.0
:param property: From the last element of the property tree path. Default 'name' for component name string.
:return: Full property path OR component name if no property specified.
"""
properties = {
'name': 'Grid',
+ 'Secondary Grid Spacing': 'Controller|Configuration|Secondary Grid Spacing',
}
return properties[property]
@@ -231,11 +238,13 @@ class AtomComponentProperties:
def hdri_skybox(property: str = 'name') -> str:
"""
HDRi Skybox component properties.
+ - 'Cubemap Texture': Asset.id for the cubemap texture to set.
:param property: From the last element of the property tree path. Default 'name' for component name string.
:return: Full property path OR component name if no property specified.
"""
properties = {
'name': 'HDRi Skybox',
+ 'Cubemap Texture': 'Controller|Configuration|Cubemap Texture',
}
return properties[property]
@@ -259,12 +268,16 @@ class AtomComponentProperties:
Look Modification component properties. Requires PostFX Layer component.
- 'requires' a list of component names as strings required by this component.
Use editor_entity_utils EditorEntity.add_components(list) to add this list of requirements.\n
+ - 'Enable look modification' Toggle active state of the component True/False
+ - 'Color Grading LUT' Asset.id for the LUT used for affecting level look.
:param property: From the last element of the property tree path. Default 'name' for component name string.
:return: Full property path OR component name if no property specified.
"""
properties = {
'name': 'Look Modification',
'requires': [AtomComponentProperties.postfx_layer()],
+ 'Enable look modification': 'Controller|Configuration|Enable look modification',
+ 'Color Grading LUT': 'Controller|Configuration|Color Grading LUT',
}
return properties[property]
@@ -274,12 +287,14 @@ class AtomComponentProperties:
Material component properties. Requires one of Actor OR Mesh component.
- 'requires' a list of component names as strings required by this component.
Only one of these is required at a time for this component.\n
+ - 'Material Asset': the material Asset.id of the material.
:param property: From the last element of the property tree path. Default 'name' for component name string.
:return: Full property path OR component name if no property specified.
"""
properties = {
'name': 'Material',
'requires': [AtomComponentProperties.actor(), AtomComponentProperties.mesh()],
+ 'Material Asset': 'Default Material|Material Asset',
}
return properties[property]
@@ -378,7 +393,7 @@ class AtomComponentProperties:
'name': 'PostFX Shape Weight Modifier',
'requires': [AtomComponentProperties.postfx_layer()],
'shapes': ['Axis Aligned Box Shape', 'Box Shape', 'Capsule Shape', 'Compound Shape', 'Cylinder Shape',
- 'Disk Shape', 'Polygon Prism Shape', 'Quad Shape', 'Sphere Shape', 'Vegetation Reference Shape'],
+ 'Disk Shape', 'Polygon Prism Shape', 'Quad Shape', 'Sphere Shape', 'Shape Reference'],
}
return properties[property]
diff --git a/AutomatedTesting/Gem/PythonTests/Atom/golden_images/AreaLight_1.ppm b/AutomatedTesting/Gem/PythonTests/Atom/golden_images/AreaLight_1.ppm
index 0725999dcf..8695f6bb93 100644
--- a/AutomatedTesting/Gem/PythonTests/Atom/golden_images/AreaLight_1.ppm
+++ b/AutomatedTesting/Gem/PythonTests/Atom/golden_images/AreaLight_1.ppm
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:954d7d0df47c840a24e313893800eb3126d0c0d47c3380926776b51833778db7
+oid sha256:aee1fd4d5264e5ef1676b507409ce70af6358cf1ff368d9aeb17f7b2597dfbca
size 6220817
diff --git a/AutomatedTesting/Gem/PythonTests/Atom/golden_images/AreaLight_2.ppm b/AutomatedTesting/Gem/PythonTests/Atom/golden_images/AreaLight_2.ppm
index 3a45bd31e3..d45d3f1581 100644
--- a/AutomatedTesting/Gem/PythonTests/Atom/golden_images/AreaLight_2.ppm
+++ b/AutomatedTesting/Gem/PythonTests/Atom/golden_images/AreaLight_2.ppm
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:e81c19128f42ba362a2d5f3ccf159dfbc942d67ceeb1ac8c21f295a6fd9d2ce5
+oid sha256:d4787cdafbcc2fe71c1cb3f1da53a249db839a9df539a9e88be43ccd6d8e4d6a
size 6220817
diff --git a/AutomatedTesting/Gem/PythonTests/Atom/golden_images/AreaLight_3.ppm b/AutomatedTesting/Gem/PythonTests/Atom/golden_images/AreaLight_3.ppm
index 15d679b784..0661ead69f 100644
--- a/AutomatedTesting/Gem/PythonTests/Atom/golden_images/AreaLight_3.ppm
+++ b/AutomatedTesting/Gem/PythonTests/Atom/golden_images/AreaLight_3.ppm
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:5e20801213e065b6ea8c95ede81c23faa9b6dc70a2002dc5bced293e1bed989f
+oid sha256:5fac5bf41c9b16b6fbd762868e5cf514376af92d6ef7ebb9e819f024f1a3e1a7
size 6220817
diff --git a/AutomatedTesting/Gem/PythonTests/Atom/golden_images/AreaLight_4.ppm b/AutomatedTesting/Gem/PythonTests/Atom/golden_images/AreaLight_4.ppm
index 85c083a386..a7fc77f0ec 100644
--- a/AutomatedTesting/Gem/PythonTests/Atom/golden_images/AreaLight_4.ppm
+++ b/AutomatedTesting/Gem/PythonTests/Atom/golden_images/AreaLight_4.ppm
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:e250f812e594e5152bf2d6f23caa8b53b78276bfdf344d7a8d355dd96cb995c0
+oid sha256:7a23969670499524725535e8be7428b55b6f3e887cc24e2e903f7ea821a6d1a5
size 6220817
diff --git a/AutomatedTesting/Gem/PythonTests/Atom/golden_images/AreaLight_5.ppm b/AutomatedTesting/Gem/PythonTests/Atom/golden_images/AreaLight_5.ppm
index d575de761e..7404ab3ccc 100644
--- a/AutomatedTesting/Gem/PythonTests/Atom/golden_images/AreaLight_5.ppm
+++ b/AutomatedTesting/Gem/PythonTests/Atom/golden_images/AreaLight_5.ppm
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:95be359041f8291c74b335297a4dfe9902a180510f24a181b15e1a5ba4d3b024
+oid sha256:2f1f4d8865c56ed7f96f339c39e5feb4e0dbc6c6a8b4a7843b4166381b06b00d
size 6220817
diff --git a/AutomatedTesting/Gem/PythonTests/Atom/golden_images/AtomBasicLevelSetup.ppm b/AutomatedTesting/Gem/PythonTests/Atom/golden_images/AtomBasicLevelSetup.ppm
index ef41b6cf77..acfbe57900 100644
--- a/AutomatedTesting/Gem/PythonTests/Atom/golden_images/AtomBasicLevelSetup.ppm
+++ b/AutomatedTesting/Gem/PythonTests/Atom/golden_images/AtomBasicLevelSetup.ppm
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:07e09d3eb5bf0cee3d9b3752aaad40f3ead1dcc5ddd837a6226fadde55d57274
+oid sha256:5d4ee5641e19eef08dd6b93d2f4054a1aae2165325416ed2cbf0b8243f2c0b06
size 6220817
diff --git a/AutomatedTesting/Gem/PythonTests/Atom/golden_images/SpotLight_1.ppm b/AutomatedTesting/Gem/PythonTests/Atom/golden_images/SpotLight_1.ppm
index bbbd127929..3104088689 100644
--- a/AutomatedTesting/Gem/PythonTests/Atom/golden_images/SpotLight_1.ppm
+++ b/AutomatedTesting/Gem/PythonTests/Atom/golden_images/SpotLight_1.ppm
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:118e43e4b915e262726183467cc4b82f244565213fea5b6bfe02be07f0851ab1
+oid sha256:55c8f0d1790bb12660b7557630efca297b2a1b59e6c93167a2563da79e0a8255
size 6220817
diff --git a/AutomatedTesting/Gem/PythonTests/Atom/golden_images/SpotLight_2.ppm b/AutomatedTesting/Gem/PythonTests/Atom/golden_images/SpotLight_2.ppm
index 8e716fabcc..287ec406e1 100644
--- a/AutomatedTesting/Gem/PythonTests/Atom/golden_images/SpotLight_2.ppm
+++ b/AutomatedTesting/Gem/PythonTests/Atom/golden_images/SpotLight_2.ppm
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:dc2ce3256a6552975962c9e113c52c1a22bf3817d417151f6f60640dd568e0fa
+oid sha256:082ff368b621e12b083d96562a0889b11a1d683767a74296cbe6d8732830e9e8
size 6220817
diff --git a/AutomatedTesting/Gem/PythonTests/Atom/golden_images/SpotLight_3.ppm b/AutomatedTesting/Gem/PythonTests/Atom/golden_images/SpotLight_3.ppm
index 6b6a5a5d6e..9de8785f65 100644
--- a/AutomatedTesting/Gem/PythonTests/Atom/golden_images/SpotLight_3.ppm
+++ b/AutomatedTesting/Gem/PythonTests/Atom/golden_images/SpotLight_3.ppm
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:287d98890b35427688999760f9d066bcbff1a3bc9001534241dc212b32edabd8
+oid sha256:78cc62d89782899747875b41abee57c2efdfacf4c8af6511c88f82d76eaae4ca
size 6220817
diff --git a/AutomatedTesting/Gem/PythonTests/Atom/golden_images/SpotLight_4.ppm b/AutomatedTesting/Gem/PythonTests/Atom/golden_images/SpotLight_4.ppm
index eb05228cc2..93acc14dbc 100644
--- a/AutomatedTesting/Gem/PythonTests/Atom/golden_images/SpotLight_4.ppm
+++ b/AutomatedTesting/Gem/PythonTests/Atom/golden_images/SpotLight_4.ppm
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:66e91c92c868167c850078cd91714db47e10a96e23cc30191994486bd79c353f
+oid sha256:3d6719326f4dacae278d1723090ce1182193b793f250963af8be4b2c298e8841
size 6220817
diff --git a/AutomatedTesting/Gem/PythonTests/Atom/golden_images/SpotLight_5.ppm b/AutomatedTesting/Gem/PythonTests/Atom/golden_images/SpotLight_5.ppm
index 5e12edc46d..9cd58caae5 100644
--- a/AutomatedTesting/Gem/PythonTests/Atom/golden_images/SpotLight_5.ppm
+++ b/AutomatedTesting/Gem/PythonTests/Atom/golden_images/SpotLight_5.ppm
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:d950d173f5101820c5e18205401ca08ce5feeff2302ac2920b292750d86a8fa4
+oid sha256:9e492bb394fb18fb117f8a5b61cd2789922f9d6e88fc83189b5b6d59ffb1c3ef
size 6220817
diff --git a/AutomatedTesting/Gem/PythonTests/Atom/golden_images/SpotLight_6.ppm b/AutomatedTesting/Gem/PythonTests/Atom/golden_images/SpotLight_6.ppm
index d442d90287..136eecbaaf 100644
--- a/AutomatedTesting/Gem/PythonTests/Atom/golden_images/SpotLight_6.ppm
+++ b/AutomatedTesting/Gem/PythonTests/Atom/golden_images/SpotLight_6.ppm
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:72eddb7126eae0c839b933886e0fb69d78229f72d49ef13199de28df2b7879db
+oid sha256:caca85f7728f660daae36afc81d681ba2de2377c516eb3c637599de5c94012aa
size 6220817
diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_DisplayMapperAdded.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_DisplayMapperAdded.py
index f8881bfa2a..e2e432364d 100644
--- a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_DisplayMapperAdded.py
+++ b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_DisplayMapperAdded.py
@@ -5,6 +5,7 @@ For complete copyright and license terms please see the LICENSE at the root of t
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
+
class Tests:
camera_creation = (
"Camera Entity successfully created",
@@ -39,6 +40,9 @@ class Tests:
is_hidden = (
"Entity is hidden",
"Entity was not hidden")
+ ldr_color_grading_lut = (
+ "LDR color Grading LUT asset set",
+ "LDR color Grading LUT asset could not be set")
entity_deleted = (
"Entity deleted",
"Entity was not deleted")
@@ -71,16 +75,19 @@ def AtomEditorComponents_DisplayMapper_AddedToEntity():
5) Enter/Exit game mode.
6) Test IsHidden.
7) Test IsVisible.
- 8) Delete Display Mapper entity.
- 9) UNDO deletion.
- 10) REDO deletion.
- 11) Look for errors and asserts.
+ 8) Set LDR color Grading LUT asset.
+ 9) Delete Display Mapper entity.
+ 10) UNDO deletion.
+ 11) REDO deletion.
+ 12) Look for errors and asserts.
:return: None
"""
+ import os
import azlmbr.legacy.general as general
+ from editor_python_test_tools.asset_utils import Asset
from editor_python_test_tools.editor_entity_utils import EditorEntity
from editor_python_test_tools.utils import Report, Tracer, TestHelper
from Atom.atom_utils.atom_constants import AtomComponentProperties
@@ -97,7 +104,7 @@ def AtomEditorComponents_DisplayMapper_AddedToEntity():
Report.critical_result(Tests.display_mapper_creation, display_mapper_entity.exists())
# 2. Add Display Mapper component to Display Mapper entity.
- display_mapper_entity.add_component(AtomComponentProperties.display_mapper())
+ display_mapper_component = display_mapper_entity.add_component(AtomComponentProperties.display_mapper())
Report.critical_result(
Tests.display_mapper_component,
display_mapper_entity.has_component(AtomComponentProperties.display_mapper()))
@@ -140,19 +147,29 @@ def AtomEditorComponents_DisplayMapper_AddedToEntity():
general.idle_wait_frames(1)
Report.result(Tests.is_visible, display_mapper_entity.is_visible() is True)
- # 8. Delete Display Mapper entity.
+ # 8. Set LDR color Grading LUT asset.
+ display_mapper_asset_path = os.path.join("TestData", "test.lightingpreset.azasset")
+ display_mapper_asset = Asset.find_asset_by_path(display_mapper_asset_path, False)
+ display_mapper_component.set_component_property_value(
+ AtomComponentProperties.display_mapper("LDR color Grading LUT"), display_mapper_asset.id)
+ Report.result(
+ Tests.ldr_color_grading_lut,
+ display_mapper_component.get_component_property_value(
+ AtomComponentProperties.display_mapper("LDR color Grading LUT")) == display_mapper_asset.id)
+
+ # 9. Delete Display Mapper entity.
display_mapper_entity.delete()
Report.result(Tests.entity_deleted, not display_mapper_entity.exists())
- # 9. UNDO deletion.
+ # 10. UNDO deletion.
general.undo()
Report.result(Tests.deletion_undo, display_mapper_entity.exists())
- # 10. REDO deletion.
+ # 11. REDO deletion.
general.redo()
Report.result(Tests.deletion_redo, not display_mapper_entity.exists())
- # 11. Look for errors and asserts.
+ # 12. Look for errors and asserts.
TestHelper.wait_for_condition(lambda: error_tracer.has_errors or error_tracer.has_asserts, 1.0)
for error_info in error_tracer.errors:
Report.info(f"Error: {error_info.filename} {error_info.function} | {error_info.message}")
diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_GlobalSkylightIBLAdded.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_GlobalSkylightIBLAdded.py
index db8f2daaee..7f0c38e289 100644
--- a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_GlobalSkylightIBLAdded.py
+++ b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_GlobalSkylightIBLAdded.py
@@ -151,7 +151,7 @@ def AtomEditorComponents_GlobalSkylightIBL_AddedToEntity():
Report.result(Tests.is_visible, global_skylight_entity.is_visible() is True)
# 8. Set the Diffuse Image asset on the Global Skylight (IBL) entity.
- diffuse_image_path = os.path.join("LightingPresets", "greenwich_park_02_4k_iblskyboxcm.exr.streamingimage")
+ diffuse_image_path = os.path.join("LightingPresets", "default_iblskyboxcm.exr.streamingimage")
diffuse_image_asset = Asset.find_asset_by_path(diffuse_image_path, False)
global_skylight_component.set_component_property_value(
AtomComponentProperties.global_skylight('Diffuse Image'), diffuse_image_asset.id)
@@ -161,7 +161,7 @@ def AtomEditorComponents_GlobalSkylightIBL_AddedToEntity():
AtomComponentProperties.global_skylight('Diffuse Image')))
# 9. Set the Specular Image asset on the Global Light (IBL) entity.
- specular_image_path = os.path.join("LightingPresets", "greenwich_park_02_4k_iblskyboxcm.exr.streamingimage")
+ specular_image_path = os.path.join("LightingPresets", "default_iblskyboxcm.exr.streamingimage")
specular_image_asset = Asset.find_asset_by_path(specular_image_path, False)
global_skylight_component.set_component_property_value(
AtomComponentProperties.global_skylight('Specular Image'), specular_image_asset.id)
diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_HDRiSkyboxAdded.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_HDRiSkyboxAdded.py
new file mode 100644
index 0000000000..0f96bc5424
--- /dev/null
+++ b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_HDRiSkyboxAdded.py
@@ -0,0 +1,177 @@
+"""
+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
+"""
+
+
+class Tests:
+ creation_undo = (
+ "UNDO Entity creation success",
+ "UNDO Entity creation failed")
+ creation_redo = (
+ "REDO Entity creation success",
+ "REDO Entity creation failed")
+ hdri_skybox_entity_creation = (
+ "HDRi Skybox successfully created",
+ "HDRi Skybox failed to be created")
+ hdri_skybox_component = (
+ "Entity has an HDRi Skybox component",
+ "Entity failed to find HDRi Skybox component")
+ cubemap_property_set = (
+ "Cubemap property set on HDRi Skybox component",
+ "Couldn't set Cubemap property on HDRi Skybox component")
+ enter_game_mode = (
+ "Entered game mode",
+ "Failed to enter game mode")
+ exit_game_mode = (
+ "Exited game mode",
+ "Couldn't exit game mode")
+ is_visible = (
+ "Entity is visible",
+ "Entity was not visible")
+ is_hidden = (
+ "Entity is hidden",
+ "Entity was not hidden")
+ entity_deleted = (
+ "Entity deleted",
+ "Entity was not deleted")
+ deletion_undo = (
+ "UNDO deletion success",
+ "UNDO deletion failed")
+ deletion_redo = (
+ "REDO deletion success",
+ "REDO deletion failed")
+
+
+def AtomEditorComponents_HDRiSkybox_AddedToEntity():
+ """
+ Summary:
+ Tests the HDRi Skybox component can be added to an entity and has the expected functionality.
+
+ Test setup:
+ - Wait for Editor idle loop.
+ - Open the "Base" level.
+
+ Expected Behavior:
+ The component can be added, used in game mode, hidden/shown, deleted, and has accurate required components.
+ Creation and deletion undo/redo should also work.
+
+ Test Steps:
+ 1) Create an HDRi Skybox with no components.
+ 2) Add an HDRi Skybox component to HDRi Skybox.
+ 3) UNDO the entity creation and component addition.
+ 4) REDO the entity creation and component addition.
+ 5) Enter/Exit game mode.
+ 6) Test IsHidden.
+ 7) Test IsVisible.
+ 8) Delete HDRi Skybox.
+ 9) UNDO deletion.
+ 10) REDO deletion.
+ 11) Look for errors.
+
+ :return: None
+ """
+
+ import os
+
+ import azlmbr.legacy.general as general
+
+ from editor_python_test_tools.asset_utils import Asset
+ from editor_python_test_tools.editor_entity_utils import EditorEntity
+ from editor_python_test_tools.utils import Report, Tracer, TestHelper
+ from Atom.atom_utils.atom_constants import AtomComponentProperties
+
+ with Tracer() as error_tracer:
+ # Test setup begins.
+ # Setup: Wait for Editor idle loop before executing Python hydra scripts then open "Base" level.
+ TestHelper.init_idle()
+ TestHelper.open_level("", "Base")
+
+ # Test steps begin.
+ # 1. Create an HDRi Skybox with no components.
+ hdri_skybox_entity = EditorEntity.create_editor_entity(
+ AtomComponentProperties.hdri_skybox())
+ Report.critical_result(Tests.hdri_skybox_entity_creation,
+ hdri_skybox_entity.exists())
+
+ # 2. Add an HDRi Skybox component to HDRi Skybox.
+ hdri_skybox_component = hdri_skybox_entity.add_component(
+ AtomComponentProperties.hdri_skybox())
+ Report.critical_result(
+ Tests.hdri_skybox_component,
+ hdri_skybox_entity.has_component(AtomComponentProperties.hdri_skybox()))
+
+ # 3. UNDO the entity creation and component addition.
+ # -> UNDO component addition.
+ general.undo()
+ # -> UNDO naming entity.
+ general.undo()
+ # -> UNDO selecting entity.
+ general.undo()
+ # -> UNDO entity creation.
+ general.undo()
+ general.idle_wait_frames(1)
+ Report.result(Tests.creation_undo, not hdri_skybox_entity.exists())
+
+ # 4. REDO the entity creation and component addition.
+ # -> REDO entity creation.
+ general.redo()
+ # -> REDO selecting entity.
+ general.redo()
+ # -> REDO naming entity.
+ general.redo()
+ # -> REDO component addition.
+ general.redo()
+ general.idle_wait_frames(1)
+ Report.result(Tests.creation_redo, hdri_skybox_entity.exists())
+
+
+ # 5. Set Cubemap Texture on HDRi Skybox component.
+ skybox_cubemap_asset_path = os.path.join("LightingPresets", "default_iblskyboxcm.exr.streamingimage")
+ skybox_cubemap_material_asset = Asset.find_asset_by_path(skybox_cubemap_asset_path, False)
+ hdri_skybox_component.set_component_property_value(
+ AtomComponentProperties.hdri_skybox('Cubemap Texture'), skybox_cubemap_material_asset.id)
+ get_cubemap_property = hdri_skybox_component.get_component_property_value(
+ AtomComponentProperties.hdri_skybox('Cubemap Texture'))
+ Report.result(Tests.cubemap_property_set, get_cubemap_property == skybox_cubemap_material_asset.id)
+
+
+ # 6. Enter/Exit game mode.
+ TestHelper.enter_game_mode(Tests.enter_game_mode)
+ general.idle_wait_frames(1)
+ TestHelper.exit_game_mode(Tests.exit_game_mode)
+
+ # 7. Test IsHidden.
+ hdri_skybox_entity.set_visibility_state(False)
+ Report.result(Tests.is_hidden, hdri_skybox_entity.is_hidden() is True)
+
+ # 8. Test IsVisible.
+ hdri_skybox_entity.set_visibility_state(True)
+ general.idle_wait_frames(1)
+ Report.result(Tests.is_visible, hdri_skybox_entity.is_visible() is True)
+
+ # 9. Delete hdri_skybox entity.
+ hdri_skybox_entity.delete()
+ Report.result(Tests.entity_deleted, not hdri_skybox_entity.exists())
+
+ # 10. UNDO deletion.
+ general.undo()
+ Report.result(Tests.deletion_undo, hdri_skybox_entity.exists())
+
+ # 11. REDO deletion.
+ general.redo()
+ Report.result(Tests.deletion_redo, not hdri_skybox_entity.exists())
+
+ # 12. Look for errors or asserts.
+ TestHelper.wait_for_condition(lambda: error_tracer.has_errors or error_tracer.has_asserts, 1.0)
+ for error_info in error_tracer.errors:
+ Report.info(f"Error: {error_info.filename} {error_info.function} | {error_info.message}")
+ for assert_info in error_tracer.asserts:
+ Report.info(f"Assert: {assert_info.filename} {assert_info.function} | {assert_info.message}")
+
+
+if __name__ == "__main__":
+ from editor_python_test_tools.utils import Report
+ Report.start_test(AtomEditorComponents_HDRiSkybox_AddedToEntity)
diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_LookModificationAdded.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_LookModificationAdded.py
new file mode 100644
index 0000000000..afb8033426
--- /dev/null
+++ b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_LookModificationAdded.py
@@ -0,0 +1,211 @@
+"""
+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
+"""
+
+
+class Tests:
+ creation_undo = (
+ "UNDO Entity creation success",
+ "UNDO Entity creation failed")
+ creation_redo = (
+ "REDO Entity creation success",
+ "REDO Entity creation failed")
+ look_modification_creation = (
+ "Look Modification Entity successfully created",
+ "Look Modification Entity failed to be created")
+ look_modification_component = (
+ "Entity has a Look Modification component",
+ "Entity failed to find Look Modification component")
+ look_modification_disabled = (
+ "Look Modification component disabled",
+ "Look Modification component was not disabled")
+ postfx_layer_component = (
+ "Entity has a PostFX Layer component",
+ "Entity did not have an PostFX Layer component")
+ look_modification_enabled = (
+ "Look Modification component enabled",
+ "Look Modification component was not enabled")
+ enable_look_modification_parameter_enabled = (
+ "Enable look modification parameter enabled",
+ "Enable look modification parameter was not enabled")
+ color_grading_lut_set = (
+ "Entity has the Color Grading LUT set",
+ "Entity did not the Color Grading LUT set")
+ enter_game_mode = (
+ "Entered game mode",
+ "Failed to enter game mode")
+ exit_game_mode = (
+ "Exited game mode",
+ "Couldn't exit game mode")
+ is_visible = (
+ "Entity is visible",
+ "Entity was not visible")
+ is_hidden = (
+ "Entity is hidden",
+ "Entity was not hidden")
+ entity_deleted = (
+ "Entity deleted",
+ "Entity was not deleted")
+ deletion_undo = (
+ "UNDO deletion success",
+ "UNDO deletion failed")
+ deletion_redo = (
+ "REDO deletion success",
+ "REDO deletion failed")
+
+
+def AtomEditorComponents_LookModification_AddedToEntity():
+ """
+ Summary:
+ Tests the Look Modification component can be added to an entity and has the expected functionality.
+
+ Test setup:
+ - Wait for Editor idle loop.
+ - Open the "Base" level.
+
+ Expected Behavior:
+ The component can be added, used in game mode, hidden/shown, deleted, and has accurate required components.
+ Creation and deletion undo/redo should also work.
+
+ Test Steps:
+ 1) Create an Look Modification entity with no components.
+ 2) Add Look Modification component to Look Modification entity.
+ 3) UNDO the entity creation and component addition.
+ 4) REDO the entity creation and component addition.
+ 5) Verify Look Modification component not enabled.
+ 6) Add PostFX Layer component since it is required by the Look Modification component.
+ 7) Verify Look Modification component is enabled.
+ 8) Enable the "Enable Look Modification" parameter.
+ 9) Add LUT asset to the Color Grading LUT parameter.
+ 9) Enter/Exit game mode.
+ 10) Test IsHidden.
+ 11) Test IsVisible.
+ 12) Delete Look Modification entity.
+ 13) UNDO deletion.
+ 14) REDO deletion.
+ 15) Look for errors.
+
+ :return: None
+ """
+
+ import os
+
+ import azlmbr.legacy.general as general
+
+ from editor_python_test_tools.asset_utils import Asset
+ from editor_python_test_tools.editor_entity_utils import EditorEntity
+ from editor_python_test_tools.utils import Report, Tracer, TestHelper
+ from Atom.atom_utils.atom_constants import AtomComponentProperties
+
+ with Tracer() as error_tracer:
+ # Test setup begins.
+ # Setup: Wait for Editor idle loop before executing Python hydra scripts then open "Base" level.
+ TestHelper.init_idle()
+ TestHelper.open_level("", "Base")
+
+ # Test steps begin.
+ # 1. Create an Look Modification entity with no components.
+ look_modification_entity = EditorEntity.create_editor_entity(AtomComponentProperties.look_modification())
+ Report.critical_result(Tests.look_modification_creation, look_modification_entity.exists())
+
+ # 2. Add Look Modification component to Look Modification entity.
+ look_modification_component = look_modification_entity.add_component(
+ AtomComponentProperties.look_modification())
+ Report.critical_result(
+ Tests.look_modification_component,
+ look_modification_entity.has_component(AtomComponentProperties.look_modification()))
+
+ # 3. UNDO the entity creation and component addition.
+ # -> UNDO component addition.
+ general.undo()
+ # -> UNDO naming entity.
+ general.undo()
+ # -> UNDO selecting entity.
+ general.undo()
+ # -> UNDO entity creation.
+ general.undo()
+ general.idle_wait_frames(1)
+ Report.result(Tests.creation_undo, not look_modification_entity.exists())
+
+ # 4. REDO the entity creation and component addition.
+ # -> REDO entity creation.
+ general.redo()
+ # -> REDO selecting entity.
+ general.redo()
+ # -> REDO naming entity.
+ general.redo()
+ # -> REDO component addition.
+ general.redo()
+ general.idle_wait_frames(1)
+ Report.result(Tests.creation_redo, look_modification_entity.exists())
+
+ # 5. Verify Look Modification component not enabled.
+ Report.result(Tests.look_modification_disabled, not look_modification_component.is_enabled())
+
+ # 6. Add PostFX Layer component since it is required by the Look Modification component.
+ look_modification_entity.add_component(AtomComponentProperties.postfx_layer())
+ Report.result(
+ Tests.postfx_layer_component,
+ look_modification_entity.has_component(AtomComponentProperties.postfx_layer()))
+
+ # 7. Verify Look Modification component is enabled.
+ Report.result(Tests.look_modification_enabled, look_modification_component.is_enabled())
+
+ # 8. Enable the "Enable look modification" parameter.
+ look_modification_component.set_component_property_value(
+ AtomComponentProperties.look_modification('Enable look modification'), True)
+ Report.result(Tests.enable_look_modification_parameter_enabled,
+ look_modification_component.get_component_property_value(
+ AtomComponentProperties.look_modification('Enable look modification')) is True)
+
+ # 9. Set the Color Grading LUT asset on the Look Modification entity.
+ color_grading_lut_path = os.path.join("ColorGrading", "TestData", "Photoshop", "inv-Log2-48nits",
+ "test_3dl_32_lut.azasset")
+ color_grading_lut_asset = Asset.find_asset_by_path(color_grading_lut_path, False)
+ look_modification_component.set_component_property_value(
+ AtomComponentProperties.look_modification('Color Grading LUT'), color_grading_lut_asset.id)
+ Report.result(
+ Tests.color_grading_lut_set,
+ color_grading_lut_asset.id == look_modification_component.get_component_property_value(
+ AtomComponentProperties.look_modification('Color Grading LUT')))
+
+ # 10. Enter/Exit game mode.
+ TestHelper.enter_game_mode(Tests.enter_game_mode)
+ general.idle_wait_frames(1)
+ TestHelper.exit_game_mode(Tests.exit_game_mode)
+
+ # 11. Test IsHidden.
+ look_modification_entity.set_visibility_state(False)
+ Report.result(Tests.is_hidden, look_modification_entity.is_hidden() is True)
+
+ # 12. Test IsVisible.
+ look_modification_entity.set_visibility_state(True)
+ general.idle_wait_frames(1)
+ Report.result(Tests.is_visible, look_modification_entity.is_visible() is True)
+
+ # 13. Delete Look Modification entity.
+ look_modification_entity.delete()
+ Report.result(Tests.entity_deleted, not look_modification_entity.exists())
+
+ # 14. UNDO deletion.
+ general.undo()
+ Report.result(Tests.deletion_undo, look_modification_entity.exists())
+
+ # 15. REDO deletion.
+ general.redo()
+ Report.result(Tests.deletion_redo, not look_modification_entity.exists())
+
+ # 16. Look for errors and asserts.
+ TestHelper.wait_for_condition(lambda: error_tracer.has_errors or error_tracer.has_asserts, 1.0)
+ for error_info in error_tracer.errors:
+ Report.info(f"Error: {error_info.filename} {error_info.function} | {error_info.message}")
+ for assert_info in error_tracer.asserts:
+ Report.info(f"Assert: {assert_info.filename} {assert_info.function} | {assert_info.message}")
+
+
+if __name__ == "__main__":
+ from editor_python_test_tools.utils import Report
+ Report.start_test(AtomEditorComponents_LookModification_AddedToEntity)
diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomGPU_BasicLevelSetup.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomGPU_BasicLevelSetup.py
index 92c555127a..127b3e5b5f 100644
--- a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomGPU_BasicLevelSetup.py
+++ b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomGPU_BasicLevelSetup.py
@@ -6,30 +6,70 @@ SPDX-License-Identifier: Apache-2.0 OR MIT
"""
-# fmt: off
-class Tests :
- camera_component_added = ("Camera component was added", "Camera component wasn't added")
- camera_fov_set = ("Camera component FOV property set", "Camera component FOV property wasn't set")
- directional_light_component_added = ("Directional Light component added", "Directional Light component wasn't added")
- enter_game_mode = ("Entered game mode", "Failed to enter game mode")
- exit_game_mode = ("Exited game mode", "Couldn't exit game mode")
- global_skylight_component_added = ("Global Skylight (IBL) component added", "Global Skylight (IBL) component wasn't added")
- global_skylight_diffuse_image_set = ("Global Skylight Diffuse Image property set", "Global Skylight Diffuse Image property wasn't set")
- global_skylight_specular_image_set = ("Global Skylight Specular Image property set", "Global Skylight Specular Image property wasn't set")
- ground_plane_material_asset_set = ("Ground Plane Material Asset was set", "Ground Plane Material Asset wasn't set")
- ground_plane_material_component_added = ("Ground Plane Material component added", "Ground Plane Material component wasn't added")
- ground_plane_mesh_asset_set = ("Ground Plane Mesh Asset property was set", "Ground Plane Mesh Asset property wasn't set")
- hdri_skybox_component_added = ("HDRi Skybox component added", "HDRi Skybox component wasn't added")
- hdri_skybox_cubemap_texture_set = ("HDRi Skybox Cubemap Texture property set", "HDRi Skybox Cubemap Texture property wasn't set")
- mesh_component_added = ("Mesh component added", "Mesh component wasn't added")
- no_assert_occurred = ("No asserts detected", "Asserts were detected")
- no_error_occurred = ("No errors detected", "Errors were detected")
- secondary_grid_spacing = ("Secondary Grid Spacing set", "Secondary Grid Spacing not set")
- sphere_material_component_added = ("Sphere Material component added", "Sphere Material component wasn't added")
- sphere_material_set = ("Sphere Material Asset was set", "Sphere Material Asset wasn't set")
- sphere_mesh_asset_set = ("Sphere Mesh Asset was set", "Sphere Mesh Asset wasn't set")
- viewport_set = ("Viewport set to correct size", "Viewport not set to correct size")
-# fmt: on
+class Tests:
+ camera_component_added = (
+ "Camera component was added",
+ "Camera component wasn't added")
+ camera_fov_set = (
+ "Camera component FOV property set",
+ "Camera component FOV property wasn't set")
+ directional_light_component_added = (
+ "Directional Light component added",
+ "Directional Light component wasn't added")
+ enter_game_mode = (
+ "Entered game mode",
+ "Failed to enter game mode")
+ exit_game_mode = (
+ "Exited game mode",
+ "Couldn't exit game mode")
+ global_skylight_component_added = (
+ "Global Skylight (IBL) component added",
+ "Global Skylight (IBL) component wasn't added")
+ global_skylight_diffuse_image_set = (
+ "Global Skylight Diffuse Image property set",
+ "Global Skylight Diffuse Image property wasn't set")
+ global_skylight_specular_image_set = (
+ "Global Skylight Specular Image property set",
+ "Global Skylight Specular Image property wasn't set")
+ ground_plane_material_asset_set = (
+ "Ground Plane Material Asset was set",
+ "Ground Plane Material Asset wasn't set")
+ ground_plane_material_component_added = (
+ "Ground Plane Material component added",
+ "Ground Plane Material component wasn't added")
+ ground_plane_mesh_asset_set = (
+ "Ground Plane Mesh Asset property was set",
+ "Ground Plane Mesh Asset property wasn't set")
+ hdri_skybox_component_added = (
+ "HDRi Skybox component added",
+ "HDRi Skybox component wasn't added")
+ hdri_skybox_cubemap_texture_set = (
+ "HDRi Skybox Cubemap Texture property set",
+ "HDRi Skybox Cubemap Texture property wasn't set")
+ mesh_component_added = (
+ "Mesh component added",
+ "Mesh component wasn't added")
+ no_assert_occurred = (
+ "No asserts detected",
+ "Asserts were detected")
+ no_error_occurred = (
+ "No errors detected",
+ "Errors were detected")
+ secondary_grid_spacing = (
+ "Secondary Grid Spacing set",
+ "Secondary Grid Spacing not set")
+ sphere_material_component_added = (
+ "Sphere Material component added",
+ "Sphere Material component wasn't added")
+ sphere_material_set = (
+ "Sphere Material Asset was set",
+ "Sphere Material Asset wasn't set")
+ sphere_mesh_asset_set = (
+ "Sphere Mesh Asset was set",
+ "Sphere Mesh Asset wasn't set")
+ viewport_set = (
+ "Viewport set to correct size",
+ "Viewport not set to correct size")
def AtomGPU_BasicLevelSetup_SetsUpLevel():
@@ -77,19 +117,17 @@ def AtomGPU_BasicLevelSetup_SetsUpLevel():
import os
from math import isclose
- import azlmbr.asset as asset
- import azlmbr.bus as bus
import azlmbr.legacy.general as general
import azlmbr.math as math
import azlmbr.paths
+ from editor_python_test_tools.asset_utils import Asset
from editor_python_test_tools.editor_entity_utils import EditorEntity
- from editor_python_test_tools.utils import Report, Tracer, TestHelper as helper
+ from editor_python_test_tools.utils import Report, Tracer, TestHelper
+ from Atom.atom_utils.atom_constants import AtomComponentProperties
from Atom.atom_utils.screenshot_utils import ScreenshotHelper
- MATERIAL_COMPONENT_NAME = "Material"
- MESH_COMPONENT_NAME = "Mesh"
SCREENSHOT_NAME = "AtomBasicLevelSetup"
SCREEN_WIDTH = 1280
SCREEN_HEIGHT = 720
@@ -98,24 +136,24 @@ def AtomGPU_BasicLevelSetup_SetsUpLevel():
def initial_viewport_setup(screen_width, screen_height):
general.set_viewport_size(screen_width, screen_height)
general.update_viewport()
- result = isclose(
- a=general.get_viewport_size().x, b=SCREEN_WIDTH, rel_tol=0.1) and isclose(
- a=general.get_viewport_size().y, b=SCREEN_HEIGHT, rel_tol=0.1)
-
- return result
+ TestHelper.wait_for_condition(
+ function=lambda: isclose(a=general.get_viewport_size().x, b=SCREEN_WIDTH, rel_tol=0.1)
+ and isclose(a=general.get_viewport_size().y, b=SCREEN_HEIGHT, rel_tol=0.1),
+ timeout_in_seconds=4.0
+ )
with Tracer() as error_tracer:
# Test setup begins.
# Setup: Wait for Editor idle loop before executing Python hydra scripts then open "Base" level.
- helper.init_idle()
- helper.open_level("", "Base")
+ TestHelper.init_idle()
+ TestHelper.open_level("", "Base")
# Test steps begin.
# 1. Close error windows and display helpers then update the viewport size.
- helper.close_error_windows()
- helper.close_display_helpers()
+ TestHelper.close_error_windows()
+ TestHelper.close_display_helpers()
+ initial_viewport_setup(SCREEN_WIDTH, SCREEN_HEIGHT)
general.update_viewport()
- Report.critical_result(Tests.viewport_set, initial_viewport_setup(SCREEN_WIDTH, SCREEN_HEIGHT))
# 2. Create Default Level Entity.
default_level_entity_name = "Default Level"
@@ -123,168 +161,167 @@ def AtomGPU_BasicLevelSetup_SetsUpLevel():
math.Vector3(0.0, 0.0, 0.0), default_level_entity_name)
# 3. Create Grid Entity as a child entity of the Default Level Entity.
- grid_name = "Grid"
- grid_entity = EditorEntity.create_editor_entity(grid_name, default_level_entity.id)
+ grid_entity = EditorEntity.create_editor_entity(AtomComponentProperties.grid(), default_level_entity.id)
# 4. Add Grid component to Grid Entity and set Secondary Grid Spacing.
- grid_component = grid_entity.add_component(grid_name)
- secondary_grid_spacing_property = "Controller|Configuration|Secondary Grid Spacing"
+ grid_component = grid_entity.add_component(AtomComponentProperties.grid())
secondary_grid_spacing_value = 1.0
- grid_component.set_component_property_value(secondary_grid_spacing_property, secondary_grid_spacing_value)
+ grid_component.set_component_property_value(
+ AtomComponentProperties.grid('Secondary Grid Spacing'), secondary_grid_spacing_value)
secondary_grid_spacing_set = grid_component.get_component_property_value(
- secondary_grid_spacing_property) == secondary_grid_spacing_value
+ AtomComponentProperties.grid('Secondary Grid Spacing')) == secondary_grid_spacing_value
Report.result(Tests.secondary_grid_spacing, secondary_grid_spacing_set)
# 5. Create Global Skylight (IBL) Entity as a child entity of the Default Level Entity.
- global_skylight_name = "Global Skylight (IBL)"
- global_skylight_entity = EditorEntity.create_editor_entity(global_skylight_name, default_level_entity.id)
+ global_skylight_entity = EditorEntity.create_editor_entity(
+ AtomComponentProperties.global_skylight(), default_level_entity.id)
# 6. Add HDRi Skybox component to the Global Skylight (IBL) Entity.
- hdri_skybox_name = "HDRi Skybox"
- hdri_skybox_component = global_skylight_entity.add_component(hdri_skybox_name)
- Report.result(Tests.hdri_skybox_component_added, global_skylight_entity.has_component(hdri_skybox_name))
+ hdri_skybox_component = global_skylight_entity.add_component(AtomComponentProperties.hdri_skybox())
+ Report.result(Tests.hdri_skybox_component_added, global_skylight_entity.has_component(
+ AtomComponentProperties.hdri_skybox()))
# 7. Add Global Skylight (IBL) component to the Global Skylight (IBL) Entity.
- global_skylight_component = global_skylight_entity.add_component(global_skylight_name)
- Report.result(Tests.global_skylight_component_added, global_skylight_entity.has_component(global_skylight_name))
+ global_skylight_component = global_skylight_entity.add_component(AtomComponentProperties.global_skylight())
+ Report.result(Tests.global_skylight_component_added, global_skylight_entity.has_component(
+ AtomComponentProperties.global_skylight()))
# 8. Set the Cubemap Texture property of the HDRi Skybox component.
- global_skylight_image_asset_path = os.path.join(
- "LightingPresets", "greenwich_park_02_4k_iblskyboxcm_iblspecular.exr.streamingimage")
- global_skylight_image_asset = asset.AssetCatalogRequestBus(
- bus.Broadcast, "GetAssetIdByPath", global_skylight_image_asset_path, math.Uuid(), False)
- hdri_skybox_cubemap_texture_property = "Controller|Configuration|Cubemap Texture"
+ global_skylight_image_asset_path = os.path.join("LightingPresets", "default_iblskyboxcm.exr.streamingimage")
+ global_skylight_image_asset = Asset.find_asset_by_path(global_skylight_image_asset_path, False)
hdri_skybox_component.set_component_property_value(
- hdri_skybox_cubemap_texture_property, global_skylight_image_asset)
+ AtomComponentProperties.hdri_skybox('Cubemap Texture'), global_skylight_image_asset.id)
Report.result(
Tests.hdri_skybox_cubemap_texture_set,
hdri_skybox_component.get_component_property_value(
- hdri_skybox_cubemap_texture_property) == global_skylight_image_asset)
+ AtomComponentProperties.hdri_skybox('Cubemap Texture')) == global_skylight_image_asset.id)
# 9. Set the Diffuse Image property of the Global Skylight (IBL) component.
# Re-use the same image that was used in the previous test step.
- global_skylight_diffuse_image_property = "Controller|Configuration|Diffuse Image"
+ global_skylight_diffuse_image_asset_path = os.path.join(
+ "LightingPresets", "default_iblskyboxcm_ibldiffuse.exr.streamingimage")
+ global_skylight_diffuse_image_asset = Asset.find_asset_by_path(global_skylight_diffuse_image_asset_path, False)
global_skylight_component.set_component_property_value(
- global_skylight_diffuse_image_property, global_skylight_image_asset)
+ AtomComponentProperties.global_skylight('Diffuse Image'), global_skylight_diffuse_image_asset.id)
Report.result(
Tests.global_skylight_diffuse_image_set,
global_skylight_component.get_component_property_value(
- global_skylight_diffuse_image_property) == global_skylight_image_asset)
+ AtomComponentProperties.global_skylight('Diffuse Image')) == global_skylight_diffuse_image_asset.id)
# 10. Set the Specular Image property of the Global Skylight (IBL) component.
# Re-use the same image that was used in the previous test step.
- global_skylight_specular_image_property = "Controller|Configuration|Specular Image"
+ global_skylight_specular_image_asset_path = os.path.join(
+ "LightingPresets", "default_iblskyboxcm_iblspecular.exr.streamingimage")
+ global_skylight_specular_image_asset = Asset.find_asset_by_path(
+ global_skylight_specular_image_asset_path, False)
global_skylight_component.set_component_property_value(
- global_skylight_specular_image_property, global_skylight_image_asset)
+ AtomComponentProperties.global_skylight('Specular Image'), global_skylight_specular_image_asset.id)
global_skylight_specular_image_set = global_skylight_component.get_component_property_value(
- global_skylight_specular_image_property)
+ AtomComponentProperties.global_skylight('Specular Image'))
Report.result(
- Tests.global_skylight_specular_image_set, global_skylight_specular_image_set == global_skylight_image_asset)
+ Tests.global_skylight_specular_image_set,
+ global_skylight_specular_image_set == global_skylight_specular_image_asset.id)
# 11. Create a Ground Plane Entity with a Material component that is a child entity of the Default Level Entity.
ground_plane_name = "Ground Plane"
ground_plane_entity = EditorEntity.create_editor_entity(ground_plane_name, default_level_entity.id)
- ground_plane_material_component = ground_plane_entity.add_component(MATERIAL_COMPONENT_NAME)
+ ground_plane_material_component = ground_plane_entity.add_component(AtomComponentProperties.material())
Report.result(
- Tests.ground_plane_material_component_added, ground_plane_entity.has_component(MATERIAL_COMPONENT_NAME))
+ Tests.ground_plane_material_component_added,
+ ground_plane_entity.has_component(AtomComponentProperties.material()))
# 12. Set the Material Asset property of the Material component for the Ground Plane Entity.
ground_plane_entity.set_local_uniform_scale(32.0)
ground_plane_material_asset_path = os.path.join("Materials", "Presets", "PBR", "metal_chrome.azmaterial")
- ground_plane_material_asset = asset.AssetCatalogRequestBus(
- bus.Broadcast, "GetAssetIdByPath", ground_plane_material_asset_path, math.Uuid(), False)
- ground_plane_material_asset_property = "Default Material|Material Asset"
+ ground_plane_material_asset = Asset.find_asset_by_path(ground_plane_material_asset_path, False)
ground_plane_material_component.set_component_property_value(
- ground_plane_material_asset_property, ground_plane_material_asset)
+ AtomComponentProperties.material('Material Asset'), ground_plane_material_asset.id)
Report.result(
Tests.ground_plane_material_asset_set,
ground_plane_material_component.get_component_property_value(
- ground_plane_material_asset_property) == ground_plane_material_asset)
+ AtomComponentProperties.material('Material Asset')) == ground_plane_material_asset.id)
# 13. Add the Mesh component to the Ground Plane Entity and set the Mesh component Mesh Asset property.
- ground_plane_mesh_component = ground_plane_entity.add_component(MESH_COMPONENT_NAME)
- Report.result(Tests.mesh_component_added, ground_plane_entity.has_component(MESH_COMPONENT_NAME))
- ground_plane_mesh_asset_path = os.path.join("Objects", "plane.azmodel")
- ground_plane_mesh_asset = asset.AssetCatalogRequestBus(
- bus.Broadcast, "GetAssetIdByPath", ground_plane_mesh_asset_path, math.Uuid(), False)
- ground_plane_mesh_asset_property = "Controller|Configuration|Mesh Asset"
+ ground_plane_mesh_component = ground_plane_entity.add_component(AtomComponentProperties.mesh())
+ Report.result(Tests.mesh_component_added, ground_plane_entity.has_component(AtomComponentProperties.mesh()))
+ ground_plane_mesh_asset_path = os.path.join("TestData", "Objects", "plane.azmodel")
+ ground_plane_mesh_asset = Asset.find_asset_by_path(ground_plane_mesh_asset_path, False)
ground_plane_mesh_component.set_component_property_value(
- ground_plane_mesh_asset_property, ground_plane_mesh_asset)
+ AtomComponentProperties.mesh('Mesh Asset'), ground_plane_mesh_asset.id)
Report.result(
Tests.ground_plane_mesh_asset_set,
ground_plane_mesh_component.get_component_property_value(
- ground_plane_mesh_asset_property) == ground_plane_mesh_asset)
+ AtomComponentProperties.mesh('Mesh Asset')) == ground_plane_mesh_asset.id)
# 14. Create a Directional Light Entity as a child entity of the Default Level Entity.
- directional_light_name = "Directional Light"
directional_light_entity = EditorEntity.create_editor_entity_at(
- math.Vector3(0.0, 0.0, 10.0), directional_light_name, default_level_entity.id)
+ math.Vector3(0.0, 0.0, 10.0), AtomComponentProperties.directional_light(), default_level_entity.id)
# 15. Add Directional Light component to Directional Light Entity and set entity rotation.
- directional_light_entity.add_component(directional_light_name)
+ directional_light_entity.add_component(AtomComponentProperties.directional_light())
directional_light_entity_rotation = math.Vector3(DEGREE_RADIAN_FACTOR * -90.0, 0.0, 0.0)
directional_light_entity.set_local_rotation(directional_light_entity_rotation)
Report.result(
- Tests.directional_light_component_added, directional_light_entity.has_component(directional_light_name))
+ Tests.directional_light_component_added, directional_light_entity.has_component(
+ AtomComponentProperties.directional_light()))
# 16. Create a Sphere Entity as a child entity of the Default Level Entity then add a Material component.
sphere_entity = EditorEntity.create_editor_entity_at(
math.Vector3(0.0, 0.0, 1.0), "Sphere", default_level_entity.id)
- sphere_material_component = sphere_entity.add_component(MATERIAL_COMPONENT_NAME)
- Report.result(Tests.sphere_material_component_added, sphere_entity.has_component(MATERIAL_COMPONENT_NAME))
+ sphere_material_component = sphere_entity.add_component(AtomComponentProperties.material())
+ Report.result(Tests.sphere_material_component_added, sphere_entity.has_component(
+ AtomComponentProperties.material()))
# 17. Set the Material Asset property of the Material component for the Sphere Entity.
sphere_material_asset_path = os.path.join("Materials", "Presets", "PBR", "metal_brass_polished.azmaterial")
- sphere_material_asset = asset.AssetCatalogRequestBus(
- bus.Broadcast, "GetAssetIdByPath", sphere_material_asset_path, math.Uuid(), False)
- sphere_material_asset_property = "Default Material|Material Asset"
- sphere_material_component.set_component_property_value(sphere_material_asset_property, sphere_material_asset)
+ sphere_material_asset = Asset.find_asset_by_path(sphere_material_asset_path, False)
+ sphere_material_component.set_component_property_value(
+ AtomComponentProperties.material('Material Asset'), sphere_material_asset.id)
Report.result(Tests.sphere_material_set, sphere_material_component.get_component_property_value(
- sphere_material_asset_property) == sphere_material_asset)
+ AtomComponentProperties.material('Material Asset')) == sphere_material_asset.id)
# 18. Add Mesh component to Sphere Entity and set the Mesh Asset property for the Mesh component.
- sphere_mesh_component = sphere_entity.add_component(MESH_COMPONENT_NAME)
+ sphere_mesh_component = sphere_entity.add_component(AtomComponentProperties.mesh())
sphere_mesh_asset_path = os.path.join("Models", "sphere.azmodel")
- sphere_mesh_asset = asset.AssetCatalogRequestBus(
- bus.Broadcast, "GetAssetIdByPath", sphere_mesh_asset_path, math.Uuid(), False)
- sphere_mesh_asset_property = "Controller|Configuration|Mesh Asset"
- sphere_mesh_component.set_component_property_value(sphere_mesh_asset_property, sphere_mesh_asset)
+ sphere_mesh_asset = Asset.find_asset_by_path(sphere_mesh_asset_path, False)
+ sphere_mesh_component.set_component_property_value(
+ AtomComponentProperties.mesh('Mesh Asset'), sphere_mesh_asset.id)
Report.result(Tests.sphere_mesh_asset_set, sphere_mesh_component.get_component_property_value(
- sphere_mesh_asset_property) == sphere_mesh_asset)
+ AtomComponentProperties.mesh('Mesh Asset')) == sphere_mesh_asset.id)
# 19. Create a Camera Entity as a child entity of the Default Level Entity then add a Camera component.
- camera_name = "Camera"
camera_entity = EditorEntity.create_editor_entity_at(
- math.Vector3(5.5, -12.0, 9.0), camera_name, default_level_entity.id)
- camera_component = camera_entity.add_component(camera_name)
- Report.result(Tests.camera_component_added, camera_entity.has_component(camera_name))
+ math.Vector3(5.5, -12.0, 9.0), AtomComponentProperties.camera(), default_level_entity.id)
+ camera_component = camera_entity.add_component(AtomComponentProperties.camera())
+ Report.result(Tests.camera_component_added, camera_entity.has_component(AtomComponentProperties.camera()))
# 20. Set the Camera Entity rotation value and set the Camera component Field of View value.
camera_entity_rotation = math.Vector3(
DEGREE_RADIAN_FACTOR * -27.0, DEGREE_RADIAN_FACTOR * -12.0, DEGREE_RADIAN_FACTOR * 25.0)
camera_entity.set_local_rotation(camera_entity_rotation)
- camera_fov_property = "Controller|Configuration|Field of view"
camera_fov_value = 60.0
- camera_component.set_component_property_value(camera_fov_property, camera_fov_value)
+ camera_component.set_component_property_value(AtomComponentProperties.camera('Field of view'), camera_fov_value)
azlmbr.camera.EditorCameraViewRequestBus(azlmbr.bus.Event, "ToggleCameraAsActiveView", camera_entity.id)
Report.result(Tests.camera_fov_set, camera_component.get_component_property_value(
- camera_fov_property) == camera_fov_value)
+ AtomComponentProperties.camera('Field of view')) == camera_fov_value)
# 21. Enter game mode.
- helper.enter_game_mode(Tests.enter_game_mode)
- helper.wait_for_condition(function=lambda: general.is_in_game_mode(), timeout_in_seconds=4.0)
+ TestHelper.enter_game_mode(Tests.enter_game_mode)
+ TestHelper.wait_for_condition(function=lambda: general.is_in_game_mode(), timeout_in_seconds=4.0)
# 22. Take screenshot.
ScreenshotHelper(general.idle_wait_frames).capture_screenshot_blocking(f"{SCREENSHOT_NAME}.ppm")
# 23. Exit game mode.
- helper.exit_game_mode(Tests.exit_game_mode)
- helper.wait_for_condition(function=lambda: not general.is_in_game_mode(), timeout_in_seconds=4.0)
+ TestHelper.exit_game_mode(Tests.exit_game_mode)
+ TestHelper.wait_for_condition(function=lambda: not general.is_in_game_mode(), timeout_in_seconds=4.0)
# 24. Look for errors.
- helper.wait_for_condition(lambda: error_tracer.has_errors or error_tracer.has_asserts, 1.0)
- Report.result(Tests.no_assert_occurred, not error_tracer.has_asserts)
- Report.result(Tests.no_error_occurred, not error_tracer.has_errors)
+ TestHelper.wait_for_condition(lambda: error_tracer.has_errors or error_tracer.has_asserts, 1.0)
+ for error_info in error_tracer.errors:
+ Report.info(f"Error: {error_info.filename} {error_info.function} | {error_info.message}")
+ for assert_info in error_tracer.asserts:
+ Report.info(f"Assert: {assert_info.filename} {assert_info.function} | {assert_info.message}")
if __name__ == "__main__":
diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_GPUTest_BasicLevelSetup.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_GPUTest_BasicLevelSetup.py
index 645447e6de..1641b529ae 100644
--- a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_GPUTest_BasicLevelSetup.py
+++ b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_GPUTest_BasicLevelSetup.py
@@ -106,8 +106,7 @@ def run():
components=["HDRi Skybox", "Global Skylight (IBL)"],
parent_id=default_level.id
)
- global_skylight_image_asset_path = os.path.join(
- "LightingPresets", "greenwich_park_02_4k_iblskyboxcm_iblspecular.exr.streamingimage")
+ global_skylight_image_asset_path = os.path.join("LightingPresets", "default_iblskyboxcm.exr.streamingimage")
global_skylight_image_asset = asset.AssetCatalogRequestBus(
bus.Broadcast, "GetAssetIdByPath", global_skylight_image_asset_path, math.Uuid(), False)
global_skylight.get_set_test(0, "Controller|Configuration|Cubemap Texture", global_skylight_image_asset)
diff --git a/AutomatedTesting/Gem/PythonTests/Blast/TestSuite_Main.py b/AutomatedTesting/Gem/PythonTests/Blast/TestSuite_Main.py
index dbc4a1a456..a047d09d29 100644
--- a/AutomatedTesting/Gem/PythonTests/Blast/TestSuite_Main.py
+++ b/AutomatedTesting/Gem/PythonTests/Blast/TestSuite_Main.py
@@ -23,28 +23,28 @@ from base import TestAutomationBase
class TestAutomation(TestAutomationBase):
def test_ActorSplitsAfterCollision(self, request, workspace, editor, launcher_platform):
from .tests import Blast_ActorSplitsAfterCollision as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_ActorSplitsAfterRadialDamage(self, request, workspace, editor, launcher_platform):
from .tests import Blast_ActorSplitsAfterRadialDamage as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_ActorSplitsAfterCapsuleDamage(self, request, workspace, editor, launcher_platform):
from .tests import Blast_ActorSplitsAfterCapsuleDamage as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_ActorSplitsAfterImpactSpreadDamage(self, request, workspace, editor, launcher_platform):
from .tests import Blast_ActorSplitsAfterImpactSpreadDamage as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_ActorSplitsAfterShearDamage(self, request, workspace, editor, launcher_platform):
from .tests import Blast_ActorSplitsAfterShearDamage as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_ActorSplitsAfterTriangleDamage(self, request, workspace, editor, launcher_platform):
from .tests import Blast_ActorSplitsAfterTriangleDamage as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_ActorSplitsAfterStressDamage(self, request, workspace, editor, launcher_platform):
from .tests import Blast_ActorSplitsAfterStressDamage as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
diff --git a/AutomatedTesting/Gem/PythonTests/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/CMakeLists.txt
index bec49185bd..800f347359 100644
--- a/AutomatedTesting/Gem/PythonTests/CMakeLists.txt
+++ b/AutomatedTesting/Gem/PythonTests/CMakeLists.txt
@@ -56,6 +56,9 @@ add_subdirectory(streaming)
## Smoke ##
add_subdirectory(smoke)
+## Terrain ##
+add_subdirectory(Terrain)
+
## AWS ##
add_subdirectory(AWS)
diff --git a/AutomatedTesting/Gem/PythonTests/EditorPythonBindings/ComponentUpdateListProperty_test.py b/AutomatedTesting/Gem/PythonTests/EditorPythonBindings/ComponentUpdateListProperty_test.py
index ed677ea185..a8ca721cca 100755
--- a/AutomatedTesting/Gem/PythonTests/EditorPythonBindings/ComponentUpdateListProperty_test.py
+++ b/AutomatedTesting/Gem/PythonTests/EditorPythonBindings/ComponentUpdateListProperty_test.py
@@ -51,5 +51,6 @@ class TestComponentAssetListAutomation(object):
editor,
"ComponentUpdateListProperty_test_case.py",
expected_lines=expected_lines,
- cfg_args=[level]
+ cfg_args=[level],
+ enable_prefab_system=False,
)
diff --git a/AutomatedTesting/Gem/PythonTests/EditorPythonBindings/ObjectManagerCommands_test_case.py b/AutomatedTesting/Gem/PythonTests/EditorPythonBindings/ObjectManagerCommands_test_case.py
index 9a308ab9c1..28b49bb4cb 100755
--- a/AutomatedTesting/Gem/PythonTests/EditorPythonBindings/ObjectManagerCommands_test_case.py
+++ b/AutomatedTesting/Gem/PythonTests/EditorPythonBindings/ObjectManagerCommands_test_case.py
@@ -67,30 +67,6 @@ if (editor.EditorToolsApplicationRequestBus(bus.Broadcast, 'GetCurrentLevelName'
if(general.get_num_selected() == 0):
print("clear_selection works")
- general.hide_all_objects()
-
- if(general.is_object_hidden(objs_list[1])):
- print("hide_all_objects works")
-
- general.unhide_object(objs_list[1])
-
- if not(general.is_object_hidden(objs_list[1])):
- print("unhide_object works")
-
- general.hide_object(objs_list[1])
-
- if(general.is_object_hidden(objs_list[1])):
- print("hide_object works")
-
- general.unhide_all_objects()
-
- general.freeze_object(objs_list[1])
-
- if(general.is_object_frozen(objs_list[1])):
- print("freeze_object works")
-
- general.unfreeze_object(objs_list[1])
-
position = general.get_position(objs_list[1])
px1, py1, pz1 = fetch_vector3_parts(position)
general.set_position(objs_list[1], px1 + 10, py1 - 4, pz1 + 3)
diff --git a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/README.txt b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/README.txt
index 90afee39bc..bd9740f60f 100644
--- a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/README.txt
+++ b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/README.txt
@@ -26,9 +26,9 @@ INSTALL
It is recommended to set up these these tools with O3DE's CMake build commands.
Assuming CMake is already setup on your operating system, below are some sample build commands:
cd /path/to/od3e/
- mkdir windows_vs2019
- cd windows_vs2019
- cmake .. -G "Visual Studio 16 2019" -A x64 -T host=x64 -DLY_3RDPARTY_PATH="%3RDPARTYPATH%" -DLY_PROJECTS=AutomatedTesting
+ mkdir windows
+ cd windows
+ cmake .. -G "Visual Studio 16 2019" -DLY_PROJECTS=AutomatedTesting
To manually install the project in development mode using your own installed Python interpreter:
cd /path/to/od3e/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools
diff --git a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py
index 9e857ed8bc..309601b0ba 100644
--- a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py
+++ b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py
@@ -132,6 +132,7 @@ class EditorEntity:
def __init__(self, id: azlmbr.entity.EntityId):
self.id: azlmbr.entity.EntityId = id
+ self.components: List[EditorComponent] = []
# Creation functions
@classmethod
@@ -279,7 +280,7 @@ class EditorEntity:
), f"Failure: Could not add component: '{new_comp.get_component_name()}' to entity: '{self.get_name()}'"
new_comp.id = add_component_outcome.GetValue()[0]
components.append(new_comp)
-
+ self.components.append(new_comp)
return components
def get_components_of_type(self, component_names: list) -> List[EditorComponent]:
@@ -458,3 +459,14 @@ class EditorEntity:
"""
new_translation = convert_to_azvector3(new_translation)
azlmbr.components.TransformBus(azlmbr.bus.Event, "SetLocalTranslation", self.id, new_translation)
+
+ # Use this only when prefab system is enabled as it will fail otherwise.
+ def focus_on_owning_prefab(self) -> None:
+ """
+ Focuses on the owning prefab instance of the given entity.
+ :param entity: The entity used to fetch the owning prefab to focus on.
+ """
+
+ assert self.id.isValid(), "A valid entity id is required to focus on its owning prefab."
+ focus_prefab_result = azlmbr.prefab.PrefabFocusPublicRequestBus(bus.Broadcast, "FocusOnOwningPrefab", self.id)
+ assert focus_prefab_result.IsSuccess(), f"Prefab operation 'FocusOnOwningPrefab' failed. Error: {focus_prefab_result.GetError()}"
diff --git a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/hydra_editor_utils.py b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/hydra_editor_utils.py
index 985e32ede5..19aa6e9d3c 100644
--- a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/hydra_editor_utils.py
+++ b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/hydra_editor_utils.py
@@ -57,6 +57,10 @@ def add_level_component(component_name):
level_component_list, entity.EntityType().Level)
level_component_outcome = editor.EditorLevelComponentAPIBus(bus.Broadcast, 'AddComponentsOfType',
[level_component_type_ids_list[0]])
+ if not level_component_outcome.IsSuccess():
+ print('Failed to add {} level component'.format(component_name))
+ return None
+
level_component = level_component_outcome.GetValue()[0]
return level_component
diff --git a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/hydra_test_utils.py b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/hydra_test_utils.py
index 510d1b1149..ee36a640f0 100644
--- a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/hydra_test_utils.py
+++ b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/hydra_test_utils.py
@@ -29,7 +29,7 @@ def teardown_editor(editor):
def launch_and_validate_results(request, test_directory, editor, editor_script, expected_lines, unexpected_lines=[],
halt_on_unexpected=False, run_python="--runpythontest", auto_test_mode=True, null_renderer=True, cfg_args=[],
- timeout=300, log_file_name="Editor.log"):
+ timeout=300, log_file_name="Editor.log", enable_prefab_system=True):
"""
Runs the Editor with the specified script, and monitors for expected log lines.
:param request: Special fixture providing information of the requesting test function.
@@ -45,17 +45,22 @@ def launch_and_validate_results(request, test_directory, editor, editor_script,
:param cfg_args: Additional arguments for CFG, such as LevelName.
:param timeout: Length of time for test to run. Default is 60.
:param log_file_name: Name of the log file created by the editor. Defaults to 'Editor.log'
+ :param enable_prefab_system: Flag to determine whether to use new prefab system or use deprecated slice system. Defaults to True.
"""
test_case = os.path.join(test_directory, editor_script)
request.addfinalizer(lambda: teardown_editor(editor))
logger.debug("Running automated test: {}".format(editor_script))
editor.args.extend(["--skipWelcomeScreenDialog", "--regset=/Amazon/Settings/EnableSourceControl=false",
- "--regset=/Amazon/Preferences/EnablePrefabSystem=false", run_python, test_case,
+ run_python, test_case,
f"--pythontestcase={request.node.name}", "--runpythonargs", " ".join(cfg_args)])
if auto_test_mode:
editor.args.extend(["--autotest_mode"])
if null_renderer:
editor.args.extend(["-rhi=Null"])
+ if enable_prefab_system:
+ editor.args.extend(["--regset=/Amazon/Preferences/EnablePrefabSystem=true"])
+ else:
+ editor.args.extend(["--regset=/Amazon/Preferences/EnablePrefabSystem=false"])
with editor.start():
diff --git a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/utils.py b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/utils.py
index 481d73274f..212c862efd 100644
--- a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/utils.py
+++ b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/utils.py
@@ -34,6 +34,38 @@ class TestHelper:
# JIRA: SPEC-2880
# general.idle_wait_frames(1)
+ @staticmethod
+ def create_level(level_name: str) -> bool:
+ """
+ :param level_name: The name of the level to be created
+ :return: True if ECreateLevelResult returns 0, False otherwise with logging to report reason
+ """
+ Report.info(f"Creating level {level_name}")
+
+ # Use these hardcoded values to pass expected values for old terrain system until new create_level API is
+ # available
+ heightmap_resolution = 1024
+ heightmap_meters_per_pixel = 1
+ terrain_texture_resolution = 4096
+ use_terrain = False
+
+ result = general.create_level_no_prompt(level_name, heightmap_resolution, heightmap_meters_per_pixel,
+ terrain_texture_resolution, use_terrain)
+
+ # Result codes are ECreateLevelResult defined in CryEdit.h
+ if result == 1:
+ Report.info(f"{level_name} level already exists")
+ elif result == 2:
+ Report.info("Failed to create directory")
+ elif result == 3:
+ Report.info("Directory length is too long")
+ elif result != 0:
+ Report.info("Unknown error, failed to create level")
+ else:
+ Report.info(f"{level_name} level created successfully")
+
+ return result == 0
+
@staticmethod
def open_level(directory : str, level : str):
# type: (str, str) -> None
diff --git a/AutomatedTesting/Gem/PythonTests/Multiplayer/TestSuite_Main.py b/AutomatedTesting/Gem/PythonTests/Multiplayer/TestSuite_Main.py
index df1eb62943..450c760786 100644
--- a/AutomatedTesting/Gem/PythonTests/Multiplayer/TestSuite_Main.py
+++ b/AutomatedTesting/Gem/PythonTests/Multiplayer/TestSuite_Main.py
@@ -23,7 +23,6 @@ from base import TestAutomationBase
class TestAutomation(TestAutomationBase):
def _run_prefab_test(self, request, workspace, editor, test_module, batch_mode=True, autotest_mode=True):
self._run_test(request, workspace, editor, test_module,
- extra_cmdline_args=["--regset=/Amazon/Preferences/EnablePrefabSystem=true"],
batch_mode=batch_mode,
autotest_mode=autotest_mode)
diff --git a/AutomatedTesting/Gem/PythonTests/Multiplayer/TestSuite_Sandbox.py b/AutomatedTesting/Gem/PythonTests/Multiplayer/TestSuite_Sandbox.py
index 52ac19b26e..8f50d4d36d 100644
--- a/AutomatedTesting/Gem/PythonTests/Multiplayer/TestSuite_Sandbox.py
+++ b/AutomatedTesting/Gem/PythonTests/Multiplayer/TestSuite_Sandbox.py
@@ -24,7 +24,6 @@ from base import TestAutomationBase
class TestAutomation(TestAutomationBase):
def _run_prefab_test(self, request, workspace, editor, test_module, batch_mode=True, autotest_mode=True):
self._run_test(request, workspace, editor, test_module,
- extra_cmdline_args=["--regset=/Amazon/Preferences/EnablePrefabSystem=true"],
batch_mode=batch_mode,
autotest_mode=autotest_mode)
diff --git a/AutomatedTesting/Gem/PythonTests/NvCloth/TestSuite_Main.py b/AutomatedTesting/Gem/PythonTests/NvCloth/TestSuite_Main.py
index 49a776a48c..f35f098b0f 100644
--- a/AutomatedTesting/Gem/PythonTests/NvCloth/TestSuite_Main.py
+++ b/AutomatedTesting/Gem/PythonTests/NvCloth/TestSuite_Main.py
@@ -25,8 +25,8 @@ class TestAutomation(TestAutomationBase):
def test_NvCloth_AddClothSimulationToMesh(self, request, workspace, editor, launcher_platform):
from .tests import NvCloth_AddClothSimulationToMesh as test_module
- self._run_test(request, workspace, editor, test_module, use_null_renderer = self.use_null_renderer)
+ self._run_test(request, workspace, editor, test_module, use_null_renderer = self.use_null_renderer, enable_prefab_system=False)
def test_NvCloth_AddClothSimulationToActor(self, request, workspace, editor, launcher_platform):
from .tests import NvCloth_AddClothSimulationToActor as test_module
- self._run_test(request, workspace, editor, test_module, use_null_renderer = self.use_null_renderer)
+ self._run_test(request, workspace, editor, test_module, use_null_renderer = self.use_null_renderer, enable_prefab_system=False)
diff --git a/AutomatedTesting/Gem/PythonTests/Physics/TestSuite_InDevelopment.py b/AutomatedTesting/Gem/PythonTests/Physics/TestSuite_InDevelopment.py
index 9e3a9cb4ff..09d8f5635f 100755
--- a/AutomatedTesting/Gem/PythonTests/Physics/TestSuite_InDevelopment.py
+++ b/AutomatedTesting/Gem/PythonTests/Physics/TestSuite_InDevelopment.py
@@ -26,158 +26,158 @@ class TestAutomation(TestAutomationBase):
r"AutomatedTesting\Levels\Physics\Material_LibraryCrudOperationsReflectOnRagdollBones")
def test_Material_LibraryCrudOperationsReflectOnRagdollBones(self, request, workspace, editor, launcher_platform):
from .tests.material import Material_LibraryCrudOperationsReflectOnRagdollBones as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_Material_RagdollBones(self, request, workspace, editor, launcher_platform):
from .tests.material import Material_RagdollBones as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@fm.file_revert("c15308221_material_componentsinsyncwithlibrary.physmaterial",
r"AutomatedTesting\Levels\Physics\Material_ComponentsInSyncWithLibrary")
def test_Material_ComponentsInSyncWithLibrary(self, request, workspace, editor, launcher_platform):
from .tests.material import Material_ComponentsInSyncWithLibrary as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
# BUG: LY-107723")
def test_ScriptCanvas_SetKinematicTargetTransform(self, request, workspace, editor, launcher_platform):
from .tests.script_canvas import ScriptCanvas_SetKinematicTargetTransform as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
# Failing, PhysXTerrain
@fm.file_revert("c4925579_material_addmodifydeleteonterrain.physmaterial",
r"AutomatedTesting\Levels\Physics\Material_LibraryCrudOperationsReflectOnTerrain")
def test_Material_LibraryCrudOperationsReflectOnTerrain(self, request, workspace, editor, launcher_platform):
from .tests.material import Material_LibraryCrudOperationsReflectOnTerrain as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
# Failing, PhysXTerrain
def test_Terrain_TerrainTexturePainterWorks(self, request, workspace, editor, launcher_platform):
from .tests.terrain import Terrain_TerrainTexturePainterWorks as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
# Failing, PhysXTerrain
def test_Material_CanBeAssignedToTerrain(self, request, workspace, editor, launcher_platform):
from .tests.material import Material_CanBeAssignedToTerrain as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
# Failing, PhysXTerrain
def test_Material_DefaultLibraryConsistentOnAllFeatures(self, request, workspace, editor, launcher_platform):
from .tests.material import Material_DefaultLibraryConsistentOnAllFeatures as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
# Failing, PhysXTerrain
@fm.file_revert("all_ones_1.physmaterial", r"AutomatedTesting\Levels\Physics\Material_DefaultMaterialLibraryChangesWork")
@fm.file_override("default.physxconfiguration", "Material_DefaultMaterialLibraryChangesWork.physxconfiguration", "AutomatedTesting")
def test_Material_DefaultMaterialLibraryChangesWork(self, request, workspace, editor, launcher_platform):
from .tests.material import Material_DefaultMaterialLibraryChangesWork as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_Collider_SameCollisionGroupSameLayerCollide(self, request, workspace, editor, launcher_platform):
from .tests.collider import Collider_SameCollisionGroupSameLayerCollide as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_Ragdoll_OldRagdollSerializationNoErrors(self, request, workspace, editor, launcher_platform):
from .tests.ragdoll import Ragdoll_OldRagdollSerializationNoErrors as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@fm.file_override("default.physxconfiguration", "ScriptCanvas_OverlapNode.physxconfiguration")
def test_ScriptCanvas_OverlapNode(self, request, workspace, editor, launcher_platform):
from .tests.script_canvas import ScriptCanvas_OverlapNode as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_Material_StaticFriction(self, request, workspace, editor, launcher_platform):
from .tests.material import Material_StaticFriction as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@fm.file_revert("c4888315_material_addmodifydeleteoncollider.physmaterial",
r"AutomatedTesting\Levels\Physics\Material_LibraryCrudOperationsReflectOnCollider")
def test_Material_LibraryCrudOperationsReflectOnCollider(self, request, workspace, editor, launcher_platform):
from .tests.material import Material_LibraryCrudOperationsReflectOnCollider as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@fm.file_revert("c15563573_material_addmodifydeleteoncharactercontroller.physmaterial",
r"AutomatedTesting\Levels\Physics\Material_LibraryCrudOperationsReflectOnCharacterController")
def test_Material_LibraryCrudOperationsReflectOnCharacterController(self, request, workspace, editor, launcher_platform):
from .tests.material import Material_LibraryCrudOperationsReflectOnCharacterController as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@fm.file_revert("c4888315_material_addmodifydeleteoncollider.physmaterial",
r"AutomatedTesting\Levels\Physics\Material_LibraryCrudOperationsReflectOnCollider")
def test_Material_LibraryCrudOperationsReflectOnCollider(self, request, workspace, editor, launcher_platform):
from .tests.material import Material_LibraryCrudOperationsReflectOnCollider as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@fm.file_revert("c15563573_material_addmodifydeleteoncharactercontroller.physmaterial",
r"AutomatedTesting\Levels\Physics\Material_LibraryCrudOperationsReflectOnCharacterController")
def test_Material_LibraryCrudOperationsReflectOnCharacterController(self, request, workspace, editor, launcher_platform):
from .tests.material import Material_LibraryCrudOperationsReflectOnCharacterController as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@fm.file_revert("c4044455_material_librarychangesinstantly.physmaterial",
r"AutomatedTesting\Levels\Physics\C4044455_Material_LibraryChangesInstantly")
def test_Material_LibraryChangesReflectInstantly(self, request, workspace, editor, launcher_platform):
from .tests.material import Material_LibraryChangesReflectInstantly as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@fm.file_revert("Material_LibraryUpdatedAcrossLevels.physmaterial",
r"AutomatedTesting\Levels\Physics\Material_LibraryUpdatedAcrossLevels")
def test_Material_LibraryUpdatedAcrossLevels(self, request, workspace, editor, launcher_platform):
from .tests.material import Material_LibraryUpdatedAcrossLevels as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_RigidBody_LinearDampingAffectsMotion(self, request, workspace, editor, launcher_platform):
from .tests.rigid_body import RigidBody_LinearDampingAffectsMotion as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_Terrain_CollisionAgainstRigidBody(self, request, workspace, editor, launcher_platform):
from .tests.terrain import Terrain_CollisionAgainstRigidBody as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_ShapeCollider_CylinderShapeCollides(self, request, workspace, editor, launcher_platform):
from .tests.collider import ShapeCollider_CylinderShapeCollides as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_Physics_WorldBodyBusWorksOnEditorComponents(self, request, workspace, editor, launcher_platform):
from .tests import Physics_WorldBodyBusWorksOnEditorComponents as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_Collider_PxMeshErrorIfNoMesh(self, request, workspace, editor, launcher_platform):
from .tests.collider import Collider_PxMeshErrorIfNoMesh as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_ForceRegion_ImpulsesBoxShapedRigidBody(self, request, workspace, editor, launcher_platform):
from .tests.force_region import ForceRegion_ImpulsesBoxShapedRigidBody as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_Terrain_SpawnSecondTerrainComponentWarning(self, request, workspace, editor, launcher_platform):
from .tests.terrain import Terrain_SpawnSecondTerrainComponentWarning as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_Terrain_AddPhysTerrainComponent(self, request, workspace, editor, launcher_platform):
from .tests.terrain import Terrain_AddPhysTerrainComponent as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_Terrain_CanAddMultipleTerrainComponents(self, request, workspace, editor, launcher_platform):
from .tests.terrain import Terrain_CanAddMultipleTerrainComponents as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_Terrain_MultipleTerrainComponentsWarning(self, request, workspace, editor, launcher_platform):
from .tests.terrain import Terrain_MultipleTerrainComponentsWarning as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_Terrain_MultipleTerrainComponentsWarning(self, request, workspace, editor, launcher_platform):
from .tests.terrain import Terrain_MultipleTerrainComponentsWarning as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_ForceRegion_HighValuesDirectionAxesWorkWithNoError(self, request, workspace, editor, launcher_platform):
from .tests.force_region import ForceRegion_HighValuesDirectionAxesWorkWithNoError as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_Terrain_MultipleResolutionsValid(self, request, workspace, editor, launcher_platform):
from .tests.terrain import Terrain_MultipleResolutionsValid as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_ForceRegion_SmallMagnitudeDeviationOnLargeForces(self, request, workspace, editor, launcher_platform):
from .tests.force_region import ForceRegion_SmallMagnitudeDeviationOnLargeForces as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
diff --git a/AutomatedTesting/Gem/PythonTests/Physics/TestSuite_Main.py b/AutomatedTesting/Gem/PythonTests/Physics/TestSuite_Main.py
index fb2744deda..07ae5f6ca0 100644
--- a/AutomatedTesting/Gem/PythonTests/Physics/TestSuite_Main.py
+++ b/AutomatedTesting/Gem/PythonTests/Physics/TestSuite_Main.py
@@ -30,33 +30,33 @@ class TestAutomation(TestAutomationBase):
def test_RigidBody_EnablingGravityWorksUsingNotificationsPoC(self, request, workspace, editor, launcher_platform):
from .tests.rigid_body import RigidBody_EnablingGravityWorksUsingNotificationsPoC as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_ForceRegion_LocalSpaceForceOnRigidBodies(self, request, workspace, editor, launcher_platform):
from .tests.force_region import ForceRegion_LocalSpaceForceOnRigidBodies as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
@fm.file_override('physxsystemconfiguration.setreg','Material_DynamicFriction.setreg_override',
'AutomatedTesting/Registry', search_subdirs=True)
def test_Material_DynamicFriction(self, request, workspace, editor, launcher_platform):
from .tests.material import Material_DynamicFriction as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_Collider_SameCollisionGroupDiffLayersCollide(self, request, workspace, editor, launcher_platform):
from .tests.collider import Collider_SameCollisionGroupDiffLayersCollide as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_CharacterController_SwitchLevels(self, request, workspace, editor, launcher_platform):
from .tests.character_controller import CharacterController_SwitchLevels as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_Ragdoll_AddPhysxRagdollComponentWorks(self, request, workspace, editor, launcher_platform):
from .tests.ragdoll import Ragdoll_AddPhysxRagdollComponentWorks as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_ScriptCanvas_MultipleRaycastNode(self, request, workspace, editor, launcher_platform):
@@ -64,43 +64,43 @@ class TestAutomation(TestAutomationBase):
# Fixme: This test previously relied on unexpected lines log reading with is now not supported.
# Now the log reading must be done inside the test, preferably with the Tracer() utility
# unexpected_lines = ["Assert"] + test_module.Lines.unexpected
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
@fm.file_override('physxsystemconfiguration.setreg','Collider_DiffCollisionGroupDiffCollidingLayersNotCollide.setreg_override',
'AutomatedTesting/Registry', search_subdirs=True)
def test_Collider_DiffCollisionGroupDiffCollidingLayersNotCollide(self, request, workspace, editor, launcher_platform):
from .tests.collider import Collider_DiffCollisionGroupDiffCollidingLayersNotCollide as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_Joints_HingeLeadFollowerCollide(self, request, workspace, editor, launcher_platform):
from .tests.joints import Joints_HingeLeadFollowerCollide as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_Collider_PxMeshConvexMeshCollides(self, request, workspace, editor, launcher_platform):
from .tests.collider import Collider_PxMeshConvexMeshCollides as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_ShapeCollider_CylinderShapeCollides(self, request, workspace, editor, launcher_platform):
from .tests.shape_collider import ShapeCollider_CylinderShapeCollides as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_C15425929_Undo_Redo(self, request, workspace, editor, launcher_platform):
from .tests import Physics_UndoRedoWorksOnEntityWithPhysComponents as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@pytest.mark.GROUP_tick
@pytest.mark.xfail(reason="Test still under development.")
def test_Tick_InterpolatedRigidBodyMotionIsSmooth(self, request, workspace, editor, launcher_platform):
from .tests.tick import Tick_InterpolatedRigidBodyMotionIsSmooth as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@pytest.mark.GROUP_tick
@pytest.mark.xfail(reason="Test still under development.")
def test_Tick_CharacterGameplayComponentMotionIsSmooth(self, request, workspace, editor, launcher_platform):
from .tests.tick import Tick_CharacterGameplayComponentMotionIsSmooth as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
diff --git a/AutomatedTesting/Gem/PythonTests/Physics/TestSuite_Main_Optimized.py b/AutomatedTesting/Gem/PythonTests/Physics/TestSuite_Main_Optimized.py
index 3d668a2085..b25b4340e8 100644
--- a/AutomatedTesting/Gem/PythonTests/Physics/TestSuite_Main_Optimized.py
+++ b/AutomatedTesting/Gem/PythonTests/Physics/TestSuite_Main_Optimized.py
@@ -59,9 +59,6 @@ class EditorSingleTest_WithFileOverrides(EditorSingleTest):
@pytest.mark.parametrize("project", ["AutomatedTesting"])
class TestAutomationWithPrefabSystemEnabled(EditorTestSuite):
- global_extra_cmdline_args = ['-BatchMode', '-autotest_mode',
- 'extra_cmdline_args=["--regset=/Amazon/Preferences/EnablePrefabSystem=true"]']
-
@staticmethod
def get_number_parallel_editors():
return 16
@@ -81,6 +78,8 @@ class TestAutomationWithPrefabSystemEnabled(EditorTestSuite):
@pytest.mark.parametrize("project", ["AutomatedTesting"])
class TestAutomation(EditorTestSuite):
+ enable_prefab_system = False
+
@staticmethod
def get_number_parallel_editors():
return 16
diff --git a/AutomatedTesting/Gem/PythonTests/Physics/TestSuite_Periodic.py b/AutomatedTesting/Gem/PythonTests/Physics/TestSuite_Periodic.py
index 55e51dd2f8..6daf852708 100755
--- a/AutomatedTesting/Gem/PythonTests/Physics/TestSuite_Periodic.py
+++ b/AutomatedTesting/Gem/PythonTests/Physics/TestSuite_Periodic.py
@@ -31,223 +31,223 @@ class TestAutomation(TestAutomationBase):
@revert_physics_config
def test_Terrain_NoPhysTerrainComponentNoCollision(self, request, workspace, editor, launcher_platform):
from .tests.terrain import Terrain_NoPhysTerrainComponentNoCollision as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_RigidBody_InitialLinearVelocity(self, request, workspace, editor, launcher_platform):
from .tests.rigid_body import RigidBody_InitialLinearVelocity as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_RigidBody_StartGravityEnabledWorks(self, request, workspace, editor, launcher_platform):
from .tests.rigid_body import RigidBody_StartGravityEnabledWorks as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_RigidBody_KinematicModeWorks(self, request, workspace, editor, launcher_platform):
from .tests.rigid_body import RigidBody_KinematicModeWorks as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_ForceRegion_LinearDampingForceOnRigidBodies(self, request, workspace, editor, launcher_platform):
from .tests.force_region import ForceRegion_LinearDampingForceOnRigidBodies as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_ForceRegion_SimpleDragForceOnRigidBodies(self, request, workspace, editor, launcher_platform):
from .tests.force_region import ForceRegion_SimpleDragForceOnRigidBodies as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_ForceRegion_CapsuleShapedForce(self, request, workspace, editor, launcher_platform):
from .tests.force_region import ForceRegion_CapsuleShapedForce as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_ForceRegion_ImpulsesCapsuleShapedRigidBody(self, request, workspace, editor, launcher_platform):
from .tests.force_region import ForceRegion_ImpulsesCapsuleShapedRigidBody as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_RigidBody_MomentOfInertiaManualSetting(self, request, workspace, editor, launcher_platform):
from .tests.rigid_body import RigidBody_MomentOfInertiaManualSetting as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_RigidBody_COM_ManualSettingWorks(self, request, workspace, editor, launcher_platform):
from .tests.rigid_body import RigidBody_COM_ManualSettingWorks as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_RigidBody_AddRigidBodyComponent(self, request, workspace, editor, launcher_platform):
from .tests.rigid_body import RigidBody_AddRigidBodyComponent as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_ForceRegion_SplineForceOnRigidBodies(self, request, workspace, editor, launcher_platform):
from .tests.force_region import ForceRegion_SplineForceOnRigidBodies as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
@fm.file_override('physxsystemconfiguration.setreg','Material_RestitutionCombine.setreg_override',
'AutomatedTesting/Registry', search_subdirs=True)
def test_Material_RestitutionCombine(self, request, workspace, editor, launcher_platform):
from .tests.material import Material_RestitutionCombine as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
@fm.file_override('physxsystemconfiguration.setreg','Material_FrictionCombine.setreg_override',
'AutomatedTesting/Registry', search_subdirs=True)
def test_Material_FrictionCombine(self, request, workspace, editor, launcher_platform):
from .tests.material import Material_FrictionCombine as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_Collider_ColliderPositionOffset(self, request, workspace, editor, launcher_platform):
from .tests.collider import Collider_ColliderPositionOffset as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_RigidBody_AngularDampingAffectsRotation(self, request, workspace, editor, launcher_platform):
from .tests.rigid_body import RigidBody_AngularDampingAffectsRotation as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_Physics_VerifyColliderRigidBodyMeshAndTerrainWorkTogether(self, request, workspace, editor, launcher_platform):
from .tests import Physics_VerifyColliderRigidBodyMeshAndTerrainWorkTogether as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_ForceRegion_MultipleForcesInSameComponentCombineForces(self, request, workspace, editor, launcher_platform):
from .tests.force_region import ForceRegion_MultipleForcesInSameComponentCombineForces as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_ForceRegion_ImpulsesPxMeshShapedRigidBody(self, request, workspace, editor, launcher_platform):
from .tests.force_region import ForceRegion_ImpulsesPxMeshShapedRigidBody as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_ScriptCanvas_TriggerEvents(self, request, workspace, editor, launcher_platform):
from .tests.script_canvas import ScriptCanvas_TriggerEvents as test_module
# FIXME: expected_lines = test_module.LogLines.expected_lines
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_ForceRegion_ZeroPointForceDoesNothing(self, request, workspace, editor, launcher_platform):
from .tests.force_region import ForceRegion_ZeroPointForceDoesNothing as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_ForceRegion_ZeroWorldSpaceForceDoesNothing(self, request, workspace, editor, launcher_platform):
from .tests.force_region import ForceRegion_ZeroWorldSpaceForceDoesNothing as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_ForceRegion_ZeroLinearDampingDoesNothing(self, request, workspace, editor, launcher_platform):
from .tests.force_region import ForceRegion_ZeroLinearDampingDoesNothing as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_ForceRegion_MovingForceRegionChangesNetForce(self, request, workspace, editor, launcher_platform):
from .tests.force_region import ForceRegion_MovingForceRegionChangesNetForce as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_ScriptCanvas_CollisionEvents(self, request, workspace, editor, launcher_platform):
from .tests.script_canvas import ScriptCanvas_CollisionEvents as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_ForceRegion_DirectionHasNoAffectOnTotalForce(self, request, workspace, editor, launcher_platform):
from .tests.force_region import ForceRegion_DirectionHasNoAffectOnTotalForce as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_RigidBody_StartAsleepWorks(self, request, workspace, editor, launcher_platform):
from .tests.rigid_body import RigidBody_StartAsleepWorks as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_ForceRegion_SliceFileInstantiates(self, request, workspace, editor, launcher_platform):
from .tests.force_region import ForceRegion_SliceFileInstantiates as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_ForceRegion_ZeroLocalSpaceForceDoesNothing(self, request, workspace, editor, launcher_platform):
from .tests.force_region import ForceRegion_ZeroLocalSpaceForceDoesNothing as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_ForceRegion_ZeroSimpleDragForceDoesNothing(self, request, workspace, editor, launcher_platform):
from .tests.force_region import ForceRegion_ZeroSimpleDragForceDoesNothing as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_RigidBody_COM_ComputingWorks(self, request, workspace, editor, launcher_platform):
from .tests.rigid_body import RigidBody_COM_ComputingWorks as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_RigidBody_MassDifferentValuesWorks(self, request, workspace, editor, launcher_platform):
from .tests.rigid_body import RigidBody_MassDifferentValuesWorks as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
@fm.file_override('physxsystemconfiguration.setreg','Material_RestitutionCombinePriorityOrder.setreg_override',
'AutomatedTesting/Registry', search_subdirs=True)
def test_Material_RestitutionCombinePriorityOrder(self, request, workspace, editor, launcher_platform):
from .tests.material import Material_RestitutionCombinePriorityOrder as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_ForceRegion_SplineRegionWithModifiedTransform(self, request, workspace, editor, launcher_platform):
from .tests.force_region import ForceRegion_SplineRegionWithModifiedTransform as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_ScriptCanvas_ShapeCast(self, request, workspace, editor, launcher_platform):
from .tests.script_canvas import ScriptCanvas_ShapeCast as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_RigidBody_InitialAngularVelocity(self, request, workspace, editor, launcher_platform):
from .tests.rigid_body import RigidBody_InitialAngularVelocity as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_ForceRegion_ZeroSplineForceDoesNothing(self, request, workspace, editor, launcher_platform):
from .tests.force_region import ForceRegion_ZeroSplineForceDoesNothing as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_Physics_DynamicSliceWithPhysNotSpawnsStaticSlice(self, request, workspace, editor, launcher_platform):
from .tests import Physics_DynamicSliceWithPhysNotSpawnsStaticSlice as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_ForceRegion_PositionOffset(self, request, workspace, editor, launcher_platform):
from .tests.force_region import ForceRegion_PositionOffset as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
@fm.file_override('physxsystemconfiguration.setreg','Material_FrictionCombinePriorityOrder.setreg_override',
'AutomatedTesting/Registry', search_subdirs=True)
def test_Material_FrictionCombinePriorityOrder(self, request, workspace, editor, launcher_platform):
from .tests.material import Material_FrictionCombinePriorityOrder as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@pytest.mark.xfail(
reason="Something with the CryRenderer disabling is causing this test to fail now.")
@revert_physics_config
def test_Ragdoll_LevelSwitchDoesNotCrash(self, request, workspace, editor, launcher_platform):
from .tests.ragdoll import Ragdoll_LevelSwitchDoesNotCrash as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_ForceRegion_MultipleComponentsCombineForces(self, request, workspace, editor, launcher_platform):
from .tests.force_region import ForceRegion_MultipleComponentsCombineForces as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
# Marking the test as an expected failure due to sporadic failure on Automated Review: LYN-2580
# The test still runs, but a failure of the test doesn't result in the test run failing
@@ -258,102 +258,102 @@ class TestAutomation(TestAutomationBase):
'AutomatedTesting/Registry', search_subdirs=True)
def test_Material_PerFaceMaterialGetsCorrectMaterial(self, request, workspace, editor, launcher_platform):
from .tests.material import Material_PerFaceMaterialGetsCorrectMaterial as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@pytest.mark.xfail(
reason="This test will sometimes fail as the ball will continue to roll before the timeout is reached.")
@revert_physics_config
def test_RigidBody_SleepWhenBelowKineticThreshold(self, request, workspace, editor, launcher_platform):
from .tests.rigid_body import RigidBody_SleepWhenBelowKineticThreshold as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_RigidBody_COM_NotIncludesTriggerShapes(self, request, workspace, editor, launcher_platform):
from .tests.rigid_body import RigidBody_COM_NotIncludesTriggerShapes as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_Material_NoEffectIfNoColliderShape(self, request, workspace, editor, launcher_platform):
from .tests.material import Material_NoEffectIfNoColliderShape as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_Collider_TriggerPassThrough(self, request, workspace, editor, launcher_platform):
from .tests.collider import Collider_TriggerPassThrough as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_RigidBody_SetGravityWorks(self, request, workspace, editor, launcher_platform):
from .tests.rigid_body import RigidBody_SetGravityWorks as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
@fm.file_override('physxsystemconfiguration.setreg','Material_CharacterController.setreg_override',
'AutomatedTesting/Registry', search_subdirs=True)
def test_Material_CharacterController(self, request, workspace, editor, launcher_platform):
from .tests.material import Material_CharacterController as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_Material_EmptyLibraryUsesDefault(self, request, workspace, editor, launcher_platform):
from .tests.material import Material_EmptyLibraryUsesDefault as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_ForceRegion_NoQuiverOnHighLinearDampingForce(self, request, workspace, editor, launcher_platform):
from .tests.force_region import ForceRegion_NoQuiverOnHighLinearDampingForce as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_RigidBody_ComputeInertiaWorks(self, request, workspace, editor, launcher_platform):
from .tests.rigid_body import RigidBody_ComputeInertiaWorks as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_ScriptCanvas_PostPhysicsUpdate(self, request, workspace, editor, launcher_platform):
from .tests.script_canvas import ScriptCanvas_PostPhysicsUpdate as test_module
# Fixme: unexpected_lines = ["Assert"] + test_module.Lines.unexpected
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
@fm.file_override('physxsystemconfiguration.setreg','Collider_NoneCollisionGroupSameLayerNotCollide.setreg_override',
'AutomatedTesting/Registry', search_subdirs=True)
def test_Collider_NoneCollisionGroupSameLayerNotCollide(self, request, workspace, editor, launcher_platform):
from .tests.collider import Collider_NoneCollisionGroupSameLayerNotCollide as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
@fm.file_override('physxsystemconfiguration.setreg','Collider_SameCollisionGroupSameCustomLayerCollide.setreg_override',
'AutomatedTesting/Registry', search_subdirs=True)
def test_Collider_SameCollisionGroupSameCustomLayerCollide(self, request, workspace, editor, launcher_platform):
from .tests.collider import Collider_SameCollisionGroupSameCustomLayerCollide as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
@fm.file_override('physxdefaultsceneconfiguration.setreg','ScriptCanvas_PostUpdateEvent.setreg_override',
'AutomatedTesting/Registry', search_subdirs=True)
def test_ScriptCanvas_PostUpdateEvent(self, request, workspace, editor, launcher_platform):
from .tests.script_canvas import ScriptCanvas_PostUpdateEvent as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
@fm.file_override('physxsystemconfiguration.setreg','Material_Restitution.setreg_override',
'AutomatedTesting/Registry', search_subdirs=True)
def test_Material_Restitution(self, request, workspace, editor, launcher_platform):
from .tests.material import Material_Restitution as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
@fm.file_override('physxdefaultsceneconfiguration.setreg', 'ScriptCanvas_PreUpdateEvent.setreg_override',
'AutomatedTesting/Registry', search_subdirs=True)
def test_ScriptCanvas_PreUpdateEvent(self, request, workspace, editor, launcher_platform):
from .tests.script_canvas import ScriptCanvas_PreUpdateEvent as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_ForceRegion_PxMeshShapedForce(self, request, workspace, editor, launcher_platform):
from .tests.force_region import ForceRegion_PxMeshShapedForce as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
# Marking the Test as expected to fail using the xfail decorator due to sporadic failure on Automated Review: SPEC-3146
# The test still runs, but a failure of the test doesn't result in the test run failing
@@ -361,176 +361,173 @@ class TestAutomation(TestAutomationBase):
@revert_physics_config
def test_RigidBody_MaxAngularVelocityWorks(self, request, workspace, editor, launcher_platform):
from .tests.rigid_body import RigidBody_MaxAngularVelocityWorks as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_Joints_HingeSoftLimitsConstrained(self, request, workspace, editor, launcher_platform):
from .tests.joints import Joints_HingeSoftLimitsConstrained as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_Joints_BallSoftLimitsConstrained(self, request, workspace, editor, launcher_platform):
from .tests.joints import Joints_BallSoftLimitsConstrained as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_Joints_BallLeadFollowerCollide(self, request, workspace, editor, launcher_platform):
from .tests.joints import Joints_BallLeadFollowerCollide as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
@fm.file_override('physxsystemconfiguration.setreg','Collider_AddingNewGroupWorks.setreg_override',
'AutomatedTesting/Registry', search_subdirs=True)
def test_Collider_AddingNewGroupWorks(self, request, workspace, editor, launcher_platform):
from .tests.collider import Collider_AddingNewGroupWorks as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_ShapeCollider_InactiveWhenNoShapeComponent(self, request, workspace, editor, launcher_platform):
from .tests.shape_collider import ShapeCollider_InactiveWhenNoShapeComponent as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_Collider_CheckDefaultShapeSettingIsPxMesh(self, request, workspace, editor, launcher_platform):
from .tests.collider import Collider_CheckDefaultShapeSettingIsPxMesh as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_ShapeCollider_LargeNumberOfShapeCollidersWontCrashEditor(self, request, workspace, editor, launcher_platform):
from .tests.shape_collider import ShapeCollider_LargeNumberOfShapeCollidersWontCrashEditor as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_Collider_SphereShapeEditing(self, request, workspace, editor, launcher_platform):
from .tests.collider import Collider_SphereShapeEditing as test_module
- self._run_test(request, workspace, editor, test_module,
- extra_cmdline_args=["--regset=/Amazon/Preferences/EnablePrefabSystem=true"])
+ self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_Collider_BoxShapeEditing(self, request, workspace, editor, launcher_platform):
from .tests.collider import Collider_BoxShapeEditing as test_module
- self._run_test(request, workspace, editor, test_module,
- extra_cmdline_args=["--regset=/Amazon/Preferences/EnablePrefabSystem=true"])
+ self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_Collider_CapsuleShapeEditing(self, request, workspace, editor, launcher_platform):
from .tests.collider import Collider_CapsuleShapeEditing as test_module
- self._run_test(request, workspace, editor, test_module,
- extra_cmdline_args=["--regset=/Amazon/Preferences/EnablePrefabSystem=true"])
+ self._run_test(request, workspace, editor, test_module)
def test_ForceRegion_WithNonTriggerColliderWarning(self, request, workspace, editor, launcher_platform):
from .tests.force_region import ForceRegion_WithNonTriggerColliderWarning as test_module
# Fixme: expected_lines = ["[Warning] (PhysX Force Region) - Please ensure collider component marked as trigger exists in entity"]
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_ForceRegion_WorldSpaceForceOnRigidBodies(self, request, workspace, editor, launcher_platform):
from .tests.force_region import ForceRegion_WorldSpaceForceOnRigidBodies as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_ForceRegion_PointForceOnRigidBodies(self, request, workspace, editor, launcher_platform):
from .tests.force_region import ForceRegion_PointForceOnRigidBodies as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_ForceRegion_SphereShapedForce(self, request, workspace, editor, launcher_platform):
from .tests.force_region import ForceRegion_SphereShapedForce as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_ForceRegion_RotationalOffset(self, request, workspace, editor, launcher_platform):
from .tests.force_region import ForceRegion_RotationalOffset as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_Material_LibraryClearingAssignsDefault(self, request, workspace, editor, launcher_platform):
from .tests.material import Material_LibraryClearingAssignsDefault as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_Collider_AddColliderComponent(self, request, workspace, editor, launcher_platform):
from .tests.collider import Collider_AddColliderComponent as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@pytest.mark.xfail(
reason="This will fail due to this issue ATOM-15487.")
def test_Collider_PxMeshAutoAssignedWhenModifyingRenderMeshComponent(self, request, workspace, editor, launcher_platform):
from .tests.collider import Collider_PxMeshAutoAssignedWhenModifyingRenderMeshComponent as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_Collider_PxMeshAutoAssignedWhenAddingRenderMeshComponent(self, request, workspace, editor, launcher_platform):
from .tests.collider import Collider_PxMeshAutoAssignedWhenAddingRenderMeshComponent as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_Collider_MultipleSurfaceSlots(self, request, workspace, editor, launcher_platform):
from .tests.collider import Collider_MultipleSurfaceSlots as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_Collider_PxMeshNotAutoAssignedWhenNoPhysicsFbx(self, request, workspace, editor, launcher_platform):
from .tests.collider import Collider_PxMeshNotAutoAssignedWhenNoPhysicsFbx as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_RigidBody_EnablingGravityWorksPoC(self, request, workspace, editor, launcher_platform):
from .tests.rigid_body import RigidBody_EnablingGravityWorksPoC as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
@fm.file_override('physxsystemconfiguration.setreg','Collider_CollisionGroupsWorkflow.setreg_override',
'AutomatedTesting/Registry', search_subdirs=True)
def test_Collider_CollisionGroupsWorkflow(self, request, workspace, editor, launcher_platform):
from .tests.collider import Collider_CollisionGroupsWorkflow as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_Collider_ColliderRotationOffset(self, request, workspace, editor, launcher_platform):
from .tests.collider import Collider_ColliderRotationOffset as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_ForceRegion_ParentChildForcesCombineForces(self, request, workspace, editor, launcher_platform):
from .tests.force_region import ForceRegion_ParentChildForcesCombineForces as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_ShapeCollider_CanBeAddedWitNoWarnings(self, request, workspace, editor, launcher_platform):
from .tests.shape_collider import ShapeCollider_CanBeAddedWitNoWarnings as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_Physics_UndoRedoWorksOnEntityWithPhysComponents(self, request, workspace, editor, launcher_platform):
from .tests import Physics_UndoRedoWorksOnEntityWithPhysComponents as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_Joints_Fixed2BodiesConstrained(self, request, workspace, editor, launcher_platform):
from .tests.joints import Joints_Fixed2BodiesConstrained as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_Joints_Hinge2BodiesConstrained(self, request, workspace, editor, launcher_platform):
from .tests.joints import Joints_Hinge2BodiesConstrained as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_Joints_Ball2BodiesConstrained(self, request, workspace, editor, launcher_platform):
from .tests.joints import Joints_Ball2BodiesConstrained as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_Joints_FixedBreakable(self, request, workspace, editor, launcher_platform):
from .tests.joints import Joints_FixedBreakable as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_Joints_HingeBreakable(self, request, workspace, editor, launcher_platform):
from .tests.joints import Joints_HingeBreakable as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_Joints_BallBreakable(self, request, workspace, editor, launcher_platform):
from .tests.joints import Joints_BallBreakable as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_Joints_HingeNoLimitsConstrained(self, request, workspace, editor, launcher_platform):
from .tests.joints import Joints_HingeNoLimitsConstrained as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_Joints_BallNoLimitsConstrained(self, request, workspace, editor, launcher_platform):
from .tests.joints import Joints_BallNoLimitsConstrained as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_Joints_GlobalFrameConstrained(self, request, workspace, editor, launcher_platform):
from .tests.joints import Joints_GlobalFrameConstrained as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@revert_physics_config
def test_Material_DefaultLibraryUpdatedAcrossLevels(self, request, workspace, editor, launcher_platform):
@@ -540,7 +537,7 @@ class TestAutomation(TestAutomationBase):
search_subdirs=True)
def levels_before(self, request, workspace, editor, launcher_platform):
from .tests.material import Material_DefaultLibraryUpdatedAcrossLevels_before as test_module_0
- self._run_test(request, workspace, editor, test_module_0)
+ self._run_test(request, workspace, editor, test_module_0, enable_prefab_system=False)
# File override replaces the previous physxconfiguration file with another where the only difference is the default material library
@fm.file_override("physxsystemconfiguration.setreg",
@@ -549,7 +546,7 @@ class TestAutomation(TestAutomationBase):
search_subdirs=True)
def levels_after(self, request, workspace, editor, launcher_platform):
from .tests.material import Material_DefaultLibraryUpdatedAcrossLevels_after as test_module_1
- self._run_test(request, workspace, editor, test_module_1)
+ self._run_test(request, workspace, editor, test_module_1, enable_prefab_system=False)
levels_before(self, request, workspace, editor, launcher_platform)
levels_after(self, request, workspace, editor, launcher_platform)
\ No newline at end of file
diff --git a/AutomatedTesting/Gem/PythonTests/Physics/TestSuite_Sandbox.py b/AutomatedTesting/Gem/PythonTests/Physics/TestSuite_Sandbox.py
index 81fdc747d5..9b104ccfcf 100644
--- a/AutomatedTesting/Gem/PythonTests/Physics/TestSuite_Sandbox.py
+++ b/AutomatedTesting/Gem/PythonTests/Physics/TestSuite_Sandbox.py
@@ -32,7 +32,7 @@ class TestAutomation(TestAutomationBase):
def test_ScriptCanvas_GetCollisionNameReturnsName(self, request, workspace, editor, launcher_platform):
from .tests.script_canvas import ScriptCanvas_GetCollisionNameReturnsName as test_module
# Fixme: expected_lines=["Layer Name: Right"]
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
## Seems to be flaky, need to investigate
def test_ScriptCanvas_GetCollisionNameReturnsNothingWhenHasToggledLayer(self, request, workspace, editor, launcher_platform):
@@ -42,4 +42,4 @@ class TestAutomation(TestAutomationBase):
# Fixme: for group in collision_groups:
# Fixme: unexpected_lines.append(f"GroupName: {group}")
# Fixme: expected_lines=["GroupName: "]
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
diff --git a/AutomatedTesting/Gem/PythonTests/Physics/TestSuite_Utils.py b/AutomatedTesting/Gem/PythonTests/Physics/TestSuite_Utils.py
index 61c2816f50..3e00b684c0 100755
--- a/AutomatedTesting/Gem/PythonTests/Physics/TestSuite_Utils.py
+++ b/AutomatedTesting/Gem/PythonTests/Physics/TestSuite_Utils.py
@@ -30,11 +30,11 @@ class TestUtils(TestAutomationBase):
expected_lines = []
unexpected_lines = ["Assert"]
- self._run_test(request, workspace, editor, physmaterial_editor_test_module, expected_lines, unexpected_lines)
+ self._run_test(request, workspace, editor, physmaterial_editor_test_module, expected_lines, unexpected_lines, enable_prefab_system=False)
def test_UtilTest_Tracer_PicksErrorsAndWarnings(self, request, workspace, launcher_platform, editor):
from .utils import UtilTest_Tracer_PicksErrorsAndWarnings as testcase_module
- self._run_test(request, workspace, editor, testcase_module, [], [])
+ self._run_test(request, workspace, editor, testcase_module, [], [], enable_prefab_system=False)
def test_FileManagement_FindingFiles(self, workspace, launcher_platform):
"""
@@ -263,4 +263,4 @@ class TestUtils(TestAutomationBase):
expected_lines = []
unexpected_lines = ["Assert"]
- self._run_test(request, workspace, editor, test_module, expected_lines, unexpected_lines)
+ self._run_test(request, workspace, editor, test_module, expected_lines, unexpected_lines, enable_prefab_system=False)
diff --git a/AutomatedTesting/Gem/PythonTests/Physics/utils/FileManagement.py b/AutomatedTesting/Gem/PythonTests/Physics/utils/FileManagement.py
index 22a41de4ea..017bb672a4 100644
--- a/AutomatedTesting/Gem/PythonTests/Physics/utils/FileManagement.py
+++ b/AutomatedTesting/Gem/PythonTests/Physics/utils/FileManagement.py
@@ -218,6 +218,7 @@ class FileManagement:
src_file_path = os.path.join(src_path, src_file)
if os.path.exists(target_file_path):
fs.unlock_file(target_file_path)
+ os.makedirs(target_path, exist_ok=True)
shutil.copyfile(src_file_path, target_file_path)
@staticmethod
diff --git a/AutomatedTesting/Gem/PythonTests/Prefab/TestSuite_Main.py b/AutomatedTesting/Gem/PythonTests/Prefab/TestSuite_Main.py
index 479915752f..6e1f94d358 100644
--- a/AutomatedTesting/Gem/PythonTests/Prefab/TestSuite_Main.py
+++ b/AutomatedTesting/Gem/PythonTests/Prefab/TestSuite_Main.py
@@ -12,7 +12,6 @@ import pytest
import os
import sys
-from ly_test_tools import LAUNCHERS
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../automatedtesting_shared')
from base import TestAutomationBase
@@ -24,42 +23,49 @@ class TestAutomation(TestAutomationBase):
def _run_prefab_test(self, request, workspace, editor, test_module, batch_mode=True, autotest_mode=True):
self._run_test(request, workspace, editor, test_module,
- extra_cmdline_args=["--regset=/Amazon/Preferences/EnablePrefabSystem=true"],
batch_mode=batch_mode,
autotest_mode=autotest_mode)
- def test_PrefabLevel_OpensLevelWithEntities(self, request, workspace, editor, launcher_platform):
- from .tests import PrefabLevel_OpensLevelWithEntities as test_module
+ def test_OpenLevel_ContainingTwoEntities(self, request, workspace, editor, launcher_platform):
+ from Prefab.tests.open_level import OpenLevel_ContainingTwoEntities as test_module
self._run_prefab_test(request, workspace, editor, test_module)
- def test_PrefabBasicWorkflow_CreatePrefab(self, request, workspace, editor, launcher_platform):
- from .tests import PrefabBasicWorkflow_CreatePrefab as test_module
+ def test_CreatePrefab_WithSingleEntity(self, request, workspace, editor, launcher_platform):
+ from Prefab.tests.create_prefab import CreatePrefab_WithSingleEntity as test_module
self._run_prefab_test(request, workspace, editor, test_module)
- def test_PrefabBasicWorkflow_InstantiatePrefab(self, request, workspace, editor, launcher_platform):
- from .tests import PrefabBasicWorkflow_InstantiatePrefab as test_module
+ def test_InstantiatePrefab_ContainingASingleEntity(self, request, workspace, editor, launcher_platform):
+ from Prefab.tests.instantiate_prefab import InstantiatePrefab_ContainingASingleEntity as test_module
self._run_prefab_test(request, workspace, editor, test_module)
- def test_PrefabBasicWorkflow_CreateAndDeletePrefab(self, request, workspace, editor, launcher_platform):
- from .tests import PrefabBasicWorkflow_CreateAndDeletePrefab as test_module
+ def test_DeletePrefab_ContainingASingleEntity(self, request, workspace, editor, launcher_platform):
+ from Prefab.tests.delete_prefab import DeletePrefab_ContainingASingleEntity as test_module
self._run_prefab_test(request, workspace, editor, test_module)
- def test_PrefabBasicWorkflow_CreateAndReparentPrefab(self, request, workspace, editor, launcher_platform):
- from .tests import PrefabBasicWorkflow_CreateAndReparentPrefab as test_module
+ def test_ReparentPrefab_UnderAnotherPrefab(self, request, workspace, editor, launcher_platform):
+ from Prefab.tests.reparent_prefab import ReparentPrefab_UnderAnotherPrefab as test_module
self._run_prefab_test(request, workspace, editor, test_module, autotest_mode=False)
- def test_PrefabBasicWorkflow_CreateReparentAndDetachPrefab(self, request, workspace, editor, launcher_platform):
- from .tests import PrefabBasicWorkflow_CreateReparentAndDetachPrefab as test_module
+ def test_DetachPrefab_UnderAnotherPrefab(self, request, workspace, editor, launcher_platform):
+ from Prefab.tests.detach_prefab import DetachPrefab_UnderAnotherPrefab as test_module
self._run_prefab_test(request, workspace, editor, test_module, autotest_mode=False)
- def test_PrefabBasicWorkflow_CreateAndDuplicatePrefab(self, request, workspace, editor, launcher_platform):
- from .tests import PrefabBasicWorkflow_CreateAndDuplicatePrefab as test_module
+ def test_DuplicatePrefab_ContainingASingleEntity(self, request, workspace, editor, launcher_platform):
+ from Prefab.tests.duplicate_prefab import DuplicatePrefab_ContainingASingleEntity as test_module
self._run_prefab_test(request, workspace, editor, test_module)
- def test_PrefabComplexWorflow_CreatePrefabOfChildEntity(self, request, workspace, editor, launcher_platform):
- from .tests import PrefabComplexWorflow_CreatePrefabOfChildEntity as test_module
+ def test_CreatePrefab_UnderAnEntity(self, request, workspace, editor, launcher_platform):
+ from Prefab.tests.create_prefab import CreatePrefab_UnderAnEntity as test_module
self._run_prefab_test(request, workspace, editor, test_module, autotest_mode=False)
- def test_PrefabComplexWorflow_CreatePrefabInsidePrefab(self, request, workspace, editor, launcher_platform):
- from .tests import PrefabComplexWorflow_CreatePrefabInsidePrefab as test_module
+ def test_CreatePrefab_UnderAnotherPrefab(self, request, workspace, editor, launcher_platform):
+ from Prefab.tests.create_prefab import CreatePrefab_UnderAnotherPrefab as test_module
+ self._run_prefab_test(request, workspace, editor, test_module, autotest_mode=False)
+
+ def test_DeleteEntity_UnderAnotherPrefab(self, request, workspace, editor, launcher_platform):
+ from Prefab.tests.delete_entity import DeleteEntity_UnderAnotherPrefab as test_module
+ self._run_prefab_test(request, workspace, editor, test_module, autotest_mode=False)
+
+ def test_DeleteEntity_UnderLevelPrefab(self, request, workspace, editor, launcher_platform):
+ from Prefab.tests.delete_entity import DeleteEntity_UnderLevelPrefab as test_module
self._run_prefab_test(request, workspace, editor, test_module, autotest_mode=False)
diff --git a/AutomatedTesting/Gem/PythonTests/Prefab/tests/PrefabComplexWorflow_CreatePrefabOfChildEntity.py b/AutomatedTesting/Gem/PythonTests/Prefab/tests/create_prefab/CreatePrefab_UnderAnEntity.py
similarity index 94%
rename from AutomatedTesting/Gem/PythonTests/Prefab/tests/PrefabComplexWorflow_CreatePrefabOfChildEntity.py
rename to AutomatedTesting/Gem/PythonTests/Prefab/tests/create_prefab/CreatePrefab_UnderAnEntity.py
index dec44d52be..5033c1da9c 100644
--- a/AutomatedTesting/Gem/PythonTests/Prefab/tests/PrefabComplexWorflow_CreatePrefabOfChildEntity.py
+++ b/AutomatedTesting/Gem/PythonTests/Prefab/tests/create_prefab/CreatePrefab_UnderAnEntity.py
@@ -5,7 +5,7 @@ For complete copyright and license terms please see the LICENSE at the root of t
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
-def PrefabComplexWorflow_CreatePrefabOfChildEntity():
+def CreatePrefab_UnderAnEntity():
"""
Test description:
- Creates two entities, parent and child. Child entity has Parent entity as its parent.
@@ -18,7 +18,7 @@ def PrefabComplexWorflow_CreatePrefabOfChildEntity():
from editor_python_test_tools.editor_entity_utils import EditorEntity
from editor_python_test_tools.prefab_utils import Prefab
- import PrefabTestUtils as prefab_test_utils
+ import Prefab.tests.PrefabTestUtils as prefab_test_utils
prefab_test_utils.open_base_tests_level()
@@ -49,4 +49,4 @@ def PrefabComplexWorflow_CreatePrefabOfChildEntity():
if __name__ == "__main__":
from editor_python_test_tools.utils import Report
- Report.start_test(PrefabComplexWorflow_CreatePrefabOfChildEntity)
+ Report.start_test(CreatePrefab_UnderAnEntity)
diff --git a/AutomatedTesting/Gem/PythonTests/Prefab/tests/PrefabComplexWorflow_CreatePrefabInsidePrefab.py b/AutomatedTesting/Gem/PythonTests/Prefab/tests/create_prefab/CreatePrefab_UnderAnotherPrefab.py
similarity index 94%
rename from AutomatedTesting/Gem/PythonTests/Prefab/tests/PrefabComplexWorflow_CreatePrefabInsidePrefab.py
rename to AutomatedTesting/Gem/PythonTests/Prefab/tests/create_prefab/CreatePrefab_UnderAnotherPrefab.py
index e14fc96449..429da49434 100644
--- a/AutomatedTesting/Gem/PythonTests/Prefab/tests/PrefabComplexWorflow_CreatePrefabInsidePrefab.py
+++ b/AutomatedTesting/Gem/PythonTests/Prefab/tests/create_prefab/CreatePrefab_UnderAnotherPrefab.py
@@ -5,7 +5,7 @@ For complete copyright and license terms please see the LICENSE at the root of t
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
-def PrefabComplexWorflow_CreatePrefabInsidePrefab():
+def CreatePrefab_UnderAnotherPrefab():
"""
Test description:
- Creates an entity with a physx collider
@@ -17,7 +17,7 @@ def PrefabComplexWorflow_CreatePrefabInsidePrefab():
from editor_python_test_tools.editor_entity_utils import EditorEntity
from editor_python_test_tools.prefab_utils import Prefab
- import PrefabTestUtils as prefab_test_utils
+ import Prefab.tests.PrefabTestUtils as prefab_test_utils
prefab_test_utils.open_base_tests_level()
@@ -54,4 +54,4 @@ def PrefabComplexWorflow_CreatePrefabInsidePrefab():
if __name__ == "__main__":
from editor_python_test_tools.utils import Report
- Report.start_test(PrefabComplexWorflow_CreatePrefabInsidePrefab)
+ Report.start_test(CreatePrefab_UnderAnotherPrefab)
diff --git a/AutomatedTesting/Gem/PythonTests/Prefab/tests/PrefabBasicWorkflow_CreatePrefab.py b/AutomatedTesting/Gem/PythonTests/Prefab/tests/create_prefab/CreatePrefab_WithSingleEntity.py
similarity index 84%
rename from AutomatedTesting/Gem/PythonTests/Prefab/tests/PrefabBasicWorkflow_CreatePrefab.py
rename to AutomatedTesting/Gem/PythonTests/Prefab/tests/create_prefab/CreatePrefab_WithSingleEntity.py
index cae105a9a9..80f4c0e596 100644
--- a/AutomatedTesting/Gem/PythonTests/Prefab/tests/PrefabBasicWorkflow_CreatePrefab.py
+++ b/AutomatedTesting/Gem/PythonTests/Prefab/tests/create_prefab/CreatePrefab_WithSingleEntity.py
@@ -5,7 +5,7 @@ For complete copyright and license terms please see the LICENSE at the root of t
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
-def PrefabBasicWorkflow_CreatePrefab():
+def CreatePrefab_WithSingleEntity():
CAR_PREFAB_FILE_NAME = 'car_prefab'
@@ -13,7 +13,7 @@ def PrefabBasicWorkflow_CreatePrefab():
from editor_python_test_tools.utils import Report
from editor_python_test_tools.prefab_utils import Prefab
- import PrefabTestUtils as prefab_test_utils
+ import Prefab.tests.PrefabTestUtils as prefab_test_utils
prefab_test_utils.open_base_tests_level()
@@ -26,4 +26,4 @@ def PrefabBasicWorkflow_CreatePrefab():
if __name__ == "__main__":
from editor_python_test_tools.utils import Report
- Report.start_test(PrefabBasicWorkflow_CreatePrefab)
+ Report.start_test(CreatePrefab_WithSingleEntity)
diff --git a/AutomatedTesting/Gem/PythonTests/Prefab/tests/delete_entity/DeleteEntity_UnderAnotherPrefab.py b/AutomatedTesting/Gem/PythonTests/Prefab/tests/delete_entity/DeleteEntity_UnderAnotherPrefab.py
new file mode 100644
index 0000000000..deaaaedf30
--- /dev/null
+++ b/AutomatedTesting/Gem/PythonTests/Prefab/tests/delete_entity/DeleteEntity_UnderAnotherPrefab.py
@@ -0,0 +1,52 @@
+"""
+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
+"""
+
+def DeleteEntity_UnderAnotherPrefab():
+ """
+ Test description:
+ - Creates an entity.
+ - Creates a prefab out of the above entity.
+ - Focuses on the created prefab and destroys the entity within.
+ Checks that the entity is correctly destroyed.
+ """
+
+ from editor_python_test_tools.editor_entity_utils import EditorEntity
+ from editor_python_test_tools.prefab_utils import Prefab
+
+ import Prefab.tests.PrefabTestUtils as prefab_test_utils
+
+ prefab_test_utils.open_base_tests_level()
+
+ PREFAB_FILE_NAME = 'some_prefab'
+
+ # Creates a new entity at the root level
+ entity = EditorEntity.create_editor_entity()
+ assert entity.id.IsValid(), "Couldn't create entity."
+
+ # Asserts if prefab creation doesn't succeed
+ child_prefab, child_instance = Prefab.create_prefab([entity], PREFAB_FILE_NAME)
+ child_entity_ids_inside_prefab = child_instance.get_direct_child_entities()
+ assert len(
+ child_entity_ids_inside_prefab) == 1, f"{len(child_entity_ids_inside_prefab)} entities found inside prefab" \
+ f" when there should have been just 1 entity"
+
+ child_entity_inside_prefab = child_entity_ids_inside_prefab[0]
+ child_entity_inside_prefab.focus_on_owning_prefab()
+
+ child_entity_inside_prefab.delete()
+
+ # Wait till prefab propagation finishes before validating entity deletion.
+ azlmbr.legacy.general.idle_wait_frames(1)
+
+ child_entity_ids_inside_prefab = child_instance.get_direct_child_entities()
+ assert len(
+ child_entity_ids_inside_prefab) == 0, f"{len(child_entity_ids_inside_prefab)} entities found inside prefab" \
+ f" when there should have been 0 entities"
+
+if __name__ == "__main__":
+ from editor_python_test_tools.utils import Report
+ Report.start_test(DeleteEntity_UnderAnotherPrefab)
diff --git a/AutomatedTesting/Gem/PythonTests/Prefab/tests/delete_entity/DeleteEntity_UnderLevelPrefab.py b/AutomatedTesting/Gem/PythonTests/Prefab/tests/delete_entity/DeleteEntity_UnderLevelPrefab.py
new file mode 100644
index 0000000000..807427718c
--- /dev/null
+++ b/AutomatedTesting/Gem/PythonTests/Prefab/tests/delete_entity/DeleteEntity_UnderLevelPrefab.py
@@ -0,0 +1,37 @@
+"""
+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
+"""
+
+def DeleteEntity_UnderLevelPrefab():
+ """
+ Test description:
+ - Creates an entity.
+ - Destroys the created entity.
+ Checks that the entity is correctly destroyed.
+ """
+
+ from editor_python_test_tools.editor_entity_utils import EditorEntity
+ import Prefab.tests.PrefabTestUtils as prefab_test_utils
+
+ prefab_test_utils.open_base_tests_level()
+
+ # Creates a new Entity at the root level
+ # Asserts if creation didn't succeed
+ entity = EditorEntity.create_editor_entity_at((100.0, 100.0, 100.0), name = "TestEntity")
+ assert entity.id.IsValid(), "Couldn't create entity"
+
+ level_container_entity = EditorEntity(entity.get_parent_id())
+ entity.delete()
+
+ # Wait till prefab propagation finishes before validating entity deletion.
+ azlmbr.legacy.general.idle_wait_frames(1)
+ level_container_child_entities_count = len(level_container_entity.get_children_ids())
+ assert level_container_child_entities_count == 0, f"The level still has {level_container_child_entities_count}" \
+ f" children when it should have 0."
+
+if __name__ == "__main__":
+ from editor_python_test_tools.utils import Report
+ Report.start_test(DeleteEntity_UnderLevelPrefab)
diff --git a/AutomatedTesting/Gem/PythonTests/Prefab/tests/PrefabBasicWorkflow_CreateAndDeletePrefab.py b/AutomatedTesting/Gem/PythonTests/Prefab/tests/delete_prefab/DeletePrefab_ContainingASingleEntity.py
similarity index 83%
rename from AutomatedTesting/Gem/PythonTests/Prefab/tests/PrefabBasicWorkflow_CreateAndDeletePrefab.py
rename to AutomatedTesting/Gem/PythonTests/Prefab/tests/delete_prefab/DeletePrefab_ContainingASingleEntity.py
index bbebd70e04..919168019e 100644
--- a/AutomatedTesting/Gem/PythonTests/Prefab/tests/PrefabBasicWorkflow_CreateAndDeletePrefab.py
+++ b/AutomatedTesting/Gem/PythonTests/Prefab/tests/delete_prefab/DeletePrefab_ContainingASingleEntity.py
@@ -5,14 +5,14 @@ For complete copyright and license terms please see the LICENSE at the root of t
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
-def PrefabBasicWorkflow_CreateAndDeletePrefab():
+def DeletePrefab_ContainingASingleEntity():
CAR_PREFAB_FILE_NAME = 'car_prefab'
from editor_python_test_tools.editor_entity_utils import EditorEntity
from editor_python_test_tools.prefab_utils import Prefab
- import PrefabTestUtils as prefab_test_utils
+ import Prefab.tests.PrefabTestUtils as prefab_test_utils
prefab_test_utils.open_base_tests_level()
@@ -29,4 +29,4 @@ def PrefabBasicWorkflow_CreateAndDeletePrefab():
if __name__ == "__main__":
from editor_python_test_tools.utils import Report
- Report.start_test(PrefabBasicWorkflow_CreateAndDeletePrefab)
+ Report.start_test(DeletePrefab_ContainingASingleEntity)
diff --git a/AutomatedTesting/Gem/PythonTests/Prefab/tests/PrefabBasicWorkflow_CreateReparentAndDetachPrefab.py b/AutomatedTesting/Gem/PythonTests/Prefab/tests/detach_prefab/DetachPrefab_UnderAnotherPrefab.py
similarity index 89%
rename from AutomatedTesting/Gem/PythonTests/Prefab/tests/PrefabBasicWorkflow_CreateReparentAndDetachPrefab.py
rename to AutomatedTesting/Gem/PythonTests/Prefab/tests/detach_prefab/DetachPrefab_UnderAnotherPrefab.py
index bdf77c4bf3..5c97f0b032 100644
--- a/AutomatedTesting/Gem/PythonTests/Prefab/tests/PrefabBasicWorkflow_CreateReparentAndDetachPrefab.py
+++ b/AutomatedTesting/Gem/PythonTests/Prefab/tests/detach_prefab/DetachPrefab_UnderAnotherPrefab.py
@@ -5,7 +5,7 @@ For complete copyright and license terms please see the LICENSE at the root of t
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
-def PrefabBasicWorkflow_CreateReparentAndDetachPrefab():
+def DetachPrefab_UnderAnotherPrefab():
CAR_PREFAB_FILE_NAME = 'car_prefab'
WHEEL_PREFAB_FILE_NAME = 'wheel_prefab'
@@ -18,7 +18,7 @@ def PrefabBasicWorkflow_CreateReparentAndDetachPrefab():
from editor_python_test_tools.editor_entity_utils import EditorEntity
from editor_python_test_tools.prefab_utils import Prefab
- import PrefabTestUtils as prefab_test_utils
+ import Prefab.tests.PrefabTestUtils as prefab_test_utils
prefab_test_utils.open_base_tests_level()
@@ -48,4 +48,4 @@ def PrefabBasicWorkflow_CreateReparentAndDetachPrefab():
if __name__ == "__main__":
from editor_python_test_tools.utils import Report
- Report.start_test(PrefabBasicWorkflow_CreateReparentAndDetachPrefab)
+ Report.start_test(DetachPrefab_UnderAnotherPrefab)
diff --git a/AutomatedTesting/Gem/PythonTests/Prefab/tests/PrefabBasicWorkflow_CreateAndDuplicatePrefab.py b/AutomatedTesting/Gem/PythonTests/Prefab/tests/duplicate_prefab/DuplicatePrefab_ContainingASingleEntity.py
similarity index 83%
rename from AutomatedTesting/Gem/PythonTests/Prefab/tests/PrefabBasicWorkflow_CreateAndDuplicatePrefab.py
rename to AutomatedTesting/Gem/PythonTests/Prefab/tests/duplicate_prefab/DuplicatePrefab_ContainingASingleEntity.py
index 2479ae549e..e611303fbb 100644
--- a/AutomatedTesting/Gem/PythonTests/Prefab/tests/PrefabBasicWorkflow_CreateAndDuplicatePrefab.py
+++ b/AutomatedTesting/Gem/PythonTests/Prefab/tests/duplicate_prefab/DuplicatePrefab_ContainingASingleEntity.py
@@ -5,14 +5,14 @@ For complete copyright and license terms please see the LICENSE at the root of t
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
-def PrefabBasicWorkflow_CreateAndDuplicatePrefab():
+def DuplicatePrefab_ContainingASingleEntity():
CAR_PREFAB_FILE_NAME = 'car_prefab'
from editor_python_test_tools.editor_entity_utils import EditorEntity
from editor_python_test_tools.prefab_utils import Prefab
- import PrefabTestUtils as prefab_test_utils
+ import Prefab.tests.PrefabTestUtils as prefab_test_utils
prefab_test_utils.open_base_tests_level()
@@ -29,4 +29,4 @@ def PrefabBasicWorkflow_CreateAndDuplicatePrefab():
if __name__ == "__main__":
from editor_python_test_tools.utils import Report
- Report.start_test(PrefabBasicWorkflow_CreateAndDuplicatePrefab)
+ Report.start_test(DuplicatePrefab_ContainingASingleEntity)
diff --git a/AutomatedTesting/Gem/PythonTests/Prefab/tests/PrefabBasicWorkflow_InstantiatePrefab.py b/AutomatedTesting/Gem/PythonTests/Prefab/tests/instantiate_prefab/InstantiatePrefab_ContainingASingleEntity.py
similarity index 85%
rename from AutomatedTesting/Gem/PythonTests/Prefab/tests/PrefabBasicWorkflow_InstantiatePrefab.py
rename to AutomatedTesting/Gem/PythonTests/Prefab/tests/instantiate_prefab/InstantiatePrefab_ContainingASingleEntity.py
index a701802cd4..a81608ee8a 100644
--- a/AutomatedTesting/Gem/PythonTests/Prefab/tests/PrefabBasicWorkflow_InstantiatePrefab.py
+++ b/AutomatedTesting/Gem/PythonTests/Prefab/tests/instantiate_prefab/InstantiatePrefab_ContainingASingleEntity.py
@@ -5,7 +5,7 @@ For complete copyright and license terms please see the LICENSE at the root of t
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
-def PrefabBasicWorkflow_InstantiatePrefab():
+def InstantiatePrefab_ContainingASingleEntity():
from azlmbr.math import Vector3
@@ -15,7 +15,7 @@ def PrefabBasicWorkflow_InstantiatePrefab():
from editor_python_test_tools.prefab_utils import Prefab
- import PrefabTestUtils as prefab_test_utils
+ import Prefab.tests.PrefabTestUtils as prefab_test_utils
prefab_test_utils.open_base_tests_level()
@@ -30,4 +30,4 @@ def PrefabBasicWorkflow_InstantiatePrefab():
if __name__ == "__main__":
from editor_python_test_tools.utils import Report
- Report.start_test(PrefabBasicWorkflow_InstantiatePrefab)
+ Report.start_test(InstantiatePrefab_ContainingASingleEntity)
diff --git a/AutomatedTesting/Gem/PythonTests/Prefab/tests/PrefabLevel_OpensLevelWithEntities.py b/AutomatedTesting/Gem/PythonTests/Prefab/tests/open_level/OpenLevel_ContainingTwoEntities.py
similarity index 96%
rename from AutomatedTesting/Gem/PythonTests/Prefab/tests/PrefabLevel_OpensLevelWithEntities.py
rename to AutomatedTesting/Gem/PythonTests/Prefab/tests/open_level/OpenLevel_ContainingTwoEntities.py
index 0eb7e86a9e..787d7000d2 100644
--- a/AutomatedTesting/Gem/PythonTests/Prefab/tests/PrefabLevel_OpensLevelWithEntities.py
+++ b/AutomatedTesting/Gem/PythonTests/Prefab/tests/open_level/OpenLevel_ContainingTwoEntities.py
@@ -14,7 +14,7 @@ class Tests():
# fmt:on
-def PrefabLevel_OpensLevelWithEntities():
+def OpenLevel_ContainingTwoEntities():
"""
Opens the level that contains 2 entities, "EmptyEntity" and "EntityWithPxCollider".
This test makes sure that both entities exist after opening the level and that:
@@ -70,4 +70,4 @@ def PrefabLevel_OpensLevelWithEntities():
if __name__ == "__main__":
from editor_python_test_tools.utils import Report
- Report.start_test(PrefabLevel_OpensLevelWithEntities)
+ Report.start_test(OpenLevel_ContainingTwoEntities)
diff --git a/AutomatedTesting/Gem/PythonTests/Prefab/tests/PrefabBasicWorkflow_CreateAndReparentPrefab.py b/AutomatedTesting/Gem/PythonTests/Prefab/tests/reparent_prefab/ReparentPrefab_UnderAnotherPrefab.py
similarity index 89%
rename from AutomatedTesting/Gem/PythonTests/Prefab/tests/PrefabBasicWorkflow_CreateAndReparentPrefab.py
rename to AutomatedTesting/Gem/PythonTests/Prefab/tests/reparent_prefab/ReparentPrefab_UnderAnotherPrefab.py
index 1cbc591c29..2c460a3298 100644
--- a/AutomatedTesting/Gem/PythonTests/Prefab/tests/PrefabBasicWorkflow_CreateAndReparentPrefab.py
+++ b/AutomatedTesting/Gem/PythonTests/Prefab/tests/reparent_prefab/ReparentPrefab_UnderAnotherPrefab.py
@@ -5,7 +5,7 @@ For complete copyright and license terms please see the LICENSE at the root of t
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
-def PrefabBasicWorkflow_CreateAndReparentPrefab():
+def ReparentPrefab_UnderAnotherPrefab():
CAR_PREFAB_FILE_NAME = 'car_prefab'
WHEEL_PREFAB_FILE_NAME = 'wheel_prefab'
@@ -18,7 +18,7 @@ def PrefabBasicWorkflow_CreateAndReparentPrefab():
from editor_python_test_tools.editor_entity_utils import EditorEntity
from editor_python_test_tools.prefab_utils import Prefab
- import PrefabTestUtils as prefab_test_utils
+ import Prefab.tests.PrefabTestUtils as prefab_test_utils
prefab_test_utils.open_base_tests_level()
@@ -45,4 +45,4 @@ def PrefabBasicWorkflow_CreateAndReparentPrefab():
if __name__ == "__main__":
from editor_python_test_tools.utils import Report
- Report.start_test(PrefabBasicWorkflow_CreateAndReparentPrefab)
+ Report.start_test(ReparentPrefab_UnderAnotherPrefab)
diff --git a/AutomatedTesting/Gem/PythonTests/PythonAssetBuilder/AssetBuilder_test_case.py b/AutomatedTesting/Gem/PythonTests/PythonAssetBuilder/AssetBuilder_test_case.py
index 8d418222ce..112fd013bf 100644
--- a/AutomatedTesting/Gem/PythonTests/PythonAssetBuilder/AssetBuilder_test_case.py
+++ b/AutomatedTesting/Gem/PythonTests/PythonAssetBuilder/AssetBuilder_test_case.py
@@ -8,42 +8,54 @@ import azlmbr.bus
import azlmbr.asset
import azlmbr.editor
import azlmbr.math
-import azlmbr.legacy.general
-def raise_and_stop(msg):
- print (msg)
+print('Starting mock asset tests')
+handler = azlmbr.editor.EditorEventBusHandler()
+
+def on_notify_editor_initialized(args):
+ # These tests are meant to check that the test_asset.mock source asset turned into
+ # a test_asset.mock_asset product asset via the Python asset builder system
+ mockAssetType = azlmbr.math.Uuid_CreateString('{9274AD17-3212-4651-9F3B-7DCCB080E467}', 0)
+ mockAssetPath = 'gem/pythontests/pythonassetbuilder/test_asset.mock_asset'
+ assetId = azlmbr.asset.AssetCatalogRequestBus(azlmbr.bus.Broadcast, 'GetAssetIdByPath', mockAssetPath, mockAssetType, False)
+ if (assetId.is_valid() is False):
+ print(f'Mock AssetId is not valid! Got {assetId.to_string()} instead')
+ else:
+ print(f'Mock AssetId is valid!')
+
+ assetIdString = assetId.to_string()
+ if (assetIdString.endswith(':528cca58') is False):
+ print(f'Mock AssetId {assetIdString} has unexpected sub-id for {mockAssetPath}!')
+ else:
+ print(f'Mock AssetId has expected sub-id for {mockAssetPath}!')
+
+ print ('Mock asset exists')
+
+ # These tests detect if the geom_group.fbx file turns into a number of azmodel product assets
+ def test_azmodel_product(generatedModelAssetPath):
+ azModelAssetType = azlmbr.math.Uuid_CreateString('{2C7477B6-69C5-45BE-8163-BCD6A275B6D8}', 0)
+ assetId = azlmbr.asset.AssetCatalogRequestBus(azlmbr.bus.Broadcast, 'GetAssetIdByPath', generatedModelAssetPath, azModelAssetType, False)
+ assetIdString = assetId.to_string()
+ if (assetId.is_valid()):
+ print(f'AssetId found for asset ({generatedModelAssetPath}) found')
+ else:
+ print(f'Asset at path {generatedModelAssetPath} has unexpected asset ID ({assetIdString})!')
+
+ test_azmodel_product('gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_z_positive_1.azmodel')
+ test_azmodel_product('gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_z_negative_1.azmodel')
+ test_azmodel_product('gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_y_positive_1.azmodel')
+ test_azmodel_product('gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_y_negative_1.azmodel')
+ test_azmodel_product('gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_x_positive_1.azmodel')
+ test_azmodel_product('gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_x_negative_1.azmodel')
+ test_azmodel_product('gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_center_1.azmodel')
+
+ # clear up notification handler
+ global handler
+ handler.disconnect()
+ handler = None
+
+ print('Finished mock asset tests')
azlmbr.editor.EditorToolsApplicationRequestBus(azlmbr.bus.Broadcast, 'ExitNoPrompt')
-# These tests are meant to check that the test_asset.mock source asset turned into
-# a test_asset.mock_asset product asset via the Python asset builder system
-mockAssetType = azlmbr.math.Uuid_CreateString('{9274AD17-3212-4651-9F3B-7DCCB080E467}', 0)
-mockAssetPath = 'gem/pythontests/pythonassetbuilder/test_asset.mock_asset'
-assetId = azlmbr.asset.AssetCatalogRequestBus(azlmbr.bus.Broadcast, 'GetAssetIdByPath', mockAssetPath, mockAssetType, False)
-if (assetId.is_valid() is False):
- raise_and_stop(f'Mock AssetId is not valid! Got {assetId.to_string()} instead')
-
-assetIdString = assetId.to_string()
-if (assetIdString.endswith(':528cca58') is False):
- raise_and_stop(f'Mock AssetId {assetIdString} has unexpected sub-id for {mockAssetPath}!')
-
-print ('Mock asset exists')
-
-# These tests detect if the geom_group.fbx file turns into a number of azmodel product assets
-def test_azmodel_product(generatedModelAssetPath):
- azModelAssetType = azlmbr.math.Uuid_CreateString('{2C7477B6-69C5-45BE-8163-BCD6A275B6D8}', 0)
- assetId = azlmbr.asset.AssetCatalogRequestBus(azlmbr.bus.Broadcast, 'GetAssetIdByPath', generatedModelAssetPath, azModelAssetType, False)
- assetIdString = assetId.to_string()
- if (assetId.is_valid()):
- print(f'AssetId found for asset ({generatedModelAssetPath}) found')
- else:
- raise_and_stop(f'Asset at path {generatedModelAssetPath} has unexpected asset ID ({assetIdString})!')
-
-test_azmodel_product('gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_z_positive_1.azmodel')
-test_azmodel_product('gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_z_negative_1.azmodel')
-test_azmodel_product('gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_y_positive_1.azmodel')
-test_azmodel_product('gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_y_negative_1.azmodel')
-test_azmodel_product('gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_x_positive_1.azmodel')
-test_azmodel_product('gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_x_negative_1.azmodel')
-test_azmodel_product('gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_center_1.azmodel')
-
-azlmbr.editor.EditorToolsApplicationRequestBus(azlmbr.bus.Broadcast, 'ExitNoPrompt')
+handler.connect()
+handler.add_callback('NotifyEditorInitialized', on_notify_editor_initialized)
diff --git a/AutomatedTesting/Gem/PythonTests/Terrain/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/Terrain/CMakeLists.txt
new file mode 100644
index 0000000000..9f8ba06829
--- /dev/null
+++ b/AutomatedTesting/Gem/PythonTests/Terrain/CMakeLists.txt
@@ -0,0 +1,24 @@
+#
+# 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
+#
+#
+
+if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
+
+ ly_add_pytest(
+ NAME AutomatedTesting::TerrainTests_Main
+ TEST_SUITE main
+ TEST_SERIAL
+ PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Main.py
+ RUNTIME_DEPENDENCIES
+ Legacy::Editor
+ AZ::AssetProcessor
+ AutomatedTesting.Assets
+ COMPONENT
+ Terrain
+ )
+
+endif()
diff --git a/AutomatedTesting/Gem/PythonTests/Terrain/EditorScripts/TerrainPhysicsCollider_ChangesSizeWithAxisAlignedBoxShapeChanges.py b/AutomatedTesting/Gem/PythonTests/Terrain/EditorScripts/TerrainPhysicsCollider_ChangesSizeWithAxisAlignedBoxShapeChanges.py
new file mode 100644
index 0000000000..f4c2a19884
--- /dev/null
+++ b/AutomatedTesting/Gem/PythonTests/Terrain/EditorScripts/TerrainPhysicsCollider_ChangesSizeWithAxisAlignedBoxShapeChanges.py
@@ -0,0 +1,89 @@
+"""
+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
+"""
+
+#fmt: off
+class Tests():
+ create_test_entity = ("Entity created successfully", "Failed to create Entity")
+ add_axis_aligned_box_shape = ("Axis Aligned Box Shape component added", "Failed to add Axis Aligned Box Shape component")
+ add_terrain_collider = ("Terrain Physics Heightfield Collider component added", "Failed to add a Terrain Physics Heightfield Collider component")
+ box_dimensions_changed = ("Aabb dimensions changed successfully", "Failed change Aabb dimensions")
+ configuration_changed = ("Terrain size changed successfully", "Failed terrain size change")
+#fmt: on
+
+def TerrainPhysicsCollider_ChangesSizeWithAxisAlignedBoxShapeChanges():
+ """
+ Summary:
+ Test aspects of the Terrain Physics Heightfield Collider through the BehaviorContext and the Property Tree.
+
+ Test Steps:
+ Expected Behavior:
+ The Editor is stable there are no warnings or errors.
+
+ Test Steps:
+ 1) Load the base level
+ 2) Create test entity
+ 3) Start the Tracer to catch any errors and warnings
+ 4) Add the Axis Aligned Box Shape and Terrain Physics Heightfield Collider components
+ 5) Change the Axis Aligned Box Shape dimensions
+ 6) Check the Heightfield provider is returning the correct size
+ 7) Verify there are no errors and warnings in the logs
+
+
+ :return: None
+ """
+
+ from editor_python_test_tools.editor_entity_utils import EditorEntity
+ from editor_python_test_tools.utils import TestHelper as helper
+ from editor_python_test_tools.utils import Report, Tracer
+ import azlmbr.legacy.general as general
+ import azlmbr.physics as physics
+ import azlmbr.math as azmath
+ import azlmbr.bus as bus
+ import sys
+ import math
+
+ SET_BOX_X_SIZE = 5.0
+ SET_BOX_Y_SIZE = 6.0
+ EXPECTED_COLUMN_SIZE = SET_BOX_X_SIZE + 1
+ EXPECTED_ROW_SIZE = SET_BOX_Y_SIZE + 1
+ helper.init_idle()
+
+ # 1) Load the level
+ helper.open_level("", "Base")
+
+ # 2) Create test entity
+ test_entity = EditorEntity.create_editor_entity("TestEntity")
+ Report.result(Tests.create_test_entity, test_entity.id.IsValid())
+
+ # 3) Start the Tracer to catch any errors and warnings
+ with Tracer() as section_tracer:
+ # 4) Add the Axis Aligned Box Shape and Terrain Physics Heightfield Collider components
+ aaBoxShape_component = test_entity.add_component("Axis Aligned Box Shape")
+ Report.result(Tests.add_axis_aligned_box_shape, test_entity.has_component("Axis Aligned Box Shape"))
+ terrainPhysics_component = test_entity.add_component("Terrain Physics Heightfield Collider")
+ Report.result(Tests.add_terrain_collider, test_entity.has_component("Terrain Physics Heightfield Collider"))
+
+ # 5) Change the Axis Aligned Box Shape dimensions
+ aaBoxShape_component.set_component_property_value("Axis Aligned Box Shape|Box Configuration|Dimensions", azmath.Vector3(SET_BOX_X_SIZE, SET_BOX_Y_SIZE, 1.0))
+ add_check = aaBoxShape_component.get_component_property_value("Axis Aligned Box Shape|Box Configuration|Dimensions") == azmath.Vector3(SET_BOX_X_SIZE, SET_BOX_Y_SIZE, 1.0)
+ Report.result(Tests.box_dimensions_changed, add_check)
+
+ # 6) Check the Heightfield provider is returning the correct size
+ columns = physics.HeightfieldProviderRequestsBus(bus.Broadcast, "GetHeightfieldGridColumns")
+ rows = physics.HeightfieldProviderRequestsBus(bus.Broadcast, "GetHeightfieldGridRows")
+ Report.result(Tests.configuration_changed, math.isclose(columns, EXPECTED_COLUMN_SIZE) and math.isclose(rows, EXPECTED_ROW_SIZE))
+
+ helper.wait_for_condition(lambda: section_tracer.has_errors or section_tracer.has_asserts, 1.0)
+ for error_info in section_tracer.errors:
+ Report.info(f"Error: {error_info.filename} {error_info.function} | {error_info.message}")
+ for assert_info in section_tracer.asserts:
+ Report.info(f"Assert: {assert_info.filename} {assert_info.function} | {assert_info.message}")
+
+if __name__ == "__main__":
+
+ from editor_python_test_tools.utils import Report
+ Report.start_test(TerrainPhysicsCollider_ChangesSizeWithAxisAlignedBoxShapeChanges)
diff --git a/AutomatedTesting/Gem/PythonTests/Terrain/EditorScripts/Terrain_SupportsPhysics.py b/AutomatedTesting/Gem/PythonTests/Terrain/EditorScripts/Terrain_SupportsPhysics.py
new file mode 100644
index 0000000000..390ec6a6b0
--- /dev/null
+++ b/AutomatedTesting/Gem/PythonTests/Terrain/EditorScripts/Terrain_SupportsPhysics.py
@@ -0,0 +1,164 @@
+"""
+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
+"""
+
+#fmt: off
+class Tests():
+ create_terrain_spawner_entity = ("Terrain_spawner_entity created successfully", "Failed to create terrain_spawner_entity")
+ create_height_provider_entity = ("Height_provider_entity created successfully", "Failed to create height_provider_entity")
+ create_test_ball = ("Ball created successfully", "Failed to create Ball")
+ box_dimensions_changed = ("Aabb dimensions changed successfully", "Failed change Aabb dimensions")
+ shape_changed = ("Shape changed successfully", "Failed Shape change")
+ entity_added = ("Entity added successfully", "Failed Entity add")
+ frequency_changed = ("Frequency changed successfully", "Failed Frequency change")
+ shape_set = ("Shape set to Sphere successfully", "Failed to set Sphere shape")
+ test_collision = ("Ball collided with terrain", "Ball failed to collide with terrain")
+ no_errors_and_warnings_found = ("No errors and warnings found", "Found errors and warnings")
+#fmt: on
+
+def Terrain_SupportsPhysics():
+ """
+ Summary:
+ Test aspects of the TerrainHeightGradientList through the BehaviorContext and the Property Tree.
+
+ Test Steps:
+ Expected Behavior:
+ The Editor is stable there are no warnings or errors.
+
+ Test Steps:
+ 1) Load the base level
+ 2) Create 2 test entities, one parent at 512.0, 512.0, 50.0 and one child at the default position and add the required components
+ 2a) Create a ball at 600.0, 600.0, 46.0 - This position is not too high over the heightfield so will collide in a reasonable time
+ 3) Start the Tracer to catch any errors and warnings
+ 4) Change the Axis Aligned Box Shape dimensions
+ 5) Set the Vegetation Shape reference to TestEntity1
+ 6) Set the FastNoise gradient frequency to 0.01
+ 7) Set the Gradient List to TestEntity2
+ 8) Set the PhysX Collider to Sphere mode
+ 9) Disable and Enable the Terrain Gradient List so that it is recognised
+ 10) Enter game mode and test if the ball hits the heightfield within 3 seconds
+ 11) Verify there are no errors and warnings in the logs
+
+
+ :return: None
+ """
+
+ from editor_python_test_tools.editor_entity_utils import EditorEntity
+ from editor_python_test_tools.utils import TestHelper as helper, Report
+ from editor_python_test_tools.utils import Report, Tracer
+ import editor_python_test_tools.hydra_editor_utils as hydra
+ import azlmbr.math as azmath
+ import azlmbr.legacy.general as general
+ import azlmbr.bus as bus
+ import azlmbr.editor as editor
+ import math
+
+ SET_BOX_X_SIZE = 1024.0
+ SET_BOX_Y_SIZE = 1024.0
+ SET_BOX_Z_SIZE = 100.0
+
+ helper.init_idle()
+
+ # 1) Load the level
+ helper.open_level("", "Base")
+ helper.wait_for_condition(lambda: general.get_current_level_name() == "Base", 2.0)
+
+ #1a) Load the level components
+ hydra.add_level_component("Terrain World")
+ hydra.add_level_component("Terrain World Renderer")
+
+ # 2) Create 2 test entities, one parent at 512.0, 512.0, 50.0 and one child at the default position and add the required components
+ entity1_components_to_add = ["Axis Aligned Box Shape", "Terrain Layer Spawner", "Terrain Height Gradient List", "Terrain Physics Heightfield Collider", "PhysX Heightfield Collider"]
+ entity2_components_to_add = ["Shape Reference", "Gradient Transform Modifier", "FastNoise Gradient"]
+ ball_components_to_add = ["Sphere Shape", "PhysX Collider", "PhysX Rigid Body"]
+ terrain_spawner_entity = hydra.Entity("TestEntity1")
+ terrain_spawner_entity.create_entity(azmath.Vector3(512.0, 512.0, 50.0), entity1_components_to_add)
+ Report.result(Tests.create_terrain_spawner_entity, terrain_spawner_entity.id.IsValid())
+ height_provider_entity = hydra.Entity("TestEntity2")
+ height_provider_entity.create_entity(azmath.Vector3(0.0, 0.0, 0.0), entity2_components_to_add,terrain_spawner_entity.id)
+ Report.result(Tests.create_height_provider_entity, height_provider_entity.id.IsValid())
+ # 2a) Create a ball at 600.0, 600.0, 46.0 - This position is not too high over the heightfield so will collide in a reasonable time
+ ball = hydra.Entity("Ball")
+ ball.create_entity(azmath.Vector3(600.0, 600.0, 46.0), ball_components_to_add)
+ Report.result(Tests.create_test_ball, ball.id.IsValid())
+ # Give everything a chance to finish initializing.
+ general.idle_wait_frames(1)
+
+ # 3) Start the Tracer to catch any errors and warnings
+ with Tracer() as section_tracer:
+ # 4) Change the Axis Aligned Box Shape dimensions
+ box_dimensions = azmath.Vector3(SET_BOX_X_SIZE, SET_BOX_Y_SIZE, SET_BOX_Z_SIZE)
+ terrain_spawner_entity.get_set_test(0, "Axis Aligned Box Shape|Box Configuration|Dimensions", box_dimensions)
+ box_shape_dimensions = hydra.get_component_property_value(terrain_spawner_entity.components[0], "Axis Aligned Box Shape|Box Configuration|Dimensions")
+ Report.result(Tests.box_dimensions_changed, box_dimensions == box_shape_dimensions)
+
+ # 5) Set the Vegetaion Shape reference to TestEntity1
+ height_provider_entity.get_set_test(0, "Configuration|Shape Entity Id", terrain_spawner_entity.id)
+ entityId = hydra.get_component_property_value(height_provider_entity.components[0], "Configuration|Shape Entity Id")
+ Report.result(Tests.shape_changed, entityId == terrain_spawner_entity.id)
+
+ # 6) Set the FastNoise Gradient frequency to 0.01
+ Frequency = 0.01
+ height_provider_entity.get_set_test(2, "Configuration|Frequency", Frequency)
+ FrequencyVal = hydra.get_component_property_value(height_provider_entity.components[2], "Configuration|Frequency")
+ Report.result(Tests.frequency_changed, math.isclose(Frequency, FrequencyVal, abs_tol = 0.00001))
+
+ # 7) Set the Gradient List to TestEntity2
+ propertyTree = hydra.get_property_tree(terrain_spawner_entity.components[2])
+ propertyTree.add_container_item("Configuration|Gradient Entities", 0, height_provider_entity.id)
+ checkID = propertyTree.get_container_item("Configuration|Gradient Entities", 0)
+ Report.result(Tests.entity_added, checkID.GetValue() == height_provider_entity.id)
+
+ # 8) Set the PhysX Collider to Sphere mode
+ shape = 0
+ hydra.get_set_test(ball, 1, "Shape Configuration|Shape", shape)
+ setShape = hydra.get_component_property_value(ball.components[1], "Shape Configuration|Shape")
+ Report.result(Tests.shape_set, shape == setShape)
+
+ # 9) Disable and Enable the Terrain Gradient List so that it is recognised
+ editor.EditorComponentAPIBus(bus.Broadcast, 'EnableComponents', [terrain_spawner_entity.components[2]])
+
+ general.enter_game_mode()
+
+ general.idle_wait_frames(1)
+
+ # 10) Enter game mode and test if the ball hits the heightfield within 3 seconds
+ TIMEOUT = 3.0
+
+ class Collider:
+ id = general.find_game_entity("Ball")
+ touched_ground = False
+
+ terrain_id = general.find_game_entity("TestEntity1")
+
+ def on_collision_begin(args):
+ other_id = args[0]
+ if other_id.Equal(terrain_id):
+ Report.info("Touched ground")
+ Collider.touched_ground = True
+
+ handler = azlmbr.physics.CollisionNotificationBusHandler()
+ handler.connect(Collider.id)
+ handler.add_callback("OnCollisionBegin", on_collision_begin)
+
+ helper.wait_for_condition(lambda: Collider.touched_ground, TIMEOUT)
+ Report.result(Tests.test_collision, Collider.touched_ground)
+
+ general.exit_game_mode()
+
+ # 11) Verify there are no errors and warnings in the logs
+ helper.wait_for_condition(lambda: section_tracer.has_errors or section_tracer.has_asserts, 1.0)
+ for error_info in section_tracer.errors:
+ Report.info(f"Error: {error_info.filename} {error_info.function} | {error_info.message}")
+ for assert_info in section_tracer.asserts:
+ Report.info(f"Assert: {assert_info.filename} {assert_info.function} | {assert_info.message}")
+
+
+if __name__ == "__main__":
+
+ from editor_python_test_tools.utils import Report
+ Report.start_test(Terrain_SupportsPhysics)
+
diff --git a/AutomatedTesting/Gem/PythonTests/Terrain/TestSuite_Main.py b/AutomatedTesting/Gem/PythonTests/Terrain/TestSuite_Main.py
new file mode 100644
index 0000000000..786651713c
--- /dev/null
+++ b/AutomatedTesting/Gem/PythonTests/Terrain/TestSuite_Main.py
@@ -0,0 +1,29 @@
+"""
+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
+
+"""
+
+# This suite consists of all test cases that are passing and have been verified.
+
+import pytest
+import os
+import sys
+
+from ly_test_tools import LAUNCHERS
+from ly_test_tools.o3de.editor_test import EditorTestSuite, EditorSharedTest
+
+@pytest.mark.SUITE_main
+@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
+@pytest.mark.parametrize("project", ["AutomatedTesting"])
+class TestAutomation(EditorTestSuite):
+
+ enable_prefab_system = False
+
+ class test_AxisAlignedBoxShape_ConfigurationWorks(EditorSharedTest):
+ from .EditorScripts import TerrainPhysicsCollider_ChangesSizeWithAxisAlignedBoxShapeChanges as test_module
+
+ class test_Terrain_SupportsPhysics(EditorSharedTest):
+ from .EditorScripts import Terrain_SupportsPhysics as test_module
diff --git a/AutomatedTesting/Gem/PythonTests/Terrain/__init__.py b/AutomatedTesting/Gem/PythonTests/Terrain/__init__.py
new file mode 100644
index 0000000000..f5193b300e
--- /dev/null
+++ b/AutomatedTesting/Gem/PythonTests/Terrain/__init__.py
@@ -0,0 +1,6 @@
+"""
+Copyright (c) Contributors to the Open 3D Engine Project.
+For complete copyright and license terms please see the LICENSE at the root of this distribution.
+
+SPDX-License-Identifier: Apache-2.0 OR MIT
+"""
diff --git a/AutomatedTesting/Gem/PythonTests/WhiteBox/TestSuite_Main.py b/AutomatedTesting/Gem/PythonTests/WhiteBox/TestSuite_Main.py
index fa6c81c98a..2fc717e256 100644
--- a/AutomatedTesting/Gem/PythonTests/WhiteBox/TestSuite_Main.py
+++ b/AutomatedTesting/Gem/PythonTests/WhiteBox/TestSuite_Main.py
@@ -24,12 +24,12 @@ from base import TestAutomationBase
class TestAutomation(TestAutomationBase):
def test_WhiteBox_AddComponentToEntity(self, request, workspace, editor, launcher_platform):
from .tests import WhiteBox_AddComponentToEntity as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_WhiteBox_SetDefaultShape(self, request, workspace, editor, launcher_platform):
from .tests import WhiteBox_SetDefaultShape as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_WhiteBox_SetInvisible(self, request, workspace, editor, launcher_platform):
from .tests import WhiteBox_SetInvisible as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/ap_missing_dependency_fixture.py b/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/ap_missing_dependency_fixture.py
index 857d91bb12..7f7f420fd0 100755
--- a/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/ap_missing_dependency_fixture.py
+++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/ap_missing_dependency_fixture.py
@@ -183,23 +183,26 @@ def ap_missing_dependency_fixture(request, workspace, ap_setup_fixture) -> Any:
:return: None
"""
logger.info(f"Searching output for expected dependencies for product {product}")
+ sorted_expected = sorted(expected_dependencies)
# Check dependencies found either in the log or console output
for product_name, missing_deps in self.extract_missing_dependencies_from_output(log_output).items():
if product in product_name:
+ sorted_missing = sorted(missing_deps)
# fmt:off
- assert sorted(missing_deps) == sorted(expected_dependencies), \
+ assert sorted_expected == sorted_missing, \
f"Missing dependencies for '{product_name}' did not match expected. Expected: " \
- f"{expected_dependencies}, Actual: {missing_deps}"
+ f"{sorted_expected}, Actual: {sorted_missing}"
# fmt:on
# Check dependencies found in Database
for product_name, missing_deps in self.extract_missing_dependencies_from_database(product,
platforms).items():
if product.replace("\\", "/") in product_name:
+ sorted_missing = sorted(missing_deps)
# fmt:off
- assert sorted(expected_dependencies) == sorted(missing_deps), \
- f"Product '{product_name}' expected missing dependencies: {expected_dependencies}; " \
- f"actual missing dependencies {missing_deps}"
+ assert sorted_expected == sorted_missing, \
+ f"Product '{product_name}' expected missing dependencies: {sorted_expected}; " \
+ f"actual missing dependencies {sorted_missing}"
# fmt:on
def __getitem__(self, item: str) -> object:
diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/ap_setup_fixture.py b/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/ap_setup_fixture.py
index 244ecfb516..c5b02e4f28 100755
--- a/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/ap_setup_fixture.py
+++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/ap_setup_fixture.py
@@ -4,7 +4,7 @@ For complete copyright and license terms please see the LICENSE at the root of t
SPDX-License-Identifier: Apache-2.0 OR MIT
-A fixture for Setting Up Asset Processor Batch workspace for tests in lmbr_test
+A fixture for Setting Up Asset Processor Batch workspace for tests
"""
# Import builtin libraries
diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/asset_processor_fixture.py b/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/asset_processor_fixture.py
index eea6cb9224..885b4c2959 100755
--- a/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/asset_processor_fixture.py
+++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/asset_processor_fixture.py
@@ -4,7 +4,7 @@ For complete copyright and license terms please see the LICENSE at the root of t
SPDX-License-Identifier: Apache-2.0 OR MIT
-A fixture for using the Asset Processor in lmbr_test, this will stop the asset processor after every test via
+A fixture for using the Asset Processor, this will stop the asset processor after every test via
the teardown. Using the fixture at class level will stop the asset processor after the suite completes.
Using the fixture at test level will stop asset processor after the test completes. Calling this fixture as a test argument will still run the teardown to stop the Asset Processor.
"""
@@ -15,6 +15,7 @@ import logging
# Import LyTestTools
import ly_test_tools.o3de.asset_processor as asset_processor_commands
+import ly_test_tools.o3de.asset_processor_utils
logger = logging.getLogger(__name__)
@@ -36,5 +37,8 @@ def asset_processor(request: pytest.fixture, workspace: pytest.fixture) -> asset
ap.stop()
request.addfinalizer(teardown)
+ for n in ly_test_tools.o3de.asset_processor_utils.processList:
+ assert not ly_test_tools.o3de.asset_processor_utils.check_ap_running(n), f"{n} process did not shutdown correctly."
+
return ap
diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/bundler_batch_setup_fixture.py b/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/bundler_batch_setup_fixture.py
index 35d7982ded..9281d5947e 100755
--- a/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/bundler_batch_setup_fixture.py
+++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/bundler_batch_setup_fixture.py
@@ -158,7 +158,7 @@ def bundler_batch_setup_fixture(request, workspace, asset_processor, timeout) ->
else:
cmd.append(f"--{key}")
if append_defaults:
- cmd.append(f"--project-path={os.path.join(workspace.paths.engine_root(), workspace.project)}")
+ cmd.append(f"--project-path={workspace.paths.project()}")
return cmd
# ******
diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/CMakeLists.txt
index 5a5809595e..e37a5ed99b 100644
--- a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/CMakeLists.txt
+++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/CMakeLists.txt
@@ -103,6 +103,19 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
AZ::AssetBundlerBatch
)
+ ly_add_pytest(
+ NAME AssetPipelineTests.BundleMode
+ PATH ${CMAKE_CURRENT_LIST_DIR}/bundle_mode_tests.py
+ EXCLUDE_TEST_RUN_TARGET_FROM_IDE
+ TEST_SERIAL
+ TEST_SUITE periodic
+ RUNTIME_DEPENDENCIES
+ AZ::AssetProcessor
+ AZ::AssetBundlerBatch
+ Legacy::Editor
+ AutomatedTesting.Assets
+ )
+
ly_add_pytest(
NAME AssetPipelineTests.AssetBuilder
PATH ${CMAKE_CURRENT_LIST_DIR}/asset_builder_tests.py
diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_bundler_batch_tests.py b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_bundler_batch_tests.py
index 7f85e5e317..f5e5642573 100755
--- a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_bundler_batch_tests.py
+++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_bundler_batch_tests.py
@@ -88,214 +88,6 @@ class TestsAssetBundlerBatch_WindowsAndMac(object):
bundler_batch_helper.call_bundles(help="")
bundler_batch_helper.call_bundleSeed(help="")
- @pytest.mark.BAT
- @pytest.mark.assetpipeline
- @pytest.mark.test_case_id("C16877175")
- @pytest.mark.skip("'animations/animationeditorfiles/sample1.animgraph' missing, needs investigation")
- def test_WindowsAndMac_CreateAssetList_DependenciesCorrect(self, workspace, bundler_batch_helper):
- r"""
- Tests that an asset list created maps dependencies correctly.
- testdependencieslevel\level.pak and lists of known dependencies are used for validation
-
- Test Steps:
- 1. Create an asset list from the level.pak
- 2. Create Lists of expected assets in the level.pak
- 3. Add lists of expected assets to a single list
- 4. Compare list of expected assets to actual assets
- """
- helper = bundler_batch_helper
-
- # Create the asset list file
- helper.call_assetLists(
- addSeed=r"levels\testdependencieslevel\level.pak",
- assetListFile=helper['asset_info_file_request']
- )
-
- assert os.path.isfile(helper["asset_info_file_result"])
-
- # Lists of known relative locations of assets
- default_level_assets = [
- "engineassets/texturemsg/defaultnouvs.dds",
- "engineassets/texturemsg/defaultnouvs.dds.1",
- "engineassets/texturemsg/defaultnouvs.dds.2",
- "engineassets/texturemsg/defaultnouvs.dds.3",
- "engineassets/texturemsg/defaultnouvs.dds.4",
- "engineassets/texturemsg/defaultnouvs.dds.5",
- "engineassets/texturemsg/defaultnouvs.dds.6",
- "engineassets/texturemsg/defaultnouvs.dds.7",
- "engineassets/texturemsg/defaultnouvs_ddn.dds",
- "engineassets/texturemsg/defaultnouvs_ddn.dds.1",
- "engineassets/texturemsg/defaultnouvs_ddn.dds.2",
- "engineassets/texturemsg/defaultnouvs_ddn.dds.3",
- "engineassets/texturemsg/defaultnouvs_ddn.dds.4",
- "engineassets/texturemsg/defaultnouvs_ddn.dds.5",
- "engineassets/texturemsg/defaultnouvs_spec.dds",
- "engineassets/texturemsg/defaultnouvs_spec.dds.1",
- "engineassets/texturemsg/defaultnouvs_spec.dds.2",
- "engineassets/texturemsg/defaultnouvs_spec.dds.3",
- "engineassets/texturemsg/defaultnouvs_spec.dds.4",
- "engineassets/texturemsg/defaultnouvs_spec.dds.5",
- "engineassets/textures/defaults/16_grey.dds",
- "engineassets/textures/cubemap/default_level_cubemap.dds",
- "engineassets/textures/cubemap/default_level_cubemap.dds.1",
- "engineassets/textures/cubemap/default_level_cubemap.dds.2",
- "engineassets/textures/cubemap/default_level_cubemap.dds.3",
- "engineassets/textures/cubemap/default_level_cubemap.dds.4",
- "engineassets/textures/cubemap/default_level_cubemap_diff.dds",
- "engineassets/materials/water/ocean_default.mtl",
- "engineassets/textures/defaults/spot_default.dds",
- "engineassets/textures/defaults/spot_default.dds.1",
- "engineassets/textures/defaults/spot_default.dds.2",
- "engineassets/textures/defaults/spot_default.dds.3",
- "engineassets/textures/defaults/spot_default.dds.4",
- "engineassets/textures/defaults/spot_default.dds.5",
- "materials/material_terrain_default.mtl",
- "textures/skys/night/half_moon.dds",
- "textures/skys/night/half_moon.dds.1",
- "textures/skys/night/half_moon.dds.2",
- "textures/skys/night/half_moon.dds.3",
- "textures/skys/night/half_moon.dds.4",
- "textures/skys/night/half_moon.dds.5",
- "textures/skys/night/half_moon.dds.6",
- "engineassets/materials/sky/sky.mtl",
- "levels/testdependencieslevel/level.pak",
- "levels/testdependencieslevel/terrain/cover.ctc",
- "levels/testdependencieslevel/terraintexture.pak",
- ]
-
- sequence_material_cube_assets = [
- "textures/test_texture_sequence/test_texture_sequence000.dds",
- "textures/test_texture_sequence/test_texture_sequence001.dds",
- "textures/test_texture_sequence/test_texture_sequence002.dds",
- "textures/test_texture_sequence/test_texture_sequence003.dds",
- "textures/test_texture_sequence/test_texture_sequence004.dds",
- "textures/test_texture_sequence/test_texture_sequence005.dds",
- "objects/_primitives/_box_1x1.cgf",
- "materials/test_texture_sequence.mtl",
- "objects/_primitives/_box_1x1.mtl",
- "textures/_primitives/middle_gray_checker.dds",
- "textures/_primitives/middle_gray_checker.dds.1",
- "textures/_primitives/middle_gray_checker.dds.2",
- "textures/_primitives/middle_gray_checker.dds.3",
- "textures/_primitives/middle_gray_checker.dds.4",
- "textures/_primitives/middle_gray_checker.dds.5",
- "textures/_primitives/middle_gray_checker_ddn.dds",
- "textures/_primitives/middle_gray_checker_ddn.dds.1",
- "textures/_primitives/middle_gray_checker_ddn.dds.2",
- "textures/_primitives/middle_gray_checker_ddn.dds.3",
- "textures/_primitives/middle_gray_checker_ddn.dds.4",
- "textures/_primitives/middle_gray_checker_ddn.dds.5",
- "textures/_primitives/middle_gray_checker_spec.dds",
- "textures/_primitives/middle_gray_checker_spec.dds.1",
- "textures/_primitives/middle_gray_checker_spec.dds.2",
- "textures/_primitives/middle_gray_checker_spec.dds.3",
- "textures/_primitives/middle_gray_checker_spec.dds.4",
- "textures/_primitives/middle_gray_checker_spec.dds.5",
- ]
-
- character_with_simplified_material_assets = [
- "objects/characters/jack/jack.actor",
- "objects/characters/jack/jack.mtl",
- "objects/characters/jack/textures/jack_diff.dds",
- "objects/characters/jack/textures/jack_diff.dds.1",
- "objects/characters/jack/textures/jack_diff.dds.2",
- "objects/characters/jack/textures/jack_diff.dds.3",
- "objects/characters/jack/textures/jack_diff.dds.4",
- "objects/characters/jack/textures/jack_diff.dds.5",
- "objects/characters/jack/textures/jack_diff.dds.6",
- "objects/characters/jack/textures/jack_diff.dds.7",
- "objects/characters/jack/textures/jack_spec.dds",
- "objects/characters/jack/textures/jack_spec.dds.1",
- "objects/characters/jack/textures/jack_spec.dds.2",
- "objects/characters/jack/textures/jack_spec.dds.3",
- "objects/characters/jack/textures/jack_spec.dds.4",
- "objects/characters/jack/textures/jack_spec.dds.5",
- "objects/characters/jack/textures/jack_spec.dds.6",
- "objects/characters/jack/textures/jack_spec.dds.7",
- "objects/default/editorprimitive.mtl",
- "engineassets/textures/grey.dds",
- "animations/animationeditorfiles/sample0.animgraph",
- "animations/motions/jack_death_fall_back_zup.motion",
- "animations/animationeditorfiles/sample1.animgraph",
- "animations/animationeditorfiles/sample0.motionset",
- "animations/motions/rin_jump.motion",
- "animations/animationeditorfiles/sample1.motionset",
- "animations/motions/rin_idle.motion",
- "animations/motions/jack_idle_aim_zup.motion",
- ]
-
- spawner_assets = [
- "slices/sphere.dynamicslice",
- "objects/default/primitive_sphere.cgf",
- "test1.luac",
- "test2.luac",
- ]
-
- ui_canvas_assets = [
- "fonts/vera.ttf",
- "fonts/vera.font",
- "scriptcanvas/mainmenu.scriptcanvas_compiled",
- "fonts/vera.fontfamily",
- "ui/canvas/start.uicanvas",
- "fonts/vera-italic.font",
- "ui/textureatlas/sample.texatlasidx",
- "fonts/vera-bold-italic.ttf",
- "fonts/vera-bold.font",
- "ui/textures/prefab/button_normal.dds",
- "ui/textures/prefab/button_normal.sprite",
- "fonts/vera-italic.ttf",
- "ui/textureatlas/sample.dds",
- "fonts/vera-bold-italic.font",
- "fonts/vera-bold.ttf",
- "ui/textures/prefab/button_disabled.dds",
- "ui/textures/prefab/button_disabled.sprite",
- ]
-
- wwise_and_atl_assets = [
- "libs/gameaudio/wwise/levels/testdependencieslevel/test_dependencies_level.xml",
- "sounds/wwise/test_bank3.bnk",
- "sounds/wwise/test_bank4.bnk",
- "sounds/wwise/test_bank5.bnk",
- "sounds/wwise/test_bank1.bnk",
- "sounds/wwise/init.bnk",
- "sounds/wwise/499820003.wem",
- "sounds/wwise/196049145.wem",
- ]
-
- particle_library_assets = [
- "libs/particles/milestone2particles.xml",
- "textures/milestone2/particles/fx_launchermuzzlering_01.dds",
- "textures/milestone2/particles/fx_launchermuzzlering_01.dds.1",
- "textures/milestone2/particles/fx_launchermuzzlering_01.dds.2",
- "textures/milestone2/particles/fx_launchermuzzlering_01.dds.3",
- "textures/milestone2/particles/fx_launchermuzzlering_01.dds.4",
- "textures/milestone2/particles/fx_launchermuzzlering_01.dds.5",
- "textures/milestone2/particles/fx_sparkstreak_01.dds",
- "textures/milestone2/particles/fx_launchermuzzlefront_01.dds",
- "textures/milestone2/particles/fx_launchermuzzlefront_01.dds.1",
- "textures/milestone2/particles/fx_launchermuzzlefront_01.dds.2",
- "textures/milestone2/particles/fx_launchermuzzlefront_01.dds.3",
- "textures/milestone2/particles/fx_launchermuzzlefront_01.dds.4",
- "textures/milestone2/particles/fx_launchermuzzlefront_01.dds.5",
- ]
-
- lens_flares_library_assets = ["libs/flares/flares.xml", "textures/lights/flare01.dds"]
-
- expected_assets_list = default_level_assets
- expected_assets_list.extend(sequence_material_cube_assets)
- expected_assets_list.extend(character_with_simplified_material_assets)
- expected_assets_list.extend(spawner_assets)
- expected_assets_list.extend(ui_canvas_assets)
- expected_assets_list.extend(wwise_and_atl_assets)
- expected_assets_list.extend(particle_library_assets)
- expected_assets_list.extend(lens_flares_library_assets) # All expected assets
-
- # Get actual calculated dependencies from the asset list created
- actual_assets_list = []
- for rel_path in helper.get_asset_relative_paths(helper["asset_info_file_result"]):
- actual_assets_list.append(rel_path)
-
- assert sorted(actual_assets_list) == sorted(expected_assets_list)
@pytest.mark.BAT
@pytest.mark.assetpipeline
@@ -310,9 +102,9 @@ class TestsAssetBundlerBatch_WindowsAndMac(object):
3. Read and store contents of asset list into memory
4. Attempt to create a new asset list in without using --allowOverwrites
5. Verify that Asset Bundler returns false
- 6. Verify that file contents of the orignally created asset list did not change from what was stored in memory
+ 6. Verify that file contents of the originally created asset list did not change from what was stored in memory
7. Attempt to create a new asset list without debug while allowing overwrites
- 8. Verify that file contents of the orignally created asset list changed from what was stored in memory
+ 8. Verify that file contents of the originally created asset list changed from what was stored in memory
"""
helper = bundler_batch_helper
seed_list = os.path.join(workspace.paths.engine_root(), "Assets", "Engine", "SeedAssetList.seed") # Engine seed list
@@ -919,7 +711,7 @@ class TestsAssetBundlerBatch_WindowsAndMac(object):
# Extra arguments for pattern comparison
cmd.extend([f"--filePatternType={pattern_type}", f"--filePattern={pattern}"])
if workspace.project:
- cmd.append(f'--project-path={project_name}')
+ cmd.append(f'--project-path={workspace.paths.project()}')
return cmd
# End generate_compare_command()
@@ -960,7 +752,7 @@ class TestsAssetBundlerBatch_WindowsAndMac(object):
output_mac_asset_list = helper.platform_file_name(last_output_arg, platform)
# Build execution command
- cmd = generate_compare_command(platform_arg, workspace.project)
+ cmd = generate_compare_command(platform_arg, workspace.paths.project())
# Execute command
subprocess.check_call(cmd)
@@ -995,7 +787,7 @@ class TestsAssetBundlerBatch_WindowsAndMac(object):
f"--comparisonRulesFile={rule_file}",
f"--comparisonType={args[1]}",
r"--addComparison",
- f"--project-path={workspace.project}",
+ f"--project-path={workspace.paths.project()}",
]
if args[1] == "4":
# If pattern comparison, append a few extra arguments
@@ -1117,7 +909,7 @@ class TestsAssetBundlerBatch_WindowsAndMac(object):
"--addDefaultSeedListFiles",
"--platform=pc",
"--print",
- f"--project-path={workspace.project}"
+ f"--project-path={workspace.paths.project()}"
],
universal_newlines=True,
)
@@ -1189,7 +981,7 @@ class TestsAssetBundlerBatch_WindowsAndMac(object):
# Make sure file gets deleted on teardown
request.addfinalizer(lambda: fs.delete([bundle_result_path], True, False))
- bundles_folder = os.path.join(workspace.paths.engine_root(), workspace.project, "Bundles")
+ bundles_folder = os.path.join(workspace.paths.project(), "Bundles")
level_pak = r"levels\testdependencieslevel\level.pak"
bundle_request_path = os.path.join(bundles_folder, "bundle.pak")
bundle_result_path = os.path.join(bundles_folder,
@@ -1243,23 +1035,64 @@ class TestsAssetBundlerBatch_WindowsAndMac(object):
2. Verify file was created
3. Verify that only the expected assets are present in the created asset list
"""
- expected_assets = [
+ expected_assets = sorted([
"ui/canvases/lyshineexamples/animation/multiplesequences.uicanvas",
- "ui/textures/prefab/button_normal.sprite"
- ]
+ "ui/textures/prefab/button_disabled.tif.streamingimage",
+ "ui/textures/prefab/tooltip_sliced.tif.streamingimage",
+ "ui/textures/prefab/button_normal.tif.streamingimage"
+ ])
+ # Printing these lists out can save a step in debugging if this test fails on Jenkins.
+ logger.info(f"expected_assets: {expected_assets}")
+
+ skip_assets = sorted([
+ "ui/scripts/lyshineexamples/animation/multiplesequences.luac",
+ "ui/scripts/lyshineexamples/unloadthiscanvasbutton.luac",
+ "fonts/vera.fontfamily",
+ "fonts/vera-italic.font",
+ "fonts/vera.font",
+ "fonts/vera-bold.font",
+ "fonts/vera-bold-italic.font",
+ "fonts/vera-italic.ttf",
+ "fonts/vera.ttf",
+ "fonts/vera-bold.ttf",
+ "fonts/vera-bold-italic.ttf"
+ ])
+ logger.info(f"skip_assets: {skip_assets}")
+
+ expected_and_skip_assets = sorted(expected_assets + skip_assets)
+ # Printing both together to make it quick to compare the results in the logs for a test failure on Jenkins
+ logger.info(f"expected_and_skip_assets: {expected_and_skip_assets}")
+
+ # First, generate an asset info file without skipping, to get a list that can be used as a baseline to verify
+ # the files were actually skipped, and not just missing.
+ bundler_batch_helper.call_assetLists(
+ assetListFile=bundler_batch_helper['asset_info_file_request'],
+ addSeed="ui/canvases/lyshineexamples/animation/multiplesequences.uicanvas"
+ )
+ assert os.path.isfile(bundler_batch_helper["asset_info_file_result"])
+ assets_in_no_skip_list = []
+ for rel_path in bundler_batch_helper.get_asset_relative_paths(bundler_batch_helper["asset_info_file_result"]):
+ assets_in_no_skip_list.append(rel_path)
+ assets_in_no_skip_list = sorted(assets_in_no_skip_list)
+ logger.info(f"assets_in_no_skip_list: {assets_in_no_skip_list}")
+ assert assets_in_no_skip_list == expected_and_skip_assets
+
+ # Now generate an asset info file using the skip command, and verify the skip files are not in the list.
bundler_batch_helper.call_assetLists(
assetListFile=bundler_batch_helper['asset_info_file_request'],
addSeed="ui/canvases/lyshineexamples/animation/multiplesequences.uicanvas",
- skip="ui/textures/prefab/button_disabled.sprite,ui/scripts/lyshineexamples/animation/multiplesequences.luac,"
- "ui/textures/prefab/tooltip_sliced.sprite,ui/scripts/lyshineexamples/unloadthiscanvasbutton.luac,fonts/vera.fontfamily,fonts/vera-italic.font,"
- "fonts/vera.font,fonts/vera-bold.font,fonts/vera-bold-italic.font,fonts/vera-italic.ttf,fonts/vera.ttf,fonts/vera-bold.ttf,fonts/vera-bold-italic.ttf"
+ allowOverwrites="",
+ skip=','.join(skip_assets)
)
+
assert os.path.isfile(bundler_batch_helper["asset_info_file_result"])
assets_in_list = []
for rel_path in bundler_batch_helper.get_asset_relative_paths(bundler_batch_helper["asset_info_file_result"]):
assets_in_list.append(rel_path)
+ assets_in_list = sorted(assets_in_list)
+ logger.info(f"assets_in_list: {assets_in_list}")
+ assert assets_in_list == expected_assets
- assert sorted(assets_in_list) == sorted(expected_assets)
@pytest.mark.BAT
@pytest.mark.assetpipeline
diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/bundle_mode_in_editor_tests.py b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/bundle_mode_in_editor_tests.py
new file mode 100644
index 0000000000..33a55d6601
--- /dev/null
+++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/bundle_mode_in_editor_tests.py
@@ -0,0 +1,20 @@
+"""
+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
+"""
+import azlmbr.bus
+import azlmbr.editor
+import azlmbr.legacy.general
+import sys
+
+# Print out the passed in bundle_path, so the outer test can verify this was sent in correctly
+bundle_path = sys.argv[1]
+print('Bundle mode test running with path {}'.format(sys.argv[1]))
+
+# Turn on bundle mode. This will trigger some printouts that the outer test logic will validate.
+azlmbr.legacy.general.set_cvar_integer("sys_report_files_not_found_in_paks", 1)
+azlmbr.legacy.general.run_console(f"loadbundles {bundle_path}")
+
+azlmbr.editor.EditorToolsApplicationRequestBus(azlmbr.bus.Broadcast, 'ExitNoPrompt')
diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/bundle_mode_tests.py b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/bundle_mode_tests.py
new file mode 100644
index 0000000000..af92bb1773
--- /dev/null
+++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/bundle_mode_tests.py
@@ -0,0 +1,93 @@
+"""
+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
+"""
+
+import os
+import pytest
+import logging
+import sys
+import time
+pytest.importorskip('ly_test_tools')
+
+import ly_test_tools.environment.file_system as fs
+import ly_test_tools.environment.waiter as waiter
+import ly_test_tools.log.log_monitor
+
+from ..ap_fixtures.asset_processor_fixture import asset_processor as asset_processor
+from ..ap_fixtures.bundler_batch_setup_fixture import bundler_batch_setup_fixture as bundler_batch_helper
+from ..ap_fixtures.timeout_option_fixture import timeout_option_fixture as timeout
+
+@pytest.mark.SUITE_periodic
+@pytest.mark.parametrize('launcher_platform', ['windows_editor'])
+@pytest.mark.parametrize('project', ['AutomatedTesting'])
+@pytest.mark.parametrize('level', ['auto_test'])
+class TestBundleMode(object):
+ def test_bundle_mode_with_levels_mounts_bundles_correctly(self, request, editor, level, launcher_platform,
+ asset_processor, workspace, bundler_batch_helper):
+ level_pak = os.path.join("levels", level, "level.pak")
+
+ bundles_folder = os.path.join(workspace.paths.project(), "Bundles")
+ bundle_request_path = os.path.join(bundles_folder, "bundle.pak")
+ bundle_result_path = os.path.join(bundles_folder,
+ bundler_batch_helper.platform_file_name(
+ "bundle.pak", workspace.asset_processor_platform))
+
+ # Create target 'Bundles' folder if it doesn't exist
+ if not os.path.exists(bundles_folder):
+ os.mkdir(bundles_folder)
+ # Delete target bundle file if it already exists
+ if os.path.exists(bundle_result_path):
+ fs.delete([bundle_result_path], True, False)
+
+ # Make asset list file to use in the bundle
+ bundler_batch_helper.call_assetLists(
+ addSeed=level_pak,
+ assetListFile=bundler_batch_helper["asset_info_file_request"],
+ )
+
+ # Make bundle in /Bundles
+ bundler_batch_helper.call_bundles(
+ assetListFile=bundler_batch_helper["asset_info_file_result"],
+ outputBundlePath=bundle_request_path,
+ maxSize="2048",
+ )
+
+ # Ensure the bundle was created
+ assert os.path.exists(bundle_result_path), f"Bundle was not created at location: {bundle_result_path}"
+
+ # The editor flips the slash direction in some of the printouts
+ bundle_result_path_editor_separator = bundle_result_path.replace('\\', '/')
+
+ expected_lines = [
+ # A beginning of test printout can help debug where failures occur, if this line is missing
+ # then the Editor didn't launch, didn't run the Python test, or didn't pass in the right parameter
+ f'Bundle mode test running with path {bundles_folder}',
+ # These printouts happen in response to the loadbundles call, and verify this bundle is actually loaded
+ f"[CONSOLE] Executing console command 'loadbundles {bundles_folder}'",
+ f'(BundlingSystem) - Loading bundles from {bundles_folder} of type .pak',
+ f'(Archive) - Opening archive file {bundle_result_path_editor_separator}',
+ ]
+ unexpected_lines = []
+
+ timeout = 180
+ halt_on_unexpected = False
+ test_directory = os.path.join(os.path.dirname(__file__))
+ test_file = os.path.join(test_directory, 'bundle_mode_in_editor_tests.py')
+ editor.args.extend(['-NullRenderer', '-rhi=Null', "--skipWelcomeScreenDialog",
+ "--autotest_mode", "--runpythontest", test_file, "--runpythonargs", bundles_folder])
+
+ with editor.start(launch_ap=True):
+ editor_log_file = os.path.join(editor.workspace.paths.project_log(), 'Editor.log')
+ log_monitor = ly_test_tools.log.log_monitor.LogMonitor(editor, editor_log_file)
+ waiter.wait_for(
+ lambda: editor.is_alive(),
+ timeout,
+ exc=("Log file '{}' was never opened by another process.".format(editor_log_file)),
+ interval=1)
+ log_monitor.monitor_log_for_lines(expected_lines, unexpected_lines, halt_on_unexpected, timeout)
+
+ # Delete the bundle created and used in this test
+ fs.delete([bundle_result_path], True, False)
diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/missing_dependency_tests.py b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/missing_dependency_tests.py
index 7159b2e83f..52321fceea 100755
--- a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/missing_dependency_tests.py
+++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/missing_dependency_tests.py
@@ -120,31 +120,29 @@ class TestsMissingDependencies_WindowsAndMac(object):
# Relative path to the txt file with missing dependencies
expected_product = f"testassets\\validuuidsnotdependency.txt"
- self._asset_processor.add_source_folder_assets(f"{self._workspace.project}\\Objects\\LumberTank")
- self._asset_processor.add_source_folder_assets(f"{self._workspace.project}\\Objects\\Characters\\Jack")
# Expected missing dependencies
expected_dependencies = [
# String Asset #
- ('1CB10C43F3245B93A294C602ADEF95F9:[0', '{1CB10C43-F324-5B93-A294-C602ADEF95F9}:0'),
+ # InvalidAssetIdNoReport.txt
+ ('E68A85B0-131D-5A82-B2D5-BC58EE4062AE', '{E68A85B0-131D-5A82-B2D5-BC58EE4062AE}:0'),
+ # InvalidRelativePathsNoReport.txt
+ ('B3EF12DD306C520EB0A8A6B0D031A195', '{B3EF12DD-306C-520E-B0A8-A6B0D031A195}:0'),
+ # SelfReferenceUUID.txt
('33bcee02F3225688ABEE534F6058593F', '{33BCEE02-F322-5688-ABEE-534F6058593F}:0'),
- ('345E5C660D6254FF8D0F7C8EE66A2249', '{345E5C66-0D62-54FF-8D0F-7C8EE66A2249}:3e8'),
- ('345E5C660D6254FF8D0F7C8EE66A2249', '{345E5C66-0D62-54FF-8D0F-7C8EE66A2249}:3ea'),
- ('345E5C660D6254FF8D0F7C8EE66A2249', '{345E5C66-0D62-54FF-8D0F-7C8EE66A2249}:3eb'),
- ('37108522F50459499CD6C8D47A960CF1', '{37108522-F504-5949-9CD6-C8D47A960CF1}:3e8'),
- ('37108522F50459499CD6C8D47A960CF1', '{37108522-F504-5949-9CD6-C8D47A960CF1}:3ea'),
- ('37108522F50459499CD6C8D47A960CF1', '{37108522-F504-5949-9CD6-C8D47A960CF1}:3eb'),
- ('6BDE282B49C957F7B0714B26579BCA9A', '{6BDE282B-49C9-57F7-B071-4B26579BCA9A}:0'),
- ('747D31D71E62553592226173C49CF97E', '{747D31D7-1E62-5535-9222-6173C49CF97E}:1'),
- ('747D31D71E62553592226173C49CF97E', '{747D31D7-1E62-5535-9222-6173C49CF97E}:2'),
- ('A26C73D1837E5AE59E68F916FA7C3699', '{A26C73D1-837E-5AE5-9E68-F916FA7C3699}:3e8'),
- ('A26C73D1837E5AE59E68F916FA7C3699', '{A26C73D1-837E-5AE5-9E68-F916FA7C3699}:3ea'),
- ('A26C73D1837E5AE59E68F916FA7C3699', '{A26C73D1-837E-5AE5-9E68-F916FA7C3699}:3eb'),
- ('B076CDDC-14DF-50F4-A5E9-7518ABB3E851', '{B076CDDC-14DF-50F4-A5E9-7518ABB3E851}:0'),
- ('C67BEA9F-09FF-59AA-A7F0-A52B8F987508', '{C67BEA9F-09FF-59AA-A7F0-A52B8F987508}:3e8'),
- ('C67BEA9F-09FF-59AA-A7F0-A52B8F987508', '{C67BEA9F-09FF-59AA-A7F0-A52B8F987508}:3ea'),
- ('C67BEA9F-09FF-59AA-A7F0-A52B8F987508', '{C67BEA9F-09FF-59AA-A7F0-A52B8F987508}:3eb'),
- ('C67BEA9F-09FF-59AA-A7F0-A52B8F987508', '{C67BEA9F-09FF-59AA-A7F0-A52B8F987508}:3ec'),
- ('D92C4661C8985E19BD3597CB2318CFA6:[0', '{D92C4661-C898-5E19-BD35-97CB2318CFA6}:0'),
+ # SelfReferencePath.txt
+ ('DD587FBE-16C8-5B98-AE3C-A9F8750B2692', '{DD587FBE-16C8-5B98-AE3C-A9F8750B2692}:0'),
+ # InvalidUUIDNoReport.txt
+ ('837412DF-D05F-576D-81AA-ACF360463749', '{837412DF-D05F-576D-81AA-ACF360463749}:0'),
+ # MaxIteration31Deep.txt
+ ('3F642A0FDC825696A70A1DA5709744DF', '{3F642A0F-DC82-5696-A70A-1DA5709744DF}:0'),
+ # OnlyMatchesCorrectLengthUUIDs.txt
+ ('2545AD8B-1B9B-5F93-859D-D8DC1DC2B480', '{2545AD8B-1B9B-5F93-859D-D8DC1DC2B480}:0'),
+ # WildcardScanTest1.txt
+ ('1CB10C43F3245B93A294C602ADEF95F9:[0', '{1CB10C43-F324-5B93-A294-C602ADEF95F9}:0'),
+ # RelativeProductPathsNotDependencies.txt
+ ('B772953CA08A5D209491530E87D11504:[0', '{B772953C-A08A-5D20-9491-530E87D11504}:0'),
+ # WildcardScanTest2.txt
+ ('D92C4661C8985E19BD3597CB2318CFA6', '{D92C4661-C898-5E19-BD35-97CB2318CFA6}:0'),
]
self.do_missing_dependency_test(expected_product, expected_dependencies,
"%ValidUUIDsNotDependency.txt")
@@ -187,8 +185,11 @@ class TestsMissingDependencies_WindowsAndMac(object):
# Expected missing dependencies
expected_dependencies = [
# String Asset #
- ('2ef92b8D044E5C278E2BB1AC0374A4E7:1003', '{2EF92B8D-044E-5C27-8E2B-B1AC0374A4E7}:3eb'),
+ # _dev_Red.tif
+ ('2ef92b8D044E5C278E2BB1AC0374A4E7:1000', '{2EF92B8D-044E-5C27-8E2B-B1AC0374A4E7}:3e8'),
+ # _dev_Purple.tif
('A2482826-053D-5634-A27B-084B1326AAE5}:[1002', '{A2482826-053D-5634-A27B-084B1326AAE5}:3ea'),
+ # _dev_White.tif
('D83B36F1-61A6-5001-B191-4D0CE282E236}-1002', '{D83B36F1-61A6-5001-B191-4D0CE282E236}:3ea'),
]
@@ -237,11 +238,10 @@ class TestsMissingDependencies_WindowsAndMac(object):
expected_dependencies = [
# String Asset #
('TestAssets\\WildcardScanTest1.txt', '{1CB10C43-F324-5B93-A294-C602ADEF95F9}:0'),
- ('libs/particles/milestone2PARTICLES.XML', '{6BDE282B-49C9-57F7-B071-4B26579BCA9A}:0'),
+ ('TESTASSETS/ReportONEmISSINGdEPENDENCY.tXT', '{BE5E2373-245E-59E4-B4C6-7370EEAA2EFD}:0'),
('textures/_dev_Purple.tif', '{A2482826-053D-5634-A27B-084B1326AAE5}:3e8'),
('textures/_dev_Purple.tif', '{A2482826-053D-5634-A27B-084B1326AAE5}:3ea'),
- ('textures/_dev_Purple.tif', '{A2482826-053D-5634-A27B-084B1326AAE5}:3eb'),
- ('project.json', '{B076CDDC-14DF-50F4-A5E9-7518ABB3E851}:0'),
+ ('TestAssets/InvalidAssetIdNoReport.txt', '{E68A85B0-131D-5A82-B2D5-BC58EE4062AE}:0'),
('TestAssets/RelativeProductPathsNotDependencies.txt', '{B772953C-A08A-5D20-9491-530E87D11504}:0'),
]
@@ -282,29 +282,31 @@ class TestsMissingDependencies_WindowsAndMac(object):
2. Set the expected missing dependencies
3. Execute test
"""
-
- self._asset_processor.add_source_folder_assets(f"Gems\\LyShineExamples\\Assets\\UI\\Fonts\\LyShineExamples")
- self._asset_processor.add_scan_folder(f"Gems\\LyShineExamples\\Assets")
# Relative path to the txt file with missing dependencies as product paths
expected_product = f"testassets\\relativeproductpathsnotdependencies.txt"
expected_dependencies = [
# String Asset #
- ('materials/floor_tile.mtl', '{0EFF5E4A-F544-5D87-8696-6DDFA62D6063}:0'),
- ('materials/am_grass1.mtl', '{1151F14D-38A6-5579-888A-BE3139882E68}:0'),
- ('2ef92b8D044E5C278E2BB1AC0374A4E7:1002', '{2EF92B8D-044E-5C27-8E2B-B1AC0374A4E7}:3ea'),
- ('textures/milestone2/ama_grey_02.tif.streamingimage', '{3EE80AAD-EB9C-56BD-9E9C-65410578998C}:3e8'),
- ('ui/milestone2menu.uicanvas', '{445D9AF3-6CA5-5281-82A9-5C570BCD1DB8}:0'),
- ('libs/particles/milestone2particles.xml', '{6BDE282B-49C9-57F7-B071-4B26579BCA9A}:0'),
- ('textures/_dev_yellow_light.tif.1002.imagemipchain', '{6C40868F-3FC1-5115-96EA-DD0A9E33DEE4}:3ea'),
- ('textures\\\\_dev_tan.tif.streamingimage', '{8F2BCEF5-C8CE-5B80-8103-8C1D694D012C}:3e8'),
- ('materials/am_rockground.mtl', '{A1DA3D05-A020-5BB5-A608-C4812B7BD733}:0'),
('textures/_dev_purple.tif.streamingimage', '{A2482826-053D-5634-A27B-084B1326AAE5}:3e8'),
- ('A2482826-053D-5634-A27B-084B1326AAE5}:[1002', '{A2482826-053D-5634-A27B-084B1326AAE5}:3ea'),
- ('project.json', '{B076CDDC-14DF-50F4-A5E9-7518ABB3E851}:0'),
- ('CEAA362B4E505BCEB827CB92EF40A50E', '{CEAA362B-4E50-5BCE-B827-CB92EF40A50E}:1'),
- ('CEAA362B4E505BCEB827CB92EF40A50E', '{CEAA362B-4E50-5BCE-B827-CB92EF40A50E}:2'),
+ ('textures\\_dev_stucco.tif.streamingimage', '{70114D85-D712-5AEB-A816-8FE3A37087AF}:3e8'),
+ ('textures\\\\_dev_tan.tif.streamingimage', '{8F2BCEF5-C8CE-5B80-8103-8C1D694D012C}:3e8'),
('TEXTURES/_DEV_WHITE.tif.streamingimage', '{D83B36F1-61A6-5001-B191-4D0CE282E236}:3e8'),
+ ('textures/_dev_yellow_light.tif.1002.imagemipchain', '{6C40868F-3FC1-5115-96EA-DD0A9E33DEE4}:3ea'),
+ ('textures/_dev_woodland.tif.1002.imagemipchain', '{F3DD193C-5845-569C-A974-AA338B30CF86}:3ea'),
('textures/_dev_woodland.tif.streamingimage', '{F3DD193C-5845-569C-A974-AA338B30CF86}:3e8'),
+ ('textures/_dev_yellow_light.tif.streamingimage', '{6C40868F-3FC1-5115-96EA-DD0A9E33DEE4}:3e8'),
+ ('textures/_dev_yellow_med.tif.1002.imagemipchain', '{BB4DFF57-52BD-525B-9628-68232E31802C}:3ea'),
+ ('textures/lights/flare01.tif.streamingimage', '{D8E49CC4-C743-5F31-A1EC-4AA89163B8F5}:3e8'),
+ # SelfReferenceUUID.txt
+ ('33BCEE02-F322-5688-ABEE-534F6058593F', '{33BCEE02-F322-5688-ABEE-534F6058593F}:0'),
+ ('textures/test_texture_sequence/test_texture_sequence000.png.streamingimage', '{6CC90BEE-0A9F-57A8-9013-7C1D643C0E8E}:3e8'),
+ # _dev_red.tif.streamingimage
+ ('2ef92b8D044E5C278E2BB1AC0374A4E7:1002', '{2EF92B8D-044E-5C27-8E2B-B1AC0374A4E7}:3ea'),
+ # SelfReferenceAssetID.txt
+ ('785A05D2-483E-5B43-A2B9-92ACDAE6E938', '{785A05D2-483E-5B43-A2B9-92ACDAE6E938}:0'),
+ ('textures/test_texture_sequence/test_texture_sequence001.png.streamingimage', '{8A8A37DD-01B9-5D70-92E4-925E2C0FE826}:3e8'),
+ # _dev_purple.tif.1002.imagemipchain
+ ('A2482826-053D-5634-A27B-084B1326AAE5}:[1002', '{A2482826-053D-5634-A27B-084B1326AAE5}:3ea'),
+ ('textures/_dev_purple_glass.tif.1002.imagemipchain', '{2FCDD831-77D1-5BE1-A4C8-CA47E4F89F19}:3ea'),
]
self.do_missing_dependency_test(expected_product, expected_dependencies,
diff --git a/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/base.py b/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/base.py
index cbb6102a44..4543888a7c 100755
--- a/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/base.py
+++ b/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/base.py
@@ -52,7 +52,7 @@ class TestAutomationBase:
cls._kill_ly_processes()
def _run_test(self, request, workspace, editor, testcase_module, extra_cmdline_args=[], batch_mode=True,
- autotest_mode=True, use_null_renderer=True):
+ autotest_mode=True, use_null_renderer=True, enable_prefab_system=True):
test_starttime = time.time()
self.logger = logging.getLogger(__name__)
errors = []
@@ -97,6 +97,11 @@ class TestAutomationBase:
pycmd += ["-BatchMode"]
if autotest_mode:
pycmd += ["-autotest_mode"]
+ if enable_prefab_system:
+ pycmd += ["--regset=/Amazon/Preferences/EnablePrefabSystem=true"]
+ else:
+ pycmd += ["--regset=/Amazon/Preferences/EnablePrefabSystem=false"]
+
pycmd += extra_cmdline_args
editor.args.extend(pycmd) # args are added to the WinLauncher start command
editor.start(backupFiles = False, launch_ap = False)
@@ -165,7 +170,7 @@ class TestAutomationBase:
for line in f.readlines():
error_str += f"|{log_basename}| {line}"
except Exception as ex:
- error_str += "-- No log available --"
+ error_str += f"-- No log available ({ex})--"
pytest.fail(error_str)
diff --git a/AutomatedTesting/Gem/PythonTests/editor/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/editor/CMakeLists.txt
index bf42579970..1fc71da972 100644
--- a/AutomatedTesting/Gem/PythonTests/editor/CMakeLists.txt
+++ b/AutomatedTesting/Gem/PythonTests/editor/CMakeLists.txt
@@ -7,60 +7,6 @@
#
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_FOUNDATION_TEST_SUPPORTED)
- ly_add_pytest(
- NAME AutomatedTesting::EditorTests_Main
- TEST_SUITE main
- TEST_SERIAL
- PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Main.py
- PYTEST_MARKS "not REQUIRES_gpu"
- RUNTIME_DEPENDENCIES
- Legacy::Editor
- AZ::AssetProcessor
- AutomatedTesting.Assets
- COMPONENT
- Editor
- )
-
- ly_add_pytest(
- NAME AutomatedTesting::EditorTests_Main_GPU
- TEST_SUITE main
- TEST_SERIAL
- TEST_REQUIRES gpu
- PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Main.py
- PYTEST_MARKS "REQUIRES_gpu"
- RUNTIME_DEPENDENCIES
- Legacy::Editor
- AZ::AssetProcessor
- AutomatedTesting.Assets
- COMPONENT
- Editor
- )
-
- ly_add_pytest(
- NAME AutomatedTesting::EditorTests_Periodic
- TEST_SUITE periodic
- TEST_SERIAL
- PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Periodic.py
- RUNTIME_DEPENDENCIES
- Legacy::Editor
- AZ::AssetProcessor
- AutomatedTesting.Assets
- COMPONENT
- Editor
- )
-
- ly_add_pytest(
- NAME AutomatedTesting::EditorTests_Sandbox
- TEST_SUITE sandbox
- TEST_SERIAL
- PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Sandbox.py
- RUNTIME_DEPENDENCIES
- Legacy::Editor
- AZ::AssetProcessor
- AutomatedTesting.Assets
- COMPONENT
- Editor
- )
ly_add_pytest(
NAME AutomatedTesting::EditorTests_Main_Optimized
diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetBrowser_SearchFiltering.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetBrowser_SearchFiltering.py
index 33c48c7a77..7366faafdc 100644
--- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetBrowser_SearchFiltering.py
+++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetBrowser_SearchFiltering.py
@@ -62,7 +62,7 @@ def AssetBrowser_SearchFiltering():
from editor_python_test_tools.utils import Report
from editor_python_test_tools.utils import TestHelper as helper
- def verify_files_appeared(model, allowed_asset_extentions, parent_index=QtCore.QModelIndex()):
+ def verify_files_appeared(model, allowed_asset_extensions, parent_index=QtCore.QModelIndex()):
indexes = [parent_index]
while len(indexes) > 0:
parent_index = indexes.pop(0)
@@ -71,7 +71,7 @@ def AssetBrowser_SearchFiltering():
cur_data = cur_index.data(Qt.DisplayRole)
if (
"." in cur_data
- and (cur_data.lower().split(".")[-1] not in allowed_asset_extentions)
+ and (cur_data.lower().split(".")[-1] not in allowed_asset_extensions)
and not cur_data[-1] == ")"
):
Report.info(f"Incorrect file found: {cur_data}")
@@ -94,16 +94,21 @@ def AssetBrowser_SearchFiltering():
Report.info("Asset Browser is already open")
editor_window = pyside_utils.get_editor_main_window()
app = QtWidgets.QApplication.instance()
-
- # 3) Type the name of an asset in the search bar and make sure only one asset is filtered in Asset browser
+
+ # 3) Type the name of an asset in the search bar and make sure it is filtered to and selectable
asset_browser = editor_window.findChild(QtWidgets.QDockWidget, "Asset Browser")
search_bar = asset_browser.findChild(QtWidgets.QLineEdit, "textSearch")
search_bar.setText("cedar.fbx")
asset_browser_tree = asset_browser.findChild(QtWidgets.QTreeView, "m_assetBrowserTreeViewWidget")
- model_index = pyside_utils.find_child_by_pattern(asset_browser_tree, "cedar.fbx")
- pyside_utils.item_view_index_mouse_click(asset_browser_tree, model_index)
+ asset_browser_table = asset_browser.findChild(QtWidgets.QTreeView, "m_assetBrowserTableViewWidget")
+ found = await pyside_utils.wait_for_condition(lambda: pyside_utils.find_child_by_pattern(asset_browser_table, "cedar.fbx"), 5.0)
+ if found:
+ model_index = pyside_utils.find_child_by_pattern(asset_browser_table, "cedar.fbx")
+ else:
+ Report.result(Tests.asset_filtered, found)
+ pyside_utils.item_view_index_mouse_click(asset_browser_table, model_index)
is_filtered = await pyside_utils.wait_for_condition(
- lambda: asset_browser_tree.indexBelow(asset_browser_tree.currentIndex()) == QtCore.QModelIndex(), 5.0)
+ lambda: asset_browser_table.currentIndex() == model_index, 5.0)
Report.result(Tests.asset_filtered, is_filtered)
# 4) Click the "X" in the search bar.
diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetBrowser_TreeNavigation.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetBrowser_TreeNavigation.py
index b4f0dc7f6c..ecc77778cc 100644
--- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetBrowser_TreeNavigation.py
+++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetBrowser_TreeNavigation.py
@@ -84,8 +84,8 @@ def AssetBrowser_TreeNavigation():
# 3) Collapse all files initially
main_window = editor_window.findChild(QtWidgets.QMainWindow)
- asset_browser = pyside_utils.find_child_by_hierarchy(main_window, ..., "Asset Browser")
- tree = pyside_utils.find_child_by_hierarchy(asset_browser, ..., "m_assetBrowserTreeViewWidget")
+ asset_browser = pyside_utils.find_child_by_pattern(main_window, text="Asset Browser", type=QtWidgets.QDockWidget)
+ tree = pyside_utils.find_child_by_pattern(asset_browser, "m_assetBrowserTreeViewWidget")
scroll_area = tree.findChild(QtWidgets.QWidget, "qt_scrollarea_vcontainer")
scroll_bar = scroll_area.findChild(QtWidgets.QScrollBar)
tree.collapseAll()
diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Docking_BasicDockedTools.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Docking_BasicDockedTools.py
index 2a91e7a374..6683fc952a 100644
--- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Docking_BasicDockedTools.py
+++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Docking_BasicDockedTools.py
@@ -140,13 +140,13 @@ def Docking_BasicDockedTools():
# 2.5,6) Send a console command.
console_line_edit = console.findChild(QtWidgets.QLineEdit, "lineEdit")
- console_line_edit.setText("t_Scale 2")
+ console_line_edit.setText("t_simulationTickScale 2")
QtTest.QTest.keyClick(console_line_edit, QtCore.Qt.Key_Enter)
- general.get_cvar("t_Scale")
- Report.result(Tests.docked_console_works, general.get_cvar("t_Scale") == "2")
+ general.get_cvar("t_simulationTickScale")
+ Report.result(Tests.docked_console_works, general.get_cvar("t_simulationTickScale") == "2")
# Reset the altered cvar
- console_line_edit.setText("t_Scale 1")
+ console_line_edit.setText("t_simulationTickScale 1")
QtTest.QTest.keyClick(console_line_edit, QtCore.Qt.Key_Enter)
run_test()
diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/EntityOutliner_EntityOrdering.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/EntityOutliner_EntityOrdering.py
new file mode 100644
index 0000000000..5fa8130302
--- /dev/null
+++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/EntityOutliner_EntityOrdering.py
@@ -0,0 +1,147 @@
+"""
+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
+"""
+
+
+class Tests:
+ entities_sorted = (
+ "Entities sorted in the expected order",
+ "Entities sorted in an incorrect order",
+ )
+
+
+def EntityOutliner_EntityOrdering():
+ """
+ Summary:
+ Verify that manual entity ordering in the entity outliner works and is stable.
+
+ Expected Behavior:
+ Several entities are created, some are manually ordered, and their order
+ is maintained, even when new entities are added.
+
+ Test Steps:
+ 1) Open the empty Prefab Base level
+ 2) Add 5 entities to the outliner
+ 3) Move "Entity1" to the top of the order
+ 4) Move "Entity4" to the bottom of the order
+ 5) Add another new entity, ensure the rest of the order is unchanged
+ """
+
+ import editor_python_test_tools.pyside_utils as pyside_utils
+ import azlmbr.legacy.general as general
+ from editor_python_test_tools.utils import Report
+ from editor_python_test_tools.utils import TestHelper as helper
+ from PySide2 import QtCore, QtWidgets, QtGui, QtTest
+
+ # Grab the Editor, Entity Outliner, and Outliner Model
+ editor_window = pyside_utils.get_editor_main_window()
+ entity_outliner = pyside_utils.find_child_by_hierarchy(
+ editor_window, ..., "EntityOutlinerWidgetUI", ..., "m_objectTree"
+ )
+ entity_outliner_model = entity_outliner.model()
+
+ # Get the outliner index for the root prefab container entity
+ def get_root_prefab_container_index():
+ return entity_outliner_model.index(0, 0)
+
+ # Get the outliner index for the top level entity of a given name
+ def index_for_name(name):
+ root_index = get_root_prefab_container_index()
+ for row in range(entity_outliner_model.rowCount(root_index)):
+ row_index = entity_outliner_model.index(row, 0, root_index)
+ if row_index.data() == name:
+ return row_index
+ return None
+
+ # Validate that the outliner top level entity order matches the expected order
+ def verify_entities_sorted(expected_order):
+ actual_order = []
+ root_index = get_root_prefab_container_index()
+ for row in range(entity_outliner_model.rowCount(root_index)):
+ row_index = entity_outliner_model.index(row, 0, root_index)
+ actual_order.append(row_index.data())
+
+ sorted_correctly = actual_order == expected_order
+ Report.result(Tests.entities_sorted, sorted_correctly)
+ if not sorted_correctly:
+ print(f"Expected entity order: {expected_order}")
+ print(f"Actual entity order: {actual_order}")
+
+ # Creates an entity from the outliner context menu
+ def create_entity():
+ pyside_utils.trigger_context_menu_entry(
+ entity_outliner, "Create entity", index=get_root_prefab_container_index()
+ )
+ # Wait a tick after entity creation to let events process
+ general.idle_wait(0.0)
+
+ # Moves an entity (wrapped by move_entity_before and move_entity_after)
+ def _move_entity(source_name, target_name, move_after=False):
+ source_index = index_for_name(source_name)
+ target_index = index_for_name(target_name)
+
+ target_row = target_index.row()
+ if move_after:
+ target_row += 1
+
+ # Generate MIME data and directly inject it into the model instead of
+ # generating mouse click operations, as it's more reliable and we're
+ # testing the underlying drag & drop logic as opposed to Qt's mouse
+ # handling here
+ mime_data = entity_outliner_model.mimeData([source_index])
+ entity_outliner_model.dropMimeData(
+ mime_data, QtCore.Qt.MoveAction, target_row, 0, target_index.parent()
+ )
+ # Wait after move to let events (i.e. prefab propagation) process
+ general.idle_wait(1.0)
+
+ # Move an entity before another entity in the order by dragging the source above the target
+ move_entity_before = lambda source_name, target_name: _move_entity(
+ source_name, target_name, move_after=False
+ )
+ # Move an entity after another entity in the order by dragging the source beloew the target
+ move_entity_after = lambda source_name, target_name: _move_entity(
+ source_name, target_name, move_after=True
+ )
+
+ expected_order = []
+
+ # 1) Open the empty Prefab Base level
+ helper.init_idle()
+ helper.open_level("Prefab", "Base")
+
+ # 2) Add 5 entities to the outliner
+ ENTITIES_TO_ADD = 5
+ for i in range(ENTITIES_TO_ADD):
+ create_entity()
+
+ # Our new entity should be given a name with a number automatically
+ new_entity = f"Entity{i+1}"
+ # The new entity should be added to the bottom of its parent entity
+ expected_order = expected_order + [new_entity]
+
+ verify_entities_sorted(expected_order)
+
+ # 3) Move "Entity5" to the top of the order
+ move_entity_before("Entity5", "Entity1")
+ expected_order = ["Entity5", "Entity1", "Entity2", "Entity3", "Entity4"]
+ verify_entities_sorted(expected_order)
+
+ # 4) Move "Entity2" to the bottom of the order
+ move_entity_after("Entity2", "Entity4")
+ expected_order = ["Entity5", "Entity1", "Entity3", "Entity4", "Entity2"]
+ verify_entities_sorted(expected_order)
+
+ # 5) Add another new entity, ensure the rest of the order is unchanged
+ create_entity()
+ expected_order = ["Entity5", "Entity1", "Entity3", "Entity4", "Entity2", "Entity6"]
+ verify_entities_sorted(expected_order)
+
+
+if __name__ == "__main__":
+ from editor_python_test_tools.utils import Report
+
+ Report.start_test(EntityOutliner_EntityOrdering)
diff --git a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main.py b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main.py
index 26b254ae71..c9e91687e0 100644
--- a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main.py
+++ b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main.py
@@ -33,11 +33,22 @@ class TestAutomation(TestAutomationBase):
def test_BasicEditorWorkflows_LevelEntityComponentCRUD(self, request, workspace, editor, launcher_platform,
remove_test_level):
from .EditorScripts import BasicEditorWorkflows_LevelEntityComponentCRUD as test_module
- self._run_test(request, workspace, editor, test_module, batch_mode=False, autotest_mode=False)
+ self._run_test(request, workspace, editor, test_module, batch_mode=False, autotest_mode=False, enable_prefab_system=False)
@pytest.mark.REQUIRES_gpu
def test_BasicEditorWorkflows_GPU_LevelEntityComponentCRUD(self, request, workspace, editor, launcher_platform,
remove_test_level):
from .EditorScripts import BasicEditorWorkflows_LevelEntityComponentCRUD as test_module
self._run_test(request, workspace, editor, test_module, batch_mode=False, autotest_mode=False,
- use_null_renderer=False)
+ use_null_renderer=False, enable_prefab_system=False)
+
+ def test_EntityOutlienr_EntityOrdering(self, request, workspace, editor, launcher_platform):
+ from .EditorScripts import EntityOutliner_EntityOrdering as test_module
+ self._run_test(
+ request,
+ workspace,
+ editor,
+ test_module,
+ batch_mode=False,
+ autotest_mode=True,
+ )
diff --git a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main_Optimized.py b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main_Optimized.py
index afc52f962d..d87fd8625b 100644
--- a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main_Optimized.py
+++ b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main_Optimized.py
@@ -21,6 +21,8 @@ class TestAutomationNoAutoTestMode(EditorTestSuite):
# Disable -autotest_mode and -BatchMode. Tests cannot run in -BatchMode due to UI interactions, and these tests
# interact with modal dialogs
global_extra_cmdline_args = []
+
+ enable_prefab_system = False
class test_BasicEditorWorkflows_LevelEntityComponentCRUD(EditorSingleTest):
# Custom teardown to remove slice asset created during test
@@ -43,12 +45,10 @@ class TestAutomationNoAutoTestMode(EditorTestSuite):
class test_InputBindings_Add_Remove_Input_Events(EditorSharedTest):
from .EditorScripts import InputBindings_Add_Remove_Input_Events as test_module
- @pytest.mark.skip(reason="Crashes Editor: ATOM-15493")
class test_AssetPicker_UI_UX(EditorSharedTest):
from .EditorScripts import AssetPicker_UI_UX as test_module
-@pytest.mark.xfail(reason="Optimized tests are experimental, we will enable xfail and monitor them temporarily.")
@pytest.mark.SUITE_main
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
@pytest.mark.parametrize("project", ["AutomatedTesting"])
@@ -57,10 +57,11 @@ class TestAutomationAutoTestMode(EditorTestSuite):
# Enable only -autotest_mode for these tests. Tests cannot run in -BatchMode due to UI interactions
global_extra_cmdline_args = ["-autotest_mode"]
+ enable_prefab_system = False
+
class test_AssetBrowser_TreeNavigation(EditorSharedTest):
from .EditorScripts import AssetBrowser_TreeNavigation as test_module
- @pytest.mark.skip(reason="Crashes Editor: ATOM-15493")
class test_AssetBrowser_SearchFiltering(EditorSharedTest):
from .EditorScripts import AssetBrowser_SearchFiltering as test_module
@@ -74,6 +75,5 @@ class TestAutomationAutoTestMode(EditorTestSuite):
class test_Menus_FileMenuOptions_Work(EditorSharedTest):
from .EditorScripts import Menus_FileMenuOptions as test_module
-
class test_BasicEditorWorkflows_ExistingLevel_EntityComponentCRUD(EditorSharedTest):
from .EditorScripts import BasicEditorWorkflows_ExistingLevel_EntityComponentCRUD as test_module
diff --git a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Periodic.py b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Periodic.py
index 398b64bc87..1bd1d7f987 100644
--- a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Periodic.py
+++ b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Periodic.py
@@ -32,31 +32,29 @@ class TestAutomation(TestAutomationBase):
def test_AssetBrowser_TreeNavigation(self, request, workspace, editor, launcher_platform):
from .EditorScripts import AssetBrowser_TreeNavigation as test_module
- self._run_test(request, workspace, editor, test_module, batch_mode=False)
+ self._run_test(request, workspace, editor, test_module, batch_mode=False, enable_prefab_system=False)
- @pytest.mark.skip(reason="Crashes Editor: ATOM-15493")
def test_AssetBrowser_SearchFiltering(self, request, workspace, editor, launcher_platform):
from .EditorScripts import AssetBrowser_SearchFiltering as test_module
- self._run_test(request, workspace, editor, test_module, batch_mode=False)
+ self._run_test(request, workspace, editor, test_module, batch_mode=False, enable_prefab_system=False)
- @pytest.mark.skip(reason="Crashes Editor: ATOM-15493")
def test_AssetPicker_UI_UX(self, request, workspace, editor, launcher_platform):
from .EditorScripts import AssetPicker_UI_UX as test_module
- self._run_test(request, workspace, editor, test_module, autotest_mode=False, batch_mode=False)
+ self._run_test(request, workspace, editor, test_module, autotest_mode=False, batch_mode=False, enable_prefab_system=False)
def test_ComponentCRUD_Add_Delete_Components(self, request, workspace, editor, launcher_platform):
from .EditorScripts import ComponentCRUD_Add_Delete_Components as test_module
- self._run_test(request, workspace, editor, test_module, batch_mode=False)
+ self._run_test(request, workspace, editor, test_module, batch_mode=False, enable_prefab_system=False)
def test_InputBindings_Add_Remove_Input_Events(self, request, workspace, editor, launcher_platform):
from .EditorScripts import InputBindings_Add_Remove_Input_Events as test_module
- self._run_test(request, workspace, editor, test_module, batch_mode=False, autotest_mode=False)
+ self._run_test(request, workspace, editor, test_module, batch_mode=False, autotest_mode=False, enable_prefab_system=False)
def test_Menus_ViewMenuOptions_Work(self, request, workspace, editor, launcher_platform):
from .EditorScripts import Menus_ViewMenuOptions as test_module
- self._run_test(request, workspace, editor, test_module, batch_mode=False)
+ self._run_test(request, workspace, editor, test_module, batch_mode=False, enable_prefab_system=False)
@pytest.mark.skip(reason="Times out due to dialogs failing to dismiss: LYN-4208")
def test_Menus_FileMenuOptions_Work(self, request, workspace, editor, launcher_platform):
from .EditorScripts import Menus_FileMenuOptions as test_module
- self._run_test(request, workspace, editor, test_module, batch_mode=False)
+ self._run_test(request, workspace, editor, test_module, batch_mode=False, enable_prefab_system=False)
diff --git a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Sandbox.py b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Sandbox.py
index 98a6620d9c..8a56a2dbfd 100644
--- a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Sandbox.py
+++ b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Sandbox.py
@@ -20,8 +20,8 @@ class TestAutomation(TestAutomationBase):
def test_Menus_EditMenuOptions_Work(self, request, workspace, editor, launcher_platform):
from .EditorScripts import Menus_EditMenuOptions as test_module
- self._run_test(request, workspace, editor, test_module, batch_mode=False)
+ self._run_test(request, workspace, editor, test_module, batch_mode=False, enable_prefab_system=False)
def test_Docking_BasicDockedTools(self, request, workspace, editor, launcher_platform):
from .EditorScripts import Docking_BasicDockedTools as test_module
- self._run_test(request, workspace, editor, test_module, batch_mode=False)
+ self._run_test(request, workspace, editor, test_module, batch_mode=False, enable_prefab_system=False)
diff --git a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Sandbox_Optimized.py b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Sandbox_Optimized.py
index 4a472095ae..ce0d5e43e9 100644
--- a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Sandbox_Optimized.py
+++ b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Sandbox_Optimized.py
@@ -19,6 +19,8 @@ class TestAutomationAutoTestMode(EditorTestSuite):
# Enable only -autotest_mode for these tests. Tests cannot run in -BatchMode due to UI interactions
global_extra_cmdline_args = ["-autotest_mode"]
+ enable_prefab_system = False
+
class test_Docking_BasicDockedTools(EditorSharedTest):
from .EditorScripts import Docking_BasicDockedTools as test_module
diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/largeworlds/CMakeLists.txt
index c2123d683c..ba607ede32 100644
--- a/AutomatedTesting/Gem/PythonTests/largeworlds/CMakeLists.txt
+++ b/AutomatedTesting/Gem/PythonTests/largeworlds/CMakeLists.txt
@@ -10,45 +10,29 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_
## DynVeg ##
- ly_add_pytest(
- NAME AutomatedTesting::DynamicVegetationTests_Main
- TEST_SERIAL
- TEST_SUITE main
- PATH ${CMAKE_CURRENT_LIST_DIR}/dyn_veg/TestSuite_Main.py
- RUNTIME_DEPENDENCIES
- AZ::AssetProcessor
- Legacy::Editor
- AutomatedTesting.GameLauncher
- AutomatedTesting.Assets
- COMPONENT
- LargeWorlds
- )
-
-
- ly_add_pytest(
- NAME AutomatedTesting::DynamicVegetationTests_Periodic
- TEST_SERIAL
- TEST_SUITE periodic
- PATH ${CMAKE_CURRENT_LIST_DIR}/dyn_veg/TestSuite_Periodic.py
- RUNTIME_DEPENDENCIES
- AZ::AssetProcessor
- Legacy::Editor
- AutomatedTesting.Assets
- AutomatedTesting.GameLauncher
- COMPONENT
- LargeWorlds
- )
-
ly_add_pytest(
NAME AutomatedTesting::DynamicVegetationTests_Main_Optimized
TEST_SERIAL
TEST_SUITE main
PATH ${CMAKE_CURRENT_LIST_DIR}/dyn_veg/TestSuite_Main_Optimized.py
RUNTIME_DEPENDENCIES
- AZ::AssetProcessor
- Legacy::Editor
- AutomatedTesting.Assets
- AutomatedTesting.GameLauncher
+ AZ::AssetProcessor
+ Legacy::Editor
+ AutomatedTesting.Assets
+ AutomatedTesting.GameLauncher
+ COMPONENT
+ LargeWorlds
+ )
+ ly_add_pytest(
+ NAME AutomatedTesting::DynamicVegetationTests_Periodic_Optimized
+ TEST_SERIAL
+ TEST_SUITE periodic
+ PATH ${CMAKE_CURRENT_LIST_DIR}/dyn_veg/TestSuite_Periodic_Optimized.py
+ RUNTIME_DEPENDENCIES
+ AZ::AssetProcessor
+ Legacy::Editor
+ AutomatedTesting.Assets
+ AutomatedTesting.GameLauncher
COMPONENT
LargeWorlds
)
diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynVegUtils_TempPrefabCreationWorks.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynVegUtils_TempPrefabCreationWorks.py
new file mode 100644
index 0000000000..d016473d5e
--- /dev/null
+++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynVegUtils_TempPrefabCreationWorks.py
@@ -0,0 +1,85 @@
+"""
+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
+"""
+
+
+def DynVegUtils_TempPrefabCreationWorks():
+ """
+ Summary:
+ An existing level is opened. Each Prefab setup to be spawned by Dynamic Vegetation tests is created in memory and
+ validated against existing test slice components/mesh assignments.
+
+ Expected Behavior:
+ Temporary prefabs contain the expected components/assets.
+
+ Test Steps:
+ 1) Open an existing level
+ 2) Create each of the necessary temporary Mesh prefabs, and validate the component/mesh setups
+ 3) Create the necessary temporary PhysX Collider, and validate the component setup
+ 4) Report errors/asserts
+
+ :return: None
+ """
+
+ import os
+
+ import azlmbr.asset as asset
+ import azlmbr.bus as bus
+ import azlmbr.math as math
+
+ from Prefab.tests import PrefabTestUtils as prefab_test_utils
+ from largeworlds.large_worlds_utils import editor_dynveg_test_helper as dynveg
+ from editor_python_test_tools.utils import Report, Tracer
+ from editor_python_test_tools.utils import TestHelper as helper
+ from editor_python_test_tools.prefab_utils import PrefabInstance
+
+ with Tracer() as error_tracer:
+ # Create dictionary for prefab filenames and paths to create using helper function
+ mesh_prefabs = {
+ "PinkFlower": os.path.join("assets", "objects", "foliage", "grass_flower_pink.azmodel"),
+ "PurpleFlower": os.path.join("assets", "objects", "foliage", "grass_flower_purple.azmodel"),
+ "1m_Cube": os.path.join("objects", "_primitives", "_box_1x1.azmodel"),
+ "CedarTree": os.path.join("assets", "objects", "foliage", "cedar.azmodel"),
+ "Bush": os.path.join("assets", "objects", "foliage", "bush_privet_01.azmodel"),
+ }
+
+ # 1) Open an existing simple level
+ prefab_test_utils.open_base_tests_level()
+
+ # 2) Create each of the Mesh asset prefabs and validate that the prefab created successfully
+ for prefab_filename, asset_path in mesh_prefabs.items():
+ mesh_prefab_created = (
+ f"Temporary mesh prefab: {prefab_filename} created successfully",
+ f"Failed to create temporary mesh prefab: {prefab_filename}"
+ )
+ prefab = dynveg.create_temp_mesh_prefab(asset_path, prefab_filename)
+ Report.result(mesh_prefab_created, helper.wait_for_condition(lambda:
+ PrefabInstance.is_valid(prefab[1]), 3.0))
+
+ # 3) Create temp PhysX Collider prefab and validate that the prefab created successfully
+ physx_prefab_filename = "CedarTree_Collision"
+ physx_collider_prefab_created = (
+ f"Temporary mesh prefab: {physx_prefab_filename} created successfully",
+ f"Failed to create temporary mesh prefab: {physx_prefab_filename}"
+ )
+ test_physx_mesh_asset_id = asset.AssetCatalogRequestBus(bus.Broadcast, "GetAssetIdByPath", os.path.join(
+ "assets", "objects", "foliage", "cedar.pxmesh"), math.Uuid(), False)
+ dynveg.create_temp_physx_mesh_collider(test_physx_mesh_asset_id, physx_prefab_filename)
+ Report.result(physx_collider_prefab_created, helper.wait_for_condition(lambda:
+ PrefabInstance.is_valid(prefab[1]), 3.0))
+
+ # 4) Report errors/asserts
+ helper.wait_for_condition(lambda: error_tracer.has_errors or error_tracer.has_asserts, 1.0)
+ for error_info in error_tracer.errors:
+ Report.info(f"Error: {error_info.filename} {error_info.function} | {error_info.message}")
+ for assert_info in error_tracer.asserts:
+ Report.info(f"Assert: {assert_info.filename} {assert_info.function} | {assert_info.message}")
+
+
+if __name__ == "__main__":
+
+ from editor_python_test_tools.utils import Report
+ Report.start_test(DynVegUtils_TempPrefabCreationWorks)
diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_Embedded_E2E.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_Embedded_E2E.py
index 84c661873c..fa45e057e2 100755
--- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_Embedded_E2E.py
+++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_Embedded_E2E.py
@@ -72,9 +72,9 @@ def DynamicSliceInstanceSpawner_Embedded_E2E():
# 1) Create a new, temporary level
lvl_name = "tmp_level"
helper.init_idle()
- level_created = general.create_level_no_prompt(lvl_name, 1024, 1, 4096, False)
+ level_created = helper.create_level(lvl_name)
general.idle_wait(1.0)
- Report.critical_result(Tests.level_created, level_created == 0)
+ Report.critical_result(Tests.level_created, level_created)
general.set_current_view_position(512.0, 480.0, 38.0)
# 2) Create a new entity with required vegetation area components and Script Canvas component for launcher test
diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_External_E2E.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_External_E2E.py
index de2554034f..2353095849 100755
--- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_External_E2E.py
+++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_External_E2E.py
@@ -73,9 +73,9 @@ def DynamicSliceInstanceSpawner_External_E2E():
# 1) Create a new, temporary level
lvl_name = "tmp_level"
helper.init_idle()
- level_created = general.create_level_no_prompt(lvl_name, 1024, 1, 4096, False)
+ level_created = helper.create_level(lvl_name)
general.idle_wait(1.0)
- Report.critical_result(Tests.level_created, level_created == 0)
+ Report.critical_result(Tests.level_created, level_created)
general.set_current_view_position(512.0, 480.0, 38.0)
# 2) Create a new entity with required vegetation area components and switch the Vegetation Asset List Source
diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerBlender_E2E_Editor.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerBlender_E2E_Editor.py
index bf6501f469..130d56937b 100755
--- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerBlender_E2E_Editor.py
+++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerBlender_E2E_Editor.py
@@ -76,9 +76,9 @@ def LayerBlender_E2E_Editor():
# 1) Create a new, temporary level
lvl_name = "tmp_level"
helper.init_idle()
- level_created = general.create_level_no_prompt(lvl_name, 1024, 1, 4096, False)
+ level_created = helper.create_level(lvl_name)
general.idle_wait(1.0)
- Report.critical_result(Tests.level_created, level_created == 0)
+ Report.critical_result(Tests.level_created, level_created)
general.set_current_view_position(500.49, 498.69, 46.66)
general.set_current_view_rotation(-42.05, 0.00, -36.33)
diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerSpawner_InheritBehaviorFlag.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerSpawner_InheritBehaviorFlag.py
index 649c7d0776..1153ae2657 100755
--- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerSpawner_InheritBehaviorFlag.py
+++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerSpawner_InheritBehaviorFlag.py
@@ -78,7 +78,7 @@ def LayerSpawner_InheritBehaviorFlag():
# Create Vegetation area and assign a valid asset
veg_1 = hydra.Entity("veg_1")
veg_1.create_entity(
- position, ["Vegetation Layer Spawner", "Vegetation Reference Shape", "Vegetation Asset List"]
+ position, ["Vegetation Layer Spawner", "Shape Reference", "Vegetation Asset List"]
)
set_dynamic_slice_asset(veg_1, 2, os.path.join("Slices", "PinkFlower.dynamicslice"))
veg_1.get_set_test(1, "Configuration|Shape Entity Id", blender_entity.id)
@@ -86,7 +86,7 @@ def LayerSpawner_InheritBehaviorFlag():
# Create second vegetation area and assign a valid asset
veg_2 = hydra.Entity("veg_2")
veg_2.create_entity(
- position, ["Vegetation Layer Spawner", "Vegetation Reference Shape", "Vegetation Asset List"]
+ position, ["Vegetation Layer Spawner", "Shape Reference", "Vegetation Asset List"]
)
set_dynamic_slice_asset(veg_2, 2, os.path.join("Slices", "PurpleFlower.dynamicslice"))
veg_2.get_set_test(1, "Configuration|Shape Entity Id", blender_entity.id)
diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerSpawner_InstancesPlantInAllSupportedShapes.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerSpawner_InstancesPlantInAllSupportedShapes.py
index 0da200d87a..42604cd2da 100755
--- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerSpawner_InstancesPlantInAllSupportedShapes.py
+++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerSpawner_InstancesPlantInAllSupportedShapes.py
@@ -9,7 +9,7 @@ SPDX-License-Identifier: Apache-2.0 OR MIT
def LayerSpawner_InstancesPlantInAllSupportedShapes():
"""
Summary:
- The level is loaded and vegetation area is created. Then the Vegetation Reference Shape
+ The level is loaded and vegetation area is created. Then the Shape Reference
component of vegetation area is pinned with entities of different shape components to check
if the vegetation plants in different shaped areas.
@@ -67,7 +67,7 @@ def LayerSpawner_InstancesPlantInAllSupportedShapes():
10.0, 10.0, 10.0,
asset_path)
vegetation.remove_component("Box Shape")
- vegetation.add_component("Vegetation Reference Shape")
+ vegetation.add_component("Shape Reference")
# Create surface for planting on
dynveg.create_surface_entity("Surface Entity", entity_position, 60.0, 60.0, 1.0)
diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/TestSuite_Main.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/TestSuite_Main.py
index 4c02c887ef..06c9c5f615 100644
--- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/TestSuite_Main.py
+++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/TestSuite_Main.py
@@ -20,8 +20,8 @@ class TestAutomation(TestAutomationBase):
def test_DynamicSliceInstanceSpawner_DynamicSliceSpawnerWorks(self, request, workspace, editor, launcher_platform):
from .EditorScripts import DynamicSliceInstanceSpawner_DynamicSliceSpawnerWorks as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_EmptyInstanceSpawner_EmptySpawnerWorks(self, request, workspace, editor, launcher_platform):
from .EditorScripts import EmptyInstanceSpawner_EmptySpawnerWorks as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/TestSuite_Main_Optimized.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/TestSuite_Main_Optimized.py
index ded2dda4e9..673e40e397 100644
--- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/TestSuite_Main_Optimized.py
+++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/TestSuite_Main_Optimized.py
@@ -12,12 +12,24 @@ import ly_test_tools.environment.file_system as file_system
from ly_test_tools.o3de.editor_test import EditorSingleTest, EditorSharedTest, EditorParallelTest, EditorTestSuite
-@pytest.mark.xfail(reason="Optimized tests are experimental, we will enable xfail and monitor them temporarily.")
@pytest.mark.SUITE_main
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
@pytest.mark.parametrize("project", ["AutomatedTesting"])
class TestAutomation(EditorTestSuite):
+ enable_prefab_system = False
+
+ # Helpers for test asset cleanup
+ def cleanup_test_level(self, workspace):
+ file_system.delete([os.path.join(workspace.paths.engine_root(), "AutomatedTesting", "Levels", "tmp_level")],
+ True, True)
+
+ def cleanup_test_slices(self, workspace):
+ file_system.delete([os.path.join(workspace.paths.engine_root(), "AutomatedTesting", "slices",
+ "TestSlice_1.slice")], True, True)
+ file_system.delete([os.path.join(workspace.paths.engine_root(), "AutomatedTesting", "slices",
+ "TestSlice_2.slice")], True, True)
+
class test_DynamicSliceInstanceSpawner_DynamicSliceSpawnerWorks(EditorParallelTest):
from .EditorScripts import DynamicSliceInstanceSpawner_DynamicSliceSpawnerWorks as test_module
@@ -36,10 +48,7 @@ class TestAutomation(EditorTestSuite):
class test_SpawnerSlices_SliceCreationAndVisibilityToggleWorks(EditorSingleTest):
# Custom teardown to remove slice asset created during test
def teardown(self, request, workspace, editor, editor_test_results, launcher_platform):
- file_system.delete([os.path.join(workspace.paths.engine_root(), "AutomatedTesting", "slices",
- "TestSlice_1.slice")], True, True)
- file_system.delete([os.path.join(workspace.paths.engine_root(), "AutomatedTesting", "slices",
- "TestSlice_2.slice")], True, True)
+ TestAutomation.cleanup_test_slices(self, workspace)
from .EditorScripts import SpawnerSlices_SliceCreationAndVisibilityToggleWorks as test_module
class test_AssetListCombiner_CombinedDescriptorsExpressInConfiguredArea(EditorParallelTest):
@@ -150,23 +159,29 @@ class TestAutomation(EditorTestSuite):
class test_DynamicSliceInstanceSpawner_Embedded_E2E_Editor(EditorSingleTest):
from .EditorScripts import DynamicSliceInstanceSpawner_Embedded_E2E as test_module
- # Custom teardown to remove test level created during test
+ # Custom setup/teardown to remove test level created during test
+ def setup(self, request, workspace, editor, editor_test_results, launcher_platform):
+ TestAutomation.cleanup_test_level(self, workspace)
+
def teardown(self, request, workspace, editor, editor_test_results, launcher_platform):
- file_system.delete([os.path.join(workspace.paths.engine_root(), "AutomatedTesting", "Levels", "tmp_level")],
- True, True)
+ TestAutomation.cleanup_test_level(self, workspace)
class test_DynamicSliceInstanceSpawner_External_E2E_Editor(EditorSingleTest):
from .EditorScripts import DynamicSliceInstanceSpawner_External_E2E as test_module
- # Custom teardown to remove test level created during test
+ # Custom setup/teardown to remove test level created during test
+ def setup(self, request, workspace, editor, editor_test_results, launcher_platform):
+ TestAutomation.cleanup_test_level(self, workspace)
+
def teardown(self, request, workspace, editor, editor_test_results, launcher_platform):
- file_system.delete([os.path.join(workspace.paths.engine_root(), "AutomatedTesting", "Levels", "tmp_level")],
- True, True)
-
+ TestAutomation.cleanup_test_level(self, workspace)
+
class test_LayerBlender_E2E_Editor(EditorSingleTest):
from .EditorScripts import LayerBlender_E2E_Editor as test_module
- # Custom teardown to remove test level created during test
+ # Custom setup/teardown to remove test level created during test
+ def setup(self, request, workspace, editor, editor_test_results, launcher_platform):
+ TestAutomation.cleanup_test_level(self, workspace)
+
def teardown(self, request, workspace, editor, editor_test_results, launcher_platform):
- file_system.delete([os.path.join(workspace.paths.engine_root(), "AutomatedTesting", "Levels", "tmp_level")],
- True, True)
+ TestAutomation.cleanup_test_level(self, workspace)
diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/TestSuite_Periodic.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/TestSuite_Periodic.py
index 2780c0f471..d0d570950b 100644
--- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/TestSuite_Periodic.py
+++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/TestSuite_Periodic.py
@@ -52,158 +52,158 @@ class TestAutomation(TestAutomationBase):
def test_AltitudeFilter_ComponentAndOverrides_InstancesPlantAtSpecifiedAltitude(self, request, workspace, editor, launcher_platform):
from .EditorScripts import AltitudeFilter_ComponentAndOverrides_InstancesPlantAtSpecifiedAltitude as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_AltitudeFilter_ShapeSample_InstancesPlantAtSpecifiedAltitude(self, request, workspace, editor, launcher_platform):
from .EditorScripts import AltitudeFilter_ShapeSample_InstancesPlantAtSpecifiedAltitude as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_AltitudeFilter_FilterStageToggle(self, request, workspace, editor, launcher_platform):
from .EditorScripts import AltitudeFilter_FilterStageToggle as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_SpawnerSlices_SliceCreationAndVisibilityToggleWorks(self, request, workspace, editor, remove_test_slice, launcher_platform):
from .EditorScripts import SpawnerSlices_SliceCreationAndVisibilityToggleWorks as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_AssetListCombiner_CombinedDescriptorsExpressInConfiguredArea(self, request, workspace, editor, launcher_platform):
from .EditorScripts import AssetListCombiner_CombinedDescriptorsExpressInConfiguredArea as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_AssetWeightSelector_InstancesExpressBasedOnWeight(self, request, workspace, editor, launcher_platform):
from .EditorScripts import AssetWeightSelector_InstancesExpressBasedOnWeight as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@pytest.mark.xfail(reason="https://github.com/o3de/o3de/issues/4155")
def test_DistanceBetweenFilter_InstancesPlantAtSpecifiedRadius(self, request, workspace, editor, launcher_platform):
from .EditorScripts import DistanceBetweenFilter_InstancesPlantAtSpecifiedRadius as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@pytest.mark.xfail(reason="https://github.com/o3de/o3de/issues/4155")
def test_DistanceBetweenFilterOverrides_InstancesPlantAtSpecifiedRadius(self, request, workspace, editor, launcher_platform):
from .EditorScripts import DistanceBetweenFilterOverrides_InstancesPlantAtSpecifiedRadius as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_SurfaceDataRefreshes_RemainsStable(self, request, workspace, editor, launcher_platform):
from .EditorScripts import SurfaceDataRefreshes_RemainsStable as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_VegetationInstances_DespawnWhenOutOfRange(self, request, workspace, editor, launcher_platform):
from .EditorScripts import VegetationInstances_DespawnWhenOutOfRange as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_InstanceSpawnerPriority_LayerAndSubPriority_HigherValuesPlantOverLower(self, request, workspace, editor, launcher_platform):
from .EditorScripts import InstanceSpawnerPriority_LayerAndSubPriority as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_LayerBlocker_InstancesBlockedInConfiguredArea(self, request, workspace, editor, launcher_platform):
from .EditorScripts import LayerBlocker_InstancesBlockedInConfiguredArea as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_LayerSpawner_InheritBehaviorFlag(self, request, workspace, editor, launcher_platform):
from .EditorScripts import LayerSpawner_InheritBehaviorFlag as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_LayerSpawner_InstancesPlantInAllSupportedShapes(self, request, workspace, editor, launcher_platform):
from .EditorScripts import LayerSpawner_InstancesPlantInAllSupportedShapes as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_LayerSpawner_FilterStageToggle(self, request, workspace, editor, launcher_platform):
from .EditorScripts import LayerSpawner_FilterStageToggle as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@pytest.mark.xfail(reason="https://github.com/o3de/o3de/issues/2038")
def test_LayerSpawner_InstancesRefreshUsingCorrectViewportCamera(self, request, workspace, editor, launcher_platform):
from .EditorScripts import LayerSpawner_InstancesRefreshUsingCorrectViewportCamera as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_MeshBlocker_InstancesBlockedByMesh(self, request, workspace, editor, launcher_platform):
from .EditorScripts import MeshBlocker_InstancesBlockedByMesh as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_MeshBlocker_InstancesBlockedByMeshHeightTuning(self, request, workspace, editor, launcher_platform):
from .EditorScripts import MeshBlocker_InstancesBlockedByMeshHeightTuning as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_MeshSurfaceTagEmitter_DependentOnMeshComponent(self, request, workspace, editor, launcher_platform):
from .EditorScripts import MeshSurfaceTagEmitter_DependentOnMeshComponent as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_MeshSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully(self, request, workspace, editor, launcher_platform):
from .EditorScripts import MeshSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_PhysXColliderSurfaceTagEmitter_E2E_Editor(self, request, workspace, editor, launcher_platform):
from .EditorScripts import PhysXColliderSurfaceTagEmitter_E2E_Editor as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_PositionModifier_ComponentAndOverrides_InstancesPlantAtSpecifiedOffsets(self, request, workspace, editor, launcher_platform):
from .EditorScripts import PositionModifier_ComponentAndOverrides_InstancesPlantAtSpecifiedOffsets as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_PositionModifier_AutoSnapToSurfaceWorks(self, request, workspace, editor, launcher_platform):
from .EditorScripts import PositionModifier_AutoSnapToSurfaceWorks as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_RotationModifier_InstancesRotateWithinRange(self, request, workspace, editor, launcher_platform):
from .EditorScripts import RotationModifier_InstancesRotateWithinRange as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_RotationModifierOverrides_InstancesRotateWithinRange(self, request, workspace, editor, launcher_platform):
from .EditorScripts import RotationModifierOverrides_InstancesRotateWithinRange as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_ScaleModifier_InstancesProperlyScale(self, request, workspace, editor, launcher_platform):
from .EditorScripts import ScaleModifier_InstancesProperlyScale as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_ScaleModifierOverrides_InstancesProperlyScale(self, request, workspace, editor, launcher_platform):
from .EditorScripts import ScaleModifierOverrides_InstancesProperlyScale as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_ShapeIntersectionFilter_InstancesPlantInAssignedShape(self, request, workspace, editor, launcher_platform):
from .EditorScripts import ShapeIntersectionFilter_InstancesPlantInAssignedShape as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_ShapeIntersectionFilter_FilterStageToggle(self, request, workspace, editor, launcher_platform):
from .EditorScripts import ShapeIntersectionFilter_FilterStageToggle as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_SlopeAlignmentModifier_InstanceSurfaceAlignment(self, request, workspace, editor, launcher_platform):
from .EditorScripts import SlopeAlignmentModifier_InstanceSurfaceAlignment as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_SlopeAlignmentModifierOverrides_InstanceSurfaceAlignment(self, request, workspace, editor, launcher_platform):
from .EditorScripts import SlopeAlignmentModifierOverrides_InstanceSurfaceAlignment as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_SurfaceMaskFilter_BasicSurfaceTagCreation(self, request, workspace, editor, launcher_platform):
from .EditorScripts import SurfaceMaskFilter_BasicSurfaceTagCreation as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_SurfaceMaskFilter_ExclusiveSurfaceTags_Function(self, request, workspace, editor, launcher_platform):
from .EditorScripts import SurfaceMaskFilter_ExclusionList as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_SurfaceMaskFilter_InclusiveSurfaceTags_Function(self, request, workspace, editor, launcher_platform):
from .EditorScripts import SurfaceMaskFilter_InclusionList as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_SurfaceMaskFilterOverrides_MultipleDescriptorOverridesPlantAsExpected(self, request, workspace, editor, launcher_platform):
from .EditorScripts import SurfaceMaskFilterOverrides_MultipleDescriptorOverridesPlantAsExpected as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_SystemSettings_SectorPointDensity(self, request, workspace, editor, launcher_platform):
from .EditorScripts import SystemSettings_SectorPointDensity as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_SystemSettings_SectorSize(self, request, workspace, editor, launcher_platform):
from .EditorScripts import SystemSettings_SectorSize as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_SlopeFilter_ComponentAndOverrides_InstancesPlantOnValidSlopes(self, request, workspace, editor, launcher_platform):
from .EditorScripts import SlopeFilter_ComponentAndOverrides_InstancesPlantOnValidSlope as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@pytest.mark.SUITE_periodic
@@ -219,7 +219,7 @@ class TestAutomationE2E(TestAutomationBase):
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
from .EditorScripts import DynamicSliceInstanceSpawner_Embedded_E2E as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@pytest.mark.parametrize("launcher_platform", ['windows'])
def test_DynamicSliceInstanceSpawner_Embedded_E2E_Launcher(self, workspace, launcher, level,
@@ -240,7 +240,7 @@ class TestAutomationE2E(TestAutomationBase):
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
from .EditorScripts import DynamicSliceInstanceSpawner_External_E2E as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@pytest.mark.parametrize("launcher_platform", ['windows'])
def test_DynamicSliceInstanceSpawner_External_E2E_Launcher(self, workspace, launcher, level,
@@ -261,7 +261,7 @@ class TestAutomationE2E(TestAutomationBase):
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
from .EditorScripts import LayerBlender_E2E_Editor as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@pytest.mark.parametrize("launcher_platform", ['windows'])
@pytest.mark.xfail(reason="https://github.com/o3de/o3de/issues/4170")
diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/TestSuite_Periodic_Optimized.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/TestSuite_Periodic_Optimized.py
new file mode 100644
index 0000000000..f87d6567ef
--- /dev/null
+++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/TestSuite_Periodic_Optimized.py
@@ -0,0 +1,23 @@
+"""
+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
+"""
+
+import os
+import pytest
+
+import ly_test_tools.environment.file_system as file_system
+from ly_test_tools.o3de.editor_test import EditorSingleTest, EditorSharedTest, EditorParallelTest, EditorTestSuite
+
+
+@pytest.mark.SUITE_main
+@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
+@pytest.mark.parametrize("project", ["AutomatedTesting"])
+class TestAutomation(EditorTestSuite):
+
+ global_extra_cmdline_args = ["-BatchMode", "-autotest_mode"]
+
+ class test_DynVegUtils_TempPrefabCreationWorks(EditorSharedTest):
+ from .EditorScripts import DynVegUtils_TempPrefabCreationWorks as test_module
diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/TestSuite_Periodic.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/TestSuite_Periodic.py
index 21eecf642c..3ad27eb973 100644
--- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/TestSuite_Periodic.py
+++ b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/TestSuite_Periodic.py
@@ -20,52 +20,52 @@ class TestAutomation(TestAutomationBase):
def test_GradientGenerators_Incompatibilities(self, request, workspace, editor, launcher_platform):
from .EditorScripts import GradientGenerators_Incompatibilities as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_GradientModifiers_Incompatibilities(self, request, workspace, editor, launcher_platform):
from .EditorScripts import GradientModifiers_Incompatibilities as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_GradientPreviewSettings_DefaultPinnedEntityIsSelf(self, request, workspace, editor, launcher_platform):
from .EditorScripts import GradientPreviewSettings_DefaultPinnedEntityIsSelf as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_GradientPreviewSettings_ClearingPinnedEntitySetsPreviewToOrigin(self, request, workspace, editor, launcher_platform):
from .EditorScripts import GradientPreviewSettings_ClearingPinnedEntitySetsPreviewToOrigin as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_GradientSampling_GradientReferencesAddRemoveSuccessfully(self, request, workspace, editor, launcher_platform):
from .EditorScripts import GradientSampling_GradientReferencesAddRemoveSuccessfully as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_GradientSurfaceTagEmitter_ComponentDependencies(self, request, workspace, editor, launcher_platform):
from .EditorScripts import GradientSurfaceTagEmitter_ComponentDependencies as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_GradientSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully(self, request, workspace, editor, launcher_platform):
from .EditorScripts import GradientSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_GradientTransform_RequiresShape(self, request, workspace, editor, launcher_platform):
from .EditorScripts import GradientTransform_RequiresShape as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_GradientTransform_FrequencyZoomCanBeSetBeyondSliderRange(self, request, workspace, editor, launcher_platform):
from .EditorScripts import GradientTransform_FrequencyZoomCanBeSetBeyondSliderRange as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_GradientTransform_ComponentIncompatibleWithSpawners(self, request, workspace, editor, launcher_platform):
from .EditorScripts import GradientTransform_ComponentIncompatibleWithSpawners as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_GradientTransform_ComponentIncompatibleWithExpectedGradients(self, request, workspace, editor, launcher_platform):
from .EditorScripts import GradientTransform_ComponentIncompatibleWithExpectedGradients as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_ImageGradient_RequiresShape(self, request, workspace, editor, launcher_platform):
from .EditorScripts import ImageGradient_RequiresShape as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_ImageGradient_ProcessedImageAssignedSuccessfully(self, request, workspace, editor, launcher_platform):
from .EditorScripts import ImageGradient_ProcessedImageAssignedSuccessfully as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/TestSuite_Periodic_Optimized.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/TestSuite_Periodic_Optimized.py
index 514504d324..6ac0658b4d 100644
--- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/TestSuite_Periodic_Optimized.py
+++ b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/TestSuite_Periodic_Optimized.py
@@ -15,6 +15,8 @@ from ly_test_tools.o3de.editor_test import EditorSingleTest, EditorSharedTest, E
@pytest.mark.parametrize("project", ["AutomatedTesting"])
class TestAutomation(EditorTestSuite):
+ enable_prefab_system = False
+
class test_GradientGenerators_Incompatibilities(EditorSharedTest):
from .EditorScripts import GradientGenerators_Incompatibilities as test_module
diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/AreaNodes_DependentComponentsAdded.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/AreaNodes_DependentComponentsAdded.py
index 9703423901..c69ce77041 100755
--- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/AreaNodes_DependentComponentsAdded.py
+++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/AreaNodes_DependentComponentsAdded.py
@@ -96,7 +96,7 @@ def AreaNodes_DependentComponentsAdded():
'SpawnerAreaNode': [
'Vegetation Layer Spawner',
'Vegetation Asset List',
- 'Vegetation Reference Shape'
+ 'Shape Reference'
],
'MeshBlockerAreaNode': [
'Vegetation Layer Blocker (Mesh)',
@@ -104,7 +104,7 @@ def AreaNodes_DependentComponentsAdded():
],
'BlockerAreaNode': [
'Vegetation Layer Blocker',
- 'Vegetation Reference Shape'
+ 'Shape Reference'
]
}
diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/Edit_DisabledNodeDuplication.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/Edit_DisabledNodeDuplication.py
index 417e093567..4dfc227c53 100755
--- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/Edit_DisabledNodeDuplication.py
+++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/Edit_DisabledNodeDuplication.py
@@ -82,7 +82,7 @@ def Edit_DisabledNodeDuplication():
nodes = {
'SpawnerAreaNode': 'Vegetation Asset List',
'MeshBlockerAreaNode': 'Mesh',
- 'BlockerAreaNode': 'Vegetation Reference Shape',
+ 'BlockerAreaNode': 'Shape Reference',
'FastNoiseGradientNode': 'Gradient Transform Modifier',
'ImageGradientNode': 'Gradient Transform Modifier',
'PerlinNoiseGradientNode': 'Gradient Transform Modifier',
diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientNodes_DependentComponentsAdded.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientNodes_DependentComponentsAdded.py
index c04f9f05f6..63df9a6fcb 100755
--- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientNodes_DependentComponentsAdded.py
+++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientNodes_DependentComponentsAdded.py
@@ -104,7 +104,7 @@ def GradientNodes_DependentComponentsAdded():
# we will be checking for
commonComponents = [
'Gradient Transform Modifier',
- 'Vegetation Reference Shape'
+ 'Shape Reference'
]
componentNames = []
for name in gradients:
@@ -114,7 +114,7 @@ def GradientNodes_DependentComponentsAdded():
# Create nodes for the gradients that have additional required dependencies and check if
# the Entity created by adding the node has the appropriate Component and required
- # Gradient Transform Modifier and Vegetation Reference Shape components added automatically to it
+ # Gradient Transform Modifier and Shape Reference components added automatically to it
newGraph = graph.GraphManagerRequestBus(bus.Broadcast, 'GetGraph', newGraphId)
x = 10.0
y = 10.0
diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/TestSuite_Main.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/TestSuite_Main.py
index af4855a546..dedc9c70c0 100644
--- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/TestSuite_Main.py
+++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/TestSuite_Main.py
@@ -22,8 +22,8 @@ class TestAutomation(TestAutomationBase):
def test_LandscapeCanvas_SlotConnections_UpdateComponentReferences(self, request, workspace, editor, launcher_platform):
from .EditorScripts import SlotConnections_UpdateComponentReferences as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_LandscapeCanvas_GradientMixer_NodeConstruction(self, request, workspace, editor, launcher_platform):
from .EditorScripts import GradientMixer_NodeConstruction as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/TestSuite_Main_Optimized.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/TestSuite_Main_Optimized.py
index 1c3652cae9..402df133cb 100644
--- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/TestSuite_Main_Optimized.py
+++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/TestSuite_Main_Optimized.py
@@ -18,6 +18,8 @@ from ly_test_tools.o3de.editor_test import EditorSingleTest, EditorSharedTest, E
@pytest.mark.parametrize("project", ["AutomatedTesting"])
class TestAutomation(EditorTestSuite):
+ enable_prefab_system = False
+
class test_LandscapeCanvas_SlotConnections_UpdateComponentReferences(EditorSharedTest):
from .EditorScripts import SlotConnections_UpdateComponentReferences as test_module
diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/TestSuite_Periodic.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/TestSuite_Periodic.py
index ef8b3e492b..a719b1a7c0 100644
--- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/TestSuite_Periodic.py
+++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/TestSuite_Periodic.py
@@ -33,89 +33,89 @@ class TestAutomation(TestAutomationBase):
def test_LandscapeCanvas_AreaNodes_DependentComponentsAdded(self, request, workspace, editor, launcher_platform):
from .EditorScripts import AreaNodes_DependentComponentsAdded as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_LandscapeCanvas_AreaNodes_EntityCreatedOnNodeAdd(self, request, workspace, editor, launcher_platform):
from .EditorScripts import AreaNodes_EntityCreatedOnNodeAdd as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_LandscapeCanvas_AreaNodes_EntityRemovedOnNodeDelete(self, request, workspace, editor, launcher_platform):
from .EditorScripts import AreaNodes_EntityRemovedOnNodeDelete as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_LandscapeCanvas_LayerExtenderNodes_ComponentEntitySync(self, request, workspace, editor, launcher_platform):
from .EditorScripts import LayerExtenderNodes_ComponentEntitySync as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_LandscapeCanvas_Edit_DisabledNodeDuplication(self, request, workspace, editor, launcher_platform):
from .EditorScripts import Edit_DisabledNodeDuplication as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_LandscapeCanvas_Edit_UndoNodeDelete_SliceEntity(self, request, workspace, editor, launcher_platform):
from .EditorScripts import Edit_UndoNodeDelete_SliceEntity as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_LandscapeCanvas_NewGraph_CreatedSuccessfully(self, request, workspace, editor, launcher_platform):
from .EditorScripts import NewGraph_CreatedSuccessfully as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_LandscapeCanvas_Component_AddedRemoved(self, request, workspace, editor, launcher_platform):
from .EditorScripts import Component_AddedRemoved as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_LandscapeCanvas_GraphClosed_OnLevelChange(self, request, workspace, editor, launcher_platform):
from .EditorScripts import GraphClosed_OnLevelChange as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@pytest.mark.xfail(reason="https://github.com/o3de/o3de/issues/2201")
def test_LandscapeCanvas_GraphClosed_OnEntityDelete(self, request, workspace, editor, launcher_platform):
from .EditorScripts import GraphClosed_OnEntityDelete as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_LandscapeCanvas_GraphClosed_TabbedGraphClosesIndependently(self, request, workspace, editor, launcher_platform):
from .EditorScripts import GraphClosed_TabbedGraph as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_LandscapeCanvas_Slice_CreateInstantiate(self, request, workspace, editor, remove_test_slice, launcher_platform):
from .EditorScripts import Slice_CreateInstantiate as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_LandscapeCanvas_GradientModifierNodes_EntityCreatedOnNodeAdd(self, request, workspace, editor, launcher_platform):
from .EditorScripts import GradientModifierNodes_EntityCreatedOnNodeAdd as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_LandscapeCanvas_GradientModifierNodes_EntityRemovedOnNodeDelete(self, request, workspace, editor, launcher_platform):
from .EditorScripts import GradientModifierNodes_EntityRemovedOnNodeDelete as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_LandscapeCanvas_GradientNodes_DependentComponentsAdded(self, request, workspace, editor, launcher_platform):
from .EditorScripts import GradientNodes_DependentComponentsAdded as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_LandscapeCanvas_GradientNodes_EntityCreatedOnNodeAdd(self, request, workspace, editor, launcher_platform):
from .EditorScripts import GradientNodes_EntityCreatedOnNodeAdd as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_LandscapeCanvas_GradientNodes_EntityRemovedOnNodeDelete(self, request, workspace, editor, launcher_platform):
from .EditorScripts import GradientNodes_EntityRemovedOnNodeDelete as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_LandscapeCanvas_GraphUpdates_UpdateComponents(self, request, workspace, editor, launcher_platform):
from .EditorScripts import GraphUpdates_UpdateComponents as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_LandscapeCanvas_ComponentUpdates_UpdateGraph(self, request, workspace, editor, launcher_platform):
from .EditorScripts import ComponentUpdates_UpdateGraph as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_LandscapeCanvas_LayerBlender_NodeConstruction(self, request, workspace, editor, launcher_platform):
from .EditorScripts import LayerBlender_NodeConstruction as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_LandscapeCanvas_ShapeNodes_EntityCreatedOnNodeAdd(self, request, workspace, editor, launcher_platform):
from .EditorScripts import ShapeNodes_EntityCreatedOnNodeAdd as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_LandscapeCanvas_ShapeNodes_EntityRemovedOnNodeDelete(self, request, workspace, editor, launcher_platform):
from .EditorScripts import ShapeNodes_EntityRemovedOnNodeDelete as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/large_worlds_utils/editor_dynveg_test_helper.py b/AutomatedTesting/Gem/PythonTests/largeworlds/large_worlds_utils/editor_dynveg_test_helper.py
index 957536fffb..d7d5842518 100755
--- a/AutomatedTesting/Gem/PythonTests/largeworlds/large_worlds_utils/editor_dynveg_test_helper.py
+++ b/AutomatedTesting/Gem/PythonTests/largeworlds/large_worlds_utils/editor_dynveg_test_helper.py
@@ -19,6 +19,45 @@ import azlmbr.paths
sys.path.append(os.path.join(azlmbr.paths.projectroot, 'Gem', 'PythonTests'))
import editor_python_test_tools.hydra_editor_utils as hydra
+from editor_python_test_tools.editor_entity_utils import EditorEntity
+from editor_python_test_tools.prefab_utils import Prefab
+
+
+def create_temp_mesh_prefab(mesh_asset_path, prefab_filename):
+ # Create initial entity
+ root = EditorEntity.create_editor_entity(name=prefab_filename)
+ assert root.exists(), "Failed to create entity"
+ # Add mesh component
+ mesh_component = root.add_component("Mesh")
+ assert root.has_component("Mesh") and mesh_component.is_enabled(), "Failed to add/activate Mesh component"
+ # Assign the specified mesh asset
+ mesh_asset = asset.AssetCatalogRequestBus(bus.Broadcast, "GetAssetIdByPath", mesh_asset_path, math.Uuid(), False)
+ mesh_component.set_component_property_value("Controller|Configuration|Mesh Asset", mesh_asset)
+ assert mesh_component.get_component_property_value("Controller|Configuration|Mesh Asset") == mesh_asset, \
+ "Failed to set Mesh asset"
+ # Create and return the temporary/in-memory prefab
+ temp_prefab = Prefab.create_prefab([root], prefab_filename)
+ return temp_prefab
+
+
+def create_temp_physx_mesh_collider(physx_mesh_id, prefab_filename):
+ # Create initial entity
+ root = EditorEntity.create_editor_entity(name=prefab_filename)
+ assert root.exists(), "Failed to create entity"
+ # Add PhysX Collider component
+ collider_component = root.add_component("PhysX Collider")
+ assert root.has_component("PhysX Collider") and collider_component.is_enabled(), \
+ "Failed to add/activate PhysX Collider component"
+ # Set the Collider's Shape Configuration field to PhysicsAsset, and assign the specified PhysX Mesh asset
+ collider_component.set_component_property_value("Shape Configuration|Shape", 7)
+ assert collider_component.get_component_property_value("Shape Configuration|Shape") == 7, \
+ "Failed to set Collider Shape to PhysicsAsset"
+ collider_component.set_component_property_value("Shape Configuration|Asset|PhysX Mesh", physx_mesh_id)
+ assert collider_component.get_component_property_value("Shape Configuration|Asset|PhysX Mesh") == physx_mesh_id, \
+ "Failed to assign PhysX Mesh asset"
+ # Create and return the temporary/in-memory prefab
+ temp_prefab = Prefab.create_prefab([root], prefab_filename)
+ return temp_prefab
def create_surface_entity(name, center_point, box_size_x, box_size_y, box_size_z):
diff --git a/AutomatedTesting/Gem/PythonTests/scripting/TestSuite_Periodic.py b/AutomatedTesting/Gem/PythonTests/scripting/TestSuite_Periodic.py
index b2001e6825..27af63ddbc 100755
--- a/AutomatedTesting/Gem/PythonTests/scripting/TestSuite_Periodic.py
+++ b/AutomatedTesting/Gem/PythonTests/scripting/TestSuite_Periodic.py
@@ -27,15 +27,15 @@ TEST_DIRECTORY = os.path.dirname(__file__)
class TestAutomation(TestAutomationBase):
def test_Pane_HappyPath_OpenCloseSuccessfully(self, request, workspace, editor, launcher_platform):
from . import Pane_HappyPath_OpenCloseSuccessfully as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_Pane_HappyPath_DocksProperly(self, request, workspace, editor, launcher_platform):
from . import Pane_HappyPath_DocksProperly as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_Pane_HappyPath_ResizesProperly(self, request, workspace, editor, launcher_platform):
from . import Pane_HappyPath_ResizesProperly as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@pytest.mark.xfail(reason="Test fails to find expected lines, it needs to be fixed.")
@pytest.mark.parametrize("level", ["tmp_level"])
@@ -45,7 +45,7 @@ class TestAutomation(TestAutomationBase):
request.addfinalizer(teardown)
file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True)
from . import ScriptCanvas_TwoComponents_InteractSuccessfully as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@pytest.mark.xfail(reason="Test fails to find expected lines, it needs to be fixed.")
@pytest.mark.parametrize("level", ["tmp_level"])
@@ -55,15 +55,15 @@ class TestAutomation(TestAutomationBase):
request.addfinalizer(teardown)
file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True)
from . import ScriptCanvas_ChangingAssets_ComponentStable as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_Graph_HappyPath_ZoomInZoomOut(self, request, workspace, editor, launcher_platform):
from . import Graph_HappyPath_ZoomInZoomOut as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_NodePalette_HappyPath_CanSelectNode(self, request, workspace, editor, launcher_platform):
from . import NodePalette_HappyPath_CanSelectNode as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@pytest.mark.xfail(reason="Test fails to find expected lines, it needs to be fixed.")
@pytest.mark.parametrize("level", ["tmp_level"])
@@ -73,11 +73,11 @@ class TestAutomation(TestAutomationBase):
request.addfinalizer(teardown)
file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True)
from . import ScriptCanvasComponent_OnEntityActivatedDeactivated_PrintMessage as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_NodePalette_HappyPath_ClearSelection(self, request, workspace, editor, launcher_platform, project):
from . import NodePalette_HappyPath_ClearSelection as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@pytest.mark.xfail(reason="Test fails to find expected lines, it needs to be fixed.")
@pytest.mark.parametrize("level", ["tmp_level"])
@@ -87,7 +87,7 @@ class TestAutomation(TestAutomationBase):
request.addfinalizer(teardown)
file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True)
from . import ScriptCanvas_TwoEntities_UseSimultaneously as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_ScriptEvent_HappyPath_CreatedWithoutError(self, request, workspace, editor, launcher_platform, project):
def teardown():
@@ -99,19 +99,19 @@ class TestAutomation(TestAutomationBase):
[os.path.join(workspace.paths.project(), "ScriptCanvas", "test_file.scriptevent")], True, True
)
from . import ScriptEvent_HappyPath_CreatedWithoutError as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_ScriptCanvasTools_Toggle_OpenCloseSuccess(self, request, workspace, editor, launcher_platform):
from . import ScriptCanvasTools_Toggle_OpenCloseSuccess as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_NodeInspector_HappyPath_VariableRenames(self, request, workspace, editor, launcher_platform, project):
from . import NodeInspector_HappyPath_VariableRenames as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_Debugger_HappyPath_TargetMultipleGraphs(self, request, workspace, editor, launcher_platform, project):
from . import Debugger_HappyPath_TargetMultipleGraphs as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@pytest.mark.parametrize("level", ["tmp_level"])
def test_Debugger_HappyPath_TargetMultipleEntities(self, request, workspace, editor, launcher_platform, project, level):
@@ -120,16 +120,16 @@ class TestAutomation(TestAutomationBase):
request.addfinalizer(teardown)
file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True)
from . import Debugger_HappyPath_TargetMultipleEntities as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@pytest.mark.xfail(reason="Test fails to find expected lines, it needs to be fixed.")
def test_EditMenu_Default_UndoRedo(self, request, workspace, editor, launcher_platform, project):
from . import EditMenu_Default_UndoRedo as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_Pane_Undocked_ClosesSuccessfully(self, request, workspace, editor, launcher_platform):
from . import Pane_Undocked_ClosesSuccessfully as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@pytest.mark.parametrize("level", ["tmp_level"])
def test_Entity_HappyPath_AddScriptCanvasComponent(self, request, workspace, editor, launcher_platform, project, level):
@@ -138,11 +138,11 @@ class TestAutomation(TestAutomationBase):
request.addfinalizer(teardown)
file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True)
from . import Entity_HappyPath_AddScriptCanvasComponent as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_Pane_Default_RetainOnSCRestart(self, request, workspace, editor, launcher_platform):
from . import Pane_Default_RetainOnSCRestart as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@pytest.mark.xfail(reason="Test fails to find expected lines, it needs to be fixed.")
@pytest.mark.parametrize("level", ["tmp_level"])
@@ -152,7 +152,7 @@ class TestAutomation(TestAutomationBase):
request.addfinalizer(teardown)
file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True)
from . import ScriptEvents_HappyPath_SendReceiveAcrossMultiple as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@pytest.mark.xfail(reason="Test fails to find expected lines, it needs to be fixed.")
@pytest.mark.parametrize("level", ["tmp_level"])
@@ -162,7 +162,7 @@ class TestAutomation(TestAutomationBase):
request.addfinalizer(teardown)
file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True)
from . import ScriptEvents_Default_SendReceiveSuccessfully as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@pytest.mark.xfail(reason="Test fails to find expected lines, it needs to be fixed.")
@pytest.mark.parametrize("level", ["tmp_level"])
@@ -172,24 +172,24 @@ class TestAutomation(TestAutomationBase):
request.addfinalizer(teardown)
file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True)
from . import ScriptEvents_ReturnSetType_Successfully as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_NodeCategory_ExpandOnClick(self, request, workspace, editor, launcher_platform):
from . import NodeCategory_ExpandOnClick as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_NodePalette_SearchText_Deletion(self, request, workspace, editor, launcher_platform):
from . import NodePalette_SearchText_Deletion as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
@pytest.mark.xfail(reason="Test fails to find expected lines, it needs to be fixed.")
def test_VariableManager_UnpinVariableType_Works(self, request, workspace, editor, launcher_platform):
from . import VariableManager_UnpinVariableType_Works as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_Node_HappyPath_DuplicateNode(self, request, workspace, editor, launcher_platform):
from . import Node_HappyPath_DuplicateNode as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
def test_ScriptEvent_AddRemoveParameter_ActionsSuccessful(self, request, workspace, editor, launcher_platform):
def teardown():
@@ -201,7 +201,7 @@ class TestAutomation(TestAutomationBase):
[os.path.join(workspace.paths.project(), "ScriptCanvas", "test_file.scriptevent")], True, True
)
from . import ScriptEvent_AddRemoveParameter_ActionsSuccessful as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
# NOTE: We had to use hydra_test_utils.py, as TestAutomationBase run_test method
# fails because of pyside_utils import
@@ -220,7 +220,14 @@ class TestScriptCanvasTests(object):
"File->Open action working as expected: True",
]
hydra.launch_and_validate_results(
- request, TEST_DIRECTORY, editor, "FileMenu_Default_NewAndOpen.py", expected_lines, auto_test_mode=False, timeout=60,
+ request,
+ TEST_DIRECTORY,
+ editor,
+ "FileMenu_Default_NewAndOpen.py",
+ expected_lines,
+ auto_test_mode=False,
+ timeout=60,
+ enable_prefab_system=False,
)
@pytest.mark.xfail(reason="Test fails to find expected lines, it needs to be fixed.")
@@ -239,6 +246,7 @@ class TestScriptCanvasTests(object):
expected_lines,
auto_test_mode=False,
timeout=60,
+ enable_prefab_system=False,
)
def test_GraphClose_Default_SavePrompt(self, request, editor, launcher_platform):
@@ -255,6 +263,7 @@ class TestScriptCanvasTests(object):
expected_lines,
auto_test_mode=False,
timeout=60,
+ enable_prefab_system=False,
)
def test_VariableManager_Default_CreateDeleteVars(self, request, editor, launcher_platform):
@@ -269,6 +278,7 @@ class TestScriptCanvasTests(object):
expected_lines,
auto_test_mode=False,
timeout=60,
+ enable_prefab_system=False,
)
@pytest.mark.parametrize(
@@ -304,6 +314,7 @@ class TestScriptCanvasTests(object):
cfg_args=[config.get('cfg_args')],
auto_test_mode=False,
timeout=60,
+ enable_prefab_system=False,
)
@pytest.mark.xfail(reason="Test fails to find expected lines, it needs to be fixed.")
@@ -332,6 +343,7 @@ class TestScriptCanvasTests(object):
expected_lines,
auto_test_mode=False,
timeout=60,
+ enable_prefab_system=False,
)
@pytest.mark.xfail(reason="Test fails to find expected lines, it needs to be fixed.")
@@ -359,5 +371,6 @@ class TestScriptCanvasTests(object):
expected_lines,
auto_test_mode=False,
timeout=60,
+ enable_prefab_system=False,
)
\ No newline at end of file
diff --git a/AutomatedTesting/Gem/PythonTests/scripting/TestSuite_Sandbox.py b/AutomatedTesting/Gem/PythonTests/scripting/TestSuite_Sandbox.py
index 91b01d8d08..071ae2286c 100644
--- a/AutomatedTesting/Gem/PythonTests/scripting/TestSuite_Sandbox.py
+++ b/AutomatedTesting/Gem/PythonTests/scripting/TestSuite_Sandbox.py
@@ -23,4 +23,4 @@ class TestAutomation(TestAutomationBase):
def test_Opening_Closing_Pane(self, request, workspace, editor, launcher_platform):
from . import Opening_Closing_Pane as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
diff --git a/AutomatedTesting/Gem/PythonTests/smoke/test_CLITool_SerializeContextTools_Works.py b/AutomatedTesting/Gem/PythonTests/smoke/test_CLITool_SerializeContextTools_Works.py
index a3f6b8b09f..917ff17f82 100644
--- a/AutomatedTesting/Gem/PythonTests/smoke/test_CLITool_SerializeContextTools_Works.py
+++ b/AutomatedTesting/Gem/PythonTests/smoke/test_CLITool_SerializeContextTools_Works.py
@@ -13,7 +13,10 @@ import os
import pytest
import subprocess
+import ly_test_tools
+
+@pytest.mark.skipif(not ly_test_tools.WINDOWS, reason="Only succeeds on windows https://github.com/o3de/o3de/issues/5539")
@pytest.mark.SUITE_smoke
class TestCLIToolSerializeContextToolsWorks(object):
def test_CLITool_SerializeContextTools_Works(self, build_directory):
diff --git a/AutomatedTesting/Gem/PythonTests/smoke/test_Editor_NewExistingLevels_Works.py b/AutomatedTesting/Gem/PythonTests/smoke/test_Editor_NewExistingLevels_Works.py
index 6f654b9107..5caf7744c4 100644
--- a/AutomatedTesting/Gem/PythonTests/smoke/test_Editor_NewExistingLevels_Works.py
+++ b/AutomatedTesting/Gem/PythonTests/smoke/test_Editor_NewExistingLevels_Works.py
@@ -11,10 +11,13 @@ Test should run in both gpu and non gpu
import pytest
import os
from automatedtesting_shared.base import TestAutomationBase
+
+import ly_test_tools
import ly_test_tools.environment.file_system as file_system
@pytest.mark.SUITE_smoke
+@pytest.mark.skipif(not ly_test_tools.WINDOWS, reason="Only succeeds on windows https://github.com/o3de/o3de/issues/5539")
@pytest.mark.parametrize("launcher_platform", ["windows_editor"])
@pytest.mark.parametrize("project", ["AutomatedTesting"])
@pytest.mark.parametrize("level", ["temp_level"])
@@ -28,4 +31,4 @@ class TestAutomation(TestAutomationBase):
from . import Editor_NewExistingLevels_Works as test_module
- self._run_test(request, workspace, editor, test_module)
+ self._run_test(request, workspace, editor, test_module, enable_prefab_system=False)
diff --git a/AutomatedTesting/Levels/Base/Base.prefab b/AutomatedTesting/Levels/Base/Base.prefab
index 98495663b7..7765fe488e 100644
--- a/AutomatedTesting/Levels/Base/Base.prefab
+++ b/AutomatedTesting/Levels/Base/Base.prefab
@@ -1,52 +1,61 @@
{
"ContainerEntity": {
- "Id": "ContainerEntity",
- "Name": "Base",
+ "Id": "Entity_[1146574390643]",
+ "Name": "Level",
"Components": {
- "Component_[10182366347512475253]": {
- "$type": "EditorPrefabComponent",
- "Id": 10182366347512475253
+ "Component_[10641544592923449938]": {
+ "$type": "EditorInspectorComponent",
+ "Id": 10641544592923449938
},
- "Component_[12917798267488243668]": {
- "$type": "EditorPendingCompositionComponent",
- "Id": 12917798267488243668
- },
- "Component_[3261249813163778338]": {
+ "Component_[12039882709170782873]": {
"$type": "EditorOnlyEntityComponent",
- "Id": 3261249813163778338
+ "Id": 12039882709170782873
},
- "Component_[3837204912784440039]": {
- "$type": "EditorDisabledCompositionComponent",
- "Id": 3837204912784440039
+ "Component_[12265484671603697631]": {
+ "$type": "EditorPendingCompositionComponent",
+ "Id": 12265484671603697631
},
- "Component_[4272963378099646759]": {
+ "Component_[14126657869720434043]": {
+ "$type": "EditorEntitySortComponent",
+ "Id": 14126657869720434043,
+ "ChildEntityOrderEntryArray": [
+ {
+ "EntityId": ""
+ },
+ {
+ "EntityId": "",
+ "SortIndex": 1
+ }
+ ]
+ },
+ "Component_[15230859088967841193]": {
"$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent",
- "Id": 4272963378099646759,
+ "Id": 15230859088967841193,
"Parent Entity": ""
},
- "Component_[4848458548047175816]": {
- "$type": "EditorVisibilityComponent",
- "Id": 4848458548047175816
+ "Component_[16239496886950819870]": {
+ "$type": "EditorDisabledCompositionComponent",
+ "Id": 16239496886950819870
},
- "Component_[5787060997243919943]": {
- "$type": "EditorInspectorComponent",
- "Id": 5787060997243919943
- },
- "Component_[7804170251266531779]": {
- "$type": "EditorLockComponent",
- "Id": 7804170251266531779
- },
- "Component_[7874177159288365422]": {
- "$type": "EditorEntitySortComponent",
- "Id": 7874177159288365422
- },
- "Component_[8018146290632383969]": {
+ "Component_[5688118765544765547]": {
"$type": "EditorEntityIconComponent",
- "Id": 8018146290632383969
+ "Id": 5688118765544765547
},
- "Component_[8452360690590857075]": {
+ "Component_[6545738857812235305]": {
"$type": "SelectionComponent",
- "Id": 8452360690590857075
+ "Id": 6545738857812235305
+ },
+ "Component_[7247035804068349658]": {
+ "$type": "EditorPrefabComponent",
+ "Id": 7247035804068349658
+ },
+ "Component_[9307224322037797205]": {
+ "$type": "EditorLockComponent",
+ "Id": 9307224322037797205
+ },
+ "Component_[9562516168917670048]": {
+ "$type": "EditorVisibilityComponent",
+ "Id": 9562516168917670048
}
}
}
diff --git a/AutomatedTesting/Levels/Physics/ForceRegion_ImpulsesPxMeshShapedRigidBody/PhysXSedan/_dev_sedan_r0-b.fbx.assetinfo b/AutomatedTesting/Levels/Physics/ForceRegion_ImpulsesPxMeshShapedRigidBody/PhysXSedan/_dev_Sedan_r0-b.fbx.assetinfo
similarity index 100%
rename from AutomatedTesting/Levels/Physics/ForceRegion_ImpulsesPxMeshShapedRigidBody/PhysXSedan/_dev_sedan_r0-b.fbx.assetinfo
rename to AutomatedTesting/Levels/Physics/ForceRegion_ImpulsesPxMeshShapedRigidBody/PhysXSedan/_dev_Sedan_r0-b.fbx.assetinfo
diff --git a/AutomatedTesting/Levels/Physics/ForceRegion_PxMeshShapedForce/PhysXSedan/_dev_sedan_r0-b.fbx.assetinfo b/AutomatedTesting/Levels/Physics/ForceRegion_PxMeshShapedForce/PhysXSedan/_dev_Sedan_r0-b.fbx.assetinfo
similarity index 100%
rename from AutomatedTesting/Levels/Physics/ForceRegion_PxMeshShapedForce/PhysXSedan/_dev_sedan_r0-b.fbx.assetinfo
rename to AutomatedTesting/Levels/Physics/ForceRegion_PxMeshShapedForce/PhysXSedan/_dev_Sedan_r0-b.fbx.assetinfo
diff --git a/AutomatedTesting/Levels/Physics/Material_DefaultMaterialLibraryChangesWork/rin_skeleton_newgeo - copy.fbx.assetinfo b/AutomatedTesting/Levels/Physics/Material_DefaultMaterialLibraryChangesWork/rin_skeleton_newgeo - Copy.fbx.assetinfo
similarity index 100%
rename from AutomatedTesting/Levels/Physics/Material_DefaultMaterialLibraryChangesWork/rin_skeleton_newgeo - copy.fbx.assetinfo
rename to AutomatedTesting/Levels/Physics/Material_DefaultMaterialLibraryChangesWork/rin_skeleton_newgeo - Copy.fbx.assetinfo
diff --git a/AutomatedTesting/Levels/Physics/Physics_WorldBodyBusWorksOnEditorComponents/PhysXSedan/_dev_sedan_r0-b.fbx.assetinfo b/AutomatedTesting/Levels/Physics/Physics_WorldBodyBusWorksOnEditorComponents/PhysXSedan/_dev_Sedan_r0-b.fbx.assetinfo
similarity index 100%
rename from AutomatedTesting/Levels/Physics/Physics_WorldBodyBusWorksOnEditorComponents/PhysXSedan/_dev_sedan_r0-b.fbx.assetinfo
rename to AutomatedTesting/Levels/Physics/Physics_WorldBodyBusWorksOnEditorComponents/PhysXSedan/_dev_Sedan_r0-b.fbx.assetinfo
diff --git a/AutomatedTesting/Levels/Physics/RigidBody_COM_ComputingWorks/PhysXSedan/_dev_sedan_r0-b.fbx.assetinfo b/AutomatedTesting/Levels/Physics/RigidBody_COM_ComputingWorks/PhysXSedan/_dev_Sedan_r0-b.fbx.assetinfo
similarity index 100%
rename from AutomatedTesting/Levels/Physics/RigidBody_COM_ComputingWorks/PhysXSedan/_dev_sedan_r0-b.fbx.assetinfo
rename to AutomatedTesting/Levels/Physics/RigidBody_COM_ComputingWorks/PhysXSedan/_dev_Sedan_r0-b.fbx.assetinfo
diff --git a/AutomatedTesting/Levels/macbeth_shaderballs/macbeth_shaderballs.prefab b/AutomatedTesting/Levels/macbeth_shaderballs/macbeth_shaderballs.prefab
new file mode 100644
index 0000000000..22504f168a
--- /dev/null
+++ b/AutomatedTesting/Levels/macbeth_shaderballs/macbeth_shaderballs.prefab
@@ -0,0 +1,3401 @@
+{
+ "ContainerEntity": {
+ "Id": "ContainerEntity",
+ "Name": "macbeth_shaderballs",
+ "Components": {
+ "Component_[10182366347512475253]": {
+ "$type": "EditorPrefabComponent",
+ "Id": 10182366347512475253
+ },
+ "Component_[12917798267488243668]": {
+ "$type": "EditorPendingCompositionComponent",
+ "Id": 12917798267488243668
+ },
+ "Component_[3261249813163778338]": {
+ "$type": "EditorOnlyEntityComponent",
+ "Id": 3261249813163778338
+ },
+ "Component_[3837204912784440039]": {
+ "$type": "EditorDisabledCompositionComponent",
+ "Id": 3837204912784440039
+ },
+ "Component_[4272963378099646759]": {
+ "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent",
+ "Id": 4272963378099646759,
+ "Parent Entity": ""
+ },
+ "Component_[4848458548047175816]": {
+ "$type": "EditorVisibilityComponent",
+ "Id": 4848458548047175816
+ },
+ "Component_[5787060997243919943]": {
+ "$type": "EditorInspectorComponent",
+ "Id": 5787060997243919943
+ },
+ "Component_[7804170251266531779]": {
+ "$type": "EditorLockComponent",
+ "Id": 7804170251266531779
+ },
+ "Component_[7874177159288365422]": {
+ "$type": "EditorEntitySortComponent",
+ "Id": 7874177159288365422
+ },
+ "Component_[8018146290632383969]": {
+ "$type": "EditorEntityIconComponent",
+ "Id": 8018146290632383969
+ },
+ "Component_[8452360690590857075]": {
+ "$type": "SelectionComponent",
+ "Id": 8452360690590857075
+ }
+ }
+ },
+ "Entities": {
+ "Entity_[471076350497]": {
+ "Id": "Entity_[471076350497]",
+ "Name": "WorldOrigin",
+ "Components": {
+ "Component_[10118378636607282023]": {
+ "$type": "AZ::Render::EditorImageBasedLightComponent",
+ "Id": 10118378636607282023,
+ "Controller": {
+ "Configuration": {
+ "diffuseImageAsset": {
+ "assetId": {
+ "guid": "{10853039-DC8A-558A-B27E-4433A6386731}",
+ "subId": 3000
+ },
+ "assetHint": "lightingpresets/lowcontrast/blouberg_sunrise_1_4k_iblskyboxcm_ibldiffuse.exr.streamingimage"
+ },
+ "specularImageAsset": {
+ "assetId": {
+ "guid": "{10853039-DC8A-558A-B27E-4433A6386731}",
+ "subId": 2000
+ },
+ "assetHint": "lightingpresets/lowcontrast/blouberg_sunrise_1_4k_iblskyboxcm_iblspecular.exr.streamingimage"
+ },
+ "exposure": 1.0
+ }
+ }
+ },
+ "Component_[10390989140659450689]": {
+ "$type": "EditorInspectorComponent",
+ "Id": 10390989140659450689,
+ "ComponentOrderEntryArray": [
+ {
+ "ComponentId": 6066687697346848609
+ },
+ {
+ "ComponentId": 1538992203183232042,
+ "SortIndex": 1
+ },
+ {
+ "ComponentId": 10118378636607282023,
+ "SortIndex": 2
+ }
+ ]
+ },
+ "Component_[1122756123782465575]": {
+ "$type": "EditorLockComponent",
+ "Id": 1122756123782465575
+ },
+ "Component_[1411541685315998773]": {
+ "$type": "EditorDisabledCompositionComponent",
+ "Id": 1411541685315998773
+ },
+ "Component_[1538992203183232042]": {
+ "$type": "AZ::Render::EditorGridComponent",
+ "Id": 1538992203183232042
+ },
+ "Component_[16871442125196328877]": {
+ "$type": "EditorEntitySortComponent",
+ "Id": 16871442125196328877,
+ "ChildEntityOrderEntryArray": [
+ {
+ "EntityId": "Entity_[604220336673]"
+ },
+ {
+ "EntityId": "Entity_[599925369377]",
+ "SortIndex": 1
+ },
+ {
+ "EntityId": "Entity_[475371317793]",
+ "SortIndex": 2
+ },
+ {
+ "EntityId": "Entity_[509731056161]",
+ "SortIndex": 3
+ },
+ {
+ "EntityId": "Entity_[505436088865]",
+ "SortIndex": 4
+ },
+ {
+ "EntityId": "Entity_[539795827233]",
+ "SortIndex": 5
+ },
+ {
+ "EntityId": "Entity_[569860598305]",
+ "SortIndex": 6
+ }
+ ]
+ },
+ "Component_[18389136819207633744]": {
+ "$type": "SelectionComponent",
+ "Id": 18389136819207633744
+ },
+ "Component_[2967708543517171475]": {
+ "$type": "EditorEntityIconComponent",
+ "Id": 2967708543517171475
+ },
+ "Component_[6066687697346848609]": {
+ "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent",
+ "Id": 6066687697346848609,
+ "Parent Entity": "ContainerEntity"
+ },
+ "Component_[7035058231756199033]": {
+ "$type": "EditorVisibilityComponent",
+ "Id": 7035058231756199033
+ },
+ "Component_[7861798362721154905]": {
+ "$type": "EditorOnlyEntityComponent",
+ "Id": 7861798362721154905
+ },
+ "Component_[8535986786667781968]": {
+ "$type": "EditorPendingCompositionComponent",
+ "Id": 8535986786667781968
+ }
+ }
+ },
+ "Entity_[475371317793]": {
+ "Id": "Entity_[475371317793]",
+ "Name": "00_Illuminant",
+ "Components": {
+ "Component_[12222961627447331506]": {
+ "$type": "EditorMaterialComponent",
+ "Id": 12222961627447331506,
+ "Controller": {
+ "Configuration": {
+ "materials": {
+ "{}": {
+ "MaterialAsset": {
+ "assetId": {
+ "guid": "{29C7358C-9899-56DF-8F99-F654C7138DB8}"
+ },
+ "assetHint": "materials/presets/macbeth/00_illuminant.azmaterial"
+ }
+ }
+ }
+ }
+ },
+ "materialSlotsByLodEnabled": true
+ },
+ "Component_[12780007764330464223]": {
+ "$type": "EditorVisibilityComponent",
+ "Id": 12780007764330464223
+ },
+ "Component_[12904863407657276829]": {
+ "$type": "EditorInspectorComponent",
+ "Id": 12904863407657276829,
+ "ComponentOrderEntryArray": [
+ {
+ "ComponentId": 7205597372613518510
+ },
+ {
+ "ComponentId": 8564054653851438099,
+ "SortIndex": 1
+ },
+ {
+ "ComponentId": 12222961627447331506,
+ "SortIndex": 2
+ }
+ ]
+ },
+ "Component_[13729618014821386240]": {
+ "$type": "EditorPendingCompositionComponent",
+ "Id": 13729618014821386240
+ },
+ "Component_[14429836600052599894]": {
+ "$type": "EditorEntityIconComponent",
+ "Id": 14429836600052599894
+ },
+ "Component_[14808014799413383215]": {
+ "$type": "EditorEntitySortComponent",
+ "Id": 14808014799413383215
+ },
+ "Component_[17252932649882883756]": {
+ "$type": "SelectionComponent",
+ "Id": 17252932649882883756
+ },
+ "Component_[2229055145450914672]": {
+ "$type": "EditorLockComponent",
+ "Id": 2229055145450914672
+ },
+ "Component_[2249882080644631374]": {
+ "$type": "EditorOnlyEntityComponent",
+ "Id": 2249882080644631374
+ },
+ "Component_[7205597372613518510]": {
+ "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent",
+ "Id": 7205597372613518510,
+ "Parent Entity": "Entity_[471076350497]",
+ "Transform Data": {
+ "Translate": [
+ -0.020035700872540474,
+ 10.880657196044922,
+ 1.0
+ ],
+ "Rotate": [
+ 0.0,
+ 0.0,
+ 180.00001525878906
+ ]
+ }
+ },
+ "Component_[7918371639409185899]": {
+ "$type": "EditorDisabledCompositionComponent",
+ "Id": 7918371639409185899
+ },
+ "Component_[8564054653851438099]": {
+ "$type": "AZ::Render::EditorMeshComponent",
+ "Id": 8564054653851438099,
+ "Controller": {
+ "Configuration": {
+ "ModelAsset": {
+ "assetId": {
+ "guid": "{D0F73AAF-52B7-507C-B045-DBE2FE2D4403}",
+ "subId": 268677693
+ },
+ "assetHint": "objects/shaderball_simple/shaberball_simple_1m.azmodel"
+ },
+ "LodOverride": 255
+ }
+ }
+ }
+ }
+ },
+ "Entity_[479666285089]": {
+ "Id": "Entity_[479666285089]",
+ "Name": "09_moderate_red",
+ "Components": {
+ "Component_[12222961627447331506]": {
+ "$type": "EditorMaterialComponent",
+ "Id": 12222961627447331506,
+ "Controller": {
+ "Configuration": {
+ "materials": {
+ "{}": {
+ "MaterialAsset": {
+ "assetId": {
+ "guid": "{FD3D09E1-9B20-5761-87A2-388ADD3C966A}"
+ },
+ "assetHint": "materials/presets/macbeth/09_moderate_red.azmaterial"
+ }
+ }
+ }
+ }
+ },
+ "materialSlotsByLodEnabled": true
+ },
+ "Component_[12780007764330464223]": {
+ "$type": "EditorVisibilityComponent",
+ "Id": 12780007764330464223
+ },
+ "Component_[12904863407657276829]": {
+ "$type": "EditorInspectorComponent",
+ "Id": 12904863407657276829,
+ "ComponentOrderEntryArray": [
+ {
+ "ComponentId": 7205597372613518510
+ },
+ {
+ "ComponentId": 8564054653851438099,
+ "SortIndex": 1
+ },
+ {
+ "ComponentId": 12222961627447331506,
+ "SortIndex": 2
+ }
+ ]
+ },
+ "Component_[13729618014821386240]": {
+ "$type": "EditorPendingCompositionComponent",
+ "Id": 13729618014821386240
+ },
+ "Component_[14429836600052599894]": {
+ "$type": "EditorEntityIconComponent",
+ "Id": 14429836600052599894
+ },
+ "Component_[14808014799413383215]": {
+ "$type": "EditorEntitySortComponent",
+ "Id": 14808014799413383215
+ },
+ "Component_[17252932649882883756]": {
+ "$type": "SelectionComponent",
+ "Id": 17252932649882883756
+ },
+ "Component_[2229055145450914672]": {
+ "$type": "EditorLockComponent",
+ "Id": 2229055145450914672
+ },
+ "Component_[2249882080644631374]": {
+ "$type": "EditorOnlyEntityComponent",
+ "Id": 2249882080644631374
+ },
+ "Component_[7205597372613518510]": {
+ "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent",
+ "Id": 7205597372613518510,
+ "Parent Entity": "Entity_[505436088865]",
+ "Transform Data": {
+ "Translate": [
+ -2.113382339477539,
+ -9.999999974752427e-7,
+ 0.0
+ ],
+ "Rotate": [
+ 0.0,
+ 0.0,
+ 180.00001525878906
+ ]
+ }
+ },
+ "Component_[7918371639409185899]": {
+ "$type": "EditorDisabledCompositionComponent",
+ "Id": 7918371639409185899
+ },
+ "Component_[8564054653851438099]": {
+ "$type": "AZ::Render::EditorMeshComponent",
+ "Id": 8564054653851438099,
+ "Controller": {
+ "Configuration": {
+ "ModelAsset": {
+ "assetId": {
+ "guid": "{D0F73AAF-52B7-507C-B045-DBE2FE2D4403}",
+ "subId": 268677693
+ },
+ "assetHint": "objects/shaderball_simple/shaberball_simple_1m.azmodel"
+ },
+ "LodOverride": 255
+ }
+ }
+ }
+ }
+ },
+ "Entity_[483961252385]": {
+ "Id": "Entity_[483961252385]",
+ "Name": "08_purplish_blue",
+ "Components": {
+ "Component_[12222961627447331506]": {
+ "$type": "EditorMaterialComponent",
+ "Id": 12222961627447331506,
+ "Controller": {
+ "Configuration": {
+ "materials": {
+ "{}": {
+ "MaterialAsset": {
+ "assetId": {
+ "guid": "{0478869F-5E19-5A5C-AA22-0D31972E83B7}"
+ },
+ "assetHint": "materials/presets/macbeth/08_purplish_blue.azmaterial"
+ }
+ }
+ }
+ }
+ },
+ "materialSlotsByLodEnabled": true
+ },
+ "Component_[12780007764330464223]": {
+ "$type": "EditorVisibilityComponent",
+ "Id": 12780007764330464223
+ },
+ "Component_[12904863407657276829]": {
+ "$type": "EditorInspectorComponent",
+ "Id": 12904863407657276829,
+ "ComponentOrderEntryArray": [
+ {
+ "ComponentId": 7205597372613518510
+ },
+ {
+ "ComponentId": 8564054653851438099,
+ "SortIndex": 1
+ },
+ {
+ "ComponentId": 12222961627447331506,
+ "SortIndex": 2
+ }
+ ]
+ },
+ "Component_[13729618014821386240]": {
+ "$type": "EditorPendingCompositionComponent",
+ "Id": 13729618014821386240
+ },
+ "Component_[14429836600052599894]": {
+ "$type": "EditorEntityIconComponent",
+ "Id": 14429836600052599894
+ },
+ "Component_[14808014799413383215]": {
+ "$type": "EditorEntitySortComponent",
+ "Id": 14808014799413383215
+ },
+ "Component_[17252932649882883756]": {
+ "$type": "SelectionComponent",
+ "Id": 17252932649882883756
+ },
+ "Component_[2229055145450914672]": {
+ "$type": "EditorLockComponent",
+ "Id": 2229055145450914672
+ },
+ "Component_[2249882080644631374]": {
+ "$type": "EditorOnlyEntityComponent",
+ "Id": 2249882080644631374
+ },
+ "Component_[7205597372613518510]": {
+ "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent",
+ "Id": 7205597372613518510,
+ "Parent Entity": "Entity_[505436088865]",
+ "Transform Data": {
+ "Translate": [
+ -6.113382339477539,
+ -9.999999974752427e-7,
+ 0.0
+ ],
+ "Rotate": [
+ 0.0,
+ 0.0,
+ 180.00001525878906
+ ]
+ }
+ },
+ "Component_[7918371639409185899]": {
+ "$type": "EditorDisabledCompositionComponent",
+ "Id": 7918371639409185899
+ },
+ "Component_[8564054653851438099]": {
+ "$type": "AZ::Render::EditorMeshComponent",
+ "Id": 8564054653851438099,
+ "Controller": {
+ "Configuration": {
+ "ModelAsset": {
+ "assetId": {
+ "guid": "{D0F73AAF-52B7-507C-B045-DBE2FE2D4403}",
+ "subId": 268677693
+ },
+ "assetHint": "objects/shaderball_simple/shaberball_simple_1m.azmodel"
+ },
+ "LodOverride": 255
+ }
+ }
+ }
+ }
+ },
+ "Entity_[488256219681]": {
+ "Id": "Entity_[488256219681]",
+ "Name": "07_orange",
+ "Components": {
+ "Component_[12222961627447331506]": {
+ "$type": "EditorMaterialComponent",
+ "Id": 12222961627447331506,
+ "Controller": {
+ "Configuration": {
+ "materials": {
+ "{}": {
+ "MaterialAsset": {
+ "assetId": {
+ "guid": "{3E414822-FF6A-5A79-BF1A-66F4C48C381D}"
+ },
+ "assetHint": "materials/presets/macbeth/07_orange.azmaterial"
+ }
+ }
+ }
+ }
+ },
+ "materialSlotsByLodEnabled": true
+ },
+ "Component_[12780007764330464223]": {
+ "$type": "EditorVisibilityComponent",
+ "Id": 12780007764330464223
+ },
+ "Component_[12904863407657276829]": {
+ "$type": "EditorInspectorComponent",
+ "Id": 12904863407657276829,
+ "ComponentOrderEntryArray": [
+ {
+ "ComponentId": 7205597372613518510
+ },
+ {
+ "ComponentId": 8564054653851438099,
+ "SortIndex": 1
+ },
+ {
+ "ComponentId": 12222961627447331506,
+ "SortIndex": 2
+ }
+ ]
+ },
+ "Component_[13729618014821386240]": {
+ "$type": "EditorPendingCompositionComponent",
+ "Id": 13729618014821386240
+ },
+ "Component_[14429836600052599894]": {
+ "$type": "EditorEntityIconComponent",
+ "Id": 14429836600052599894
+ },
+ "Component_[14808014799413383215]": {
+ "$type": "EditorEntitySortComponent",
+ "Id": 14808014799413383215
+ },
+ "Component_[17252932649882883756]": {
+ "$type": "SelectionComponent",
+ "Id": 17252932649882883756
+ },
+ "Component_[2229055145450914672]": {
+ "$type": "EditorLockComponent",
+ "Id": 2229055145450914672
+ },
+ "Component_[2249882080644631374]": {
+ "$type": "EditorOnlyEntityComponent",
+ "Id": 2249882080644631374
+ },
+ "Component_[7205597372613518510]": {
+ "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent",
+ "Id": 7205597372613518510,
+ "Parent Entity": "Entity_[505436088865]",
+ "Transform Data": {
+ "Translate": [
+ -10.113382339477539,
+ -9.999999974752427e-7,
+ 0.0
+ ],
+ "Rotate": [
+ 0.0,
+ 0.0,
+ 180.00001525878906
+ ]
+ }
+ },
+ "Component_[7918371639409185899]": {
+ "$type": "EditorDisabledCompositionComponent",
+ "Id": 7918371639409185899
+ },
+ "Component_[8564054653851438099]": {
+ "$type": "AZ::Render::EditorMeshComponent",
+ "Id": 8564054653851438099,
+ "Controller": {
+ "Configuration": {
+ "ModelAsset": {
+ "assetId": {
+ "guid": "{D0F73AAF-52B7-507C-B045-DBE2FE2D4403}",
+ "subId": 268677693
+ },
+ "assetHint": "objects/shaderball_simple/shaberball_simple_1m.azmodel"
+ },
+ "LodOverride": 255
+ }
+ }
+ }
+ }
+ },
+ "Entity_[492551186977]": {
+ "Id": "Entity_[492551186977]",
+ "Name": "10_purple",
+ "Components": {
+ "Component_[12222961627447331506]": {
+ "$type": "EditorMaterialComponent",
+ "Id": 12222961627447331506,
+ "Controller": {
+ "Configuration": {
+ "materials": {
+ "{}": {
+ "MaterialAsset": {
+ "assetId": {
+ "guid": "{6A0A0CBE-FE95-5732-B2A9-442ABAC6B3AA}"
+ },
+ "assetHint": "materials/presets/macbeth/10_purple.azmaterial"
+ }
+ }
+ }
+ }
+ },
+ "materialSlotsByLodEnabled": true
+ },
+ "Component_[12780007764330464223]": {
+ "$type": "EditorVisibilityComponent",
+ "Id": 12780007764330464223
+ },
+ "Component_[12904863407657276829]": {
+ "$type": "EditorInspectorComponent",
+ "Id": 12904863407657276829,
+ "ComponentOrderEntryArray": [
+ {
+ "ComponentId": 7205597372613518510
+ },
+ {
+ "ComponentId": 8564054653851438099,
+ "SortIndex": 1
+ },
+ {
+ "ComponentId": 12222961627447331506,
+ "SortIndex": 2
+ }
+ ]
+ },
+ "Component_[13729618014821386240]": {
+ "$type": "EditorPendingCompositionComponent",
+ "Id": 13729618014821386240
+ },
+ "Component_[14429836600052599894]": {
+ "$type": "EditorEntityIconComponent",
+ "Id": 14429836600052599894
+ },
+ "Component_[14808014799413383215]": {
+ "$type": "EditorEntitySortComponent",
+ "Id": 14808014799413383215
+ },
+ "Component_[17252932649882883756]": {
+ "$type": "SelectionComponent",
+ "Id": 17252932649882883756
+ },
+ "Component_[2229055145450914672]": {
+ "$type": "EditorLockComponent",
+ "Id": 2229055145450914672
+ },
+ "Component_[2249882080644631374]": {
+ "$type": "EditorOnlyEntityComponent",
+ "Id": 2249882080644631374
+ },
+ "Component_[7205597372613518510]": {
+ "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent",
+ "Id": 7205597372613518510,
+ "Parent Entity": "Entity_[505436088865]",
+ "Transform Data": {
+ "Translate": [
+ 1.8866175413131714,
+ -9.999999974752427e-7,
+ 0.0
+ ],
+ "Rotate": [
+ 0.0,
+ 0.0,
+ 180.00001525878906
+ ]
+ }
+ },
+ "Component_[7918371639409185899]": {
+ "$type": "EditorDisabledCompositionComponent",
+ "Id": 7918371639409185899
+ },
+ "Component_[8564054653851438099]": {
+ "$type": "AZ::Render::EditorMeshComponent",
+ "Id": 8564054653851438099,
+ "Controller": {
+ "Configuration": {
+ "ModelAsset": {
+ "assetId": {
+ "guid": "{D0F73AAF-52B7-507C-B045-DBE2FE2D4403}",
+ "subId": 268677693
+ },
+ "assetHint": "objects/shaderball_simple/shaberball_simple_1m.azmodel"
+ },
+ "LodOverride": 255
+ }
+ }
+ }
+ }
+ },
+ "Entity_[496846154273]": {
+ "Id": "Entity_[496846154273]",
+ "Name": "11_yellowish_green",
+ "Components": {
+ "Component_[12222961627447331506]": {
+ "$type": "EditorMaterialComponent",
+ "Id": 12222961627447331506,
+ "Controller": {
+ "Configuration": {
+ "materials": {
+ "{}": {
+ "MaterialAsset": {
+ "assetId": {
+ "guid": "{8D382D9F-D56E-523E-8372-C372B002B81D}"
+ },
+ "assetHint": "materials/presets/macbeth/11_yellow_green.azmaterial"
+ }
+ }
+ }
+ }
+ },
+ "materialSlotsByLodEnabled": true
+ },
+ "Component_[12780007764330464223]": {
+ "$type": "EditorVisibilityComponent",
+ "Id": 12780007764330464223
+ },
+ "Component_[12904863407657276829]": {
+ "$type": "EditorInspectorComponent",
+ "Id": 12904863407657276829,
+ "ComponentOrderEntryArray": [
+ {
+ "ComponentId": 7205597372613518510
+ },
+ {
+ "ComponentId": 8564054653851438099,
+ "SortIndex": 1
+ },
+ {
+ "ComponentId": 12222961627447331506,
+ "SortIndex": 2
+ }
+ ]
+ },
+ "Component_[13729618014821386240]": {
+ "$type": "EditorPendingCompositionComponent",
+ "Id": 13729618014821386240
+ },
+ "Component_[14429836600052599894]": {
+ "$type": "EditorEntityIconComponent",
+ "Id": 14429836600052599894
+ },
+ "Component_[14808014799413383215]": {
+ "$type": "EditorEntitySortComponent",
+ "Id": 14808014799413383215
+ },
+ "Component_[17252932649882883756]": {
+ "$type": "SelectionComponent",
+ "Id": 17252932649882883756
+ },
+ "Component_[2229055145450914672]": {
+ "$type": "EditorLockComponent",
+ "Id": 2229055145450914672
+ },
+ "Component_[2249882080644631374]": {
+ "$type": "EditorOnlyEntityComponent",
+ "Id": 2249882080644631374
+ },
+ "Component_[7205597372613518510]": {
+ "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent",
+ "Id": 7205597372613518510,
+ "Parent Entity": "Entity_[505436088865]",
+ "Transform Data": {
+ "Translate": [
+ 5.886617660522461,
+ -9.999999974752427e-7,
+ 0.0
+ ],
+ "Rotate": [
+ 0.0,
+ 0.0,
+ 180.00001525878906
+ ]
+ }
+ },
+ "Component_[7918371639409185899]": {
+ "$type": "EditorDisabledCompositionComponent",
+ "Id": 7918371639409185899
+ },
+ "Component_[8564054653851438099]": {
+ "$type": "AZ::Render::EditorMeshComponent",
+ "Id": 8564054653851438099,
+ "Controller": {
+ "Configuration": {
+ "ModelAsset": {
+ "assetId": {
+ "guid": "{D0F73AAF-52B7-507C-B045-DBE2FE2D4403}",
+ "subId": 268677693
+ },
+ "assetHint": "objects/shaderball_simple/shaberball_simple_1m.azmodel"
+ },
+ "LodOverride": 255
+ }
+ }
+ }
+ }
+ },
+ "Entity_[501141121569]": {
+ "Id": "Entity_[501141121569]",
+ "Name": "12_orange_yellow",
+ "Components": {
+ "Component_[12222961627447331506]": {
+ "$type": "EditorMaterialComponent",
+ "Id": 12222961627447331506,
+ "Controller": {
+ "Configuration": {
+ "materials": {
+ "{}": {
+ "MaterialAsset": {
+ "assetId": {
+ "guid": "{7C8D9C96-8D79-5AA5-9A1D-DE68760127D7}"
+ },
+ "assetHint": "materials/presets/macbeth/12_orange_yellow.azmaterial"
+ }
+ }
+ }
+ }
+ },
+ "materialSlotsByLodEnabled": true
+ },
+ "Component_[12780007764330464223]": {
+ "$type": "EditorVisibilityComponent",
+ "Id": 12780007764330464223
+ },
+ "Component_[12904863407657276829]": {
+ "$type": "EditorInspectorComponent",
+ "Id": 12904863407657276829,
+ "ComponentOrderEntryArray": [
+ {
+ "ComponentId": 7205597372613518510
+ },
+ {
+ "ComponentId": 8564054653851438099,
+ "SortIndex": 1
+ },
+ {
+ "ComponentId": 12222961627447331506,
+ "SortIndex": 2
+ }
+ ]
+ },
+ "Component_[13729618014821386240]": {
+ "$type": "EditorPendingCompositionComponent",
+ "Id": 13729618014821386240
+ },
+ "Component_[14429836600052599894]": {
+ "$type": "EditorEntityIconComponent",
+ "Id": 14429836600052599894
+ },
+ "Component_[14808014799413383215]": {
+ "$type": "EditorEntitySortComponent",
+ "Id": 14808014799413383215
+ },
+ "Component_[17252932649882883756]": {
+ "$type": "SelectionComponent",
+ "Id": 17252932649882883756
+ },
+ "Component_[2229055145450914672]": {
+ "$type": "EditorLockComponent",
+ "Id": 2229055145450914672
+ },
+ "Component_[2249882080644631374]": {
+ "$type": "EditorOnlyEntityComponent",
+ "Id": 2249882080644631374
+ },
+ "Component_[7205597372613518510]": {
+ "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent",
+ "Id": 7205597372613518510,
+ "Parent Entity": "Entity_[505436088865]",
+ "Transform Data": {
+ "Translate": [
+ 9.886617660522461,
+ -9.999999974752427e-7,
+ 0.0
+ ],
+ "Rotate": [
+ 0.0,
+ 0.0,
+ 180.00001525878906
+ ]
+ }
+ },
+ "Component_[7918371639409185899]": {
+ "$type": "EditorDisabledCompositionComponent",
+ "Id": 7918371639409185899
+ },
+ "Component_[8564054653851438099]": {
+ "$type": "AZ::Render::EditorMeshComponent",
+ "Id": 8564054653851438099,
+ "Controller": {
+ "Configuration": {
+ "ModelAsset": {
+ "assetId": {
+ "guid": "{D0F73AAF-52B7-507C-B045-DBE2FE2D4403}",
+ "subId": 268677693
+ },
+ "assetHint": "objects/shaderball_simple/shaberball_simple_1m.azmodel"
+ },
+ "LodOverride": 255
+ }
+ }
+ }
+ }
+ },
+ "Entity_[505436088865]": {
+ "Id": "Entity_[505436088865]",
+ "Name": "Row",
+ "Components": {
+ "Component_[10247332857034196288]": {
+ "$type": "EditorDisabledCompositionComponent",
+ "Id": 10247332857034196288
+ },
+ "Component_[1050259146293298025]": {
+ "$type": "EditorOnlyEntityComponent",
+ "Id": 1050259146293298025
+ },
+ "Component_[10963468433108777551]": {
+ "$type": "EditorInspectorComponent",
+ "Id": 10963468433108777551,
+ "ComponentOrderEntryArray": [
+ {
+ "ComponentId": 5648156935684358836
+ }
+ ]
+ },
+ "Component_[11044618010943237536]": {
+ "$type": "EditorEntityIconComponent",
+ "Id": 11044618010943237536
+ },
+ "Component_[11056805018150955063]": {
+ "$type": "EditorEntitySortComponent",
+ "Id": 11056805018150955063,
+ "ChildEntityOrderEntryArray": [
+ {
+ "EntityId": "Entity_[488256219681]"
+ },
+ {
+ "EntityId": "Entity_[483961252385]",
+ "SortIndex": 1
+ },
+ {
+ "EntityId": "Entity_[479666285089]",
+ "SortIndex": 2
+ },
+ {
+ "EntityId": "Entity_[492551186977]",
+ "SortIndex": 3
+ },
+ {
+ "EntityId": "Entity_[496846154273]",
+ "SortIndex": 4
+ },
+ {
+ "EntityId": "Entity_[501141121569]",
+ "SortIndex": 5
+ }
+ ]
+ },
+ "Component_[11466054095979053511]": {
+ "$type": "EditorPendingCompositionComponent",
+ "Id": 11466054095979053511
+ },
+ "Component_[1364058654406679998]": {
+ "$type": "SelectionComponent",
+ "Id": 1364058654406679998
+ },
+ "Component_[1550934027474222562]": {
+ "$type": "EditorVisibilityComponent",
+ "Id": 1550934027474222562
+ },
+ "Component_[15938036103959223730]": {
+ "$type": "EditorLockComponent",
+ "Id": 15938036103959223730
+ },
+ "Component_[5648156935684358836]": {
+ "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent",
+ "Id": 5648156935684358836,
+ "Parent Entity": "Entity_[471076350497]",
+ "Transform Data": {
+ "Translate": [
+ 0.0,
+ 2.0,
+ 1.0
+ ]
+ }
+ }
+ }
+ },
+ "Entity_[509731056161]": {
+ "Id": "Entity_[509731056161]",
+ "Name": "Row",
+ "Components": {
+ "Component_[10247332857034196288]": {
+ "$type": "EditorDisabledCompositionComponent",
+ "Id": 10247332857034196288
+ },
+ "Component_[1050259146293298025]": {
+ "$type": "EditorOnlyEntityComponent",
+ "Id": 1050259146293298025
+ },
+ "Component_[10963468433108777551]": {
+ "$type": "EditorInspectorComponent",
+ "Id": 10963468433108777551,
+ "ComponentOrderEntryArray": [
+ {
+ "ComponentId": 5648156935684358836
+ }
+ ]
+ },
+ "Component_[11044618010943237536]": {
+ "$type": "EditorEntityIconComponent",
+ "Id": 11044618010943237536
+ },
+ "Component_[11056805018150955063]": {
+ "$type": "EditorEntitySortComponent",
+ "Id": 11056805018150955063,
+ "ChildEntityOrderEntryArray": [
+ {
+ "EntityId": "Entity_[522615958049]"
+ },
+ {
+ "EntityId": "Entity_[518320990753]",
+ "SortIndex": 1
+ },
+ {
+ "EntityId": "Entity_[514026023457]",
+ "SortIndex": 2
+ },
+ {
+ "EntityId": "Entity_[526910925345]",
+ "SortIndex": 3
+ },
+ {
+ "EntityId": "Entity_[531205892641]",
+ "SortIndex": 4
+ },
+ {
+ "EntityId": "Entity_[535500859937]",
+ "SortIndex": 5
+ }
+ ]
+ },
+ "Component_[11466054095979053511]": {
+ "$type": "EditorPendingCompositionComponent",
+ "Id": 11466054095979053511
+ },
+ "Component_[1364058654406679998]": {
+ "$type": "SelectionComponent",
+ "Id": 1364058654406679998
+ },
+ "Component_[1550934027474222562]": {
+ "$type": "EditorVisibilityComponent",
+ "Id": 1550934027474222562
+ },
+ "Component_[15938036103959223730]": {
+ "$type": "EditorLockComponent",
+ "Id": 15938036103959223730
+ },
+ "Component_[5648156935684358836]": {
+ "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent",
+ "Id": 5648156935684358836,
+ "Parent Entity": "Entity_[471076350497]",
+ "Transform Data": {
+ "Translate": [
+ 0.0,
+ 6.0,
+ 1.0
+ ]
+ }
+ }
+ }
+ },
+ "Entity_[514026023457]": {
+ "Id": "Entity_[514026023457]",
+ "Name": "03_blue_sky",
+ "Components": {
+ "Component_[12222961627447331506]": {
+ "$type": "EditorMaterialComponent",
+ "Id": 12222961627447331506,
+ "Controller": {
+ "Configuration": {
+ "materials": {
+ "{}": {
+ "MaterialAsset": {
+ "assetId": {
+ "guid": "{65DF9715-8D50-5852-BDDF-345BF9A36AAF}"
+ },
+ "assetHint": "materials/presets/macbeth/03_blue_sky.azmaterial"
+ }
+ }
+ }
+ }
+ },
+ "materialSlotsByLodEnabled": true
+ },
+ "Component_[12780007764330464223]": {
+ "$type": "EditorVisibilityComponent",
+ "Id": 12780007764330464223
+ },
+ "Component_[12904863407657276829]": {
+ "$type": "EditorInspectorComponent",
+ "Id": 12904863407657276829,
+ "ComponentOrderEntryArray": [
+ {
+ "ComponentId": 7205597372613518510
+ },
+ {
+ "ComponentId": 8564054653851438099,
+ "SortIndex": 1
+ },
+ {
+ "ComponentId": 12222961627447331506,
+ "SortIndex": 2
+ }
+ ]
+ },
+ "Component_[13729618014821386240]": {
+ "$type": "EditorPendingCompositionComponent",
+ "Id": 13729618014821386240
+ },
+ "Component_[14429836600052599894]": {
+ "$type": "EditorEntityIconComponent",
+ "Id": 14429836600052599894
+ },
+ "Component_[14808014799413383215]": {
+ "$type": "EditorEntitySortComponent",
+ "Id": 14808014799413383215
+ },
+ "Component_[17252932649882883756]": {
+ "$type": "SelectionComponent",
+ "Id": 17252932649882883756
+ },
+ "Component_[2229055145450914672]": {
+ "$type": "EditorLockComponent",
+ "Id": 2229055145450914672
+ },
+ "Component_[2249882080644631374]": {
+ "$type": "EditorOnlyEntityComponent",
+ "Id": 2249882080644631374
+ },
+ "Component_[7205597372613518510]": {
+ "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent",
+ "Id": 7205597372613518510,
+ "Parent Entity": "Entity_[509731056161]",
+ "Transform Data": {
+ "Translate": [
+ -2.113382339477539,
+ -9.999999974752427e-7,
+ 0.0
+ ],
+ "Rotate": [
+ 0.0,
+ 0.0,
+ 180.00001525878906
+ ]
+ }
+ },
+ "Component_[7918371639409185899]": {
+ "$type": "EditorDisabledCompositionComponent",
+ "Id": 7918371639409185899
+ },
+ "Component_[8564054653851438099]": {
+ "$type": "AZ::Render::EditorMeshComponent",
+ "Id": 8564054653851438099,
+ "Controller": {
+ "Configuration": {
+ "ModelAsset": {
+ "assetId": {
+ "guid": "{D0F73AAF-52B7-507C-B045-DBE2FE2D4403}",
+ "subId": 268677693
+ },
+ "assetHint": "objects/shaderball_simple/shaberball_simple_1m.azmodel"
+ },
+ "LodOverride": 255
+ }
+ }
+ }
+ }
+ },
+ "Entity_[518320990753]": {
+ "Id": "Entity_[518320990753]",
+ "Name": "02_light_skin",
+ "Components": {
+ "Component_[12222961627447331506]": {
+ "$type": "EditorMaterialComponent",
+ "Id": 12222961627447331506,
+ "Controller": {
+ "Configuration": {
+ "materials": {
+ "{}": {
+ "MaterialAsset": {
+ "assetId": {
+ "guid": "{0B0603C9-E7C3-5166-98EC-F8B3A4D469FB}"
+ },
+ "assetHint": "materials/presets/macbeth/02_light_skin.azmaterial"
+ }
+ }
+ }
+ }
+ },
+ "materialSlotsByLodEnabled": true
+ },
+ "Component_[12780007764330464223]": {
+ "$type": "EditorVisibilityComponent",
+ "Id": 12780007764330464223
+ },
+ "Component_[12904863407657276829]": {
+ "$type": "EditorInspectorComponent",
+ "Id": 12904863407657276829,
+ "ComponentOrderEntryArray": [
+ {
+ "ComponentId": 7205597372613518510
+ },
+ {
+ "ComponentId": 8564054653851438099,
+ "SortIndex": 1
+ },
+ {
+ "ComponentId": 12222961627447331506,
+ "SortIndex": 2
+ }
+ ]
+ },
+ "Component_[13729618014821386240]": {
+ "$type": "EditorPendingCompositionComponent",
+ "Id": 13729618014821386240
+ },
+ "Component_[14429836600052599894]": {
+ "$type": "EditorEntityIconComponent",
+ "Id": 14429836600052599894
+ },
+ "Component_[14808014799413383215]": {
+ "$type": "EditorEntitySortComponent",
+ "Id": 14808014799413383215
+ },
+ "Component_[17252932649882883756]": {
+ "$type": "SelectionComponent",
+ "Id": 17252932649882883756
+ },
+ "Component_[2229055145450914672]": {
+ "$type": "EditorLockComponent",
+ "Id": 2229055145450914672
+ },
+ "Component_[2249882080644631374]": {
+ "$type": "EditorOnlyEntityComponent",
+ "Id": 2249882080644631374
+ },
+ "Component_[7205597372613518510]": {
+ "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent",
+ "Id": 7205597372613518510,
+ "Parent Entity": "Entity_[509731056161]",
+ "Transform Data": {
+ "Translate": [
+ -6.113382339477539,
+ -9.999999974752427e-7,
+ 0.0
+ ],
+ "Rotate": [
+ 0.0,
+ 0.0,
+ 180.00001525878906
+ ]
+ }
+ },
+ "Component_[7918371639409185899]": {
+ "$type": "EditorDisabledCompositionComponent",
+ "Id": 7918371639409185899
+ },
+ "Component_[8564054653851438099]": {
+ "$type": "AZ::Render::EditorMeshComponent",
+ "Id": 8564054653851438099,
+ "Controller": {
+ "Configuration": {
+ "ModelAsset": {
+ "assetId": {
+ "guid": "{D0F73AAF-52B7-507C-B045-DBE2FE2D4403}",
+ "subId": 268677693
+ },
+ "assetHint": "objects/shaderball_simple/shaberball_simple_1m.azmodel"
+ },
+ "LodOverride": 255
+ }
+ }
+ }
+ }
+ },
+ "Entity_[522615958049]": {
+ "Id": "Entity_[522615958049]",
+ "Name": "01_dark_skin",
+ "Components": {
+ "Component_[12222961627447331506]": {
+ "$type": "EditorMaterialComponent",
+ "Id": 12222961627447331506,
+ "Controller": {
+ "Configuration": {
+ "materials": {
+ "{}": {
+ "MaterialAsset": {
+ "assetId": {
+ "guid": "{73B6CE55-0766-51FD-8D9C-92C60862D270}"
+ },
+ "assetHint": "materials/presets/macbeth/01_dark_skin.azmaterial"
+ }
+ }
+ }
+ }
+ },
+ "materialSlotsByLodEnabled": true
+ },
+ "Component_[12780007764330464223]": {
+ "$type": "EditorVisibilityComponent",
+ "Id": 12780007764330464223
+ },
+ "Component_[12904863407657276829]": {
+ "$type": "EditorInspectorComponent",
+ "Id": 12904863407657276829,
+ "ComponentOrderEntryArray": [
+ {
+ "ComponentId": 7205597372613518510
+ },
+ {
+ "ComponentId": 8564054653851438099,
+ "SortIndex": 1
+ },
+ {
+ "ComponentId": 12222961627447331506,
+ "SortIndex": 2
+ }
+ ]
+ },
+ "Component_[13729618014821386240]": {
+ "$type": "EditorPendingCompositionComponent",
+ "Id": 13729618014821386240
+ },
+ "Component_[14429836600052599894]": {
+ "$type": "EditorEntityIconComponent",
+ "Id": 14429836600052599894
+ },
+ "Component_[14808014799413383215]": {
+ "$type": "EditorEntitySortComponent",
+ "Id": 14808014799413383215
+ },
+ "Component_[17252932649882883756]": {
+ "$type": "SelectionComponent",
+ "Id": 17252932649882883756
+ },
+ "Component_[2229055145450914672]": {
+ "$type": "EditorLockComponent",
+ "Id": 2229055145450914672
+ },
+ "Component_[2249882080644631374]": {
+ "$type": "EditorOnlyEntityComponent",
+ "Id": 2249882080644631374
+ },
+ "Component_[7205597372613518510]": {
+ "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent",
+ "Id": 7205597372613518510,
+ "Parent Entity": "Entity_[509731056161]",
+ "Transform Data": {
+ "Translate": [
+ -10.113382339477539,
+ -9.999999974752427e-7,
+ 0.0
+ ],
+ "Rotate": [
+ 0.0,
+ 0.0,
+ 180.00001525878906
+ ]
+ }
+ },
+ "Component_[7918371639409185899]": {
+ "$type": "EditorDisabledCompositionComponent",
+ "Id": 7918371639409185899
+ },
+ "Component_[8564054653851438099]": {
+ "$type": "AZ::Render::EditorMeshComponent",
+ "Id": 8564054653851438099,
+ "Controller": {
+ "Configuration": {
+ "ModelAsset": {
+ "assetId": {
+ "guid": "{D0F73AAF-52B7-507C-B045-DBE2FE2D4403}",
+ "subId": 268677693
+ },
+ "assetHint": "objects/shaderball_simple/shaberball_simple_1m.azmodel"
+ },
+ "LodOverride": 255
+ }
+ }
+ }
+ }
+ },
+ "Entity_[526910925345]": {
+ "Id": "Entity_[526910925345]",
+ "Name": "04_foliage",
+ "Components": {
+ "Component_[12222961627447331506]": {
+ "$type": "EditorMaterialComponent",
+ "Id": 12222961627447331506,
+ "Controller": {
+ "Configuration": {
+ "materials": {
+ "{}": {
+ "MaterialAsset": {
+ "assetId": {
+ "guid": "{C11C560D-F984-5836-928A-45CF96179862}"
+ },
+ "assetHint": "materials/presets/macbeth/04_foliage.azmaterial"
+ }
+ }
+ }
+ }
+ },
+ "materialSlotsByLodEnabled": true
+ },
+ "Component_[12780007764330464223]": {
+ "$type": "EditorVisibilityComponent",
+ "Id": 12780007764330464223
+ },
+ "Component_[12904863407657276829]": {
+ "$type": "EditorInspectorComponent",
+ "Id": 12904863407657276829,
+ "ComponentOrderEntryArray": [
+ {
+ "ComponentId": 7205597372613518510
+ },
+ {
+ "ComponentId": 8564054653851438099,
+ "SortIndex": 1
+ },
+ {
+ "ComponentId": 12222961627447331506,
+ "SortIndex": 2
+ }
+ ]
+ },
+ "Component_[13729618014821386240]": {
+ "$type": "EditorPendingCompositionComponent",
+ "Id": 13729618014821386240
+ },
+ "Component_[14429836600052599894]": {
+ "$type": "EditorEntityIconComponent",
+ "Id": 14429836600052599894
+ },
+ "Component_[14808014799413383215]": {
+ "$type": "EditorEntitySortComponent",
+ "Id": 14808014799413383215
+ },
+ "Component_[17252932649882883756]": {
+ "$type": "SelectionComponent",
+ "Id": 17252932649882883756
+ },
+ "Component_[2229055145450914672]": {
+ "$type": "EditorLockComponent",
+ "Id": 2229055145450914672
+ },
+ "Component_[2249882080644631374]": {
+ "$type": "EditorOnlyEntityComponent",
+ "Id": 2249882080644631374
+ },
+ "Component_[7205597372613518510]": {
+ "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent",
+ "Id": 7205597372613518510,
+ "Parent Entity": "Entity_[509731056161]",
+ "Transform Data": {
+ "Translate": [
+ 1.8866175413131714,
+ -9.999999974752427e-7,
+ 0.0
+ ],
+ "Rotate": [
+ 0.0,
+ 0.0,
+ 180.00001525878906
+ ]
+ }
+ },
+ "Component_[7918371639409185899]": {
+ "$type": "EditorDisabledCompositionComponent",
+ "Id": 7918371639409185899
+ },
+ "Component_[8564054653851438099]": {
+ "$type": "AZ::Render::EditorMeshComponent",
+ "Id": 8564054653851438099,
+ "Controller": {
+ "Configuration": {
+ "ModelAsset": {
+ "assetId": {
+ "guid": "{D0F73AAF-52B7-507C-B045-DBE2FE2D4403}",
+ "subId": 268677693
+ },
+ "assetHint": "objects/shaderball_simple/shaberball_simple_1m.azmodel"
+ },
+ "LodOverride": 255
+ }
+ }
+ }
+ }
+ },
+ "Entity_[531205892641]": {
+ "Id": "Entity_[531205892641]",
+ "Name": "05_blue_flower",
+ "Components": {
+ "Component_[12222961627447331506]": {
+ "$type": "EditorMaterialComponent",
+ "Id": 12222961627447331506,
+ "Controller": {
+ "Configuration": {
+ "materials": {
+ "{}": {
+ "MaterialAsset": {
+ "assetId": {
+ "guid": "{3326A6D9-FEA4-5CDE-AE4A-8BD28DF3A7CA}"
+ },
+ "assetHint": "materials/presets/macbeth/05_blue_flower.azmaterial"
+ }
+ }
+ }
+ }
+ },
+ "materialSlotsByLodEnabled": true
+ },
+ "Component_[12780007764330464223]": {
+ "$type": "EditorVisibilityComponent",
+ "Id": 12780007764330464223
+ },
+ "Component_[12904863407657276829]": {
+ "$type": "EditorInspectorComponent",
+ "Id": 12904863407657276829,
+ "ComponentOrderEntryArray": [
+ {
+ "ComponentId": 7205597372613518510
+ },
+ {
+ "ComponentId": 8564054653851438099,
+ "SortIndex": 1
+ },
+ {
+ "ComponentId": 12222961627447331506,
+ "SortIndex": 2
+ }
+ ]
+ },
+ "Component_[13729618014821386240]": {
+ "$type": "EditorPendingCompositionComponent",
+ "Id": 13729618014821386240
+ },
+ "Component_[14429836600052599894]": {
+ "$type": "EditorEntityIconComponent",
+ "Id": 14429836600052599894
+ },
+ "Component_[14808014799413383215]": {
+ "$type": "EditorEntitySortComponent",
+ "Id": 14808014799413383215
+ },
+ "Component_[17252932649882883756]": {
+ "$type": "SelectionComponent",
+ "Id": 17252932649882883756
+ },
+ "Component_[2229055145450914672]": {
+ "$type": "EditorLockComponent",
+ "Id": 2229055145450914672
+ },
+ "Component_[2249882080644631374]": {
+ "$type": "EditorOnlyEntityComponent",
+ "Id": 2249882080644631374
+ },
+ "Component_[7205597372613518510]": {
+ "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent",
+ "Id": 7205597372613518510,
+ "Parent Entity": "Entity_[509731056161]",
+ "Transform Data": {
+ "Translate": [
+ 5.886617660522461,
+ -9.999999974752427e-7,
+ 0.0
+ ],
+ "Rotate": [
+ 0.0,
+ 0.0,
+ 180.00001525878906
+ ]
+ }
+ },
+ "Component_[7918371639409185899]": {
+ "$type": "EditorDisabledCompositionComponent",
+ "Id": 7918371639409185899
+ },
+ "Component_[8564054653851438099]": {
+ "$type": "AZ::Render::EditorMeshComponent",
+ "Id": 8564054653851438099,
+ "Controller": {
+ "Configuration": {
+ "ModelAsset": {
+ "assetId": {
+ "guid": "{D0F73AAF-52B7-507C-B045-DBE2FE2D4403}",
+ "subId": 268677693
+ },
+ "assetHint": "objects/shaderball_simple/shaberball_simple_1m.azmodel"
+ },
+ "LodOverride": 255
+ }
+ }
+ }
+ }
+ },
+ "Entity_[535500859937]": {
+ "Id": "Entity_[535500859937]",
+ "Name": "06_bluish_green",
+ "Components": {
+ "Component_[12222961627447331506]": {
+ "$type": "EditorMaterialComponent",
+ "Id": 12222961627447331506,
+ "Controller": {
+ "Configuration": {
+ "materials": {
+ "{}": {
+ "MaterialAsset": {
+ "assetId": {
+ "guid": "{BD7A8B80-242E-50CC-900F-9001945C5A0C}"
+ },
+ "assetHint": "materials/presets/macbeth/06_bluish_green.azmaterial"
+ }
+ }
+ }
+ }
+ },
+ "materialSlotsByLodEnabled": true
+ },
+ "Component_[12780007764330464223]": {
+ "$type": "EditorVisibilityComponent",
+ "Id": 12780007764330464223
+ },
+ "Component_[12904863407657276829]": {
+ "$type": "EditorInspectorComponent",
+ "Id": 12904863407657276829,
+ "ComponentOrderEntryArray": [
+ {
+ "ComponentId": 7205597372613518510
+ },
+ {
+ "ComponentId": 8564054653851438099,
+ "SortIndex": 1
+ },
+ {
+ "ComponentId": 12222961627447331506,
+ "SortIndex": 2
+ }
+ ]
+ },
+ "Component_[13729618014821386240]": {
+ "$type": "EditorPendingCompositionComponent",
+ "Id": 13729618014821386240
+ },
+ "Component_[14429836600052599894]": {
+ "$type": "EditorEntityIconComponent",
+ "Id": 14429836600052599894
+ },
+ "Component_[14808014799413383215]": {
+ "$type": "EditorEntitySortComponent",
+ "Id": 14808014799413383215
+ },
+ "Component_[17252932649882883756]": {
+ "$type": "SelectionComponent",
+ "Id": 17252932649882883756
+ },
+ "Component_[2229055145450914672]": {
+ "$type": "EditorLockComponent",
+ "Id": 2229055145450914672
+ },
+ "Component_[2249882080644631374]": {
+ "$type": "EditorOnlyEntityComponent",
+ "Id": 2249882080644631374
+ },
+ "Component_[7205597372613518510]": {
+ "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent",
+ "Id": 7205597372613518510,
+ "Parent Entity": "Entity_[509731056161]",
+ "Transform Data": {
+ "Translate": [
+ 9.886617660522461,
+ -9.999999974752427e-7,
+ 0.0
+ ],
+ "Rotate": [
+ 0.0,
+ 0.0,
+ 180.00001525878906
+ ]
+ }
+ },
+ "Component_[7918371639409185899]": {
+ "$type": "EditorDisabledCompositionComponent",
+ "Id": 7918371639409185899
+ },
+ "Component_[8564054653851438099]": {
+ "$type": "AZ::Render::EditorMeshComponent",
+ "Id": 8564054653851438099,
+ "Controller": {
+ "Configuration": {
+ "ModelAsset": {
+ "assetId": {
+ "guid": "{D0F73AAF-52B7-507C-B045-DBE2FE2D4403}",
+ "subId": 268677693
+ },
+ "assetHint": "objects/shaderball_simple/shaberball_simple_1m.azmodel"
+ },
+ "LodOverride": 255
+ }
+ }
+ }
+ }
+ },
+ "Entity_[539795827233]": {
+ "Id": "Entity_[539795827233]",
+ "Name": "Row",
+ "Components": {
+ "Component_[10247332857034196288]": {
+ "$type": "EditorDisabledCompositionComponent",
+ "Id": 10247332857034196288
+ },
+ "Component_[1050259146293298025]": {
+ "$type": "EditorOnlyEntityComponent",
+ "Id": 1050259146293298025
+ },
+ "Component_[10963468433108777551]": {
+ "$type": "EditorInspectorComponent",
+ "Id": 10963468433108777551,
+ "ComponentOrderEntryArray": [
+ {
+ "ComponentId": 5648156935684358836
+ }
+ ]
+ },
+ "Component_[11044618010943237536]": {
+ "$type": "EditorEntityIconComponent",
+ "Id": 11044618010943237536
+ },
+ "Component_[11056805018150955063]": {
+ "$type": "EditorEntitySortComponent",
+ "Id": 11056805018150955063,
+ "ChildEntityOrderEntryArray": [
+ {
+ "EntityId": "Entity_[552680729121]"
+ },
+ {
+ "EntityId": "Entity_[548385761825]",
+ "SortIndex": 1
+ },
+ {
+ "EntityId": "Entity_[544090794529]",
+ "SortIndex": 2
+ },
+ {
+ "EntityId": "Entity_[556975696417]",
+ "SortIndex": 3
+ },
+ {
+ "EntityId": "Entity_[561270663713]",
+ "SortIndex": 4
+ },
+ {
+ "EntityId": "Entity_[565565631009]",
+ "SortIndex": 5
+ }
+ ]
+ },
+ "Component_[11466054095979053511]": {
+ "$type": "EditorPendingCompositionComponent",
+ "Id": 11466054095979053511
+ },
+ "Component_[1364058654406679998]": {
+ "$type": "SelectionComponent",
+ "Id": 1364058654406679998
+ },
+ "Component_[1550934027474222562]": {
+ "$type": "EditorVisibilityComponent",
+ "Id": 1550934027474222562
+ },
+ "Component_[15938036103959223730]": {
+ "$type": "EditorLockComponent",
+ "Id": 15938036103959223730
+ },
+ "Component_[5648156935684358836]": {
+ "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent",
+ "Id": 5648156935684358836,
+ "Parent Entity": "Entity_[471076350497]",
+ "Transform Data": {
+ "Translate": [
+ 0.0,
+ -2.0,
+ 1.0
+ ]
+ }
+ }
+ }
+ },
+ "Entity_[544090794529]": {
+ "Id": "Entity_[544090794529]",
+ "Name": "15_red",
+ "Components": {
+ "Component_[12222961627447331506]": {
+ "$type": "EditorMaterialComponent",
+ "Id": 12222961627447331506,
+ "Controller": {
+ "Configuration": {
+ "materials": {
+ "{}": {
+ "MaterialAsset": {
+ "assetId": {
+ "guid": "{9C47066E-BD8F-5C1B-B935-933296BBE312}"
+ },
+ "assetHint": "materials/presets/macbeth/15_red.azmaterial"
+ }
+ }
+ }
+ }
+ },
+ "materialSlotsByLodEnabled": true
+ },
+ "Component_[12780007764330464223]": {
+ "$type": "EditorVisibilityComponent",
+ "Id": 12780007764330464223
+ },
+ "Component_[12904863407657276829]": {
+ "$type": "EditorInspectorComponent",
+ "Id": 12904863407657276829,
+ "ComponentOrderEntryArray": [
+ {
+ "ComponentId": 7205597372613518510
+ },
+ {
+ "ComponentId": 8564054653851438099,
+ "SortIndex": 1
+ },
+ {
+ "ComponentId": 12222961627447331506,
+ "SortIndex": 2
+ }
+ ]
+ },
+ "Component_[13729618014821386240]": {
+ "$type": "EditorPendingCompositionComponent",
+ "Id": 13729618014821386240
+ },
+ "Component_[14429836600052599894]": {
+ "$type": "EditorEntityIconComponent",
+ "Id": 14429836600052599894
+ },
+ "Component_[14808014799413383215]": {
+ "$type": "EditorEntitySortComponent",
+ "Id": 14808014799413383215
+ },
+ "Component_[17252932649882883756]": {
+ "$type": "SelectionComponent",
+ "Id": 17252932649882883756
+ },
+ "Component_[2229055145450914672]": {
+ "$type": "EditorLockComponent",
+ "Id": 2229055145450914672
+ },
+ "Component_[2249882080644631374]": {
+ "$type": "EditorOnlyEntityComponent",
+ "Id": 2249882080644631374
+ },
+ "Component_[7205597372613518510]": {
+ "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent",
+ "Id": 7205597372613518510,
+ "Parent Entity": "Entity_[539795827233]",
+ "Transform Data": {
+ "Translate": [
+ -2.113382339477539,
+ -9.999999974752427e-7,
+ 0.0
+ ],
+ "Rotate": [
+ 0.0,
+ 0.0,
+ 180.00001525878906
+ ]
+ }
+ },
+ "Component_[7918371639409185899]": {
+ "$type": "EditorDisabledCompositionComponent",
+ "Id": 7918371639409185899
+ },
+ "Component_[8564054653851438099]": {
+ "$type": "AZ::Render::EditorMeshComponent",
+ "Id": 8564054653851438099,
+ "Controller": {
+ "Configuration": {
+ "ModelAsset": {
+ "assetId": {
+ "guid": "{D0F73AAF-52B7-507C-B045-DBE2FE2D4403}",
+ "subId": 268677693
+ },
+ "assetHint": "objects/shaderball_simple/shaberball_simple_1m.azmodel"
+ },
+ "LodOverride": 255
+ }
+ }
+ }
+ }
+ },
+ "Entity_[548385761825]": {
+ "Id": "Entity_[548385761825]",
+ "Name": "14_green",
+ "Components": {
+ "Component_[12222961627447331506]": {
+ "$type": "EditorMaterialComponent",
+ "Id": 12222961627447331506,
+ "Controller": {
+ "Configuration": {
+ "materials": {
+ "{}": {
+ "MaterialAsset": {
+ "assetId": {
+ "guid": "{82346ED7-D369-5EF0-A7E0-70C1082EE073}"
+ },
+ "assetHint": "materials/presets/macbeth/14_green.azmaterial"
+ }
+ }
+ }
+ }
+ },
+ "materialSlotsByLodEnabled": true
+ },
+ "Component_[12780007764330464223]": {
+ "$type": "EditorVisibilityComponent",
+ "Id": 12780007764330464223
+ },
+ "Component_[12904863407657276829]": {
+ "$type": "EditorInspectorComponent",
+ "Id": 12904863407657276829,
+ "ComponentOrderEntryArray": [
+ {
+ "ComponentId": 7205597372613518510
+ },
+ {
+ "ComponentId": 8564054653851438099,
+ "SortIndex": 1
+ },
+ {
+ "ComponentId": 12222961627447331506,
+ "SortIndex": 2
+ }
+ ]
+ },
+ "Component_[13729618014821386240]": {
+ "$type": "EditorPendingCompositionComponent",
+ "Id": 13729618014821386240
+ },
+ "Component_[14429836600052599894]": {
+ "$type": "EditorEntityIconComponent",
+ "Id": 14429836600052599894
+ },
+ "Component_[14808014799413383215]": {
+ "$type": "EditorEntitySortComponent",
+ "Id": 14808014799413383215
+ },
+ "Component_[17252932649882883756]": {
+ "$type": "SelectionComponent",
+ "Id": 17252932649882883756
+ },
+ "Component_[2229055145450914672]": {
+ "$type": "EditorLockComponent",
+ "Id": 2229055145450914672
+ },
+ "Component_[2249882080644631374]": {
+ "$type": "EditorOnlyEntityComponent",
+ "Id": 2249882080644631374
+ },
+ "Component_[7205597372613518510]": {
+ "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent",
+ "Id": 7205597372613518510,
+ "Parent Entity": "Entity_[539795827233]",
+ "Transform Data": {
+ "Translate": [
+ -6.113382339477539,
+ -9.999999974752427e-7,
+ 0.0
+ ],
+ "Rotate": [
+ 0.0,
+ 0.0,
+ 180.00001525878906
+ ]
+ }
+ },
+ "Component_[7918371639409185899]": {
+ "$type": "EditorDisabledCompositionComponent",
+ "Id": 7918371639409185899
+ },
+ "Component_[8564054653851438099]": {
+ "$type": "AZ::Render::EditorMeshComponent",
+ "Id": 8564054653851438099,
+ "Controller": {
+ "Configuration": {
+ "ModelAsset": {
+ "assetId": {
+ "guid": "{D0F73AAF-52B7-507C-B045-DBE2FE2D4403}",
+ "subId": 268677693
+ },
+ "assetHint": "objects/shaderball_simple/shaberball_simple_1m.azmodel"
+ },
+ "LodOverride": 255
+ }
+ }
+ }
+ }
+ },
+ "Entity_[552680729121]": {
+ "Id": "Entity_[552680729121]",
+ "Name": "13_blue",
+ "Components": {
+ "Component_[12222961627447331506]": {
+ "$type": "EditorMaterialComponent",
+ "Id": 12222961627447331506,
+ "Controller": {
+ "Configuration": {
+ "materials": {
+ "{}": {
+ "MaterialAsset": {
+ "assetId": {
+ "guid": "{B8972ADB-DBA9-5807-9742-2B14453FDD96}"
+ },
+ "assetHint": "materials/presets/macbeth/13_blue.azmaterial"
+ }
+ }
+ }
+ }
+ },
+ "materialSlotsByLodEnabled": true
+ },
+ "Component_[12780007764330464223]": {
+ "$type": "EditorVisibilityComponent",
+ "Id": 12780007764330464223
+ },
+ "Component_[12904863407657276829]": {
+ "$type": "EditorInspectorComponent",
+ "Id": 12904863407657276829,
+ "ComponentOrderEntryArray": [
+ {
+ "ComponentId": 7205597372613518510
+ },
+ {
+ "ComponentId": 8564054653851438099,
+ "SortIndex": 1
+ },
+ {
+ "ComponentId": 12222961627447331506,
+ "SortIndex": 2
+ }
+ ]
+ },
+ "Component_[13729618014821386240]": {
+ "$type": "EditorPendingCompositionComponent",
+ "Id": 13729618014821386240
+ },
+ "Component_[14429836600052599894]": {
+ "$type": "EditorEntityIconComponent",
+ "Id": 14429836600052599894
+ },
+ "Component_[14808014799413383215]": {
+ "$type": "EditorEntitySortComponent",
+ "Id": 14808014799413383215
+ },
+ "Component_[17252932649882883756]": {
+ "$type": "SelectionComponent",
+ "Id": 17252932649882883756
+ },
+ "Component_[2229055145450914672]": {
+ "$type": "EditorLockComponent",
+ "Id": 2229055145450914672
+ },
+ "Component_[2249882080644631374]": {
+ "$type": "EditorOnlyEntityComponent",
+ "Id": 2249882080644631374
+ },
+ "Component_[7205597372613518510]": {
+ "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent",
+ "Id": 7205597372613518510,
+ "Parent Entity": "Entity_[539795827233]",
+ "Transform Data": {
+ "Translate": [
+ -10.113382339477539,
+ -9.999999974752427e-7,
+ 0.0
+ ],
+ "Rotate": [
+ 0.0,
+ 0.0,
+ 180.00001525878906
+ ]
+ }
+ },
+ "Component_[7918371639409185899]": {
+ "$type": "EditorDisabledCompositionComponent",
+ "Id": 7918371639409185899
+ },
+ "Component_[8564054653851438099]": {
+ "$type": "AZ::Render::EditorMeshComponent",
+ "Id": 8564054653851438099,
+ "Controller": {
+ "Configuration": {
+ "ModelAsset": {
+ "assetId": {
+ "guid": "{D0F73AAF-52B7-507C-B045-DBE2FE2D4403}",
+ "subId": 268677693
+ },
+ "assetHint": "objects/shaderball_simple/shaberball_simple_1m.azmodel"
+ },
+ "LodOverride": 255
+ }
+ }
+ }
+ }
+ },
+ "Entity_[556975696417]": {
+ "Id": "Entity_[556975696417]",
+ "Name": "16_yellow",
+ "Components": {
+ "Component_[12222961627447331506]": {
+ "$type": "EditorMaterialComponent",
+ "Id": 12222961627447331506,
+ "Controller": {
+ "Configuration": {
+ "materials": {
+ "{}": {
+ "MaterialAsset": {
+ "assetId": {
+ "guid": "{099BB2A1-F76E-5B77-BCFD-B0A6249F0EA3}"
+ },
+ "assetHint": "materials/presets/macbeth/16_yellow.azmaterial"
+ }
+ }
+ }
+ }
+ },
+ "materialSlotsByLodEnabled": true
+ },
+ "Component_[12780007764330464223]": {
+ "$type": "EditorVisibilityComponent",
+ "Id": 12780007764330464223
+ },
+ "Component_[12904863407657276829]": {
+ "$type": "EditorInspectorComponent",
+ "Id": 12904863407657276829,
+ "ComponentOrderEntryArray": [
+ {
+ "ComponentId": 7205597372613518510
+ },
+ {
+ "ComponentId": 8564054653851438099,
+ "SortIndex": 1
+ },
+ {
+ "ComponentId": 12222961627447331506,
+ "SortIndex": 2
+ }
+ ]
+ },
+ "Component_[13729618014821386240]": {
+ "$type": "EditorPendingCompositionComponent",
+ "Id": 13729618014821386240
+ },
+ "Component_[14429836600052599894]": {
+ "$type": "EditorEntityIconComponent",
+ "Id": 14429836600052599894
+ },
+ "Component_[14808014799413383215]": {
+ "$type": "EditorEntitySortComponent",
+ "Id": 14808014799413383215
+ },
+ "Component_[17252932649882883756]": {
+ "$type": "SelectionComponent",
+ "Id": 17252932649882883756
+ },
+ "Component_[2229055145450914672]": {
+ "$type": "EditorLockComponent",
+ "Id": 2229055145450914672
+ },
+ "Component_[2249882080644631374]": {
+ "$type": "EditorOnlyEntityComponent",
+ "Id": 2249882080644631374
+ },
+ "Component_[7205597372613518510]": {
+ "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent",
+ "Id": 7205597372613518510,
+ "Parent Entity": "Entity_[539795827233]",
+ "Transform Data": {
+ "Translate": [
+ 1.8866175413131714,
+ -9.999999974752427e-7,
+ 0.0
+ ],
+ "Rotate": [
+ 0.0,
+ 0.0,
+ 180.00001525878906
+ ]
+ }
+ },
+ "Component_[7918371639409185899]": {
+ "$type": "EditorDisabledCompositionComponent",
+ "Id": 7918371639409185899
+ },
+ "Component_[8564054653851438099]": {
+ "$type": "AZ::Render::EditorMeshComponent",
+ "Id": 8564054653851438099,
+ "Controller": {
+ "Configuration": {
+ "ModelAsset": {
+ "assetId": {
+ "guid": "{D0F73AAF-52B7-507C-B045-DBE2FE2D4403}",
+ "subId": 268677693
+ },
+ "assetHint": "objects/shaderball_simple/shaberball_simple_1m.azmodel"
+ },
+ "LodOverride": 255
+ }
+ }
+ }
+ }
+ },
+ "Entity_[561270663713]": {
+ "Id": "Entity_[561270663713]",
+ "Name": "17_magenta",
+ "Components": {
+ "Component_[12222961627447331506]": {
+ "$type": "EditorMaterialComponent",
+ "Id": 12222961627447331506,
+ "Controller": {
+ "Configuration": {
+ "materials": {
+ "{}": {
+ "MaterialAsset": {
+ "assetId": {
+ "guid": "{2A83451E-0FE6-508E-BAA2-6142AAA53C42}"
+ },
+ "assetHint": "materials/presets/macbeth/17_magenta.azmaterial"
+ }
+ }
+ }
+ }
+ },
+ "materialSlotsByLodEnabled": true
+ },
+ "Component_[12780007764330464223]": {
+ "$type": "EditorVisibilityComponent",
+ "Id": 12780007764330464223
+ },
+ "Component_[12904863407657276829]": {
+ "$type": "EditorInspectorComponent",
+ "Id": 12904863407657276829,
+ "ComponentOrderEntryArray": [
+ {
+ "ComponentId": 7205597372613518510
+ },
+ {
+ "ComponentId": 8564054653851438099,
+ "SortIndex": 1
+ },
+ {
+ "ComponentId": 12222961627447331506,
+ "SortIndex": 2
+ }
+ ]
+ },
+ "Component_[13729618014821386240]": {
+ "$type": "EditorPendingCompositionComponent",
+ "Id": 13729618014821386240
+ },
+ "Component_[14429836600052599894]": {
+ "$type": "EditorEntityIconComponent",
+ "Id": 14429836600052599894
+ },
+ "Component_[14808014799413383215]": {
+ "$type": "EditorEntitySortComponent",
+ "Id": 14808014799413383215
+ },
+ "Component_[17252932649882883756]": {
+ "$type": "SelectionComponent",
+ "Id": 17252932649882883756
+ },
+ "Component_[2229055145450914672]": {
+ "$type": "EditorLockComponent",
+ "Id": 2229055145450914672
+ },
+ "Component_[2249882080644631374]": {
+ "$type": "EditorOnlyEntityComponent",
+ "Id": 2249882080644631374
+ },
+ "Component_[7205597372613518510]": {
+ "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent",
+ "Id": 7205597372613518510,
+ "Parent Entity": "Entity_[539795827233]",
+ "Transform Data": {
+ "Translate": [
+ 5.886617660522461,
+ -9.999999974752427e-7,
+ 0.0
+ ],
+ "Rotate": [
+ 0.0,
+ 0.0,
+ 180.00001525878906
+ ]
+ }
+ },
+ "Component_[7918371639409185899]": {
+ "$type": "EditorDisabledCompositionComponent",
+ "Id": 7918371639409185899
+ },
+ "Component_[8564054653851438099]": {
+ "$type": "AZ::Render::EditorMeshComponent",
+ "Id": 8564054653851438099,
+ "Controller": {
+ "Configuration": {
+ "ModelAsset": {
+ "assetId": {
+ "guid": "{D0F73AAF-52B7-507C-B045-DBE2FE2D4403}",
+ "subId": 268677693
+ },
+ "assetHint": "objects/shaderball_simple/shaberball_simple_1m.azmodel"
+ },
+ "LodOverride": 255
+ }
+ }
+ }
+ }
+ },
+ "Entity_[565565631009]": {
+ "Id": "Entity_[565565631009]",
+ "Name": "18_cyan",
+ "Components": {
+ "Component_[12222961627447331506]": {
+ "$type": "EditorMaterialComponent",
+ "Id": 12222961627447331506,
+ "Controller": {
+ "Configuration": {
+ "materials": {
+ "{}": {
+ "MaterialAsset": {
+ "assetId": {
+ "guid": "{6949B983-05D6-50A4-9D43-A6CDAB2BF3F5}"
+ },
+ "assetHint": "materials/presets/macbeth/18_cyan.azmaterial"
+ }
+ }
+ }
+ }
+ },
+ "materialSlotsByLodEnabled": true
+ },
+ "Component_[12780007764330464223]": {
+ "$type": "EditorVisibilityComponent",
+ "Id": 12780007764330464223
+ },
+ "Component_[12904863407657276829]": {
+ "$type": "EditorInspectorComponent",
+ "Id": 12904863407657276829,
+ "ComponentOrderEntryArray": [
+ {
+ "ComponentId": 7205597372613518510
+ },
+ {
+ "ComponentId": 8564054653851438099,
+ "SortIndex": 1
+ },
+ {
+ "ComponentId": 12222961627447331506,
+ "SortIndex": 2
+ }
+ ]
+ },
+ "Component_[13729618014821386240]": {
+ "$type": "EditorPendingCompositionComponent",
+ "Id": 13729618014821386240
+ },
+ "Component_[14429836600052599894]": {
+ "$type": "EditorEntityIconComponent",
+ "Id": 14429836600052599894
+ },
+ "Component_[14808014799413383215]": {
+ "$type": "EditorEntitySortComponent",
+ "Id": 14808014799413383215
+ },
+ "Component_[17252932649882883756]": {
+ "$type": "SelectionComponent",
+ "Id": 17252932649882883756
+ },
+ "Component_[2229055145450914672]": {
+ "$type": "EditorLockComponent",
+ "Id": 2229055145450914672
+ },
+ "Component_[2249882080644631374]": {
+ "$type": "EditorOnlyEntityComponent",
+ "Id": 2249882080644631374
+ },
+ "Component_[7205597372613518510]": {
+ "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent",
+ "Id": 7205597372613518510,
+ "Parent Entity": "Entity_[539795827233]",
+ "Transform Data": {
+ "Translate": [
+ 9.886617660522461,
+ -9.999999974752427e-7,
+ 0.0
+ ],
+ "Rotate": [
+ 0.0,
+ 0.0,
+ 180.00001525878906
+ ]
+ }
+ },
+ "Component_[7918371639409185899]": {
+ "$type": "EditorDisabledCompositionComponent",
+ "Id": 7918371639409185899
+ },
+ "Component_[8564054653851438099]": {
+ "$type": "AZ::Render::EditorMeshComponent",
+ "Id": 8564054653851438099,
+ "Controller": {
+ "Configuration": {
+ "ModelAsset": {
+ "assetId": {
+ "guid": "{D0F73AAF-52B7-507C-B045-DBE2FE2D4403}",
+ "subId": 268677693
+ },
+ "assetHint": "objects/shaderball_simple/shaberball_simple_1m.azmodel"
+ },
+ "LodOverride": 255
+ }
+ }
+ }
+ }
+ },
+ "Entity_[569860598305]": {
+ "Id": "Entity_[569860598305]",
+ "Name": "Row",
+ "Components": {
+ "Component_[10247332857034196288]": {
+ "$type": "EditorDisabledCompositionComponent",
+ "Id": 10247332857034196288
+ },
+ "Component_[1050259146293298025]": {
+ "$type": "EditorOnlyEntityComponent",
+ "Id": 1050259146293298025
+ },
+ "Component_[10963468433108777551]": {
+ "$type": "EditorInspectorComponent",
+ "Id": 10963468433108777551,
+ "ComponentOrderEntryArray": [
+ {
+ "ComponentId": 5648156935684358836
+ }
+ ]
+ },
+ "Component_[11044618010943237536]": {
+ "$type": "EditorEntityIconComponent",
+ "Id": 11044618010943237536
+ },
+ "Component_[11056805018150955063]": {
+ "$type": "EditorEntitySortComponent",
+ "Id": 11056805018150955063,
+ "ChildEntityOrderEntryArray": [
+ {
+ "EntityId": "Entity_[582745500193]"
+ },
+ {
+ "EntityId": "Entity_[578450532897]",
+ "SortIndex": 1
+ },
+ {
+ "EntityId": "Entity_[574155565601]",
+ "SortIndex": 2
+ },
+ {
+ "EntityId": "Entity_[587040467489]",
+ "SortIndex": 3
+ },
+ {
+ "EntityId": "Entity_[591335434785]",
+ "SortIndex": 4
+ },
+ {
+ "EntityId": "Entity_[595630402081]",
+ "SortIndex": 5
+ }
+ ]
+ },
+ "Component_[11466054095979053511]": {
+ "$type": "EditorPendingCompositionComponent",
+ "Id": 11466054095979053511
+ },
+ "Component_[1364058654406679998]": {
+ "$type": "SelectionComponent",
+ "Id": 1364058654406679998
+ },
+ "Component_[1550934027474222562]": {
+ "$type": "EditorVisibilityComponent",
+ "Id": 1550934027474222562
+ },
+ "Component_[15938036103959223730]": {
+ "$type": "EditorLockComponent",
+ "Id": 15938036103959223730
+ },
+ "Component_[5648156935684358836]": {
+ "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent",
+ "Id": 5648156935684358836,
+ "Parent Entity": "Entity_[471076350497]",
+ "Transform Data": {
+ "Translate": [
+ 0.0,
+ -6.0,
+ 1.0
+ ]
+ }
+ }
+ }
+ },
+ "Entity_[574155565601]": {
+ "Id": "Entity_[574155565601]",
+ "Name": "21_neutral_6.5",
+ "Components": {
+ "Component_[12222961627447331506]": {
+ "$type": "EditorMaterialComponent",
+ "Id": 12222961627447331506,
+ "Controller": {
+ "Configuration": {
+ "materials": {
+ "{}": {
+ "MaterialAsset": {
+ "assetId": {
+ "guid": "{ADAA8BF6-1580-5684-A7F5-4B0150117375}"
+ },
+ "assetHint": "materials/presets/macbeth/21_neutral_6-5_0-44d.azmaterial"
+ }
+ }
+ }
+ }
+ },
+ "materialSlotsByLodEnabled": true
+ },
+ "Component_[12780007764330464223]": {
+ "$type": "EditorVisibilityComponent",
+ "Id": 12780007764330464223
+ },
+ "Component_[12904863407657276829]": {
+ "$type": "EditorInspectorComponent",
+ "Id": 12904863407657276829,
+ "ComponentOrderEntryArray": [
+ {
+ "ComponentId": 7205597372613518510
+ },
+ {
+ "ComponentId": 8564054653851438099,
+ "SortIndex": 1
+ },
+ {
+ "ComponentId": 12222961627447331506,
+ "SortIndex": 2
+ }
+ ]
+ },
+ "Component_[13729618014821386240]": {
+ "$type": "EditorPendingCompositionComponent",
+ "Id": 13729618014821386240
+ },
+ "Component_[14429836600052599894]": {
+ "$type": "EditorEntityIconComponent",
+ "Id": 14429836600052599894
+ },
+ "Component_[14808014799413383215]": {
+ "$type": "EditorEntitySortComponent",
+ "Id": 14808014799413383215
+ },
+ "Component_[17252932649882883756]": {
+ "$type": "SelectionComponent",
+ "Id": 17252932649882883756
+ },
+ "Component_[2229055145450914672]": {
+ "$type": "EditorLockComponent",
+ "Id": 2229055145450914672
+ },
+ "Component_[2249882080644631374]": {
+ "$type": "EditorOnlyEntityComponent",
+ "Id": 2249882080644631374
+ },
+ "Component_[7205597372613518510]": {
+ "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent",
+ "Id": 7205597372613518510,
+ "Parent Entity": "Entity_[569860598305]",
+ "Transform Data": {
+ "Translate": [
+ -2.113382339477539,
+ -9.999999974752427e-7,
+ 0.0
+ ],
+ "Rotate": [
+ 0.0,
+ 0.0,
+ 180.00001525878906
+ ]
+ }
+ },
+ "Component_[7918371639409185899]": {
+ "$type": "EditorDisabledCompositionComponent",
+ "Id": 7918371639409185899
+ },
+ "Component_[8564054653851438099]": {
+ "$type": "AZ::Render::EditorMeshComponent",
+ "Id": 8564054653851438099,
+ "Controller": {
+ "Configuration": {
+ "ModelAsset": {
+ "assetId": {
+ "guid": "{D0F73AAF-52B7-507C-B045-DBE2FE2D4403}",
+ "subId": 268677693
+ },
+ "assetHint": "objects/shaderball_simple/shaberball_simple_1m.azmodel"
+ },
+ "LodOverride": 255
+ }
+ }
+ }
+ }
+ },
+ "Entity_[578450532897]": {
+ "Id": "Entity_[578450532897]",
+ "Name": "20_neutral_8",
+ "Components": {
+ "Component_[12222961627447331506]": {
+ "$type": "EditorMaterialComponent",
+ "Id": 12222961627447331506,
+ "Controller": {
+ "Configuration": {
+ "materials": {
+ "{}": {
+ "MaterialAsset": {
+ "assetId": {
+ "guid": "{A9BAEC06-A3F6-53E9-9E3E-61E12048FC75}"
+ },
+ "assetHint": "materials/presets/macbeth/20_neutral_8-0_0-23d.azmaterial"
+ }
+ }
+ }
+ }
+ },
+ "materialSlotsByLodEnabled": true
+ },
+ "Component_[12780007764330464223]": {
+ "$type": "EditorVisibilityComponent",
+ "Id": 12780007764330464223
+ },
+ "Component_[12904863407657276829]": {
+ "$type": "EditorInspectorComponent",
+ "Id": 12904863407657276829,
+ "ComponentOrderEntryArray": [
+ {
+ "ComponentId": 7205597372613518510
+ },
+ {
+ "ComponentId": 8564054653851438099,
+ "SortIndex": 1
+ },
+ {
+ "ComponentId": 12222961627447331506,
+ "SortIndex": 2
+ }
+ ]
+ },
+ "Component_[13729618014821386240]": {
+ "$type": "EditorPendingCompositionComponent",
+ "Id": 13729618014821386240
+ },
+ "Component_[14429836600052599894]": {
+ "$type": "EditorEntityIconComponent",
+ "Id": 14429836600052599894
+ },
+ "Component_[14808014799413383215]": {
+ "$type": "EditorEntitySortComponent",
+ "Id": 14808014799413383215
+ },
+ "Component_[17252932649882883756]": {
+ "$type": "SelectionComponent",
+ "Id": 17252932649882883756
+ },
+ "Component_[2229055145450914672]": {
+ "$type": "EditorLockComponent",
+ "Id": 2229055145450914672
+ },
+ "Component_[2249882080644631374]": {
+ "$type": "EditorOnlyEntityComponent",
+ "Id": 2249882080644631374
+ },
+ "Component_[7205597372613518510]": {
+ "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent",
+ "Id": 7205597372613518510,
+ "Parent Entity": "Entity_[569860598305]",
+ "Transform Data": {
+ "Translate": [
+ -6.113382339477539,
+ -9.999999974752427e-7,
+ 0.0
+ ],
+ "Rotate": [
+ 0.0,
+ 0.0,
+ 180.00001525878906
+ ]
+ }
+ },
+ "Component_[7918371639409185899]": {
+ "$type": "EditorDisabledCompositionComponent",
+ "Id": 7918371639409185899
+ },
+ "Component_[8564054653851438099]": {
+ "$type": "AZ::Render::EditorMeshComponent",
+ "Id": 8564054653851438099,
+ "Controller": {
+ "Configuration": {
+ "ModelAsset": {
+ "assetId": {
+ "guid": "{D0F73AAF-52B7-507C-B045-DBE2FE2D4403}",
+ "subId": 268677693
+ },
+ "assetHint": "objects/shaderball_simple/shaberball_simple_1m.azmodel"
+ },
+ "LodOverride": 255
+ }
+ }
+ }
+ }
+ },
+ "Entity_[582745500193]": {
+ "Id": "Entity_[582745500193]",
+ "Name": "19_white_9.5",
+ "Components": {
+ "Component_[12222961627447331506]": {
+ "$type": "EditorMaterialComponent",
+ "Id": 12222961627447331506,
+ "Controller": {
+ "Configuration": {
+ "materials": {
+ "{}": {
+ "MaterialAsset": {
+ "assetId": {
+ "guid": "{94E3052F-2B5A-5C28-912A-C0FDC00F5CD3}"
+ },
+ "assetHint": "materials/presets/macbeth/19_white_9-5_0-05d.azmaterial"
+ }
+ }
+ }
+ }
+ },
+ "materialSlotsByLodEnabled": true
+ },
+ "Component_[12780007764330464223]": {
+ "$type": "EditorVisibilityComponent",
+ "Id": 12780007764330464223
+ },
+ "Component_[12904863407657276829]": {
+ "$type": "EditorInspectorComponent",
+ "Id": 12904863407657276829,
+ "ComponentOrderEntryArray": [
+ {
+ "ComponentId": 7205597372613518510
+ },
+ {
+ "ComponentId": 8564054653851438099,
+ "SortIndex": 1
+ },
+ {
+ "ComponentId": 12222961627447331506,
+ "SortIndex": 2
+ }
+ ]
+ },
+ "Component_[13729618014821386240]": {
+ "$type": "EditorPendingCompositionComponent",
+ "Id": 13729618014821386240
+ },
+ "Component_[14429836600052599894]": {
+ "$type": "EditorEntityIconComponent",
+ "Id": 14429836600052599894
+ },
+ "Component_[14808014799413383215]": {
+ "$type": "EditorEntitySortComponent",
+ "Id": 14808014799413383215
+ },
+ "Component_[17252932649882883756]": {
+ "$type": "SelectionComponent",
+ "Id": 17252932649882883756
+ },
+ "Component_[2229055145450914672]": {
+ "$type": "EditorLockComponent",
+ "Id": 2229055145450914672
+ },
+ "Component_[2249882080644631374]": {
+ "$type": "EditorOnlyEntityComponent",
+ "Id": 2249882080644631374
+ },
+ "Component_[7205597372613518510]": {
+ "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent",
+ "Id": 7205597372613518510,
+ "Parent Entity": "Entity_[569860598305]",
+ "Transform Data": {
+ "Translate": [
+ -10.113382339477539,
+ -9.999999974752427e-7,
+ 0.0
+ ],
+ "Rotate": [
+ 0.0,
+ 0.0,
+ 180.00001525878906
+ ]
+ }
+ },
+ "Component_[7918371639409185899]": {
+ "$type": "EditorDisabledCompositionComponent",
+ "Id": 7918371639409185899
+ },
+ "Component_[8564054653851438099]": {
+ "$type": "AZ::Render::EditorMeshComponent",
+ "Id": 8564054653851438099,
+ "Controller": {
+ "Configuration": {
+ "ModelAsset": {
+ "assetId": {
+ "guid": "{D0F73AAF-52B7-507C-B045-DBE2FE2D4403}",
+ "subId": 268677693
+ },
+ "assetHint": "objects/shaderball_simple/shaberball_simple_1m.azmodel"
+ },
+ "LodOverride": 255
+ }
+ }
+ }
+ }
+ },
+ "Entity_[587040467489]": {
+ "Id": "Entity_[587040467489]",
+ "Name": "22_neutral_5",
+ "Components": {
+ "Component_[12222961627447331506]": {
+ "$type": "EditorMaterialComponent",
+ "Id": 12222961627447331506,
+ "Controller": {
+ "Configuration": {
+ "materials": {
+ "{}": {
+ "MaterialAsset": {
+ "assetId": {
+ "guid": "{1E45E15B-8035-5775-B796-A77654CDB094}"
+ },
+ "assetHint": "materials/presets/macbeth/22_neutral_5-0_0-70d.azmaterial"
+ }
+ }
+ }
+ }
+ },
+ "materialSlotsByLodEnabled": true
+ },
+ "Component_[12780007764330464223]": {
+ "$type": "EditorVisibilityComponent",
+ "Id": 12780007764330464223
+ },
+ "Component_[12904863407657276829]": {
+ "$type": "EditorInspectorComponent",
+ "Id": 12904863407657276829,
+ "ComponentOrderEntryArray": [
+ {
+ "ComponentId": 7205597372613518510
+ },
+ {
+ "ComponentId": 8564054653851438099,
+ "SortIndex": 1
+ },
+ {
+ "ComponentId": 12222961627447331506,
+ "SortIndex": 2
+ }
+ ]
+ },
+ "Component_[13729618014821386240]": {
+ "$type": "EditorPendingCompositionComponent",
+ "Id": 13729618014821386240
+ },
+ "Component_[14429836600052599894]": {
+ "$type": "EditorEntityIconComponent",
+ "Id": 14429836600052599894
+ },
+ "Component_[14808014799413383215]": {
+ "$type": "EditorEntitySortComponent",
+ "Id": 14808014799413383215
+ },
+ "Component_[17252932649882883756]": {
+ "$type": "SelectionComponent",
+ "Id": 17252932649882883756
+ },
+ "Component_[2229055145450914672]": {
+ "$type": "EditorLockComponent",
+ "Id": 2229055145450914672
+ },
+ "Component_[2249882080644631374]": {
+ "$type": "EditorOnlyEntityComponent",
+ "Id": 2249882080644631374
+ },
+ "Component_[7205597372613518510]": {
+ "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent",
+ "Id": 7205597372613518510,
+ "Parent Entity": "Entity_[569860598305]",
+ "Transform Data": {
+ "Translate": [
+ 1.8866175413131714,
+ -9.999999974752427e-7,
+ 0.0
+ ],
+ "Rotate": [
+ 0.0,
+ 0.0,
+ 180.00001525878906
+ ]
+ }
+ },
+ "Component_[7918371639409185899]": {
+ "$type": "EditorDisabledCompositionComponent",
+ "Id": 7918371639409185899
+ },
+ "Component_[8564054653851438099]": {
+ "$type": "AZ::Render::EditorMeshComponent",
+ "Id": 8564054653851438099,
+ "Controller": {
+ "Configuration": {
+ "ModelAsset": {
+ "assetId": {
+ "guid": "{D0F73AAF-52B7-507C-B045-DBE2FE2D4403}",
+ "subId": 268677693
+ },
+ "assetHint": "objects/shaderball_simple/shaberball_simple_1m.azmodel"
+ },
+ "LodOverride": 255
+ }
+ }
+ }
+ }
+ },
+ "Entity_[591335434785]": {
+ "Id": "Entity_[591335434785]",
+ "Name": "23_neutral_3.5",
+ "Components": {
+ "Component_[12222961627447331506]": {
+ "$type": "EditorMaterialComponent",
+ "Id": 12222961627447331506,
+ "Controller": {
+ "Configuration": {
+ "materials": {
+ "{}": {
+ "MaterialAsset": {
+ "assetId": {
+ "guid": "{23C26041-7155-5FE2-8E12-FACFD52DA006}"
+ },
+ "assetHint": "materials/presets/macbeth/23_neutral_3-5_1-05d.azmaterial"
+ }
+ }
+ }
+ }
+ },
+ "materialSlotsByLodEnabled": true
+ },
+ "Component_[12780007764330464223]": {
+ "$type": "EditorVisibilityComponent",
+ "Id": 12780007764330464223
+ },
+ "Component_[12904863407657276829]": {
+ "$type": "EditorInspectorComponent",
+ "Id": 12904863407657276829,
+ "ComponentOrderEntryArray": [
+ {
+ "ComponentId": 7205597372613518510
+ },
+ {
+ "ComponentId": 8564054653851438099,
+ "SortIndex": 1
+ },
+ {
+ "ComponentId": 12222961627447331506,
+ "SortIndex": 2
+ }
+ ]
+ },
+ "Component_[13729618014821386240]": {
+ "$type": "EditorPendingCompositionComponent",
+ "Id": 13729618014821386240
+ },
+ "Component_[14429836600052599894]": {
+ "$type": "EditorEntityIconComponent",
+ "Id": 14429836600052599894
+ },
+ "Component_[14808014799413383215]": {
+ "$type": "EditorEntitySortComponent",
+ "Id": 14808014799413383215
+ },
+ "Component_[17252932649882883756]": {
+ "$type": "SelectionComponent",
+ "Id": 17252932649882883756
+ },
+ "Component_[2229055145450914672]": {
+ "$type": "EditorLockComponent",
+ "Id": 2229055145450914672
+ },
+ "Component_[2249882080644631374]": {
+ "$type": "EditorOnlyEntityComponent",
+ "Id": 2249882080644631374
+ },
+ "Component_[7205597372613518510]": {
+ "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent",
+ "Id": 7205597372613518510,
+ "Parent Entity": "Entity_[569860598305]",
+ "Transform Data": {
+ "Translate": [
+ 5.886617660522461,
+ -9.999999974752427e-7,
+ 0.0
+ ],
+ "Rotate": [
+ 0.0,
+ 0.0,
+ 180.00001525878906
+ ]
+ }
+ },
+ "Component_[7918371639409185899]": {
+ "$type": "EditorDisabledCompositionComponent",
+ "Id": 7918371639409185899
+ },
+ "Component_[8564054653851438099]": {
+ "$type": "AZ::Render::EditorMeshComponent",
+ "Id": 8564054653851438099,
+ "Controller": {
+ "Configuration": {
+ "ModelAsset": {
+ "assetId": {
+ "guid": "{D0F73AAF-52B7-507C-B045-DBE2FE2D4403}",
+ "subId": 268677693
+ },
+ "assetHint": "objects/shaderball_simple/shaberball_simple_1m.azmodel"
+ },
+ "LodOverride": 255
+ }
+ }
+ }
+ }
+ },
+ "Entity_[595630402081]": {
+ "Id": "Entity_[595630402081]",
+ "Name": "24_black_2",
+ "Components": {
+ "Component_[12222961627447331506]": {
+ "$type": "EditorMaterialComponent",
+ "Id": 12222961627447331506,
+ "Controller": {
+ "Configuration": {
+ "materials": {
+ "{}": {
+ "MaterialAsset": {
+ "assetId": {
+ "guid": "{1D83625A-4016-58F0-A94A-13B92B19F5B5}"
+ },
+ "assetHint": "materials/presets/macbeth/24_black_2-0_1-50d.azmaterial"
+ }
+ }
+ }
+ }
+ },
+ "materialSlotsByLodEnabled": true
+ },
+ "Component_[12780007764330464223]": {
+ "$type": "EditorVisibilityComponent",
+ "Id": 12780007764330464223
+ },
+ "Component_[12904863407657276829]": {
+ "$type": "EditorInspectorComponent",
+ "Id": 12904863407657276829,
+ "ComponentOrderEntryArray": [
+ {
+ "ComponentId": 7205597372613518510
+ },
+ {
+ "ComponentId": 8564054653851438099,
+ "SortIndex": 1
+ },
+ {
+ "ComponentId": 12222961627447331506,
+ "SortIndex": 2
+ }
+ ]
+ },
+ "Component_[13729618014821386240]": {
+ "$type": "EditorPendingCompositionComponent",
+ "Id": 13729618014821386240
+ },
+ "Component_[14429836600052599894]": {
+ "$type": "EditorEntityIconComponent",
+ "Id": 14429836600052599894
+ },
+ "Component_[14808014799413383215]": {
+ "$type": "EditorEntitySortComponent",
+ "Id": 14808014799413383215
+ },
+ "Component_[17252932649882883756]": {
+ "$type": "SelectionComponent",
+ "Id": 17252932649882883756
+ },
+ "Component_[2229055145450914672]": {
+ "$type": "EditorLockComponent",
+ "Id": 2229055145450914672
+ },
+ "Component_[2249882080644631374]": {
+ "$type": "EditorOnlyEntityComponent",
+ "Id": 2249882080644631374
+ },
+ "Component_[7205597372613518510]": {
+ "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent",
+ "Id": 7205597372613518510,
+ "Parent Entity": "Entity_[569860598305]",
+ "Transform Data": {
+ "Translate": [
+ 9.886617660522461,
+ -9.999999974752427e-7,
+ 0.0
+ ],
+ "Rotate": [
+ 0.0,
+ 0.0,
+ 180.00001525878906
+ ]
+ }
+ },
+ "Component_[7918371639409185899]": {
+ "$type": "EditorDisabledCompositionComponent",
+ "Id": 7918371639409185899
+ },
+ "Component_[8564054653851438099]": {
+ "$type": "AZ::Render::EditorMeshComponent",
+ "Id": 8564054653851438099,
+ "Controller": {
+ "Configuration": {
+ "ModelAsset": {
+ "assetId": {
+ "guid": "{D0F73AAF-52B7-507C-B045-DBE2FE2D4403}",
+ "subId": 268677693
+ },
+ "assetHint": "objects/shaderball_simple/shaberball_simple_1m.azmodel"
+ },
+ "LodOverride": 255
+ }
+ }
+ }
+ }
+ },
+ "Entity_[599925369377]": {
+ "Id": "Entity_[599925369377]",
+ "Name": "MacBeth_Chart",
+ "Components": {
+ "Component_[10911367092756441312]": {
+ "$type": "EditorLockComponent",
+ "Id": 10911367092756441312
+ },
+ "Component_[11487615730470734577]": {
+ "$type": "EditorEntitySortComponent",
+ "Id": 11487615730470734577
+ },
+ "Component_[1380862607750834390]": {
+ "$type": "EditorDisabledCompositionComponent",
+ "Id": 1380862607750834390
+ },
+ "Component_[17376808010180534107]": {
+ "$type": "EditorOnlyEntityComponent",
+ "Id": 17376808010180534107
+ },
+ "Component_[18051852481298910543]": {
+ "$type": "EditorPendingCompositionComponent",
+ "Id": 18051852481298910543
+ },
+ "Component_[2468310869499941539]": {
+ "$type": "EditorVisibilityComponent",
+ "Id": 2468310869499941539
+ },
+ "Component_[3104847651593575388]": {
+ "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent",
+ "Id": 3104847651593575388,
+ "Parent Entity": "Entity_[471076350497]",
+ "Transform Data": {
+ "Translate": [
+ 0.0,
+ 0.0,
+ 1.0
+ ],
+ "Scale": [
+ 24.748918533325195,
+ 24.748918533325195,
+ 24.748918533325195
+ ],
+ "UniformScale": 24.748918533325195
+ }
+ },
+ "Component_[4039743767801786212]": {
+ "$type": "AZ::Render::EditorMeshComponent",
+ "Id": 4039743767801786212,
+ "Controller": {
+ "Configuration": {
+ "ModelAsset": {
+ "assetId": {
+ "guid": "{767B3209-EDF7-503A-BF3D-6A69DAABC966}",
+ "subId": 285003870
+ },
+ "assetHint": "materialeditor/viewportmodels/plane_1x1.azmodel"
+ },
+ "LodOverride": 255
+ }
+ }
+ },
+ "Component_[4350883917310195183]": {
+ "$type": "EditorMaterialComponent",
+ "Id": 4350883917310195183,
+ "Controller": {
+ "Configuration": {
+ "materials": {
+ "{}": {
+ "MaterialAsset": {
+ "assetId": {
+ "guid": "{6BCA78B0-98F0-5843-A0D9-2FD6AB5B8B95}"
+ },
+ "assetHint": "materials/presets/macbeth/macbeth_lab_16bit_2014_srgb.azmaterial"
+ }
+ }
+ }
+ }
+ },
+ "materialSlotsByLodEnabled": true
+ },
+ "Component_[5382697958657080154]": {
+ "$type": "EditorInspectorComponent",
+ "Id": 5382697958657080154,
+ "ComponentOrderEntryArray": [
+ {
+ "ComponentId": 3104847651593575388
+ },
+ {
+ "ComponentId": 4039743767801786212,
+ "SortIndex": 1
+ },
+ {
+ "ComponentId": 4350883917310195183,
+ "SortIndex": 2
+ }
+ ]
+ },
+ "Component_[5944774294236360498]": {
+ "$type": "SelectionComponent",
+ "Id": 5944774294236360498
+ },
+ "Component_[7918181081161287223]": {
+ "$type": "EditorEntityIconComponent",
+ "Id": 7918181081161287223
+ }
+ }
+ },
+ "Entity_[604220336673]": {
+ "Id": "Entity_[604220336673]",
+ "Name": "Camera1",
+ "Components": {
+ "Component_[10875630838724467144]": {
+ "$type": "{CA11DA46-29FF-4083-B5F6-E02C3A8C3A3D} EditorCameraComponent",
+ "Id": 10875630838724467144,
+ "Controller": {
+ "Configuration": {
+ "EditorEntityId": 604220336673
+ }
+ }
+ },
+ "Component_[11853636775353879324]": {
+ "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent",
+ "Id": 11853636775353879324,
+ "Parent Entity": "Entity_[471076350497]",
+ "Transform Data": {
+ "Translate": [
+ -0.088332898914814,
+ -14.735246658325195,
+ 12.247514724731445
+ ],
+ "Rotate": [
+ -34.60991287231445,
+ 0.19504709541797638,
+ -0.282683789730072
+ ]
+ }
+ },
+ "Component_[14115131108729471373]": {
+ "$type": "EditorEntitySortComponent",
+ "Id": 14115131108729471373
+ },
+ "Component_[14490537709933782275]": {
+ "$type": "SelectionComponent",
+ "Id": 14490537709933782275
+ },
+ "Component_[15389860813854215395]": {
+ "$type": "EditorDisabledCompositionComponent",
+ "Id": 15389860813854215395
+ },
+ "Component_[16956210187152487952]": {
+ "$type": "EditorVisibilityComponent",
+ "Id": 16956210187152487952
+ },
+ "Component_[3120168445836073859]": {
+ "$type": "EditorInspectorComponent",
+ "Id": 3120168445836073859,
+ "ComponentOrderEntryArray": [
+ {
+ "ComponentId": 11853636775353879324
+ },
+ {
+ "ComponentId": 6418726603140010485,
+ "SortIndex": 1
+ },
+ {
+ "ComponentId": 6573470892650938647,
+ "SortIndex": 2
+ },
+ {
+ "ComponentId": 10875630838724467144,
+ "SortIndex": 3
+ },
+ {
+ "ComponentId": 9127356411199949930,
+ "SortIndex": 4
+ }
+ ]
+ },
+ "Component_[397791896240265054]": {
+ "$type": "EditorEntityIconComponent",
+ "Id": 397791896240265054
+ },
+ "Component_[6418726603140010485]": {
+ "$type": "AZ::Render::EditorExposureControlComponent",
+ "Id": 6418726603140010485,
+ "Controller": {
+ "Configuration": {
+ "ExposureControlType": 1,
+ "EyeAdaptationExposureMin": -10.0,
+ "EyeAdaptationExposureMax": 10.0
+ }
+ }
+ },
+ "Component_[6572845495569063152]": {
+ "$type": "EditorOnlyEntityComponent",
+ "Id": 6572845495569063152
+ },
+ "Component_[6573470892650938647]": {
+ "$type": "AZ::Render::EditorPostFxLayerComponent",
+ "Id": 6573470892650938647
+ },
+ "Component_[7175586201406734874]": {
+ "$type": "EditorLockComponent",
+ "Id": 7175586201406734874
+ },
+ "Component_[7393764569438584638]": {
+ "$type": "EditorPendingCompositionComponent",
+ "Id": 7393764569438584638
+ },
+ "Component_[9127356411199949930]": {
+ "$type": "GenericComponentWrapper",
+ "Id": 9127356411199949930,
+ "m_template": {
+ "$type": "FlyCameraInputComponent"
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/AutomatedTesting/Levels/macbeth_shaderballs/tags.txt b/AutomatedTesting/Levels/macbeth_shaderballs/tags.txt
new file mode 100644
index 0000000000..0d6c1880e7
--- /dev/null
+++ b/AutomatedTesting/Levels/macbeth_shaderballs/tags.txt
@@ -0,0 +1,12 @@
+0,0,0,0,0,0
+0,0,0,0,0,0
+0,0,0,0,0,0
+0,0,0,0,0,0
+0,0,0,0,0,0
+0,0,0,0,0,0
+0,0,0,0,0,0
+0,0,0,0,0,0
+0,0,0,0,0,0
+0,0,0,0,0,0
+0,0,0,0,0,0
+0,0,0,0,0,0
diff --git a/AutomatedTesting/Objects/sphere_5lods.fbx b/AutomatedTesting/Objects/sphere_5lods.fbx
new file mode 100644
index 0000000000..965738c933
--- /dev/null
+++ b/AutomatedTesting/Objects/sphere_5lods.fbx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7e169277bca473325281d5fe043cffc9196bd3ef46f6bffbea6e0b5e3b7194a1
+size 62700
diff --git a/AutomatedTesting/Objects/sphere_5lods.fbx.assetinfo b/AutomatedTesting/Objects/sphere_5lods.fbx.assetinfo
new file mode 100644
index 0000000000..d46cbf322a
--- /dev/null
+++ b/AutomatedTesting/Objects/sphere_5lods.fbx.assetinfo
@@ -0,0 +1,8 @@
+{
+ "values": [
+ {
+ "$type": "ScriptProcessorRule",
+ "scriptFilename": "Editor/Scripts/auto_lod.py"
+ }
+ ]
+}
diff --git a/AutomatedTesting/Registry/editorpreferences.setreg b/AutomatedTesting/Registry/editorpreferences.setreg
index b338d6acad..e76e04f9ba 100644
--- a/AutomatedTesting/Registry/editorpreferences.setreg
+++ b/AutomatedTesting/Registry/editorpreferences.setreg
@@ -1,7 +1,7 @@
{
"Amazon": {
"Preferences": {
- "EnablePrefabSystem": false
+ "EnablePrefabSystem": true
}
}
}
\ No newline at end of file
diff --git a/AutomatedTesting/TestAssets/RelativeProductPathsNotDependencies.txt b/AutomatedTesting/TestAssets/RelativeProductPathsNotDependencies.txt
index d3975ced7c..8084defe84 100644
--- a/AutomatedTesting/TestAssets/RelativeProductPathsNotDependencies.txt
+++ b/AutomatedTesting/TestAssets/RelativeProductPathsNotDependencies.txt
@@ -2,24 +2,24 @@ These tests are mostly done with files that have a different extension between s
The source scan is done first, and will catch files in the source path.
Product path searching is resolved using "endsWith" logic.
textures/_dev_purple.tif.streamingimage
-Back slashes, and project name in the path
-pc/textures/_dev_stucco.tif.streamingimage
+Back slashes
+textures\_dev_stucco.tif.streamingimage
Double back slashes
textures\\_dev_tan.tif.streamingimage
Casing doesn't match
TEXTURES/_DEV_WHITE.tif.streamingimage
Some files have multiple extensions, this verifies that won't trip up the scanner.
textures/_dev_yellow_light.tif.1002.imagemipchain
-Path inline textures/milestone2/ama_grey_02.tif.streamingimage test
+Path inline textures/_dev_woodland.tif.1002.imagemipchain test
Path after=textures/_dev_woodland.tif.streamingimage equal sign
Multiple paths on one line
-Multiple materials/am_grass1.mtl paths materials/am_rockground.mtl on one line
-Path before a UUID
-Path materials/floor_tile.mtl before B92667DC-9F5B-5D72-A29D-99219DD9B691 a UUID
-Path before an asset ID
-Path ui/milestone2menu.uicanvas before an 2ef92b8D044E5C278E2BB1AC0374A4E7:1002 asset ID
-Path after a UUID
-Path after CEAA362B4E505BCEB827CB92EF40A50E a project.json UUID
-Path after an asset ID
-Path after {A2482826-053D-5634-A27B-084B1326AAE5}:[1002] an libs/particles/milestone2particles.xml asset ID
+Multiple textures/_dev_yellow_light.tif.streamingimage paths textures/_dev_yellow_med.tif.1002.imagemipchain on one line
+Path before a UUID for SelfReferenceUUID text file
+Path textures/lights/flare01.tif.streamingimage before 33BCEE02-F322-5688-ABEE-534F6058593F a UUID
+Path before an asset ID for _dev_red image
+Path textures/test_texture_sequence/test_texture_sequence000.png.streamingimage before an 2ef92b8D044E5C278E2BB1AC0374A4E7:1002 asset ID
+Path after a UUID for SelfReferenceAssetID text file
+Path after 785A05D2-483E-5B43-A2B9-92ACDAE6E938 a textures/test_texture_sequence/test_texture_sequence001.png.streamingimage UUID
+Path after an asset ID for _dev_purple image file
+Path after {A2482826-053D-5634-A27B-084B1326AAE5}:[1002] an textures/_dev_purple_glass.tif.1002.imagemipchain asset ID
diff --git a/AutomatedTesting/TestAssets/RelativeSourcePathsNotDependencies.txt b/AutomatedTesting/TestAssets/RelativeSourcePathsNotDependencies.txt
index a5ae046b11..df3bcc896e 100644
--- a/AutomatedTesting/TestAssets/RelativeSourcePathsNotDependencies.txt
+++ b/AutomatedTesting/TestAssets/RelativeSourcePathsNotDependencies.txt
@@ -3,6 +3,6 @@ TestAssets/RelativeProductPathsNotDependencies.txt
Back slashes
TestAssets\WildcardScanTest1.txt
Casing doesn't match
-libs/particles/milestone2PARTICLES.XML
-Path inline project.json test
+TESTASSETS/ReportONEmISSINGdEPENDENCY.tXT
+Path inline TestAssets/InvalidAssetIdNoReport.txt test
Path after=textures/_dev_Purple.tif equal sign
diff --git a/AutomatedTesting/TestAssets/ValidAssetIdNotDependency.txt b/AutomatedTesting/TestAssets/ValidAssetIdNotDependency.txt
index 4cda459232..0b9df7c99d 100644
--- a/AutomatedTesting/TestAssets/ValidAssetIdNotDependency.txt
+++ b/AutomatedTesting/TestAssets/ValidAssetIdNotDependency.txt
@@ -1,5 +1,7 @@
+File extensions are separated from file names, so the missing dependency scanner doesn't find when scanning, and only finds the asset IDs in this file.
+
/textures /_dev_Purple . tif, the product ID is for one of the mips.
{A2482826-053D-5634-A27B-084B1326AAE5}:[1002]
_dev_Red . tif, another mip, different formatting.
-2ef92b8D044E5C278E2BB1AC0374A4E7:1003
+2ef92b8D044E5C278E2BB1AC0374A4E7:1000
_dev_White.tif, {D83B36F1-61A6-5001-B191-4D0CE282E236}-1002 asset ID inline.
diff --git a/AutomatedTesting/TestAssets/ValidUUIDsNotDependency.txt b/AutomatedTesting/TestAssets/ValidUUIDsNotDependency.txt
index 436d6fb628..91c518ef2f 100644
--- a/AutomatedTesting/TestAssets/ValidUUIDsNotDependency.txt
+++ b/AutomatedTesting/TestAssets/ValidUUIDsNotDependency.txt
@@ -1,18 +1,19 @@
Paths are broken up to avoid having them show up as relative path results.
+All references are to other text files in this folder, extensions are omitted to make sure only UUID scanning finds these references.
-This is the UUID for Materials / Default / AM_UV_v1_1K_source . png
-C67BEA9F-09FF-59AA-A7F0-A52B8F987508
-This is the UUID for libs / particles / milestone2particles . xml. This tests UUIDs without separators.
-6BDE282B49C957F7B0714B26579BCA9A
-This is the UUID for SelfReferenceUUID.txt. This tests UUIDs with mixed casing.
+This is the UUID for InvalidAssetIdNoReport
+E68A85B0-131D-5A82-B2D5-BC58EE4062AE
+This is the UUID for InvalidRelativePathsNoReport. This tests UUIDs without separators.
+B3EF12DD306C520EB0A8A6B0D031A195
+This is the UUID for SelfReferenceUUID. This tests UUIDs with mixed casing.
33bcee02F3225688ABEE534F6058593F
-This is a UUID mid-line B076CDDC-14DF-50F4-A5E9-7518ABB3E851, for project . json
+This is a UUID mid-line DD587FBE-16C8-5B98-AE3C-A9F8750B2692, for SelfReferencePath
-Two UUIDs on the same line
-Two UUIDs 345E5C660D6254FF8D0F7C8EE66A2249 mixed on A26C73D1837E5AE59E68F916FA7C3699 the same line
+InvalidUUIDNoReport and MaxIteration31Deep
+Two UUIDs 837412DF-D05F-576D-81AA-ACF360463749 mixed on 3F642A0FDC825696A70A1DA5709744DF the same line
Test UUIDs and Asset IDs mixed on the same line. Relative paths are handled in the relative path tests.
-UUID: slices / MuzzleFlash . slice, AssetID: TestsAssets / WildcardScanTest1 . txt
-This 747D31D71E62553592226173C49CF97E uuid is on the line with 1CB10C43F3245B93A294C602ADEF95F9:[0] a valid asset ID
-UUID: Objects / Lumbertank_turret . cgf, AssetID: TestsAssets / WildcardScanTest2 . txt
-This D92C4661C8985E19BD3597CB2318CFA6:[0] uuid is on the line with 37108522F50459499CD6C8D47A960CF1 a valid asset ID
+OnlyMatchesCorrectLengthUUIDs and WildcardScanTest1
+This 2545AD8B-1B9B-5F93-859D-D8DC1DC2B480 uuid is on the line with 1CB10C43F3245B93A294C602ADEF95F9:[0] a valid asset ID
+RelativeProductPathsNotDependencies and WildcardScanTest2
+This B772953CA08A5D209491530E87D11504:[0] uuid is on the line with D92C4661C8985E19BD3597CB2318CFA6 a valid asset ID
diff --git a/AutomatedTesting/cmake/CompilerSettings.cmake b/AutomatedTesting/cmake/CompilerSettings.cmake
new file mode 100644
index 0000000000..60bda1d45b
--- /dev/null
+++ b/AutomatedTesting/cmake/CompilerSettings.cmake
@@ -0,0 +1,13 @@
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+#
+
+# File to tweak compiler settings before compiler detection happens (before project() is called)
+# We dont have PAL enabled at this point, so we can only use pure-CMake variables
+if("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Linux")
+ include(cmake/Platform/Linux/CompilerSettings_linux.cmake)
+endif()
diff --git a/AutomatedTesting/EngineFinder.cmake b/AutomatedTesting/cmake/EngineFinder.cmake
similarity index 63%
rename from AutomatedTesting/EngineFinder.cmake
rename to AutomatedTesting/cmake/EngineFinder.cmake
index 0a34a43b77..15b96eb8a9 100644
--- a/AutomatedTesting/EngineFinder.cmake
+++ b/AutomatedTesting/cmake/EngineFinder.cmake
@@ -1,3 +1,4 @@
+# {BEGIN_LICENSE}
#
# 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.
@@ -5,18 +6,34 @@
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
#
+# {END_LICENSE}
# This file is copied during engine registration. Edits to this file will be lost next
# time a registration happens.
include_guard()
# Read the engine name from the project_json file
-file(READ ${CMAKE_CURRENT_LIST_DIR}/project.json project_json)
-set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${CMAKE_CURRENT_LIST_DIR}/project.json)
+file(READ ${CMAKE_CURRENT_SOURCE_DIR}/project.json project_json)
+set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/project.json)
string(JSON LY_ENGINE_NAME_TO_USE ERROR_VARIABLE json_error GET ${project_json} engine)
if(json_error)
- message(FATAL_ERROR "Unable to read key 'engine' from 'project.json', error: ${json_error}")
+ message(FATAL_ERROR "Unable to read key 'engine' from 'project.json'\nError: ${json_error}")
+endif()
+
+if(CMAKE_MODULE_PATH)
+ foreach(module_path ${CMAKE_MODULE_PATH})
+ if(EXISTS ${module_path}/Findo3de.cmake)
+ file(READ ${module_path}/../engine.json engine_json)
+ string(JSON engine_name ERROR_VARIABLE json_error GET ${engine_json} engine_name)
+ if(json_error)
+ message(FATAL_ERROR "Unable to read key 'engine_name' from 'engine.json'\nError: ${json_error}")
+ endif()
+ if(LY_ENGINE_NAME_TO_USE STREQUAL engine_name)
+ return() # Engine being forced through CMAKE_MODULE_PATH
+ endif()
+ endif()
+ endforeach()
endif()
if(DEFINED ENV{USERPROFILE} AND EXISTS $ENV{USERPROFILE})
@@ -25,6 +42,11 @@ else()
set(manifest_path $ENV{HOME}/.o3de/o3de_manifest.json) # Unix
endif()
+set(registration_error [=[
+Engine registration is required before configuring a project.
+Run 'scripts/o3de register --this-engine' from the engine root.
+]=])
+
# Read the ~/.o3de/o3de_manifest.json file and look through the 'engines_path' object.
# Find a key that matches LY_ENGINE_NAME_TO_USE and use that as the engine path.
if(EXISTS ${manifest_path})
@@ -33,36 +55,38 @@ if(EXISTS ${manifest_path})
string(JSON engines_path_count ERROR_VARIABLE json_error LENGTH ${manifest_json} engines_path)
if(json_error)
- message(FATAL_ERROR "Unable to read key 'engines_path' from '${manifest_path}', error: ${json_error}")
+ message(FATAL_ERROR "Unable to read key 'engines_path' from '${manifest_path}'\nError: ${json_error}\n${registration_error}")
endif()
string(JSON engines_path_type ERROR_VARIABLE json_error TYPE ${manifest_json} engines_path)
if(json_error OR NOT ${engines_path_type} STREQUAL "OBJECT")
- message(FATAL_ERROR "Type of 'engines_path' in '${manifest_path}' is not a JSON Object, error: ${json_error}")
+ message(FATAL_ERROR "Type of 'engines_path' in '${manifest_path}' is not a JSON Object\nError: ${json_error}")
endif()
math(EXPR engines_path_count "${engines_path_count}-1")
foreach(engine_path_index RANGE ${engines_path_count})
string(JSON engine_name ERROR_VARIABLE json_error MEMBER ${manifest_json} engines_path ${engine_path_index})
if(json_error)
- message(FATAL_ERROR "Unable to read 'engines_path/${engine_path_index}' from '${manifest_path}', error: ${json_error}")
+ message(FATAL_ERROR "Unable to read 'engines_path/${engine_path_index}' from '${manifest_path}'\nError: ${json_error}")
endif()
if(LY_ENGINE_NAME_TO_USE STREQUAL engine_name)
string(JSON engine_path ERROR_VARIABLE json_error GET ${manifest_json} engines_path ${engine_name})
if(json_error)
- message(FATAL_ERROR "Unable to read value from 'engines_path/${engine_name}', error: ${json_error}")
+ message(FATAL_ERROR "Unable to read value from 'engines_path/${engine_name}'\nError: ${json_error}")
endif()
if(engine_path)
list(APPEND CMAKE_MODULE_PATH "${engine_path}/cmake")
- break()
+ return()
endif()
endif()
endforeach()
+
+ message(FATAL_ERROR "The project.json uses engine name '${LY_ENGINE_NAME_TO_USE}' but no engine with that name has been registered.\n${registration_error}")
else()
# If the user is passing CMAKE_MODULE_PATH we assume thats where we will find the engine
if(NOT CMAKE_MODULE_PATH)
- message(FATAL_ERROR "Engine registration is required before configuring a project. Please register an engine by running 'scripts/o3de register --this-engine'")
+ message(FATAL_ERROR "O3DE Manifest file not found.\n${registration_error}")
endif()
endif()
diff --git a/Templates/DefaultProject/Template/cmake/Platform/Linux/CompilerSettings.cmake b/AutomatedTesting/cmake/Platform/Linux/CompilerSettings_linux.cmake
similarity index 100%
rename from Templates/DefaultProject/Template/cmake/Platform/Linux/CompilerSettings.cmake
rename to AutomatedTesting/cmake/Platform/Linux/CompilerSettings_linux.cmake
diff --git a/Code/Editor/2DViewport.cpp b/Code/Editor/2DViewport.cpp
index ed810aea29..4d0609907f 100644
--- a/Code/Editor/2DViewport.cpp
+++ b/Code/Editor/2DViewport.cpp
@@ -234,7 +234,7 @@ void Q2DViewport::UpdateContent(int flags)
}
//////////////////////////////////////////////////////////////////////////
-void Q2DViewport::OnRButtonDown(Qt::KeyboardModifiers modifiers, const QPoint& point)
+void Q2DViewport::OnRButtonDown([[maybe_unused]] Qt::KeyboardModifiers modifiers, const QPoint& point)
{
if (GetIEditor()->IsInGameMode())
{
@@ -246,9 +246,6 @@ void Q2DViewport::OnRButtonDown(Qt::KeyboardModifiers modifiers, const QPoint& p
setFocus();
}
- // Check Edit Tool.
- MouseCallback(eMouseRDown, point, modifiers);
-
SetCurrentCursor(STD_CURSOR_MOVE, QString());
// Save the mouse down position
@@ -273,17 +270,8 @@ void Q2DViewport::OnRButtonUp([[maybe_unused]] Qt::KeyboardModifiers modifiers,
}
//////////////////////////////////////////////////////////////////////////
-void Q2DViewport::OnMButtonDown(Qt::KeyboardModifiers modifiers, const QPoint& point)
+void Q2DViewport::OnMButtonDown([[maybe_unused]] Qt::KeyboardModifiers modifiers, const QPoint& point)
{
- ////////////////////////////////////////////////////////////////////////
- // User pressed the middle mouse button
- ////////////////////////////////////////////////////////////////////////
- // Check Edit Tool.
- if (MouseCallback(eMouseMDown, point, modifiers))
- {
- return;
- }
-
// Save the mouse down position
m_RMouseDownPos = point;
@@ -300,14 +288,8 @@ void Q2DViewport::OnMButtonDown(Qt::KeyboardModifiers modifiers, const QPoint& p
}
//////////////////////////////////////////////////////////////////////////
-void Q2DViewport::OnMButtonUp(Qt::KeyboardModifiers modifiers, const QPoint& point)
+void Q2DViewport::OnMButtonUp([[maybe_unused]] Qt::KeyboardModifiers modifiers, [[maybe_unused]] const QPoint& point)
{
- // Check Edit Tool.
- if (MouseCallback(eMouseMUp, point, modifiers))
- {
- return;
- }
-
SetViewMode(NothingMode);
ReleaseMouse();
@@ -547,13 +529,6 @@ QPoint Q2DViewport::WorldToView(const Vec3& wp) const
QPoint p = QPoint(static_cast(sp.x), static_cast(sp.y));
return p;
}
-//////////////////////////////////////////////////////////////////////////
-QPoint Q2DViewport::WorldToViewParticleEditor(const Vec3& wp, [[maybe_unused]] int width, [[maybe_unused]] int height) const //Eric@conffx implement for the children class of IDisplayViewport
-{
- Vec3 sp = m_screenTM.TransformPoint(wp);
- QPoint p = QPoint(static_cast(sp.x), static_cast(sp.y));
- return p;
-}
//////////////////////////////////////////////////////////////////////////
Vec3 Q2DViewport::ViewToWorld(const QPoint& vp, [[maybe_unused]] bool* collideWithTerrain, [[maybe_unused]] bool onlyTerrain, [[maybe_unused]] bool bSkipVegetation, [[maybe_unused]] bool bTestRenderMesh, [[maybe_unused]] bool* collideWithObject) const
diff --git a/Code/Editor/2DViewport.h b/Code/Editor/2DViewport.h
index 007c1a47d3..e89f4aed34 100644
--- a/Code/Editor/2DViewport.h
+++ b/Code/Editor/2DViewport.h
@@ -50,8 +50,6 @@ public:
//! Map world space position to viewport position.
QPoint WorldToView(const Vec3& wp) const override;
- QPoint WorldToViewParticleEditor(const Vec3& wp, int width, int height) const override; //Eric@conffx
-
//! Map viewport position to world space position.
Vec3 ViewToWorld(const QPoint& vp, bool* collideWithTerrain = nullptr, bool onlyTerrain = false, bool bSkipVegetation = false, bool bTestRenderMesh = false, bool* collideWithObject = nullptr) const override;
//! Map viewport position to world space ray from camera.
@@ -64,7 +62,6 @@ public:
// ovverided from CViewport.
float GetScreenScaleFactor(const Vec3& worldPoint) const override;
- float GetScreenScaleFactor([[maybe_unused]] const CCamera& camera, [[maybe_unused]] const Vec3& object_position) override { return 1; } //Eric@conffx
// Overrided from CViewport.
void OnDragSelectRectangle(const QRect &rect, bool bNormalizeRect = false) override;
diff --git a/Code/Editor/AboutDialog.ui b/Code/Editor/AboutDialog.ui
index a6c5bb5d52..09a7c18841 100644
--- a/Code/Editor/AboutDialog.ui
+++ b/Code/Editor/AboutDialog.ui
@@ -125,7 +125,7 @@
- General Availability
+ development
Qt::AutoText
diff --git a/Code/Editor/ActionManager.cpp b/Code/Editor/ActionManager.cpp
index ff74a2c208..4cc64a532e 100644
--- a/Code/Editor/ActionManager.cpp
+++ b/Code/Editor/ActionManager.cpp
@@ -152,15 +152,6 @@ ActionManager::ActionWrapper& ActionManager::ActionWrapper::SetMenu(DynamicMenu*
return *this;
}
-ActionManager::ActionWrapper& ActionManager::ActionWrapper::SetApplyHoverEffect()
-{
- // Our standard toolbar icons, when hovered on, get a white color effect.
- // But for this to work we need .pngs that look good with this effect, so this only works with the standard toolbars
- // and looks very ugly for other toolbars, including toolbars loaded from XML (which just show a white rectangle)
- m_action->setProperty("IconHasHoverEffect", true);
- return *this;
-}
-
ActionManager::ActionWrapper& ActionManager::ActionWrapper::SetReserved()
{
m_action->setProperty("Reserved", true);
diff --git a/Code/Editor/ActionManager.h b/Code/Editor/ActionManager.h
index 8879bdc1fb..58504f860c 100644
--- a/Code/Editor/ActionManager.h
+++ b/Code/Editor/ActionManager.h
@@ -151,7 +151,6 @@ public:
}
ActionWrapper& SetMenu(DynamicMenu* menu);
- ActionWrapper& SetApplyHoverEffect();
operator QAction*() const {
return m_action;
diff --git a/Code/Editor/Animation/AnimationBipedBoneNames.cpp b/Code/Editor/Animation/AnimationBipedBoneNames.cpp
index d9f1b845ca..72502fe61d 100644
--- a/Code/Editor/Animation/AnimationBipedBoneNames.cpp
+++ b/Code/Editor/Animation/AnimationBipedBoneNames.cpp
@@ -10,24 +10,21 @@
#include "AnimationBipedBoneNames.h"
-namespace EditorAnimationBones
+namespace EditorAnimationBones::Biped
{
- namespace Biped
- {
- const char* Pelvis = "Bip01 Pelvis";
- const char* Head = "Bip01 Head";
- const char* Weapon = "weapon_bone";
+ const char* Pelvis = "Bip01 Pelvis";
+ const char* Head = "Bip01 Head";
+ const char* Weapon = "weapon_bone";
- const char* LeftEye = "eye_bone_left";
- const char* RightEye = "eye_bone_right";
+ const char* LeftEye = "eye_bone_left";
+ const char* RightEye = "eye_bone_right";
- const char* Spine[5] = { "Bip01 Spine", "Bip01 Spine1", "Bip01 Spine2", "Bip01 Spine3", "Bip01 Spine4" };
- const char* Neck[2] = { "Bip01 Neck", "Bip01 Neck1" };
+ const char* Spine[5] = { "Bip01 Spine", "Bip01 Spine1", "Bip01 Spine2", "Bip01 Spine3", "Bip01 Spine4" };
+ const char* Neck[2] = { "Bip01 Neck", "Bip01 Neck1" };
- const char* LeftHeel = "Bip01 L Heel";
- const char* LeftToe[2] = { "Bip01 L Toe0", "Bip01 L Toe1" };
+ const char* LeftHeel = "Bip01 L Heel";
+ const char* LeftToe[2] = { "Bip01 L Toe0", "Bip01 L Toe1" };
- const char* RightHeel = "Bip01 R Heel";
- const char* RightToe[2] = { "Bip01 R Toe0", "Bip01 R Toe1" };
- }
-}
+ const char* RightHeel = "Bip01 R Heel";
+ const char* RightToe[2] = { "Bip01 R Toe0", "Bip01 R Toe1" };
+} // namespace EditorAnimationBones::Biped
diff --git a/Code/Editor/AnimationContext.cpp b/Code/Editor/AnimationContext.cpp
index fce1150878..51dd8deefc 100644
--- a/Code/Editor/AnimationContext.cpp
+++ b/Code/Editor/AnimationContext.cpp
@@ -21,6 +21,8 @@
#include "Include/IObjectManager.h"
#include "Objects/EntityObject.h"
+#include
+
//////////////////////////////////////////////////////////////////////////
// Movie Callback.
//////////////////////////////////////////////////////////////////////////
@@ -499,25 +501,24 @@ void CAnimationContext::Update()
return;
}
- ITimer* pTimer = GetIEditor()->GetSystem()->GetITimer();
+ const AZ::TimeUs frameDeltaTimeUs = AZ::GetSimulationTickDeltaTimeUs();
+ const float frameDeltaTime = AZ::TimeUsToSeconds(frameDeltaTimeUs);
if (!m_bAutoRecording)
{
AnimateActiveSequence();
- float dt = pTimer->GetFrameTime();
- m_currTime += dt * m_fTimeScale;
+ m_currTime += frameDeltaTime * m_fTimeScale;
if (!m_recording)
{
- GetIEditor()->GetMovieSystem()->PreUpdate(dt);
- GetIEditor()->GetMovieSystem()->PostUpdate(dt);
+ GetIEditor()->GetMovieSystem()->PreUpdate(frameDeltaTime);
+ GetIEditor()->GetMovieSystem()->PostUpdate(frameDeltaTime);
}
}
else
{
- float dt = pTimer->GetFrameTime();
- m_fRecordingCurrTime += dt * m_fTimeScale;
+ m_fRecordingCurrTime += frameDeltaTime * m_fTimeScale;
if (fabs(m_fRecordingCurrTime - m_currTime) > m_fRecordingTimeStep)
{
m_currTime += m_fRecordingTimeStep;
@@ -644,7 +645,9 @@ void CAnimationContext::OnPostRender()
{
SAnimContext ac;
ac.dt = 0;
- ac.fps = GetIEditor()->GetSystem()->GetITimer()->GetFrameRate();
+ const AZ::TimeUs frameDeltaTimeUs = AZ::GetSimulationTickDeltaTimeUs();
+ const float frameDeltaTime = AZ::TimeUsToSeconds(frameDeltaTimeUs);
+ ac.fps = 1.0f / frameDeltaTime;
ac.time = m_currTime;
ac.singleFrame = true;
ac.forcePlay = true;
@@ -797,7 +800,9 @@ void CAnimationContext::AnimateActiveSequence()
SAnimContext ac;
ac.dt = 0;
- ac.fps = GetIEditor()->GetSystem()->GetITimer()->GetFrameRate();
+ const AZ::TimeUs frameDeltaTimeUs = AZ::GetSimulationTickDeltaTimeUs();
+ const float frameDeltaTime = AZ::TimeUsToSeconds(frameDeltaTimeUs);
+ ac.fps = 1.0f / frameDeltaTime;
ac.time = m_currTime;
ac.singleFrame = true;
ac.forcePlay = true;
diff --git a/Code/Editor/AssetImporter/AssetImporterManager/AssetImporterManager.cpp b/Code/Editor/AssetImporter/AssetImporterManager/AssetImporterManager.cpp
index b721b8759e..baa287e47f 100644
--- a/Code/Editor/AssetImporter/AssetImporterManager/AssetImporterManager.cpp
+++ b/Code/Editor/AssetImporter/AssetImporterManager/AssetImporterManager.cpp
@@ -140,7 +140,7 @@ bool AssetImporterManager::OnBrowseFiles()
bool encounteredCrate = false;
QStringList invalidFiles;
- for (QString path : fileDialog.selectedFiles())
+ for (const QString& path : fileDialog.selectedFiles())
{
QString fileName = GetFileName(path);
QFileInfo info(path);
diff --git a/Code/Editor/AzAssetBrowser/AzAssetBrowserRequestHandler.cpp b/Code/Editor/AzAssetBrowser/AzAssetBrowserRequestHandler.cpp
index 1c2be16a3d..6fc10e379a 100644
--- a/Code/Editor/AzAssetBrowser/AzAssetBrowserRequestHandler.cpp
+++ b/Code/Editor/AzAssetBrowser/AzAssetBrowserRequestHandler.cpp
@@ -199,41 +199,6 @@ namespace AzAssetBrowserRequestHandlerPrivate
}
}
}
-
- // Helper utility - determines if the thing being dragged is a FBX from the scene import pipeline
- // This is important to differentiate.
- // when someone drags a MTL file directly into the viewport, even from a FBX, we want to spawn it as a decal
- // but when someone drags a FBX that contains MTL files, we want only to spawn the meshes.
- // so we have to specifically differentiate here between the mimeData type that contains the source as the root
- // (dragging the fbx file itself)
- // and one which contains the actual product at its root.
-
- bool IsDragOfFBX(const QMimeData* mimeData)
- {
- AZStd::vector entries;
- if (!AssetBrowserEntry::FromMimeData(mimeData, entries))
- {
- // if mimedata does not even contain entries, no point in proceeding.
- return false;
- }
-
- for (auto entry : entries)
- {
- if (entry->GetEntryType() != AssetBrowserEntry::AssetEntryType::Source)
- {
- continue;
- }
- // this is a source file. Is it the filetype we're looking for?
- if (SourceAssetBrowserEntry* source = azrtti_cast(entry))
- {
- if (AzFramework::StringFunc::Equal(source->GetExtension().c_str(), ".fbx", false))
- {
- return true;
- }
- }
- }
- return false;
- }
}
AzAssetBrowserRequestHandler::AzAssetBrowserRequestHandler()
diff --git a/Code/Editor/BaseLibrary.cpp b/Code/Editor/BaseLibrary.cpp
index 9f26630c2c..15742bd254 100644
--- a/Code/Editor/BaseLibrary.cpp
+++ b/Code/Editor/BaseLibrary.cpp
@@ -14,66 +14,6 @@
#include "Include/IBaseLibraryManager.h"
#include
#include
-#include "Undo/IUndoObject.h"
-
-//////////////////////////////////////////////////////////////////////////
-// Undo functionality for libraries.
-//////////////////////////////////////////////////////////////////////////
-
-class CUndoBaseLibrary
- : public IUndoObject
-{
-public:
- CUndoBaseLibrary(CBaseLibrary* pLib, const QString& description, const QString& selectedItem = QString())
- : m_pLib(pLib)
- , m_description(description)
- , m_redo(nullptr)
- , m_selectedItem(selectedItem)
- {
- assert(m_pLib);
-
- m_undo = GetIEditor()->GetSystem()->CreateXmlNode("Undo");
- m_pLib->Serialize(m_undo, false);
- }
-
- QString GetEditorObjectName() override
- {
- return m_selectedItem;
- }
-
-protected:
- int GetSize() override { return sizeof(CUndoBaseLibrary); }
- QString GetDescription() override { return m_description; };
-
- void Undo(bool bUndo) override
- {
- if (bUndo)
- {
- m_redo = GetIEditor()->GetSystem()->CreateXmlNode("Redo");
- m_pLib->Serialize(m_redo, false);
- }
- m_pLib->Serialize(m_undo, true);
- m_pLib->SetModified();
- GetIEditor()->Notify(eNotify_OnDataBaseUpdate);
- }
-
- void Redo() override
- {
- m_pLib->Serialize(m_redo, true);
- m_pLib->SetModified();
- GetIEditor()->Notify(eNotify_OnDataBaseUpdate);
- }
-
-private:
- QString m_description;
- QString m_selectedItem;
- _smart_ptr m_pLib;
- XmlNodeRef m_undo;
- XmlNodeRef m_redo;
-};
-
-
-
//////////////////////////////////////////////////////////////////////////
// CBaseLibrary implementation.
diff --git a/Code/Editor/BaseLibraryItem.cpp b/Code/Editor/BaseLibraryItem.cpp
index b1fba91fad..e3788bc3e4 100644
--- a/Code/Editor/BaseLibraryItem.cpp
+++ b/Code/Editor/BaseLibraryItem.cpp
@@ -29,7 +29,6 @@ public:
assert(libMgr);
m_itemPath = libItem->GetFullName();
- m_description = "Lib item changed: " + m_itemPath;
//serialize the lib item to undo
m_undoCtx.node = GetIEditor()->GetSystem()->CreateXmlNode("Undo");
@@ -45,13 +44,8 @@ public:
m_size = sizeof(CUndoBaseLibraryItem);
m_size += static_cast(xmlStr.GetAllocatedMemory());
m_size += m_itemPath.length();
- m_size += m_description.length();
}
- QString GetEditorObjectName() override
- {
- return m_itemPath;
- }
protected:
int GetSize() override
@@ -59,11 +53,6 @@ protected:
return m_size;
}
- QString GetDescription() override
- {
- return m_description;
- }
-
void Undo(bool bUndo) override
{
//find the libItem
@@ -111,7 +100,6 @@ protected:
}
private:
- QString m_description;
QString m_itemPath;
IDataBaseItem::SerializeContext m_undoCtx; //saved before operation
IDataBaseItem::SerializeContext m_redoCtx; //saved after operation so used for redo
diff --git a/Code/Editor/BaseLibraryManager.cpp b/Code/Editor/BaseLibraryManager.cpp
index 7346ffaf8c..0e51a5238c 100644
--- a/Code/Editor/BaseLibraryManager.cpp
+++ b/Code/Editor/BaseLibraryManager.cpp
@@ -17,120 +17,6 @@
#include "ErrorReport.h"
#include "Undo/IUndoObject.h"
-
-///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-// Undo functionality for Managers, including add library, remove library, and rename library -- Vera, Confetti
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-class CUndoBaseLibraryManager
- : public IUndoObject
-{
-public:
- CUndoBaseLibraryManager(CBaseLibraryManager* pMngr, const QString& description, const QString& modifiedManager = nullptr)
- : m_pMngr(pMngr)
- , m_description(description)
- , m_editorObject(modifiedManager)
- {
- assert(m_pMngr);
- SerializeTo(m_undos);
- }
-
- QString GetEditorObjectName() override
- {
- return m_editorObject;
- }
-
-protected:
- int GetSize() override { return sizeof(CUndoBaseLibraryManager); }
- QString GetDescription() override { return m_description; };
-
- void Undo(bool bUndo) override
- {
- if (bUndo)
- {
- SerializeTo(m_redos);
- }
- m_pMngr->ClearAll();
- UnserializeFrom(m_undos);
- GetIEditor()->Notify(eNotify_OnDataBaseUpdate);
- }
-
- void Redo() override
- {
- m_pMngr->ClearAll();
- UnserializeFrom(m_redos);
- GetIEditor()->Notify(eNotify_OnDataBaseUpdate);
- }
-
-private:
- struct LibUndoNode
- : public _i_reference_target_t
- {
- LibUndoNode()
- {
- node = nullptr;
- fileName = "";
- }
- XmlNodeRef node;
- QString fileName;
- };
-
- static const char* const LIBRARY_TAG;
- static const char* const LEVEL_LIBRARY_TAG;
-
- void SerializeTo(std::vector<_smart_ptr >& undos) // Save Library Undo
- {
- undos.clear();
- for (int i = 0; i < m_pMngr->GetLibraryCount(); i++)
- {
- IDataBaseLibrary* library = m_pMngr->GetLibrary(i);
-
- const char* tag = library->IsLevelLibrary() ? LEVEL_LIBRARY_TAG : LIBRARY_TAG;
- XmlNodeRef node = GetIEditor()->GetSystem()->CreateXmlNode(tag);
- QString file = library->GetFilename().isEmpty() ? library->GetFilename() : library->GetName();
- library->Serialize(node, false);
- if (node && !file.isEmpty())
- {
- _smart_ptr undo = new LibUndoNode();
- undo->fileName = file;
- undo->node = node;
- undos.push_back(undo);
- }
- }
- }
-
- void UnserializeFrom(std::vector<_smart_ptr >& undos) // Load Library Undo
- {
- for (int i = 0; i < undos.size(); i++)
- {
- _smart_ptr undo = undos[i];
- if (undo->node && !undo->fileName.isEmpty())
- {
- //AddLibrary adds a .xml to the end of the library path, this will remove the extra for compatibility
- undo->fileName.replace(m_pMngr->GetLibsPath().toLower(), "");
- undo->fileName.replace(".xml", "");
-
- const bool isLevelLibrary = (strcmp(undo->node->getTag(), LEVEL_LIBRARY_TAG) == 0);
-
- IDataBaseLibrary* library = m_pMngr->AddLibrary(undo->fileName, isLevelLibrary);
- library->Serialize(undo->node, true);
- }
- }
- }
-
-
- QString m_description;
- QString m_editorObject;
- CBaseLibraryManager* m_pMngr;
- std::vector<_smart_ptr > m_undos;
- std::vector<_smart_ptr > m_redos;
-};
-
-const char* const CUndoBaseLibraryManager::LIBRARY_TAG = "UndoLibrary";
-const char* const CUndoBaseLibraryManager::LEVEL_LIBRARY_TAG = "UndoLevelLibrary";
-
-
-
//////////////////////////////////////////////////////////////////////////
// CBaseLibraryManager implementation.
//////////////////////////////////////////////////////////////////////////
@@ -606,11 +492,9 @@ void CBaseLibraryManager::RegisterItem(CBaseLibraryItem* pItem, REFGUID newGuid)
if (m_bUniqGuidMap)
{
- bool bNewItem = true;
REFGUID oldGuid = pItem->GetGUID();
if (!GuidUtil::IsEmpty(oldGuid))
{
- bNewItem = false;
m_itemsGuidMap.erase(oldGuid);
}
if (GuidUtil::IsEmpty(newGuid))
diff --git a/Code/Editor/CMakeLists.txt b/Code/Editor/CMakeLists.txt
index 693799e08b..3358b49dce 100644
--- a/Code/Editor/CMakeLists.txt
+++ b/Code/Editor/CMakeLists.txt
@@ -131,7 +131,7 @@ ly_add_source_properties(
PROPERTY COMPILE_DEFINITIONS
VALUES
O3DE_COPYRIGHT_YEAR=${LY_VERSION_COPYRIGHT_YEAR}
- LY_BUILD=${LY_VERSION_BUILD_NUMBER}
+ LY_VERSION_BUILD_NUMBER=${LY_VERSION_BUILD_NUMBER}
${LY_PAL_TOOLS_DEFINES}
)
ly_add_source_properties(
diff --git a/Code/Editor/Controls/ReflectedPropertyControl/ReflectedPropertyCtrl.cpp b/Code/Editor/Controls/ReflectedPropertyControl/ReflectedPropertyCtrl.cpp
index 1151137bfc..c5bf6a4d81 100644
--- a/Code/Editor/Controls/ReflectedPropertyControl/ReflectedPropertyCtrl.cpp
+++ b/Code/Editor/Controls/ReflectedPropertyControl/ReflectedPropertyCtrl.cpp
@@ -671,7 +671,7 @@ AzToolsFramework::PropertyRowWidget* ReflectedPropertyControl::FindPropertyRowWi
return nullptr;
}
const AzToolsFramework::ReflectedPropertyEditor::WidgetList& widgets = m_editor->GetWidgets();
- for (auto instance : widgets)
+ for (const auto& instance : widgets)
{
if (instance.second->label() == item->GetPropertyName())
{
diff --git a/Code/Editor/Controls/SplineCtrlEx.cpp b/Code/Editor/Controls/SplineCtrlEx.cpp
index 1dc2ff19e1..bff75af169 100644
--- a/Code/Editor/Controls/SplineCtrlEx.cpp
+++ b/Code/Editor/Controls/SplineCtrlEx.cpp
@@ -82,7 +82,6 @@ protected:
}
int GetSize() override { return sizeof(*this); }
- QString GetDescription() override { return "UndoSplineCtrlEx"; };
void Undo(bool bUndo) override
{
diff --git a/Code/Editor/CryEdit.cpp b/Code/Editor/CryEdit.cpp
index 5bcb77797c..d5f2305dfb 100644
--- a/Code/Editor/CryEdit.cpp
+++ b/Code/Editor/CryEdit.cpp
@@ -33,6 +33,7 @@ AZ_POP_DISABLE_WARNING
#include
#include
#include
+#include
#include
// Aws Native SDK
@@ -80,7 +81,6 @@ AZ_POP_DISABLE_WARNING
#include
// CryCommon
-#include
#include
// Editor
@@ -371,10 +371,8 @@ void CCryEditApp::RegisterActionHandlers()
ON_COMMAND(ID_EDIT_FETCH, OnEditFetch)
ON_COMMAND(ID_FILE_EXPORTTOGAMENOSURFACETEXTURE, OnFileExportToGameNoSurfaceTexture)
ON_COMMAND(ID_VIEW_SWITCHTOGAME, OnViewSwitchToGame)
- MainWindow::instance()->GetActionManager()->RegisterActionHandler(ID_VIEW_SWITCHTOGAME_FULLSCREEN, [this]() {
- ed_previewGameInFullscreen_once = true;
- OnViewSwitchToGame();
- });
+ ON_COMMAND(ID_VIEW_SWITCHTOGAME_VIEWPORT, OnViewSwitchToGame)
+ ON_COMMAND(ID_VIEW_SWITCHTOGAME_FULLSCREEN, OnViewSwitchToGameFullScreen)
ON_COMMAND(ID_MOVE_OBJECT, OnMoveObject)
ON_COMMAND(ID_RENAME_OBJ, OnRenameObj)
ON_COMMAND(ID_UNDO, OnUndo)
@@ -914,13 +912,9 @@ namespace
QWidget* g_splashScreen = nullptr;
}
-QString FormatVersion(const SFileVersion& v)
+QString FormatVersion([[maybe_unused]] const SFileVersion& v)
{
-#if defined(LY_BUILD)
- return QObject::tr("Version %1.%2.%3.%4 - Build %5").arg(v[3]).arg(v[2]).arg(v[1]).arg(v[0]).arg(LY_BUILD);
-#else
- return QObject::tr("Version %1.%2.%3.%4").arg(v[3]).arg(v[2]).arg(v[1]).arg(v[0]);
-#endif
+ return QObject::tr("Version %1").arg(LY_VERSION_BUILD_NUMBER);
}
QString FormatRichTextCopyrightNotice()
@@ -1361,16 +1355,6 @@ void CCryEditApp::CompileCriticalAssets() const
assetsInQueueNotifcation.BusDisconnect();
CCryEditApp::OutputStartupMessage(QString("Asset Processor is now ready."));
- // VERY early on, as soon as we can, request that the asset system make sure the following assets take priority over others,
- // so that by the time we ask for them there is a greater likelihood that they're already good to go.
- // these can be loaded later but are still important:
- AzFramework::AssetSystemRequestBus::Broadcast(&AzFramework::AssetSystem::AssetSystemRequests::EscalateAssetBySearchTerm, "/texturemsg/");
- AzFramework::AssetSystemRequestBus::Broadcast(&AzFramework::AssetSystem::AssetSystemRequests::EscalateAssetBySearchTerm, "engineassets/materials");
- AzFramework::AssetSystemRequestBus::Broadcast(&AzFramework::AssetSystem::AssetSystemRequests::EscalateAssetBySearchTerm, "engineassets/geomcaches");
- AzFramework::AssetSystemRequestBus::Broadcast(&AzFramework::AssetSystem::AssetSystemRequests::EscalateAssetBySearchTerm, "engineassets/objects");
-
- // some are specifically extra important and will cause issues if missing completely:
- AzFramework::AssetSystemRequestBus::Broadcast(&AzFramework::AssetSystem::AssetSystemRequests::CompileAssetSync, "engineassets/objects/default.cgf");
}
bool CCryEditApp::ConnectToAssetProcessor() const
@@ -2584,6 +2568,12 @@ void CCryEditApp::OnViewSwitchToGame()
GetIEditor()->SetInGameMode(inGame);
}
+void CCryEditApp::OnViewSwitchToGameFullScreen()
+{
+ ed_previewGameInFullscreen_once = true;
+ OnViewSwitchToGame();
+}
+
//////////////////////////////////////////////////////////////////////////
void CCryEditApp::OnExportSelectedObjects()
{
@@ -3974,9 +3964,8 @@ void CCryEditApp::OpenLUAEditor(const char* files)
}
}
- const char* engineRoot = nullptr;
- AzFramework::ApplicationRequests::Bus::BroadcastResult(engineRoot, &AzFramework::ApplicationRequests::GetEngineRoot);
- AZ_Assert(engineRoot != nullptr, "Unable to communicate to AzFramework::ApplicationRequests::Bus");
+ AZ::IO::FixedMaxPathString engineRoot = AZ::Utils::GetEnginePath();
+ AZ_Assert(!engineRoot.empty(), "Unable to query Engine Path");
AZStd::string_view exePath;
AZ::ComponentApplicationBus::BroadcastResult(exePath, &AZ::ComponentApplicationRequests::GetExecutableFolder);
@@ -3995,7 +3984,7 @@ void CCryEditApp::OpenLUAEditor(const char* files)
#endif
"%s", argumentQuoteString, aznumeric_cast(exePath.size()), exePath.data(), argumentQuoteString);
- AZStd::string processArgs = AZStd::string::format("%s -engine-path \"%s\"", args.c_str(), engineRoot);
+ AZStd::string processArgs = AZStd::string::format("%s -engine-path \"%s\"", args.c_str(), engineRoot.c_str());
StartProcessDetached(process.c_str(), processArgs.c_str());
}
@@ -4028,7 +4017,7 @@ void CCryEditApp::OnError(AzFramework::AssetSystem::AssetSystemErrors error)
break;
}
- CryMessageBox(errorMessage.c_str(), "Error", MB_OK | MB_ICONERROR | MB_SETFOREGROUND);
+ QMessageBox::critical(nullptr,"Error",errorMessage.c_str());
}
void CCryEditApp::OnOpenProceduralMaterialEditor()
@@ -4196,6 +4185,8 @@ extern "C" int AZ_DLL_EXPORT CryEditMain(int argc, char* argv[])
"\nThis could be because of incorrectly configured components, or missing required gems."
"\nSee other errors for more details.");
+ AzToolsFramework::EditorEventsBus::Broadcast(&AzToolsFramework::EditorEvents::NotifyEditorInitialized);
+
if (didCryEditStart)
{
app->EnableOnIdle();
diff --git a/Code/Editor/CryEdit.h b/Code/Editor/CryEdit.h
index 53ee8f1905..8c514170ae 100644
--- a/Code/Editor/CryEdit.h
+++ b/Code/Editor/CryEdit.h
@@ -212,6 +212,7 @@ public:
void OnEditFetch();
void OnFileExportToGameNoSurfaceTexture();
void OnViewSwitchToGame();
+ void OnViewSwitchToGameFullScreen();
void OnViewDeploy();
void DeleteSelectedEntities(bool includeDescendants);
void OnMoveObject();
diff --git a/Code/Editor/CryEditDoc.cpp b/Code/Editor/CryEditDoc.cpp
index 212606c737..3bcba4d5e0 100644
--- a/Code/Editor/CryEditDoc.cpp
+++ b/Code/Editor/CryEditDoc.cpp
@@ -19,6 +19,7 @@
#include
#include
#include
+#include
#include
#include
@@ -50,7 +51,6 @@
#include "GameExporter.h"
#include "MainWindow.h"
#include "LevelFileDialog.h"
-#include "StatObjBus.h"
#include "Undo/Undo.h"
#include
@@ -245,9 +245,6 @@ void CCryEditDoc::DeleteContents()
EBUS_EVENT(AzToolsFramework::EditorEntityContextRequestBus, ResetEditorContext);
- // [LY-90904] move this to the EditorVegetationManager component
- InstanceStatObjEventBus::Broadcast(&InstanceStatObjEventBus::Events::ReleaseData);
-
//////////////////////////////////////////////////////////////////////////
// Clear all undo info.
//////////////////////////////////////////////////////////////////////////
@@ -307,8 +304,6 @@ void CCryEditDoc::Save(TDocMultiArchive& arrXmlAr)
// Fog settings ///////////////////////////////////////////////////////
SerializeFogSettings((*arrXmlAr[DMAS_GENERAL]));
-
- SerializeNameSelection((*arrXmlAr[DMAS_GENERAL]));
}
}
AfterSave();
@@ -454,12 +449,6 @@ void CCryEditDoc::Load(TDocMultiArchive& arrXmlAr, const QString& szFilename)
}
}
- if (!isPrefabEnabled)
- {
- // Name Selection groups
- SerializeNameSelection((*arrXmlAr[DMAS_GENERAL]));
- }
-
{
CAutoLogTime logtime("Post Load");
@@ -594,16 +583,6 @@ void CCryEditDoc::SerializeFogSettings(CXmlArchive& xmlAr)
}
}
-void CCryEditDoc::SerializeNameSelection(CXmlArchive& xmlAr)
-{
- IObjectManager* pObjManager = GetIEditor()->GetObjectManager();
-
- if (pObjManager)
- {
- pObjManager->SerializeNameSelection(xmlAr.root, xmlAr.bLoading);
- }
-}
-
void CCryEditDoc::SetModifiedModules(EModifiedModule eModifiedModule, bool boSet)
{
if (!boSet)
@@ -749,7 +728,9 @@ bool CCryEditDoc::OnOpenDocument(const QString& lpszPathName)
bool CCryEditDoc::BeforeOpenDocument(const QString& lpszPathName, TOpenDocContext& context)
{
- CTimeValue loading_start_time = gEnv->pTimer->GetAsyncTime();
+ const AZ::TimeMs timeMs = AZ::GetRealElapsedTimeMs();
+ const double timeSec = AZ::TimeMsToSecondsDouble(timeMs);
+ const CTimeValue loading_start_time(timeSec);
bool usePrefabSystemForLevels = false;
AzFramework::ApplicationRequests::Bus::BroadcastResult(
@@ -790,7 +771,7 @@ bool CCryEditDoc::BeforeOpenDocument(const QString& lpszPathName, TOpenDocContex
bool CCryEditDoc::DoOpenDocument(TOpenDocContext& context)
{
- CTimeValue& loading_start_time = context.loading_start_time;
+ const CTimeValue& loading_start_time = context.loading_start_time;
bool isPrefabEnabled = false;
AzFramework::ApplicationRequests::Bus::BroadcastResult(isPrefabEnabled, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled);
@@ -860,7 +841,9 @@ bool CCryEditDoc::DoOpenDocument(TOpenDocContext& context)
StartStreamingLoad();
- CTimeValue loading_end_time = gEnv->pTimer->GetAsyncTime();
+ const AZ::TimeMs timeMs = AZ::GetRealElapsedTimeMs();
+ const double timeSec = AZ::TimeMsToSecondsDouble(timeMs);
+ const CTimeValue loading_end_time(timeSec);
CLogFile::FormatLine("-----------------------------------------------------------");
CLogFile::FormatLine("Successfully opened document %s", context.absoluteLevelPath.toUtf8().data());
@@ -1123,7 +1106,7 @@ bool CCryEditDoc::SaveLevel(const QString& filename)
const QString oldLevelPattern = QDir(oldLevelFolder).absoluteFilePath("*.*");
const QString oldLevelName = Path::GetFile(GetLevelPathName());
const QString oldLevelXml = Path::ReplaceExtension(oldLevelName, "xml");
- AZ::IO::ArchiveFileIterator findHandle = pIPak->FindFirst(oldLevelPattern.toUtf8().data(), AZ::IO::IArchive::eFileSearchType_AllowOnDiskAndInZips);
+ AZ::IO::ArchiveFileIterator findHandle = pIPak->FindFirst(oldLevelPattern.toUtf8().data(), AZ::IO::FileSearchLocation::Any);
if (findHandle)
{
do
diff --git a/Code/Editor/CryEditDoc.h b/Code/Editor/CryEditDoc.h
index e64bdb1308..f7e97d308e 100644
--- a/Code/Editor/CryEditDoc.h
+++ b/Code/Editor/CryEditDoc.h
@@ -24,7 +24,6 @@
#include
#endif
-class CClouds;
struct LightingSettings;
struct IVariable;
struct ICVar;
@@ -124,7 +123,6 @@ public: // Create from serialization only
const char* GetTemporaryLevelName() const;
void DeleteTemporaryLevel();
- CClouds* GetClouds() { return m_pClouds; }
void SetWaterColor(const QColor& col) { m_waterColor = col; }
QColor GetWaterColor() const { return m_waterColor; }
XmlNodeRef& GetFogTemplate() { return m_fogTemplate; }
@@ -163,7 +161,6 @@ protected:
bool LoadEntitiesFromSlice(const QString& sliceFile);
void SerializeFogSettings(CXmlArchive& xmlAr);
virtual void SerializeViewSettings(CXmlArchive& xmlAr);
- void SerializeNameSelection(CXmlArchive& xmlAr);
void LogLoadTime(int time) const;
struct TSaveDocContext
@@ -195,7 +192,6 @@ protected:
QColor m_waterColor = QColor(0, 0, 255);
XmlNodeRef m_fogTemplate;
XmlNodeRef m_environmentTemplate;
- CClouds* m_pClouds;
std::list m_listeners;
bool m_bDocumentReady = false;
ICVar* doc_validate_surface_types = nullptr;
diff --git a/Code/Editor/Dialogs/PythonScriptsDialog.cpp b/Code/Editor/Dialogs/PythonScriptsDialog.cpp
index 35047947ac..06b1acdbc8 100644
--- a/Code/Editor/Dialogs/PythonScriptsDialog.cpp
+++ b/Code/Editor/Dialogs/PythonScriptsDialog.cpp
@@ -40,10 +40,10 @@ AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING
namespace
{
// File name extension for python files
- const QString s_kPythonFileNameSpec = "*.py";
+ const QString s_kPythonFileNameSpec("*.py");
// Tree root element name
- const QString s_kRootElementName = "Python Scripts";
+ const QString s_kRootElementName("Python Scripts");
}
//////////////////////////////////////////////////////////////////////////
diff --git a/Code/Editor/EditorDefs.h b/Code/Editor/EditorDefs.h
index 4115e8433a..97c03b2b45 100644
--- a/Code/Editor/EditorDefs.h
+++ b/Code/Editor/EditorDefs.h
@@ -105,7 +105,6 @@
#include
#include
#include
-#include
#include
#include
diff --git a/Code/Editor/EditorModularViewportCameraComposer.cpp b/Code/Editor/EditorModularViewportCameraComposer.cpp
index 72fd37605a..f145adf72f 100644
--- a/Code/Editor/EditorModularViewportCameraComposer.cpp
+++ b/Code/Editor/EditorModularViewportCameraComposer.cpp
@@ -145,6 +145,15 @@ namespace SandboxEditor
}
};
+ const auto trackingTransform = [viewportId = m_viewportId]
+ {
+ bool tracking = false;
+ AtomToolsFramework::ModularViewportCameraControllerRequestBus::EventResult(
+ tracking, viewportId, &AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::IsTrackingTransform);
+
+ return tracking;
+ };
+
m_firstPersonRotateCamera = AZStd::make_shared(SandboxEditor::CameraFreeLookChannelId());
m_firstPersonRotateCamera->m_rotateSpeedFn = []
@@ -152,6 +161,11 @@ namespace SandboxEditor
return SandboxEditor::CameraRotateSpeed();
};
+ m_firstPersonRotateCamera->m_constrainPitch = [trackingTransform]
+ {
+ return !trackingTransform();
+ };
+
// default behavior is to hide the cursor but this can be disabled (useful for remote desktop)
// note: See CaptureCursorLook in the Settings Registry
m_firstPersonRotateCamera->SetActivationBeganFn(hideCursor);
@@ -255,6 +269,11 @@ namespace SandboxEditor
return SandboxEditor::CameraOrbitYawRotationInverted();
};
+ m_orbitRotateCamera->m_constrainPitch = [trackingTransform]
+ {
+ return !trackingTransform();
+ };
+
m_orbitTranslateCamera = AZStd::make_shared(
translateCameraInputChannelIds, AzFramework::LookTranslation, AzFramework::TranslateOffsetOrbit);
@@ -337,12 +356,12 @@ namespace SandboxEditor
AZ::TransformBus::EventResult(worldFromLocal, viewEntityId, &AZ::TransformBus::Events::GetWorldTM);
AtomToolsFramework::ModularViewportCameraControllerRequestBus::Event(
- m_viewportId, &AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::SetReferenceFrame, worldFromLocal);
+ m_viewportId, &AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::StartTrackingTransform, worldFromLocal);
}
else
{
AtomToolsFramework::ModularViewportCameraControllerRequestBus::Event(
- m_viewportId, &AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::ClearReferenceFrame);
+ m_viewportId, &AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::StopTrackingTransform);
}
}
diff --git a/Code/Editor/EditorViewportWidget.cpp b/Code/Editor/EditorViewportWidget.cpp
index 290f0fd17f..7323da9e95 100644
--- a/Code/Editor/EditorViewportWidget.cpp
+++ b/Code/Editor/EditorViewportWidget.cpp
@@ -53,7 +53,6 @@
#include
// CryCommon
-#include
#include
// AzFramework
@@ -98,9 +97,6 @@
#include
-#include
-#include
-
AZ_CVAR(
bool, ed_visibility_logTiming, false, nullptr, AZ::ConsoleFunctorFlags::Null, "Output the timing of the new IVisibilitySystem query");
@@ -299,13 +295,9 @@ AzToolsFramework::ViewportInteraction::MousePick EditorViewportWidget::BuildMous
{
AzToolsFramework::ViewportInteraction::MousePick mousePick;
mousePick.m_screenCoordinates = AzToolsFramework::ViewportInteraction::ScreenPointFromQPoint(point);
- if (const auto& ray = m_renderViewport->ViewportScreenToWorldRay(mousePick.m_screenCoordinates);
- ray.has_value())
- {
- mousePick.m_rayOrigin = ray.value().origin;
- mousePick.m_rayDirection = ray.value().direction;
- }
-
+ const auto[origin, direction] = m_renderViewport->ViewportScreenToWorldRay(mousePick.m_screenCoordinates);
+ mousePick.m_rayOrigin = origin;
+ mousePick.m_rayDirection = direction;
return mousePick;
}
@@ -480,7 +472,7 @@ void EditorViewportWidget::Update()
{
auto start = std::chrono::steady_clock::now();
- m_entityVisibilityQuery.UpdateVisibility(GetCameraState());
+ m_entityVisibilityQuery.UpdateVisibility(m_renderViewport->GetCameraState());
if (ed_visibility_logTiming)
{
@@ -556,22 +548,6 @@ void EditorViewportWidget::OnEditorNotifyEvent(EEditorNotifyEvent event)
// this should only occur for the main viewport and no others.
ShowCursor();
- // If the user has selected game mode, enable outputting to any attached HMD and properly size the context
- // to the resolution specified by the VR device.
- if (gSettings.bEnableGameModeVR)
- {
- const AZ::VR::HMDDeviceInfo* deviceInfo = nullptr;
- EBUS_EVENT_RESULT(deviceInfo, AZ::VR::HMDDeviceRequestBus, GetDeviceInfo);
- AZ_Warning("Render Viewport", deviceInfo, "No VR device detected");
-
- if (deviceInfo)
- {
- // Note: This may also need to adjust the viewport size
- SetActiveWindow();
- SetFocus();
- SetSelected(true);
- }
- }
SetCurrentCursor(STD_CURSOR_GAME);
if (ShouldPreviewFullscreen())
@@ -738,7 +714,7 @@ void EditorViewportWidget::RenderAll()
m_debugDisplay->DepthTestOff();
m_manipulatorManager->DrawManipulators(
- *m_debugDisplay, GetCameraState(),
+ *m_debugDisplay, m_renderViewport->GetCameraState(),
BuildMouseInteractionInternal(
AztfVi::MouseButtons(AztfVi::TranslateMouseButtons(QGuiApplication::mouseButtons())), keyboardModifiers,
BuildMousePick(WidgetToViewport(mapFromGlobal(QCursor::pos())))));
@@ -902,48 +878,11 @@ void EditorViewportWidget::OnMenuSelectCurrentCamera()
}
}
-AzFramework::CameraState EditorViewportWidget::GetCameraState()
-{
- return m_renderViewport->GetCameraState();
-}
-
-AZ::Vector3 EditorViewportWidget::PickTerrain(const AzFramework::ScreenPoint& point)
-{
- return LYVec3ToAZVec3(ViewToWorld(AzToolsFramework::ViewportInteraction::QPointFromScreenPoint(point), nullptr, true));
-}
-
-AZ::EntityId EditorViewportWidget::PickEntity(const AzFramework::ScreenPoint& point)
-{
- AZ::EntityId entityId;
- HitContext hitInfo;
- hitInfo.view = this;
- if (HitTest(AzToolsFramework::ViewportInteraction::QPointFromScreenPoint(point), hitInfo))
- {
- if (hitInfo.object && (hitInfo.object->GetType() == OBJTYPE_AZENTITY))
- {
- auto entityObject = static_cast(hitInfo.object);
- entityId = entityObject->GetAssociatedEntityId();
- }
- }
-
- return entityId;
-}
-
-float EditorViewportWidget::TerrainHeight(const AZ::Vector2& position)
-{
- return GetIEditor()->GetTerrainElevation(position.GetX(), position.GetY());
-}
-
void EditorViewportWidget::FindVisibleEntities(AZStd::vector& visibleEntitiesOut)
{
visibleEntitiesOut.assign(m_entityVisibilityQuery.Begin(), m_entityVisibilityQuery.End());
}
-AzFramework::ScreenPoint EditorViewportWidget::ViewportWorldToScreen(const AZ::Vector3& worldPosition)
-{
- return m_renderViewport->ViewportWorldToScreen(worldPosition);
-}
-
QWidget* EditorViewportWidget::GetWidgetForViewportContextMenu()
{
return this;
@@ -1653,16 +1592,15 @@ void EditorViewportWidget::RenderSelectedRegion()
Vec3 EditorViewportWidget::WorldToView3D(const Vec3& wp, [[maybe_unused]] int nFlags) const
{
Vec3 out(0, 0, 0);
- float x, y, z;
+ float x, y;
- ProjectToScreen(wp.x, wp.y, wp.z, &x, &y, &z);
- if (_finite(x) && _finite(y) && _finite(z))
+ ProjectToScreen(wp.x, wp.y, wp.z, &x, &y);
+ if (_finite(x) && _finite(y))
{
out.x = (x / 100) * m_rcClient.width();
out.y = (y / 100) * m_rcClient.height();
out.x /= static_cast(QHighDpiScaling::factor(windowHandle()->screen()));
out.y /= static_cast(QHighDpiScaling::factor(windowHandle()->screen()));
- out.z = z;
}
return out;
}
@@ -1672,24 +1610,6 @@ QPoint EditorViewportWidget::WorldToView(const Vec3& wp) const
{
return AzToolsFramework::ViewportInteraction::QPointFromScreenPoint(m_renderViewport->ViewportWorldToScreen(LYVec3ToAZVec3(wp)));
}
-//////////////////////////////////////////////////////////////////////////
-QPoint EditorViewportWidget::WorldToViewParticleEditor(const Vec3& wp, int width, int height) const
-{
- QPoint p;
- float x, y, z;
-
- ProjectToScreen(wp.x, wp.y, wp.z, &x, &y, &z);
- if (_finite(x) || _finite(y))
- {
- p.rx() = static_cast((x / 100) * width);
- p.ry() = static_cast((y / 100) * height);
- }
- else
- {
- QPoint(0, 0);
- }
- return p;
-}
//////////////////////////////////////////////////////////////////////////
Vec3 EditorViewportWidget::ViewToWorld(
@@ -1705,20 +1625,16 @@ Vec3 EditorViewportWidget::ViewToWorld(
AZ_UNUSED(collideWithObject);
auto ray = m_renderViewport->ViewportScreenToWorldRay(AzToolsFramework::ViewportInteraction::ScreenPointFromQPoint(vp));
- if (!ray.has_value())
- {
- return Vec3(0, 0, 0);
- }
const float maxDistance = 10000.f;
- Vec3 v = AZVec3ToLYVec3(ray.value().direction) * maxDistance;
+ Vec3 v = AZVec3ToLYVec3(ray.direction) * maxDistance;
if (!_finite(v.x) || !_finite(v.y) || !_finite(v.z))
{
return Vec3(0, 0, 0);
}
- Vec3 colp = AZVec3ToLYVec3(ray.value().origin) + 0.002f * v;
+ Vec3 colp = AZVec3ToLYVec3(ray.origin) + 0.002f * v;
return colp;
}
@@ -1757,21 +1673,19 @@ bool EditorViewportWidget::RayRenderMeshIntersection(IRenderMesh* pRenderMesh, c
return bRes;*/
}
-void EditorViewportWidget::UnProjectFromScreen(float sx, float sy, float sz, float* px, float* py, float* pz) const
+void EditorViewportWidget::UnProjectFromScreen(float sx, float sy, float* px, float* py, float* pz) const
{
- AZ::Vector3 wp;
- wp = m_renderViewport->ViewportScreenToWorld(AzFramework::ScreenPoint{(int)sx, m_rcClient.bottom() - ((int)sy)}, sz).value_or(wp);
+ const AZ::Vector3 wp = m_renderViewport->ViewportScreenToWorld(AzFramework::ScreenPoint{(int)sx, m_rcClient.bottom() - ((int)sy)});
*px = wp.GetX();
*py = wp.GetY();
*pz = wp.GetZ();
}
-void EditorViewportWidget::ProjectToScreen(float ptx, float pty, float ptz, float* sx, float* sy, float* sz) const
+void EditorViewportWidget::ProjectToScreen(float ptx, float pty, float ptz, float* sx, float* sy) const
{
AzFramework::ScreenPoint screenPosition = m_renderViewport->ViewportWorldToScreen(AZ::Vector3{ptx, pty, ptz});
*sx = static_cast(screenPosition.m_x);
*sy = static_cast(screenPosition.m_y);
- *sz = 0.f;
}
//////////////////////////////////////////////////////////////////////////
@@ -1781,32 +1695,22 @@ void EditorViewportWidget::ViewToWorldRay(const QPoint& vp, Vec3& raySrc, Vec3&
Vec3 pos0, pos1;
float wx, wy, wz;
- UnProjectFromScreen(static_cast(vp.x()), static_cast(rc.bottom() - vp.y()), 0.0f, &wx, &wy, &wz);
- if (!_finite(wx) || !_finite(wy) || !_finite(wz))
- {
- return;
- }
- if (fabs(wx) > 1000000 || fabs(wy) > 1000000 || fabs(wz) > 1000000)
- {
- return;
- }
- pos0(wx, wy, wz);
- UnProjectFromScreen(static_cast(vp.x()), static_cast(rc.bottom() - vp.y()), 1.0f, &wx, &wy, &wz);
- if (!_finite(wx) || !_finite(wy) || !_finite(wz))
- {
- return;
- }
- if (fabs(wx) > 1000000 || fabs(wy) > 1000000 || fabs(wz) > 1000000)
- {
- return;
- }
- pos1(wx, wy, wz);
+ UnProjectFromScreen(static_cast(vp.x()), static_cast(rc.bottom() - vp.y()), &wx, &wy, &wz);
- Vec3 v = (pos1 - pos0);
- v = v.GetNormalized();
+ if (!_finite(wx) || !_finite(wy) || !_finite(wz))
+ {
+ return;
+ }
+
+ if (fabs(wx) > 1000000 || fabs(wy) > 1000000 || fabs(wz) > 1000000)
+ {
+ return;
+ }
+
+ pos0(wx, wy, wz);
raySrc = pos0;
- rayDir = v;
+ rayDir = (pos0 - AZVec3ToLYVec3(m_renderViewport->GetCameraState().m_position)).GetNormalized();
}
//////////////////////////////////////////////////////////////////////////
@@ -1815,13 +1719,6 @@ float EditorViewportWidget::GetScreenScaleFactor([[maybe_unused]] const Vec3& wo
AZ_Error("CryLegacy", false, "EditorViewportWidget::GetScreenScaleFactor not implemented");
return 1.f;
}
-//////////////////////////////////////////////////////////////////////////
-float EditorViewportWidget::GetScreenScaleFactor(const CCamera& camera, const Vec3& object_position)
-{
- Vec3 camPos = camera.GetPosition();
- float dist = camPos.GetDistance(object_position);
- return dist;
-}
//////////////////////////////////////////////////////////////////////////
bool EditorViewportWidget::CheckRespondToInput() const
@@ -1842,7 +1739,6 @@ bool EditorViewportWidget::CheckRespondToInput() const
//////////////////////////////////////////////////////////////////////////
bool EditorViewportWidget::HitTest(const QPoint& point, HitContext& hitInfo)
{
- hitInfo.camera = nullptr;
hitInfo.pExcludedObject = GetCameraObject();
return QtViewport::HitTest(point, hitInfo);
}
@@ -2216,7 +2112,7 @@ bool EditorViewportWidget::GetActiveCameraState(AzFramework::CameraState& camera
{
if (m_pPrimaryViewport == this)
{
- cameraState = GetCameraState();
+ cameraState = m_renderViewport->GetCameraState();
return true;
}
@@ -2363,10 +2259,10 @@ void* EditorViewportWidget::GetSystemCursorConstraintWindow() const
return systemCursorConstrained ? renderOverlayHWND() : nullptr;
}
-void EditorViewportWidget::BuildDragDropContext(AzQtComponents::ViewportDragContext& context, const QPoint& pt)
+void EditorViewportWidget::BuildDragDropContext(
+ AzQtComponents::ViewportDragContext& context, const AzFramework::ViewportId viewportId, const QPoint& point)
{
- const auto scaledPoint = WidgetToViewport(pt);
- QtViewport::BuildDragDropContext(context, scaledPoint);
+ QtViewport::BuildDragDropContext(context, viewportId, point);
}
void EditorViewportWidget::RestoreViewportAfterGameMode()
@@ -2547,12 +2443,6 @@ bool EditorViewportWidget::ShouldPreviewFullscreen() const
return false;
}
- // Not supported in VR
- if (gSettings.bEnableGameModeVR)
- {
- return false;
- }
-
// If level not loaded, don't preview in fullscreen (preview shouldn't work at all without a level, but it does)
if (auto ge = GetIEditor()->GetGameEngine())
{
diff --git a/Code/Editor/EditorViewportWidget.h b/Code/Editor/EditorViewportWidget.h
index 01f6068d56..3d52b2416d 100644
--- a/Code/Editor/EditorViewportWidget.h
+++ b/Code/Editor/EditorViewportWidget.h
@@ -10,7 +10,6 @@
#pragma once
#if !defined(Q_MOC_RUN)
-#include
#include
@@ -166,13 +165,11 @@ private:
Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, const QPoint& point) override;
void SetViewportId(int id) override;
QPoint WorldToView(const Vec3& wp) const override;
- QPoint WorldToViewParticleEditor(const Vec3& wp, int width, int height) const override;
Vec3 WorldToView3D(const Vec3& wp, int nFlags = 0) const override;
Vec3 ViewToWorld(const QPoint& vp, bool* collideWithTerrain = nullptr, bool onlyTerrain = false, bool bSkipVegetation = false, bool bTestRenderMesh = false, bool* collideWithObject = nullptr) const override;
void ViewToWorldRay(const QPoint& vp, Vec3& raySrc, Vec3& rayDir) const override;
Vec3 ViewToWorldNormal(const QPoint& vp, bool onlyTerrain, bool bTestRenderMesh = false) override;
float GetScreenScaleFactor(const Vec3& worldPoint) const override;
- float GetScreenScaleFactor(const CCamera& camera, const Vec3& object_position) override;
float GetAspectRatio() const override;
bool HitTest(const QPoint& point, HitContext& hitInfo) override;
bool IsBoundsVisible(const AABB& box) const override;
@@ -208,9 +205,6 @@ private:
void* GetSystemCursorConstraintWindow() const override;
// AzToolsFramework::MainEditorViewportInteractionRequestBus overrides ...
- AZ::EntityId PickEntity(const AzFramework::ScreenPoint& point) override;
- AZ::Vector3 PickTerrain(const AzFramework::ScreenPoint& point) override;
- float TerrainHeight(const AZ::Vector2& position) override;
bool ShowingWorldSpace() override;
QWidget* GetWidgetForViewportContextMenu() override;
@@ -275,7 +269,8 @@ private:
bool CheckRespondToInput() const;
- void BuildDragDropContext(AzQtComponents::ViewportDragContext& context, const QPoint& pt) override;
+ void BuildDragDropContext(
+ AzQtComponents::ViewportDragContext& context, AzFramework::ViewportId viewportId, const QPoint& point) override;
void SetAsActiveViewport();
void PushDisableRendering();
@@ -296,9 +291,6 @@ private:
// This switches the active camera to the next one in the list of (default, all custom cams).
void CycleCamera();
- AzFramework::CameraState GetCameraState();
- AzFramework::ScreenPoint ViewportWorldToScreen(const AZ::Vector3& worldPosition);
-
QPoint WidgetToViewport(const QPoint& point) const;
QPoint ViewportToWidget(const QPoint& point) const;
QSize WidgetToViewport(const QSize& size) const;
@@ -306,8 +298,8 @@ private:
const DisplayContext& GetDisplayContext() const { return m_displayContext; }
CBaseObject* GetCameraObject() const;
- void UnProjectFromScreen(float sx, float sy, float sz, float* px, float* py, float* pz) const;
- void ProjectToScreen(float ptx, float pty, float ptz, float* sx, float* sy, float* sz) const;
+ void UnProjectFromScreen(float sx, float sy, float* px, float* py, float* pz) const;
+ void ProjectToScreen(float ptx, float pty, float ptz, float* sx, float* sy) const;
AZ::RPI::ViewPtr GetCurrentAtomView() const;
diff --git a/Code/Editor/Export/ExportManager.cpp b/Code/Editor/Export/ExportManager.cpp
index 5527aa6ce6..b27b7e0387 100644
--- a/Code/Editor/Export/ExportManager.cpp
+++ b/Code/Editor/Export/ExportManager.cpp
@@ -35,20 +35,8 @@
#include "Resource.h"
#include "Plugins/ComponentEntityEditorPlugin/Objects/ComponentEntityObject.h"
-#include
-#include
-
namespace
{
- inline Export::Vector3D Vec3ToVector3D(const Vec3& vec)
- {
- Export::Vector3D ret;
- ret.x = vec.x;
- ret.y = vec.y;
- ret.z = vec.z;
- return ret;
- }
-
const float kTangentDelta = 0.01f;
const float kAspectRatio = 1.777778f;
const int kReserveCount = 7; // x,y,z,rot_x,rot_y,rot_z,fov
@@ -106,22 +94,22 @@ void Export::CData::Clear()
// CExportManager
CExportManager::CExportManager()
: m_isPrecaching(false)
- , m_pBaseObj(nullptr)
- , m_FBXBakedExportFPS(0.0f)
, m_fScale(100.0f)
+ , m_bAnimationExport(false)
+ , m_pBaseObj(nullptr)
, // this scale is used by CryEngine RC
- m_bAnimationExport(false)
+ m_FBXBakedExportFPS(0.0f)
, m_bExportLocalCoords(false)
+ , m_bExportOnlyPrimaryCamera(false)
, m_numberOfExportFrames(0)
, m_pivotEntityObject(nullptr)
, m_bBakedKeysSequenceExport(true)
, m_animTimeExportPrimarySequenceCurrentTime(0.0f)
, m_animKeyTimeExport(true)
, m_soundKeyTimeExport(true)
- , m_bExportOnlyPrimaryCamera(false)
{
- RegisterExporter(new COBJExporter());
- RegisterExporter(new COCMExporter());
+ CExportManager::RegisterExporter(new COBJExporter());
+ CExportManager::RegisterExporter(new COCMExporter());
}
@@ -313,203 +301,6 @@ void CExportManager::AddEntityAnimationData(AZ::EntityId entityId)
ProcessEntityAnimationTrack(entityId, pObj, AnimParamType::Rotation);
}
-
-void CExportManager::AddMesh(Export::CObject* pObj, const IIndexedMesh* pIndMesh, Matrix34A* pTm)
-{
- if (m_isPrecaching || !pObj)
- {
- return;
- }
-
- pObj->m_MeshHash = reinterpret_cast(pIndMesh);
- IIndexedMesh::SMeshDescription meshDesc;
- pIndMesh->GetMeshDescription(meshDesc);
-
- // if we have subset of meshes we need to duplicate vertices,
- // keep transformation of submesh,
- // and store new offset for indices
- int newOffsetIndex = pObj->GetVertexCount();
-
- if (meshDesc.m_nVertCount)
- {
- pObj->m_vertices.reserve(meshDesc.m_nVertCount + newOffsetIndex);
- pObj->m_normals.reserve(meshDesc.m_nVertCount + newOffsetIndex);
- }
-
- for (int v = 0; v < meshDesc.m_nVertCount; ++v)
- {
- Vec3 n = meshDesc.m_pNorms[v].GetN();
- Vec3 tmp = (meshDesc.m_pVerts ? meshDesc.m_pVerts[v] : meshDesc.m_pVertsF16[v].ToVec3());
- if (pTm)
- {
- tmp = pTm->TransformPoint(tmp);
- }
-
- pObj->m_vertices.push_back(Vec3ToVector3D(tmp * m_fScale));
- pObj->m_normals.push_back(Vec3ToVector3D(n));
- }
-
- if (meshDesc.m_nCoorCount)
- {
- pObj->m_texCoords.reserve(meshDesc.m_nCoorCount + newOffsetIndex);
- }
-
- for (int v = 0; v < meshDesc.m_nCoorCount; ++v)
- {
- Vec2 uv = meshDesc.m_pTexCoord[v].GetUV();
- uv.y = 1.0f - uv.y;
- pObj->m_texCoords.push_back({uv.x,uv.y});
- }
-
- if (pIndMesh->GetSubSetCount() && !(pIndMesh->GetSubSetCount() == 1 && pIndMesh->GetSubSet(0).nNumIndices == 0))
- {
- for (int i = 0; i < pIndMesh->GetSubSetCount(); ++i)
- {
- Export::CMesh* pMesh = new Export::CMesh();
-
- const SMeshSubset& sms = pIndMesh->GetSubSet(i);
- const vtx_idx* pIndices = &meshDesc.m_pIndices[sms.nFirstIndexId];
- int nTris = sms.nNumIndices / 3;
- pMesh->m_faces.reserve(nTris);
- for (int f = 0; f < nTris; ++f)
- {
- Export::Face face;
- face.idx[0] = *(pIndices++) + newOffsetIndex;
- face.idx[1] = *(pIndices++) + newOffsetIndex;
- face.idx[2] = *(pIndices++) + newOffsetIndex;
- pMesh->m_faces.push_back(face);
- }
-
- pObj->m_meshes.push_back(pMesh);
- }
- }
- else
- {
- Export::CMesh* pMesh = new Export::CMesh();
- if (meshDesc.m_nFaceCount == 0 && meshDesc.m_nIndexCount != 0 && meshDesc.m_pIndices != nullptr)
- {
- const vtx_idx* pIndices = &meshDesc.m_pIndices[0];
- int nTris = meshDesc.m_nIndexCount / 3;
- pMesh->m_faces.reserve(nTris);
- for (int f = 0; f < nTris; ++f)
- {
- Export::Face face;
- face.idx[0] = *(pIndices++) + newOffsetIndex;
- face.idx[1] = *(pIndices++) + newOffsetIndex;
- face.idx[2] = *(pIndices++) + newOffsetIndex;
- pMesh->m_faces.push_back(face);
- }
- }
- else
- {
- pMesh->m_faces.reserve(meshDesc.m_nFaceCount);
- for (int f = 0; f < meshDesc.m_nFaceCount; ++f)
- {
- Export::Face face;
- face.idx[0] = meshDesc.m_pFaces[f].v[0];
- face.idx[1] = meshDesc.m_pFaces[f].v[1];
- face.idx[2] = meshDesc.m_pFaces[f].v[2];
- pMesh->m_faces.push_back(face);
- }
- }
-
- pObj->m_meshes.push_back(pMesh);
- }
-}
-
-
-bool CExportManager::AddStatObj(Export::CObject* pObj, IStatObj* pStatObj, Matrix34A* pTm)
-{
- IIndexedMesh* pIndMesh = nullptr;
-
- if (pStatObj->GetSubObjectCount())
- {
- for (int i = 0; i < pStatObj->GetSubObjectCount(); i++)
- {
- IStatObj::SSubObject* pSubObj = pStatObj->GetSubObject(i);
- if (pSubObj && pSubObj->nType == STATIC_SUB_OBJECT_MESH && pSubObj->pStatObj)
- {
- pIndMesh = nullptr;
- if (m_isOccluder)
- {
- if (pSubObj->pStatObj->GetLodObject(2))
- {
- pIndMesh = pSubObj->pStatObj->GetLodObject(2)->GetIndexedMesh(true);
- }
- if (!pIndMesh && pSubObj->pStatObj->GetLodObject(1))
- {
- pIndMesh = pSubObj->pStatObj->GetLodObject(1)->GetIndexedMesh(true);
- }
- }
- if (!pIndMesh)
- {
- pIndMesh = pSubObj->pStatObj->GetIndexedMesh(true);
- }
- if (pIndMesh)
- {
- AddMesh(pObj, pIndMesh, pTm);
- }
- }
- }
- }
-
- if (!pIndMesh)
- {
- if (m_isOccluder)
- {
- if (pStatObj->GetLodObject(2))
- {
- pIndMesh = pStatObj->GetLodObject(2)->GetIndexedMesh(true);
- }
- if (!pIndMesh && pStatObj->GetLodObject(1))
- {
- pIndMesh = pStatObj->GetLodObject(1)->GetIndexedMesh(true);
- }
- }
- if (!pIndMesh)
- {
- pIndMesh = pStatObj->GetIndexedMesh(true);
- }
- if (pIndMesh)
- {
- AddMesh(pObj, pIndMesh, pTm);
- }
- }
-
- return true;
-}
-
-bool CExportManager::AddMeshes(Export::CObject* pObj)
-{
- if (m_pBaseObj->GetType() == OBJTYPE_AZENTITY)
- {
- CEntityObject* pEntityObject = (CEntityObject*)m_pBaseObj;
- IRenderNode* pEngineNode = pEntityObject->GetEngineNode();
-
- if (pEngineNode)
- {
- if (!m_isPrecaching)
- {
- for (int i = 0; i < pEngineNode->GetSlotCount(); ++i)
- {
- Matrix34A tm;
- IStatObj* pStatObj = pEngineNode->GetEntityStatObj(i, 0, &tm);
- if (pStatObj)
- {
- Matrix34A objTM = m_pBaseObj->GetWorldTM();
- objTM.Invert();
- tm = objTM * tm;
- AddStatObj(pObj, pStatObj, &tm);
- }
- }
- }
- }
- }
-
- return true;
-}
-
-
bool CExportManager::AddObject(CBaseObject* pBaseObj)
{
if (m_isOccluder)
@@ -531,7 +322,6 @@ bool CExportManager::AddObject(CBaseObject* pBaseObj)
if (m_isPrecaching)
{
- AddMeshes(nullptr);
return true;
}
@@ -542,7 +332,6 @@ bool CExportManager::AddObject(CBaseObject* pBaseObj)
m_objectMap[pBaseObj] = int(m_data.m_objects.size() - 1);
- AddMeshes(pObj);
m_pBaseObj = nullptr;
return true;
@@ -1227,15 +1016,6 @@ bool CExportManager::ImportFromFile(const char* filename)
return bRet;
}
-bool CExportManager::ExportSingleStatObj(IStatObj* pStatObj, const char* filename)
-{
- Export::CObject* pObj = new Export::CObject(Path::GetFileName(filename).toUtf8().data());
- AddStatObj(pObj, pStatObj);
- m_data.m_objects.push_back(pObj);
- ExportToFile(filename, true);
- return true;
-}
-
void CExportManager::SaveNodeKeysTimeToXML()
{
CTrackViewSequence* pSequence = GetIEditor()->GetAnimation()->GetSequence();
diff --git a/Code/Editor/Export/ExportManager.h b/Code/Editor/Export/ExportManager.h
index 14318be957..6908bcf0f7 100644
--- a/Code/Editor/Export/ExportManager.h
+++ b/Code/Editor/Export/ExportManager.h
@@ -139,18 +139,11 @@ public:
bool ImportFromFile(const char* filename);
const Export::CData& GetData() const {return m_data; };
- //! Exports the stat obj to the obj file specified
- //! returns true if succeeded, otherwise false
- bool ExportSingleStatObj(IStatObj* pStatObj, const char* filename) override;
-
void SetBakedKeysSequenceExport(bool bBaked){m_bBakedKeysSequenceExport = bBaked; };
void SaveNodeKeysTimeToXML();
private:
- void AddMesh(Export::CObject* pObj, const IIndexedMesh* pIndMesh, Matrix34A* pTm = nullptr);
- bool AddStatObj(Export::CObject* pObj, IStatObj* pStatObj, Matrix34A* pTm = nullptr);
- bool AddMeshes(Export::CObject* pObj);
bool AddObject(CBaseObject* pBaseObj);
void SolveHierarchy();
diff --git a/Code/Editor/GameEngine.cpp b/Code/Editor/GameEngine.cpp
index ff247c1e6c..ed8f30af93 100644
--- a/Code/Editor/GameEngine.cpp
+++ b/Code/Editor/GameEngine.cpp
@@ -157,20 +157,20 @@ struct SSystemUserCallback
}
}
- int ShowMessage(const char* text, const char* caption, unsigned int uType) override
+ void ShowMessage(const char* text, const char* caption, unsigned int uType) override
{
if (CCryEditApp::instance()->IsInAutotestMode())
{
- return IDOK;
+ return;
}
const UINT kMessageBoxButtonMask = 0x000f;
if (!GetIEditor()->IsInGameMode() && (uType == 0 || uType == MB_OK || !(uType & kMessageBoxButtonMask)))
{
static_cast(GetIEditor())->AddErrorMessage(text, caption);
- return IDOK;
+ return;
}
- return CryMessageBox(text, caption, uType);
+ CryMessageBox(text, caption, uType);
}
void OnSplashScreenDone()
@@ -822,7 +822,7 @@ void CGameEngine::Update()
if (gEnv->pSystem)
{
gEnv->pSystem->UpdatePreTickBus();
- componentApplication->Tick(gEnv->pTimer->GetFrameTime(ITimer::ETIMER_GAME));
+ componentApplication->Tick();
gEnv->pSystem->UpdatePostTickBus();
}
@@ -838,7 +838,7 @@ void CGameEngine::Update()
unsigned int updateFlags = ESYSUPDATE_EDITOR;
GetIEditor()->GetAnimation()->Update();
GetIEditor()->GetSystem()->UpdatePreTickBus(updateFlags);
- componentApplication->Tick(gEnv->pTimer->GetFrameTime(ITimer::ETIMER_GAME));
+ componentApplication->Tick();
GetIEditor()->GetSystem()->UpdatePostTickBus(updateFlags);
}
}
diff --git a/Code/Editor/GameEngine.h b/Code/Editor/GameEngine.h
index 4104e9aeac..5a77fc2fb1 100644
--- a/Code/Editor/GameEngine.h
+++ b/Code/Editor/GameEngine.h
@@ -8,17 +8,11 @@
// Description : The game engine for editor
-
-
-#ifndef CRYINCLUDE_EDITOR_GAMEENGINE_H
-#define CRYINCLUDE_EDITOR_GAMEENGINE_H
-
#pragma once
#if !defined(Q_MOC_RUN)
#include
#include "LogFile.h"
-#include "CryListenerSet.h"
#include "Util/ModalWindowDismisser.h"
#endif
@@ -159,5 +153,3 @@ private:
AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING
};
-
-#endif // CRYINCLUDE_EDITOR_GAMEENGINE_H
diff --git a/Code/Editor/GameExporter.cpp b/Code/Editor/GameExporter.cpp
index ae1095b03a..a768861b90 100644
--- a/Code/Editor/GameExporter.cpp
+++ b/Code/Editor/GameExporter.cpp
@@ -146,13 +146,11 @@ bool CGameExporter::Export(unsigned int flags, [[maybe_unused]] EEndian eExportE
exportSuccessful = false;
}
- if (exportSuccessful)
+ if (exportSuccessful && m_bAutoExportMode)
{
- if (m_bAutoExportMode)
- {
- // Remove read-only flags.
- CrySetFileAttributes(m_levelPak.m_sPath.toUtf8().data(), FILE_ATTRIBUTE_NORMAL);
- }
+ // Remove read-only flags.
+ auto perms = QFile::permissions(m_levelPak.m_sPath) | QFile::Permission::WriteOwner;
+ QFile::setPermissions(m_levelPak.m_sPath, perms);
}
//////////////////////////////////////////////////////////////////////////
diff --git a/Code/Editor/IEditor.h b/Code/Editor/IEditor.h
index 7c49819d83..48c8392f32 100644
--- a/Code/Editor/IEditor.h
+++ b/Code/Editor/IEditor.h
@@ -508,8 +508,6 @@ struct IEditor
virtual CBaseObject* NewObject(const char* typeName, const char* fileName = "", const char* name = "", float x = 0.0f, float y = 0.0f, float z = 0.0f, bool modifyDoc = true) = 0;
//! Delete object
virtual void DeleteObject(CBaseObject* obj) = 0;
- //! Clone object
- virtual CBaseObject* CloneObject(CBaseObject* obj) = 0;
//! Get current selection group
virtual CSelectionGroup* GetSelection() = 0;
virtual CBaseObject* GetSelectedObject() = 0;
diff --git a/Code/Editor/IEditorImpl.cpp b/Code/Editor/IEditorImpl.cpp
index 66c64d5bef..e5df6be58e 100644
--- a/Code/Editor/IEditorImpl.cpp
+++ b/Code/Editor/IEditorImpl.cpp
@@ -397,11 +397,6 @@ void CEditorImpl::Update()
// Make sure this is not called recursively
m_bUpdates = false;
- //@FIXME: Restore this latter.
- //if (GetGameEngine() && GetGameEngine()->IsLevelLoaded())
- {
- m_pObjectManager->Update();
- }
if (IsInPreviewMode())
{
SetModifiedFlag(false);
@@ -687,13 +682,6 @@ void CEditorImpl::DeleteObject(CBaseObject* obj)
GetObjectManager()->DeleteObject(obj);
}
-CBaseObject* CEditorImpl::CloneObject(CBaseObject* obj)
-{
- SetModifiedFlag();
- GetIEditor()->SetModifiedModule(eModifiedBrushes);
- return GetObjectManager()->CloneObject(obj);
-}
-
CBaseObject* CEditorImpl::GetSelectedObject()
{
if (m_pObjectManager->GetSelection()->GetCount() != 1)
diff --git a/Code/Editor/IEditorImpl.h b/Code/Editor/IEditorImpl.h
index 26701edec2..4976c0c1ca 100644
--- a/Code/Editor/IEditorImpl.h
+++ b/Code/Editor/IEditorImpl.h
@@ -141,7 +141,6 @@ public:
const SGizmoParameters& GetGlobalGizmoParameters() override;
CBaseObject* NewObject(const char* typeName, const char* fileName = "", const char* name = "", float x = 0.0f, float y = 0.0f, float z = 0.0f, bool modifyDoc = true) override;
void DeleteObject(CBaseObject* obj) override;
- CBaseObject* CloneObject(CBaseObject* obj) override;
IObjectManager* GetObjectManager() override;
// This will return a null pointer if CrySystem is not loaded before
// Global Sandbox Settings are loaded from the registry before CrySystem
diff --git a/Code/Editor/IconManager.cpp b/Code/Editor/IconManager.cpp
index 820213bbd9..a9d31aef7b 100644
--- a/Code/Editor/IconManager.cpp
+++ b/Code/Editor/IconManager.cpp
@@ -21,8 +21,6 @@
#include "Util/Image.h"
#include "Util/ImageUtil.h"
-#include
-
#define HELPER_MATERIAL "Objects/Helper"
namespace
@@ -38,7 +36,6 @@ namespace
CIconManager::CIconManager()
{
ZeroStruct(m_icons);
- ZeroStruct(m_objects);
}
//////////////////////////////////////////////////////////////////////////
@@ -61,13 +58,7 @@ void CIconManager::Done()
void CIconManager::Reset()
{
// Do not unload objects. but clears them.
- int i;
- for (i = 0; i < sizeof(m_objects) / sizeof(m_objects[0]); i++)
- {
- delete m_objects[i];
- m_objects[i] = nullptr;
- }
- for (i = 0; i < eIcon_COUNT; i++)
+ for (int i = 0; i < eIcon_COUNT; i++)
{
m_icons[i] = 0;
}
@@ -110,12 +101,6 @@ int CIconManager::GetIconTexture(EIcon icon)
return m_icons[icon];
}
-//////////////////////////////////////////////////////////////////////////
-IStatObj* CIconManager::GetObject(EStatObject)
-{
- return nullptr;
-}
-
//////////////////////////////////////////////////////////////////////////
QImage* CIconManager::GetIconBitmap(const char* filename, bool& bHaveAlpha, uint32 effects /*=0*/)
{
diff --git a/Code/Editor/IconManager.h b/Code/Editor/IconManager.h
index 7183f036ed..7e9be63665 100644
--- a/Code/Editor/IconManager.h
+++ b/Code/Editor/IconManager.h
@@ -8,11 +8,6 @@
// Description : Manages Textures used by Icon.
-
-
-#ifndef CRYINCLUDE_EDITOR_ICONMANAGER_H
-#define CRYINCLUDE_EDITOR_ICONMANAGER_H
-
#pragma once
#include "Include/IIconManager.h" // for IIconManager
@@ -31,7 +26,7 @@ class CIconManager
public:
// Construction
CIconManager();
- ~CIconManager();
+ ~CIconManager() override;
void Init();
void Done();
@@ -41,8 +36,6 @@ public:
// Operations
virtual int GetIconTexture(EIcon icon);
-
- virtual IStatObj* GetObject(EStatObject object);
virtual int GetIconTexture(const char* iconName);
//////////////////////////////////////////////////////////////////////////
@@ -61,7 +54,6 @@ public:
private:
StdMap m_textures;
- IStatObj* m_objects[eStatObject_COUNT];
int m_icons[eIcon_COUNT];
//////////////////////////////////////////////////////////////////////////
@@ -70,5 +62,3 @@ private:
typedef std::map IconsMap;
IconsMap m_iconBitmapsMap;
};
-
-#endif // CRYINCLUDE_EDITOR_ICONMANAGER_H
diff --git a/Code/Editor/Include/HitContext.h b/Code/Editor/Include/HitContext.h
index 186124555f..ceff0adb22 100644
--- a/Code/Editor/Include/HitContext.h
+++ b/Code/Editor/Include/HitContext.h
@@ -19,7 +19,6 @@ class CBaseObject;
struct IDisplayViewport;
class CDeepSelection;
struct AABB;
-class CCamera;
#include
#include
@@ -68,8 +67,6 @@ struct HitContext
QRect rect;
//! Optional limiting bounding box for hit testing.
AABB* bounds;
- //! Optional camera for culling perspective viewports.
- CCamera* camera;
//! Testing performed in 2D viewport.
bool b2DViewport;
@@ -120,7 +117,6 @@ struct HitContext
rect = QRect();
b2DViewport = false;
view = 0;
- camera = 0;
point2d = QPoint();
axis = 0;
distanceTolerance = 0;
diff --git a/Code/Editor/Include/IDisplayViewport.h b/Code/Editor/Include/IDisplayViewport.h
index c7dff33e50..2dab2802c7 100644
--- a/Code/Editor/Include/IDisplayViewport.h
+++ b/Code/Editor/Include/IDisplayViewport.h
@@ -6,15 +6,11 @@
*
*/
-
-#ifndef CRYINCLUDE_EDITOR_INCLUDE_IDISPLAYVIEWPORT_H
-#define CRYINCLUDE_EDITOR_INCLUDE_IDISPLAYVIEWPORT_H
#pragma once
struct DisplayContext;
class CBaseObjectsCache;
class QPoint;
-class CCamera;
struct AABB;
class CViewport;
@@ -23,8 +19,6 @@ struct IDisplayViewport
{
virtual void Update() = 0;
virtual float GetScreenScaleFactor(const Vec3& position) const = 0;
- virtual float GetScreenScaleFactor(const CCamera& camera, const Vec3& object_position) = 0;
- virtual bool HitTestLine(const Vec3& lineP1, const Vec3& lineP2, const QPoint& hitpoint, int pixelRadius, float* pToCameraDistance = 0) const = 0;
/**
* Gets the distance of the point on screen to the line defined by the two points, converted to screenspace.
@@ -47,16 +41,12 @@ struct IDisplayViewport
virtual const Matrix34& GetViewTM() const = 0;
virtual const Matrix34& GetScreenTM() const = 0;
virtual QPoint WorldToView(const Vec3& worldPoint) const = 0;
- virtual QPoint WorldToViewParticleEditor(const Vec3& worldPoint, int width, int height) const = 0;
virtual Vec3 WorldToView3D(const Vec3& worldPoint, int flags = 0) const = 0;
virtual Vec3 ViewToWorld(const QPoint& vp, bool* collideWithTerrain = nullptr, bool onlyTerrain = false, bool bSkipVegetation = false, bool bTestRenderMesh = false, bool* collideWithObject = nullptr) const = 0;
virtual void ViewToWorldRay(const QPoint& vp, Vec3& raySrc, Vec3& rayDir) const = 0;
- virtual float GetGridStep() const = 0;
virtual void setRay(QPoint& vp, Vec3& raySrc, Vec3& rayDir) = 0;
- virtual void setHitcontext(QPoint& vp, Vec3& raySrc, Vec3& rayDir) = 0;
virtual float GetAspectRatio() const = 0;
- virtual const ::Plane* GetConstructionPlane() const = 0;
virtual bool IsBoundsVisible(const AABB& box) const = 0;
@@ -65,5 +55,3 @@ struct IDisplayViewport
virtual CViewport *asCViewport() { return nullptr; }
};
-
-#endif // CRYINCLUDE_EDITOR_INCLUDE_IDISPLAYVIEWPORT_H
diff --git a/Code/Editor/Include/IEditorMaterialManager.h b/Code/Editor/Include/IEditorMaterialManager.h
index d76ec32829..6f71c5ddd1 100644
--- a/Code/Editor/Include/IEditorMaterialManager.h
+++ b/Code/Editor/Include/IEditorMaterialManager.h
@@ -9,10 +9,6 @@
#define CRYINCLUDE_EDITOR_MATERIAL_IEDITORMATERIALMANAGER_H
#pragma once
-#define MATERIAL_FILE_EXT ".mtl"
-#define DCC_MATERIAL_FILE_EXT ".dccmtl"
-#define MATERIALS_PATH "materials/"
-
#include
#include
diff --git a/Code/Editor/Include/IExportManager.h b/Code/Editor/Include/IExportManager.h
index ea802134b6..ce79e52e15 100644
--- a/Code/Editor/Include/IExportManager.h
+++ b/Code/Editor/Include/IExportManager.h
@@ -8,14 +8,9 @@
// Description : Export geometry interfaces
-
-
-#ifndef CRYINCLUDE_EDITOR_INCLUDE_IEXPORTMANAGER_H
-#define CRYINCLUDE_EDITOR_INCLUDE_IEXPORTMANAGER_H
#pragma once
#define EXP_NAMESIZE 32
-struct IStatObj;
enum class AnimParamType;
namespace Export
@@ -178,18 +173,10 @@ struct IExporter
virtual void Release() = 0;
};
-
-
// IExportManager: interface to export manager
struct IExportManager
{
//! Register exporter
//! return true if succeed, otherwise false
virtual bool RegisterExporter(IExporter* pExporter) = 0;
-
- virtual bool ExportSingleStatObj(IStatObj* pStatObj, const char* filename) = 0;
};
-
-
-
-#endif // CRYINCLUDE_EDITOR_INCLUDE_IEXPORTMANAGER_H
diff --git a/Code/Editor/Include/IFileUtil.h b/Code/Editor/Include/IFileUtil.h
index e179f892d9..036a0bc5ee 100644
--- a/Code/Editor/Include/IFileUtil.h
+++ b/Code/Editor/Include/IFileUtil.h
@@ -60,7 +60,6 @@ struct IFileUtil
EFILE_TYPE_GEOMETRY,
EFILE_TYPE_TEXTURE,
EFILE_TYPE_SOUND,
- EFILE_TYPE_GEOMCACHE,
EFILE_TYPE_LAST,
};
@@ -114,9 +113,7 @@ struct IFileUtil
virtual void ShowInExplorer(const QString& path) = 0;
- virtual bool CompileLuaFile(const char* luaFilename) = 0;
virtual bool ExtractFile(QString& file, bool bMsgBoxAskForExtraction = true, const char* pDestinationFilename = nullptr) = 0;
- virtual void EditTextFile(const char* txtFile, int line = 0, ETextFileType fileType = FILE_TYPE_SCRIPT) = 0;
virtual void EditTextureFile(const char* txtureFile, bool bUseGameFolder) = 0;
//! dcc filename calculation and extraction sub-routines
diff --git a/Code/Editor/Include/IIconManager.h b/Code/Editor/Include/IIconManager.h
index 4925e47ae8..2407ea31bd 100644
--- a/Code/Editor/Include/IIconManager.h
+++ b/Code/Editor/Include/IIconManager.h
@@ -6,12 +6,8 @@
*
*/
-
-#ifndef CRYINCLUDE_EDITOR_INCLUDE_IICONMANAGER_H
-#define CRYINCLUDE_EDITOR_INCLUDE_IICONMANAGER_H
#pragma once
-struct IStatObj;
struct IMaterial;
class CBitmap;
@@ -56,12 +52,9 @@ enum EIconEffect
struct IIconManager
{
virtual ~IIconManager() = default;
- virtual IStatObj* GetObject(EStatObject object) = 0;
virtual int GetIconTexture(EIcon icon) = 0;
virtual int GetIconTexture(const char* iconName) = 0;
virtual QImage* GetIconBitmap(const char* filename, bool& haveAlpha, uint32 effects = 0) = 0;
// Register an Icon for the specific command
virtual void RegisterCommandIcon([[maybe_unused]] const char* filename, [[maybe_unused]] int nCommandId) {}
};
-
-#endif // CRYINCLUDE_EDITOR_INCLUDE_IICONMANAGER_H
diff --git a/Code/Editor/Include/IObjectManager.h b/Code/Editor/Include/IObjectManager.h
index 0a7bc8dcca..b612bcb80c 100644
--- a/Code/Editor/Include/IObjectManager.h
+++ b/Code/Editor/Include/IObjectManager.h
@@ -5,10 +5,6 @@
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
-
-
-#ifndef CRYINCLUDE_EDITOR_INCLUDE_IOBJECTMANAGER_H
-#define CRYINCLUDE_EDITOR_INCLUDE_IOBJECTMANAGER_H
#pragma once
#include
@@ -29,32 +25,15 @@ class CObjectArchive;
class CViewport;
struct HitContext;
enum class ImageRotationDegrees;
-struct IStatObj;
class CBaseObject;
class XmlNodeRef;
#include "ObjectEvent.h"
-enum SerializeFlags
-{
- SERIALIZE_ALL = 0,
- SERIALIZE_ONLY_SHARED = 1,
- SERIALIZE_ONLY_NOTSHARED = 2,
-};
-
//////////////////////////////////////////////////////////////////////////
typedef std::vector CBaseObjectsArray;
typedef std::pair< bool(CALLBACK*)(CBaseObject const&, void*), void* > BaseObjectFilterFunctor;
-struct IObjectSelectCallback
-{
- //! Called when object is selected.
- //! Return true if selection should proceed, or false to abort object selection.
- virtual bool OnSelectObject(CBaseObject* obj) = 0;
- //! Return true if object can be selected.
- virtual bool CanSelectObject(CBaseObject* obj) = 0;
-};
-
//////////////////////////////////////////////////////////////////////////
//
// Interface to access editor objects scene graph.
@@ -78,10 +57,6 @@ public:
virtual void DeleteObject(CBaseObject* obj) = 0;
virtual void DeleteSelection(CSelectionGroup* pSelection) = 0;
virtual void DeleteAllObjects() = 0;
- virtual CBaseObject* CloneObject(CBaseObject* obj) = 0;
-
- virtual void BeginEditParams(CBaseObject* obj, int flags) = 0;
- virtual void EndEditParams(int flags = 0) = 0;
//! Get number of objects manager by ObjectManager (not contain sub objects of groups).
virtual int GetObjectCount() const = 0;
@@ -90,27 +65,9 @@ public:
//! @param layer if 0 get objects for all layers, or layer to get objects from.
virtual void GetObjects(CBaseObjectsArray& objects) const = 0;
- //! Get array of objects that pass the filter.
- //! @param filter The filter functor, return true if you want to get the certain obj, return false if want to skip it.
- virtual void GetObjects(CBaseObjectsArray& objects, BaseObjectFilterFunctor const& filter) const = 0;
-
//! Display objects on specified display context.
virtual void Display(DisplayContext& dc) = 0;
- //! Called when selecting without selection helpers - this is needed since
- //! the visible object cache is normally not updated when not displaying helpers.
- virtual void ForceUpdateVisibleObjectCache(DisplayContext& dc) = 0;
-
- //! Check intersection with objects.
- //! Find intersection with nearest to ray origin object hit by ray.
- //! If distance tollerance is specified certain relaxation applied on collision test.
- //! @return true if hit any object, and fills hitInfo structure.
- virtual bool HitTest(HitContext& hitInfo) = 0;
-
- //! Check intersection with an object.
- //! @return true if hit, and fills hitInfo structure.
- virtual bool HitTestObject(CBaseObject* obj, HitContext& hc) = 0;
-
//! Gets a radius to be used for hit tests on the axis helpers, like the transform gizmo.
//! @return the axis helper hit radius.
virtual int GetAxisHelperHitRadius() const = 0;
@@ -137,59 +94,18 @@ public:
//! Find objects which intersect with a given AABB.
virtual void FindObjectsInAABB(const AABB& aabb, std::vector& result) const = 0;
- //////////////////////////////////////////////////////////////////////////
- // Operations on objects.
- //////////////////////////////////////////////////////////////////////////
- //! Makes object visible or invisible.
- virtual void HideObject(CBaseObject* obj, bool hide) = 0;
- //! Shows the last hidden object based on hidden ID
- virtual void ShowLastHiddenObject() = 0;
- //! Freeze object, making it unselectable.
- virtual void FreezeObject(CBaseObject* obj, bool freeze) = 0;
- //! Unhide all hidden objects.
- virtual void UnhideAll() = 0;
- //! Unfreeze all frozen objects.
- virtual void UnfreezeAll() = 0;
-
//////////////////////////////////////////////////////////////////////////
// Object Selection.
//////////////////////////////////////////////////////////////////////////
virtual bool SelectObject(CBaseObject* obj, bool bUseMask = true) = 0;
virtual void UnselectObject(CBaseObject* obj) = 0;
- //! Select objects within specified distance from given position.
- //! Return number of selected objects.
- virtual int SelectObjects(const AABB& box, bool bUnselect = false) = 0;
-
- virtual void SelectEntities(std::set& s) = 0;
-
- virtual int MoveObjects(const AABB& box, const Vec3& offset, ImageRotationDegrees rotation, bool bIsCopy = false) = 0;
-
- //! Selects/Unselects all objects within 2d rectangle in given viewport.
- virtual void SelectObjectsInRect(CViewport* view, const QRect& rect, bool bSelect) = 0;
- virtual void FindObjectsInRect(CViewport* view, const QRect& rect, std::vector& guids) = 0;
-
//! Clear default selection set.
//! @Return number of objects removed from selection.
virtual int ClearSelection() = 0;
- //! Deselect all current selected objects and selects object that were unselected.
- //! @Return number of selected objects.
- virtual int InvertSelection() = 0;
-
//! Get current selection.
virtual CSelectionGroup* GetSelection() const = 0;
- //! Get named selection.
- virtual CSelectionGroup* GetSelection(const QString& name) const = 0;
- // Get selection group names
- virtual void GetNameSelectionStrings(QStringList& names) = 0;
- //! Change name of current selection group.
- //! And store it in list.
- virtual void NameSelection(const QString& name) = 0;
- //! Set one of name selections as current selection.
- virtual void SetSelection(const QString& name) = 0;
- //! Removes one of named selections.
- virtual void RemoveSelection(const QString& name) = 0;
//! Delete all objects in current selection group.
virtual void DeleteSelection() = 0;
@@ -198,54 +114,11 @@ public:
virtual QString GenerateUniqueObjectName(const QString& typeName) = 0;
//! Register object name in object manager, needed for generating uniq names.
virtual void RegisterObjectName(const QString& name) = 0;
- //! Enable/Disable generating of unique object names (Enabled by default).
- //! Return previous value.
- virtual bool EnableUniqObjectNames(bool bEnable) = 0;
//! Find object class by name.
virtual CObjectClassDesc* FindClass(const QString& className) = 0;
- virtual void GetClassCategories(QStringList& categories) = 0;
- virtual void GetClassCategoryToolClassNamePairs(std::vector< std::pair >& categoryToolClassNamePairs) = 0;
- virtual void GetClassTypes(const QString& category, QStringList& types) = 0;
-
- //! Export objects to xml.
- //! When onlyShared is true ony objects with shared flags exported, overwise only not shared object exported.
- virtual void Export(const QString& levelPath, XmlNodeRef& rootNode, bool onlyShared) = 0;
- //! Export only entities to xml.
- virtual void ExportEntities(XmlNodeRef& rootNode) = 0;
-
- //! Serialize Objects in manager to specified XML Node.
- //! @param flags Can be one of SerializeFlags.
- virtual void Serialize(XmlNodeRef& rootNode, bool bLoading, int flags = SERIALIZE_ALL) = 0;
- virtual void SerializeNameSelection(XmlNodeRef& rootNode, bool bLoading) = 0;
-
- //! Load objects from object archive.
- //! @param bSelect if set newly loaded object will be selected.
- virtual void LoadObjects(CObjectArchive& ar, bool bSelect) = 0;
virtual void ChangeObjectId(REFGUID oldId, REFGUID newId) = 0;
- virtual bool IsDuplicateObjectName(const QString& newName) const = 0;
- virtual void ShowDuplicationMsgWarning(CBaseObject* obj, const QString& newName, bool bShowMsgBox) const = 0;
- virtual void ChangeObjectName(CBaseObject* obj, const QString& newName) = 0;
-
- //! while loading PreFabs we need to force this IDs
- //! to force always the same IDs, on each load.
- //! needed for RAM-maps assignments
- virtual uint32 ForceID() const = 0;
- virtual void ForceID(uint32 FID) = 0;
-
- //! Convert object of one type to object of another type.
- //! Original object is deleted.
- virtual bool ConvertToType(CBaseObject* pObject, const QString& typeName) = 0;
-
- //! Set new selection callback.
- //! @return previous selection callback.
- virtual IObjectSelectCallback* SetSelectCallback(IObjectSelectCallback* callback) = 0;
-
- // Enables/Disables creating of game objects.
- virtual void SetCreateGameObject(bool enable) = 0;
- //! Return true if objects loaded from xml should immidiatly create game objects associated with them.
- virtual bool IsCreateGameObjects() const = 0;
virtual IGizmoManager* GetGizmoManager() = 0;
@@ -253,34 +126,9 @@ public:
//! Invalidate visibily settings of objects.
virtual void InvalidateVisibleList() = 0;
- //////////////////////////////////////////////////////////////////////////
- // ObjectManager notification Callbacks.
- //////////////////////////////////////////////////////////////////////////
- virtual void AddObjectEventListener(EventListener* listener) = 0;
- virtual void RemoveObjectEventListener(EventListener* listener) = 0;
-
- //////////////////////////////////////////////////////////////////////////
- // Used to indicate starting and ending of objects loading.
- //////////////////////////////////////////////////////////////////////////
- virtual void StartObjectsLoading(int numObjects) = 0;
- virtual void EndObjectsLoading() = 0;
-
//////////////////////////////////////////////////////////////////////////
// Gathers all resources used by all objects.
virtual void GatherUsedResources(CUsedResources& resources) = 0;
virtual bool IsLightClass(CBaseObject* pObject) = 0;
-
- virtual void FindAndRenameProperty2(const char* property2Name, const QString& oldValue, const QString& newValue) = 0;
- virtual void FindAndRenameProperty2If(const char* property2Name, const QString& oldValue, const QString& newValue, const char* otherProperty2Name, const QString& otherValue) = 0;
-
- virtual bool IsReloading() const = 0;
-
- // Set bSkipUpdate to true if you want to skip update objects on the idle loop.
- virtual void SetSkipUpdate(bool bSkipUpdate) = 0;
-
- virtual void SetExportingLevel(bool bExporting) = 0;
- virtual bool IsExportingLevelInprogress() const = 0;
};
-
-#endif // CRYINCLUDE_EDITOR_INCLUDE_IOBJECTMANAGER_H
diff --git a/Code/Editor/Include/ObjectEvent.h b/Code/Editor/Include/ObjectEvent.h
index e59bca6111..a117a8f8f1 100644
--- a/Code/Editor/Include/ObjectEvent.h
+++ b/Code/Editor/Include/ObjectEvent.h
@@ -14,7 +14,6 @@
//! Standart objects types.
enum ObjectType
{
- OBJTYPE_DUMMY = 1 << 20,
OBJTYPE_AZENTITY = 1 << 21,
};
diff --git a/Code/Editor/LayoutWnd.cpp b/Code/Editor/LayoutWnd.cpp
index aa2a008844..ea125ca3d4 100644
--- a/Code/Editor/LayoutWnd.cpp
+++ b/Code/Editor/LayoutWnd.cpp
@@ -487,7 +487,6 @@ bool CLayoutWnd::LoadConfig()
CreateLayout((EViewLayout)layout, false);
- bool bRebindViewports = false;
if (m_splitWnd)
{
const QString str = settings.value("Viewports").toString();
@@ -498,14 +497,12 @@ bool CLayoutWnd::LoadConfig()
{
break;
}
- bRebindViewports = true;
if (!resToken.isEmpty())
{
m_viewType[nIndex] = resToken;
}
nIndex++;
}
- ;
}
BindViewports();
diff --git a/Code/Editor/Lib/Tests/Camera/test_EditorCamera.cpp b/Code/Editor/Lib/Tests/Camera/test_EditorCamera.cpp
index 637b9c44c5..dd7698a82e 100644
--- a/Code/Editor/Lib/Tests/Camera/test_EditorCamera.cpp
+++ b/Code/Editor/Lib/Tests/Camera/test_EditorCamera.cpp
@@ -27,7 +27,9 @@ namespace UnitTest
AZ::Entity* m_entity = nullptr;
AZ::ComponentDescriptor* m_transformComponent = nullptr;
- static const AzFramework::ViewportId TestViewportId;
+ static inline constexpr AzFramework::ViewportId TestViewportId = 2345;
+ static inline constexpr float HalfInterpolateToTransformDuration =
+ AtomToolsFramework::ModularViewportCameraControllerRequests::InterpolateToTransformDuration * 0.5f;
void SetUp() override
{
@@ -76,8 +78,6 @@ namespace UnitTest
}
};
- const AzFramework::ViewportId EditorCameraFixture::TestViewportId = AzFramework::ViewportId(1337);
-
TEST_F(EditorCameraFixture, ModularViewportCameraControllerReferenceFrameUpdatedWhenViewportEntityisChanged)
{
// Given
@@ -91,8 +91,8 @@ namespace UnitTest
&Camera::EditorCameraNotificationBus::Events::OnViewportViewEntityChanged, m_entity->GetId());
// ensure the viewport updates after the viewport view entity change
- const float deltaTime = 1.0f / 60.0f;
- m_controllerList->UpdateViewport({ TestViewportId, AzFramework::FloatSeconds(deltaTime), AZ::ScriptTimePoint() });
+ // note: do a large step to ensure smoothing finishes (e.g. not 1.0f/60.0f)
+ m_controllerList->UpdateViewport({ TestViewportId, AzFramework::FloatSeconds(2.0f), AZ::ScriptTimePoint() });
// retrieve updated camera transform
const AZ::Transform cameraTransform = m_cameraViewportContextView->GetCameraTransform();
@@ -102,61 +102,40 @@ namespace UnitTest
EXPECT_THAT(cameraTransform, IsClose(entityTransform));
}
- TEST_F(EditorCameraFixture, ReferenceFrameRemainsIdentityAfterExternalCameraTransformChangeWhenNotSet)
+ TEST_F(EditorCameraFixture, TrackingTransformIsTrueAfterTransformIsTracked)
{
- // Given
- m_cameraViewportContextView->SetCameraTransform(AZ::Transform::CreateTranslation(AZ::Vector3(10.0f, 20.0f, 30.0f)));
+ // Given/When
+ const AZ::Transform referenceFrame = AZ::Transform::CreateFromQuaternionAndTranslation(
+ AZ::Quaternion::CreateRotationX(AZ::DegToRad(90.0f)), AZ::Vector3(1.0f, 2.0f, 3.0f));
+ AtomToolsFramework::ModularViewportCameraControllerRequestBus::Event(
+ TestViewportId, &AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::StartTrackingTransform, referenceFrame);
- // When
- AZ::Transform referenceFrame = AZ::Transform::CreateTranslation(AZ::Vector3(1.0f, 2.0f, 3.0f));
+ bool trackingTransform = false;
AtomToolsFramework::ModularViewportCameraControllerRequestBus::EventResult(
- referenceFrame, TestViewportId, &AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::GetReferenceFrame);
+ trackingTransform, TestViewportId, &AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::IsTrackingTransform);
// Then
- // reference frame is still the identity
- EXPECT_THAT(referenceFrame, IsClose(AZ::Transform::CreateIdentity()));
+ EXPECT_THAT(trackingTransform, ::testing::IsTrue());
}
- TEST_F(EditorCameraFixture, ExternalCameraTransformChangeWhenReferenceFrameIsSetUpdatesReferenceFrame)
+ TEST_F(EditorCameraFixture, TrackingTransformIsFalseAfterTransformIsStoppedBeingTracked)
{
// Given
const AZ::Transform referenceFrame = AZ::Transform::CreateFromQuaternionAndTranslation(
AZ::Quaternion::CreateRotationX(AZ::DegToRad(90.0f)), AZ::Vector3(1.0f, 2.0f, 3.0f));
AtomToolsFramework::ModularViewportCameraControllerRequestBus::Event(
- TestViewportId, &AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::SetReferenceFrame, referenceFrame);
-
- const AZ::Transform nextTransform = AZ::Transform::CreateTranslation(AZ::Vector3(10.0f, 20.0f, 30.0f));
- m_cameraViewportContextView->SetCameraTransform(nextTransform);
-
- // When
- AZ::Transform currentReferenceFrame = AZ::Transform::CreateTranslation(AZ::Vector3(1.0f, 2.0f, 3.0f));
- AtomToolsFramework::ModularViewportCameraControllerRequestBus::EventResult(
- currentReferenceFrame, TestViewportId,
- &AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::GetReferenceFrame);
-
- // Then
- EXPECT_THAT(currentReferenceFrame, IsClose(nextTransform));
- }
-
- TEST_F(EditorCameraFixture, ReferenceFrameReturnedToIdentityAfterClear)
- {
- // Given
- const AZ::Transform referenceFrame = AZ::Transform::CreateFromQuaternionAndTranslation(
- AZ::Quaternion::CreateRotationX(AZ::DegToRad(90.0f)), AZ::Vector3(1.0f, 2.0f, 3.0f));
- AtomToolsFramework::ModularViewportCameraControllerRequestBus::Event(
- TestViewportId, &AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::SetReferenceFrame, referenceFrame);
+ TestViewportId, &AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::StartTrackingTransform, referenceFrame);
// When
AtomToolsFramework::ModularViewportCameraControllerRequestBus::Event(
- TestViewportId, &AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::ClearReferenceFrame);
-
- AZ::Transform currentReferenceFrame = AZ::Transform::CreateTranslation(AZ::Vector3(1.0f, 2.0f, 3.0f));
- AtomToolsFramework::ModularViewportCameraControllerRequestBus::EventResult(
- currentReferenceFrame, TestViewportId,
- &AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::GetReferenceFrame);
+ TestViewportId, &AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::StopTrackingTransform);
// Then
- EXPECT_THAT(currentReferenceFrame, IsClose(AZ::Transform::CreateIdentity()));
+ bool trackingTransform = false;
+ AtomToolsFramework::ModularViewportCameraControllerRequestBus::EventResult(
+ trackingTransform, TestViewportId, &AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::IsTrackingTransform);
+
+ EXPECT_THAT(trackingTransform, ::testing::IsFalse());
}
TEST_F(EditorCameraFixture, InterpolateToTransform)
@@ -169,8 +148,10 @@ namespace UnitTest
transformToInterpolateTo);
// simulate interpolation
- m_controllerList->UpdateViewport({ TestViewportId, AzFramework::FloatSeconds(0.5f), AZ::ScriptTimePoint() });
- m_controllerList->UpdateViewport({ TestViewportId, AzFramework::FloatSeconds(0.5f), AZ::ScriptTimePoint() });
+ m_controllerList->UpdateViewport(
+ { TestViewportId, AzFramework::FloatSeconds(HalfInterpolateToTransformDuration), AZ::ScriptTimePoint() });
+ m_controllerList->UpdateViewport(
+ { TestViewportId, AzFramework::FloatSeconds(HalfInterpolateToTransformDuration), AZ::ScriptTimePoint() });
const auto finalTransform = m_cameraViewportContextView->GetCameraTransform();
@@ -184,7 +165,7 @@ namespace UnitTest
const AZ::Transform referenceFrame = AZ::Transform::CreateFromQuaternionAndTranslation(
AZ::Quaternion::CreateRotationX(AZ::DegToRad(90.0f)), AZ::Vector3(1.0f, 2.0f, 3.0f));
AtomToolsFramework::ModularViewportCameraControllerRequestBus::Event(
- TestViewportId, &AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::SetReferenceFrame, referenceFrame);
+ TestViewportId, &AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::StartTrackingTransform, referenceFrame);
AZ::Transform transformToInterpolateTo = AZ::Transform::CreateFromQuaternionAndTranslation(
AZ::Quaternion::CreateRotationZ(AZ::DegToRad(90.0f)), AZ::Vector3(20.0f, 40.0f, 60.0f));
@@ -195,18 +176,85 @@ namespace UnitTest
transformToInterpolateTo);
// simulate interpolation
- m_controllerList->UpdateViewport({ TestViewportId, AzFramework::FloatSeconds(0.5f), AZ::ScriptTimePoint() });
- m_controllerList->UpdateViewport({ TestViewportId, AzFramework::FloatSeconds(0.5f), AZ::ScriptTimePoint() });
-
- AZ::Transform currentReferenceFrame = AZ::Transform::CreateTranslation(AZ::Vector3(1.0f, 2.0f, 3.0f));
- AtomToolsFramework::ModularViewportCameraControllerRequestBus::EventResult(
- currentReferenceFrame, TestViewportId,
- &AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::GetReferenceFrame);
+ m_controllerList->UpdateViewport(
+ { TestViewportId, AzFramework::FloatSeconds(HalfInterpolateToTransformDuration), AZ::ScriptTimePoint() });
+ m_controllerList->UpdateViewport(
+ { TestViewportId, AzFramework::FloatSeconds(HalfInterpolateToTransformDuration), AZ::ScriptTimePoint() });
const auto finalTransform = m_cameraViewportContextView->GetCameraTransform();
// Then
EXPECT_THAT(finalTransform, IsClose(transformToInterpolateTo));
- EXPECT_THAT(currentReferenceFrame, IsClose(AZ::Transform::CreateIdentity()));
+ }
+
+ TEST_F(EditorCameraFixture, BeginningCameraInterpolationReturnsTrue)
+ {
+ // Given/When
+ bool interpolationBegan = false;
+ AtomToolsFramework::ModularViewportCameraControllerRequestBus::EventResult(
+ interpolationBegan, TestViewportId,
+ &AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::InterpolateToTransform,
+ AZ::Transform::CreateTranslation(AZ::Vector3(10.0f, 10.0f, 10.0f)));
+
+ // Then
+ EXPECT_THAT(interpolationBegan, ::testing::IsTrue());
+ }
+
+ TEST_F(EditorCameraFixture, CameraInterpolationDoesNotBeginDuringAnExistingInterpolation)
+ {
+ // Given/When
+ bool initialInterpolationBegan = false;
+ AtomToolsFramework::ModularViewportCameraControllerRequestBus::EventResult(
+ initialInterpolationBegan, TestViewportId,
+ &AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::InterpolateToTransform,
+ AZ::Transform::CreateTranslation(AZ::Vector3(10.0f, 10.0f, 10.0f)));
+
+ m_controllerList->UpdateViewport(
+ { TestViewportId, AzFramework::FloatSeconds(HalfInterpolateToTransformDuration), AZ::ScriptTimePoint() });
+
+ bool nextInterpolationBegan = true;
+ AtomToolsFramework::ModularViewportCameraControllerRequestBus::EventResult(
+ nextInterpolationBegan, TestViewportId,
+ &AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::InterpolateToTransform,
+ AZ::Transform::CreateTranslation(AZ::Vector3(10.0f, 10.0f, 10.0f)));
+
+ bool interpolating = false;
+ AtomToolsFramework::ModularViewportCameraControllerRequestBus::EventResult(
+ interpolating, TestViewportId, &AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::IsInterpolating);
+
+ // Then
+ EXPECT_THAT(initialInterpolationBegan, ::testing::IsTrue());
+ EXPECT_THAT(nextInterpolationBegan, ::testing::IsFalse());
+ EXPECT_THAT(interpolating, ::testing::IsTrue());
+ }
+
+ TEST_F(EditorCameraFixture, CameraInterpolationCanBeginAfterAnInterpolationCompletes)
+ {
+ // Given/When
+ bool initialInterpolationBegan = false;
+ AtomToolsFramework::ModularViewportCameraControllerRequestBus::EventResult(
+ initialInterpolationBegan, TestViewportId,
+ &AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::InterpolateToTransform,
+ AZ::Transform::CreateTranslation(AZ::Vector3(10.0f, 10.0f, 10.0f)));
+
+ m_controllerList->UpdateViewport(
+ { TestViewportId,
+ AzFramework::FloatSeconds(AtomToolsFramework::ModularViewportCameraControllerRequests::InterpolateToTransformDuration + 0.5f),
+ AZ::ScriptTimePoint() });
+
+ bool interpolating = true;
+ AtomToolsFramework::ModularViewportCameraControllerRequestBus::EventResult(
+ interpolating, TestViewportId, &AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::IsInterpolating);
+
+ bool nextInterpolationBegan = false;
+ AtomToolsFramework::ModularViewportCameraControllerRequestBus::EventResult(
+ nextInterpolationBegan, TestViewportId,
+ &AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::InterpolateToTransform,
+ AZ::Transform::CreateTranslation(AZ::Vector3(10.0f, 10.0f, 10.0f)));
+
+ // Then
+ EXPECT_THAT(initialInterpolationBegan, ::testing::IsTrue());
+ EXPECT_THAT(interpolating, ::testing::IsFalse());
+ EXPECT_THAT(nextInterpolationBegan, ::testing::IsTrue());
}
} // namespace UnitTest
diff --git a/Code/Editor/Lib/Tests/test_EditorPythonBindings.cpp b/Code/Editor/Lib/Tests/test_EditorPythonBindings.cpp
index 1006c339ee..de0eb5df6f 100644
--- a/Code/Editor/Lib/Tests/test_EditorPythonBindings.cpp
+++ b/Code/Editor/Lib/Tests/test_EditorPythonBindings.cpp
@@ -25,7 +25,6 @@
#include
#include
#include
-#include
#include
#include "IEditorMock.h"
diff --git a/Code/Editor/Lib/Tests/test_ModularViewportCameraController.cpp b/Code/Editor/Lib/Tests/test_ModularViewportCameraController.cpp
index 275df11784..67d89ad967 100644
--- a/Code/Editor/Lib/Tests/test_ModularViewportCameraController.cpp
+++ b/Code/Editor/Lib/Tests/test_ModularViewportCameraController.cpp
@@ -9,7 +9,7 @@
#include
#include
#include
-#include
+#include
#include
#include
#include
@@ -74,7 +74,7 @@ namespace UnitTest
class ModularViewportCameraControllerFixture : public AllocatorsTestFixture
{
public:
- static const AzFramework::ViewportId TestViewportId;
+ static inline constexpr AzFramework::ViewportId TestViewportId = 1234;
void SetUp() override
{
@@ -146,6 +146,17 @@ namespace UnitTest
controller->SetCameraPropsBuilderCallback(
[](AzFramework::CameraProps& cameraProps)
{
+ // note: rotateSmoothness is also used for roll (not related to camera input directly)
+ cameraProps.m_rotateSmoothnessFn = []
+ {
+ return 5.0f;
+ };
+
+ cameraProps.m_translateSmoothnessFn = []
+ {
+ return 5.0f;
+ };
+
cameraProps.m_rotateSmoothingEnabledFn = []
{
return false;
@@ -209,8 +220,6 @@ namespace UnitTest
AZStd::unique_ptr m_editorModularViewportCameraComposer;
};
- const AzFramework::ViewportId ModularViewportCameraControllerFixture::TestViewportId = AzFramework::ViewportId(0);
-
TEST_F(ModularViewportCameraControllerFixture, MouseMovementDoesNotAccumulateExcessiveDriftInModularViewportCameraWithVaryingDeltaTime)
{
SandboxEditor::SetCameraCaptureCursorForLook(false);
@@ -380,6 +389,7 @@ namespace UnitTest
m_controllerList->UpdateViewport({ TestViewportId, AzFramework::FloatSeconds(deltaTime), AZ::ScriptTimePoint() });
QTest::mouseRelease(m_rootWidget.get(), Qt::MouseButton::RightButton, Qt::NoModifier, start + mouseDelta);
+ m_controllerList->UpdateViewport({ TestViewportId, AzFramework::FloatSeconds(deltaTime), AZ::ScriptTimePoint() });
// update the position of the widget
const auto offset = QPoint(500, 500);
diff --git a/Code/Editor/Lib/Tests/test_ObjectManagerPythonBindings.cpp b/Code/Editor/Lib/Tests/test_ObjectManagerPythonBindings.cpp
index 39a89670ef..64b7d36d30 100644
--- a/Code/Editor/Lib/Tests/test_ObjectManagerPythonBindings.cpp
+++ b/Code/Editor/Lib/Tests/test_ObjectManagerPythonBindings.cpp
@@ -63,16 +63,6 @@ namespace ObjectManagerPythonBindingsUnitTests
EXPECT_TRUE(behaviorContext->m_methods.find("get_selection_center") != behaviorContext->m_methods.end());
EXPECT_TRUE(behaviorContext->m_methods.find("get_selection_aabb") != behaviorContext->m_methods.end());
- EXPECT_TRUE(behaviorContext->m_methods.find("hide_object") != behaviorContext->m_methods.end());
- EXPECT_TRUE(behaviorContext->m_methods.find("is_object_hidden") != behaviorContext->m_methods.end());
- EXPECT_TRUE(behaviorContext->m_methods.find("unhide_object") != behaviorContext->m_methods.end());
- EXPECT_TRUE(behaviorContext->m_methods.find("hide_all_objects") != behaviorContext->m_methods.end());
- EXPECT_TRUE(behaviorContext->m_methods.find("unhide_all_objects") != behaviorContext->m_methods.end());
-
- EXPECT_TRUE(behaviorContext->m_methods.find("freeze_object") != behaviorContext->m_methods.end());
- EXPECT_TRUE(behaviorContext->m_methods.find("is_object_frozen") != behaviorContext->m_methods.end());
- EXPECT_TRUE(behaviorContext->m_methods.find("unfreeze_object") != behaviorContext->m_methods.end());
-
EXPECT_TRUE(behaviorContext->m_methods.find("delete_object") != behaviorContext->m_methods.end());
EXPECT_TRUE(behaviorContext->m_methods.find("delete_selected") != behaviorContext->m_methods.end());
diff --git a/Code/Editor/Lib/Tests/test_TrackViewPythonBindings.cpp b/Code/Editor/Lib/Tests/test_TrackViewPythonBindings.cpp
index 191596f4ae..88a4b4f63f 100644
--- a/Code/Editor/Lib/Tests/test_TrackViewPythonBindings.cpp
+++ b/Code/Editor/Lib/Tests/test_TrackViewPythonBindings.cpp
@@ -94,6 +94,9 @@ namespace TrackViewPythonBindingsUnitTests
m_app.Start(appDesc);
m_app.RegisterComponentDescriptor(AzToolsFramework::TrackViewComponent::CreateDescriptor());
+
+ // Disable saving global user settings to prevent failure due to detecting file updates
+ AZ::UserSettingsComponentRequestBus::Broadcast(&AZ::UserSettingsComponentRequests::DisableSaveOnFinalize);
}
void TearDown() override
diff --git a/Code/Editor/Lib/Tests/test_ViewportManipulatorController.cpp b/Code/Editor/Lib/Tests/test_ViewportManipulatorController.cpp
index 63e59ea940..473ddd81f7 100644
--- a/Code/Editor/Lib/Tests/test_ViewportManipulatorController.cpp
+++ b/Code/Editor/Lib/Tests/test_ViewportManipulatorController.cpp
@@ -8,10 +8,11 @@
#include
#include
-#include
+#include
#include
#include
#include
+#include
namespace UnitTest
{
@@ -77,14 +78,15 @@ namespace UnitTest
class ViewportManipulatorControllerFixture : public AllocatorsTestFixture
{
public:
- static const AzFramework::ViewportId TestViewportId;
+ static inline constexpr AzFramework::ViewportId TestViewportId = 1234;
+ static inline const QSize WidgetSize = QSize(1920, 1080);
void SetUp() override
{
AllocatorsTestFixture::SetUp();
m_rootWidget = AZStd::make_unique();
- m_rootWidget->setFixedSize(QSize(100, 100));
+ m_rootWidget->setFixedSize(WidgetSize);
QApplication::setActiveWindow(m_rootWidget.get());
m_controllerList = AZStd::make_shared();
@@ -111,8 +113,6 @@ namespace UnitTest
AZStd::unique_ptr m_inputChannelMapper;
};
- const AzFramework::ViewportId ViewportManipulatorControllerFixture::TestViewportId = AzFramework::ViewportId(0);
-
TEST_F(ViewportManipulatorControllerFixture, AnEventIsNotPropagatedToTheViewportWhenAManipulatorHandlesItFirst)
{
// forward input events to our controller list
@@ -227,4 +227,74 @@ namespace UnitTest
// the key was released (cleared)
EXPECT_TRUE(endedEvent);
}
+
+ TEST_F(ViewportManipulatorControllerFixture, DoubleClickIsNotRegisteredIfMouseDeltaHasMovedMoreThanDeadzoneInClickInterval)
+ {
+ AzFramework::NativeWindowHandle nativeWindowHandle = nullptr;
+
+ // forward input events to our controller list
+ QObject::connect(
+ m_inputChannelMapper.get(), &AzToolsFramework::QtEventToAzInputMapper::InputChannelUpdated, m_rootWidget.get(),
+ [this, nativeWindowHandle](const AzFramework::InputChannel* inputChannel, [[maybe_unused]] QEvent* event)
+ {
+ m_controllerList->HandleInputChannelEvent(
+ AzFramework::ViewportControllerInputEvent{ TestViewportId, nativeWindowHandle, *inputChannel });
+ });
+
+ ::testing::NiceMock mockWindowRequests;
+ mockWindowRequests.Connect(nativeWindowHandle);
+
+ using ::testing::Return;
+ // note: WindowRequests is used internally by ViewportManipulatorController
+ ON_CALL(mockWindowRequests, GetClientAreaSize())
+ .WillByDefault(Return(AzFramework::WindowSize(WidgetSize.width(), WidgetSize.height())));
+
+ EditorInteractionViewportSelectionFake editorInteractionViewportFake;
+ editorInteractionViewportFake.m_internalHandleMouseManipulatorInteraction = [](const MouseInteractionEvent&)
+ {
+ // report the event was not handled (manipulator was not interacted with)
+ return false;
+ };
+
+ bool doubleClickDetected = false;
+ editorInteractionViewportFake.m_internalHandleMouseViewportInteraction =
+ [&doubleClickDetected](const MouseInteractionEvent& mouseInteractionEvent)
+ {
+ // ensure no double click event is detected with the given inputs below
+ if (mouseInteractionEvent.m_mouseEvent == AzToolsFramework::ViewportInteraction::MouseEvent::DoubleClick)
+ {
+ doubleClickDetected = true;
+ }
+
+ return true;
+ };
+
+ editorInteractionViewportFake.Connect();
+
+ m_controllerList->Add(AZStd::make_shared());
+
+ // simulate a click, move, click
+ MouseMove(m_rootWidget.get(), QPoint(0, 0), QPoint(10, 10));
+ MousePressAndMove(m_rootWidget.get(), QPoint(10, 10), QPoint(0, 0), Qt::MouseButton::LeftButton);
+ QTest::mouseRelease(m_rootWidget.get(), Qt::MouseButton::LeftButton, Qt::KeyboardModifier::NoModifier, QPoint(10, 10));
+ MouseMove(m_rootWidget.get(), QPoint(10, 10), QPoint(20, 20));
+ MousePressAndMove(m_rootWidget.get(), QPoint(20, 20), QPoint(0, 0), Qt::MouseButton::LeftButton);
+ QTest::mouseRelease(m_rootWidget.get(), Qt::MouseButton::LeftButton, Qt::KeyboardModifier::NoModifier, QPoint(20, 20));
+
+ // ensure no double click was detected
+ EXPECT_FALSE(doubleClickDetected);
+
+ // simulate double click (sanity check it still is detected correctly with no movement)
+ MouseMove(m_rootWidget.get(), QPoint(0, 0), QPoint(10, 10));
+ MousePressAndMove(m_rootWidget.get(), QPoint(10, 10), QPoint(0, 0), Qt::MouseButton::LeftButton);
+ QTest::mouseRelease(m_rootWidget.get(), Qt::MouseButton::LeftButton, Qt::KeyboardModifier::NoModifier, QPoint(10, 10));
+ MousePressAndMove(m_rootWidget.get(), QPoint(10, 10), QPoint(0, 0), Qt::MouseButton::LeftButton);
+ QTest::mouseRelease(m_rootWidget.get(), Qt::MouseButton::LeftButton, Qt::KeyboardModifier::NoModifier, QPoint(10, 10));
+
+ // ensure a double click was detected
+ EXPECT_TRUE(doubleClickDetected);
+
+ mockWindowRequests.Disconnect();
+ editorInteractionViewportFake.Disconnect();
+ }
} // namespace UnitTest
diff --git a/Code/Editor/MainWindow.cpp b/Code/Editor/MainWindow.cpp
index 528b4eba6b..38e433c3a3 100644
--- a/Code/Editor/MainWindow.cpp
+++ b/Code/Editor/MainWindow.cpp
@@ -519,7 +519,7 @@ MainWindow* MainWindow::instance()
void MainWindow::closeEvent(QCloseEvent* event)
{
- gSettings.Save();
+ gSettings.Save(true);
AzFramework::SystemCursorState currentCursorState;
bool isInGameMode = false;
@@ -576,7 +576,6 @@ void MainWindow::closeEvent(QCloseEvent* event)
}
// Close all edit panels.
GetIEditor()->ClearSelection();
- GetIEditor()->GetObjectManager()->EndEditParams();
// force clean up of all deferred deletes, so that we don't have any issues with windows from plugins not being deleted yet
qApp->sendPostedEvents(nullptr, QEvent::DeferredDelete);
@@ -708,14 +707,10 @@ void MainWindow::InitActions()
.SetShortcut(QKeySequence::Undo)
.SetReserved()
.SetStatusTip(tr("Undo last operation"))
- //.SetMenu(new QMenu("FIXME"))
- .SetApplyHoverEffect()
.RegisterUpdateCallback(cryEdit, &CCryEditApp::OnUpdateUndo);
am->AddAction(ID_REDO, tr("&Redo"))
.SetShortcut(AzQtComponents::RedoKeySequence)
.SetReserved()
- //.SetMenu(new QMenu("FIXME"))
- .SetApplyHoverEffect()
.SetStatusTip(tr("Redo last undo operation"))
.RegisterUpdateCallback(cryEdit, &CCryEditApp::OnUpdateRedo);
@@ -731,7 +726,6 @@ void MainWindow::InitActions()
// Modify actions
am->AddAction(AzToolsFramework::EditModeMove, tr("Move"))
.SetIcon(Style::icon("Move"))
- .SetApplyHoverEffect()
.SetShortcut(tr("1"))
.SetToolTip(tr("Move (1)"))
.SetCheckable(true)
@@ -757,7 +751,6 @@ void MainWindow::InitActions()
});
am->AddAction(AzToolsFramework::EditModeRotate, tr("Rotate"))
.SetIcon(Style::icon("Translate"))
- .SetApplyHoverEffect()
.SetShortcut(tr("2"))
.SetToolTip(tr("Rotate (2)"))
.SetCheckable(true)
@@ -783,7 +776,6 @@ void MainWindow::InitActions()
});
am->AddAction(AzToolsFramework::EditModeScale, tr("Scale"))
.SetIcon(Style::icon("Scale"))
- .SetApplyHoverEffect()
.SetShortcut(tr("3"))
.SetToolTip(tr("Scale (3)"))
.SetCheckable(true)
@@ -808,7 +800,6 @@ void MainWindow::InitActions()
am->AddAction(AzToolsFramework::SnapToGrid, tr("Snap to grid"))
.SetIcon(Style::icon("Grid"))
- .SetApplyHoverEffect()
.SetShortcut(tr("G"))
.SetToolTip(tr("Snap to grid (G)"))
.SetStatusTip(tr("Toggles snap to grid"))
@@ -821,7 +812,6 @@ void MainWindow::InitActions()
am->AddAction(AzToolsFramework::SnapAngle, tr("Snap angle"))
.SetIcon(Style::icon("Angle"))
- .SetApplyHoverEffect()
.SetStatusTip(tr("Snap angle"))
.SetCheckable(true)
.RegisterUpdateCallback([](QAction* action) {
@@ -939,29 +929,28 @@ void MainWindow::InitActions()
.Connect(&QAction::triggered, this, &MainWindow::OnRefreshAudioSystem);
// Game actions
- am->AddAction(ID_VIEW_SWITCHTOGAME, tr("Play &Game"))
+ am->AddAction(ID_VIEW_SWITCHTOGAME, tr("Play Game"))
.SetIcon(QIcon(":/stylesheet/img/UI20/toolbar/Play.svg"))
+ .SetToolTip(tr("Play Game"))
+ .SetStatusTip(tr("Activate the game input mode"))
+ .SetCheckable(true)
+ .RegisterUpdateCallback(cryEdit, &CCryEditApp::OnUpdatePlayGame);
+ am->AddAction(ID_VIEW_SWITCHTOGAME_VIEWPORT, tr("Play Game"))
.SetShortcut(tr("Ctrl+G"))
.SetToolTip(tr("Play Game (Ctrl+G)"))
.SetStatusTip(tr("Activate the game input mode"))
- .SetApplyHoverEffect()
- .SetCheckable(true)
.RegisterUpdateCallback(cryEdit, &CCryEditApp::OnUpdatePlayGame);
- am->AddAction(ID_VIEW_SWITCHTOGAME_FULLSCREEN, tr("Play &Game (Maximized)"))
+ am->AddAction(ID_VIEW_SWITCHTOGAME_FULLSCREEN, tr("Play Game (Maximized)"))
.SetShortcut(tr("Ctrl+Shift+G"))
.SetStatusTip(tr("Activate the game input mode (maximized)"))
- .SetIcon(Style::icon("Play"))
- .SetApplyHoverEffect()
- .SetCheckable(true);
+ .RegisterUpdateCallback(cryEdit, &CCryEditApp::OnUpdatePlayGame);
am->AddAction(ID_TOOLBAR_WIDGET_PLAYCONSOLE_LABEL, tr("Play Controls"))
.SetText(tr("Play Controls"));
am->AddAction(ID_SWITCH_PHYSICS, tr("Simulate"))
.SetIcon(QIcon(":/stylesheet/img/UI20/toolbar/Simulate_Physics.svg"))
.SetShortcut(tr("Ctrl+P"))
.SetToolTip(tr("Simulate (Ctrl+P)"))
- .SetCheckable(true)
.SetStatusTip(tr("Enable processing of Physics and AI."))
- .SetApplyHoverEffect()
.SetCheckable(true)
.RegisterUpdateCallback(cryEdit, &CCryEditApp::OnSwitchPhysicsUpdate);
am->AddAction(ID_GAME_SYNCPLAYER, tr("Move Player and Camera Separately")).SetCheckable(true)
@@ -1051,8 +1040,7 @@ void MainWindow::InitActions()
// Editors Toolbar actions
am->AddAction(ID_OPEN_ASSET_BROWSER, tr("Asset browser"))
- .SetToolTip(tr("Open Asset Browser"))
- .SetApplyHoverEffect();
+ .SetToolTip(tr("Open Asset Browser"));
AZ::EBusReduceResult> emfxEnabled(false);
using AnimationRequestBus = AzToolsFramework::EditorAnimationSystemRequestsBus;
@@ -1062,8 +1050,7 @@ void MainWindow::InitActions()
{
QAction* action = am->AddAction(ID_OPEN_EMOTIONFX_EDITOR, tr("Animation Editor"))
.SetToolTip(tr("Open Animation Editor"))
- .SetIcon(QIcon(":/EMotionFX/EMFX_icon_32x32.png"))
- .SetApplyHoverEffect();
+ .SetIcon(QIcon(":/EMotionFX/EMFX_icon_32x32.png"));
QObject::connect(action, &QAction::triggered, this, []() {
QtViewPaneManager::instance()->OpenPane(LyViewPane::AnimationEditor);
});
@@ -1071,12 +1058,10 @@ void MainWindow::InitActions()
am->AddAction(ID_OPEN_AUDIO_CONTROLS_BROWSER, tr("Audio Controls Editor"))
.SetToolTip(tr("Open Audio Controls Editor"))
- .SetIcon(Style::icon("Audio"))
- .SetApplyHoverEffect();
+ .SetIcon(Style::icon("Audio"));
am->AddAction(ID_OPEN_UICANVASEDITOR, tr(LyViewPane::UiEditor))
- .SetToolTip(tr("Open UI Editor"))
- .SetApplyHoverEffect();
+ .SetToolTip(tr("Open UI Editor"));
// Edit Mode Toolbar Actions
am->AddAction(IDC_SELECTION_MASK, tr("Selected Object Types"));
@@ -1089,12 +1074,10 @@ void MainWindow::InitActions()
// Object Toolbar Actions
am->AddAction(ID_GOTO_SELECTED, tr("Go to selected object"))
.SetIcon(Style::icon("select_object"))
- .SetApplyHoverEffect()
.Connect(&QAction::triggered, this, &MainWindow::OnGotoSelected);
// Misc Toolbar Actions
- am->AddAction(ID_OPEN_SUBSTANCE_EDITOR, tr("Open Substance Editor"))
- .SetApplyHoverEffect();
+ am->AddAction(ID_OPEN_SUBSTANCE_EDITOR, tr("Open Substance Editor"));
}
void MainWindow::InitToolActionHandlers()
@@ -1266,7 +1249,9 @@ void MainWindow::OnGameModeChanged(bool inGameMode)
// block signals on the switch to game actions before setting the checked state, as
// setting the checked state triggers the action, which will re-enter this function
// and result in an infinite loop
- AZStd::vector actions = { m_actionManager->GetAction(ID_VIEW_SWITCHTOGAME), m_actionManager->GetAction(ID_VIEW_SWITCHTOGAME_FULLSCREEN) };
+ AZStd::vector actions = { m_actionManager->GetAction(ID_VIEW_SWITCHTOGAME_VIEWPORT),
+ m_actionManager->GetAction(ID_VIEW_SWITCHTOGAME_FULLSCREEN),
+ m_actionManager->GetAction(ID_VIEW_SWITCHTOGAME)};
for (auto action : actions)
{
action->blockSignals(true);
diff --git a/Code/Editor/Objects/AxisGizmo.cpp b/Code/Editor/Objects/AxisGizmo.cpp
index a603b2615d..7215853854 100644
--- a/Code/Editor/Objects/AxisGizmo.cpp
+++ b/Code/Editor/Objects/AxisGizmo.cpp
@@ -329,7 +329,6 @@ bool CAxisGizmo::MouseCallback(CViewport* view, EMouseEvent event, QPoint& point
hc.b2DViewport = view->GetType() != ET_ViewportCamera;
hc.point2d = point;
view->ViewToWorldRay(point, hc.raySrc, hc.rayDir);
- bool bHit = false;
if (HitTest(hc))
{
switch (hc.manipulatorMode)
@@ -344,7 +343,6 @@ bool CAxisGizmo::MouseCallback(CViewport* view, EMouseEvent event, QPoint& point
view->SetCurrentCursor(STD_CURSOR_SCALE);
break;
}
- bHit = true;
}
}
}
diff --git a/Code/Editor/Objects/BaseObject.cpp b/Code/Editor/Objects/BaseObject.cpp
index 4ae01faddf..86840789dd 100644
--- a/Code/Editor/Objects/BaseObject.cpp
+++ b/Code/Editor/Objects/BaseObject.cpp
@@ -33,8 +33,6 @@
#include "ViewManager.h"
#include "IEditorImpl.h"
#include "GameEngine.h"
-#include
-#include
// To use the Andrew's algorithm in order to make convex hull from the points, this header is needed.
#include "Util/GeometryUtil.h"
@@ -53,18 +51,16 @@ class CUndoBaseObject
: public IUndoObject
{
public:
- CUndoBaseObject(CBaseObject* pObj, const char* undoDescription);
+ CUndoBaseObject(CBaseObject* pObj);
protected:
int GetSize() override { return sizeof(*this); }
- QString GetDescription() override { return m_undoDescription; };
QString GetObjectName() override;
void Undo(bool bUndo) override;
void Redo() override;
protected:
- QString m_undoDescription;
GUID m_guid;
XmlNodeRef m_undo;
XmlNodeRef m_redo;
@@ -77,11 +73,10 @@ class CUndoBaseObjectMinimal
: public IUndoObject
{
public:
- CUndoBaseObjectMinimal(CBaseObject* obj, const char* undoDescription, int flags);
+ CUndoBaseObjectMinimal(CBaseObject* obj, int flags);
protected:
int GetSize() override { return sizeof(*this); }
- QString GetDescription() override { return m_undoDescription; };
QString GetObjectName() override;
void Undo(bool bUndo) override;
@@ -101,7 +96,6 @@ private:
void SetTransformsFromState(CBaseObject* pObject, const StateStruct& state, bool bUndo);
GUID m_guid;
- QString m_undoDescription;
StateStruct m_undoState;
StateStruct m_redoState;
};
@@ -167,7 +161,6 @@ private:
}
int GetSize() override { return sizeof(CUndoAttachBaseObject); }
- QString GetDescription() override { return "Attachment Changed"; }
GUID m_attachedObjectGUID;
GUID m_parentObjectGUID;
@@ -176,11 +169,10 @@ private:
};
//////////////////////////////////////////////////////////////////////////
-CUndoBaseObject::CUndoBaseObject(CBaseObject* obj, const char* undoDescription)
+CUndoBaseObject::CUndoBaseObject(CBaseObject* obj)
{
// Stores the current state of this object.
assert(obj != 0);
- m_undoDescription = undoDescription;
m_guid = obj->GetId();
m_redo = nullptr;
@@ -254,11 +246,10 @@ void CUndoBaseObject::Redo()
}
//////////////////////////////////////////////////////////////////////////
-CUndoBaseObjectMinimal::CUndoBaseObjectMinimal(CBaseObject* pObj, const char* undoDescription, [[maybe_unused]] int flags)
+CUndoBaseObjectMinimal::CUndoBaseObjectMinimal(CBaseObject* pObj, [[maybe_unused]] int flags)
{
// Stores the current state of this object.
assert(pObj != nullptr);
- m_undoDescription = undoDescription;
m_guid = pObj->GetId();
ZeroStruct(m_redoState);
@@ -287,7 +278,7 @@ QString CUndoBaseObjectMinimal::GetObjectName()
void CUndoBaseObjectMinimal::Undo(bool bUndo)
{
CBaseObject* pObject = GetIEditor()->GetObjectManager()->FindObject(m_guid);
- if (!pObject || pObject->GetType() == OBJTYPE_DUMMY)
+ if (!pObject)
{
return;
}
@@ -316,7 +307,7 @@ void CUndoBaseObjectMinimal::Undo(bool bUndo)
void CUndoBaseObjectMinimal::Redo()
{
CBaseObject* pObject = GetIEditor()->GetObjectManager()->FindObject(m_guid);
- if (!pObject || pObject->GetType() == OBJTYPE_DUMMY)
+ if (!pObject)
{
return;
}
@@ -382,7 +373,6 @@ CBaseObject::CBaseObject()
, m_rotate(IDENTITY)
, m_scale(1, 1, 1)
, m_guid(GUID_NULL)
- , m_floorNumber(-1)
, m_flags(0)
, m_nTextureIcon(0)
, m_color(QColor(255, 255, 255))
@@ -398,11 +388,9 @@ CBaseObject::CBaseObject()
, m_bMatrixInWorldSpace(false)
, m_bMatrixValid(false)
, m_bWorldBoxValid(false)
- , m_nMaterialLayersMask(0)
, m_nMinSpec(0)
, m_vDrawIconPos(0, 0, 0)
, m_nIconFlags(0)
- , m_hideOrder(CBaseObject::s_invalidHiddenID)
{
m_worldBounds.min.Set(0, 0, 0);
m_worldBounds.max.Set(0, 0, 0);
@@ -431,7 +419,6 @@ bool CBaseObject::Init([[maybe_unused]] IEditor* ie, CBaseObject* prev, [[maybe_
SetLocalTM(prev->GetPos(), prev->GetRotation(), prev->GetScale());
SetArea(prev->GetArea());
SetColor(prev->GetColor());
- m_nMaterialLayersMask = prev->m_nMaterialLayersMask;
SetMinSpec(prev->GetMinSpec(), false);
// Copy all basic variables.
@@ -488,7 +475,7 @@ void CBaseObject::SetName(const QString& name)
return;
}
- StoreUndo("Name");
+ StoreUndo();
// Notification is expensive and not required if this is during construction.
bool notify = (!m_name.isEmpty());
@@ -500,7 +487,6 @@ void CBaseObject::SetName(const QString& name)
if (notify)
{
NotifyListeners(ON_RENAME);
- static_cast(GetIEditor()->GetObjectManager())->NotifyObjectListeners(this, ON_RENAME);
}
}
@@ -529,47 +515,6 @@ const QString& CBaseObject::GetName() const
return m_name;
}
-//////////////////////////////////////////////////////////////////////////
-QString CBaseObject::GetWarningsText() const
-{
- QString warnings;
-
- if (gSettings.viewports.bShowScaleWarnings)
- {
- const EScaleWarningLevel scaleWarningLevel = GetScaleWarningLevel();
- if (scaleWarningLevel == eScaleWarningLevel_Rescaled)
- {
- warnings += "\\n Warning: Object Scale is not 100%.";
- }
- else if (scaleWarningLevel == eScaleWarningLevel_RescaledNonUniform)
- {
- warnings += "\\n Warning: Object has non-uniform scale.";
- }
- }
-
- if (gSettings.viewports.bShowRotationWarnings)
- {
- const ERotationWarningLevel rotationWarningLevel = GetRotationWarningLevel();
-
- if (rotationWarningLevel == eRotationWarningLevel_Rotated)
- {
- warnings += "\\n Warning: Object is rotated.";
- }
- else if (rotationWarningLevel == eRotationWarningLevel_RotatedNonRectangular)
- {
- warnings += "\\n Warning: Object is rotated non-orthogonally.";
- }
- }
-
- return warnings;
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool CBaseObject::IsSameClass(CBaseObject* obj)
-{
- return GetClassDesc() == obj->GetClassDesc();
-}
-
//////////////////////////////////////////////////////////////////////////
bool CBaseObject::SetPos(const Vec3& pos, int flags)
{
@@ -615,7 +560,7 @@ bool CBaseObject::SetPos(const Vec3& pos, int flags)
//////////////////////////////////////////////////////////////////////////
if (!bPositionDelegated && (flags & eObjectUpdateFlags_RestoreUndo) == 0 && (flags & eObjectUpdateFlags_Animated) == 0)
{
- StoreUndo("Position", true, flags);
+ StoreUndo(true, flags);
}
if (!bPositionDelegated)
@@ -659,7 +604,7 @@ bool CBaseObject::SetRotation(const Quat& rotate, int flags)
if (!bRotationDelegated && (flags & eObjectUpdateFlags_RestoreUndo) == 0 && (flags & eObjectUpdateFlags_Animated) == 0)
{
- StoreUndo("Rotate", true, flags);
+ StoreUndo(true, flags);
}
if (!bRotationDelegated)
@@ -704,7 +649,7 @@ bool CBaseObject::SetScale(const Vec3& scale, int flags)
if (!bScaleDelegated && (flags & eObjectUpdateFlags_RestoreUndo) == 0 && (flags & eObjectUpdateFlags_Animated) == 0)
{
- StoreUndo("Scale", true, flags);
+ StoreUndo(true, flags);
}
if (!bScaleDelegated)
@@ -763,7 +708,7 @@ void CBaseObject::ChangeColor(const QColor& color)
return;
}
- StoreUndo("Color", true);
+ StoreUndo(true);
SetColor(color);
SetModified(false);
@@ -783,7 +728,7 @@ void CBaseObject::SetArea(float area)
return;
}
- StoreUndo("Area", true);
+ StoreUndo(true);
m_flattenArea = area;
SetModified(false);
@@ -953,14 +898,8 @@ void CBaseObject::DrawTextureIcon(DisplayContext& dc, [[maybe_unused]] const Vec
}
//////////////////////////////////////////////////////////////////////////
-void CBaseObject::DrawWarningIcons(DisplayContext& dc, const Vec3& pos)
+void CBaseObject::DrawWarningIcons(DisplayContext& dc, const Vec3&)
{
- // Don't draw warning icons if they are beyond draw distance
- if ((dc.camera->GetPosition() - pos).GetLength() > gSettings.viewports.fWarningIconsDrawDistance)
- {
- return;
- }
-
if (gSettings.viewports.bShowIcons || gSettings.viewports.bShowSizeBasedIcons)
{
const int warningIconSizeX = OBJECT_TEXTURE_ICON_SIZEX / 2;
@@ -1010,11 +949,8 @@ void CBaseObject::DrawLabel(DisplayContext& dc, const Vec3& pos, const QColor& l
labelColor = QColor(0, 0, 0);
}
- float camDist = dc.camera->GetPosition().GetDistance(pos);
- float maxDist = dc.settings->GetLabelsDistance();
- if (camDist < dc.settings->GetLabelsDistance() || (dc.flags & DISPLAY_SELECTION_HELPERS))
+ if (dc.flags & DISPLAY_SELECTION_HELPERS)
{
- float range = maxDist / 2.0f;
Vec3 c(static_cast(labelColor.redF()), static_cast(labelColor.greenF()), static_cast(labelColor.redF()));
if (IsSelected())
{
@@ -1032,10 +968,6 @@ void CBaseObject::DrawLabel(DisplayContext& dc, const Vec3& pos, const QColor& l
col[1] = c.y;
col[2] = c.z;
}
- else if (camDist > range)
- {
- col[3] = col[3] * (1.0f - (camDist - range) / range);
- }
dc.SetColor(col[0], col[1], col[2], col[3] * alpha);
dc.DrawTextLabel(pos, size, GetName().toUtf8().data());
@@ -1196,74 +1128,6 @@ bool CBaseObject::CanBeDrawn(const DisplayContext& dc, bool& outDisplaySelection
return bResult;
}
-//////////////////////////////////////////////////////////////////////////
-bool CBaseObject::IsInCameraView(const CCamera& camera)
-{
- AABB bbox;
- GetBoundBox(bbox);
- return (camera.IsAABBVisible_F(AABB(bbox.min, bbox.max)));
-}
-
-//////////////////////////////////////////////////////////////////////////
-float CBaseObject::GetCameraVisRatio(const CCamera& camera)
-{
- AABB bbox;
- GetBoundBox(bbox);
-
- static const float defaultVisRatio = 1000.0f;
-
- const float objectHeightSq = max(1.0f, (bbox.max - bbox.min).GetLengthSquared());
- const float camdistSq = (bbox.min - camera.GetPosition()).GetLengthSquared();
- float visRatio = defaultVisRatio;
- if (camdistSq > FLT_EPSILON)
- {
- visRatio = objectHeightSq / camdistSq;
- }
-
- return visRatio;
-}
-
-//////////////////////////////////////////////////////////////////////////
-int CBaseObject::MouseCreateCallback(CViewport* view, EMouseEvent event, QPoint& point, int flags)
-{
- AZ_PROFILE_FUNCTION(Editor);
-
- if (event == eMouseMove || event == eMouseLDown)
- {
- Vec3 pos;
- if (GetIEditor()->GetAxisConstrains() != AXIS_TERRAIN)
- {
- pos = view->MapViewToCP(point);
- }
- else
- {
- // Snap to terrain.
- bool hitTerrain;
- pos = view->ViewToWorld(point, &hitTerrain);
- if (hitTerrain)
- {
- pos.z = GetIEditor()->GetTerrainElevation(pos.x, pos.y) + 1.0f;
- }
- pos = view->SnapToGrid(pos);
- }
- SetPos(pos);
-
- if (event == eMouseLDown)
- {
- return MOUSECREATE_OK;
- }
- }
-
- if (event == eMouseWheel)
- {
- float angle = 1;
- Quat rot = GetRotation();
- rot.SetRotationXYZ(Ang3(0.f, 0.f, rot.GetRotZ() + DEG2RAD(flags > 0 ? angle * (-1) : angle)));
- SetRotation(rot);
- }
- return MOUSECREATE_CONTINUE;
-}
-
//////////////////////////////////////////////////////////////////////////
void CBaseObject::OnEvent(ObjectEvent event)
{
@@ -1277,18 +1141,13 @@ void CBaseObject::OnEvent(ObjectEvent event)
//////////////////////////////////////////////////////////////////////////
-void CBaseObject::SetShared([[maybe_unused]] bool bShared)
-{
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CBaseObject::SetHidden(bool bHidden, uint64 hiddenID, bool bAnimated)
+void CBaseObject::SetHidden(bool bHidden, bool bAnimated)
{
if (CheckFlags(OBJFLAG_HIDDEN) != bHidden)
{
if (!bAnimated)
{
- StoreUndo("Hide Object");
+ StoreUndo();
}
if (bHidden)
@@ -1300,7 +1159,6 @@ void CBaseObject::SetHidden(bool bHidden, uint64 hiddenID, bool bAnimated)
ClearFlags(OBJFLAG_HIDDEN);
}
- m_hideOrder = hiddenID;
UpdateVisibility(!IsHidden());
}
}
@@ -1310,7 +1168,7 @@ void CBaseObject::SetFrozen(bool bFrozen)
{
if (CheckFlags(OBJFLAG_FROZEN) != bFrozen)
{
- StoreUndo("Freeze Object");
+ StoreUndo();
if (bFrozen)
{
SetFlags(OBJFLAG_FROZEN);
@@ -1396,14 +1254,6 @@ void CBaseObject::Serialize(CObjectArchive& ar)
if (ar.bLoading)
{
// Loading.
- if (ar.ShouldResetInternalMembers())
- {
- m_flags = 0;
- m_flattenArea = 0.0f;
- m_nMinSpec = 0;
- m_scale.Set(1.0f, 1.0f, 1.0f);
- }
-
int flags = 0;
int oldFlags = m_flags;
@@ -1443,7 +1293,6 @@ void CBaseObject::Serialize(CObjectArchive& ar)
xmlNode->getAttr("LookAt", lookatId);
xmlNode->getAttr("Material", mtlName);
xmlNode->getAttr("MinSpec", nMinSpec);
- xmlNode->getAttr("FloorNumber", m_floorNumber);
if (nMinSpec <= CONFIG_VERYHIGH_SPEC) // Ignore invalid values.
{
@@ -1507,18 +1356,6 @@ void CBaseObject::Serialize(CObjectArchive& ar)
SetModified(false);
//////////////////////////////////////////////////////////////////////////
-
- if (ar.bUndo)
- {
- // If we are selected update UI Panel.
- xmlNode->getAttr("HideOrder", m_hideOrder);
- }
-
- // We reseted the min spec and deserialized it so set it internally
- if (ar.ShouldResetInternalMembers())
- {
- SetMinSpec(m_nMinSpec);
- }
}
else
{
@@ -1530,7 +1367,6 @@ void CBaseObject::Serialize(CObjectArchive& ar)
xmlNode->setAttr("Id", m_guid);
xmlNode->setAttr("Name", GetName().toUtf8().data());
- xmlNode->setAttr("HideOrder", m_hideOrder);
if (m_parent)
{
@@ -1547,8 +1383,6 @@ void CBaseObject::Serialize(CObjectArchive& ar)
xmlNode->setAttr("Pos", GetPos());
}
- xmlNode->setAttr("FloorNumber", m_floorNumber);
-
xmlNode->setAttr("Rotate", m_rotate);
if (!IsEquivalent(GetScale(), Vec3(1, 1, 1), 0))
@@ -1641,13 +1475,8 @@ CBaseObject* CBaseObject::FindObject(REFGUID id) const
}
//////////////////////////////////////////////////////////////////////////
-void CBaseObject::StoreUndo(const char* UndoDescription, bool minimal, int flags)
+void CBaseObject::StoreUndo(bool minimal, int flags)
{
- if (m_objType == OBJTYPE_DUMMY)
- {
- return;
- }
-
// Don't use Sandbox undo for AZ entities, except for the move & scale tools, which rely on it.
const bool isGizmoTool = 0 != (flags & (eObjectUpdateFlags_MoveTool | eObjectUpdateFlags_ScaleTool | eObjectUpdateFlags_UserInput));
if (!isGizmoTool && 0 != (m_flags & OBJFLAG_DONT_SAVE))
@@ -1659,28 +1488,18 @@ void CBaseObject::StoreUndo(const char* UndoDescription, bool minimal, int flags
{
if (minimal)
{
- CUndo::Record(new CUndoBaseObjectMinimal(this, UndoDescription, flags));
+ CUndo::Record(new CUndoBaseObjectMinimal(this, flags));
}
else
{
- CUndo::Record(new CUndoBaseObject(this, UndoDescription));
+ CUndo::Record(new CUndoBaseObject(this));
}
}
}
-//////////////////////////////////////////////////////////////////////////
-bool CBaseObject::IsCreateGameObjects() const
-{
- return GetObjectManager()->IsCreateGameObjects();
-}
-
//////////////////////////////////////////////////////////////////////////
QString CBaseObject::GetTypeName() const
{
- if (m_objType == OBJTYPE_DUMMY)
- {
- return "";
- }
QString className = m_classDesc->ClassName();
QString subClassName = strstr(className.toUtf8().data(), "::");
if (subClassName.isEmpty())
@@ -1689,7 +1508,7 @@ QString CBaseObject::GetTypeName() const
}
QString name;
- name.append(className.mid(0, className.length() - subClassName.length()));
+ name.append(className.midRef(0, className.length() - subClassName.length()));
return name;
}
@@ -1941,85 +1760,6 @@ bool CBaseObject::HitTestRect(HitContext& hc)
return bHit;
}
-//////////////////////////////////////////////////////////////////////////
-bool CBaseObject::HitHelperTest(HitContext& hc)
-{
- return HitHelperAtTest(hc, GetWorldPos());
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool CBaseObject::HitHelperAtTest(HitContext& hc, const Vec3& pos)
-{
- AZ_PROFILE_FUNCTION(Editor);
-
- bool bResult = false;
-
- if (m_nTextureIcon && (gSettings.viewports.bShowIcons || gSettings.viewports.bShowSizeBasedIcons) && !hc.bUseSelectionHelpers)
- {
- int iconSizeX = OBJECT_TEXTURE_ICON_SIZEX;
- int iconSizeY = OBJECT_TEXTURE_ICON_SIZEY;
-
- if (gSettings.viewports.bDistanceScaleIcons)
- {
- float fScreenScale = hc.view->GetScreenScaleFactor(pos);
-
- iconSizeX = static_cast(static_cast(iconSizeX) * OBJECT_TEXTURE_ICON_SCALE / fScreenScale);
- iconSizeY = static_cast(static_cast(iconSizeY) * OBJECT_TEXTURE_ICON_SCALE / fScreenScale);
- }
-
- // Hit Test icon of this object.
- Vec3 testPos = pos;
- int y0 = -(iconSizeY / 2);
- int y1 = +(iconSizeY / 2);
- if (CheckFlags(OBJFLAG_SHOW_ICONONTOP))
- {
- Vec3 objectPos = GetWorldPos();
-
- AABB box;
- GetBoundBox(box);
- testPos.z = (pos.z - objectPos.z) + box.max.z;
- y0 = -(iconSizeY);
- y1 = 0;
- }
- QPoint pnt = hc.view->WorldToView(testPos);
-
- if (hc.point2d.x() >= pnt.x() - (iconSizeX / 2) && hc.point2d.x() <= pnt.x() + (iconSizeX / 2) &&
- hc.point2d.y() >= pnt.y() + y0 && hc.point2d.y() <= pnt.y() + y1)
- {
- hc.dist = hc.raySrc.GetDistance(testPos) - 0.2f;
- hc.iconHit = true;
- bResult = true;
- }
- }
- else if (hc.bUseSelectionHelpers)
- {
- // Check potentially children first
- bResult = HitHelperTestForChildObjects(hc);
-
- // If no hit check this object
- if (!bResult)
- {
- // Hit test helper.
- Vec3 w = pos - hc.raySrc;
- w = hc.rayDir.Cross(w);
- float d = w.GetLengthSquared();
-
- static const float screenScaleToRadiusFactor = 0.008f;
- const float radius = hc.view->GetScreenScaleFactor(pos) * screenScaleToRadiusFactor;
- const float pickDistance = hc.raySrc.GetDistance(pos);
- if (d < radius * radius + hc.distanceTolerance && hc.dist >= pickDistance)
- {
- hc.dist = pickDistance;
- hc.object = this;
- bResult = true;
- }
- }
- }
-
-
- return bResult;
-}
-
//////////////////////////////////////////////////////////////////////////
CBaseObject* CBaseObject::GetChild(size_t const i) const
{
@@ -2027,47 +1767,6 @@ CBaseObject* CBaseObject::GetChild(size_t const i) const
return m_childs[i];
}
-//////////////////////////////////////////////////////////////////////////
-bool CBaseObject::IsChildOf(CBaseObject* node)
-{
- CBaseObject* p = m_parent;
- while (p && p != node)
- {
- p = p->m_parent;
- }
- if (p == node)
- {
- return true;
- }
- return false;
-}
-
-//////////////////////////////////////////////////////////////////////////
-
-
-//////////////////////////////////////////////////////////////////////////
-void CBaseObject::CloneChildren(CBaseObject* pFromObject)
-{
- if (pFromObject == nullptr)
- {
- return;
- }
-
- for (size_t i = 0, nChildCount(pFromObject->GetChildCount()); i < nChildCount; ++i)
- {
- CBaseObject* pFromChildObject = pFromObject->GetChild(i);
-
- CBaseObject* pChildClone = GetObjectManager()->CloneObject(pFromChildObject);
- if (pChildClone == nullptr)
- {
- continue;
- }
-
- pChildClone->CloneChildren(pFromChildObject);
- AddMember(pChildClone, false);
- }
-}
-
//////////////////////////////////////////////////////////////////////////
void CBaseObject::AttachChild(CBaseObject* child, bool bKeepPos)
{
@@ -2084,7 +1783,6 @@ void CBaseObject::AttachChild(CBaseObject* child, bool bKeepPos)
return;
}
- static_cast(GetObjectManager())->NotifyObjectListeners(child, ON_PREATTACHED);
child->NotifyListeners(bKeepPos ? ON_PREATTACHEDKEEPXFORM : ON_PREATTACHED);
pTransformDelegate = m_pTransformDelegate;
@@ -2129,7 +1827,6 @@ void CBaseObject::AttachChild(CBaseObject* child, bool bKeepPos)
m_pTransformDelegate = pTransformDelegate;
child->m_pTransformDelegate = pChildTransformDelegate;
- static_cast(GetObjectManager())->NotifyObjectListeners(child, ON_ATTACHED);
child->NotifyListeners(ON_ATTACHED);
NotifyListeners(ON_CHILDATTACHED);
@@ -2167,7 +1864,6 @@ void CBaseObject::DetachThis(bool bKeepPos)
{
CScopedSuspendUndo suspendUndo;
- static_cast(GetObjectManager())->NotifyObjectListeners(this, ON_PREDETACHED);
NotifyListeners(bKeepPos ? ON_PREDETACHEDKEEPXFORM : ON_PREDETACHED);
pTransformDelegate = m_pTransformDelegate;
@@ -2198,7 +1894,6 @@ void CBaseObject::DetachThis(bool bKeepPos)
SetTransformDelegate(pTransformDelegate);
- static_cast(GetObjectManager())->NotifyObjectListeners(this, ON_DETACHED);
NotifyListeners(ON_DETACHED);
}
}
@@ -2302,12 +1997,6 @@ Matrix34 CBaseObject::GetParentAttachPointWorldTM() const
return Matrix34(IDENTITY);
}
-//////////////////////////////////////////////////////////////////////////
-bool CBaseObject::IsParentAttachmentValid() const
-{
- return true;
-}
-
//////////////////////////////////////////////////////////////////////////
void CBaseObject::InvalidateTM([[maybe_unused]] int flags)
{
@@ -2458,7 +2147,7 @@ void CBaseObject::SetLookAt(CBaseObject* target)
return;
}
- StoreUndo("Change LookAt");
+ StoreUndo();
if (m_lookat)
{
@@ -2583,63 +2272,6 @@ void CBaseObject::Validate(IErrorReport* report)
//////////////////////////////////////////////////////////////////////////
};
-//////////////////////////////////////////////////////////////////////////
-Ang3 CBaseObject::GetWorldAngles() const
-{
- if (m_scale == Vec3(1, 1, 1))
- {
- Quat q = Quat(GetWorldTM());
- Ang3 angles = RAD2DEG(Ang3::GetAnglesXYZ(Matrix33(q)));
- return angles;
- }
- else
- {
- Matrix34 tm = GetWorldTM();
- tm.OrthonormalizeFast();
- Quat q = Quat(tm);
- Ang3 angles = RAD2DEG(Ang3::GetAnglesXYZ(Matrix33(q)));
- return angles;
- }
-};
-
-//////////////////////////////////////////////////////////////////////////
-void CBaseObject::PostClone(CBaseObject* pFromObject, CObjectCloneContext& ctx)
-{
- CBaseObject* pFromParent = pFromObject->GetParent();
- if (pFromParent)
- {
- SetFloorNumber(pFromObject->GetFloorNumber());
-
- CBaseObject* pFromParentInContext = ctx.FindClone(pFromParent);
- if (pFromParentInContext)
- {
- pFromParentInContext->AddMember(this, false);
- }
- else
- {
- pFromParent->AddMember(this, false);
- }
- }
- if (pFromObject->ShouldCloneChildren())
- {
- for (int i = 0; i < pFromObject->GetChildCount(); i++)
- {
- CBaseObject* pChildObject = pFromObject->GetChild(i);
- CBaseObject* pClonedChild = GetObjectManager()->CloneObject(pChildObject);
- ctx.AddClone(pChildObject, pClonedChild);
- }
- for (int i = 0; i < pFromObject->GetChildCount(); i++)
- {
- CBaseObject* pChildObject = pFromObject->GetChild(i);
- CBaseObject* pClonedChild = ctx.FindClone(pChildObject);
- if (pClonedChild)
- {
- pClonedChild->PostClone(pChildObject, ctx);
- }
- }
- }
-}
-
//////////////////////////////////////////////////////////////////////////
void CBaseObject::GatherUsedResources(CUsedResources& resources)
{
@@ -2675,79 +2307,6 @@ void CBaseObject::SetMinSpec(uint32 nSpec, bool bSetChildren)
}
}
-//////////////////////////////////////////////////////////////////////////
-void CBaseObject::OnPropertyChanged(IVariable*)
-{
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CBaseObject::OnMultiSelPropertyChanged(IVariable*)
-{
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CBaseObject::OnMenuShowInAssetBrowser()
-{
- if (!IsSelected())
- {
- CUndo undo("Select Object");
- GetIEditor()->GetObjectManager()->ClearSelection();
- GetIEditor()->SelectObject(this);
- }
-
- GetIEditor()->ExecuteCommand("asset_browser.show_viewport_selection");
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CBaseObject::OnContextMenu(QMenu* menu)
-{
- if (!menu->isEmpty())
- {
- menu->addSeparator();
- }
- CUsedResources resources;
- GatherUsedResources(resources);
-
- static_cast(GetIEditor())->OnObjectContextMenuOpened(menu, this);
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool CBaseObject::IntersectRayMesh(const Vec3& raySrc, const Vec3& rayDir, SRayHitInfo& outHitInfo) const
-{
- const float fRenderMeshTestDistance = 0.2f;
- IRenderNode* pRenderNode = GetEngineNode();
- if (!pRenderNode)
- {
- return false;
- }
-
- Matrix34 worldTM;
- IStatObj* pStatObj = pRenderNode->GetEntityStatObj(0, 0, &worldTM);
- if (!pStatObj)
- {
- return false;
- }
-
- // transform decal into object space
- Matrix34 worldTM_Inverted = worldTM.GetInverted();
- Matrix33 worldRot(worldTM_Inverted);
- worldRot.Transpose();
- // put hit direction into the object space
- Vec3 vRayDir = rayDir.GetNormalized() * worldRot;
- // put hit position into the object space
- Vec3 vHitPos = worldTM_Inverted.TransformPoint(raySrc);
- Vec3 vLineP1 = vHitPos - vRayDir * fRenderMeshTestDistance;
-
- memset(&outHitInfo, 0, sizeof(outHitInfo));
- outHitInfo.inReferencePoint = vHitPos;
- outHitInfo.inRay.origin = vLineP1;
- outHitInfo.inRay.direction = vRayDir;
- outHitInfo.bInFirstHit = false;
- outHitInfo.bUseCache = false;
-
- return pStatObj->RayIntersection(outHitInfo, nullptr);
-}
-
//////////////////////////////////////////////////////////////////////////
EScaleWarningLevel CBaseObject::GetScaleWarningLevel() const
{
diff --git a/Code/Editor/Objects/BaseObject.h b/Code/Editor/Objects/BaseObject.h
index 3865696ecb..f78755e81d 100644
--- a/Code/Editor/Objects/BaseObject.h
+++ b/Code/Editor/Objects/BaseObject.h
@@ -35,8 +35,6 @@ struct SSubObjSelectionModifyContext;
struct SRayHitInfo;
class CPopupMenuItem;
class QMenu;
-struct IRenderNode;
-struct IStatObj;
//////////////////////////////////////////////////////////////////////////
typedef _smart_ptr CBaseObjectPtr;
@@ -119,15 +117,6 @@ enum ObjectFlags
#define ERF_GET_WRITABLE(flags) (flags)
-//////////////////////////////////////////////////////////////////////////
-//! This flags passed to CBaseObject::BeginEditParams method.
-enum ObjectEditFlags
-{
- OBJECT_CREATE = 0x001,
- OBJECT_EDIT = 0x002,
- OBJECT_COLLAPSE_OBJECTPANEL = 0x004
-};
-
//////////////////////////////////////////////////////////////////////////
//! Return values from CBaseObject::MouseCreateCallback method.
enum MouseCreateResult
@@ -137,19 +126,6 @@ enum MouseCreateResult
MOUSECREATE_OK, //!< Accept this object.
};
-//////////////////////////////////////////////////////////////////////////
-// Interface to the object create with the mouse callback.
-//////////////////////////////////////////////////////////////////////////
-struct IMouseCreateCallback
-{
- virtual void Release() = 0;
- virtual MouseCreateResult OnMouseEvent(CViewport* view, EMouseEvent event, QPoint& point, int flags) = 0;
- // Some process of creation need to be able to be displayed such as creation for custom solid.
- virtual void Display([[maybe_unused]] DisplayContext& dc){}
- // Called after accepting an object to see if new object creation mode should be continued.
- virtual bool ContinueCreation() = 0;
-};
-
// Flags used for object interaction
enum EObjectUpdateFlags
{
@@ -261,22 +237,11 @@ public:
/** Check if both object are of same class.
*/
- virtual bool IsSameClass(CBaseObject* obj);
- virtual void SetDefaultType() { m_objType = OBJTYPE_DUMMY; };
virtual ObjectType GetType() const
{
- if (m_objType == OBJTYPE_DUMMY)
- {
- return m_objType;
- }
- else
- {
- return m_classDesc->GetObjectType();
- }
+ return m_classDesc->GetObjectType();
};
- // const char* GetTypeName() const { return m_classDesc->ClassName(); };
QString GetTypeName() const;
- virtual QString GetTypeDescription() const { return m_classDesc->ClassName(); };
//////////////////////////////////////////////////////////////////////////
// Flags.
@@ -289,8 +254,6 @@ public:
// Hidden ID
//////////////////////////////////////////////////////////////////////////
static const uint64 s_invalidHiddenID = 0;
- uint64 GetHideOrder() const { return m_hideOrder; }
- void SetHideOrder(uint64 newID) { m_hideOrder = newID; }
//! Returns true if object hidden.
bool IsHidden() const;
@@ -307,26 +270,19 @@ public:
virtual bool IsSelectable() const;
// Return texture icon.
- bool HaveTextureIcon() const { return m_nTextureIcon != 0; };
int GetTextureIcon() const { return m_nTextureIcon; }
void SetTextureIcon(int nTexIcon) { m_nTextureIcon = nTexIcon; }
- //! Set shared between missions flag.
- virtual void SetShared(bool bShared);
//! Set object hidden status.
- virtual void SetHidden(bool bHidden, uint64 hiddenId = CBaseObject::s_invalidHiddenID, bool bAnimated = false);
+ virtual void SetHidden(bool bHidden, bool bAnimated = false);
//! Set object frozen status.
virtual void SetFrozen(bool bFrozen);
//! Set object selected status.
virtual void SetSelected(bool bSelect);
- //! Return associated 3DEngine render node
- virtual IRenderNode* GetEngineNode() const { return nullptr; };
//! Set object highlighted (Note: not selected)
virtual void SetHighlight(bool bHighlight);
//! Check if object is highlighted.
bool IsHighlighted() const { return CheckFlags(OBJFLAG_HIGHLIGHT); }
- //! Check if object can have measurement axises.
- virtual bool HasMeasurementAxis() const { return true; }
//! Check if the object is isolated when the editor is in Isolation Mode
virtual bool IsIsolated() const { return false; }
@@ -345,8 +301,6 @@ public:
//////////////////////////////////////////////////////////////////////////
//! Get name of object.
const QString& GetName() const;
- virtual QString GetComment() const { return QString(); }
- virtual QString GetWarningsText() const;
//! Change name of object.
virtual void SetName(const QString& name);
@@ -376,10 +330,6 @@ public:
//! Get object scale.
const Vec3 GetScale() const;
- virtual bool StartScaling() { return false; }
- virtual bool GetUntransformedScale([[maybe_unused]] Vec3& scale) const { return false; }
- virtual bool TransformScale([[maybe_unused]] const Vec3& scale) { return false; }
-
//! Set flatten area.
void SetArea(float area);
float GetArea() const { return m_flattenArea; };
@@ -397,8 +347,6 @@ public:
// CHILDS
//////////////////////////////////////////////////////////////////////////
- //! Return true if node have childs.
- bool HaveChilds() const { return !m_childs.empty(); }
//! Return true if have attached childs.
size_t GetChildCount() const { return m_childs.size(); }
@@ -406,10 +354,6 @@ public:
CBaseObject* GetChild(size_t const i) const;
//! Return parent node if exist.
CBaseObject* GetParent() const { return m_parent; };
- //! Scans hierarchy up to determine if we child of specified node.
- virtual bool IsChildOf(CBaseObject* node);
- //! Clone Children
- void CloneChildren(CBaseObject* pFromObject);
//! Attach new child node.
//! @param bKeepPos if true Child node will keep its world space position.
virtual void AttachChild(CBaseObject* child, bool bKeepPos = true);
@@ -422,8 +366,6 @@ public:
virtual void DetachAll(bool bKeepPos = true);
// Detach this node from parent.
virtual void DetachThis(bool bKeepPos = true);
- // Returns the link parent.
- virtual CBaseObject* GetLinkParent() const { return GetParent(); }
//////////////////////////////////////////////////////////////////////////
// MATRIX
@@ -437,15 +379,11 @@ public:
// Gets matrix of parent attachment point
virtual Matrix34 GetParentAttachPointWorldTM() const;
- // Checks if the attachment point is valid
- virtual bool IsParentAttachmentValid() const;
-
//! Set position in world space.
virtual void SetWorldPos(const Vec3& pos, int flags = 0);
//! Get position in world space.
Vec3 GetWorldPos() const { return GetWorldTM().GetTranslation(); };
- Ang3 GetWorldAngles() const;
//! Set xform of object given in world space.
virtual void SetWorldTM(const Matrix34& tm, int flags = 0);
@@ -460,12 +398,6 @@ public:
// Interface to be implemented in plugins.
//////////////////////////////////////////////////////////////////////////
- //! Called when object is being created (use GetMouseCreateCallback for more advanced mouse creation callback).
- virtual int MouseCreateCallback(CViewport* view, EMouseEvent event, QPoint& point, int flags);
- // Return pointer to the callback object used when creating object by the mouse.
- // If this function return nullptr MouseCreateCallback method will be used instead.
- virtual IMouseCreateCallback* GetMouseCreateCallback() { return nullptr; };
-
//! Draw object to specified viewport.
virtual void Display([[maybe_unused]] DisplayContext& disp) {}
@@ -477,10 +409,6 @@ public:
//! Return true if was hit.
virtual bool HitTestRect(HitContext& hc);
- //! Perform intersection testing of this object based on its icon helper.
- //! Return true if was hit.
- virtual bool HitHelperTest(HitContext& hc);
-
//! Get bounding box of object in world coordinate space.
virtual void GetBoundBox(AABB& box);
@@ -500,8 +428,6 @@ public:
//! @param bUndo true if loading or saving data for Undo/Redo purposes.
virtual void Serialize(CObjectArchive& ar);
- //// Pre load called before serialize after all objects where completly loaded.
- //virtual void PreLoad( CObjectArchive &ar ) {};
// Post load called after all objects where completely loaded.
virtual void PostLoad([[maybe_unused]] CObjectArchive& ar) {};
@@ -513,9 +439,6 @@ public:
//! Override in derived classes, to handle specific events.
virtual void OnEvent(ObjectEvent event);
- //! Generate dynamic context menu for the object
- virtual void OnContextMenu(QMenu* menu);
-
//////////////////////////////////////////////////////////////////////////
// LookAt Target.
//////////////////////////////////////////////////////////////////////////
@@ -523,13 +446,11 @@ public:
CBaseObject* GetLookAt() const { return m_lookat; };
//! Returns true if this object is a look-at target.
bool IsLookAtTarget() const;
- CBaseObject* GetLookAtSource() const { return m_lookatSource; };
-
IObjectManager* GetObjectManager() const;
//! Store undo information for this object.
- void StoreUndo(const char* undoDescription, bool minimal = false, int flags = 0);
+ void StoreUndo(bool minimal = false, int flags = 0);
//! Add event listener callback.
void AddEventListener(EventListener* listener);
@@ -548,52 +469,21 @@ public:
//! Check if specified object is very similar to this one.
virtual bool IsSimilarObject(CBaseObject* pObject);
- //////////////////////////////////////////////////////////////////////////
- // Material Layers Mask.
- //////////////////////////////////////////////////////////////////////////
- virtual void SetMaterialLayersMask(uint32 nLayersMask) { m_nMaterialLayersMask = nLayersMask; }
- uint32 GetMaterialLayersMask() const { return m_nMaterialLayersMask; };
-
//////////////////////////////////////////////////////////////////////////
// Object minimal usage spec (All/Low/Medium/High)
//////////////////////////////////////////////////////////////////////////
uint32 GetMinSpec() const { return m_nMinSpec; }
virtual void SetMinSpec(uint32 nSpec, bool bSetChildren = true);
- //////////////////////////////////////////////////////////////////////////
- // SubObj selection.
- //////////////////////////////////////////////////////////////////////////
- // Return true if object support selecting of this sub object element type.
- virtual bool StartSubObjSelection([[maybe_unused]] int elemType) { return false; };
- virtual void EndSubObjectSelection() {};
- virtual void ModifySubObjSelection([[maybe_unused]] SSubObjSelectionModifyContext& modCtx) {};
- virtual void AcceptSubObjectModify() {};
-
//! In This function variables of the object must be initialized.
virtual void InitVariables() {};
- //////////////////////////////////////////////////////////////////////////
- // Procedural Floor Management.
- //////////////////////////////////////////////////////////////////////////
- int GetFloorNumber() const { return m_floorNumber; };
- void SetFloorNumber(int floorNumber) { m_floorNumber = floorNumber; };
-
- virtual void OnPropertyChanged(IVariable*);
- virtual void OnMultiSelPropertyChanged(IVariable*);
-
//! Draw a reddish highlight indicating its budget usage.
virtual void DrawBudgetUsage(DisplayContext& dc, const QColor& color);
- bool IntersectRayMesh(const Vec3& raySrc, const Vec3& rayDir, SRayHitInfo& outHitInfo) const;
-
- virtual void EditTags([[maybe_unused]] bool alwaysTag) {}
- virtual bool SupportsEditTags() const { return false; }
-
bool CanBeHightlighted() const;
bool IsSkipSelectionHelper() const;
- virtual IStatObj* GetIStatObj() { return nullptr; }
-
// Invalidates cached transformation matrix.
// nWhyFlags - Flags that indicate the reason for matrix invalidation.
virtual void InvalidateTM(int nWhyFlags);
@@ -612,26 +502,14 @@ protected:
//! Optional file parameter specify initial object or script for this object.
virtual bool Init(IEditor* ie, CBaseObject* prev, const QString& file);
- //////////////////////////////////////////////////////////////////////////
- //! Must be called after cloning the object on clone of object.
- //! This will make sure object references are cloned correctly.
- virtual void PostClone(CBaseObject* pFromObject, CObjectCloneContext& ctx);
-
//! Must be implemented by derived class to create game related objects.
virtual bool CreateGameObject() { return true; };
- //! If true, all attached chilren will be cloned when the parent object is cloned.
- virtual bool ShouldCloneChildren() const { return true; }
-
/** Called when object is about to be deleted.
- All Game resources should be freed in this function.
+ All Game resources should be freed in this function.
*/
virtual void Done();
- /** Change current id of object.
- */
- //virtual void SetId( uint32 objectId ) { m_id = objectId; };
-
//! Call this to delete an object.
virtual void DeleteThis() = 0;
@@ -674,11 +552,6 @@ protected:
//! Returns if the object can be drawn, and if its selection helper should also be drawn.
bool CanBeDrawn(const DisplayContext& dc, bool& outDisplaySelectionHelper) const;
- //! Returns if object is in the camera view.
- virtual bool IsInCameraView(const CCamera& camera);
- //! Returns vis ratio of object in camera
- virtual float GetCameraVisRatio(const CCamera& camera);
-
// Do basic intersection tests
virtual bool IntersectRectBounds(const AABB& bbox);
virtual bool IntersectRayBounds(const Ray& ray);
@@ -687,17 +560,11 @@ protected:
// Function can be used by derived classes.
bool HitTestRectBounds(HitContext& hc, const AABB& box);
- // Do helper hit testing as specific location.
- bool HitHelperAtTest(HitContext& hc, const Vec3& pos);
-
// Do helper hit testing taking child objects into account (e.g. opened prefab)
virtual bool HitHelperTestForChildObjects([[maybe_unused]] HitContext& hc) { return false; }
CBaseObject* FindObject(REFGUID id) const;
- // Returns true if game objects should be created.
- bool IsCreateGameObjects() const;
-
// Helper gizmo functions.
void AddGizmo(CGizmo* gizmo);
void RemoveGizmo(CGizmo* gizmo);
@@ -708,14 +575,6 @@ protected:
//! Only used by ObjectManager.
bool IsPotentiallyVisible() const;
- //////////////////////////////////////////////////////////////////////////
- // May be overridden in derived classes to handle helpers scaling.
- //////////////////////////////////////////////////////////////////////////
- virtual void SetHelperScale([[maybe_unused]] float scale) {};
- virtual float GetHelperScale() { return 1.0f; };
-
- void SetNameInternal(const QString& name) { m_name = name; }
-
void SetDrawTextureIconProperties(DisplayContext& dc, const Vec3& pos, float alpha = 1.0f, int texIconFlags = 0);
const Vec3& GetTextureIconDrawPos(){ return m_vDrawIconPos; };
int GetTextureIconFlags(){ return m_nIconFlags; };
@@ -737,8 +596,6 @@ private:
friend class CObjectArchive;
friend class CSelectionGroup;
- void OnMenuShowInAssetBrowser();
-
//! Set class description for this object,
//! Only called once after creation by ObjectManager.
void SetClassDesc(CObjectClassDesc* classDesc);
@@ -746,9 +603,6 @@ private:
EScaleWarningLevel GetScaleWarningLevel() const;
ERotationWarningLevel GetRotationWarningLevel() const;
- // auto resolving
- void OnMtlResolved(uint32 id, bool success, const char* orgName, const char* newName);
-
bool IsInSelectionBox() const { return m_bInSelectionBox; }
void SetId(REFGUID guid) { m_guid = guid; }
@@ -771,13 +625,10 @@ private:
//! Unique object Id.
GUID m_guid;
- // floor number of object if procedural object flag is set
- int m_floorNumber;
-
//! Flags of this object.
int m_flags;
- // Id of the texture icon for this object.
+ //! Id of the texture icon for this object.
int m_nTextureIcon;
//! Display color.
@@ -828,13 +679,10 @@ private:
mutable uint32 m_bMatrixValid : 1;
mutable uint32 m_bWorldBoxValid : 1;
uint32 m_bInSelectionBox : 1;
- uint32 m_nMaterialLayersMask : 8;
uint32 m_nMinSpec : 8;
Vec3 m_vDrawIconPos;
AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING
-
- uint64 m_hideOrder;
};
Q_DECLARE_METATYPE(CBaseObject*)
diff --git a/Code/Editor/Objects/DisplayContext.h b/Code/Editor/Objects/DisplayContext.h
index 0f0f0e665a..8f54be78fe 100644
--- a/Code/Editor/Objects/DisplayContext.h
+++ b/Code/Editor/Objects/DisplayContext.h
@@ -31,7 +31,6 @@ struct IRenderer;
struct IRenderAuxGeom;
struct IIconManager;
class CDisplaySettings;
-class CCamera;
class QPoint;
enum DisplayFlags
@@ -66,7 +65,6 @@ struct SANDBOX_API DisplayContext
IDisplayViewport* view;
IRenderAuxGeom* pRenderAuxGeom;
IIconManager* pIconManager;
- CCamera* camera;
AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING
AABB box; // Bounding box of volume that need to be repainted.
AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING
@@ -83,11 +81,38 @@ struct SANDBOX_API DisplayContext
// Draw functions
//////////////////////////////////////////////////////////////////////////
//! Set current materialc color.
- void SetColor(float r, float g, float b, float a = 1) { m_color4b = ColorB(static_cast(r * 255.0f), static_cast(g * 255.0f), static_cast(b * 255.0f), static_cast(a * 255.0f)); };
- void SetColor(const Vec3& color, float a = 1) { m_color4b = ColorB(static_cast(color.x * 255.0f), static_cast(color.y * 255.0f), static_cast(color.z * 255.0f), static_cast(a * 255.0f)); };
- void SetColor(const QColor& rgb, float a) { m_color4b = ColorB(static_cast(rgb.red()), static_cast(rgb.green()), static_cast(rgb.blue()), static_cast(a * 255.0f)); };
- void SetColor(const QColor& color) { m_color4b = ColorB(static_cast(color.red()), static_cast(color.green()), static_cast(color.blue()), static_cast(color.alpha())); };
- void SetColor(const ColorB& color) { m_color4b = color; };
+ void SetColor(float r, float g, float b, float a = 1)
+ {
+ m_color4b = ColorB(
+ static_cast(r * 255.0f), static_cast(g * 255.0f), static_cast(b * 255.0f), static_cast(a * 255.0f));
+ };
+ void SetColor(const Vec3& color, float a = 1)
+ {
+ m_color4b = ColorB(
+ static_cast(color.x * 255.0f), static_cast(color.y * 255.0f), static_cast(color.z * 255.0f),
+ static_cast(a * 255.0f));
+ };
+ void SetColor(const AZ::Vector3& color, float a = 1)
+ {
+ m_color4b = ColorB(
+ static_cast(color.GetX() * 255.0f), static_cast(color.GetY() * 255.0f), static_cast(color.GetZ() * 255.0f),
+ static_cast(a * 255.0f));
+ };
+ void SetColor(const QColor& rgb, float a)
+ {
+ m_color4b = ColorB(
+ static_cast(rgb.red()), static_cast(rgb.green()), static_cast(rgb.blue()), static_cast(a * 255.0f));
+ };
+ void SetColor(const QColor& color)
+ {
+ m_color4b = ColorB(
+ static_cast(color.red()), static_cast(color.green()), static_cast(color.blue()),
+ static_cast(color.alpha()));
+ };
+ void SetColor(const ColorB& color)
+ {
+ m_color4b = color;
+ };
void SetAlpha(float a = 1) { m_color4b.a = static_cast(a * 255.0f); };
ColorB GetColor() const { return m_color4b; }
@@ -110,6 +135,7 @@ struct SANDBOX_API DisplayContext
void DrawTrianglesIndexed(const AZStd::vector& vertices, const AZStd::vector& indices, const ColorB& color);
// Draw wireframe box.
void DrawWireBox(const Vec3& min, const Vec3& max);
+ void DrawWireBox(const AZ::Vector3& min, const AZ::Vector3& max);
// Draw filled box
void DrawSolidBox(const Vec3& min, const Vec3& max);
void DrawSolidOBB(const Vec3& center, const Vec3& axisX, const Vec3& axisY, const Vec3& axisZ, const Vec3& halfExtents);
diff --git a/Code/Editor/Objects/DisplayContextShared.inl b/Code/Editor/Objects/DisplayContextShared.inl
index df0b1f82a1..1fbd2ef7b6 100644
--- a/Code/Editor/Objects/DisplayContextShared.inl
+++ b/Code/Editor/Objects/DisplayContextShared.inl
@@ -225,6 +225,12 @@ void DisplayContext::DrawWireBox(const Vec3& min, const Vec3& max)
pRenderAuxGeom->DrawAABB(AABB(min, max), m_matrixStack[m_currentMatrix], false, m_color4b, eBBD_Faceted);
}
+void DisplayContext::DrawWireBox(const AZ::Vector3& min, const AZ::Vector3& max)
+{
+ pRenderAuxGeom->DrawAABB(
+ AABB(Vec3(min.GetX(), min.GetY(), min.GetZ()), Vec3(max.GetX(), max.GetY(), max.GetZ())),
+ m_matrixStack[m_currentMatrix], false, m_color4b, eBBD_Faceted);
+}
//////////////////////////////////////////////////////////////////////////
void DisplayContext::DrawSolidBox(const Vec3& min, const Vec3& max)
{
@@ -1138,10 +1144,6 @@ bool DisplayContext::IsVisible(const AABB& bounds)
return true;
}
}
- else
- {
- return camera->IsAABBVisible_F(AABB(bounds.min, bounds.max));
- }
return false;
}
diff --git a/Code/Editor/Objects/EntityObject.cpp b/Code/Editor/Objects/EntityObject.cpp
index 6e2354998c..86512377c6 100644
--- a/Code/Editor/Objects/EntityObject.cpp
+++ b/Code/Editor/Objects/EntityObject.cpp
@@ -28,8 +28,7 @@
#include "HitContext.h"
#include "Objects/SelectionGroup.h"
-#include
-#include
+static constexpr int VIEW_DISTANCE_MULTIPLIER_MAX = 100;
//////////////////////////////////////////////////////////////////////////
//! Undo Entity Link
@@ -58,7 +57,6 @@ public:
protected:
void Release() override { delete this; };
int GetSize() override { return sizeof(*this); }; // Return size of xml state.
- QString GetDescription() override { return "Entity Link"; };
QString GetObjectName() override{ return ""; };
void Undo([[maybe_unused]] bool bUndo) override
@@ -139,7 +137,6 @@ private:
}
int GetSize() override { return sizeof(CUndoAttachEntity); }
- QString GetDescription() override { return "Attachment Changed"; }
GUID m_attachedEntityGUID;
CEntityObject::EAttachmentType m_attachmentType;
@@ -151,8 +148,6 @@ private:
// CBase implementation.
//////////////////////////////////////////////////////////////////////////
-float CEntityObject::m_helperScale = 1;
-
namespace
{
CEntityObject* s_pPropertyPanelEntityObject = nullptr;
@@ -163,12 +158,9 @@ namespace
//////////////////////////////////////////////////////////////////////////
CEntityObject::CEntityObject()
- : m_listeners(1)
{
m_bLoadFailed = false;
- m_visualObject = nullptr;
-
m_box.min.Set(0, 0, 0);
m_box.max.Set(0, 0, 0);
@@ -223,7 +215,7 @@ CEntityObject::CEntityObject()
mv_ratioLOD = 100;
mv_viewDistanceMultiplier = 1.0f;
mv_ratioLOD.SetLimits(0, 255);
- mv_viewDistanceMultiplier.SetLimits(0.0f, IRenderNode::VIEW_DISTANCE_MULTIPLIER_MAX);
+ mv_viewDistanceMultiplier.SetLimits(0.0f, VIEW_DISTANCE_MULTIPLIER_MAX);
m_physicsState = nullptr;
@@ -247,7 +239,6 @@ CEntityObject::CEntityObject()
m_onSetCallbacksCache.emplace_back([this](IVariable* var) { OnProjectInAllDirsChange(var); });
m_onSetCallbacksCache.emplace_back([this](IVariable* var) { OnProjectorFOVChange(var); });
m_onSetCallbacksCache.emplace_back([this](IVariable* var) { OnProjectorTextureChange(var); });
- m_onSetCallbacksCache.emplace_back([this](IVariable* var) { OnPropertyChange(var); });
m_onSetCallbacksCache.emplace_back([this](IVariable* var) { OnRadiusChange(var); });
}
@@ -295,11 +286,6 @@ void CEntityObject::Done()
ReleaseEventTargets();
RemoveAllEntityLinks();
- for (CListenerSet::Notifier notifier(m_listeners); notifier.IsValid(); notifier.Next())
- {
- notifier->OnDone();
- }
-
CBaseObject::Done();
}
@@ -365,12 +351,6 @@ void CEntityObject::SetTransformDelegate(ITransformDelegate* pTransformDelegate)
ResetCallbacks();
}
-//////////////////////////////////////////////////////////////////////////
-bool CEntityObject::IsSameClass(CBaseObject* obj)
-{
- return (GetClassDesc() == obj->GetClassDesc());
-}
-
//////////////////////////////////////////////////////////////////////////
bool CEntityObject::ConvertFromObject(CBaseObject* object)
{
@@ -458,33 +438,10 @@ bool CEntityObject::HitTest(HitContext& hc)
return false;
}
-//////////////////////////////////////////////////////////////////////////
-bool CEntityObject::HitHelperTest(HitContext& hc)
-{
- bool bResult = CBaseObject::HitHelperTest(hc);
- if (bResult)
- {
- hc.object = this;
- }
-
- return bResult;
-}
-
//////////////////////////////////////////////////////////////////////////
bool CEntityObject::HitTestRect(HitContext& hc)
{
- bool bResult = false;
-
- if (m_visualObject && !gSettings.viewports.bShowIcons && !gSettings.viewports.bShowSizeBasedIcons)
- {
- AABB box;
- box.SetTransformedAABB(GetWorldTM(), m_visualObject->GetAABB());
- bResult = HitTestRectBounds(hc, box);
- }
- else
- {
- bResult = CBaseObject::HitTestRect(hc);
- }
+ bool bResult = CBaseObject::HitTestRect(hc);
if (bResult)
{
@@ -494,42 +451,6 @@ bool CEntityObject::HitTestRect(HitContext& hc)
return bResult;
}
-//////////////////////////////////////////////////////////////////////////
-int CEntityObject::MouseCreateCallback(CViewport* view, EMouseEvent event, QPoint& point, int flags)
-{
- AZ_PROFILE_FUNCTION(Entity);
-
- if (event == eMouseMove || event == eMouseLDown)
- {
- Vec3 pos;
- // Rise Entity above ground on Bounding box amount.
- if (GetIEditor()->GetAxisConstrains() != AXIS_TERRAIN)
- {
- pos = view->MapViewToCP(point);
- }
- else
- {
- // Snap to terrain.
- bool hitTerrain;
- pos = view->ViewToWorld(point, &hitTerrain);
- if (hitTerrain)
- {
- pos.z = GetIEditor()->GetTerrainElevation(pos.x, pos.y);
- pos.z = pos.z - m_box.min.z;
- }
- pos = view->SnapToGrid(pos);
- }
- SetPos(pos);
-
- if (event == eMouseLDown)
- {
- return MOUSECREATE_OK;
- }
- return MOUSECREATE_CONTINUE;
- }
- return CBaseObject::MouseCreateCallback(view, event, point, flags);
-}
-
//////////////////////////////////////////////////////////////////////////
IVariable* CEntityObject::FindVariableInSubBlock(CVarBlockPtr& properties, IVariable* pSubBlockVar, const char* pVarName)
{
@@ -592,11 +513,11 @@ void CEntityObject::AdjustLightProperties(CVarBlockPtr& properties, const char*
if (IVariable* pCastShadowVarLegacy = FindVariableInSubBlock(properties, pSubBlockVar, "bCastShadow"))
{
pCastShadowVarLegacy->SetFlags(pCastShadowVarLegacy->GetFlags() | IVariable::UI_INVISIBLE);
-
- if (pCastShadowVarLegacy->GetDisplayValue()[0] != '0')
+ const QString zeroPrefix("0");
+ if (!pCastShadowVarLegacy->GetDisplayValue().startsWith(zeroPrefix))
{
bCastShadowLegacy = true;
- pCastShadowVarLegacy->SetDisplayValue("0");
+ pCastShadowVarLegacy->SetDisplayValue(zeroPrefix);
}
}
@@ -680,11 +601,6 @@ void CEntityObject::SetName(const QString& name)
CBaseObject::SetName(name);
- CListenerSet listeners = m_listeners;
- for (CListenerSet::Notifier notifier(listeners); notifier.IsValid(); notifier.Next())
- {
- notifier->OnNameChanged(name.toUtf8().data());
- }
}
//////////////////////////////////////////////////////////////////////////
@@ -697,19 +613,6 @@ void CEntityObject::SetSelected(bool bSelect)
UpdateLightProperty();
}
- for (CListenerSet::Notifier notifier(m_listeners); notifier.IsValid(); notifier.Next())
- {
- notifier->OnSelectionChanged(bSelect);
- }
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CEntityObject::OnPropertyChange([[maybe_unused]] IVariable* var)
-{
- if (s_ignorePropertiesUpdate)
- {
- return;
- }
}
template
@@ -941,11 +844,9 @@ void CEntityObject::Serialize(CObjectArchive& ar)
m_eventTargets.emplace_back(AZStd::move(et));
if (targetId != GUID_NULL)
{
- using namespace AZStd::placeholders;
ar.SetResolveCallback(
this, targetId,
- [this](CBaseObject* object, unsigned int index) { ResolveEventTarget(object, index); },
- i);
+ [this,i](CBaseObject* object) { ResolveEventTarget(object, i); });
}
}
}
@@ -956,11 +857,7 @@ void CEntityObject::Serialize(CObjectArchive& ar)
QString attachmentType;
xmlNode->getAttr("AttachmentType", attachmentType);
- if (attachmentType == "GeomCacheNode")
- {
- m_attachmentType = eAT_GeomCacheNode;
- }
- else if (attachmentType == "CharacterBone")
+ if (attachmentType == "CharacterBone")
{
m_attachmentType = eAT_CharacterBone;
}
@@ -987,11 +884,7 @@ void CEntityObject::Serialize(CObjectArchive& ar)
{
if (m_attachmentType != eAT_Pivot)
{
- if (m_attachmentType == eAT_GeomCacheNode)
- {
- xmlNode->setAttr("AttachmentType", "GeomCacheNode");
- }
- else if (m_attachmentType == eAT_CharacterBone)
+ if (m_attachmentType == eAT_CharacterBone)
{
xmlNode->setAttr("AttachmentType", "CharacterBone");
}
@@ -1091,11 +984,7 @@ XmlNodeRef CEntityObject::Export([[maybe_unused]] const QString& levelPath, XmlN
objNode->setAttr("ParentId", parentEntity->GetEntityId());
if (m_attachmentType != eAT_Pivot)
{
- if (m_attachmentType == eAT_GeomCacheNode)
- {
- objNode->setAttr("AttachmentType", "GeomCacheNode");
- }
- else if (m_attachmentType == eAT_CharacterBone)
+ if (m_attachmentType == eAT_CharacterBone)
{
objNode->setAttr("AttachmentType", "CharacterBone");
}
@@ -1166,12 +1055,6 @@ XmlNodeRef CEntityObject::Export([[maybe_unused]] const QString& levelPath, XmlN
objNode->setAttr("MinSpec", ( uint32 )GetMinSpec());
}
- uint32 nMtlLayersMask = GetMaterialLayersMask();
- if (nMtlLayersMask != 0)
- {
- objNode->setAttr("MatLayersMask", nMtlLayersMask);
- }
-
if (mv_hiddenInGame)
{
objNode->setAttr("HiddenInGame", true);
@@ -1268,11 +1151,6 @@ void CEntityObject::OnEvent(ObjectEvent event)
case EVENT_CONFIG_SPEC_CHANGE:
{
- IObjectManager* objMan = GetIEditor()->GetObjectManager();
- if (objMan && objMan->IsLightClass(this))
- {
- OnPropertyChange(nullptr);
- }
break;
}
default:
@@ -1362,56 +1240,6 @@ QString CEntityObject::GetLightAnimation() const
return "";
}
-//////////////////////////////////////////////////////////////////////////
-void CEntityObject::PostClone(CBaseObject* pFromObject, CObjectCloneContext& ctx)
-{
- CBaseObject::PostClone(pFromObject, ctx);
-
- CEntityObject* pFromEntity = ( CEntityObject* )pFromObject;
- // Clone event targets.
- if (!pFromEntity->m_eventTargets.empty())
- {
- size_t numTargets = pFromEntity->m_eventTargets.size();
- for (size_t i = 0; i < numTargets; i++)
- {
- CEntityEventTarget& et = pFromEntity->m_eventTargets[i];
- CBaseObject* pClonedTarget = ctx.FindClone(et.target);
- if (!pClonedTarget)
- {
- pClonedTarget = et.target; // If target not cloned, link to original target.
- }
-
- // Add cloned event.
- AddEventTarget(pClonedTarget, et.event, et.sourceEvent, true);
- }
- }
-
- // Clone links.
- if (!pFromEntity->m_links.empty())
- {
- int numTargets = static_cast(pFromEntity->m_links.size());
- for (int i = 0; i < numTargets; i++)
- {
- CEntityLink& et = pFromEntity->m_links[i];
- CBaseObject* pClonedTarget = ctx.FindClone(et.target);
- if (!pClonedTarget)
- {
- pClonedTarget = et.target; // If target not cloned, link to original target.
- }
-
- // Add cloned event.
- if (pClonedTarget)
- {
- AddEntityLink(et.name, pClonedTarget->GetId());
- }
- else
- {
- AddEntityLink(et.name, GUID_NULL);
- }
- }
- }
-}
-
//////////////////////////////////////////////////////////////////////////
void CEntityObject::ResolveEventTarget(CBaseObject* object, unsigned int index)
{
@@ -1566,7 +1394,7 @@ void CEntityObject::OnObjectEvent(CBaseObject* target, int event)
//////////////////////////////////////////////////////////////////////////
int CEntityObject::AddEventTarget(CBaseObject* target, const QString& event, const QString& sourceEvent, [[maybe_unused]] bool bUpdateScript)
{
- StoreUndo("Add EventTarget");
+ StoreUndo();
CEntityEventTarget et;
et.target = target;
et.event = event;
@@ -1600,7 +1428,7 @@ void CEntityObject::RemoveEventTarget(int index, [[maybe_unused]] bool bUpdateSc
{
if (index >= 0 && index < m_eventTargets.size())
{
- StoreUndo("Remove EventTarget");
+ StoreUndo();
if (m_eventTargets[index].pLineGizmo)
{
@@ -1636,7 +1464,7 @@ int CEntityObject::AddEntityLink(const QString& name, GUID targetEntityId)
}
}
- StoreUndo("Add EntityLink");
+ StoreUndo();
CLineGizmo* pLineGizmo = nullptr;
@@ -1684,7 +1512,7 @@ void CEntityObject::RemoveEntityLink(int index)
if (index >= 0 && index < m_links.size())
{
CEntityLink& link = m_links[index];
- StoreUndo("Remove EntityLink");
+ StoreUndo();
if (link.pLineGizmo)
{
@@ -1707,7 +1535,7 @@ void CEntityObject::RenameEntityLink(int index, const QString& newName)
{
if (index >= 0 && index < m_links.size())
{
- StoreUndo("Rename EntityLink");
+ StoreUndo();
if (m_links[index].pLineGizmo)
{
@@ -1854,18 +1682,6 @@ void CEntityObject::OnLoadFailed()
GetIEditor()->GetErrorReport()->ReportError(err);
}
-//////////////////////////////////////////////////////////////////////////
-void CEntityObject::SetHelperScale(float scale)
-{
- m_helperScale = scale;
-}
-
-//////////////////////////////////////////////////////////////////////////
-float CEntityObject::GetHelperScale()
-{
- return m_helperScale;
-}
-
//////////////////////////////////////////////////////////////////////////
//! Analyze errors for this object.
void CEntityObject::Validate(IErrorReport* report)
@@ -1913,19 +1729,6 @@ bool CEntityObject::IsSimilarObject(CBaseObject* pObject)
return false;
}
-//////////////////////////////////////////////////////////////////////////
-void CEntityObject::OnContextMenu(QMenu* pMenu)
-{
- if (!pMenu->isEmpty())
- {
- pMenu->addSeparator();
- }
-
- // Events
-
- CBaseObject::OnContextMenu(pMenu);
-}
-
//////////////////////////////////////////////////////////////////////////
void CEntityObject::PreInitLightProperty()
{
@@ -2183,16 +1986,6 @@ void CEntityObject::StoreUndoEntityLink(CSelectionGroup* pGroup)
}
}
-void CEntityObject::RegisterListener(IEntityObjectListener* pListener)
-{
- m_listeners.Add(pListener);
-}
-
-void CEntityObject::UnregisterListener(IEntityObjectListener* pListener)
-{
- m_listeners.Remove(pListener);
-}
-
template
T CEntityObject::GetEntityProperty(const char* pName, T defaultvalue) const
{
diff --git a/Code/Editor/Objects/EntityObject.h b/Code/Editor/Objects/EntityObject.h
index dcc6ff7b22..c3e379bccc 100644
--- a/Code/Editor/Objects/EntityObject.h
+++ b/Code/Editor/Objects/EntityObject.h
@@ -16,10 +16,7 @@
#include "BaseObject.h"
#include "IMovieSystem.h"
-#include "IEntityObjectListener.h"
#include "Gizmo.h"
-#include "CryListenerSet.h"
-#include "StatObjBus.h"
#include
#endif
@@ -81,11 +78,6 @@ public:
//////////////////////////////////////////////////////////////////////////
// Overrides from CBaseObject.
//////////////////////////////////////////////////////////////////////////
- //! Return type name of Entity.
- QString GetTypeDescription() const override { return GetEntityClass(); };
-
- //////////////////////////////////////////////////////////////////////////
- bool IsSameClass(CBaseObject* obj) override;
bool Init(IEditor* ie, CBaseObject* prev, const QString& file) override;
void InitVariables() override;
@@ -102,16 +94,12 @@ public:
void SetEntityPropertyFloat(const char* name, float value);
void SetEntityPropertyString(const char* name, const QString& value);
- int MouseCreateCallback(CViewport* view, EMouseEvent event, QPoint& point, int flags) override;
- void OnContextMenu(QMenu* menu) override;
-
void SetName(const QString& name) override;
void SetSelected(bool bSelect) override;
void GetLocalBounds(AABB& box) override;
bool HitTest(HitContext& hc) override;
- bool HitHelperTest(HitContext& hc) override;
bool HitTestRect(HitContext& hc) override;
void UpdateVisibility(bool bVisible) override;
bool ConvertFromObject(CBaseObject* object) override;
@@ -131,7 +119,6 @@ public:
enum EAttachmentType
{
eAT_Pivot,
- eAT_GeomCacheNode,
eAT_CharacterBone,
};
@@ -140,14 +127,9 @@ public:
EAttachmentType GetAttachType() const { return m_attachmentType; }
QString GetAttachTarget() const { return m_attachmentTarget; }
- void SetHelperScale(float scale) override;
- float GetHelperScale() override;
-
void GatherUsedResources(CUsedResources& resources) override;
bool IsSimilarObject(CBaseObject* pObject) override;
- bool HasMeasurementAxis() const override { return false; }
-
bool IsIsolated() const override { return false; }
//////////////////////////////////////////////////////////////////////////
@@ -221,20 +203,12 @@ public:
static void StoreUndoEntityLink(CSelectionGroup* pGroup);
- void RegisterListener(IEntityObjectListener* pListener);
- void UnregisterListener(IEntityObjectListener* pListener);
-
protected:
template
void SetEntityProperty(const char* name, T value);
template
T GetEntityProperty(const char* name, T defaultvalue) const;
- //////////////////////////////////////////////////////////////////////////
- //! Must be called after cloning the object on clone of object.
- //! This will make sure object references are cloned correctly.
- void PostClone(CBaseObject* pFromObject, CObjectCloneContext& ctx) override;
-
//! Draw default object items.
void DrawProjectorPyramid(DisplayContext& dc, float dist);
void DrawProjectorFrustum(DisplayContext& dc, Vec2 size, float dist);
@@ -243,10 +217,6 @@ protected:
CVarBlock* CloneProperties(CVarBlock* srcProperties);
- //////////////////////////////////////////////////////////////////////////
- //! Callback called when one of entity properties have been modified.
- void OnPropertyChange(IVariable* var);
-
//////////////////////////////////////////////////////////////////////////
void OnObjectEvent(CBaseObject* target, int event) override;
void ResolveEventTarget(CBaseObject* object, unsigned int index);
@@ -328,7 +298,6 @@ protected:
// Used for light entities
float m_projectorFOV;
- IStatObj* m_visualObject;
AABB m_box;
//////////////////////////////////////////////////////////////////////////
@@ -389,8 +358,6 @@ protected:
XmlNodeRef m_physicsState;
AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING
- static float m_helperScale;
-
EAttachmentType m_attachmentType;
bool m_bEnableReload;
@@ -434,7 +401,6 @@ private:
void ForceVariableUpdate();
AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING
- CListenerSet m_listeners;
std::vector< std::pair > m_callbacks;
AZStd::fixed_vector< IVariable::OnSetCallback, VariableCallbackIndex::Count > m_onSetCallbacksCache;
AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING
diff --git a/Code/Editor/Objects/IEntityObjectListener.h b/Code/Editor/Objects/IEntityObjectListener.h
deleted file mode 100644
index 9072a837d0..0000000000
--- a/Code/Editor/Objects/IEntityObjectListener.h
+++ /dev/null
@@ -1,20 +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
-
-class IEntityObjectListener
-{
-public:
- virtual ~IEntityObjectListener() = default;
-
- virtual void OnNameChanged(const char* pName) = 0;
- virtual void OnSelectionChanged(const bool bSelected) = 0;
- virtual void OnDone() = 0;
-};
-
diff --git a/Code/Editor/Objects/LineGizmo.cpp b/Code/Editor/Objects/LineGizmo.cpp
index 31ea341f5b..991f449cd6 100644
--- a/Code/Editor/Objects/LineGizmo.cpp
+++ b/Code/Editor/Objects/LineGizmo.cpp
@@ -98,16 +98,8 @@ void CLineGizmo::Display(DisplayContext& dc)
Vec3 pos = 0.5f * (m_point[0] + m_point[1]);
//dc.renderer->DrawLabelEx( p3+Vec3(0,0,0.3f),1.2f,col,true,true,m_name );
- float camDist = dc.camera->GetPosition().GetDistance(pos);
- float maxDist = dc.settings->GetLabelsDistance();
- if (camDist < dc.settings->GetLabelsDistance())
{
- float range = maxDist / 2.0f;
float col[4] = { m_color[0].r, m_color[0].g, m_color[0].b, m_color[0].a };
- if (camDist > range)
- {
- col[3] = col[3] * (1.0f - (camDist - range) / range);
- }
dc.SetColor(col[0], col[1], col[2], col[3]);
dc.DrawTextLabel(pos + Vec3(0, 0, 0.2f), 1.2f, m_name.toUtf8().data());
}
diff --git a/Code/Editor/Objects/ObjectLoader.cpp b/Code/Editor/Objects/ObjectLoader.cpp
index 9596265bb9..63ac4c93af 100644
--- a/Code/Editor/Objects/ObjectLoader.cpp
+++ b/Code/Editor/Objects/ObjectLoader.cpp
@@ -28,19 +28,12 @@ CObjectArchive::CObjectArchive(IObjectManager* objMan, XmlNodeRef xmlRoot, bool
m_nFlags = 0;
node = xmlRoot;
m_pCurrentErrorReport = GetIEditor()->GetErrorReport();
- m_pGeometryPak = nullptr;
- m_pCurrentObject = nullptr;
m_bNeedResolveObjects = false;
- m_bProgressBarEnabled = true;
}
//////////////////////////////////////////////////////////////////////////
CObjectArchive::~CObjectArchive()
{
- if (m_pGeometryPak)
- {
- delete m_pGeometryPak;
- }
// Always make sure objects are resolved when loading from archive.
if (bLoading && m_bNeedResolveObjects)
{
@@ -74,31 +67,6 @@ void CObjectArchive::SetResolveCallback(CBaseObject* fromObject, REFGUID objectI
}
}
-//////////////////////////////////////////////////////////////////////////
-void CObjectArchive::SetResolveCallback(CBaseObject* fromObject, REFGUID objectId, ResolveObjRefFunctor2 func, uint32 userData)
-{
- if (objectId == GUID_NULL)
- {
- func(0, userData);
- return;
- }
-
- CBaseObject* object = m_objectManager->FindObject(objectId);
- if (object && !(m_nFlags & eObjectLoader_MakeNewIDs))
- {
- // Object is already resolved. immidiatly call callback.
- func(object, userData);
- }
- else
- {
- Callback cb;
- cb.fromObject = fromObject;
- cb.func2 = func;
- cb.userData = userData;
- m_resolveCallbacks.insert(Callbacks::value_type(objectId, cb));
- }
-}
-
//////////////////////////////////////////////////////////////////////////
GUID CObjectArchive::ResolveID(REFGUID id)
{
@@ -117,10 +85,7 @@ void CObjectArchive::ResolveObjects()
{
CWaitProgress wait("Loading Objects", false);
- if (m_bProgressBarEnabled)
- {
- wait.Start();
- }
+ wait.Start();
GetIEditor()->SuspendUndo();
//////////////////////////////////////////////////////////////////////////
@@ -129,10 +94,7 @@ void CObjectArchive::ResolveObjects()
int numObj = static_cast(m_loadedObjects.size());
for (i = 0; i < numObj; i++)
{
- if (m_bProgressBarEnabled)
- {
- wait.Step((i * 100) / numObj);
- }
+ wait.Step((i * 100) / numObj);
SLoadedObjectInfo& obj = m_loadedObjects[i];
m_pCurrentErrorReport->SetCurrentValidatorObject(obj.pObject);
@@ -204,30 +166,20 @@ void CObjectArchive::ResolveObjects()
{
(cb.func1)(object);
}
- if (cb.func2)
- {
- (cb.func2)(object, cb.userData);
- }
}
m_resolveCallbacks.clear();
//////////////////////////////////////////////////////////////////////////
{
CWaitProgress wait("Creating Objects", false);
- if (m_bProgressBarEnabled)
- {
- wait.Start();
- }
+ wait.Start();
//////////////////////////////////////////////////////////////////////////
// Serialize All Objects from XML.
//////////////////////////////////////////////////////////////////////////
int numObj = static_cast(m_loadedObjects.size());
for (i = 0; i < numObj; i++)
{
- if (m_bProgressBarEnabled)
- {
- wait.Step((i * 100) / numObj);
- }
+ wait.Step((i * 100) / numObj);
SLoadedObjectInfo& obj = m_loadedObjects[i];
m_pCurrentErrorReport->SetCurrentValidatorObject(obj.pObject);
@@ -258,8 +210,6 @@ void CObjectArchive::ResolveObjects()
m_bNeedResolveObjects = false;
m_pCurrentErrorReport->SetCurrentValidatorObject(nullptr);
- m_sequenceIdRemap.clear();
- m_pendingIds.clear();
}
//////////////////////////////////////////////////////////////////////////
@@ -272,7 +222,6 @@ void CObjectArchive::SaveObject(CBaseObject* pObject)
if (m_savedObjects.find(pObject) == m_savedObjects.end())
{
- m_pCurrentObject = pObject;
m_savedObjects.insert(pObject);
// If this object was not saved before.
XmlNodeRef objNode = node->newChild("Object");
@@ -307,45 +256,6 @@ CBaseObject* CObjectArchive::LoadObject(const XmlNodeRef& objNode, CBaseObject*
return pObject;
}
-//////////////////////////////////////////////////////////////////////////
-void CObjectArchive::LoadObjects(XmlNodeRef& rootObjectsNode)
-{
- int numObjects = rootObjectsNode->getChildCount();
- for (int i = 0; i < numObjects; i++)
- {
- XmlNodeRef objNode = rootObjectsNode->getChild(i);
- LoadObject(objNode, nullptr);
- }
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CObjectArchive::ReportError(CErrorRecord& err)
-{
- if (m_pCurrentErrorReport)
- {
- m_pCurrentErrorReport->ReportError(err);
- }
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CObjectArchive::SetErrorReport(CErrorReport* errReport)
-{
- if (errReport)
- {
- m_pCurrentErrorReport = errReport;
- }
- else
- {
- m_pCurrentErrorReport = GetIEditor()->GetErrorReport();
- }
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CObjectArchive::ShowErrors()
-{
- GetIEditor()->GetErrorReport()->Display();
-}
-
//////////////////////////////////////////////////////////////////////////
void CObjectArchive::MakeNewIds(bool bEnable)
{
@@ -359,70 +269,8 @@ void CObjectArchive::MakeNewIds(bool bEnable)
}
}
-//////////////////////////////////////////////////////////////////////////
-void CObjectArchive::SetShouldResetInternalMembers(bool reset)
-{
- if (reset)
- {
- m_nFlags |= eObjectLoader_ResetInternalMembers;
- }
- else
- {
- m_nFlags &= ~(eObjectLoader_ResetInternalMembers);
- }
-}
-
//////////////////////////////////////////////////////////////////////////
void CObjectArchive::RemapID(REFGUID oldId, REFGUID newId)
{
m_IdRemap[oldId] = newId;
}
-
-//////////////////////////////////////////////////////////////////////////
-CPakFile* CObjectArchive::GetGeometryPak(const char* sFilename)
-{
- if (m_pGeometryPak)
- {
- return m_pGeometryPak;
- }
- m_pGeometryPak = new CPakFile;
- m_pGeometryPak->Open(sFilename);
- return m_pGeometryPak;
-}
-
-//////////////////////////////////////////////////////////////////////////
-CBaseObject* CObjectArchive::GetCurrentObject()
-{
- return m_pCurrentObject;
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CObjectArchive::AddSequenceIdMapping(uint32 oldId, uint32 newId)
-{
- assert(oldId != newId);
- assert(GetIEditor()->GetMovieSystem()->FindSequenceById(oldId) || stl::find(m_pendingIds, oldId));
- assert(GetIEditor()->GetMovieSystem()->FindSequenceById(newId) == nullptr);
- assert(stl::find(m_pendingIds, newId) == false);
- m_sequenceIdRemap[oldId] = newId;
- m_pendingIds.push_back(newId);
-}
-
-//////////////////////////////////////////////////////////////////////////
-uint32 CObjectArchive::RemapSequenceId(uint32 id) const
-{
- std::map::const_iterator itr = m_sequenceIdRemap.find(id);
- if (itr == m_sequenceIdRemap.end())
- {
- return id;
- }
- else
- {
- return itr->second;
- }
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool CObjectArchive::IsAmongPendingIds(uint32 id) const
-{
- return stl::find(m_pendingIds, id);
-}
diff --git a/Code/Editor/Objects/ObjectLoader.h b/Code/Editor/Objects/ObjectLoader.h
index a491e50da0..fc1014ad03 100644
--- a/Code/Editor/Objects/ObjectLoader.h
+++ b/Code/Editor/Objects/ObjectLoader.h
@@ -6,18 +6,13 @@
*
*/
-
-#ifndef CRYINCLUDE_EDITOR_OBJECTS_OBJECTLOADER_H
-#define CRYINCLUDE_EDITOR_OBJECTS_OBJECTLOADER_H
#pragma once
#include "Util/GuidUtil.h"
#include "ErrorReport.h"
+#include
-#include
-
-class CPakFile;
class CErrorRecord;
struct IObjectManager;
@@ -43,63 +38,27 @@ AZ_POP_DISABLE_DLL_EXPORT_BASECLASS_WARNING
//! Resolve callback with only one parameter of CBaseObject.
typedef AZStd::function ResolveObjRefFunctor1;
- //! Resolve callback with two parameters one is pointer to CBaseObject and second use data integer.
- typedef AZStd::function ResolveObjRefFunctor2;
-
- /** Register Object id.
- @param objectId Original object id from the file.
- @param realObjectId Changed object id.
- */
- //void RegisterObjectId( int objectId,int realObjectId );
// Return object ID remapped after loading.
GUID ResolveID(REFGUID id);
//! Set object resolve callback, it will be called once object with specified Id is loaded.
void SetResolveCallback(CBaseObject* fromObject, REFGUID objectId, ResolveObjRefFunctor1 func);
- //! Set object resolve callback, it will be called once object with specified Id is loaded.
- void SetResolveCallback(CBaseObject* fromObject, REFGUID objectId, ResolveObjRefFunctor2 func, uint32 userData);
//! Resolve all object ids and call callbacks on resolved objects.
void ResolveObjects();
// Save object to archive.
void SaveObject(CBaseObject* pObject);
- //! Load multiple objects from archive.
- void LoadObjects(XmlNodeRef& rootObjectsNode);
-
//! Load one object from archive.
CBaseObject* LoadObject(const XmlNodeRef& objNode, CBaseObject* pPrevObject = nullptr);
- //////////////////////////////////////////////////////////////////////////
- int GetLoadedObjectsCount() { return static_cast(m_loadedObjects.size()); }
- CBaseObject* GetLoadedObject(int nIndex) const { return m_loadedObjects[nIndex].pObject; }
-
//! If true new loaded objects will be assigned new GUIDs.
void MakeNewIds(bool bEnable);
//! Remap object ids.
void RemapID(REFGUID oldId, REFGUID newId);
- //! Report error during loading.
- void ReportError(CErrorRecord& err);
- //! Assigner different error report class.
- void SetErrorReport(CErrorReport* errReport);
- //! Display collected error reports.
- void ShowErrors();
-
- void EnableProgressBar(bool bEnable) { m_bProgressBarEnabled = bEnable; };
-
- CPakFile* GetGeometryPak(const char* sFilename);
- CBaseObject* GetCurrentObject();
-
- void AddSequenceIdMapping(uint32 oldId, uint32 newId);
- uint32 RemapSequenceId(uint32 id) const;
- bool IsAmongPendingIds(uint32 id) const;
-
- void SetShouldResetInternalMembers(bool reset);
- bool ShouldResetInternalMembers() const { return m_nFlags & eObjectLoader_ResetInternalMembers; }
-
private:
struct SLoadedObjectInfo
{
@@ -110,22 +69,19 @@ private:
bool operator <(const SLoadedObjectInfo& oi) const { return nSortOrder < oi.nSortOrder; }
};
-
IObjectManager* m_objectManager;
struct Callback
{
ResolveObjRefFunctor1 func1;
- ResolveObjRefFunctor2 func2;
- uint32 userData;
_smart_ptr fromObject;
- Callback() { func1 = 0; func2 = 0; userData = 0; };
+ Callback() { func1 = 0; }
};
typedef std::multimap Callbacks;
AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING
Callbacks m_resolveCallbacks;
// Set of all saved objects to this archive.
- typedef std::set<_smart_ptr > ObjectsSet;
+ typedef AZStd::set<_smart_ptr > ObjectsSet;
ObjectsSet m_savedObjects;
//typedef std::multimap > OrderedObjects;
@@ -138,20 +94,11 @@ private:
enum EObjectLoaderFlags
{
eObjectLoader_MakeNewIDs = 0x0001, // If true new loaded objects will be assigned new GUIDs.
- eObjectLoader_ResetInternalMembers = 0x0004, // In case we are deserializing and we would like to wipe all previous state
};
int m_nFlags;
IErrorReport* m_pCurrentErrorReport;
- CPakFile* m_pGeometryPak;
- CBaseObject* m_pCurrentObject;
bool m_bNeedResolveObjects;
- bool m_bProgressBarEnabled;
- // This table is used when there is any collision of ids while importing TrackView sequences.
- std::map m_sequenceIdRemap;
- std::vector m_pendingIds;
AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING
};
-
-#endif // CRYINCLUDE_EDITOR_OBJECTS_OBJECTLOADER_H
diff --git a/Code/Editor/Objects/ObjectManager.cpp b/Code/Editor/Objects/ObjectManager.cpp
index ee7e9a8e96..1dea6ece7f 100644
--- a/Code/Editor/Objects/ObjectManager.cpp
+++ b/Code/Editor/Objects/ObjectManager.cpp
@@ -50,7 +50,7 @@ public:
GUID guid;
public:
- virtual ~CXMLObjectClassDesc() = default;
+ virtual ~CXMLObjectClassDesc() = default;
REFGUID ClassID() override
{
return guid;
@@ -81,60 +81,27 @@ CObjectManager* g_pObjectManager = nullptr;
//////////////////////////////////////////////////////////////////////////
CObjectManager::CObjectManager()
- : m_lastHideMask(0)
- , m_maxObjectViewDistRatio(0.00001f)
- , m_currSelection(&m_defaultSelection)
- , m_nLastSelCount(0)
+ : m_currSelection(&m_defaultSelection)
, m_bSelectionChanged(false)
- , m_selectCallback(nullptr)
- , m_currEditObject(nullptr)
- , m_bSingleSelection(false)
- , m_createGameObjects(true)
- , m_bGenUniqObjectNames(true)
, m_gizmoManager(new CGizmoManager())
- , m_pLoadProgress(nullptr)
- , m_loadedObjects(0)
- , m_totalObjectsToLoad(0)
, m_bExiting(false)
, m_isUpdateVisibilityList(false)
, m_currentHideCount(CBaseObject::s_invalidHiddenID)
- , m_bInReloading(false)
- , m_bSkipObjectUpdate(false)
- , m_bLevelExporting(false)
{
g_pObjectManager = this;
- RegisterObjectClasses();
-
m_objectsByName.reserve(1024);
- LoadRegistry();
}
//////////////////////////////////////////////////////////////////////////
CObjectManager::~CObjectManager()
{
m_bExiting = true;
- SaveRegistry();
DeleteAllObjects();
delete m_gizmoManager;
}
-//////////////////////////////////////////////////////////////////////////
-void CObjectManager::RegisterObjectClasses()
-{
- LoadRegistry();
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CObjectManager::SaveRegistry()
-{
-}
-
-void CObjectManager::LoadRegistry()
-{
-}
-
//////////////////////////////////////////////////////////////////////////
CBaseObject* CObjectManager::NewObject(CObjectClassDesc* cls, CBaseObject* prev, const QString& file, const char* newObjectName)
{
@@ -186,17 +153,6 @@ CBaseObject* CObjectManager::NewObject(CObjectClassDesc* cls, CBaseObject* prev,
if (obj->GetType() != OBJTYPE_AZENTITY)
{
GetIEditor()->RecordUndo(new CUndoBaseObjectNew(obj));
-
- // check for script entities
- const char* scriptClassName = "";
- CEntityObject* entityObj = qobject_cast(obj);
- QByteArray entityClass; // Leave it outside of the if. Otherwise buffer is deleted.
- if (entityObj)
- {
- entityClass = entityObj->GetEntityClass().toUtf8();
- scriptClassName = entityClass.data();
- }
-
}
}
@@ -318,12 +274,6 @@ CBaseObject* CObjectManager::NewObject(CObjectArchive& ar, CBaseObject* pUndoObj
}
}
- m_loadedObjects++;
- if (m_pLoadProgress && m_totalObjectsToLoad > 0)
- {
- m_pLoadProgress->Step((m_loadedObjects * 100) / m_totalObjectsToLoad);
- }
-
return pObject;
}
@@ -351,10 +301,6 @@ CBaseObject* CObjectManager::NewObject(const QString& typeName, CBaseObject* pre
void CObjectManager::DeleteObject(CBaseObject* obj)
{
AZ_PROFILE_FUNCTION(Editor);
- if (m_currEditObject == obj)
- {
- EndEditParams();
- }
if (!obj)
{
@@ -367,7 +313,6 @@ void CObjectManager::DeleteObject(CBaseObject* obj)
return;
}
- NotifyObjectListeners(obj, CBaseObject::ON_PREDELETE);
obj->NotifyListeners(CBaseObject::ON_PREDELETE);
// Must be after object DetachAll to support restoring Parent/Child relations.
@@ -377,7 +322,7 @@ void CObjectManager::DeleteObject(CBaseObject* obj)
// Store undo for all child objects.
for (int i = 0; i < obj->GetChildCount(); i++)
{
- obj->GetChild(i)->StoreUndo("DeleteParent");
+ obj->GetChild(i)->StoreUndo();
}
CUndo::Record(new CUndoBaseObjectDelete(obj));
}
@@ -388,8 +333,6 @@ void CObjectManager::DeleteObject(CBaseObject* obj)
obj->Done();
- NotifyObjectListeners(obj, CBaseObject::ON_DELETE);
-
RemoveObject(obj);
}
@@ -462,22 +405,10 @@ void CObjectManager::DeleteAllObjects()
{
AZ_PROFILE_FUNCTION(Editor);
- EndEditParams();
-
ClearSelection();
- int i;
InvalidateVisibleList();
- // Delete all selection groups.
- std::vector sel;
- stl::map_to_vector(m_selections, sel);
- for (i = 0; i < sel.size(); i++)
- {
- delete sel[i];
- }
- m_selections.clear();
-
TBaseObjects objectsHolder;
GetAllObjects(objectsHolder);
@@ -485,7 +416,7 @@ void CObjectManager::DeleteAllObjects()
m_objects.clear();
m_objectsByName.clear();
- for (i = 0; i < objectsHolder.size(); i++)
+ for (int i = 0; i < objectsHolder.size(); i++)
{
objectsHolder[i]->Done();
}
@@ -499,17 +430,6 @@ void CObjectManager::DeleteAllObjects()
m_animatedAttachedEntities.clear();
}
-CBaseObject* CObjectManager::CloneObject(CBaseObject* obj)
-{
- AZ_PROFILE_FUNCTION(Editor);
- assert(obj);
- //CRuntimeClass *cls = obj->GetRuntimeClass();
- //CBaseObject *clone = (CBaseObject*)cls->CreateObject();
- //clone->CloneCopy( obj );
- CBaseObject* clone = NewObject(obj->GetClassDesc(), obj);
- return clone;
-}
-
//////////////////////////////////////////////////////////////////////////
CBaseObject* CObjectManager::FindObject(REFGUID guid) const
{
@@ -608,7 +528,7 @@ bool CObjectManager::AddObject(CBaseObject* obj)
if (CEntityObject* entityObj = qobject_cast(obj))
{
CEntityObject::EAttachmentType attachType = entityObj->GetAttachType();
- if (attachType == CEntityObject::EAttachmentType::eAT_GeomCacheNode || attachType == CEntityObject::EAttachmentType::eAT_CharacterBone)
+ if (attachType == CEntityObject::EAttachmentType::eAT_CharacterBone)
{
m_animatedAttachedEntities.insert(entityObj);
}
@@ -620,7 +540,6 @@ bool CObjectManager::AddObject(CBaseObject* obj)
RegisterObjectName(obj->GetName());
InvalidateVisibleList();
- NotifyObjectListeners(obj, CBaseObject::ON_ADD);
return true;
}
@@ -641,12 +560,6 @@ void CObjectManager::RemoveObject(CBaseObject* obj)
// Remove this object from selection groups.
m_currSelection->RemoveObject(obj);
- std::vector sel;
- stl::map_to_vector(m_selections, sel);
- for (int i = 0; i < sel.size(); i++)
- {
- sel[i]->RemoveObject(obj);
- }
m_objectsByName.erase(AZ::Crc32(obj->GetName().toUtf8().data(), obj->GetName().toUtf8().count(), true));
@@ -674,54 +587,7 @@ void CObjectManager::ChangeObjectId(REFGUID oldGuid, REFGUID newGuid)
CBaseObjectPtr pRemappedObject = (*it).second;
pRemappedObject->SetId(newGuid);
m_objects.erase(it);
- m_objects.insert(std::make_pair(newGuid, pRemappedObject));
- }
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CObjectManager::ShowDuplicationMsgWarning(CBaseObject* obj, const QString& newName, bool bShowMsgBox) const
-{
- CBaseObject* pExisting = FindObject(newName);
- if (pExisting)
- {
- QString sRenameWarning = QObject::tr("%1 \"%2\" was NOT renamed to \"%3\" because %4 with the same name already exists.")
- .arg(obj->GetClassDesc()->ClassName())
- .arg(obj->GetName())
- .arg(newName)
- .arg(pExisting->GetClassDesc()->ClassName()
- );
-
- // If id is taken.
- CryWarning(VALIDATOR_MODULE_EDITOR, VALIDATOR_WARNING, "%s", sRenameWarning.toUtf8().data());
-
- if (bShowMsgBox)
- {
- QMessageBox::critical(QApplication::activeWindow(), QString(), sRenameWarning);
- }
- }
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CObjectManager::ChangeObjectName(CBaseObject* obj, const QString& newName)
-{
- assert(obj);
-
- if (newName != obj->GetName())
- {
- if (IsDuplicateObjectName(newName))
- {
- return;
- }
-
- // Remove previous name from map
- const AZ::Crc32 oldNameCrc(obj->GetName().toUtf8().data(), obj->GetName().count(), true);
- m_objectsByName.erase(oldNameCrc);
-
- obj->SetName(newName);
-
- // Add new name to map
- const AZ::Crc32 nameCrc(newName.toUtf8().data(), newName.count(), true);
- m_objectsByName[nameCrc] = obj;
+ m_objects.insert(AZStd::make_pair(newGuid, pRemappedObject));
}
}
@@ -742,28 +608,9 @@ void CObjectManager::GetObjects(CBaseObjectsArray& objects) const
}
}
-void CObjectManager::GetObjects(CBaseObjectsArray& objects, BaseObjectFilterFunctor const& filter) const
-{
- objects.clear();
- objects.reserve(m_objects.size());
- for (Objects::const_iterator it = m_objects.begin(); it != m_objects.end(); ++it)
- {
- assert(it->second);
- if (filter.first(*it->second, filter.second))
- {
- objects.push_back(it->second);
- }
- }
-}
-
//////////////////////////////////////////////////////////////////////////
void CObjectManager::SendEvent(ObjectEvent event)
{
- if (event == EVENT_RELOAD_ENTITY)
- {
- m_bInReloading = true;
- }
-
for (Objects::iterator it = m_objects.begin(); it != m_objects.end(); ++it)
{
CBaseObject* obj = it->second;
@@ -772,7 +619,6 @@ void CObjectManager::SendEvent(ObjectEvent event)
if (event == EVENT_RELOAD_ENTITY)
{
- m_bInReloading = false;
GetIEditor()->Notify(eNotify_OnReloadTrackView);
}
}
@@ -792,93 +638,6 @@ void CObjectManager::SendEvent(ObjectEvent event, const AABB& bounds)
}
}
-//////////////////////////////////////////////////////////////////////////
-void CObjectManager::Update()
-{
- if (m_bSkipObjectUpdate)
- {
- return;
- }
-
- QWidget* prevActiveWindow = QApplication::activeWindow();
-
- // Restore focus if it changed.
- if (prevActiveWindow && QApplication::activeWindow() != prevActiveWindow)
- {
- prevActiveWindow->setFocus();
- }
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CObjectManager::HideObject(CBaseObject* obj, bool hide)
-{
- assert(obj != 0);
- if (hide)
- {
- obj->SetHidden(hide, ++m_currentHideCount);
- }
- else
- {
- obj->SetHidden(false);
- }
- InvalidateVisibleList();
-}
-
-void CObjectManager::ShowLastHiddenObject()
-{
- uint64 mostRecentID = CBaseObject::s_invalidHiddenID;
- CBaseObject* mostRecentObject = nullptr;
- for (auto it : m_objects)
- {
- CBaseObject* obj = it.second;
-
- uint64 hiddenID = obj->GetHideOrder();
-
- if (hiddenID > mostRecentID)
- {
- mostRecentID = hiddenID;
- mostRecentObject = obj;
- }
- }
-
- if (mostRecentObject != nullptr)
- {
- mostRecentObject->SetHidden(false);
- }
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CObjectManager::UnhideAll()
-{
- for (Objects::iterator it = m_objects.begin(); it != m_objects.end(); ++it)
- {
- CBaseObject* obj = it->second;
- obj->SetHidden(false);
- }
-
- InvalidateVisibleList();
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CObjectManager::FreezeObject(CBaseObject* obj, bool freeze)
-{
- assert(obj != 0);
- // Remove object from main object set and put it to hidden set.
- obj->SetFrozen(freeze);
- InvalidateVisibleList();
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CObjectManager::UnfreezeAll()
-{
- for (Objects::iterator it = m_objects.begin(); it != m_objects.end(); ++it)
- {
- CBaseObject* obj = it->second;
- obj->SetFrozen(false);
- }
- InvalidateVisibleList();
-}
-
//////////////////////////////////////////////////////////////////////////
bool CObjectManager::SelectObject(CBaseObject* obj, bool bUseMask)
{
@@ -894,14 +653,6 @@ bool CObjectManager::SelectObject(CBaseObject* obj, bool bUseMask)
return false;
}
- if (m_selectCallback)
- {
- if (!m_selectCallback->OnSelectObject(obj))
- {
- return true;
- }
- }
-
m_currSelection->AddObject(obj);
// while in ComponentMode we never explicitly change selection (the entity will always be selected).
@@ -921,14 +672,6 @@ bool CObjectManager::SelectObject(CBaseObject* obj, bool bUseMask)
return true;
}
-void CObjectManager::SelectEntities(std::set& s)
-{
- for (std::set::iterator it = s.begin(), end = s.end(); it != end; ++it)
- {
- SelectObject(*it);
- }
-}
-
void CObjectManager::UnselectObject(CBaseObject* obj)
{
// while in ComponentMode we never explicitly change selection (the entity will always be selected).
@@ -947,139 +690,6 @@ void CObjectManager::UnselectObject(CBaseObject* obj)
m_currSelection->RemoveObject(obj);
}
-CSelectionGroup* CObjectManager::GetSelection(const QString& name) const
-{
- CSelectionGroup* selection = stl::find_in_map(m_selections, name, (CSelectionGroup*)nullptr);
- return selection;
-}
-
-void CObjectManager::GetNameSelectionStrings(QStringList& names)
-{
- for (TNameSelectionMap::iterator it = m_selections.begin(); it != m_selections.end(); ++it)
- {
- names.push_back(it->first);
- }
-}
-
-void CObjectManager::NameSelection(const QString& name)
-{
- if (m_currSelection->IsEmpty())
- {
- return;
- }
-
- CSelectionGroup* selection = stl::find_in_map(m_selections, name, (CSelectionGroup*)nullptr);
- if (selection)
- {
- assert(selection != 0);
- // Check if trying to rename itself to the same name.
- if (selection == m_currSelection)
- {
- return;
- }
- m_selections.erase(name);
- delete selection;
- }
- selection = new CSelectionGroup;
- selection->Copy(*m_currSelection);
- selection->SetName(name);
- m_selections[name] = selection;
- m_currSelection = selection;
- m_defaultSelection.RemoveAll();
-}
-
-void CObjectManager::SerializeNameSelection(XmlNodeRef& rootNode, bool bLoading)
-{
- if (!rootNode)
- {
- return;
- }
-
- _smart_ptr tmpGroup(nullptr);
-
- QString selRootStr("NameSelection");
- QString selNodeStr("NameSelectionNode");
- QString selNodeNameStr("name");
- QString idStr("id");
- QString objAttrStr("obj");
-
- XmlNodeRef startNode = rootNode->findChild(selRootStr.toUtf8().data());
-
- if (bLoading)
- {
- m_selections.erase(m_selections.begin(), m_selections.end());
-
- if (startNode)
- {
- for (int selNodeNo = 0; selNodeNo < startNode->getChildCount(); ++selNodeNo)
- {
- XmlNodeRef selNode = startNode->getChild(selNodeNo);
- tmpGroup = new CSelectionGroup;
-
- for (int objIDNodeNo = 0; objIDNodeNo < selNode->getChildCount(); ++objIDNodeNo)
- {
- GUID curID = GUID_NULL;
- XmlNodeRef idNode = selNode->getChild(objIDNodeNo);
- if (!idNode->getAttr(idStr.toUtf8().data(), curID))
- {
- continue;
- }
-
- if (curID != GUID_NULL)
- {
- if (GetIEditor()->GetObjectManager()->FindObject(curID))
- {
- tmpGroup->AddObject(GetIEditor()->GetObjectManager()->FindObject(curID));
- }
- }
- }
-
- if (tmpGroup->GetCount() > 0)
- {
- QString nameStr;
- if (!selNode->getAttr(selNodeNameStr.toUtf8().data(), nameStr))
- {
- continue;
- }
- tmpGroup->SetName(nameStr);
- m_selections[nameStr] = tmpGroup;
- }
- }
- }
- }
- else
- {
- startNode = rootNode->newChild(selRootStr.toUtf8().data());
- CSelectionGroup* objSelection = nullptr;
-
- for (TNameSelectionMap::iterator it = m_selections.begin(); it != m_selections.end(); ++it)
- {
- XmlNodeRef selectionNameNode = startNode->newChild(selNodeStr.toUtf8().data());
- selectionNameNode->setAttr(selNodeNameStr.toUtf8().data(), it->first.toUtf8().data());
- objSelection = it->second;
-
- if (!objSelection)
- {
- continue;
- }
-
- if (objSelection->GetCount() == 0)
- {
- continue;
- }
-
- for (int i = 0; i < objSelection->GetCount(); ++i)
- {
- if (objSelection->GetObject(i))
- {
- XmlNodeRef objNode = selectionNameNode->newChild(objAttrStr.toUtf8().data());
- objNode->setAttr(idStr.toUtf8().data(), GuidUtil::ToString(objSelection->GetObject(i)->GetId()));
- }
- }
- }
- }
-}
-
//////////////////////////////////////////////////////////////////////////
int CObjectManager::ClearSelection()
{
@@ -1133,63 +743,6 @@ int CObjectManager::ClearSelection()
return numSel;
}
-//////////////////////////////////////////////////////////////////////////
-int CObjectManager::InvertSelection()
-{
- AZ_PROFILE_FUNCTION(Editor);
-
- int selCount = 0;
- // iterate all objects.
- for (Objects::const_iterator it = m_objects.begin(); it != m_objects.end(); ++it)
- {
- CBaseObject* pObj = it->second;
- if (pObj->IsSelected())
- {
- UnselectObject(pObj);
- }
- else
- {
- if (SelectObject(pObj))
- {
- selCount++;
- }
- }
- }
- return selCount;
-}
-
-void CObjectManager::SetSelection(const QString& name)
-{
- AZ_PROFILE_FUNCTION(Editor);
- CSelectionGroup* selection = stl::find_in_map(m_selections, name, (CSelectionGroup*)nullptr);
- if (selection)
- {
- UnselectCurrent();
- assert(selection != 0);
- m_currSelection = selection;
- SelectCurrent();
- }
-}
-
-void CObjectManager::RemoveSelection(const QString& name)
-{
- AZ_PROFILE_FUNCTION(Editor);
-
- QString selName = name;
- CSelectionGroup* selection = stl::find_in_map(m_selections, name, (CSelectionGroup*)nullptr);
- if (selection)
- {
- if (selection == m_currSelection)
- {
- UnselectCurrent();
- m_currSelection = &m_defaultSelection;
- m_defaultSelection.RemoveAll();
- }
- delete selection;
- m_selections.erase(selName);
- }
-}
-
void CObjectManager::SelectCurrent()
{
AZ_PROFILE_FUNCTION(Editor);
@@ -1261,157 +814,7 @@ void CObjectManager::Display(DisplayContext& dc)
}
}
-void CObjectManager::ForceUpdateVisibleObjectCache([[maybe_unused]] DisplayContext& dc)
-{
- AZ_Assert(false, "CObjectManager::ForceUpdateVisibleObjectCache is legacy/deprecated and should not be used.");
-}
-
-void CObjectManager::FindDisplayableObjects([[maybe_unused]] DisplayContext& dc, [[maybe_unused]] bool bDisplay)
-{
- AZ_Assert(false, "CObjectManager::FindDisplayableObjects is legacy/deprecated and should not be used.");
-}
-
-void CObjectManager::BeginEditParams(CBaseObject* obj, int flags)
-{
- assert(obj != 0);
- if (obj == m_currEditObject)
- {
- return;
- }
-
- if (GetSelection()->GetCount() > 1)
- {
- return;
- }
-
- QWidget* prevActiveWindow = QApplication::activeWindow();
-
- if (m_currEditObject)
- {
- //if (obj->GetClassDesc() != m_currEditObject->GetClassDesc())
- if (!obj->IsSameClass(m_currEditObject))
- {
- EndEditParams(flags);
- }
- }
-
- m_currEditObject = obj;
-
- if (flags & OBJECT_CREATE)
- {
- // Unselect all other objects.
- ClearSelection();
- // Select this object.
- SelectObject(obj, false);
- }
-
- m_bSingleSelection = true;
-
- // Restore focus if it changed.
- // OBJECT_EDIT is used by the EntityOutliner when items are selected. Using it here to prevent shifting focus to the EntityInspector on select.
- if (!(flags & OBJECT_EDIT) && prevActiveWindow && QApplication::activeWindow() != prevActiveWindow)
- {
- prevActiveWindow->setFocus();
- }
-}
-
-void CObjectManager::EndEditParams([[maybe_unused]] int flags)
-{
- m_bSingleSelection = false;
- m_currEditObject = nullptr;
- //m_bSelectionChanged = false; // don't need to clear for ungroup
-}
-
-//! Select objects within specified distance from given position.
-int CObjectManager::SelectObjects(const AABB& box, bool bUnselect)
-{
- AZ_PROFILE_FUNCTION(Editor);
- int numSel = 0;
-
- AABB objBounds;
- for (Objects::iterator it = m_objects.begin(); it != m_objects.end(); ++it)
- {
- CBaseObject* obj = it->second;
-
- if (obj->IsHidden())
- {
- continue;
- }
-
- obj->GetBoundBox(objBounds);
- if (box.IsIntersectBox(objBounds))
- {
- numSel++;
- if (!bUnselect)
- {
- SelectObject(obj);
- }
- else
- {
- UnselectObject(obj);
- }
- }
- }
- return numSel;
-}
-
//////////////////////////////////////////////////////////////////////////
-int CObjectManager::MoveObjects(const AABB& box, const Vec3& offset, ImageRotationDegrees rotation, [[maybe_unused]] bool bIsCopy)
-{
- AABB objBounds;
-
- Vec3 src = (box.min + box.max) / 2;
- Vec3 dst = src + offset;
- float alpha = 0.0f;
- switch (rotation)
- {
- case ImageRotationDegrees::Rotate90:
- alpha = gf_halfPI;
- break;
- case ImageRotationDegrees::Rotate180:
- alpha = gf_PI;
- break;
- case ImageRotationDegrees::Rotate270:
- alpha = gf_PI + gf_halfPI;
- break;
- default:
- break;
- }
-
- float cosa = cos(alpha);
- float sina = sin(alpha);
-
- for (Objects::iterator it = m_objects.begin(); it != m_objects.end(); ++it)
- {
- CBaseObject* obj = it->second;
-
- if (obj->GetParent())
- {
- continue;
- }
-
- obj->GetBoundBox(objBounds);
- if (box.IsIntersectBox(objBounds))
- {
- if (rotation == ImageRotationDegrees::Rotate0)
- {
- obj->SetPos(obj->GetPos() - src + dst);
- }
- else
- {
- Vec3 pos = obj->GetPos() - src;
- Vec3 newPos(pos);
- newPos.x = cosa * pos.x - sina * pos.y;
- newPos.y = sina * pos.x + cosa * pos.y;
- obj->SetPos(newPos + dst);
- Quat q;
- obj->SetRotation(q.CreateRotationZ(alpha) * obj->GetRotation());
- }
- }
- }
- return 0;
-}
-
bool CObjectManager::IsObjectDeletionAllowed(CBaseObject* pObject)
{
if (!pObject)
@@ -1442,99 +845,12 @@ void CObjectManager::DeleteSelection()
objects.AddObject(m_currSelection->GetObject(i));
}
- RemoveSelection(m_currSelection->GetName());
m_currSelection = &m_defaultSelection;
m_defaultSelection.RemoveAll();
DeleteSelection(&objects);
}
-//////////////////////////////////////////////////////////////////////////
-bool CObjectManager::HitTestObject(CBaseObject* obj, HitContext& hc)
-{
- AZ_PROFILE_FUNCTION(Editor);
-
- if (obj->IsFrozen())
- {
- return false;
- }
-
- if (obj->IsHidden())
- {
- return false;
- }
-
- // This object is rejected by deep selection.
- if (obj->CheckFlags(OBJFLAG_NO_HITTEST))
- {
- return false;
- }
-
- ObjectType objType = obj->GetType();
-
- // Check if this object type is masked for selection.
- if (!(objType & gSettings.objectSelectMask))
- {
- return false;
- }
-
- const bool bSelectionHelperHit = obj->HitHelperTest(hc);
-
- if (hc.bUseSelectionHelpers && !bSelectionHelperHit)
- {
- return false;
- }
-
- if (!bSelectionHelperHit)
- {
- // Fast checking.
- if (hc.camera && !obj->IsInCameraView(*hc.camera))
- {
- return false;
- }
- else if (hc.bounds && !obj->IntersectRectBounds(*hc.bounds))
- {
- return false;
- }
-
- // Do 2D space testing.
- if (hc.nSubObjFlags == 0)
- {
- Ray ray(hc.raySrc, hc.rayDir);
- if (!obj->IntersectRayBounds(ray))
- {
- return false;
- }
- }
- else if (!obj->HitTestRect(hc))
- {
- return false;
- }
- }
-
- return (bSelectionHelperHit || obj->HitTest(hc));
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool CObjectManager::HitTest([[maybe_unused]] HitContext& hitInfo)
-{
- AZ_Assert(false, "CObjectManager::HitTest is legacy/deprecated and should not be used.");
- return false;
-}
-
-void CObjectManager::FindObjectsInRect(
- [[maybe_unused]] CViewport* view, [[maybe_unused]] const QRect& rect, [[maybe_unused]] std::vector& guids)
-{
- AZ_Assert(false, "CObjectManager::FindObjectsInRect is legacy/deprecated and should not be used.");
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CObjectManager::SelectObjectsInRect(
- [[maybe_unused]] CViewport* view, [[maybe_unused]] const QRect& rect, [[maybe_unused]] bool bSelect)
-{
- AZ_Assert(false, "CObjectManager::SelectObjectsInRect is legacy/deprecated and should not be used.");
-}
-
//////////////////////////////////////////////////////////////////////////
uint16 FindPossibleObjectNameNumber(std::set& numberSet)
{
@@ -1585,50 +901,9 @@ void CObjectManager::RegisterObjectName(const QString& name)
}
}
-//////////////////////////////////////////////////////////////////////////
-void CObjectManager::UpdateRegisterObjectName(const QString& name)
-{
- // Remove all numbers from the end of typename.
- QString typeName = name;
- int nameLen = typeName.length();
- int len = nameLen;
-
- while (len > 0 && typeName[len - 1].isDigit())
- {
- len--;
- }
-
- typeName = typeName.left(len);
-
- uint16 num = 1;
- if (len < nameLen)
- {
- num = (uint16)atoi((const char*)name.toUtf8().data() + len) + 0;
- }
-
- NameNumbersMap::iterator it = m_nameNumbersMap.find(typeName);
-
- if (it != m_nameNumbersMap.end())
- {
- if (it->second.end() != it->second.find(num))
- {
- it->second.erase(num);
- if (it->second.empty())
- {
- m_nameNumbersMap.erase(it);
- }
- }
- }
-}
-
//////////////////////////////////////////////////////////////////////////
QString CObjectManager::GenerateUniqueObjectName(const QString& theTypeName)
{
- if (!m_bGenUniqObjectNames)
- {
- return theTypeName;
- }
-
QString typeName = theTypeName;
const int subIndex = theTypeName.indexOf("::");
if (subIndex != -1 && subIndex > typeName.length() - 2)
@@ -1663,14 +938,6 @@ QString CObjectManager::GenerateUniqueObjectName(const QString& theTypeName)
return str;
}
-//////////////////////////////////////////////////////////////////////////
-bool CObjectManager::EnableUniqObjectNames(bool bEnable)
-{
- bool bPrev = m_bGenUniqObjectNames;
- m_bGenUniqObjectNames = bEnable;
- return bPrev;
-}
-
//////////////////////////////////////////////////////////////////////////
CObjectClassDesc* CObjectManager::FindClass(const QString& className)
{
@@ -1682,64 +949,6 @@ CObjectClassDesc* CObjectManager::FindClass(const QString& className)
return nullptr;
}
-//////////////////////////////////////////////////////////////////////////
-void CObjectManager::GetClassCategories(QStringList& categories)
-{
- std::vector classes;
- CClassFactory::Instance()->GetClassesBySystemID(ESYSTEM_CLASS_OBJECT, classes);
- std::set cset;
- for (int i = 0; i < classes.size(); i++)
- {
- QString category = classes[i]->Category();
- if (!category.isEmpty())
- {
- cset.insert(category);
- }
- }
- categories.clear();
- categories.reserve(static_cast(cset.size()));
- for (std::set::iterator cit = cset.begin(); cit != cset.end(); ++cit)
- {
- categories.push_back(*cit);
- }
-}
-
-void CObjectManager::GetClassCategoryToolClassNamePairs(std::vector< std::pair >& categoryToolClassNamePairs)
-{
- std::vector classes;
- CClassFactory::Instance()->GetClassesBySystemID(ESYSTEM_CLASS_OBJECT, classes);
- std::set< std::pair > cset;
- for (int i = 0; i < classes.size(); i++)
- {
- QString category = classes[i]->Category();
- QString toolClassName = ((CObjectClassDesc*)classes[i])->GetToolClassName();
- if (!category.isEmpty())
- {
- cset.insert(std::pair(category, toolClassName));
- }
- }
- categoryToolClassNamePairs.clear();
- categoryToolClassNamePairs.reserve(cset.size());
- for (std::set< std::pair >::iterator cit = cset.begin(); cit != cset.end(); ++cit)
- {
- categoryToolClassNamePairs.push_back(*cit);
- }
-}
-
-void CObjectManager::GetClassTypes(const QString& category, QStringList& types)
-{
- std::vector classes;
- CClassFactory::Instance()->GetClassesBySystemID(ESYSTEM_CLASS_OBJECT, classes);
- for (int i = 0; i < classes.size(); i++)
- {
- QString cat = classes[i]->Category();
- if (QString::compare(cat, category, Qt::CaseInsensitive) == 0 && classes[i]->IsEnabled())
- {
- types.push_back(classes[i]->ClassName());
- }
- }
-}
-
//////////////////////////////////////////////////////////////////////////
void CObjectManager::RegisterClassTemplate(const XmlNodeRef& templ)
{
@@ -1804,181 +1013,6 @@ void CObjectManager::RegisterCVars()
"Adjust the hit radius used for axis helpers, like the transform gizmo.");
}
-//////////////////////////////////////////////////////////////////////////
-void CObjectManager::Serialize(XmlNodeRef& xmlNode, bool bLoading, int flags)
-{
- if (!xmlNode)
- {
- return;
- }
-
- if (bLoading)
- {
- m_loadedObjects = 0;
-
- if (flags == SERIALIZE_ONLY_NOTSHARED)
- {
- DeleteNotSharedObjects();
- }
- else if (flags == SERIALIZE_ONLY_SHARED)
- {
- DeleteSharedObjects();
- }
- else
- {
- DeleteAllObjects();
- }
-
-
- XmlNodeRef root = xmlNode->findChild("Objects");
-
- int totalObjects = 0;
-
- if (root)
- {
- root->getAttr("NumObjects", totalObjects);
- }
-
-
- StartObjectsLoading(totalObjects);
-
- CObjectArchive ar(this, xmlNode, true);
-
- // Loading.
- if (root)
- {
- ar.node = root;
- LoadObjects(ar, false);
- }
- EndObjectsLoading();
- }
- else
- {
- // Saving.
- XmlNodeRef root = xmlNode->newChild("Objects");
-
- CObjectArchive ar(this, root, false);
-
- // Save all objects to XML.
- for (Objects::iterator it = m_objects.begin(); it != m_objects.end(); ++it)
- {
- CBaseObject* obj = it->second;
-
- if (obj->CheckFlags(OBJFLAG_DONT_SAVE))
- {
- continue;
- }
-
- if ((flags == SERIALIZE_ONLY_SHARED) && !obj->CheckFlags(OBJFLAG_SHARED))
- {
- continue;
- }
- else if ((flags == SERIALIZE_ONLY_NOTSHARED) && obj->CheckFlags(OBJFLAG_SHARED))
- {
- continue;
- }
-
- XmlNodeRef objNode = root->newChild("Object");
- ar.node = objNode;
- obj->Serialize(ar);
- }
- }
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CObjectManager::LoadObjects(CObjectArchive& objectArchive, bool bSelect)
-{
- m_bLoadingObjects = true;
-
- XmlNodeRef objectsNode = objectArchive.node;
- int numObjects = objectsNode->getChildCount();
- for (int i = 0; i < numObjects; i++)
- {
- objectArchive.node = objectsNode->getChild(i);
- CBaseObject* obj = objectArchive.LoadObject(objectsNode->getChild(i));
- if (obj && bSelect)
- {
- SelectObject(obj);
- }
- }
- EndObjectsLoading(); // End progress bar, here, Resolve objects have his own.
- objectArchive.ResolveObjects();
-
- InvalidateVisibleList();
-
- m_bLoadingObjects = false;
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CObjectManager::Export(const QString& levelPath, XmlNodeRef& rootNode, bool onlyShared)
-{
- // Clear export files.
- QFile::remove(QStringLiteral("%1TagPoints.ini").arg(levelPath));
- QFile::remove(QStringLiteral("%1Volumes.ini").arg(levelPath));
-
- // Save all objects to XML.
- for (Objects::iterator it = m_objects.begin(); it != m_objects.end(); ++it)
- {
- CBaseObject* obj = it->second;
- // Export Only shared objects.
- if ((obj->CheckFlags(OBJFLAG_SHARED) && onlyShared) ||
- (!obj->CheckFlags(OBJFLAG_SHARED) && !onlyShared))
- {
- obj->Export(levelPath, rootNode);
- }
- }
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CObjectManager::ExportEntities(XmlNodeRef& rootNode)
-{
- // Save all objects to XML.
- for (Objects::iterator it = m_objects.begin(); it != m_objects.end(); ++it)
- {
- CBaseObject* obj = it->second;
- if (qobject_cast(obj))
- {
- obj->Export("", rootNode);
- }
- }
-}
-
-void CObjectManager::DeleteNotSharedObjects()
-{
- TBaseObjects objects;
- GetAllObjects(objects);
- for (int i = 0; i < objects.size(); i++)
- {
- CBaseObject* obj = objects[i];
- if (!obj->CheckFlags(OBJFLAG_SHARED))
- {
- DeleteObject(obj);
- }
- }
-}
-
-void CObjectManager::DeleteSharedObjects()
-{
- TBaseObjects objects;
- GetAllObjects(objects);
- for (int i = 0; i < objects.size(); i++)
- {
- CBaseObject* obj = objects[i];
- if (obj->CheckFlags(OBJFLAG_SHARED))
- {
- DeleteObject(obj);
- }
- }
-}
-
-//////////////////////////////////////////////////////////////////////////
-IObjectSelectCallback* CObjectManager::SetSelectCallback(IObjectSelectCallback* callback)
-{
- IObjectSelectCallback* prev = m_selectCallback;
- m_selectCallback = callback;
- return prev;
-}
-
//////////////////////////////////////////////////////////////////////////
void CObjectManager::InvalidateVisibleList()
{
@@ -2020,27 +1054,6 @@ void CObjectManager::UpdateVisibilityList()
m_isUpdateVisibilityList = false;
}
-//////////////////////////////////////////////////////////////////////////
-bool CObjectManager::ConvertToType(CBaseObject* pObject, const QString& typeName)
-{
- QString message = QString("Convert ") + pObject->GetName() + " to " + typeName;
- CUndo undo(message.toUtf8().data());
-
- CBaseObjectPtr pNewObject = GetIEditor()->NewObject(typeName.toUtf8().data());
- if (pNewObject)
- {
- if (pNewObject->ConvertFromObject(pObject))
- {
- DeleteObject(pObject);
- return true;
- }
- DeleteObject(pNewObject);
- }
-
- Log((message + " is failed.").toUtf8().data());
- return false;
-}
-
//////////////////////////////////////////////////////////////////////////
void CObjectManager::SetObjectSelected(CBaseObject* pObject, bool bSelect)
{
@@ -2069,69 +1082,6 @@ void CObjectManager::SetObjectSelected(CBaseObject* pObject, bool bSelect)
m_gizmoManager->AddGizmo(new CAxisGizmo(pObject));
}
}
-
- if (bSelect)
- {
- NotifyObjectListeners(pObject, CBaseObject::ON_SELECT);
- }
- else
- {
- NotifyObjectListeners(pObject, CBaseObject::ON_UNSELECT);
- }
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CObjectManager::HideTransformManipulators()
-{
- m_gizmoManager->DeleteAllTransformManipulators();
-}
-
-//////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////
-void CObjectManager::AddObjectEventListener(EventListener* listener)
-{
- stl::push_back_unique(m_objectEventListeners, listener);
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CObjectManager::RemoveObjectEventListener(EventListener* listener)
-{
- stl::find_and_erase(m_objectEventListeners, listener);
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CObjectManager::NotifyObjectListeners(CBaseObject* pObject, CBaseObject::EObjectListenerEvent event)
-{
- std::list::iterator next;
- for (std::list::iterator it = m_objectEventListeners.begin(); it != m_objectEventListeners.end(); it = next)
- {
- next = it;
- ++next;
- // Call listener callback.
- (*it)->OnObjectEvent(pObject, event);
- }
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CObjectManager::StartObjectsLoading(int numObjects)
-{
- if (m_pLoadProgress)
- {
- return;
- }
- m_pLoadProgress = new CWaitProgress("Loading Objects");
- m_totalObjectsToLoad = numObjects;
- m_loadedObjects = 0;
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CObjectManager::EndObjectsLoading()
-{
- if (m_pLoadProgress)
- {
- delete m_pLoadProgress;
- }
- m_pLoadProgress = nullptr;
}
//////////////////////////////////////////////////////////////////////////
@@ -2179,130 +1129,6 @@ bool CObjectManager::IsLightClass(CBaseObject* pObject)
return false;
}
-void CObjectManager::FindAndRenameProperty2(const char* property2Name, const QString& oldValue, const QString& newValue)
-{
- CBaseObjectsArray objects;
- GetObjects(objects);
-
- for (size_t i = 0, n = objects.size(); i < n; ++i)
- {
- CBaseObject* pObject = objects[i];
- if (qobject_cast(pObject))
- {
- CEntityObject* pEntity = static_cast(pObject);
- CVarBlock* pProperties2 = pEntity->GetProperties2();
- if (pProperties2)
- {
- IVariable* pVariable = pProperties2->FindVariable(property2Name);
- if (pVariable)
- {
- QString sValue;
- pVariable->Get(sValue);
- if (sValue == oldValue)
- {
- pEntity->StoreUndo("Rename Property2");
-
- pVariable->Set(newValue);
- }
- }
- }
- }
- }
-}
-
-void CObjectManager::FindAndRenameProperty2If(const char* property2Name, const QString& oldValue, const QString& newValue, const char* otherProperty2Name, const QString& otherValue)
-{
- CBaseObjectsArray objects;
- GetObjects(objects);
-
- for (size_t i = 0, n = objects.size(); i < n; ++i)
- {
- CBaseObject* pObject = objects[i];
- if (qobject_cast(pObject))
- {
- CEntityObject* pEntity = static_cast(pObject);
- CVarBlock* pProperties2 = pEntity->GetProperties2();
- if (pProperties2)
- {
- IVariable* pVariable = pProperties2->FindVariable(property2Name);
- IVariable* pOtherVariable = pProperties2->FindVariable(otherProperty2Name);
- if (pVariable && pOtherVariable)
- {
- QString sValue;
- pVariable->Get(sValue);
-
- QString sOtherValue;
- pOtherVariable->Get(sOtherValue);
-
- if ((sValue == oldValue) && (sOtherValue == otherValue))
- {
- pEntity->StoreUndo("Rename Property2 If");
-
- pVariable->Set(newValue);
- }
- }
- }
- }
- }
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CObjectManager::HitTestObjectAgainstRect(CBaseObject* pObj, CViewport* view, HitContext hc, std::vector& guids)
-{
- if (!pObj->IsSelectable())
- {
- return;
- }
-
- AABB box;
-
- // Retrieve world space bound box.
- pObj->GetBoundBox(box);
-
- // Check if object visible in viewport.
- if (!view->IsBoundsVisible(box))
- {
- return;
- }
-
- if (pObj->HitTestRect(hc))
- {
- stl::push_back_unique(guids, pObj->GetId());
- }
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CObjectManager::SelectObjectInRect(CBaseObject* pObj, CViewport* view, HitContext hc, bool bSelect)
-{
- if (!pObj->IsSelectable())
- {
- return;
- }
-
- AABB box;
-
- // Retrieve world space bound box.
- pObj->GetBoundBox(box);
-
- // Check if object visible in viewport.
- if (!view->IsBoundsVisible(box))
- {
- return;
- }
-
- if (pObj->HitTestRect(hc))
- {
- if (bSelect)
- {
- SelectObject(pObj);
- }
- else
- {
- UnselectObject(pObj);
- }
- }
-}
-
//////////////////////////////////////////////////////////////////////////
namespace
{
@@ -2382,93 +1208,6 @@ namespace
}
}
- bool PyIsObjectHidden(const char* objName)
- {
- CBaseObject* pObject = GetIEditor()->GetObjectManager()->FindObject(objName);
- if (!pObject)
- {
- throw std::logic_error((QString("\"") + objName + "\" is an invalid object name.").toUtf8().data());
- }
- return pObject->IsHidden();
- }
-
- void PyHideAllObjects()
- {
- CBaseObjectsArray baseObjects;
- GetIEditor()->GetObjectManager()->GetObjects(baseObjects);
-
- if (baseObjects.size() <= 0)
- {
- throw std::logic_error("Objects not found.");
- }
-
- CUndo undo("Hide All Objects");
- for (int i = 0; i < baseObjects.size(); i++)
- {
- GetIEditor()->GetObjectManager()->HideObject(baseObjects[i], true);
- }
- }
-
- void PyUnHideAllObjects()
- {
- CUndo undo("Unhide All Objects");
- GetIEditor()->GetObjectManager()->UnhideAll();
- }
-
- void PyHideObject(const char* objName)
- {
- CUndo undo("Hide Object");
-
- CBaseObject* pObject = GetIEditor()->GetObjectManager()->FindObject(objName);
- if (pObject)
- {
- GetIEditor()->GetObjectManager()->HideObject(pObject, true);
- }
- }
-
- void PyUnhideObject(const char* objName)
- {
- CUndo undo("Unhide Object");
-
- CBaseObject* pObject = GetIEditor()->GetObjectManager()->FindObject(objName);
- if (pObject)
- {
- GetIEditor()->GetObjectManager()->HideObject(pObject, false);
- }
- }
-
- void PyFreezeObject(const char* objName)
- {
- CUndo undo("Freeze Object");
-
- CBaseObject* pObject = GetIEditor()->GetObjectManager()->FindObject(objName);
- if (pObject)
- {
- GetIEditor()->GetObjectManager()->FreezeObject(pObject, true);
- }
- }
-
- void PyUnfreezeObject(const char* objName)
- {
- CUndo undo("Unfreeze Object");
-
- CBaseObject* pObject = GetIEditor()->GetObjectManager()->FindObject(objName);
- if (pObject)
- {
- GetIEditor()->GetObjectManager()->FreezeObject(pObject, false);
- }
- }
-
- bool PyIsObjectFrozen(const char* objName)
- {
- CBaseObject* pObject = GetIEditor()->GetObjectManager()->FindObject(objName);
- if (!pObject)
- {
- throw std::logic_error((QString("\"") + objName + "\" is an invalid object name.").toUtf8().data());
- }
- return pObject->IsFrozen();
- }
-
void PyDeleteObject(const char* objName)
{
CUndo undo("Delete Object");
@@ -2656,16 +1395,6 @@ namespace AzToolsFramework
addLegacyGeneral(behaviorContext->Method("get_selection_center", PyGetSelectionCenter, nullptr, "Returns the center point of the selection group."));
addLegacyGeneral(behaviorContext->Method("get_selection_aabb", PyGetSelectionAABB, nullptr, "Returns the aabb of the selection group."));
- addLegacyGeneral(behaviorContext->Method("hide_object", PyHideObject, nullptr, "Hides a specified object."));
- addLegacyGeneral(behaviorContext->Method("is_object_hidden", PyIsObjectHidden, nullptr, "Checks if object is hidden and returns a bool value."));
- addLegacyGeneral(behaviorContext->Method("unhide_object", PyUnhideObject, nullptr, "Unhides a specified object."));
- addLegacyGeneral(behaviorContext->Method("hide_all_objects", PyHideAllObjects, nullptr, "Hides all objects."));
- addLegacyGeneral(behaviorContext->Method("unhide_all_objects", PyUnHideAllObjects, nullptr, "Unhides all objects."));
-
- addLegacyGeneral(behaviorContext->Method("freeze_object", PyFreezeObject, nullptr, "Freezes a specified object."));
- addLegacyGeneral(behaviorContext->Method("is_object_frozen", PyIsObjectFrozen, nullptr, "Checks if object is frozen and returns a bool value."));
- addLegacyGeneral(behaviorContext->Method("unfreeze_object", PyUnfreezeObject, nullptr, "Unfreezes a specified object."));
-
addLegacyGeneral(behaviorContext->Method("delete_object", PyDeleteObject, nullptr, "Deletes a specified object."));
addLegacyGeneral(behaviorContext->Method("delete_selected", PyDeleteSelected, nullptr, "Deletes selected object(s)."));
diff --git a/Code/Editor/Objects/ObjectManager.h b/Code/Editor/Objects/ObjectManager.h
index 7389dfa6a1..fb16c2fec3 100644
--- a/Code/Editor/Objects/ObjectManager.h
+++ b/Code/Editor/Objects/ObjectManager.h
@@ -8,10 +8,6 @@
// Description : ObjectManager definition.
-
-
-#ifndef CRYINCLUDE_EDITOR_OBJECTS_OBJECTMANAGER_H
-#define CRYINCLUDE_EDITOR_OBJECTS_OBJECTMANAGER_H
#pragma once
#include "IObjectManager.h"
@@ -42,12 +38,10 @@ public:
CObjectManagerLevelIsExporting()
{
AZ::ObjectManagerEventBus::Broadcast(&AZ::ObjectManagerEventBus::Events::OnExportingStarting);
- GetIEditor()->GetObjectManager()->SetExportingLevel(true);
}
~CObjectManagerLevelIsExporting()
{
- GetIEditor()->GetObjectManager()->SetExportingLevel(false);
AZ::ObjectManagerEventBus::Broadcast(&AZ::ObjectManagerEventBus::Events::OnExportingFinished);
}
};
@@ -66,20 +60,12 @@ public:
CObjectManager();
~CObjectManager();
- void RegisterObjectClasses();
-
CBaseObject* NewObject(CObjectClassDesc* cls, CBaseObject* prev = 0, const QString& file = "", const char* newObjectName = nullptr) override;
CBaseObject* NewObject(const QString& typeName, CBaseObject* prev = 0, const QString& file = "", const char* newEntityName = nullptr) override;
void DeleteObject(CBaseObject* obj) override;
void DeleteSelection(CSelectionGroup* pSelection) override;
void DeleteAllObjects() override;
- CBaseObject* CloneObject(CBaseObject* obj) override;
-
- void BeginEditParams(CBaseObject* obj, int flags) override;
- void EndEditParams(int flags = 0) override;
- // Hides all transform manipulators.
- void HideTransformManipulators();
//! Get number of objects manager by ObjectManager (not contain sub objects of groups).
int GetObjectCount() const override;
@@ -88,30 +74,9 @@ public:
//! @param layer if 0 get objects for all layers, or layer to get objects from.
void GetObjects(CBaseObjectsArray& objects) const override;
- //! Get array of objects that pass the filter.
- //! @param filter The filter functor, return true if you want to get the certain obj, return false if want to skip it.
- void GetObjects(CBaseObjectsArray& objects, BaseObjectFilterFunctor const& filter) const override;
-
- //! Update objects.
- void Update();
-
//! Display objects on display context.
void Display(DisplayContext& dc) override;
- //! Called when selecting without selection helpers - this is needed since
- //! the visible object cache is normally not updated when not displaying helpers.
- void ForceUpdateVisibleObjectCache(DisplayContext& dc) override;
-
- //! Check intersection with objects.
- //! Find intersection with nearest to ray origin object hit by ray.
- //! If distance tollerance is specified certain relaxation applied on collision test.
- //! @return true if hit any object, and fills hitInfo structure.
- bool HitTest(HitContext& hitInfo) override;
-
- //! Check intersection with an object.
- //! @return true if hit, and fills hitInfo structure.
- bool HitTestObject(CBaseObject* obj, HitContext& hc) override;
-
//! Send event to all objects.
//! Will cause OnEvent handler to be called on all objects.
void SendEvent(ObjectEvent event) override;
@@ -134,76 +99,28 @@ public:
//! Find objects which intersect with a given AABB.
void FindObjectsInAABB(const AABB& aabb, std::vector& result) const override;
- //////////////////////////////////////////////////////////////////////////
- // Operations on objects.
- //////////////////////////////////////////////////////////////////////////
- //! Makes object visible or invisible.
- void HideObject(CBaseObject* obj, bool hide) override;
- //! Shows the last hidden object based on hidden ID
- void ShowLastHiddenObject() override;
- //! Freeze object, making it unselectable.
- void FreezeObject(CBaseObject* obj, bool freeze) override;
- //! Unhide all hidden objects.
- void UnhideAll() override;
- //! Unfreeze all frozen objects.
- void UnfreezeAll() override;
-
//////////////////////////////////////////////////////////////////////////
// Object Selection.
//////////////////////////////////////////////////////////////////////////
bool SelectObject(CBaseObject* obj, bool bUseMask = true) override;
void UnselectObject(CBaseObject* obj) override;
- //! Select objects within specified distance from given position.
- //! Return number of selected objects.
- int SelectObjects(const AABB& box, bool bUnselect = false) override;
-
- void SelectEntities(std::set& s) override;
-
- int MoveObjects(const AABB& box, const Vec3& offset, ImageRotationDegrees rotation, bool bIsCopy = false) override;
-
- //! Selects/Unselects all objects within 2d rectangle in given viewport.
- void SelectObjectsInRect(CViewport* view, const QRect& rect, bool bSelect) override;
- void FindObjectsInRect(CViewport* view, const QRect& rect, std::vector& guids) override;
-
//! Clear default selection set.
//! @Return number of objects removed from selection.
int ClearSelection() override;
- //! Deselect all current selected objects and selects object that were unselected.
- //! @Return number of selected objects.
- int InvertSelection() override;
-
//! Get current selection.
CSelectionGroup* GetSelection() const override { return m_currSelection; };
- //! Get named selection.
- CSelectionGroup* GetSelection(const QString& name) const override;
- // Get selection group names
- void GetNameSelectionStrings(QStringList& names) override;
- //! Change name of current selection group.
- //! And store it in list.
- void NameSelection(const QString& name) override;
- //! Set one of name selections as current selection.
- void SetSelection(const QString& name) override;
- void RemoveSelection(const QString& name) override;
bool IsObjectDeletionAllowed(CBaseObject* pObject);
//! Delete all objects in selection group.
void DeleteSelection() override;
- uint32 ForceID() const override{return m_ForceID; }
- void ForceID(uint32 FID) override{m_ForceID = FID; }
-
//! Generates uniq name base on type name of object.
QString GenerateUniqueObjectName(const QString& typeName) override;
//! Register object name in object manager, needed for generating uniq names.
void RegisterObjectName(const QString& name) override;
- //! Decrease name number and remove if it was last in object manager, needed for generating uniq names.
- void UpdateRegisterObjectName(const QString& name);
- //! Enable/Disable generating of unique object names (Enabled by default).
- //! Return previous value.
- bool EnableUniqObjectNames(bool bEnable) override;
//! Register XML template of runtime class.
void RegisterClassTemplate(const XmlNodeRef& templ);
@@ -215,52 +132,10 @@ public:
//! Find object class by name.
CObjectClassDesc* FindClass(const QString& className) override;
- void GetClassCategories(QStringList& categories) override;
- void GetClassCategoryToolClassNamePairs(std::vector< std::pair >& categoryToolClassNamePairs) override;
- void GetClassTypes(const QString& category, QStringList& types) override;
-
- //! Export objects to xml.
- //! When onlyShared is true ony objects with shared flags exported, overwise only not shared object exported.
- void Export(const QString& levelPath, XmlNodeRef& rootNode, bool onlyShared) override;
- void ExportEntities(XmlNodeRef& rootNode) override;
-
- //! Serialize Objects in manager to specified XML Node.
- //! @param flags Can be one of SerializeFlags.
- void Serialize(XmlNodeRef& rootNode, bool bLoading, int flags = SERIALIZE_ALL) override;
-
- void SerializeNameSelection(XmlNodeRef& rootNode, bool bLoading) override;
-
- //! Load objects from object archive.
- //! @param bSelect if set newly loaded object will be selected.
- void LoadObjects(CObjectArchive& ar, bool bSelect) override;
-
- //! Delete from Object manager all objects without SHARED flag.
- void DeleteNotSharedObjects();
- //! Delete from Object manager all objects with SHARED flag.
- void DeleteSharedObjects();
bool AddObject(CBaseObject* obj);
void RemoveObject(CBaseObject* obj);
void ChangeObjectId(REFGUID oldId, REFGUID newId) override;
- bool IsDuplicateObjectName(const QString& newName) const override
- {
- return FindObject(newName) ? true : false;
- }
- void ShowDuplicationMsgWarning(CBaseObject* obj, const QString& newName, bool bShowMsgBox) const override;
- void ChangeObjectName(CBaseObject* obj, const QString& newName) override;
-
- //! Convert object of one type to object of another type.
- //! Original object is deleted.
- bool ConvertToType(CBaseObject* pObject, const QString& typeName) override;
-
- //! Set new selection callback.
- //! @return previous selection callback.
- IObjectSelectCallback* SetSelectCallback(IObjectSelectCallback* callback) override;
-
- // Enables/Disables creating of game objects.
- void SetCreateGameObject(bool enable) override { m_createGameObjects = enable; };
- //! Return true if objects loaded from xml should immidiatly create game objects associated with them.
- bool IsCreateGameObjects() const override { return m_createGameObjects; };
//////////////////////////////////////////////////////////////////////////
//! Get access to gizmo manager.
@@ -270,33 +145,12 @@ public:
//! Invalidate visibily settings of objects.
void InvalidateVisibleList() override;
- //////////////////////////////////////////////////////////////////////////
- // ObjectManager notification Callbacks.
- //////////////////////////////////////////////////////////////////////////
- void AddObjectEventListener(EventListener* listener) override;
- void RemoveObjectEventListener(EventListener* listener) override;
-
- //////////////////////////////////////////////////////////////////////////
- // Used to indicate starting and ending of objects loading.
- //////////////////////////////////////////////////////////////////////////
- void StartObjectsLoading(int numObjects) override;
- void EndObjectsLoading() override;
-
//////////////////////////////////////////////////////////////////////////
// Gathers all resources used by all objects.
void GatherUsedResources(CUsedResources& resources) override;
bool IsLightClass(CBaseObject* pObject) override;
- virtual void FindAndRenameProperty2(const char* property2Name, const QString& oldValue, const QString& newValue) override;
- virtual void FindAndRenameProperty2If(const char* property2Name, const QString& oldValue, const QString& newValue, const char* otherProperty2Name, const QString& otherValue) override;
-
- bool IsReloading() const override { return m_bInReloading; }
- void SetSkipUpdate(bool bSkipUpdate) override { m_bSkipObjectUpdate = bSkipUpdate; }
-
- void SetExportingLevel(bool bExporting) override { m_bLevelExporting = bExporting; }
- bool IsExportingLevelInprogress() const override { return m_bLevelExporting; }
-
int GetAxisHelperHitRadius() const override { return m_axisHelperHitRadius; }
private:
@@ -317,29 +171,12 @@ private:
void SelectCurrent();
void SetObjectSelected(CBaseObject* pObject, bool bSelect);
- // Recursive functions potentially taking into child objects into account
- void SelectObjectInRect(CBaseObject* pObj, CViewport* view, HitContext hc, bool bSelect);
- void HitTestObjectAgainstRect(CBaseObject* pObj, CViewport* view, HitContext hc, std::vector& guids);
-
- void SaveRegistry();
- void LoadRegistry();
-
- void NotifyObjectListeners(CBaseObject* pObject, CBaseObject::EObjectListenerEvent event);
-
- void FindDisplayableObjects(DisplayContext& dc, bool bDisplay);
-
private:
- typedef std::map Objects;
+ typedef AZStd::map Objects;
Objects m_objects;
- typedef std::unordered_map ObjectsByNameCrc;
+ typedef AZStd::unordered_map ObjectsByNameCrc;
ObjectsByNameCrc m_objectsByName;
- typedef std::map TNameSelectionMap;
- TNameSelectionMap m_selections;
-
- //! Used for forcing IDs of "GetEditorObjectID" of PreFabs, as they used to have random IDs on each load
- uint32 m_ForceID;
-
//! Array of currently visible objects.
TBaseObjects m_visibleObjects;
@@ -349,16 +186,11 @@ private:
unsigned int m_lastComputedVisibility = 0; // when the object manager itself last updated visibility (since it also has a cache)
int m_lastHideMask = 0;
- float m_maxObjectViewDistRatio;
-
//////////////////////////////////////////////////////////////////////////
// Selection.
//! Current selection group.
CSelectionGroup* m_currSelection;
- int m_nLastSelCount;
bool m_bSelectionChanged;
- IObjectSelectCallback* m_selectCallback;
- bool m_bLoadingObjects;
// True while performing a select or deselect operation on more than one object.
// Prevents individual undo/redo commands for every object, allowing bulk undo/redo
@@ -367,20 +199,9 @@ private:
//! Default selection.
CSelectionGroup m_defaultSelection;
- CBaseObjectPtr m_currEditObject;
- bool m_bSingleSelection;
-
- bool m_createGameObjects;
- bool m_bGenUniqObjectNames;
-
// Object manager also handles Gizmo manager.
CGizmoManager* m_gizmoManager;
- //////////////////////////////////////////////////////////////////////////
- // Loading progress.
- CWaitProgress* m_pLoadProgress;
- int m_loadedObjects;
- int m_totalObjectsToLoad;
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
@@ -389,10 +210,6 @@ private:
typedef std::map, stl::less_stricmp > NameNumbersMap;
NameNumbersMap m_nameNumbersMap;
- //////////////////////////////////////////////////////////////////////////
- // Listeners.
- std::list m_objectEventListeners;
-
bool m_bExiting;
std::unordered_set m_animatedAttachedEntities;
@@ -401,10 +218,6 @@ private:
uint64 m_currentHideCount;
- bool m_bInReloading;
- bool m_bSkipObjectUpdate;
- bool m_bLevelExporting;
-
int m_axisHelperHitRadius = 20;
};
@@ -426,4 +239,3 @@ namespace AzToolsFramework
} // namespace AzToolsFramework
-#endif // CRYINCLUDE_EDITOR_OBJECTS_OBJECTMANAGER_H
diff --git a/Code/Editor/Objects/ObjectManagerLegacyUndo.h b/Code/Editor/Objects/ObjectManagerLegacyUndo.h
index 721d188171..29dc2aa4ae 100644
--- a/Code/Editor/Objects/ObjectManagerLegacyUndo.h
+++ b/Code/Editor/Objects/ObjectManagerLegacyUndo.h
@@ -24,12 +24,11 @@ public:
CUndoBaseObjectNew(CBaseObject* object);
protected:
- virtual int GetSize() override { return sizeof(*this); }; // Return size of xml state.
- virtual QString GetDescription() override { return "New BaseObject"; };
- virtual QString GetObjectName() override { return m_object->GetName(); };
+ int GetSize() override { return sizeof(*this); } // Return size of xml state.
+ QString GetObjectName() override { return m_object->GetName(); }
- virtual void Undo(bool bUndo) override;
- virtual void Redo() override;
+ void Undo(bool bUndo) override;
+ void Redo() override;
private:
CBaseObjectPtr m_object;
@@ -47,12 +46,11 @@ public:
CUndoBaseObjectDelete(CBaseObject* object);
protected:
- virtual int GetSize() override { return sizeof(*this); }; // Return size of xml state.
- virtual QString GetDescription() override { return "Delete BaseObject"; };
- virtual QString GetObjectName() override { return m_object->GetName(); };
+ int GetSize() override { return sizeof(*this); } // Return size of xml state.
+ QString GetObjectName() override { return m_object->GetName(); }
- virtual void Undo(bool bUndo) override;
- virtual void Redo() override;
+ void Undo(bool bUndo) override;
+ void Redo() override;
private:
CBaseObjectPtr m_object;
@@ -73,20 +71,19 @@ public:
* This Undo command can be used for either Legacy or Component Entities, though for
* performance reasons Component Entities are typically undone using CUndoBaseObjectBulkSelect
*
- * @param pObj The object to perform the undo/redo operation on.
+ * @param object The object to perform the undo/redo operation on.
* @param isSelect This is true if you are trying to undo a select operation, and false if
* trying to undo a deselect operation
*/
CUndoBaseObjectSelect(CBaseObject* object, bool isSelect);
protected:
- virtual void Release() override { delete this; };
- virtual int GetSize() override { return sizeof(*this); }; // Return size of xml state.
- virtual QString GetDescription() override { return "Select Object"; };
- virtual QString GetObjectName() override;
+ void Release() override { delete this; }
+ int GetSize() override { return sizeof(*this); } // Return size of xml state.
+ QString GetObjectName() override;
- virtual void Undo(bool bUndo) override;
- virtual void Redo() override;
+ void Undo(bool bUndo) override;
+ void Redo() override;
private:
GUID m_guid;
@@ -116,7 +113,6 @@ public:
protected:
int GetSize() override { return sizeof(*this); } // Return size of xml state.
- QString GetDescription() override { return QObject::tr("Select Objects"); }
/*
* Deselects the objects
@@ -153,7 +149,6 @@ public:
protected:
int GetSize() override { return sizeof(*this); } // Return size of xml state.
- QString GetDescription() override { return QObject::tr("Select Objects"); }
void Undo(bool bUndo) override;
diff --git a/Code/Editor/Objects/SelectionGroup.cpp b/Code/Editor/Objects/SelectionGroup.cpp
index 06d881d607..95a3cc7b14 100644
--- a/Code/Editor/Objects/SelectionGroup.cpp
+++ b/Code/Editor/Objects/SelectionGroup.cpp
@@ -18,8 +18,6 @@
#include "ViewManager.h"
#include "Include/IObjectManager.h"
-#include
-
//////////////////////////////////////////////////////////////////////////
CSelectionGroup::CSelectionGroup()
: m_ref(1)
@@ -226,7 +224,6 @@ void CSelectionGroup::Move(const Vec3& offset, EMoveSelectionFlag moveFlag, [[ma
m_bVertexSnapped = false;
FilterParents();
- Vec3 newPos;
bool bValidFollowGeometryMode(true);
if (point.x() == -1 || point.y() == -1)
@@ -234,8 +231,6 @@ void CSelectionGroup::Move(const Vec3& offset, EMoveSelectionFlag moveFlag, [[ma
bValidFollowGeometryMode = false;
}
- SRayHitInfo pickedInfo;
-
if (moveFlag == eMS_FollowGeometryPosNorm)
{
if (m_LastestMoveSelectionFlag != eMS_FollowGeometryPosNorm)
@@ -249,6 +244,8 @@ void CSelectionGroup::Move(const Vec3& offset, EMoveSelectionFlag moveFlag, [[ma
}
m_LastestMoveSelectionFlag = moveFlag;
+ Vec3 zeroPickedInfo_vHitNormal;
+ Vec3 zeroPickedInfo_vHitPos;
for (int i = 0; i < GetFilteredCount(); i++)
{
@@ -264,16 +261,15 @@ void CSelectionGroup::Move(const Vec3& offset, EMoveSelectionFlag moveFlag, [[ma
Vec3 zaxis = m_LastestMovedObjectRot * Vec3(0, 0, 1);
zaxis.Normalize();
Quat nq;
- nq.SetRotationV0V1(zaxis, pickedInfo.vHitNormal);
- obj->SetPos(pickedInfo.vHitPos);
+ nq.SetRotationV0V1(zaxis, zeroPickedInfo_vHitNormal);
+ obj->SetPos(zeroPickedInfo_vHitPos);
obj->SetRotation(nq * m_LastestMovedObjectRot);
continue;
}
- Matrix34 wtm = obj->GetWorldTM();
+ const Matrix34 &wtm = obj->GetWorldTM();
Vec3 wp = wtm.GetTranslation();
-
- newPos = wp + offset;
+ Vec3 newPos = wp + offset;
if (moveFlag == eMS_FollowTerrain)
{
// Make sure object keeps it height.
@@ -465,17 +461,6 @@ void CSelectionGroup::SetScale(const Vec3& scale, int referenceCoordSys)
Scale(relScale, referenceCoordSys);
}
-
-void CSelectionGroup::StartScaling()
-{
- for (int i = 0; i < GetFilteredCount(); i++)
- {
- CBaseObject* obj = GetFilteredObject(i);
- obj->StartScaling();
- }
-}
-
-
//////////////////////////////////////////////////////////////////////////
void CSelectionGroup::Align()
{
@@ -533,45 +518,6 @@ void CSelectionGroup::ResetTransformation()
}
}
-//////////////////////////////////////////////////////////////////////////
-void CSelectionGroup::Clone(CSelectionGroup& newGroup)
-{
- IObjectManager* pObjMan = GetIEditor()->GetObjectManager();
- assert(pObjMan);
-
- int i;
- CObjectCloneContext cloneContext;
-
- FilterParents();
-
- //////////////////////////////////////////////////////////////////////////
- // Clone every object.
- for (i = 0; i < GetFilteredCount(); i++)
- {
- CBaseObject* pFromObject = GetFilteredObject(i);
- CBaseObject* newObj = pObjMan->CloneObject(pFromObject);
- if (!newObj) // can be null, e.g. sequence can't be cloned
- {
- continue;
- }
-
- cloneContext.AddClone(pFromObject, newObj);
- newGroup.AddObject(newObj);
- }
-
- //////////////////////////////////////////////////////////////////////////
- // Only after everything was cloned, call PostClone on all cloned objects.
- for (i = 0; i < newGroup.GetCount(); ++i)
- {
- CBaseObject* pFromObject = GetFilteredObject(i);
- CBaseObject* pClonedObject = newGroup.GetObject(i);
- if (pClonedObject)
- {
- pClonedObject->PostClone(pFromObject, cloneContext);
- }
- }
-}
-
//////////////////////////////////////////////////////////////////////////
void CSelectionGroup::SendEvent(ObjectEvent event)
{
diff --git a/Code/Editor/Objects/SelectionGroup.h b/Code/Editor/Objects/SelectionGroup.h
index 600bce5f26..8d979d23be 100644
--- a/Code/Editor/Objects/SelectionGroup.h
+++ b/Code/Editor/Objects/SelectionGroup.h
@@ -98,7 +98,6 @@ public:
//! Resets rotation and scale to identity and (1.0f, 1.0f, 1.0f)
void ResetTransformation();
//! Scale objects in selection by given scale.
- void StartScaling();
void Scale(const Vec3& scale, int referenceCoordSys);
void SetScale(const Vec3& scale, int referenceCoordSys);
//! Align objects in selection to surface normal
@@ -106,11 +105,6 @@ public:
//! Very special method to move contents of a voxel.
void MoveContent(const Vec3& offset);
- //////////////////////////////////////////////////////////////////////////
- //! Clone objects in this group and add cloned objects to new selection group.
- //! Only topmost parent objects will be added to this selection group.
- void Clone(CSelectionGroup& newGroup);
-
// Send event to all objects in selection group.
void SendEvent(ObjectEvent event);
diff --git a/Code/Editor/Plugin.cpp b/Code/Editor/Plugin.cpp
index 4f6fe0279d..68f8d8833b 100644
--- a/Code/Editor/Plugin.cpp
+++ b/Code/Editor/Plugin.cpp
@@ -14,6 +14,7 @@
// Editor
#include "Include/IViewPane.h"
+#include
CClassFactory* CClassFactory::s_pInstance = nullptr;
CAutoRegisterClassHelper* CAutoRegisterClassHelper::s_pFirst = nullptr;
@@ -79,7 +80,7 @@ void CClassFactory::RegisterClass(IClassDesc* pClassDesc)
existingUUIDString,
findByGuid->second->ClassName().toUtf8().data());
- CryMessageBox(errorMessageBuffer, "Invalid class registration - Duplicate UUID", MB_OK);
+ QMessageBox::critical(nullptr,"Invalid class registration - Duplicate UUID",QString::fromLatin1(errorMessageBuffer));
return;
}
@@ -107,7 +108,7 @@ void CClassFactory::RegisterClass(IClassDesc* pClassDesc)
newUUIDString,
existingUUIDString);
- CryMessageBox(errorMessageBuffer, "Invalid class registration - Duplicate Class Name", MB_OK);
+ QMessageBox::critical(nullptr, "Invalid class registration - Duplicate Class Name", QString::fromLatin1(errorMessageBuffer));
return;
}
diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/Objects/ComponentEntityObject.cpp b/Code/Editor/Plugins/ComponentEntityEditorPlugin/Objects/ComponentEntityObject.cpp
index 8957b6ced6..fbb700723b 100644
--- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/Objects/ComponentEntityObject.cpp
+++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/Objects/ComponentEntityObject.cpp
@@ -36,7 +36,6 @@
#include
#include
#include
-#include
#include
#include
@@ -48,14 +47,12 @@
/**
* Scalars for icon drawing behavior.
*/
-static const int s_kIconSize = 36; /// Icon display size (in pixels)
-
CComponentEntityObject::CComponentEntityObject()
- : m_hasIcon(false)
+ : m_accentType(AzToolsFramework::EntityAccentType::None)
+ , m_hasIcon(false)
, m_entityIconVisible(false)
, m_iconOnlyHitTest(false)
, m_drawAccents(true)
- , m_accentType(AzToolsFramework::EntityAccentType::None)
, m_isIsolated(false)
, m_iconTexture(nullptr)
{
@@ -243,7 +240,7 @@ void CComponentEntityObject::SetSelected(bool bSelect)
}
bool anySelected = false;
-
+
AzToolsFramework::ToolsApplicationRequestBus::BroadcastResult(anySelected, &AzToolsFramework::ToolsApplicationRequests::AreAnyEntitiesSelected);
if (!anySelected)
@@ -266,18 +263,6 @@ void CComponentEntityObject::SetHighlight(bool bHighlight)
}
}
-IRenderNode* CComponentEntityObject::GetEngineNode() const
-{
- // It's possible for AZ::Entities to have multiple IRenderNodes.
- // However, the editor currently expects a single IRenderNode per "editor object".
- // Therefore, return the highest priority handler.
- if (auto* renderNodeHandler = LmbrCentral::RenderNodeRequestBus::FindFirstHandler(m_entityId))
- {
- return renderNodeHandler->GetRenderNode();
- }
- return nullptr;
-}
-
void CComponentEntityObject::OnEntityNameChanged(const AZStd::string& name)
{
if (m_nameReentryGuard)
@@ -331,14 +316,6 @@ void CComponentEntityObject::DetachThis(bool /*bKeepPos*/)
}
}
-CBaseObject* CComponentEntityObject::GetLinkParent() const
-{
- AZ::EntityId parentId;
- EBUS_EVENT_ID_RESULT(parentId, m_entityId, AZ::TransformBus, GetParentId);
-
- return CComponentEntityObject::FindObjectForEntity(parentId);
-}
-
bool CComponentEntityObject::IsFrozen() const
{
return CheckFlags(OBJFLAG_FROZEN);
@@ -358,16 +335,6 @@ void CComponentEntityObject::OnEntityLockChanged(bool locked)
CEntityObject::SetFrozen(locked);
}
-void CComponentEntityObject::SetHidden(
- bool bHidden, [[maybe_unused]] uint64 hiddenId /*=CBaseObject::s_invalidHiddenID*/, [[maybe_unused]] bool bAnimated /*=false*/)
-{
- if (m_visibilityFlagReentryGuard)
- {
- EditorActionScope flagChange(m_visibilityFlagReentryGuard);
- AzToolsFramework::SetEntityVisibility(m_entityId, !bHidden);
- }
-}
-
void CComponentEntityObject::OnEntityVisibilityChanged(bool visible)
{
CEntityObject::SetHidden(!visible);
@@ -612,66 +579,6 @@ void CComponentEntityObject::OnTransformChanged([[maybe_unused]] const AZ::Trans
}
}
-int CComponentEntityObject::MouseCreateCallback(CViewport* view, EMouseEvent event, QPoint& point, int flags)
-{
- if (event == eMouseMove || event == eMouseLDown)
- {
- Vec3 pos;
- if (GetIEditor()->GetAxisConstrains() != AXIS_TERRAIN)
- {
- pos = view->MapViewToCP(point);
- }
- else
- {
- // Snap to terrain.
- bool hitTerrain;
- pos = view->ViewToWorld(point, &hitTerrain);
- if (hitTerrain)
- {
- pos.z = GetIEditor()->GetTerrainElevation(pos.x, pos.y);
- }
- pos = view->SnapToGrid(pos);
- }
-
- pos = view->SnapToGrid(pos);
- SetPos(pos);
-
- if (event == eMouseLDown)
- {
- return MOUSECREATE_OK;
- }
-
- return MOUSECREATE_CONTINUE;
- }
-
- return CBaseObject::MouseCreateCallback(view, event, point, flags);
-}
-
-bool CComponentEntityObject::HitHelperTest(HitContext& hc)
-{
- bool hit = CEntityObject::HitHelperTest(hc);
- if (!hit && m_entityId.IsValid())
- {
- // Pick against icon in screen space.
- if (IsEntityIconVisible())
- {
- const QPoint entityScreenPos = hc.view->WorldToView(GetWorldPos());
- const float screenPosX = static_cast