diff --git a/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Main.py b/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Main.py index 7051b9983c..f1e66ac492 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Main.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Main.py @@ -173,9 +173,11 @@ class TestMaterialEditorBasicTests(object): "Document saved as copy is saved with changes: True", "Document saved as child is saved with changes: True", "Save All worked as expected: True", + "P1: Asset Browser visibility working as expected: True", + "P1: Inspector visibility working as expected: True", ] unexpected_lines = [ - "Traceback (most recent call last):" + # Including any lines in unexpected_lines will cause the test to run for the duration of the timeout ] hydra.launch_and_validate_results( diff --git a/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/material_editor_utils.py b/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/material_editor_utils.py index f7ff970541..96eeb4279e 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/material_editor_utils.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/material_editor_utils.py @@ -125,11 +125,11 @@ def is_pane_visible(pane_name): """ :return: bool """ - return atomtools.AtomToolsWindowRequestBus(bus.Broadcast, "IsDockWidgetVisible", pane_name) + return atomtools.AtomToolsMainWindowRequestBus(bus.Broadcast, "IsDockWidgetVisible", pane_name) def set_pane_visibility(pane_name, value): - atomtools.AtomToolsWindowRequestBus(bus.Broadcast, "SetDockWidgetVisible", pane_name, value) + atomtools.AtomToolsMainWindowRequestBus(bus.Broadcast, "SetDockWidgetVisible", pane_name, value) def select_lighting_config(config_name): diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomMaterialEditor_BasicTests.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomMaterialEditor_BasicTests.py index baad02318d..bd00a84919 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomMaterialEditor_BasicTests.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomMaterialEditor_BasicTests.py @@ -36,6 +36,19 @@ MATERIAL_TYPE_PATH = os.path.join( CACHE_FILE_EXTENSION = ".azmaterial" +def verify_pane_visibility(pane_name: str): + """ + print log lines indicating Material Editor pane visibility function + :param pane_name: Name of the pane to be tested + """ + initial_value = material_editor.is_pane_visible(pane_name) + material_editor.set_pane_visibility(pane_name, not initial_value) + result = (material_editor.is_pane_visible(pane_name) is not initial_value) + material_editor.set_pane_visibility(pane_name, initial_value) + result = result and (initial_value is material_editor.is_pane_visible(pane_name)) + print(f"P1: {pane_name} visibility working as expected: {result}") + + def run(): """ Summary: @@ -49,9 +62,12 @@ def run(): 7. Saving as a New Material 8. Saving as a Child Material 9. Saving all Open Materials + 10. Verify Asset Browser pane visibility + 11. Verify Material Inspector pane visibility Expected Result: All the above functions work as expected in Material Editor. + Pane visibility functions as expected :return: None """ @@ -186,6 +202,14 @@ def run(): material_editor.set_property(document2_id, property2_name, initial_color) material_editor.save_all() material_editor.close_all_documents() + + # 10) Verify Asset Browser pane visibility + verify_pane_visibility("Asset Browser") + + # 11) Verify Material Inspector pane visibility + verify_pane_visibility("Inspector") + + # Confirm documents closed and exit Material Editor material_editor.wait_for_condition(lambda: (not material_editor.is_open(document1_id)) and (not material_editor.is_open(document2_id)) and 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 5b1e504442..af1c187817 100644 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/TestSuite_Main_Optimized.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/TestSuite_Main_Optimized.py @@ -131,6 +131,7 @@ class TestAutomation_PrefabNotEnabled(EditorTestSuite): class test_ShapeIntersectionFilter_InstancesPlantInAssignedShape(EditorParallelTest): from .EditorScripts import ShapeIntersectionFilter_InstancesPlantInAssignedShape as test_module + @pytest.mark.skip("https://github.com/o3de/o3de/issues/6973") class test_ShapeIntersectionFilter_FilterStageToggle(EditorParallelTest): from .EditorScripts import ShapeIntersectionFilter_FilterStageToggle as test_module diff --git a/Code/Editor/Controls/ReflectedPropertyControl/PropertyGenericCtrl.cpp b/Code/Editor/Controls/ReflectedPropertyControl/PropertyGenericCtrl.cpp index 8ff83dd894..9609fb5014 100644 --- a/Code/Editor/Controls/ReflectedPropertyControl/PropertyGenericCtrl.cpp +++ b/Code/Editor/Controls/ReflectedPropertyControl/PropertyGenericCtrl.cpp @@ -24,7 +24,6 @@ // Editor #include "SelectLightAnimationDialog.h" #include "SelectSequenceDialog.h" -#include "SelectEAXPresetDlg.h" #include "QtViewPaneManager.h" AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING diff --git a/Code/Editor/CrtDebug.cpp b/Code/Editor/CrtDebug.cpp deleted file mode 100644 index f9335373da..0000000000 --- a/Code/Editor/CrtDebug.cpp +++ /dev/null @@ -1,170 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#include "EditorDefs.h" - - -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// - -//#ifdef _CRTDBG_MAP_ALLOC -#ifdef CRTDBG_MAP_ALLOC -#pragma pack (push,1) -#define nNoMansLandSize 4 -typedef struct MyCrtMemBlockHeader -{ - struct MyCrtMemBlockHeader* pBlockHeaderNext; - struct MyCrtMemBlockHeader* pBlockHeaderPrev; - char* szFileName; - int nLine; - size_t nDataSize; - int nBlockUse; - long lRequest; - unsigned char gap[nNoMansLandSize]; - /* followed by: - * unsigned char data[nDataSize]; - * unsigned char anotherGap[nNoMansLandSize]; - */ -} MyCrtMemBlockHeader; -#pragma pack (pop) - -#define pbData(pblock) ((unsigned char*)((MyCrtMemBlockHeader*)pblock + 1)) -#define pHdr(pbData) (((MyCrtMemBlockHeader*)pbData) - 1) - - -void crtdebug(const char* s, ...) -{ - char str[32768]; - va_list arg_ptr; - va_start(arg_ptr, s); - vsprintf(str, s, arg_ptr); - va_end(arg_ptr); - - FILE* l = nullptr; - azfopen(&l, "crtdump.txt", "a+t"); - if (l) - { - fprintf(l, "%s", str); - fclose(l); - } -} - -int crtAllocHook(int nAllocType, void* pvData, - size_t nSize, int nBlockUse, long lRequest, - const unsigned char* szFileName, int nLine) -{ - if (nBlockUse == _CRT_BLOCK) - { - return TRUE; - } - - static int total_cnt = 0; - static int total_mem = 0; - if (nAllocType == _HOOK_ALLOC) - { - //total_mem += nSize; - //total_cnt++; - //_CrtMemState mem_state; - //_CrtMemCheckpoint( &mem_state ); - //total_cnt = mem_state.lCounts[_NORMAL_BLOCK]; - //total_mem = mem_state.lTotalCount; - if ((total_cnt & 0xF) == 0) - { - //_CrtCheckMemory(); - } - - total_cnt++; - total_mem += nSize; - - //crtdebug( " Alloc %d,size=%d,in: %s %d (total size=%d,num=%d)\n",lRequest,nSize,szFileName,nLine,total_mem,total_cnt ); - crtdebug("Size=%d, [Total=%d,N=%d] [%s:%d]\n", nSize, total_mem, total_cnt, szFileName, nLine); - } - else if (nAllocType == _HOOK_FREE) - { - MyCrtMemBlockHeader* pHead; - pHead = pHdr(pvData); - - total_cnt--; - total_mem -= pHead->nDataSize; - - crtdebug("Size=%d, [Total=%d,N=%d] [%s:%d]\n", pHead->nDataSize, total_mem, total_cnt, pHead->szFileName, pHead->nLine); - //crtdebug( " Free size=%d,in: %s %d (total size=%d,num=%d)\n",pHead->nDataSize,pHead->szFileName,pHead->nLine,total_mem,total_cnt ); - //total_mem -= nSize; - //total_cnt--; - } - return TRUE; -} - -int crtReportHook(int nRptType, char* szMsg, int* retVal) -{ - static int gl_num_asserts = 0; - if (gl_num_asserts != 0) - { - return TRUE; - } - gl_num_asserts++; - switch (nRptType) - { - case _CRT_WARN: - crtdebug(" %s\n", szMsg); - break; - case _CRT_ERROR: - crtdebug(" %s\n", szMsg); - break; - case _CRT_ASSERT: - crtdebug(" %s\n", szMsg); - break; - } - gl_num_asserts--; - return TRUE; -} - -void InitCrt() -{ - FILE* l = nullptr; - azfopen(&l, "crtdump.txt", "w"); - if (l) - { - fclose(l); - } - - //_CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_DEBUG ); - //_CrtSetReportMode( _CRT_ERROR, _CRTDBG_MODE_DEBUG ); - //_CrtSetReportMode( _CRT_ASSERT, _CRTDBG_MODE_DEBUG ); - - _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_WNDW); - _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_WNDW); - _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_WNDW); - - //_CrtSetDbgFlag( _CRTDBG_CHECK_ALWAYS_DF|_CRTDBG_CHECK_CRT_DF|_CRTDBG_LEAK_CHECK_DF|_CRTDBG_DELAY_FREE_MEM_DF | _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) ); - //_CrtSetDbgFlag( _CRTDBG_CHECK_CRT_DF|_CRTDBG_LEAK_CHECK_DF/*|_CRTDBG_DELAY_FREE_MEM_DF*/ | _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) ); - int flags = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG); - flags &= ~_CRTDBG_DELAY_FREE_MEM_DF | _CRTDBG_LEAK_CHECK_DF | _CRTDBG_CHECK_CRT_DF; - - _CrtSetDbgFlag(flags); - - _CrtSetAllocHook (crtAllocHook); - _CrtSetReportHook(crtReportHook); -} - -void DoneCrt() -{ - //_CrtCheckMemory(); - //_CrtDumpMemoryLeaks(); -} - -// Autoinit CRT. -//struct __autoinit_crt { __autoinit_crt() { InitCrt(); }; ~__autoinit_crt() { DoneCrt(); } } __autoinit_crt_var; -#endif - - -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// diff --git a/Code/Editor/CryEdit.cpp b/Code/Editor/CryEdit.cpp index 1c4e22b99e..3beaf4d438 100644 --- a/Code/Editor/CryEdit.cpp +++ b/Code/Editor/CryEdit.cpp @@ -124,9 +124,6 @@ AZ_POP_DISABLE_WARNING #include "ScopedVariableSetter.h" #include "Util/3DConnexionDriver.h" - -#include "DimensionsDialog.h" - #include "Util/AutoDirectoryRestoreFileDialog.h" #include "Util/EditorAutoLevelLoadTest.h" #include "AboutDialog.h" @@ -1806,12 +1803,6 @@ bool CCryEditApp::InitInstance() InitLevel(cmdInfo); }); -#ifdef USE_WIP_FEATURES_MANAGER - // load the WIP features file - CWipFeatureManager::Instance()->EnableManager(!cmdInfo.m_bDeveloperMode); - CWipFeatureManager::Init(); -#endif - if (!m_bConsoleMode && !m_bPreviewMode) { GetIEditor()->UpdateViews(); @@ -2142,13 +2133,6 @@ int CCryEditApp::ExitInstance(int exitCode) } qobject_cast(qApp)->UnloadSettings(); - #ifdef USE_WIP_FEATURES_MANAGER - // - // close wip features manager - // - CWipFeatureManager::Shutdown(); - #endif - if (IsInRegularEditorMode()) { if (GetIEditor()) diff --git a/Code/Editor/CryEdit.h b/Code/Editor/CryEdit.h index 97fcde8f34..48f362003c 100644 --- a/Code/Editor/CryEdit.h +++ b/Code/Editor/CryEdit.h @@ -14,7 +14,6 @@ #if !defined(Q_MOC_RUN) #include #include -#include "WipFeatureManager.h" #include "CryEditDoc.h" #include "ViewPane.h" diff --git a/Code/Editor/CryEditDoc.cpp b/Code/Editor/CryEditDoc.cpp index 3bcba4d5e0..9d93fd5f5b 100644 --- a/Code/Editor/CryEditDoc.cpp +++ b/Code/Editor/CryEditDoc.cpp @@ -45,7 +45,6 @@ #include "ActionManager.h" #include "Include/IObjectManager.h" #include "ErrorReportDialog.h" -#include "SurfaceTypeValidator.h" #include "Util/AutoLogTime.h" #include "CheckOutDialog.h" #include "GameExporter.h" @@ -99,8 +98,7 @@ namespace Internal // CCryEditDoc construction/destruction CCryEditDoc::CCryEditDoc() - : doc_validate_surface_types(nullptr) - , m_modifiedModuleFlags(eModifiedNothing) + : m_modifiedModuleFlags(eModifiedNothing) { //////////////////////////////////////////////////////////////////////// // Set member variables to initial values @@ -120,7 +118,6 @@ CCryEditDoc::CCryEditDoc() GetIEditor()->SetDocument(this); CLogFile::WriteLine("Document created"); - RegisterConsoleVariables(); MainWindow::instance()->GetActionManager()->RegisterActionHandler(ID_FILE_SAVE_AS, this, &CCryEditDoc::OnFileSaveAs); bool isPrefabSystemEnabled = false; @@ -459,8 +456,6 @@ void CCryEditDoc::Load(TDocMultiArchive& arrXmlAr, const QString& szFilename) } } - CSurfaceTypeValidator().Validate(); - LogLoadTime(GetTickCount() - t0); // Loaded with success, remove event from log file GetIEditor()->GetSettingsManager()->UnregisterEvent(loadEvent); @@ -1910,25 +1905,6 @@ void CCryEditDoc::SetDocumentReady(bool bReady) m_bDocumentReady = bReady; } -void CCryEditDoc::RegisterConsoleVariables() -{ - doc_validate_surface_types = gEnv->pConsole->GetCVar("doc_validate_surface_types"); - - if (!doc_validate_surface_types) - { - doc_validate_surface_types = REGISTER_INT_CB("doc_validate_surface_types", 0, 0, - "Flag indicating whether icons are displayed on the animation graph.\n" - "Default is 1.\n", - OnValidateSurfaceTypesChanged); - } -} - -void CCryEditDoc::OnValidateSurfaceTypesChanged(ICVar*) -{ - CErrorsRecorder errorsRecorder(GetIEditor()); - CSurfaceTypeValidator().Validate(); -} - void CCryEditDoc::OnStartLevelResourceList() { // after loading another level we clear the RFOM_Level list, the first time the list should be empty diff --git a/Code/Editor/CryEditDoc.h b/Code/Editor/CryEditDoc.h index f7e97d308e..5d20bddf45 100644 --- a/Code/Editor/CryEditDoc.h +++ b/Code/Editor/CryEditDoc.h @@ -176,9 +176,7 @@ protected: virtual void OnFileSaveAs(); //! called immediately after saving the level. void AfterSave(); - void RegisterConsoleVariables(); void OnStartLevelResourceList(); - static void OnValidateSurfaceTypesChanged(ICVar*); QString GetCryIndexPath(const char* levelFilePath) const; @@ -194,7 +192,6 @@ protected: XmlNodeRef m_environmentTemplate; std::list m_listeners; bool m_bDocumentReady = false; - ICVar* doc_validate_surface_types = nullptr; int m_modifiedModuleFlags; // On construction, it assumes loaded levels have already been exported. Can be a big fat lie, though. // The right way would require us to save to the level folder the export status of the level. diff --git a/Code/Editor/CryEditLiveCreate.rc b/Code/Editor/CryEditLiveCreate.rc deleted file mode 100644 index 3dac96d682..0000000000 --- a/Code/Editor/CryEditLiveCreate.rc +++ /dev/null @@ -1,213 +0,0 @@ -ÿþ// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "winres.h" -#include "resource.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (United States) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -2 TEXTINCLUDE -BEGIN - "#include ""winres.h""\r\n" - "#include ""resource.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Menu -// - -IDR_MENU_LIVECREATE MENU -BEGIN - POPUP "&File" - BEGIN - MENUITEM "Save settings", ID_FILE_SAVESETTINGS - MENUITEM "Close", ID_FILE_CLOSE_LIVECREATE_VIEW - END - POPUP "&View" - BEGIN - MENUITEM "LiveCreate Logger", ID_VIEW_LIVECREATELOGGER, CHECKED - MENUITEM "LiveCreate Profile Editor", ID_VIEW_LIVECREATEPROFILEEDITOR, CHECKED - MENUITEM "LiveCreate File Sync Settings", ID_VIEW_LIVECREATEFILESYNCSETTINGS, CHECKED - END -END - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_LIVECREATE_PICKER DIALOGEX 0, 0, 316, 259 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Select game build directory" -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - DEFPUSHBUTTON "OK",IDOK,200,238,50,14 - PUSHBUTTON "Cancel",IDCANCEL,259,238,50,14 - CONTROL "",IDC_DIRECTORY_TREE,"SysTreeView32",TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_SHOWSELALWAYS | WS_BORDER | WS_HSCROLL | WS_TABSTOP,7,7,302,227 -END - -IDD_LIVECREATE_ADD_TARGETS DIALOGEX 0, 0, 500, 400 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Discover LiveCreate targets" -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - PUSHBUTTON "Refresh",IDC_REFRESH,8,8,70,18 - PUSHBUTTON "Add custom...",IDC_BUTTON_ADD_PEER,82,8,70,18 - CONTROL "Use wider search (broadcast)",IDC_CHECK_ENABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,233,12,200,10 - CONTROL "",IDC_LIST_PEERS,"XTPReport",WS_TABSTOP,8,32,484,342,WS_EX_STATICEDGE - DEFPUSHBUTTON "Use selected",IDOK,180,379,70,18 - PUSHBUTTON "Cancel",IDCANCEL,259,379,70,18 - PUSHBUTTON "Add by IP...",IDC_BUTTON_ADD_MATERIAL,157,8,70,18 -END - -IDD_LIVECREATE_PEER_LIST DIALOGEX 0, 0, 395, 213 -STYLE DS_SETFONT | DS_FIXEDSYS | DS_CENTER | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_SYSMENU -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - LTEXT "Peers:",IDC_STATIC,17,27,22,8 - PUSHBUTTON "Add...",IDC_BUTTON_ADD_PEER,56,24,56,16 - PUSHBUTTON "Edit...",IDC_BUTTON_EDIT_PEER,116,24,56,16 - PUSHBUTTON "Remove",IDC_BUTTON_DELETE_PEER,176,24,52,16 - DEFPUSHBUTTON "Start All",IDC_BUTTON_START_ALL,4,4,48,16 - PUSHBUTTON "Reset All",IDC_BUTTON_RESET_ALL,176,4,52,16 - PUSHBUTTON "Force Sync All",IDC_BUTTON_FORCE_SYNC_ALL,56,4,56,16 - PUSHBUTTON "Clean All",IDC_BUTTON_CLEAN_ALL,232,4,52,16 - PUSHBUTTON "Screenshot All",IDC_BUTTON_SCREENSHOT_ALL,116,4,56,16 - CONTROL "",IDC_LIST_PEERS,"XTPReport",WS_TABSTOP,4,44,386,164,WS_EX_STATICEDGE - CHECKBOX "LiveCreate",IDC_BUTTON_ENABLE_LIVECREATE,288,4,52,36,BS_PUSHLIKE | BS_MULTILINE - CHECKBOX "Sync\nCamera",IDC_BUTTON_CAMERA_SYNC,345,4,52,36,BS_PUSHLIKE | BS_MULTILINE - PUSHBUTTON "Discover",IDC_BUTTON_DISCOVER_PEERS,232,24,52,16 -END - -IDD_IDD_LIVECREATE_SETTINGS_PANEL DIALOGEX 0, 0, 156, 204 -STYLE DS_SETFONT | WS_CHILD -FONT 8, "MS Shell Dlg 2", 400, 0, 0x1 -BEGIN - PUSHBUTTON "Add targets...",IDC_BUTTON_DISCOVER_PEERS,4,4,80,16 -END - -IDD_LIVECREATE_EDIT_CONNECTION DIALOGEX 0, 0, 288, 183 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "LiveCreate host settings" -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - DEFPUSHBUTTON "OK",IDOK,158,154,58,20 - PUSHBUTTON "Cancel",IDCANCEL,221,154,58,20 - LTEXT "Name:",IDC_STATIC,16,46,22,8 - EDITTEXT IDC_EDIT_TARGET_NAME,44,44,100,14,ES_AUTOHSCROLL - LTEXT "IP:",IDC_STATIC,152,46,10,8 - CONTROL "",IDC_TARGET_IPADDRESS,"SysIPAddress32",WS_TABSTOP,168,44,100,15 - LTEXT "Platform:",IDC_STATIC,8,26,30,8 - LTEXT "Build path (automatic):",IDC_STATIC,19,120,74,8 - PUSHBUTTON "Test IP",IDC_BUTTON_TEST_CONNECTION,168,60,100,16 - COMBOBOX IDC_COMBO_PLATFORM,44,24,100,88,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "Resovle name to IP",IDC_BUTTON_REFRESH_IP,44,60,100,16 - CONTROL "Enable this peer",IDC_CHECK_ENABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,8,67,10 - GROUPBOX "Build settings",IDC_STATIC,7,80,272,71 - LTEXT "Build executable:",IDC_STATIC,19,92,56,8 - PUSHBUTTON "...",IDC_BUTTON_PICK_GAME_DIRECTORY,249,104,22,14 - EDITTEXT IDC_EDIT_BUILD_ROOT_PATH,20,104,226,14,ES_AUTOHSCROLL - EDITTEXT IDC_EDIT_BUILD_EXECUTABLE,20,131,249,14,ES_AUTOHSCROLL -END - -IDD_LIVECREATE_TASK_WAIT DIALOGEX 0, 0, 238, 41 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Dialog" -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - PUSHBUTTON "Cancel",IDCANCEL,94,20,50,14 - LTEXT "Static",IDC_TASK_PROGRESS_TEXT,7,7,224,8 -END - -IDD_LIVECREATE_ADD_BY_IP DIALOGEX 0, 0, 137, 75 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Add LiveCreate by IP" -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - DEFPUSHBUTTON "OK",IDOK,7,48,58,20 - PUSHBUTTON "Cancel",IDCANCEL,71,48,58,20 - LTEXT "IP:",-1,9,12,10,8 - EDITTEXT IDC_TARGET_IPADDRESS,25,10,100,15,WS_TABSTOP - PUSHBUTTON "Test IP",IDC_BUTTON_TEST_CONNECTION,25,27,100,16 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO -BEGIN - IDD_LIVECREATE_ADD_TARGETS, DIALOG - BEGIN - END - - IDD_LIVECREATE_EDIT_CONNECTION, DIALOG - BEGIN - END - - IDD_LIVECREATE_TASK_WAIT, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 231 - TOPMARGIN, 7 - BOTTOMMARGIN, 34 - END - - IDD_LIVECREATE_ADD_BY_IP, DIALOG - BEGIN - END -END -#endif // APSTUDIO_INVOKED - -#endif // English (United States) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED \ No newline at end of file diff --git a/Code/Editor/DimensionsDialog.cpp b/Code/Editor/DimensionsDialog.cpp deleted file mode 100644 index 6c8e6a616b..0000000000 --- a/Code/Editor/DimensionsDialog.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#include "EditorDefs.h" - -#include "DimensionsDialog.h" - -// Qt -#include - -AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING -#include -AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING - - - -///////////////////////////////////////////////////////////////////////////// -CDimensionsDialog::CDimensionsDialog(QWidget* pParent /*=nullptr*/) - : QDialog(pParent) - , m_group(new QButtonGroup(this)) - , ui(new Ui::CDimensionsDialog) -{ - ui->setupUi(this); - - setWindowTitle(tr("Generate Terrain Texture")); - - m_group->addButton(ui->Dim512, 512); - m_group->addButton(ui->Dim1024, 1024); - m_group->addButton(ui->Dim2048, 2048); - m_group->addButton(ui->Dim4096, 4096); - m_group->addButton(ui->Dim8192, 8192); - m_group->addButton(ui->Dim16384, 16384); -} - - -////////////////////////////////////////////////////////////////////////// -CDimensionsDialog::~CDimensionsDialog() -{ -} - -////////////////////////////////////////////////////////////////////////// -void CDimensionsDialog::SetDimensions(unsigned int iWidth) -{ - //////////////////////////////////////////////////////////////////////// - // Select a dimension option button in the dialog - //////////////////////////////////////////////////////////////////////// - - QAbstractButton* button = m_group->button(iWidth); - assert(button); - - button->setChecked(true); -} - -UINT CDimensionsDialog::GetDimensions() -{ - //////////////////////////////////////////////////////////////////////// - // Get the currently selected dimension option button in the dialog - //////////////////////////////////////////////////////////////////////// - - assert(m_group->checkedId() != -1); - - return m_group->checkedId(); -} - -#include diff --git a/Code/Editor/DimensionsDialog.h b/Code/Editor/DimensionsDialog.h deleted file mode 100644 index b94c58bf95..0000000000 --- a/Code/Editor/DimensionsDialog.h +++ /dev/null @@ -1,47 +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 -#ifndef CRYINCLUDE_EDITOR_DIMENSIONSDIALOG_H -#define CRYINCLUDE_EDITOR_DIMENSIONSDIALOG_H - -#if !defined(Q_MOC_RUN) -#include - -#include -#endif - -class QButtonGroup; - -namespace Ui { - class CDimensionsDialog; -} - -class CDimensionsDialog - : public QDialog -{ - Q_OBJECT - -public: - CDimensionsDialog(QWidget* pParent = nullptr); // standard constructor - ~CDimensionsDialog(); - - UINT GetDimensions(); - void SetDimensions(unsigned int iWidth); - -protected: - void UpdateData(bool fromUi = true); // DDX/DDV support - -private: - QButtonGroup* m_group; - - QScopedPointer ui; -}; - -#endif // CRYINCLUDE_EDITOR_DIMENSIONSDIALOG_H diff --git a/Code/Editor/DimensionsDialog.ui b/Code/Editor/DimensionsDialog.ui deleted file mode 100644 index 316a060c92..0000000000 --- a/Code/Editor/DimensionsDialog.ui +++ /dev/null @@ -1,120 +0,0 @@ - - - CDimensionsDialog - - - - 0 - 0 - 465 - 237 - - - - Qt::StrongFocus - - - - - - Texture Dimensions (Texture Dimensions divided by Terrain Size = Texels per meter) - - - - - - Qt::StrongFocus - - - 512 x 512 - - - true - - - - - - - Qt::StrongFocus - - - 1024 x 1024 - - - - - - - Qt::StrongFocus - - - 2048 x 2048 - - - - - - - Qt::StrongFocus - - - 4096 x 4096 - - - - - - - Qt::StrongFocus - - - 8192 x 8192 - - - - - - - Qt::StrongFocus - - - 16384 x 16384 - - - - - - - - - - Qt::StrongFocus - - - QDialogButtonBox::Ok - - - - - - - - - buttonBox - accepted() - CDimensionsDialog - accept() - - - 77 - 294 - - - 7 - 296 - - - - - diff --git a/Code/Editor/GameEngine.cpp b/Code/Editor/GameEngine.cpp index db4c587f54..9786dcf1b8 100644 --- a/Code/Editor/GameEngine.cpp +++ b/Code/Editor/GameEngine.cpp @@ -42,8 +42,6 @@ #include "ViewManager.h" #include "AnimationContext.h" -#include "UndoViewPosition.h" -#include "UndoViewRotation.h" #include "MainWindow.h" #include "Include/IObjectManager.h" #include "ActionManager.h" diff --git a/Code/Editor/MainWindow.qrc b/Code/Editor/MainWindow.qrc index c68e05ef41..57afc596bb 100644 --- a/Code/Editor/MainWindow.qrc +++ b/Code/Editor/MainWindow.qrc @@ -154,36 +154,6 @@ res/error_report_warning.svg res/error_report_comment.svg res/error_report_helper.svg - particles_tree_00.png - particles_tree_01.png - particles_tree_02.png - particles_tree_03.png - particles_tree_04.png - particles_tree_05.png - particles_tree_06.png - particles_tree_07.png - arhitype_tree_00.png - arhitype_tree_01.png - arhitype_tree_02.png - arhitype_tree_03.png - bmp00005_00.png - bmp00005_01.png - bmp00005_02.png - bmp00005_03.png - bmp00005_04.png - bmp00005_05.png - bmp00005_06.png - bmp00005_07.png - bmp00005_08.png - bmp00005_09.png - bmp00006_00.png - bmp00006_01.png - bmp00006_02.png - bmp00006_03.png - bmp00006_04.png - bmp00006_05.png - bmp00006_06.png - bmp00006_07.png res/arr_addkey.cur diff --git a/Code/Editor/NewLevelDialog.cpp b/Code/Editor/NewLevelDialog.cpp index a97eb30f57..b22d9dbaf3 100644 --- a/Code/Editor/NewLevelDialog.cpp +++ b/Code/Editor/NewLevelDialog.cpp @@ -18,9 +18,6 @@ #include #include -// Editor -#include "NewTerrainDialog.h" - AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING #include AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING diff --git a/Code/Editor/NewTerrainDialog.cpp b/Code/Editor/NewTerrainDialog.cpp deleted file mode 100644 index 0e66482eb4..0000000000 --- a/Code/Editor/NewTerrainDialog.cpp +++ /dev/null @@ -1,168 +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 - * - */ -// NewTerrainDialog.cpp : implementation file -// - -#include "EditorDefs.h" - -#include "NewTerrainDialog.h" - - -AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option") -#include -AZ_POP_DISABLE_WARNING - - - -CNewTerrainDialog::CNewTerrainDialog(QWidget* pParent /*=nullptr*/) - : QDialog(pParent) - , m_terrainResolutionIndex(0) - , m_terrainUnitsIndex(0) - , m_bUpdate(false) - , ui(new Ui::CNewTerrainDialog) - , m_initialized(false) -{ - ui->setupUi(this); - - setWindowTitle(tr("Terrain options")); - - // Default is 1024x1024, and m_terrainResolution holds an index to the combo box - m_terrainResolutionIndex = 3; - - connect(ui->TERRAIN_RESOLUTION, SIGNAL(activated(int)), this, SLOT(OnComboBoxSelectionTerrainResolution())); - connect(ui->TERRAIN_UNITS, SIGNAL(activated(int)), this, SLOT(OnComboBoxSelectionTerrainUnits())); -} - - -CNewTerrainDialog::~CNewTerrainDialog() -{ -} - - -void CNewTerrainDialog::UpdateData(bool fromUi) -{ - if (fromUi) - { - m_terrainResolutionIndex = ui->TERRAIN_RESOLUTION->currentIndex(); - m_terrainUnitsIndex = ui->TERRAIN_UNITS->currentIndex(); - } - else - { - ui->TERRAIN_RESOLUTION->setCurrentIndex(m_terrainResolutionIndex); - ui->TERRAIN_UNITS->setCurrentIndex(m_terrainUnitsIndex); - } -} - - -void CNewTerrainDialog::OnInitDialog() -{ - // Initialize terrain values. - int resolution = Ui::START_TERRAIN_RESOLUTION; - - // Fill terrain resolution combo box - for (int i = 0; i < 6; i++) - { - ui->TERRAIN_RESOLUTION->addItem(QString("%1x%1").arg(resolution)); - resolution *= 2; - } - - UpdateTerrainUnits(); - UpdateTerrainInfo(); - - // Save data. - UpdateData(false); -} - - -void CNewTerrainDialog::UpdateTerrainUnits() -{ - uint32 terrainRes = GetTerrainResolution(); - int size = terrainRes * GetTerrainUnits(); - int maxUnit = IntegerLog2(Ui::MAXIMUM_TERRAIN_RESOLUTION / terrainRes); - int units = Ui::START_TERRAIN_UNITS; - - ui->TERRAIN_UNITS->clear(); - for (int i = 0; i <= maxUnit; i++) - { - ui->TERRAIN_UNITS->addItem(QString::number(units)); - units *= 2; - } - if (size > Ui::MAXIMUM_TERRAIN_RESOLUTION) - { - m_terrainUnitsIndex = 0; - } - ui->TERRAIN_UNITS->setCurrentText(QString::number(m_terrainUnitsIndex)); -} - - -void CNewTerrainDialog::UpdateTerrainInfo() -{ - int sizeX = GetTerrainResolution() * GetTerrainUnits(); - int sizeY = GetTerrainResolution() * GetTerrainUnits(); - - QString str; - if (sizeX >= 1000) - { - str = tr("Terrain Size: %1 x %2 Kilometers").arg((float)sizeX / 1000.0f, 0, 'f', 3).arg((float)sizeY / 1000.0f, 0, 'f', 3); - } - else if (sizeX > 0) - { - str = tr("Terrain Size: %1 x %2 Meters").arg(sizeX).arg(sizeY); - } - else - { - str = tr("Level will have no terrain"); - } - - ui->TERRAIN_INFO->setText(str); -} - - -int CNewTerrainDialog::GetTerrainResolution() const -{ - // convert combo box index into resolution value - return Ui::START_TERRAIN_RESOLUTION * (1 << m_terrainResolutionIndex); -} - - -int CNewTerrainDialog::GetTerrainUnits() const -{ - // convert combo box index into units value - return Ui::START_TERRAIN_UNITS * (1 << m_terrainUnitsIndex); -} - - -void CNewTerrainDialog::OnComboBoxSelectionTerrainResolution() -{ - UpdateData(); - - UpdateTerrainUnits(); - - UpdateTerrainInfo(); -} - - -void CNewTerrainDialog::OnComboBoxSelectionTerrainUnits() -{ - UpdateData(); - - UpdateTerrainInfo(); -} - - -void CNewTerrainDialog::showEvent(QShowEvent* event) -{ - if (!m_initialized) - { - OnInitDialog(); - m_initialized = true; - } - QDialog::showEvent(event); -} - -#include diff --git a/Code/Editor/NewTerrainDialog.h b/Code/Editor/NewTerrainDialog.h deleted file mode 100644 index 8905a8c123..0000000000 --- a/Code/Editor/NewTerrainDialog.h +++ /dev/null @@ -1,71 +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 -#ifndef CRYINCLUDE_EDITOR_NEWTERRAINDIALOG_H -#define CRYINCLUDE_EDITOR_NEWTERRAINDIALOG_H - -#if !defined(Q_MOC_RUN) -#include - -#include - -#include -#endif - -namespace Ui -{ - class CNewTerrainDialog; - - enum TerrainDialogConstants - { - START_TERRAIN_RESOLUTION_POWER_OF_TWO = 7, - START_TERRAIN_RESOLUTION = 1 << START_TERRAIN_RESOLUTION_POWER_OF_TWO, - MAXIMUM_TERRAIN_POWER_OF_TWO = 16, - MAXIMUM_TERRAIN_RESOLUTION = 1 << MAXIMUM_TERRAIN_POWER_OF_TWO, - POWER_OFFSET = (MAXIMUM_TERRAIN_POWER_OF_TWO - START_TERRAIN_RESOLUTION_POWER_OF_TWO), - START_TERRAIN_UNITS = 1 - }; -} - -class CNewTerrainDialog - : public QDialog -{ - Q_OBJECT - -public: - CNewTerrainDialog(QWidget* pParent = nullptr); // standard constructor - ~CNewTerrainDialog(); - - int GetTerrainResolution() const; - int GetTerrainUnits() const; - - void IsResize(bool bIsResize); - - -protected: - void UpdateData(bool fromUi = true); - void OnInitDialog(); - - void UpdateTerrainUnits(); - void UpdateTerrainInfo(); - - void showEvent(QShowEvent* event) override; - -protected slots: - void OnComboBoxSelectionTerrainResolution(); - void OnComboBoxSelectionTerrainUnits(); - -public: - int m_terrainResolutionIndex; - int m_terrainUnitsIndex; - bool m_bUpdate; - - QScopedPointer ui; - bool m_initialized; -}; -#endif // CRYINCLUDE_EDITOR_NEWTERRAINDIALOG_H diff --git a/Code/Editor/NewTerrainDialog.ui b/Code/Editor/NewTerrainDialog.ui deleted file mode 100644 index 977db11918..0000000000 --- a/Code/Editor/NewTerrainDialog.ui +++ /dev/null @@ -1,112 +0,0 @@ - - - CNewTerrainDialog - - - - 0 - 0 - 292 - 160 - - - - false - - - - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - QFormLayout::AllNonFixedFieldsGrow - - - - - Heightmap Resolution: - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - TERRAIN_RESOLUTION - - - - - - - - - - Meters Per Texel: - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - TERRAIN_UNITS - - - - - - - - - - Terrain Size: 32x32 Km - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - - - - - - - - - - buttonBox - accepted() - CNewTerrainDialog - accept() - - - 164 - 176 - - - 169 - 1 - - - - - buttonBox - rejected() - CNewTerrainDialog - reject() - - - 245 - 172 - - - 247 - -1 - - - - - diff --git a/Code/Editor/PakManagerDlg.qrc b/Code/Editor/PakManagerDlg.qrc deleted file mode 100644 index bea8f8aafd..0000000000 --- a/Code/Editor/PakManagerDlg.qrc +++ /dev/null @@ -1,6 +0,0 @@ - - - res/pakmanager_file.png - res/pakmanager_folder.png - - diff --git a/Code/Editor/PakManagerDlg.ui b/Code/Editor/PakManagerDlg.ui deleted file mode 100644 index 087e5379da..0000000000 --- a/Code/Editor/PakManagerDlg.ui +++ /dev/null @@ -1,202 +0,0 @@ - - - CPakManagerDlg - - - - 0 - 0 - 661 - 494 - - - - - - - - - - 0 - 45 - - - - Open PAK... - - - - - - - - 0 - 45 - - - - Create PAK... - - - - - - - - 0 - 45 - - - - Add files... - - - - - - - - 0 - 45 - - - - Add folder... - - - - - - - - 0 - 45 - - - - Extract... - - - - - - - - 0 - 45 - - - - Delete entries - - - - - - - - 0 - 45 - - - - &Close - - - - - - - - - - - Path: - - - - - - - - 0 - 0 - - - - QFrame::Panel - - - QFrame::Sunken - - - <none> - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - - - - - - - QFrame::Box - - - Qt::ScrollBarAlwaysOn - - - QAbstractItemView::NoEditTriggers - - - QAbstractItemView::SelectItems - - - 120 - - - false - - - - Filename - - - - - Size - - - - - Modified - - - - - - - - Ready - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - - - - - Qt::AlignCenter - - - - - - - - - - diff --git a/Code/Editor/SelectEAXPresetDlg.cpp b/Code/Editor/SelectEAXPresetDlg.cpp deleted file mode 100644 index 733de8b9cf..0000000000 --- a/Code/Editor/SelectEAXPresetDlg.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#include "EditorDefs.h" - -#include "SelectEAXPresetDlg.h" - -AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING -#include "ui_SelectEAXPresetDlg.h" -AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING - - -CSelectEAXPresetDlg::CSelectEAXPresetDlg(QWidget* pParent) - : QDialog(pParent) - , m_ui(new Ui_CSelectEAXPresetDlg) -{ - m_ui->setupUi(this); -} - -CSelectEAXPresetDlg::~CSelectEAXPresetDlg() -{ -} - -void CSelectEAXPresetDlg::SetCurrPreset(const QString& sPreset) -{ - QAbstractListModel* model = Model(); - if (!model) - { - return; - } - - QModelIndexList indexes = model->match(QModelIndex(), Qt::DisplayRole, sPreset, 1, Qt::MatchExactly); - - if (!indexes.isEmpty()) - { - m_ui->listView->setCurrentIndex(indexes.at(0)); - } -} - -QString CSelectEAXPresetDlg::GetCurrPreset() const -{ - if (m_ui->listView->currentIndex().isValid()) - { - return m_ui->listView->currentIndex().data().toString(); - } - // EXCEPTION: OCX Property Pages should return false - return QString(); -} - - -void CSelectEAXPresetDlg::SetModel(QAbstractListModel* model) -{ - m_ui->listView->setModel(model); -} - -QAbstractListModel* CSelectEAXPresetDlg::Model() const -{ - return static_cast(m_ui->listView->model()); -} - -#include "moc_SelectEAXPresetDlg.cpp" diff --git a/Code/Editor/SelectEAXPresetDlg.h b/Code/Editor/SelectEAXPresetDlg.h deleted file mode 100644 index 9943585987..0000000000 --- a/Code/Editor/SelectEAXPresetDlg.h +++ /dev/null @@ -1,43 +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 - -// CSelectEAXPresetDlg dialog -#ifndef CRYINCLUDE_EDITOR_SELECTEAXPRESETDLG_H -#define CRYINCLUDE_EDITOR_SELECTEAXPRESETDLG_H - -#if !defined(Q_MOC_RUN) -#include -#endif - -class QAbstractListModel; -class Ui_CSelectEAXPresetDlg; - -class CSelectEAXPresetDlg - : public QDialog -{ - Q_OBJECT - -public: - CSelectEAXPresetDlg(QWidget* pParent = nullptr); // standard constructor - ~CSelectEAXPresetDlg(); - - void SetCurrPreset(const QString& sPreset); - QString GetCurrPreset() const; - -protected: - void SetModel(QAbstractListModel* model); - QAbstractListModel* Model() const; - -private: - Ui_CSelectEAXPresetDlg* m_ui; -}; - -#endif // CRYINCLUDE_EDITOR_SELECTEAXPRESETDLG_H diff --git a/Code/Editor/SelectEAXPresetDlg.ui b/Code/Editor/SelectEAXPresetDlg.ui deleted file mode 100644 index 3177b66c38..0000000000 --- a/Code/Editor/SelectEAXPresetDlg.ui +++ /dev/null @@ -1,67 +0,0 @@ - - - CSelectEAXPresetDlg - - - - 0 - 0 - 197 - 233 - - - - Select Preset... - - - - - - - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - listView - - - - - buttonBox - accepted() - CSelectEAXPresetDlg - accept() - - - 51 - 207 - - - 49 - 199 - - - - - buttonBox - rejected() - CSelectEAXPresetDlg - reject() - - - 148 - 213 - - - 131 - 199 - - - - - diff --git a/Code/Editor/SurfaceTypeValidator.cpp b/Code/Editor/SurfaceTypeValidator.cpp deleted file mode 100644 index 9f246cd453..0000000000 --- a/Code/Editor/SurfaceTypeValidator.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#include "EditorDefs.h" - -#include "SurfaceTypeValidator.h" - -// Editor -#include "Include/IObjectManager.h" -#include "Objects/BaseObject.h" -#include "ErrorReport.h" - - -void CSurfaceTypeValidator::Validate() -{ -} - diff --git a/Code/Editor/SurfaceTypeValidator.h b/Code/Editor/SurfaceTypeValidator.h deleted file mode 100644 index 6b1a3fbed7..0000000000 --- a/Code/Editor/SurfaceTypeValidator.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#ifndef CRYINCLUDE_EDITOR_SURFACETYPEVALIDATOR_H -#define CRYINCLUDE_EDITOR_SURFACETYPEVALIDATOR_H -#pragma once - - - -class CSurfaceTypeValidator -{ -public: - void Validate(); - -private: -}; - -#endif // CRYINCLUDE_EDITOR_SURFACETYPEVALIDATOR_H diff --git a/Code/Editor/UndoViewPosition.cpp b/Code/Editor/UndoViewPosition.cpp deleted file mode 100644 index 1934d255d3..0000000000 --- a/Code/Editor/UndoViewPosition.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -// Description : Undo for Python function (PySetCurrentViewPosition) - - -#include "EditorDefs.h" - -#include "UndoViewPosition.h" - -// Editor -#include "ViewManager.h" - -CUndoViewPosition::CUndoViewPosition(const QString& pUndoDescription) -{ - m_undoDescription = pUndoDescription; - - CViewport* pRenderViewport = GetIEditor()->GetViewManager()->GetGameViewport(); - if (pRenderViewport) - { - Matrix34 tm = pRenderViewport->GetViewTM(); - m_undo = tm.GetTranslation(); - } -} - -int CUndoViewPosition::GetSize() -{ - return sizeof(*this); -} - -QString CUndoViewPosition::GetDescription() -{ - return m_undoDescription; -} - -void CUndoViewPosition::Undo(bool bUndo) -{ - CViewport* pRenderViewport = GetIEditor()->GetViewManager()->GetGameViewport(); - if (pRenderViewport) - { - Matrix34 tm = pRenderViewport->GetViewTM(); - if (bUndo) - { - m_redo = tm.GetTranslation(); - } - - tm.SetTranslation(m_undo); - pRenderViewport->SetViewTM(tm); - } -} - -void CUndoViewPosition::Redo() -{ - CViewport* pRenderViewport = GetIEditor()->GetViewManager()->GetGameViewport(); - if (pRenderViewport) - { - Matrix34 tm = pRenderViewport->GetViewTM(); - tm.SetTranslation(m_redo); - pRenderViewport->SetViewTM(tm); - } -} diff --git a/Code/Editor/UndoViewPosition.h b/Code/Editor/UndoViewPosition.h deleted file mode 100644 index e0c6c145e8..0000000000 --- a/Code/Editor/UndoViewPosition.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -// Description : Undo for Python function (PySetCurrentViewPosition) - -#ifndef CRYINCLUDE_EDITOR_UNDOVIEWPOSITION_H -#define CRYINCLUDE_EDITOR_UNDOVIEWPOSITION_H -#pragma once - -#include "Undo/IUndoObject.h" - -class CUndoViewPosition - : public IUndoObject -{ -public: - CUndoViewPosition(const QString& pUndoDescription = "Set Current View Position"); - -protected: - int GetSize(); - QString GetDescription(); - void Undo(bool bUndo); - void Redo(); - -private: - Vec3 m_undo; - Vec3 m_redo; - QString m_undoDescription; -}; - -#endif // CRYINCLUDE_EDITOR_UNDOVIEWPOSITION_H diff --git a/Code/Editor/UndoViewRotation.cpp b/Code/Editor/UndoViewRotation.cpp deleted file mode 100644 index a305641d3b..0000000000 --- a/Code/Editor/UndoViewRotation.cpp +++ /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 - * - */ - - -// Description : Undo for Python function (PySetCurrentViewPosition) - - -#include "EditorDefs.h" - -#include "UndoViewRotation.h" - -// Editor -#include "ViewManager.h" - -#include -#include -#include -#include - -Ang3 CUndoViewRotation::GetActiveCameraRotation() -{ - AZ::Transform activeCameraTm = AZ::Transform::CreateIdentity(); - Camera::ActiveCameraRequestBus::BroadcastResult( - activeCameraTm, - &Camera::ActiveCameraRequestBus::Events::GetActiveCameraTransform - ); - const AZ::Matrix3x4 cameraMatrix = AZ::Matrix3x4::CreateFromTransform(activeCameraTm); - const Matrix33 cameraMatrixCry = AZMatrix3x3ToLYMatrix3x3(AZ::Matrix3x3::CreateFromMatrix3x4(cameraMatrix)); - return RAD2DEG(Ang3::GetAnglesXYZ(cameraMatrixCry)); -} - -CUndoViewRotation::CUndoViewRotation(const QString& pUndoDescription) -{ - m_undoDescription = pUndoDescription; - m_undo = GetActiveCameraRotation(); -} - -int CUndoViewRotation::GetSize() -{ - return sizeof(*this); -} - -QString CUndoViewRotation::GetDescription() -{ - return m_undoDescription; -} - -void CUndoViewRotation::Undo(bool bUndo) -{ - CViewport* pRenderViewport = GetIEditor()->GetViewManager()->GetGameViewport(); - if (pRenderViewport) - { - if (bUndo) - { - m_redo = GetActiveCameraRotation(); - } - - Matrix34 tm = pRenderViewport->GetViewTM(); - tm.SetRotationXYZ(Ang3(DEG2RAD(m_undo.x), DEG2RAD(m_undo.y), DEG2RAD(m_undo.z)), tm.GetTranslation()); - pRenderViewport->SetViewTM(tm); - } -} - -void CUndoViewRotation::Redo() -{ - CViewport* pRenderViewport = GetIEditor()->GetViewManager()->GetGameViewport(); - if (pRenderViewport) - { - Matrix34 tm = pRenderViewport->GetViewTM(); - tm.SetRotationXYZ(Ang3(DEG2RAD(m_redo.x), DEG2RAD(m_redo.y), DEG2RAD(m_redo.z)), tm.GetTranslation()); - pRenderViewport->SetViewTM(tm); - } -} diff --git a/Code/Editor/UndoViewRotation.h b/Code/Editor/UndoViewRotation.h deleted file mode 100644 index 2e086a3f05..0000000000 --- a/Code/Editor/UndoViewRotation.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -// Description : Undo for Python function (PySetCurrentViewRotation) - - -#ifndef CRYINCLUDE_EDITOR_UNDOVIEWROTATION_H -#define CRYINCLUDE_EDITOR_UNDOVIEWROTATION_H -#pragma once -#include "Undo/IUndoObject.h" - - -class CUndoViewRotation - : public IUndoObject -{ -public: - CUndoViewRotation(const QString& pUndoDescription = "Set Current View Rotation"); - -protected: - int GetSize(); - QString GetDescription(); - void Undo(bool bUndo); - void Redo(); - -private: - static Ang3 GetActiveCameraRotation(); - - Ang3 m_undo; - Ang3 m_redo; - QString m_undoDescription; -}; - -#endif // CRYINCLUDE_EDITOR_UNDOVIEWROTATION_H diff --git a/Code/Editor/UserMessageDefines.h b/Code/Editor/UserMessageDefines.h deleted file mode 100644 index 0b13d2819f..0000000000 --- a/Code/Editor/UserMessageDefines.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#ifndef CRYINCLUDE_EDITOR_USERMESSAGEDEFINES_H -#define CRYINCLUDE_EDITOR_USERMESSAGEDEFINES_H -#pragma once - - -enum ESandboxUserMessages -{ - // InPlaceComboBox - WM_USER_ON_SELECTION_CANCEL = WM_USER + 1, - WM_USER_ON_SELECTION_OK, - WM_USER_ON_NEW_SELECTION, - WM_USER_ON_EDITCHANGE, - WM_USER_ON_OPENDROPDOWN, - WM_USER_ON_EDITKEYDOWN, - WM_USER_ON_EDITCLICK, - // ACListWnd - ENAC_UPDATE, - // EditWithButton - WM_USER_EDITWITHBUTTON_CLICKED, - // FillSliderCtrl - WMU_FS_CHANGED, - WMU_FS_LBUTTONDOWN, - WMU_FS_LBUTTONUP, - FLM_EDITTEXTCHANGED, - FLM_FILTERTEXTCHANGED, - // NumberCtrlEdit - WMU_LBUTTONDOWN, - WMU_LBUTTONUP, - WM_ONWINDOWFOCUSCHANGES, - // SelectObjectDialog - IDT_TIMER_0, - IDT_TIMER_1, - // LensFlareEditor - WM_FLAREEDITOR_UPDATETREECONTROL, - // EquipPackDialog - UM_EQUIPLIST_CHECKSTATECHANGE, - // MaterialSender/MatEditMainDlg - WM_MATEDITPICK, - // GridMapWindow - WM_USER_ON_DBL_CLICK, - // LMCompDialog - WM_UPDATE_LIGHTMAP_GENERATION_PROGRESS, - WM_UPDATE_LIGHTMAP_GENERATION_MEMUSAGE, - WM_UPDATE_LIGHTMAP_GENERATION_MEMUSAGE_STATIC, - WM_UPDATE_GLM_NAME_EDIT, - // Viewport - WM_VIEWPORT_ON_TITLE_CHANGE, - // VisualLogControls - UWM_BUTTON_CLICKED, -}; -#endif // CRYINCLUDE_EDITOR_USERMESSAGEDEFINES_H diff --git a/Code/Editor/ViewPane.cpp b/Code/Editor/ViewPane.cpp index 421db8394e..e3494a4049 100644 --- a/Code/Editor/ViewPane.cpp +++ b/Code/Editor/ViewPane.cpp @@ -38,7 +38,6 @@ #include "Viewport.h" #include "LayoutConfigDialog.h" #include "TopRendererWnd.h" -#include "UserMessageDefines.h" #include "MainWindow.h" #include "QtViewPaneManager.h" #include "EditorViewportWidget.h" diff --git a/Code/Editor/WipFeatureManager.cpp b/Code/Editor/WipFeatureManager.cpp deleted file mode 100644 index 4fb9ed1d93..0000000000 --- a/Code/Editor/WipFeatureManager.cpp +++ /dev/null @@ -1,454 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#include "EditorDefs.h" - -#include "WipFeatureManager.h" - -#ifdef USE_WIP_FEATURES_MANAGER -#include "WipFeaturesDlg.h" - -#if defined(AZ_PLATFORM_WINDOWS) -const char* CWipFeatureManager::kWipFeaturesFilename = "@user@\\Editor\\UI\\WipFeatures.xml"; -#else -const char* CWipFeatureManager::kWipFeaturesFilename = "@user@/Editor/UI/WipFeatures.xml"; -#endif -CWipFeatureManager* CWipFeatureManager::s_pInstance = nullptr; - -static void WipFeatureVarChange(ICVar* pVar) -{ - QString strParams = pVar->GetString(); - QStringList params; - - SplitString(strParams, params, ' '); - - if (strParams == "edit") - { - static CWipFeaturesDlg dlg; - - dlg.show(); - - return; - } - - if (params.size() >= 2) - { - QString featName = params[0].trimmed(); - QString attr = params[1].trimmed(); - - if (featName.isEmpty()) - { - return; - } - - int id = featName.toInt(); - - // if all features - if (featName == "*") - { - if (attr == "enable") - { - CWipFeatureManager::Instance()->EnableAllFeatures(true); - } - else - if (attr == "disable") - { - CWipFeatureManager::Instance()->EnableAllFeatures(false); - } - else - if (attr == "hide") - { - CWipFeatureManager::Instance()->ShowAllFeatures(false); - } - else - if (attr == "show") - { - CWipFeatureManager::Instance()->ShowAllFeatures(true); - } - else - if (attr == "safemode") - { - CWipFeatureManager::Instance()->SetAllFeaturesSafeMode(true); - } - else - if (attr == "fullmode") - { - CWipFeatureManager::Instance()->SetAllFeaturesSafeMode(false); - } - else - { - CWipFeatureManager::Instance()->SetAllFeaturesParams(attr.toUtf8().data()); - } - - return; - } - - if (attr == "enable") - { - CWipFeatureManager::Instance()->EnableFeature(id, true); - } - else - if (attr == "disable") - { - CWipFeatureManager::Instance()->EnableFeature(id, false); - } - else - if (attr == "hide") - { - CWipFeatureManager::Instance()->ShowFeature(id, false); - } - else - if (attr == "show") - { - CWipFeatureManager::Instance()->ShowFeature(id, true); - } - else - if (attr == "safemode") - { - CWipFeatureManager::Instance()->SetFeatureSafeMode(id, true); - } - else - if (attr == "fullmode") - { - CWipFeatureManager::Instance()->SetFeatureSafeMode(id, false); - } - else - { - CWipFeatureManager::Instance()->SetFeatureParams(id, attr.toUtf8().data()); - } - } -} - -CWipFeatureManager::CWipFeatureManager() -{ - m_bEnabled = true; -} - -CWipFeatureManager::~CWipFeatureManager() -{ -} - -bool CWipFeatureManager::Init(bool bLoadXml) -{ - if (!gEnv) - { - return false; - } - - IConsole* pConsole = gEnv->pConsole; - - if (!pConsole) - { - return false; - } - - REGISTER_CVAR2_CB("e_wipfeature", (const char**)&CWipFeatureManager::Instance()->m_consoleCmdParams, "", VF_ALWAYSONCHANGE | VF_CHEAT, "wipfeature enable|disable|hide|show|safemode|fullmode", WipFeatureVarChange); - - if (bLoadXml) - { - CWipFeatureManager::Instance()->Load(); - } - - return true; -} - -void CWipFeatureManager::Shutdown() -{ - CWipFeatureManager::Instance()->Save(); - delete s_pInstance; - s_pInstance = nullptr; -} - -bool CWipFeatureManager::Load(const char* pFilename, bool bClearExisting) -{ - if (!GetISystem()) - { - return false; - } - - XmlNodeRef root = GetISystem()->LoadXmlFromFile(pFilename); - - if (!root) - { - return false; - } - - if (bClearExisting) - { - m_features.clear(); - } - - Log("Loading WIP features file: '%s'...", pFilename); - - for (size_t i = 0, iCount = root->getChildCount(); i < iCount; ++i) - { - SWipFeatureInfo wf; - XmlNodeRef node = root->getChild(static_cast(i)); - XmlString str; - - node->getAttr("id", wf.m_id); - node->getAttr("displayName", str); - wf.m_displayName = str; - node->getAttr("visible", wf.m_bVisible); - node->getAttr("enabled", wf.m_bEnabled); - node->getAttr("safeMode", wf.m_bSafeMode); - node->getAttr("params", str); - wf.m_params = str; - wf.m_bLoadedFromXml = true; - - TWipFeatures::iterator iter = m_features.find(wf.m_id); - - if (iter == m_features.end()) - { - m_features[wf.m_id] = wf; - } - else - { - m_features[wf.m_id].m_bVisible = wf.m_bVisible; - m_features[wf.m_id].m_bEnabled = wf.m_bEnabled; - m_features[wf.m_id].m_bSafeMode = wf.m_bSafeMode; - m_features[wf.m_id].m_params = wf.m_params; - } - } - - Log("Loaded %d WIP features.", m_features.size()); - - return true; -} - -bool CWipFeatureManager::Save(const char* pFilename) -{ - if (!gEnv) - { - return false; - } - - if (!GetISystem()) - { - return false; - } - - ISystem* pISystem = GetISystem(); - - XmlNodeRef root = pISystem->CreateXmlNode("features"); - - for (TWipFeatures::iterator iter = m_features.begin(), iterEnd = m_features.end(); iter != iterEnd; ++iter) - { - SWipFeatureInfo& wf = iter->second; - XmlNodeRef node = root->createNode("feature"); - - node->setAttr("id", wf.m_id); - node->setAttr("displayName", wf.m_displayName.c_str()); - node->setAttr("visible", wf.m_bVisible); - node->setAttr("enabled", wf.m_bEnabled); - node->setAttr("safeMode", wf.m_bSafeMode); - node->setAttr("params", wf.m_params.c_str()); - - root->addChild(node); - } - - root->saveToFile(pFilename); - - return true; -} - -int CWipFeatureManager::RegisterFeature(const char* pDisplayName, bool bVisible, bool bEnabled, bool bSafeMode, const char* pParams, bool bSaveToXml) -{ - int aMaxId = -1; - - for (TWipFeatures::iterator iter = m_features.begin(), iterEnd = m_features.end(); iter != iterEnd; ++iter) - { - if (iter->first > aMaxId) - { - aMaxId = iter->first; - } - } - - ++aMaxId; - SetFeature(aMaxId, pDisplayName, bVisible, bEnabled, bSafeMode, pParams, bSaveToXml); - - return aMaxId; -} - -void CWipFeatureManager::SetFeature(int aFeatureId, const char* pDisplayName, bool bVisible, bool bEnabled, bool bSafeMode, const char* pParams, bool bSaveToXml) -{ - m_features[aFeatureId].m_id = aFeatureId; - m_features[aFeatureId].m_displayName = pDisplayName; - m_features[aFeatureId].m_bVisible = bVisible; - m_features[aFeatureId].m_bEnabled = bEnabled; - m_features[aFeatureId].m_bSafeMode = bSafeMode; - m_features[aFeatureId].m_bSaveToXml = bSaveToXml; - m_features[aFeatureId].m_params = pParams; - - if (m_features[aFeatureId].m_pfnUpdateFeature) - { - m_features[aFeatureId].m_pfnUpdateFeature(aFeatureId, &bVisible, &bEnabled, &bSafeMode, pParams); - } -} - -void CWipFeatureManager::SetDefaultFeatureStates(int aFeatureId, const char* pDisplayName, bool bVisible, bool bEnabled, bool bSafeMode, const char* pParams) -{ - TWipFeatures::iterator iter = m_features.find(aFeatureId); - - // set feature if not existing - if (iter == m_features.end() || (iter != m_features.end() && !iter->second.m_bLoadedFromXml)) - { - m_features[aFeatureId].m_id = aFeatureId; - m_features[aFeatureId].m_displayName = pDisplayName; - m_features[aFeatureId].m_bVisible = bVisible; - m_features[aFeatureId].m_bEnabled = bEnabled; - m_features[aFeatureId].m_bSafeMode = bSafeMode; - m_features[aFeatureId].m_params = pParams; - } - else - if (iter != m_features.end() && iter->second.m_bLoadedFromXml) - { - m_features[aFeatureId].m_id = aFeatureId; - m_features[aFeatureId].m_displayName = pDisplayName; - } - - if (m_features[aFeatureId].m_pfnUpdateFeature) - { - m_features[aFeatureId].m_pfnUpdateFeature(aFeatureId, &bVisible, &bEnabled, &bSafeMode, pParams); - } -} - -bool CWipFeatureManager::IsFeatureVisible(int aFeatureId) -{ - return m_features[aFeatureId].m_bVisible || !m_bEnabled; -} - -bool CWipFeatureManager::IsFeatureEnabled(int aFeatureId) -{ - return m_features[aFeatureId].m_bEnabled || !m_bEnabled; -} - -bool CWipFeatureManager::IsFeatureInSafeMode(int aFeatureId) -{ - if (!m_bEnabled) - { - return false; - } - - return m_features[aFeatureId].m_bSafeMode; -} - -const char* CWipFeatureManager::GetFeatureParams(int aFeatureId) -{ - return m_features[aFeatureId].m_params.c_str(); -} - -void CWipFeatureManager::ShowFeature(int aFeatureId, bool bShow) -{ - m_features[aFeatureId].m_bVisible = bShow; - - if (m_features[aFeatureId].m_pfnUpdateFeature) - { - m_features[aFeatureId].m_pfnUpdateFeature(aFeatureId, &bShow, nullptr, nullptr, nullptr); - } -} - -void CWipFeatureManager::EnableFeature(int aFeatureId, bool bEnable) -{ - m_features[aFeatureId].m_bEnabled = bEnable; - - if (m_features[aFeatureId].m_pfnUpdateFeature) - { - m_features[aFeatureId].m_pfnUpdateFeature(aFeatureId, nullptr, &bEnable, nullptr, nullptr); - } -} - -void CWipFeatureManager::SetFeatureSafeMode(int aFeatureId, bool bSafeMode) -{ - m_features[aFeatureId].m_bSafeMode = bSafeMode; - - if (m_features[aFeatureId].m_pfnUpdateFeature) - { - m_features[aFeatureId].m_pfnUpdateFeature(aFeatureId, nullptr, nullptr, &bSafeMode, nullptr); - } -} - -void CWipFeatureManager::SetFeatureParams(int aFeatureId, const char* pParams) -{ - m_features[aFeatureId].m_params = pParams; - - if (m_features[aFeatureId].m_pfnUpdateFeature) - { - m_features[aFeatureId].m_pfnUpdateFeature(aFeatureId, nullptr, nullptr, nullptr, pParams); - } -} - -void CWipFeatureManager::ShowAllFeatures(bool bShow) -{ - for (TWipFeatures::iterator iter = m_features.begin(), iterEnd = m_features.end(); iter != iterEnd; ++iter) - { - iter->second.m_bVisible = bShow; - - if (iter->second.m_pfnUpdateFeature) - { - iter->second.m_pfnUpdateFeature(iter->first, &bShow, nullptr, nullptr, nullptr); - } - } -} - -void CWipFeatureManager::EnableAllFeatures(bool bEnable) -{ - for (TWipFeatures::iterator iter = m_features.begin(), iterEnd = m_features.end(); iter != iterEnd; ++iter) - { - iter->second.m_bEnabled = bEnable; - - if (iter->second.m_pfnUpdateFeature) - { - iter->second.m_pfnUpdateFeature(iter->first, nullptr, &bEnable, nullptr, nullptr); - } - } -} - -void CWipFeatureManager::SetAllFeaturesSafeMode(bool bSafeMode) -{ - for (TWipFeatures::iterator iter = m_features.begin(), iterEnd = m_features.end(); iter != iterEnd; ++iter) - { - iter->second.m_bSafeMode = bSafeMode; - - if (iter->second.m_pfnUpdateFeature) - { - iter->second.m_pfnUpdateFeature(iter->first, nullptr, nullptr, &bSafeMode, nullptr); - } - } -} - -void CWipFeatureManager::SetAllFeaturesParams(const char* pParams) -{ - for (TWipFeatures::iterator iter = m_features.begin(), iterEnd = m_features.end(); iter != iterEnd; ++iter) - { - iter->second.m_params = pParams; - - if (iter->second.m_pfnUpdateFeature) - { - iter->second.m_pfnUpdateFeature(iter->first, nullptr, nullptr, nullptr, pParams); - } - } -} - -void CWipFeatureManager::EnableManager(bool bEnable) -{ - m_bEnabled = bEnable; -} - -void CWipFeatureManager::SetFeatureUpdateCallback(int aFeatureId, TWipFeatureUpdateCallback pfnUpdate) -{ - m_features[aFeatureId].m_pfnUpdateFeature = pfnUpdate; -} - -AZStd::map& CWipFeatureManager::GetFeatures() -{ - return m_features; -} - -#endif diff --git a/Code/Editor/WipFeatureManager.h b/Code/Editor/WipFeatureManager.h deleted file mode 100644 index cd20f6d591..0000000000 --- a/Code/Editor/WipFeatureManager.h +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#ifndef CRYINCLUDE_EDITOR_WIPFEATUREMANAGER_H -#define CRYINCLUDE_EDITOR_WIPFEATUREMANAGER_H -#pragma once - -#include -#include - -/* - This class is used to control work in progress features at runtime, so QA can test even if the end user will not see those features - You can use the console command: e_wipfeature enable|disable|hide|show|safemode|fullmode - ****************************************************************************************************************************************** - *** GOOD TO KNOW: "e_wipfeature edit" console command will display the WIP dialog and you can control the features from there - ****************************************************************************************************************************************** -*/ - -// undef this define to spot all wip feature usages within the editor at compile time -#define USE_WIP_FEATURES_MANAGER - -#ifdef USE_WIP_FEATURES_MANAGER - -// use this to register new wip features, usage from inside functions -// @param id is the numeric unique id of the feature, its good to have all feature ids in an enum in one file -// @param bVisible is the feature visible by default -// @param bEnabled is the feature enabled (usually visual enable like non-grayed) by default -// @param bSafeMode is the feature operating in some sort of safe mode (the safe mode behavior defined by the feature itself) -// @param pTWipFeatureUpdateCallback callback of type TWipFeatureUpdateCallback for when a feature state (visible,enabled and so on) was modified -#define REGISTER_WIP_FEATURE(id, bVisible, bEnabled, bSafeMode, pTWipFeatureUpdateCallback) \ - static CWipFeatureManager::CWipFeatureRegisterer s_wipFeatureRegisterer_##id(id, ""#id, bVisible, bEnabled, bSafeMode, pTWipFeatureUpdateCallback); - -#define IS_WIP_FEATURE_VISIBLE(id) CWipFeatureManager::Instance()->IsFeatureVisible(id) -#define IS_WIP_FEATURE_ENABLED(id) CWipFeatureManager::Instance()->IsFeatureEnabled(id) -#define IS_WIP_FEATURE_SAFEMODE(id) CWipFeatureManager::Instance()->IsFeatureInSafeMode(id) - -// The feature manager singleton itself -class CWipFeatureManager -{ -public: - - static const char* kWipFeaturesFilename; - - // Used to register a callback function to update the state of features whitin the editor - // pbVisible, pbEnabled, pbSafeMode, pParams - if the pointer is nullptr, then that attribute was not changed - typedef void (* TWipFeatureUpdateCallback)(int aFeatureId, const bool* const pbVisible, const bool* const pbEnabled, const bool* const pbSafeMode, const char* pParams); - - // wip feature registerer auto create object, used for static auto feature creation with the REGISTER_WIP_FEATURE macro - class CWipFeatureRegisterer - { - public: - - CWipFeatureRegisterer(int id, const char* pDisplayName, bool bVisible, bool bEnabled, bool bSafeMode, TWipFeatureUpdateCallback pTWipFeatureUpdateCallback) - { - CWipFeatureManager::Instance()->SetFeatureUpdateCallback(id, pTWipFeatureUpdateCallback); - CWipFeatureManager::Instance()->SetDefaultFeatureStates(id, pDisplayName, bVisible, bEnabled, bSafeMode); - } - }; - - struct SWipFeatureInfo - { - SWipFeatureInfo() - : m_id(0) - , m_displayName("") - , m_bVisible(true) - , m_bEnabled(true) - , m_bSafeMode(false) - , m_pfnUpdateFeature(nullptr) - , m_bLoadedFromXml(false) - {} - - int m_id; - AZStd::string m_displayName, m_params; - bool m_bVisible, m_bEnabled, m_bSafeMode, - // if true, this feature will be saved into the xml file when Save(...) will be called - m_bSaveToXml, m_bLoadedFromXml; - TWipFeatureUpdateCallback m_pfnUpdateFeature; - }; - - typedef AZStd::map TWipFeatures; - -private: - - CWipFeatureManager(); - ~CWipFeatureManager(); - - static CWipFeatureManager* s_pInstance; - -public: - - static CWipFeatureManager* Instance() - { - if (!s_pInstance) - { - s_pInstance = new CWipFeatureManager(); - AZ_Assert(s_pInstance, "Could not construct CWipFeatureManager"); - } - - return s_pInstance; - } - - static bool Init(bool bLoadXml = true); - static void Shutdown(); - - bool Load(const char* pFilename = kWipFeaturesFilename, bool bClearExisting = true); - bool Save(const char* pFilename = kWipFeaturesFilename); - - // Register a new feature - // @return a new feature ID - int RegisterFeature(const char* pDisplayName, bool bVisible, bool bEnabled, bool bSafeMode, const char* pParams = "", bool bSaveToXml = true); - // Set an existing feature - void SetFeature(int aFeatureId, const char* pDisplayName, bool bVisible, bool bEnabled, bool bSafeMode, const char* pParams = "", bool bSaveToXml = true); - // Create a new feature, but it will take into account the existing feature info from the loaded XML file, with persistent settings, if any - void SetDefaultFeatureStates(int aFeatureId, const char* pDisplayName, bool bVisible, bool bEnabled, bool bSafeMode, const char* pParams = ""); - bool IsFeatureVisible(int aFeatureId); - bool IsFeatureEnabled(int aFeatureId); - bool IsFeatureInSafeMode(int aFeatureId); - const char* GetFeatureParams(int aFeatureId); - - void ShowFeature(int aFeatureId, bool bShow = true); - void EnableFeature(int aFeatureId, bool bEnable = true); - void SetFeatureSafeMode(int aFeatureId, bool bSafeMode); - void SetFeatureParams(int aFeatureId, const char* pParams); - - void ShowAllFeatures(bool bShow = true); - void EnableAllFeatures(bool bEnable = true); - void SetAllFeaturesSafeMode(bool bSafeMode); - void SetAllFeaturesParams(const char* pParams); - - // if manager is disabled, then all queries about feature enable/visible/fullmode states will return true always - void EnableManager(bool bEnable = true); - - void SetFeatureUpdateCallback(int aFeatureId, TWipFeatureUpdateCallback pfnUpdate); - TWipFeatures& GetFeatures(); - -private: - - static const int kMaxWipCmdSize = 200; - - TWipFeatures m_features; - char m_consoleCmdParams[kMaxWipCmdSize]; - bool m_bEnabled; -}; - -#else - -// -// no WIP feature manager in production build -// -#define REGISTER_WIP_FEATURE -#define IS_WIP_FEATURE_VISIBLE(id) true -#define IS_WIP_FEATURE_ENABLED(id) true -#define IS_WIP_FEATURE_SAFEMODE(id) true - -#endif //USE_WIP_FEATURES_MANAGER -#endif // CRYINCLUDE_EDITOR_WIPFEATUREMANAGER_H diff --git a/Code/Editor/WipFeaturesDlg.cpp b/Code/Editor/WipFeaturesDlg.cpp deleted file mode 100644 index bc4372d7fb..0000000000 --- a/Code/Editor/WipFeaturesDlg.cpp +++ /dev/null @@ -1,239 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#include "EditorDefs.h" - -#include "WipFeatureManager.h" - -#include "WipFeaturesDlg.h" - -// Qt -#include - -AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING -#include "ui_WipFeaturesDlg.h" -AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING - -#ifdef USE_WIP_FEATURES_MANAGER - -// CWipFeaturesDlg dialog - -class WipFeaturesModel - : public QAbstractTableModel -{ -public: - WipFeaturesModel(QObject* parent = nullptr) - : QAbstractTableModel(parent) - { - } - - int rowCount(const QModelIndex& parent = QModelIndex()) const override - { - return parent.isValid() ? 0 : static_cast(CWipFeatureManager::Instance()->GetFeatures().size()); - } - - int columnCount(const QModelIndex& parent = QModelIndex()) const override - { - return parent.isValid() ? 0 : 5; - } - - QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override - { - if (orientation != Qt::Horizontal || section >= columnCount()) - { - return QVariant(); - } - - - switch (role) - { - case Qt::TextAlignmentRole: - return section == 0 ? Qt::AlignLeft : Qt::AlignCenter; - case Qt::DisplayRole: - switch (section) - { - case 0: - return tr("Name"); - case 1: - return tr("Id"); - case 2: - return tr("Visible"); - case 3: - return tr("Enabled"); - case 4: - return tr("SafeMode"); - default: - return QVariant(); - } - default: - return QVariant(); - } - } - - bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override - { - if (!index.isValid() || index.column() >= columnCount(index.parent()) || index.row() >= rowCount(index.parent())) - { - return false; - } - - if (role != Qt::EditRole || !value.canConvert()) - { - return false; - } - - auto it = CWipFeatureManager::Instance()->GetFeatures().begin(); - std::advance(it, index.row()); - - auto id = it->first; - - switch (index.column()) - { - case 2: - CWipFeatureManager::Instance()->ShowFeature(id, value.toBool()); - break; - case 3: - CWipFeatureManager::Instance()->EnableFeature(id, value.toBool()); - break; - case 4: - CWipFeatureManager::Instance()->SetFeatureSafeMode(id, value.toBool()); - break; - default: - return false; - } - - emit dataChanged(index, index); - return true; - } - - QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override - { - if (!index.isValid() || index.column() >= columnCount(index.parent()) || index.row() >= rowCount(index.parent())) - { - return QVariant(); - } - - if (role == Qt::TextAlignmentRole) - { - return headerData(index.column(), Qt::Horizontal, role); - } - - if (role != Qt::DisplayRole) - { - return QVariant(); - } - - auto it = CWipFeatureManager::Instance()->GetFeatures().begin(); - std::advance(it, index.row()); - - auto feature = it->second; - - switch (index.column()) - { - case 0: - return QString(feature.m_displayName.c_str()); - case 1: - return feature.m_id; - case 2: - return feature.m_bVisible ? tr("X") : QString(); - case 3: - return feature.m_bEnabled ? tr("X") : QString(); - case 4: - return feature.m_bSafeMode ? tr("X") : QString(); - default: - return QVariant(); - } - } -}; - -CWipFeaturesDlg::CWipFeaturesDlg(QWidget* pParent /*=nullptr*/) - : QDialog(pParent) - , m_ui(new Ui::WipFeaturesDlg) -{ - m_ui->setupUi(this); - setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); - setFixedSize(size()); - - OnInitDialog(); - - connect(m_ui->buttonShow, &QPushButton::clicked, this, &CWipFeaturesDlg::OnBnClickedButtonShow); - connect(m_ui->buttonHide, &QPushButton::clicked, this, &CWipFeaturesDlg::OnBnClickedButtonHide); - connect(m_ui->buttonEnable, &QPushButton::clicked, this, &CWipFeaturesDlg::OnBnClickedButtonEnable); - connect(m_ui->buttonDisable, &QPushButton::clicked, this, &CWipFeaturesDlg::OnBnClickedButtonDisable); - connect(m_ui->buttonSafeMode, &QPushButton::clicked, this, &CWipFeaturesDlg::OnBnClickedButtonSafemode); - connect(m_ui->buttonNormalMode, &QPushButton::clicked, this, &CWipFeaturesDlg::OnBnClickedButtonNormalmode); -} - -CWipFeaturesDlg::~CWipFeaturesDlg() -{ -} - -// CWipFeaturesDlg message handlers - -void CWipFeaturesDlg::OnInitDialog() -{ - m_ui->m_lstFeatures->setModel(new WipFeaturesModel(this)); - m_ui->m_lstFeatures->horizontalHeader()->resizeSection(0, 300); - m_ui->m_lstFeatures->horizontalHeader()->resizeSection(1, 70); - m_ui->m_lstFeatures->horizontalHeader()->resizeSection(2, 70); - m_ui->m_lstFeatures->horizontalHeader()->resizeSection(3, 70); - m_ui->m_lstFeatures->horizontalHeader()->resizeSection(4, 70); -} - -void CWipFeaturesDlg::OnBnClickedButtonShow() -{ - for (auto index : m_ui->m_lstFeatures->selectionModel()->selectedRows()) - { - m_ui->m_lstFeatures->model()->setData(index.sibling(index.row(), 2), true); - } -} - -void CWipFeaturesDlg::OnBnClickedButtonHide() -{ - for (auto index : m_ui->m_lstFeatures->selectionModel()->selectedRows()) - { - m_ui->m_lstFeatures->model()->setData(index.sibling(index.row(), 2), false); - } -} - -void CWipFeaturesDlg::OnBnClickedButtonEnable() -{ - for (auto index : m_ui->m_lstFeatures->selectionModel()->selectedRows()) - { - m_ui->m_lstFeatures->model()->setData(index.sibling(index.row(), 3), true); - } -} - -void CWipFeaturesDlg::OnBnClickedButtonDisable() -{ - for (auto index : m_ui->m_lstFeatures->selectionModel()->selectedRows()) - { - m_ui->m_lstFeatures->model()->setData(index.sibling(index.row(), 3), false); - } -} - -void CWipFeaturesDlg::OnBnClickedButtonSafemode() -{ - for (auto index : m_ui->m_lstFeatures->selectionModel()->selectedRows()) - { - m_ui->m_lstFeatures->model()->setData(index.sibling(index.row(), 4), true); - } -} - -void CWipFeaturesDlg::OnBnClickedButtonNormalmode() -{ - for (auto index : m_ui->m_lstFeatures->selectionModel()->selectedRows()) - { - m_ui->m_lstFeatures->model()->setData(index.sibling(index.row(), 4), false); - } -} - -#include - -#endif // USE_WIP_FEATURES_MANAGER diff --git a/Code/Editor/WipFeaturesDlg.h b/Code/Editor/WipFeaturesDlg.h deleted file mode 100644 index 28f4f43958..0000000000 --- a/Code/Editor/WipFeaturesDlg.h +++ /dev/null @@ -1,58 +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 -#ifndef CRYINCLUDE_EDITOR_WIPFEATURESDLG_H -#define CRYINCLUDE_EDITOR_WIPFEATURESDLG_H - -#if !defined(Q_MOC_RUN) -#include -#endif - -#ifdef USE_WIP_FEATURES_MANAGER - -// CWipFeaturesDlg dialog - -namespace Ui -{ - class WipFeaturesDlg; -} - -class CWipFeaturesDlg - : public QDialog -{ - Q_OBJECT -public: - CWipFeaturesDlg(QWidget* pParent = nullptr); // standard constructor - virtual ~CWipFeaturesDlg(); - -private: - void OnInitDialog(); - void OnBnClickedButtonShow(); - void OnBnClickedButtonHide(); - void OnBnClickedButtonEnable(); - void OnBnClickedButtonDisable(); - void OnBnClickedButtonSafemode(); - void OnBnClickedButtonNormalmode(); - -private: - QScopedPointer m_ui; -}; - -#else - -class CWipFeaturesDlg - : public QDialog -{ - Q_OBJECT -}; - -#endif // USE_WIP_FEATURES_MANAGER - -#endif // CRYINCLUDE_EDITOR_WIPFEATURESDLG_H diff --git a/Code/Editor/WipFeaturesDlg.qrc b/Code/Editor/WipFeaturesDlg.qrc deleted file mode 100644 index 1205b1063e..0000000000 --- a/Code/Editor/WipFeaturesDlg.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - res/work_in_progress_icon.png - - diff --git a/Code/Editor/WipFeaturesDlg.ui b/Code/Editor/WipFeaturesDlg.ui deleted file mode 100644 index b4bf95e2c5..0000000000 --- a/Code/Editor/WipFeaturesDlg.ui +++ /dev/null @@ -1,184 +0,0 @@ - - - WipFeaturesDlg - - - - 0 - 0 - 620 - 342 - - - - Work in Progress Features - - - - - - Work in progress features: - - - - - - Qt::ScrollBarAlwaysOff - - - QAbstractItemView::SelectRows - - - true - - - false - - - 19 - - - - - - - Show - - - - - - - Hide - - - - - - - Qt::Horizontal - - - QSizePolicy::Ignored - - - - 74 - 20 - - - - - - - - Enable - - - - - - - Disable - - - - - - - Qt::Horizontal - - - QSizePolicy::Ignored - - - - 74 - 20 - - - - - - - - Normal Mode - - - - - - - Safe Mode - - - - - - - - - - - 64 - 64 - - - - - 64 - 64 - - - - :/res/work_in_progress_icon.png - - - - - - - - 0 - 0 - - - - NOTE:<br/>The states of the WIP features will be saved in the Editor/UI/WipFeatures.xml file when the editor exits successfuly - - - true - - - - - - - QDialogButtonBox::Close - - - - - - - - - - - buttonBox - rejected() - WipFeaturesDlg - close() - - - 647 - 339 - - - 674 - 314 - - - - - diff --git a/Code/Editor/arhitype_tree_00.png b/Code/Editor/arhitype_tree_00.png deleted file mode 100644 index 274b2b0667..0000000000 --- a/Code/Editor/arhitype_tree_00.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b9cc3783ba8ccc940e89039455f2a8617a67520400ce74c9ce4c3d16d942ead8 -size 208 diff --git a/Code/Editor/arhitype_tree_01.png b/Code/Editor/arhitype_tree_01.png deleted file mode 100644 index 274b2b0667..0000000000 --- a/Code/Editor/arhitype_tree_01.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b9cc3783ba8ccc940e89039455f2a8617a67520400ce74c9ce4c3d16d942ead8 -size 208 diff --git a/Code/Editor/arhitype_tree_02.png b/Code/Editor/arhitype_tree_02.png deleted file mode 100644 index f29a502de1..0000000000 --- a/Code/Editor/arhitype_tree_02.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1f8b26d30e8c00514648cf72bb80fe8be3f665eb7473b6565b31a4b078816bfd -size 208 diff --git a/Code/Editor/arhitype_tree_03.png b/Code/Editor/arhitype_tree_03.png deleted file mode 100644 index f29a502de1..0000000000 --- a/Code/Editor/arhitype_tree_03.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1f8b26d30e8c00514648cf72bb80fe8be3f665eb7473b6565b31a4b078816bfd -size 208 diff --git a/Code/Editor/bmp00005_00.png b/Code/Editor/bmp00005_00.png deleted file mode 100644 index 345abfaf01..0000000000 --- a/Code/Editor/bmp00005_00.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5e4a0284f8d3b2625c3f27d6505b19a0babb7af0825f08b4e08f40e647d10873 -size 388 diff --git a/Code/Editor/bmp00005_01.png b/Code/Editor/bmp00005_01.png deleted file mode 100644 index abeba83277..0000000000 --- a/Code/Editor/bmp00005_01.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:43f64ba8198c197f2dd91f00947df808fa41274411934d3d1f81e3eb44f78e7a -size 532 diff --git a/Code/Editor/bmp00005_02.png b/Code/Editor/bmp00005_02.png deleted file mode 100644 index 45439597e2..0000000000 --- a/Code/Editor/bmp00005_02.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:556929870bb8c26fe8ebf4e94536e74c2eb1084e6f566007ec3a5f2e6303fa53 -size 392 diff --git a/Code/Editor/bmp00005_03.png b/Code/Editor/bmp00005_03.png deleted file mode 100644 index b67ec062ff..0000000000 --- a/Code/Editor/bmp00005_03.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:239843fcd5a08e260106ee6eb3f69d3606321267e94df1e64ab25573d14980e1 -size 486 diff --git a/Code/Editor/bmp00005_04.png b/Code/Editor/bmp00005_04.png deleted file mode 100644 index 565730be66..0000000000 --- a/Code/Editor/bmp00005_04.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:98baf372c91fe63c423237a2a3ae5a043a4da41095698035ce86fd13f2051e44 -size 514 diff --git a/Code/Editor/bmp00005_05.png b/Code/Editor/bmp00005_05.png deleted file mode 100644 index 232c374515..0000000000 --- a/Code/Editor/bmp00005_05.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a570ae986b5f0b7e573094a7e75a8cfcc42f88b4766c47785bab26a9e8b1c2bb -size 239 diff --git a/Code/Editor/bmp00005_06.png b/Code/Editor/bmp00005_06.png deleted file mode 100644 index 3de6336a89..0000000000 --- a/Code/Editor/bmp00005_06.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4c527f2b8c883c73aebba0b5f0df6215f73b7259db61b13fa5ff7aa7b96a7b9b -size 779 diff --git a/Code/Editor/bmp00005_07.png b/Code/Editor/bmp00005_07.png deleted file mode 100644 index a813c0ad0b..0000000000 --- a/Code/Editor/bmp00005_07.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8f7f84cb48b2f9031b3a23abeddaed95d54601de33c58057d6677073b3e083aa -size 501 diff --git a/Code/Editor/bmp00005_08.png b/Code/Editor/bmp00005_08.png deleted file mode 100644 index b9f98ffe1c..0000000000 --- a/Code/Editor/bmp00005_08.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:804491b4251adfe017f8c52e00324dd74f00ebec445eedd947dea9356865cd56 -size 682 diff --git a/Code/Editor/bmp00005_09.png b/Code/Editor/bmp00005_09.png deleted file mode 100644 index 8650cc6a9e..0000000000 --- a/Code/Editor/bmp00005_09.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ecf6333b6b402e1834f3047b13e58e4f80e17a8eed3750017219b5694d1b6f67 -size 625 diff --git a/Code/Editor/bmp00006_00.png b/Code/Editor/bmp00006_00.png deleted file mode 100644 index c48f7ede09..0000000000 --- a/Code/Editor/bmp00006_00.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:70724fdada9cecd5a8d7ee5211ee713accc8f9642415e5dd93b6d621ed7273cf -size 139 diff --git a/Code/Editor/bmp00006_01.png b/Code/Editor/bmp00006_01.png deleted file mode 100644 index 7fb55bc8a5..0000000000 --- a/Code/Editor/bmp00006_01.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3d12de5789fb345c5ffe4b76246ec0ba4d7972fb14d15db3f36886f3beaed3ff -size 166 diff --git a/Code/Editor/bmp00006_02.png b/Code/Editor/bmp00006_02.png deleted file mode 100644 index 7b1ab690a3..0000000000 --- a/Code/Editor/bmp00006_02.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:fffdbe9b4e1630f4158c4a00985e713ddb6fae50bc71e8c100255bab04054c0a -size 235 diff --git a/Code/Editor/bmp00006_03.png b/Code/Editor/bmp00006_03.png deleted file mode 100644 index 4829767efd..0000000000 --- a/Code/Editor/bmp00006_03.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d5e4092107dbc45863abe1cbecb30c48135e17155b5a85afa07a4a90b3eb1221 -size 274 diff --git a/Code/Editor/bmp00006_04.png b/Code/Editor/bmp00006_04.png deleted file mode 100644 index dc809b8a65..0000000000 --- a/Code/Editor/bmp00006_04.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:bc454d6cf883b78ae4cc32bfe4a81a6d5ee64e5e1bade9f2069e7e1b405ad9b1 -size 373 diff --git a/Code/Editor/bmp00006_05.png b/Code/Editor/bmp00006_05.png deleted file mode 100644 index 2f3c67fff6..0000000000 --- a/Code/Editor/bmp00006_05.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:359236f395259b21b75f8f3fa250dfeea9ef82b9d541c7344954cf93db5c9d47 -size 616 diff --git a/Code/Editor/bmp00006_06.png b/Code/Editor/bmp00006_06.png deleted file mode 100644 index 86c43264ea..0000000000 --- a/Code/Editor/bmp00006_06.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:bc8e5dd88bb78f4f63ba8618e2bf0c1fd74d2dbdcf48261cfa57883c476619fe -size 1101 diff --git a/Code/Editor/bmp00006_07.png b/Code/Editor/bmp00006_07.png deleted file mode 100644 index 067b20a5fb..0000000000 --- a/Code/Editor/bmp00006_07.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1fbfb749ecfec92f461979d15642dfb940cc7895db3d27c47d040b0a7e2a1ae4 -size 1288 diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index 345a8e15e1..5d45bbd853 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -347,7 +347,6 @@ set(FILES MainStatusBar.cpp MainStatusBar.h MainStatusBarItems.h - CrtDebug.cpp CryEdit.rc CryEditDoc.cpp CryEditDoc.h @@ -358,7 +357,6 @@ set(FILES LogFile.cpp LogFile.h Resource.h - UserMessageDefines.h ActionManager.cpp ActionManager.h ShortcutDispatcher.cpp @@ -397,9 +395,6 @@ set(FILES ResizeResolutionDialog.cpp ResizeResolutionDialog.h ResizeResolutionDialog.ui - SelectEAXPresetDlg.cpp - SelectEAXPresetDlg.h - SelectEAXPresetDlg.ui SelectLightAnimationDialog.cpp SelectLightAnimationDialog.h SelectSequenceDialog.cpp @@ -421,9 +416,6 @@ set(FILES IconListDialog.ui UndoDropDown.cpp UndoDropDown.h - DimensionsDialog.cpp - DimensionsDialog.h - DimensionsDialog.ui NewLevelDialog.cpp NewLevelDialog.h NewLevelDialog.ui @@ -456,12 +448,7 @@ set(FILES ToolBox.h TrackViewNewSequenceDialog.h UndoConfigSpec.h - UndoViewPosition.h - UndoViewRotation.h Util/GeometryUtil.h - WipFeaturesDlg.h - WipFeaturesDlg.ui - WipFeaturesDlg.qrc LevelIndependentFileMan.cpp LevelIndependentFileMan.h LogFileImpl.cpp @@ -550,11 +537,6 @@ set(FILES TrackViewNewSequenceDialog.cpp TrackViewNewSequenceDialog.ui UndoConfigSpec.cpp - UndoViewPosition.cpp - UndoViewRotation.cpp - WipFeatureManager.cpp - WipFeatureManager.h - WipFeaturesDlg.cpp Dialogs/ErrorsDlg.cpp Dialogs/ErrorsDlg.h Dialogs/ErrorsDlg.ui @@ -571,8 +553,6 @@ set(FILES ProcessInfo.cpp ProcessInfo.h Report.h - SurfaceTypeValidator.cpp - SurfaceTypeValidator.h TrackView/AtomOutputFrameCapture.cpp TrackView/AtomOutputFrameCapture.h TrackView/TrackViewDialog.qrc diff --git a/Code/Editor/particles_tree_00.png b/Code/Editor/particles_tree_00.png deleted file mode 100644 index 274b2b0667..0000000000 --- a/Code/Editor/particles_tree_00.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b9cc3783ba8ccc940e89039455f2a8617a67520400ce74c9ce4c3d16d942ead8 -size 208 diff --git a/Code/Editor/particles_tree_01.png b/Code/Editor/particles_tree_01.png deleted file mode 100644 index 274b2b0667..0000000000 --- a/Code/Editor/particles_tree_01.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b9cc3783ba8ccc940e89039455f2a8617a67520400ce74c9ce4c3d16d942ead8 -size 208 diff --git a/Code/Editor/particles_tree_02.png b/Code/Editor/particles_tree_02.png deleted file mode 100644 index 96f4bec585..0000000000 --- a/Code/Editor/particles_tree_02.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:19b1ee36ba28ede080ef34bd13d37a8b579ad8e106089cd1b800b15aef1b58df -size 252 diff --git a/Code/Editor/particles_tree_03.png b/Code/Editor/particles_tree_03.png deleted file mode 100644 index 3ead10b3b4..0000000000 --- a/Code/Editor/particles_tree_03.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9e6ef5e26d5d1566f51824c3bfa0ed3d2653cb49e38111aaf0572590b2fd15be -size 261 diff --git a/Code/Editor/particles_tree_04.png b/Code/Editor/particles_tree_04.png deleted file mode 100644 index 0920a2667d..0000000000 --- a/Code/Editor/particles_tree_04.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:acbeaa97474bd203ac35bf87fdea49d8b3d60f18db62d64dd47c3b1b50e54816 -size 303 diff --git a/Code/Editor/particles_tree_05.png b/Code/Editor/particles_tree_05.png deleted file mode 100644 index 0a4ce61ba0..0000000000 --- a/Code/Editor/particles_tree_05.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d92fc6ec4afc582ff5d019f5b26c48e3dbe6c5f3c753271d7918cd5ca95b8b32 -size 254 diff --git a/Code/Editor/particles_tree_06.png b/Code/Editor/particles_tree_06.png deleted file mode 100644 index e0ab042cb3..0000000000 --- a/Code/Editor/particles_tree_06.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:02066aed1d53c3ffc53c0f844a88ba8870b6c2c9c846c47ef6443c21ce4b7d0c -size 224 diff --git a/Code/Editor/particles_tree_07.png b/Code/Editor/particles_tree_07.png deleted file mode 100644 index 2ab767a7e9..0000000000 --- a/Code/Editor/particles_tree_07.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:67668cc830b553605d2f9ccad57f2fcd422da6a7515cfc4e9af0f43aa8591543 -size 213 diff --git a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Mesh/MeshFeatureProcessor.h b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Mesh/MeshFeatureProcessor.h index 23cd76ca20..92e9c1e88a 100644 --- a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Mesh/MeshFeatureProcessor.h +++ b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Mesh/MeshFeatureProcessor.h @@ -176,6 +176,7 @@ namespace AZ void SetExcludeFromReflectionCubeMaps(const MeshHandle& meshHandle, bool excludeFromReflectionCubeMaps) override; void SetRayTracingEnabled(const MeshHandle& meshHandle, bool rayTracingEnabled) override; + bool GetRayTracingEnabled(const MeshHandle& meshHandle) const override; void SetVisible(const MeshHandle& meshHandle, bool visible) override; void SetUseForwardPassIblSpecular(const MeshHandle& meshHandle, bool useForwardPassIblSpecular) override; diff --git a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Mesh/MeshFeatureProcessorInterface.h b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Mesh/MeshFeatureProcessorInterface.h index 356b1936ca..f616c06e92 100644 --- a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Mesh/MeshFeatureProcessorInterface.h +++ b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Mesh/MeshFeatureProcessorInterface.h @@ -105,6 +105,8 @@ namespace AZ virtual void SetExcludeFromReflectionCubeMaps(const MeshHandle& meshHandle, bool excludeFromReflectionCubeMaps) = 0; //! Sets the option to exclude this mesh from raytracing virtual void SetRayTracingEnabled(const MeshHandle& meshHandle, bool rayTracingEnabled) = 0; + //! Gets whether this mesh is excluded from raytracing + virtual bool GetRayTracingEnabled(const MeshHandle& meshHandle) const = 0; //! Sets the mesh as visible or hidden. When the mesh is hidden it will not be rendered by the feature processor. virtual void SetVisible(const MeshHandle& meshHandle, bool visible) = 0; //! Sets the mesh to render IBL specular in the forward pass. diff --git a/Gems/Atom/Feature/Common/Code/Mocks/MockMeshFeatureProcessor.h b/Gems/Atom/Feature/Common/Code/Mocks/MockMeshFeatureProcessor.h index 2c818d3c9b..af1e23aa19 100644 --- a/Gems/Atom/Feature/Common/Code/Mocks/MockMeshFeatureProcessor.h +++ b/Gems/Atom/Feature/Common/Code/Mocks/MockMeshFeatureProcessor.h @@ -38,6 +38,7 @@ namespace UnitTest MOCK_METHOD2(AcquireMesh, MeshHandle (const AZ::Render::MeshHandleDescriptor&, const AZ::Render::MaterialAssignmentMap&)); MOCK_METHOD2(AcquireMesh, MeshHandle (const AZ::Render::MeshHandleDescriptor&, const AZ::Data::Instance&)); MOCK_METHOD2(SetRayTracingEnabled, void (const MeshHandle&, bool)); + MOCK_CONST_METHOD1(GetRayTracingEnabled, bool(const MeshHandle&)); MOCK_METHOD2(SetVisible, void (const MeshHandle&, bool)); MOCK_METHOD2(SetUseForwardPassIblSpecular, void (const MeshHandle&, bool)); }; diff --git a/Gems/Atom/Feature/Common/Code/Source/Mesh/MeshFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/Mesh/MeshFeatureProcessor.cpp index dfb2b3fe6b..6b9a3fc698 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Mesh/MeshFeatureProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/Mesh/MeshFeatureProcessor.cpp @@ -435,6 +435,19 @@ namespace AZ } } + bool MeshFeatureProcessor::GetRayTracingEnabled(const MeshHandle& meshHandle) const + { + if (meshHandle.IsValid()) + { + return meshHandle->m_descriptor.m_isRayTracingEnabled; + } + else + { + AZ_Assert(false, "Invalid mesh handle"); + return false; + } + } + void MeshFeatureProcessor::SetVisible(const MeshHandle& meshHandle, bool visible) { if (meshHandle.IsValid()) diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Application/AtomToolsApplication.h b/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Application/AtomToolsApplication.h index 9eaacbfa4f..06a9f65ec1 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Application/AtomToolsApplication.h +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Application/AtomToolsApplication.h @@ -16,7 +16,6 @@ #include #include -#include #include #include @@ -34,7 +33,6 @@ namespace AtomToolsFramework : public AzFramework::Application , public AzQtComponents::AzQtApplication , protected AzToolsFramework::AssetDatabase::AssetDatabaseRequestsBus::Handler - , protected AzFramework::AssetSystemStatusBus::Handler , protected AzToolsFramework::EditorPythonConsoleNotificationBus::Handler , protected AZ::UserSettingsOwnerRequestBus::Handler , protected AtomToolsMainWindowNotificationBus::Handler @@ -77,11 +75,6 @@ namespace AtomToolsFramework void Destroy() override; ////////////////////////////////////////////////////////////////////////// - ////////////////////////////////////////////////////////////////////////// - // AzFramework::AssetSystemStatusBus::Handler overrides... - void AssetSystemAvailable() override; - ////////////////////////////////////////////////////////////////////////// - ////////////////////////////////////////////////////////////////////////// // AZ::ComponentApplication overrides... void QueryApplicationType(AZ::ApplicationTypeQuery& appType) const override; @@ -107,10 +100,12 @@ namespace AtomToolsFramework virtual void LoadSettings(); virtual void UnloadSettings(); + virtual void ConnectToAssetProcessor(); virtual void CompileCriticalAssets(); virtual void ProcessCommandLine(const AZ::CommandLine& commandLine); static void PyIdleWaitFrames(uint32_t frames); + static void PyExit(); AzToolsFramework::TraceLogger m_traceLogger; diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Document/AtomToolsDocumentSystemRequestBus.h b/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Document/AtomToolsDocumentSystemRequestBus.h index f751915a9a..b12cf5e580 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Document/AtomToolsDocumentSystemRequestBus.h +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Document/AtomToolsDocumentSystemRequestBus.h @@ -71,6 +71,9 @@ namespace AtomToolsFramework //! Save all documents virtual bool SaveAllDocuments() = 0; + + //! Get number of allocated documents + virtual AZ::u32 GetDocumentCount() const = 0; }; using AtomToolsDocumentSystemRequestBus = AZ::EBus; diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Application/AtomToolsApplication.cpp b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Application/AtomToolsApplication.cpp index 02248fffd4..51e8bc4dda 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Application/AtomToolsApplication.cpp +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Application/AtomToolsApplication.cpp @@ -130,10 +130,13 @@ namespace AtomToolsFramework ->Attribute(AZ::Script::Attributes::Category, "Editor") ->Attribute(AZ::Script::Attributes::Module, "atomtools.general"); }; - // The reflection here is based on patterns in CryEditPythonHandler::Reflect + addGeneral(behaviorContext->Method( "idle_wait_frames", &AtomToolsApplication::PyIdleWaitFrames, nullptr, "Waits idling for a frames. Primarily used for auto-testing.")); + addGeneral(behaviorContext->Method( + "exit", &AtomToolsApplication::PyExit, nullptr, + "Exit application. Primarily used for auto-testing.")); } } @@ -171,7 +174,6 @@ namespace AtomToolsFramework void AtomToolsApplication::StartCommon(AZ::Entity* systemEntity) { - AzFramework::AssetSystemStatusBus::Handler::BusConnect(); AzToolsFramework::EditorPythonConsoleNotificationBus::Handler::BusConnect(); Base::StartCommon(systemEntity); @@ -179,6 +181,8 @@ namespace AtomToolsFramework const bool clearLogFile = GetSettingOrDefault("/O3DE/AtomToolsFramework/Application/ClearLogOnStart", false); m_traceLogger.OpenLogFile(GetBuildTargetName() + ".log", clearLogFile); + ConnectToAssetProcessor(); + AzToolsFramework::AssetDatabase::AssetDatabaseRequestsBus::Handler::BusConnect(); AzToolsFramework::AssetBrowser::AssetDatabaseLocationNotificationBus::Broadcast( &AzToolsFramework::AssetBrowser::AssetDatabaseLocationNotifications::OnDatabaseInitialized); @@ -236,7 +240,7 @@ namespace AtomToolsFramework return AZStd::vector({}); } - void AtomToolsApplication::AssetSystemAvailable() + void AtomToolsApplication::ConnectToAssetProcessor() { bool connectedToAssetProcessor = false; @@ -245,18 +249,19 @@ namespace AtomToolsFramework // and able to negotiate a connection when running a debug build // and to negotiate a connection - auto targetName = GetBuildTargetName(); + const auto targetName = GetBuildTargetName(); AzFramework::AssetSystem::ConnectionSettings connectionSettings; AzFramework::AssetSystem::ReadConnectionSettingsFromSettingsRegistry(connectionSettings); connectionSettings.m_connectionDirection = AzFramework::AssetSystem::ConnectionSettings::ConnectionDirection::ConnectToAssetProcessor; - connectionSettings.m_connectionIdentifier = GetBuildTargetName(); + connectionSettings.m_connectionIdentifier = targetName; connectionSettings.m_loggingCallback = [targetName]([[maybe_unused]] AZStd::string_view logData) { AZ_UNUSED(targetName); // Prevent unused warning in release builds AZ_TracePrintf(targetName.c_str(), "%.*s", aznumeric_cast(logData.size()), logData.data()); }; + AzFramework::AssetSystemRequestBus::BroadcastResult( connectedToAssetProcessor, &AzFramework::AssetSystemRequestBus::Events::EstablishAssetProcessorConnection, connectionSettings); @@ -264,8 +269,6 @@ namespace AtomToolsFramework { CompileCriticalAssets(); } - - AzFramework::AssetSystemStatusBus::Handler::BusDisconnect(); } void AtomToolsApplication::CompileCriticalAssets() @@ -302,6 +305,7 @@ namespace AtomToolsFramework } AZ::ComponentApplicationLifecycle::SignalEvent(*m_settingsRegistry, "CriticalAssetsCompiled", R"({})"); + // Reload the assetcatalog.xml at this point again // Start Monitoring Asset changes over the network and load the AssetCatalog auto LoadCatalog = [settingsRegistry = m_settingsRegistry.get()](AZ::Data::AssetCatalogRequests* assetCatalogRequests) @@ -564,4 +568,9 @@ namespace AtomToolsFramework Ticker ticker(&loop, frames); loop.exec(); } + + void AtomToolsApplication::PyExit() + { + AzFramework::ApplicationRequests::Bus::Broadcast(&AzFramework::ApplicationRequests::ExitMainLoop); + } } // namespace AtomToolsFramework diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Document/AtomToolsDocumentSystemComponent.cpp b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Document/AtomToolsDocumentSystemComponent.cpp index 3b27c9cd0f..d554c68451 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Document/AtomToolsDocumentSystemComponent.cpp +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Document/AtomToolsDocumentSystemComponent.cpp @@ -69,6 +69,7 @@ namespace AtomToolsFramework ->Event("SaveDocumentAsCopy", &AtomToolsDocumentSystemRequestBus::Events::SaveDocumentAsCopy) ->Event("SaveDocumentAsChild", &AtomToolsDocumentSystemRequestBus::Events::SaveDocumentAsChild) ->Event("SaveAllDocuments", &AtomToolsDocumentSystemRequestBus::Events::SaveAllDocuments) + ->Event("GetDocumentCount", &AtomToolsDocumentSystemRequestBus::Events::GetDocumentCount) ; behaviorContext->EBus("AtomToolsDocumentRequestBus") @@ -457,6 +458,11 @@ namespace AtomToolsFramework return result; } + AZ::u32 AtomToolsDocumentSystemComponent::GetDocumentCount() const + { + return aznumeric_cast(m_documentMap.size()); + } + AZ::Uuid AtomToolsDocumentSystemComponent::OpenDocumentImpl(AZStd::string_view sourcePath, bool checkIfAlreadyOpen) { AZStd::string requestedPath = sourcePath; diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Document/AtomToolsDocumentSystemComponent.h b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Document/AtomToolsDocumentSystemComponent.h index 532271974c..58470e3582 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Document/AtomToolsDocumentSystemComponent.h +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Document/AtomToolsDocumentSystemComponent.h @@ -74,6 +74,7 @@ namespace AtomToolsFramework bool SaveDocumentAsCopy(const AZ::Uuid& documentId, AZStd::string_view targetPath) override; bool SaveDocumentAsChild(const AZ::Uuid& documentId, AZStd::string_view targetPath) override; bool SaveAllDocuments() override; + AZ::u32 GetDocumentCount() const override; //////////////////////////////////////////////////////////////////////// AZ::Uuid OpenDocumentImpl(AZStd::string_view sourcePath, bool checkIfAlreadyOpen); diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/Mesh/MeshComponentBus.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/Mesh/MeshComponentBus.h index cc9c78d356..989cbcffb2 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/Mesh/MeshComponentBus.h +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/Mesh/MeshComponentBus.h @@ -51,6 +51,9 @@ namespace AZ virtual void SetVisibility(bool visible) = 0; virtual bool GetVisibility() const = 0; + virtual void SetRayTracingEnabled(bool enabled) = 0; + virtual bool GetRayTracingEnabled() const = 0; + virtual AZ::Aabb GetWorldBounds() = 0; virtual AZ::Aabb GetLocalBounds() = 0; diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/EditorMeshComponent.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/EditorMeshComponent.cpp index c89546264a..5c8d2d6116 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/EditorMeshComponent.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/EditorMeshComponent.cpp @@ -79,6 +79,9 @@ namespace AZ ->DataElement(AZ::Edit::UIHandlers::CheckBox, &MeshComponentConfig::m_useForwardPassIblSpecular, "Use Forward Pass IBL Specular", "Renders IBL specular reflections in the forward pass, using only the most influential probe (based on the position of the entity) and the global IBL cubemap. Can reduce rendering costs, but only recommended for static objects that are affected by at most one reflection probe.") ->Attribute(AZ::Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) + ->DataElement(AZ::Edit::UIHandlers::CheckBox, &MeshComponentConfig::m_isRayTracingEnabled, "Use ray tracing", + "Includes this mesh in ray tracing calculations.") + ->Attribute(AZ::Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) ->DataElement(AZ::Edit::UIHandlers::ComboBox, &MeshComponentConfig::m_lodType, "Lod Type", "Lod Method.") ->EnumAttribute(RPI::Cullable::LodType::Default, "Default") ->EnumAttribute(RPI::Cullable::LodType::ScreenCoverage, "Screen Coverage") diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.cpp index 517ba90f89..a68ad24adf 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.cpp @@ -76,6 +76,7 @@ namespace AZ ->Field("SortKey", &MeshComponentConfig::m_sortKey) ->Field("ExcludeFromReflectionCubeMaps", &MeshComponentConfig::m_excludeFromReflectionCubeMaps) ->Field("UseForwardPassIBLSpecular", &MeshComponentConfig::m_useForwardPassIblSpecular) + ->Field("IsRayTracingEnabled", &MeshComponentConfig::m_isRayTracingEnabled) ->Field("LodType", &MeshComponentConfig::m_lodType) ->Field("LodOverride", &MeshComponentConfig::m_lodOverride) ->Field("MinimumScreenCoverage", &MeshComponentConfig::m_minimumScreenCoverage) @@ -181,6 +182,8 @@ namespace AZ ->Event("GetMinimumScreenCoverage", &MeshComponentRequestBus::Events::GetMinimumScreenCoverage) ->Event("SetQualityDecayRate", &MeshComponentRequestBus::Events::SetQualityDecayRate) ->Event("GetQualityDecayRate", &MeshComponentRequestBus::Events::GetQualityDecayRate) + ->Event("SetRayTracingEnabled", &MeshComponentRequestBus::Events::SetRayTracingEnabled) + ->Event("GetRayTracingEnabled", &MeshComponentRequestBus::Events::GetRayTracingEnabled) ->VirtualProperty("ModelAssetId", "GetModelAssetId", "SetModelAssetId") ->VirtualProperty("ModelAssetPath", "GetModelAssetPath", "SetModelAssetPath") ->VirtualProperty("SortKey", "GetSortKey", "SetSortKey") @@ -188,6 +191,7 @@ namespace AZ ->VirtualProperty("LodOverride", "GetLodOverride", "SetLodOverride") ->VirtualProperty("MinimumScreenCoverage", "GetMinimumScreenCoverage", "SetMinimumScreenCoverage") ->VirtualProperty("QualityDecayRate", "GetQualityDecayRate", "SetQualityDecayRate") + ->VirtualProperty("RayTracingEnabled", "GetRayTracingEnabled", "SetRayTracingEnabled") ; behaviorContext->EBus("MeshComponentNotificationBus") @@ -382,6 +386,7 @@ namespace AZ meshDescriptor.m_modelAsset = m_configuration.m_modelAsset; meshDescriptor.m_useForwardPassIblSpecular = m_configuration.m_useForwardPassIblSpecular; meshDescriptor.m_requiresCloneCallback = RequiresCloning; + meshDescriptor.m_isRayTracingEnabled = m_configuration.m_isRayTracingEnabled; m_meshHandle = m_meshFeatureProcessor->AcquireMesh(meshDescriptor, materials); m_meshFeatureProcessor->ConnectModelChangeEventHandler(m_meshHandle, m_changeEventHandler); @@ -392,7 +397,7 @@ namespace AZ m_meshFeatureProcessor->SetMeshLodConfiguration(m_meshHandle, GetMeshLodConfiguration()); m_meshFeatureProcessor->SetExcludeFromReflectionCubeMaps(m_meshHandle, m_configuration.m_excludeFromReflectionCubeMaps); m_meshFeatureProcessor->SetVisible(m_meshHandle, m_isVisible); - + m_meshFeatureProcessor->SetRayTracingEnabled(m_meshHandle, meshDescriptor.m_isRayTracingEnabled); // [GFX TODO] This should happen automatically. m_changeEventHandler should be passed to AcquireMesh // If the model instance or asset already exists, announce a model change to let others know it's loaded. HandleModelChange(m_meshFeatureProcessor->GetModel(m_meshHandle)); @@ -559,6 +564,25 @@ namespace AZ return m_isVisible; } + void MeshComponentController::SetRayTracingEnabled(bool enabled) + { + if (m_meshHandle.IsValid() && m_meshFeatureProcessor) + { + m_meshFeatureProcessor->SetRayTracingEnabled(m_meshHandle, enabled); + m_configuration.m_isRayTracingEnabled = enabled; + } + } + + bool MeshComponentController::GetRayTracingEnabled() const + { + if (m_meshHandle.IsValid() && m_meshFeatureProcessor) + { + return m_meshFeatureProcessor->GetRayTracingEnabled(m_meshHandle); + } + + return false; + } + Aabb MeshComponentController::GetWorldBounds() { if (const AZ::Aabb localBounds = GetLocalBounds(); localBounds.IsValid()) diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.h index 6b0731fbf7..76cf6a1b39 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.h +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.h @@ -50,7 +50,7 @@ namespace AZ RHI::DrawItemSortKey m_sortKey = 0; bool m_excludeFromReflectionCubeMaps = false; bool m_useForwardPassIblSpecular = false; - + bool m_isRayTracingEnabled = true; RPI::Cullable::LodType m_lodType = RPI::Cullable::LodType::Default; RPI::Cullable::LodOverride m_lodOverride = aznumeric_cast(0); float m_minimumScreenCoverage = 1.0f / 1080.0f; @@ -116,6 +116,9 @@ namespace AZ void SetVisibility(bool visible) override; bool GetVisibility() const override; + void SetRayTracingEnabled(bool enabled) override; + bool GetRayTracingEnabled() const override; + // BoundsRequestBus and MeshComponentRequestBus overrides ... AZ::Aabb GetWorldBounds() override; AZ::Aabb GetLocalBounds() override; diff --git a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorInstance.cpp b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorInstance.cpp index 58b3d8b56e..742031c84f 100644 --- a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorInstance.cpp +++ b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorInstance.cpp @@ -379,6 +379,24 @@ namespace AZ::Render return IsVisible(); } + void AtomActorInstance::SetRayTracingEnabled(bool enabled) + { + if (m_meshHandle->IsValid() && m_meshFeatureProcessor) + { + m_meshFeatureProcessor->SetRayTracingEnabled(*m_meshHandle, enabled); + } + } + + bool AtomActorInstance::GetRayTracingEnabled() const + { + if (m_meshHandle->IsValid() && m_meshFeatureProcessor) + { + return m_meshFeatureProcessor->GetRayTracingEnabled(*m_meshHandle); + } + + return false; + } + AZ::u32 AtomActorInstance::GetJointCount() { return aznumeric_caster(m_actorInstance->GetActor()->GetSkeleton()->GetNumNodes()); diff --git a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorInstance.h b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorInstance.h index 7f646466a5..73d428216c 100644 --- a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorInstance.h +++ b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorInstance.h @@ -152,6 +152,8 @@ namespace AZ float GetQualityDecayRate() const override; void SetVisibility(bool visible) override; bool GetVisibility() const override; + void SetRayTracingEnabled(bool enabled) override; + bool GetRayTracingEnabled() const override; // GetWorldBounds/GetLocalBounds already overridden by BoundsRequestBus::Handler ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/MixedGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/MixedGradientComponent.h index 9c9867cf1e..658118fca4 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/MixedGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/MixedGradientComponent.h @@ -99,6 +99,7 @@ namespace GradientSignal ////////////////////////////////////////////////////////////////////////// // GradientRequestBus float GetValue(const GradientSampleParams& sampleParams) const override; + void GetValues(AZStd::span positions, AZStd::span outValues) const override; bool IsEntityInHierarchy(const AZ::EntityId& entityId) const override; protected: @@ -110,6 +111,34 @@ namespace GradientSignal MixedGradientLayer* GetLayer(int layerIndex) override; private: + static float PerformMixingOperation(MixedGradientLayer::MixingOperation operation, float prevValue, float currentUnpremultiplied) + { + switch (operation) + { + case MixedGradientLayer::MixingOperation::Initialize: + return currentUnpremultiplied; + case MixedGradientLayer::MixingOperation::Multiply: + return prevValue * currentUnpremultiplied; + case MixedGradientLayer::MixingOperation::Add: + return prevValue + currentUnpremultiplied; + case MixedGradientLayer::MixingOperation::Subtract: + return prevValue - currentUnpremultiplied; + case MixedGradientLayer::MixingOperation::Min: + return AZStd::min(prevValue, currentUnpremultiplied); + case MixedGradientLayer::MixingOperation::Max: + return AZStd::max(prevValue, currentUnpremultiplied); + case MixedGradientLayer::MixingOperation::Average: + return (prevValue + currentUnpremultiplied) / 2.0f; + case MixedGradientLayer::MixingOperation::Normal: + return currentUnpremultiplied; + case MixedGradientLayer::MixingOperation::Overlay: + return (prevValue >= 0.5f) ? (1.0f - (2.0f * (1.0f - prevValue) * (1.0f - currentUnpremultiplied))) + : (2.0f * prevValue * currentUnpremultiplied); + default: + return currentUnpremultiplied; + } + } + MixedGradientConfig m_configuration; LmbrCentral::DependencyMonitor m_dependencyMonitor; }; diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/PosterizeGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/PosterizeGradientComponent.h index 9b0714b449..bff49ac619 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/PosterizeGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/PosterizeGradientComponent.h @@ -73,6 +73,7 @@ namespace GradientSignal ////////////////////////////////////////////////////////////////////////// // GradientRequestBus float GetValue(const GradientSampleParams& sampleParams) const override; + void GetValues(AZStd::span positions, AZStd::span outValues) const override; bool IsEntityInHierarchy(const AZ::EntityId& entityId) const override; protected: @@ -86,6 +87,39 @@ namespace GradientSignal GradientSampler& GetGradientSampler() override; private: + + static float PosterizeValue(float input, float bands, PosterizeGradientConfig::ModeType mode) + { + const float clampedInput = AZ::GetClamp(input, 0.0f, 1.0f); + float output = 0.0f; + + // "quantize" the input down to a number that goes from 0 to (bands-1) + const float band = AZ::GetMin(floorf(clampedInput * bands), bands - 1.0f); + + // Given our quantized band, produce the right output for that band range. + switch (mode) + { + default: + case PosterizeGradientConfig::ModeType::Floor: + // Floor: the output range should be the lowest value of each band, or (0 to bands-1) / bands + output = (band + 0.0f) / bands; + break; + case PosterizeGradientConfig::ModeType::Round: + // Round: the output range should be the midpoint of each band, or (0.5 to bands-0.5) / bands + output = (band + 0.5f) / bands; + break; + case PosterizeGradientConfig::ModeType::Ceiling: + // Ceiling: the output range should be the highest value of each band, or (1 to bands) / bands + output = (band + 1.0f) / bands; + break; + case PosterizeGradientConfig::ModeType::Ps: + // Ps: the output range should be equally distributed from 0-1, or (0 to bands-1) / (bands-1) + output = band / (bands - 1.0f); + break; + } + return AZ::GetMin(output, 1.0f); + } + PosterizeGradientConfig m_configuration; LmbrCentral::DependencyMonitor m_dependencyMonitor; }; diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ReferenceGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ReferenceGradientComponent.h index bf16b484fc..17c40865b3 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ReferenceGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ReferenceGradientComponent.h @@ -64,6 +64,7 @@ namespace GradientSignal ////////////////////////////////////////////////////////////////////////// // GradientRequestBus float GetValue(const GradientSampleParams& sampleParams) const override; + void GetValues(AZStd::span positions, AZStd::span outValues) const override; bool IsEntityInHierarchy(const AZ::EntityId& entityId) const override; protected: diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/SmoothStepGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/SmoothStepGradientComponent.h index 85947175af..03f629ab1e 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/SmoothStepGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/SmoothStepGradientComponent.h @@ -71,6 +71,7 @@ namespace GradientSignal ////////////////////////////////////////////////////////////////////////// // GradientRequestBus float GetValue(const GradientSampleParams& sampleParams) const override; + void GetValues(AZStd::span positions, AZStd::span outValues) const override; bool IsEntityInHierarchy(const AZ::EntityId& entityId) const override; protected: diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/SurfaceAltitudeGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/SurfaceAltitudeGradientComponent.h index 6ed841dafb..eb76fac292 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/SurfaceAltitudeGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/SurfaceAltitudeGradientComponent.h @@ -15,6 +15,7 @@ #include #include #include +#include namespace LmbrCentral { @@ -89,6 +90,7 @@ namespace GradientSignal ////////////////////////////////////////////////////////////////////////// // GradientRequestBus float GetValue(const GradientSampleParams& sampleParams) const override; + void GetValues(AZStd::span positions, AZStd::span outValues) const override; protected: ////////////////////////////////////////////////////////////////////////// @@ -105,7 +107,22 @@ namespace GradientSignal void AddTag(AZStd::string tag) override; private: - mutable AZStd::recursive_mutex m_cacheMutex; + static float CalculateAltitudeRatio(const SurfaceData::SurfacePointList& points, float altitudeMin, float altitudeMax) + { + if (points.empty()) + { + return 0.0f; + } + + // GetSurfacePoints (which was used to populate the points list) always returns points in decreasing height order, so the + // first point in the list contains the highest altitude. + const float highestAltitude = points.front().m_position.GetZ(); + + // Turn the absolute altitude value into a 0-1 value by returning the % of the given altitude range that it falls at. + return GetRatio(altitudeMin, altitudeMax, highestAltitude); + } + + mutable AZStd::shared_mutex m_cacheMutex; SurfaceAltitudeGradientConfig m_configuration; LmbrCentral::DependencyMonitor m_dependencyMonitor; AZStd::atomic_bool m_dirty{ false }; diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/SurfaceMaskGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/SurfaceMaskGradientComponent.h index f5400719d0..3eafb8c115 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/SurfaceMaskGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/SurfaceMaskGradientComponent.h @@ -70,6 +70,7 @@ namespace GradientSignal ////////////////////////////////////////////////////////////////////////// // GradientRequestBus float GetValue(const GradientSampleParams& sampleParams) const override; + void GetValues(AZStd::span positions, AZStd::span outValues) const override; protected: ////////////////////////////////////////////////////////////////////////// @@ -80,6 +81,21 @@ namespace GradientSignal void AddTag(AZStd::string tag) override; private: + static float GetMaxSurfaceWeight(const SurfaceData::SurfacePointList& points) + { + float result = 0.0f; + + for (const auto& point : points) + { + for (const auto& [maskId, weight] : point.m_masks) + { + result = AZ::GetMax(AZ::GetClamp(weight, 0.0f, 1.0f), result); + } + } + + return result; + } + SurfaceMaskGradientConfig m_configuration; LmbrCentral::DependencyMonitor m_dependencyMonitor; }; diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/SurfaceSlopeGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/SurfaceSlopeGradientComponent.h index b6805202f1..b464b6fb0f 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/SurfaceSlopeGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/SurfaceSlopeGradientComponent.h @@ -14,6 +14,7 @@ #include #include #include +#include namespace LmbrCentral { @@ -91,6 +92,7 @@ namespace GradientSignal ////////////////////////////////////////////////////////////////////////// // GradientRequestBus float GetValue(const GradientSampleParams& sampleParams) const override; + void GetValues(AZStd::span positions, AZStd::span outValues) const override; protected: ////////////////////////////////////////////////////////////////////////// @@ -121,6 +123,37 @@ namespace GradientSignal void SetFallOffMidpoint(float midpoint) override; private: + float GetSlopeRatio(const SurfaceData::SurfacePointList& points, float angleMin, float angleMax) const + { + if (points.empty()) + { + return 0.0f; + } + + // Assuming our surface normal vector is actually normalized, we can get the slope + // by just grabbing the Z value. It's the same thing as normal.Dot(AZ::Vector3::CreateAxisZ()). + AZ_Assert( + points.front().m_normal.GetNormalized().IsClose(points.front().m_normal), + "Surface normals are expected to be normalized"); + const float slope = points.front().m_normal.GetZ(); + // Convert slope back to an angle so that we can lerp in "angular space", not "slope value space". + // (We want our 0-1 range to be linear across the range of angles) + const float slopeAngle = acosf(slope); + + switch (m_configuration.m_rampType) + { + case SurfaceSlopeGradientConfig::RampType::SMOOTH_STEP: + return m_configuration.m_smoothStep.GetSmoothedValue(GetRatio(angleMin, angleMax, slopeAngle)); + case SurfaceSlopeGradientConfig::RampType::LINEAR_RAMP_UP: + // For ramp up, linearly interpolate from min to max. + return GetRatio(angleMin, angleMax, slopeAngle); + case SurfaceSlopeGradientConfig::RampType::LINEAR_RAMP_DOWN: + default: + // For ramp down, linearly interpolate from max to min. + return GetRatio(angleMax, angleMin, slopeAngle); + } + } + SurfaceSlopeGradientConfig m_configuration; }; } diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ThresholdGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ThresholdGradientComponent.h index dbf211551c..96bc235ea8 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ThresholdGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ThresholdGradientComponent.h @@ -65,6 +65,7 @@ namespace GradientSignal ////////////////////////////////////////////////////////////////////////// // GradientRequestBus float GetValue(const GradientSampleParams& sampleParams) const override; + void GetValues(AZStd::span positions, AZStd::span outValues) const override; bool IsEntityInHierarchy(const AZ::EntityId& entityId) const override; protected: diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h b/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h index c9aa7f680c..bf5c8d1ea0 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h @@ -152,7 +152,7 @@ namespace GradientSignal auto ClearOutputValues = [](AZStd::span outValues) { // If we don't have a valid gradient (or it is fully transparent), clear out all the output values. - memset(outValues.data(), 0, outValues.size() * sizeof(float)); + AZStd::fill(outValues.begin(), outValues.end(), 0.0f); }; if (m_opacity <= 0.0f || !m_gradientId.IsValid()) diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/SmoothStep.h b/Gems/GradientSignal/Code/Include/GradientSignal/SmoothStep.h index 0489fa4893..c8fc77ac60 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/SmoothStep.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/SmoothStep.h @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -26,29 +27,46 @@ namespace GradientSignal static void Reflect(AZ::ReflectContext* context); inline float GetSmoothedValue(float inputValue) const; + inline void GetSmoothedValues(AZStd::span inOutValues) const; float m_falloffMidpoint = 0.5f; float m_falloffRange = 0.5f; float m_falloffStrength = 0.25f; + + private: + inline float CalculateSmoothedValue(float min, float max, float valueFalloffStrength, float inputValue) const; }; - inline float SmoothStep::GetSmoothedValue(float inputValue) const + inline float SmoothStep::CalculateSmoothedValue(float min, float max, float valueFalloffStrength, float inputValue) const { - float output = 0.0f; - const float value = AZ::GetClamp(inputValue, 0.0f, 1.0f); - const float valueFalloffStrength = AZ::GetClamp(m_falloffStrength, 0.0f, 1.0f); - - float min = m_falloffMidpoint - m_falloffRange / 2.0f; - float max = m_falloffMidpoint + m_falloffRange / 2.0f; float result1 = GetRatio(min, min + valueFalloffStrength, value); result1 = GetSmoothStep(result1); float result2 = GetRatio(max - valueFalloffStrength, max, value); result2 = GetSmoothStep(result2); - output = result1 * (1.0f - result2); - - return output; + return result1 * (1.0f - result2); } -} + + inline float SmoothStep::GetSmoothedValue(float inputValue) const + { + const float min = m_falloffMidpoint - m_falloffRange / 2.0f; + const float max = m_falloffMidpoint + m_falloffRange / 2.0f; + const float valueFalloffStrength = AZ::GetClamp(m_falloffStrength, 0.0f, 1.0f); + + return CalculateSmoothedValue(min, max, valueFalloffStrength, inputValue); + } + + inline void SmoothStep::GetSmoothedValues(AZStd::span inOutValues) const + { + const float min = m_falloffMidpoint - m_falloffRange / 2.0f; + const float max = m_falloffMidpoint + m_falloffRange / 2.0f; + const float valueFalloffStrength = AZ::GetClamp(m_falloffStrength, 0.0f, 1.0f); + + for (auto& inOutValue : inOutValues) + { + inOutValue = CalculateSmoothedValue(min, max, valueFalloffStrength, inOutValue); + } + } +} // namespace GradientSignal diff --git a/Gems/GradientSignal/Code/Source/Components/MixedGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/MixedGradientComponent.cpp index e042188f8a..23bdd379fe 100644 --- a/Gems/GradientSignal/Code/Source/Components/MixedGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/MixedGradientComponent.cpp @@ -257,62 +257,80 @@ namespace GradientSignal float MixedGradientComponent::GetValue(const GradientSampleParams& sampleParams) const { - AZ_PROFILE_FUNCTION(Entity); - //accumulate the mixed/combined result of all layers and operations float result = 0.0f; - float operationResult = 0.0f; for (const auto& layer : m_configuration.m_layers) { // added check to prevent opacity of 0.0, which will bust when we unpremultiply the alpha out if (layer.m_enabled && layer.m_gradientSampler.m_opacity != 0.0f) { + // Precalculate the inverse opacity that we'll use for blending the current accumulated value with. + // In the one case of "Initialize" blending, force this value to 0 so that we erase any accumulated values. + const float inverseOpacity = (layer.m_operation == MixedGradientLayer::MixingOperation::Initialize) + ? 0.0f + : (1.0f - layer.m_gradientSampler.m_opacity); + // this includes leveling and opacity result, we need unpremultiplied opacity to combine properly float current = layer.m_gradientSampler.GetValue(sampleParams); // unpremultiplied alpha (we clamp the end result) - float currentUnpremultiplied = current / layer.m_gradientSampler.m_opacity; - switch (layer.m_operation) - { - default: - case MixedGradientLayer::MixingOperation::Initialize: - //reset the result of the mixed/combined layers to the current value - result = 0.0f; - operationResult = currentUnpremultiplied; - break; - case MixedGradientLayer::MixingOperation::Multiply: - operationResult = result * currentUnpremultiplied; - break; - case MixedGradientLayer::MixingOperation::Add: - operationResult = result + currentUnpremultiplied; - break; - case MixedGradientLayer::MixingOperation::Subtract: - operationResult = result - currentUnpremultiplied; - break; - case MixedGradientLayer::MixingOperation::Min: - operationResult = AZStd::min(currentUnpremultiplied, result); - break; - case MixedGradientLayer::MixingOperation::Max: - operationResult = AZStd::max(currentUnpremultiplied, result); - break; - case MixedGradientLayer::MixingOperation::Average: - operationResult = (result + currentUnpremultiplied) / 2.0f; - break; - case MixedGradientLayer::MixingOperation::Normal: - operationResult = currentUnpremultiplied; - break; - case MixedGradientLayer::MixingOperation::Overlay: - operationResult = (result >= 0.5f) ? (1.0f - (2.0f * (1.0f - result) * (1.0f - currentUnpremultiplied))) : (2.0f * result * currentUnpremultiplied); - break; - } + const float currentUnpremultiplied = current / layer.m_gradientSampler.m_opacity; + const float operationResult = PerformMixingOperation(layer.m_operation, result, currentUnpremultiplied); // blend layers (re-applying opacity, which is why we needed to use unpremultiplied) - result = (result * (1.0f - layer.m_gradientSampler.m_opacity)) + (operationResult * layer.m_gradientSampler.m_opacity); + result = (result * inverseOpacity) + (operationResult * layer.m_gradientSampler.m_opacity); } } return AZ::GetClamp(result, 0.0f, 1.0f); } + void MixedGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const + { + if (positions.size() != outValues.size()) + { + AZ_Assert(false, "input and output lists are different sizes (%zu vs %zu).", positions.size(), outValues.size()); + return; + } + + // Initialize all of our output data to 0.0f. Layer blends will combine with this, so we need it to have an initial value. + AZStd::fill(outValues.begin(), outValues.end(), 0.0f); + + AZStd::vector layerValues(positions.size()); + + // accumulate the mixed/combined result of all layers and operations + for (const auto& layer : m_configuration.m_layers) + { + // added check to prevent opacity of 0.0, which will bust when we unpremultiply the alpha out + if (layer.m_enabled && layer.m_gradientSampler.m_opacity != 0.0f) + { + // Precalculate the inverse opacity that we'll use for blending the current accumulated value with. + // In the one case of "Initialize" blending, force this value to 0 so that we erase any accumulated values. + const float inverseOpacity = (layer.m_operation == MixedGradientLayer::MixingOperation::Initialize) + ? 0.0f + : (1.0f - layer.m_gradientSampler.m_opacity); + + // this includes leveling and opacity result, we need unpremultiplied opacity to combine properly + layer.m_gradientSampler.GetValues(positions, layerValues); + + for (size_t index = 0; index < outValues.size(); index++) + { + // unpremultiplied alpha (we clamp the end result) + const float currentUnpremultiplied = layerValues[index] / layer.m_gradientSampler.m_opacity; + const float operationResult = PerformMixingOperation(layer.m_operation, outValues[index], currentUnpremultiplied); + // blend layers (re-applying opacity, which is why we needed to use unpremultiplied) + outValues[index] = (outValues[index] * inverseOpacity) + (operationResult * layer.m_gradientSampler.m_opacity); + } + } + } + + for (auto& outValue : outValues) + { + outValue = AZ::GetClamp(outValue, 0.0f, 1.0f); + } + } + + + bool MixedGradientComponent::IsEntityInHierarchy(const AZ::EntityId& entityId) const { for (const auto& layer : m_configuration.m_layers) diff --git a/Gems/GradientSignal/Code/Source/Components/PosterizeGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/PosterizeGradientComponent.cpp index 21d321df13..4616e080f1 100644 --- a/Gems/GradientSignal/Code/Source/Components/PosterizeGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/PosterizeGradientComponent.cpp @@ -151,34 +151,28 @@ namespace GradientSignal float PosterizeGradientComponent::GetValue(const GradientSampleParams& sampleParams) const { const float bands = AZ::GetMax(static_cast(m_configuration.m_bands), 2.0f); - const float input = AZ::GetClamp(m_configuration.m_gradientSampler.GetValue(sampleParams), 0.0f, 1.0f); - float output = 0.0f; + const float input = m_configuration.m_gradientSampler.GetValue(sampleParams); + return PosterizeValue(input, bands, m_configuration.m_mode); + } - // "quantize" the input down to a number that goes from 0 to (bands-1) - const float band = AZ::GetClamp(floorf(input * bands), 0.0f, bands - 1.0f); - - // Given our quantized band, produce the right output for that band range. - switch (m_configuration.m_mode) + void PosterizeGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const + { + if (positions.size() != outValues.size()) { - default: - case PosterizeGradientConfig::ModeType::Floor: - // Floor: the output range should be the lowest value of each band, or (0 to bands-1) / bands - output = (band + 0.0f) / bands; - break; - case PosterizeGradientConfig::ModeType::Round: - // Round: the output range should be the midpoint of each band, or (0.5 to bands-0.5) / bands - output = (band + 0.5f) / bands; - break; - case PosterizeGradientConfig::ModeType::Ceiling: - // Ceiling: the output range should be the highest value of each band, or (1 to bands) / bands - output = (band + 1.0f) / bands; - break; - case PosterizeGradientConfig::ModeType::Ps: - // Ps: the output range should be equally distributed from 0-1, or (0 to bands-1) / (bands-1) - output = band / (bands - 1.0f); - break; + AZ_Assert(false, "input and output lists are different sizes (%zu vs %zu).", positions.size(), outValues.size()); + return; + } + + const float bands = AZ::GetMax(static_cast(m_configuration.m_bands), 2.0f); + + // Fill in the outValues with all of the generated inupt gradient values. + m_configuration.m_gradientSampler.GetValues(positions, outValues); + + // Run through all the input values and posterize them. + for (auto& outValue : outValues) + { + outValue = PosterizeValue(outValue, bands, m_configuration.m_mode); } - return AZ::GetClamp(output, 0.0f, 1.0f); } bool PosterizeGradientComponent::IsEntityInHierarchy(const AZ::EntityId& entityId) const diff --git a/Gems/GradientSignal/Code/Source/Components/ReferenceGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/ReferenceGradientComponent.cpp index ea304a7eed..e135401ff5 100644 --- a/Gems/GradientSignal/Code/Source/Components/ReferenceGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/ReferenceGradientComponent.cpp @@ -131,13 +131,18 @@ namespace GradientSignal float ReferenceGradientComponent::GetValue(const GradientSampleParams& sampleParams) const { - AZ_PROFILE_FUNCTION(Entity); + return m_configuration.m_gradientSampler.GetValue(sampleParams); + } - float output = 0.0f; + void ReferenceGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const + { + if (positions.size() != outValues.size()) + { + AZ_Assert(false, "input and output lists are different sizes (%zu vs %zu).", positions.size(), outValues.size()); + return; + } - output = m_configuration.m_gradientSampler.GetValue(sampleParams); - - return output; + m_configuration.m_gradientSampler.GetValues(positions, outValues); } bool ReferenceGradientComponent::IsEntityInHierarchy(const AZ::EntityId& entityId) const diff --git a/Gems/GradientSignal/Code/Source/Components/SmoothStepGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/SmoothStepGradientComponent.cpp index 510ed41510..683f0a37fa 100644 --- a/Gems/GradientSignal/Code/Source/Components/SmoothStepGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/SmoothStepGradientComponent.cpp @@ -168,12 +168,20 @@ namespace GradientSignal float SmoothStepGradientComponent::GetValue(const GradientSampleParams& sampleParams) const { - float output = 0.0f; + const float value = m_configuration.m_gradientSampler.GetValue(sampleParams); + return m_configuration.m_smoothStep.GetSmoothedValue(value); + } - const float value = AZ::GetClamp(m_configuration.m_gradientSampler.GetValue(sampleParams), 0.0f, 1.0f); - output = m_configuration.m_smoothStep.GetSmoothedValue(value); + void SmoothStepGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const + { + if (positions.size() != outValues.size()) + { + AZ_Assert(false, "input and output lists are different sizes (%zu vs %zu).", positions.size(), outValues.size()); + return; + } - return output; + m_configuration.m_gradientSampler.GetValues(positions, outValues); + m_configuration.m_smoothStep.GetSmoothedValues(outValues); } bool SmoothStepGradientComponent::IsEntityInHierarchy(const AZ::EntityId& entityId) const diff --git a/Gems/GradientSignal/Code/Source/Components/SurfaceAltitudeGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/SurfaceAltitudeGradientComponent.cpp index 8b36182750..ee6c272e40 100644 --- a/Gems/GradientSignal/Code/Source/Components/SurfaceAltitudeGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/SurfaceAltitudeGradientComponent.cpp @@ -202,19 +202,49 @@ namespace GradientSignal float SurfaceAltitudeGradientComponent::GetValue(const GradientSampleParams& sampleParams) const { - AZStd::lock_guard lock(m_cacheMutex); + AZStd::shared_lock lock(m_cacheMutex); SurfaceData::SurfacePointList points; SurfaceData::SurfaceDataSystemRequestBus::Broadcast(&SurfaceData::SurfaceDataSystemRequestBus::Events::GetSurfacePoints, sampleParams.m_position, m_configuration.m_surfaceTagsToSample, points); - if (points.empty()) + return CalculateAltitudeRatio(points, m_configuration.m_altitudeMin, m_configuration.m_altitudeMax); + } + + void SurfaceAltitudeGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const + { + if (positions.size() != outValues.size()) { - return 0.0f; + AZ_Assert(false, "input and output lists are different sizes (%zu vs %zu).", positions.size(), outValues.size()); + return; } - const AZ::Vector3& position = points.front().m_position; - return GetRatio(m_configuration.m_altitudeMin, m_configuration.m_altitudeMax, position.GetZ()); + AZStd::shared_lock lock(m_cacheMutex); + bool valuesFound = false; + + // Rather than calling GetSurfacePoints on the EBus repeatedly in a loop, we instead pass a lambda into the EBus that contains + // the loop within it so that we can avoid the repeated EBus-calling overhead. + SurfaceData::SurfaceDataSystemRequestBus::Broadcast( + [this, positions, &outValues, &valuesFound](SurfaceData::SurfaceDataSystemRequestBus::Events* surfaceDataRequests) + { + // It's possible that there's nothing connected to the EBus, so keep track of the fact that we have valid results. + valuesFound = true; + SurfaceData::SurfacePointList points; + + // For each position, call GetSurfacePoints() and turn the height into a 0-1 value based on our min/max altitudes. + for (size_t index = 0; index < positions.size(); index++) + { + points.clear(); + surfaceDataRequests->GetSurfacePoints(positions[index], m_configuration.m_surfaceTagsToSample, points); + outValues[index] = CalculateAltitudeRatio(points, m_configuration.m_altitudeMin, m_configuration.m_altitudeMax); + } + }); + + if (!valuesFound) + { + // No surface data, so no output values. + AZStd::fill(outValues.begin(), outValues.end(), 0.0f); + } } void SurfaceAltitudeGradientComponent::OnCompositionChanged() @@ -246,7 +276,7 @@ namespace GradientSignal { AZ_PROFILE_FUNCTION(Entity); - AZStd::lock_guard lock(m_cacheMutex); + AZStd::unique_lock lock(m_cacheMutex); if (m_configuration.m_shapeEntityId.IsValid()) { diff --git a/Gems/GradientSignal/Code/Source/Components/SurfaceMaskGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/SurfaceMaskGradientComponent.cpp index df7a3f5787..f697050f56 100644 --- a/Gems/GradientSignal/Code/Source/Components/SurfaceMaskGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/SurfaceMaskGradientComponent.cpp @@ -161,8 +161,6 @@ namespace GradientSignal float SurfaceMaskGradientComponent::GetValue(const GradientSampleParams& params) const { - AZ_PROFILE_FUNCTION(Entity); - float result = 0.0f; if (!m_configuration.m_surfaceTagList.empty()) @@ -171,18 +169,50 @@ namespace GradientSignal SurfaceData::SurfaceDataSystemRequestBus::Broadcast(&SurfaceData::SurfaceDataSystemRequestBus::Events::GetSurfacePoints, params.m_position, m_configuration.m_surfaceTagList, points); - for (const auto& point : points) - { - for (const auto& maskPair : point.m_masks) - { - result = AZ::GetMax(AZ::GetClamp(maskPair.second, 0.0f, 1.0f), result); - } - } + result = GetMaxSurfaceWeight(points); } return result; } + void SurfaceMaskGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const + { + if (positions.size() != outValues.size()) + { + AZ_Assert(false, "input and output lists are different sizes (%zu vs %zu).", positions.size(), outValues.size()); + return; + } + + bool valuesFound = false; + + if (!m_configuration.m_surfaceTagList.empty()) + { + // Rather than calling GetSurfacePoints on the EBus repeatedly in a loop, we instead pass a lambda into the EBus that contains + // the loop within it so that we can avoid the repeated EBus-calling overhead. + SurfaceData::SurfaceDataSystemRequestBus::Broadcast( + [this, positions, &outValues, &valuesFound](SurfaceData::SurfaceDataSystemRequestBus::Events* surfaceDataRequests) + { + // It's possible that there's nothing connected to the EBus, so keep track of the fact that we have valid results. + valuesFound = true; + SurfaceData::SurfacePointList points; + + for (size_t index = 0; index < positions.size(); index++) + { + points.clear(); + surfaceDataRequests->GetSurfacePoints(positions[index], m_configuration.m_surfaceTagList, points); + outValues[index] = GetMaxSurfaceWeight(points); + } + }); + } + + if (!valuesFound) + { + // No surface tags, so no output values. + AZStd::fill(outValues.begin(), outValues.end(), 0.0f); + } + + } + size_t SurfaceMaskGradientComponent::GetNumTags() const { return m_configuration.GetNumTags(); diff --git a/Gems/GradientSignal/Code/Source/Components/SurfaceSlopeGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/SurfaceSlopeGradientComponent.cpp index 84e0b61a62..50105a862f 100644 --- a/Gems/GradientSignal/Code/Source/Components/SurfaceSlopeGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/SurfaceSlopeGradientComponent.cpp @@ -209,36 +209,50 @@ namespace GradientSignal SurfaceData::SurfaceDataSystemRequestBus::Broadcast(&SurfaceData::SurfaceDataSystemRequestBus::Events::GetSurfacePoints, sampleParams.m_position, m_configuration.m_surfaceTagsToSample, points); - if (points.empty()) - { - return 0.0f; - } - - // Assuming our surface normal vector is actually normalized, we can get the slope - // by just grabbing the Z value. It's the same thing as normal.Dot(AZ::Vector3::CreateAxisZ()). - AZ_Assert(points.front().m_normal.GetNormalized().IsClose(points.front().m_normal), "Surface normals are expected to be normalized"); - const float slope = points.front().m_normal.GetZ(); - // Convert slope back to an angle so that we can lerp in "angular space", not "slope value space". - // (We want our 0-1 range to be linear across the range of angles) - const float slopeAngle = acosf(slope); - const float angleMin = AZ::DegToRad(AZ::GetClamp(m_configuration.m_slopeMin, 0.0f, 90.0f)); const float angleMax = AZ::DegToRad(AZ::GetClamp(m_configuration.m_slopeMax, 0.0f, 90.0f)); - switch (m_configuration.m_rampType) + return GetSlopeRatio(points, angleMin, angleMax); + } + + void SurfaceSlopeGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const + { + if (positions.size() != outValues.size()) { - case SurfaceSlopeGradientConfig::RampType::SMOOTH_STEP: - return m_configuration.m_smoothStep.GetSmoothedValue(GetRatio(angleMin, angleMax, slopeAngle)); - case SurfaceSlopeGradientConfig::RampType::LINEAR_RAMP_UP: - // For ramp up, linearly interpolate from min to max. - return GetRatio(angleMin, angleMax, slopeAngle); - case SurfaceSlopeGradientConfig::RampType::LINEAR_RAMP_DOWN: - default: - // For ramp down, linearly interpolate from max to min. - return GetRatio(angleMax, angleMin, slopeAngle); + AZ_Assert(false, "input and output lists are different sizes (%zu vs %zu).", positions.size(), outValues.size()); + return; + } + + bool valuesFound = false; + + // Rather than calling GetSurfacePoints on the EBus repeatedly in a loop, we instead pass a lambda into the EBus that contains + // the loop within it so that we can avoid the repeated EBus-calling overhead. + SurfaceData::SurfaceDataSystemRequestBus::Broadcast( + [this, positions, &outValues, &valuesFound](SurfaceData::SurfaceDataSystemRequestBus::Events* surfaceDataRequests) + { + // It's possible that there's nothing connected to the EBus, so keep track of the fact that we have valid results. + valuesFound = true; + SurfaceData::SurfacePointList points; + + const float angleMin = AZ::DegToRad(AZ::GetClamp(m_configuration.m_slopeMin, 0.0f, 90.0f)); + const float angleMax = AZ::DegToRad(AZ::GetClamp(m_configuration.m_slopeMax, 0.0f, 90.0f)); + + for (size_t index = 0; index < positions.size(); index++) + { + points.clear(); + surfaceDataRequests->GetSurfacePoints(positions[index], m_configuration.m_surfaceTagsToSample, points); + outValues[index] = GetSlopeRatio(points, angleMin, angleMax); + } + }); + + if (!valuesFound) + { + // No surface tags, so no output values. + AZStd::fill(outValues.begin(), outValues.end(), 0.0f); } } + float SurfaceSlopeGradientComponent::GetSlopeMin() const { return m_configuration.m_slopeMin; diff --git a/Gems/GradientSignal/Code/Source/Components/ThresholdGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/ThresholdGradientComponent.cpp index a47ebdebe6..5df579576d 100644 --- a/Gems/GradientSignal/Code/Source/Components/ThresholdGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/ThresholdGradientComponent.cpp @@ -138,11 +138,22 @@ namespace GradientSignal float ThresholdGradientComponent::GetValue(const GradientSampleParams& sampleParams) const { - float output = 0.0f; + return (m_configuration.m_gradientSampler.GetValue(sampleParams) <= m_configuration.m_threshold) ? 0.0f : 1.0f; + } - output = m_configuration.m_gradientSampler.GetValue(sampleParams) <= m_configuration.m_threshold ? 0.0f : 1.0f; + void ThresholdGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const + { + if (positions.size() != outValues.size()) + { + AZ_Assert(false, "input and output lists are different sizes (%zu vs %zu).", positions.size(), outValues.size()); + return; + } - return output; + m_configuration.m_gradientSampler.GetValues(positions, outValues); + for (auto& outValue : outValues) + { + outValue = (outValue <= m_configuration.m_threshold) ? 0.0f : 1.0f; + } } bool ThresholdGradientComponent::IsEntityInHierarchy(const AZ::EntityId& entityId) const diff --git a/Gems/LmbrCentral/Code/Source/Shape/TubeShapeComponent.cpp b/Gems/LmbrCentral/Code/Source/Shape/TubeShapeComponent.cpp index d96fc8c9ce..194204dd93 100644 --- a/Gems/LmbrCentral/Code/Source/Shape/TubeShapeComponent.cpp +++ b/Gems/LmbrCentral/Code/Source/Shape/TubeShapeComponent.cpp @@ -124,8 +124,14 @@ namespace LmbrCentral void TubeShapeDebugDisplayComponent::GenerateVertices() { + if (!m_spline) + { + AZ_Error("TubeShapeComponent", false, "A TubeShape must have a Spline to work"); + return; + } + const AZ::u32 endSegments = m_spline->IsClosed() ? 0 : m_tubeShapeMeshConfig.m_endSegments; GenerateTubeMesh( - m_spline, m_radiusAttribute, m_radius, m_tubeShapeMeshConfig.m_endSegments, + m_spline, m_radiusAttribute, m_radius, endSegments, m_tubeShapeMeshConfig.m_sides, m_tubeShapeMesh.m_vertexBuffer, m_tubeShapeMesh.m_indexBuffer, m_tubeShapeMesh.m_lineBuffer); } diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp index a1a2d1d20f..2f44dfe090 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp @@ -44,7 +44,7 @@ namespace ScriptCanvasBuilder AzFramework::StringFunc::Path::ConstructFull(request.m_watchFolder.data(), request.m_sourceFile.data(), fullPath, false); AzFramework::StringFunc::Path::Normalize(fullPath); - const ScriptCanvasEditor::Graph* sourceGraph = nullptr; + const ScriptCanvasEditor::EditorGraph* sourceGraph = nullptr; const ScriptCanvas::GraphData* graphData = nullptr; ScriptCanvasEditor::SourceHandle sourceHandle; diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h index 142886f98c..42cc958a07 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h @@ -35,7 +35,7 @@ namespace ScriptCanvas namespace ScriptCanvasEditor { - class Graph; + class EditorGraph; class SourceHandle; } @@ -135,7 +135,7 @@ namespace ScriptCanvasBuilder AZ::Outcome ProcessTranslationJob(ProcessTranslationJobInput& input); - ScriptCanvasEditor::Graph* PrepareSourceGraph(AZ::Entity* const buildEntity); + ScriptCanvasEditor::EditorGraph* PrepareSourceGraph(AZ::Entity* const buildEntity); AZ::Outcome SaveSubgraphInterface(ProcessTranslationJobInput& input, ScriptCanvas::SubgraphInterfaceData& subgraphInterface); diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp index 64e73de9b9..110f8c5164 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp @@ -153,7 +153,7 @@ namespace ScriptCanvasBuilder return AZ::Failure(AZStd::string("Cannot compile graph data from a nullptr Script Canvas Entity")); } - auto sourceGraph = AZ::EntityUtils::FindFirstDerivedComponent(scriptCanvasEntity); + auto sourceGraph = AZ::EntityUtils::FindFirstDerivedComponent(scriptCanvasEntity); if (!sourceGraph) { return AZ::Failure(AZStd::string("Failed to find Script Canvas Graph Component")); @@ -385,9 +385,9 @@ namespace ScriptCanvasBuilder ; } - ScriptCanvasEditor::Graph* PrepareSourceGraph(AZ::Entity* const buildEntity) + ScriptCanvasEditor::EditorGraph* PrepareSourceGraph(AZ::Entity* const buildEntity) { - auto sourceGraph = AZ::EntityUtils::FindFirstDerivedComponent(buildEntity); + auto sourceGraph = AZ::EntityUtils::FindFirstDerivedComponent(buildEntity); if (!sourceGraph) { return nullptr; diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp index c4579c9042..bea3cdfe21 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp @@ -180,7 +180,7 @@ namespace ScriptCanvasEditor AZ::ComponentApplicationBus::BroadcastResult(serializeContext, &AZ::ComponentApplicationRequests::GetSerializeContext); AZ_Assert(serializeContext, "LoadEditorAssetTree() ailed to retrieve serialize context!"); - const ScriptCanvasEditor::Graph* graph = handle.Get(); + const ScriptCanvasEditor::EditorGraph* graph = handle.Get(); serializeContext->EnumerateObject(graph, beginElementCB, nullptr, AZ::SerializeContext::ENUM_ACCESS_FOR_READ); EditorAssetTree result; @@ -253,7 +253,7 @@ namespace ScriptCanvasEditor aznumeric_caster(ScriptCanvas::MathNodeUtilities::GetRandomIntegral(1, std::numeric_limits::max())); entity->SetId(AZ::EntityId(entityId)); - auto graph = entity->FindComponent(); + auto graph = entity->FindComponent(); graph->MarkOwnership(*scriptCanvasData); entity->Init(); diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.cpp index a067bf411e..35c2f9a11a 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.cpp @@ -17,7 +17,7 @@ namespace ScriptCanvasEditor { } - UndoHelper::UndoHelper(Graph* graph) + UndoHelper::UndoHelper(EditorGraph* graph) : m_undoState(this) { SetSource(graph); @@ -28,7 +28,7 @@ namespace ScriptCanvasEditor UndoRequestBus::Handler::BusDisconnect(); } - void UndoHelper::SetSource(Graph* graph) + void UndoHelper::SetSource(EditorGraph* graph) { m_graph = graph; UndoRequestBus::Handler::BusConnect(graph->GetScriptCanvasId()); diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.h b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.h index e2d4f008fa..4765468ee7 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.h +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.h @@ -21,13 +21,13 @@ namespace ScriptCanvasEditor public: UndoHelper(); - UndoHelper(Graph* source); + UndoHelper(EditorGraph* source); ~UndoHelper(); UndoCache* GetSceneUndoCache() override; UndoData CreateUndoData() override; - void SetSource(Graph* source); + void SetSource(EditorGraph* source); void BeginUndoBatch(AZStd::string_view label) override; void EndUndoBatch() override; @@ -58,6 +58,6 @@ namespace ScriptCanvasEditor Status m_status = Status::Idle; SceneUndoState m_undoState; - Graph* m_graph = nullptr; + EditorGraph* m_graph = nullptr; }; } diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp index 510962cf4b..97ae8226c4 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp @@ -100,20 +100,8 @@ namespace EditorGraphCpp } namespace ScriptCanvasEditor { - namespace EditorGraph - { - static const char* GetMimeType() - { - return "application/x-o3de-scriptcanvas"; - } - static const char* GetWrappedNodeGroupingMimeType() - { - return "application/x-03de-scriptcanvas-wrappednodegrouping"; - } - } - - Graph::~Graph() + EditorGraph::~EditorGraph() { for (auto& entry : m_graphCanvasSaveData) { @@ -152,7 +140,7 @@ namespace ScriptCanvasEditor return true; } - void Graph::ConvertToGetVariableNode(Graph* graph, ScriptCanvas::VariableId variableId, const AZ::EntityId& nodeId, AZStd::unordered_map< AZ::EntityId, AZ::EntityId >& setVariableRemapping) + void EditorGraph::ConvertToGetVariableNode(EditorGraph* graph, ScriptCanvas::VariableId variableId, const AZ::EntityId& nodeId, AZStd::unordered_map< AZ::EntityId, AZ::EntityId >& setVariableRemapping) { ScriptCanvas::ScriptCanvasId scriptCanvasId = graph->GetScriptCanvasId(); GraphCanvas::GraphId graphId = graph->GetGraphCanvasGraphId(); @@ -440,7 +428,7 @@ namespace ScriptCanvasEditor } } - void Graph::Reflect(AZ::ReflectContext* context) + void EditorGraph::Reflect(AZ::ReflectContext* context) { GraphStatisticsHelper::Reflect(context); @@ -453,19 +441,19 @@ namespace ScriptCanvasEditor ->Field("Count", &CRCCache::m_cacheCount) ; - serializeContext->Class() + serializeContext->Class() ->Version(EditorGraphCpp::Version::Current, &GraphVersionConverter) - ->Field("m_variableCounter", &Graph::m_variableCounter) - ->Field("m_saveFormatConverted", &Graph::m_saveFormatConverted) - ->Field("GraphCanvasData", &Graph::m_graphCanvasSaveData) - ->Field("CRCCacheMap", &Graph::m_crcCacheMap) - ->Field("StatisticsHelper", &Graph::m_statisticsHelper) - ->Field("GraphCanvasSaveVersion", &Graph::m_graphCanvasSaveVersion) + ->Field("m_variableCounter", &EditorGraph::m_variableCounter) + ->Field("m_saveFormatConverted", &EditorGraph::m_saveFormatConverted) + ->Field("GraphCanvasData", &EditorGraph::m_graphCanvasSaveData) + ->Field("CRCCacheMap", &EditorGraph::m_crcCacheMap) + ->Field("StatisticsHelper", &EditorGraph::m_statisticsHelper) + ->Field("GraphCanvasSaveVersion", &EditorGraph::m_graphCanvasSaveVersion) ; } } - void Graph::Activate() + void EditorGraph::Activate() { const ScriptCanvas::ScriptCanvasId& scriptCanvasId = GetScriptCanvasId(); @@ -483,7 +471,7 @@ namespace ScriptCanvasEditor m_undoHelper.SetSource(this); } - void Graph::Deactivate() + void EditorGraph::Deactivate() { GraphItemCommandNotificationBus::Handler::BusDisconnect(); ScriptCanvas::GraphRequestBus::Handler::BusDisconnect(); @@ -499,7 +487,7 @@ namespace ScriptCanvasEditor m_graphCanvasSceneEntity = nullptr; } - void Graph::OnViewRegistered() + void EditorGraph::OnViewRegistered() { if (!m_saveFormatConverted) { @@ -507,7 +495,7 @@ namespace ScriptCanvasEditor } } - bool Graph::SanityCheckNodeReplacement(ScriptCanvas::Node* oldNode, ScriptCanvas::Node* newNode, ScriptCanvas::NodeUpdateSlotReport& nodeUpdateSlotReport) + bool EditorGraph::SanityCheckNodeReplacement(ScriptCanvas::Node* oldNode, ScriptCanvas::Node* newNode, ScriptCanvas::NodeUpdateSlotReport& nodeUpdateSlotReport) { auto findReplacementMatch = [](const ScriptCanvas::Slot* oldSlot, const AZStd::vector& newSlots)->ScriptCanvas::SlotId { @@ -623,7 +611,7 @@ namespace ScriptCanvasEditor return true; } - void Graph::HandleFunctionDefinitionExtension(ScriptCanvas::Node* node, GraphCanvas::SlotId graphCanvasSlotId, const GraphCanvas::NodeId& nodeId) + void EditorGraph::HandleFunctionDefinitionExtension(ScriptCanvas::Node* node, GraphCanvas::SlotId graphCanvasSlotId, const GraphCanvas::NodeId& nodeId) { // Special-case for the execution nodeling extensions, which are adding input/output data slots. // We want to automatically promote them to variables so that the user can refer to them more easily @@ -689,7 +677,7 @@ namespace ScriptCanvasEditor } } - AZ::Outcome Graph::ReplaceNodeByConfig + AZ::Outcome EditorGraph::ReplaceNodeByConfig ( ScriptCanvas::Node* oldNode , const ScriptCanvas::NodeConfiguration& nodeConfig , ScriptCanvas::NodeUpdateSlotReport& nodeUpdateSlotReport) @@ -808,7 +796,7 @@ namespace ScriptCanvasEditor } } - void Graph::OnEntitiesSerialized(GraphCanvas::GraphSerialization& serializationTarget) + void EditorGraph::OnEntitiesSerialized(GraphCanvas::GraphSerialization& serializationTarget) { const GraphCanvas::GraphData& graphCanvasGraphData = serializationTarget.GetGraphData(); @@ -938,7 +926,7 @@ namespace ScriptCanvasEditor } } - void Graph::OnEntitiesDeserialized(const GraphCanvas::GraphSerialization& serializationSource) + void EditorGraph::OnEntitiesDeserialized(const GraphCanvas::GraphSerialization& serializationSource) { const auto& userDataMap = serializationSource.GetUserDataMapRef(); @@ -1025,7 +1013,7 @@ namespace ScriptCanvasEditor } } - void Graph::DisconnectConnection(const GraphCanvas::ConnectionId& connectionId) + void EditorGraph::DisconnectConnection(const GraphCanvas::ConnectionId& connectionId) { AZStd::any* connectionUserData = nullptr; GraphCanvas::ConnectionRequestBus::EventResult(connectionUserData, connectionId, &GraphCanvas::ConnectionRequests::GetUserData); @@ -1043,11 +1031,11 @@ namespace ScriptCanvasEditor } } - ScriptCanvas::DataPtr Graph::Create() + ScriptCanvas::DataPtr EditorGraph::Create() { if (AZ::Entity* entity = aznew AZ::Entity("Script Canvas Graph")) { - auto graph = entity->CreateComponent(); + auto graph = entity->CreateComponent(); entity->CreateComponent(graph->GetScriptCanvasId()); if (ScriptCanvas::DataPtr data = aznew ScriptCanvas::ScriptCanvasData()) @@ -1063,17 +1051,17 @@ namespace ScriptCanvasEditor return nullptr; } - void Graph::MarkOwnership(ScriptCanvas::ScriptCanvasData& owner) + void EditorGraph::MarkOwnership(ScriptCanvas::ScriptCanvasData& owner) { m_owner = &owner; } - ScriptCanvas::DataPtr Graph::GetOwnership() const + ScriptCanvas::DataPtr EditorGraph::GetOwnership() const { - return const_cast(this)->m_owner; + return const_cast(this)->m_owner; } - bool Graph::CreateConnection(const GraphCanvas::ConnectionId& connectionId, const GraphCanvas::Endpoint& sourcePoint, const GraphCanvas::Endpoint& targetPoint) + bool EditorGraph::CreateConnection(const GraphCanvas::ConnectionId& connectionId, const GraphCanvas::Endpoint& sourcePoint, const GraphCanvas::Endpoint& targetPoint) { if (!sourcePoint.IsValid() || !targetPoint.IsValid()) { @@ -1102,7 +1090,7 @@ namespace ScriptCanvasEditor return scConnected; } - bool Graph::IsValidConnection(const GraphCanvas::Endpoint& sourcePoint, const GraphCanvas::Endpoint& targetPoint) const + bool EditorGraph::IsValidConnection(const GraphCanvas::Endpoint& sourcePoint, const GraphCanvas::Endpoint& targetPoint) const { ScriptCanvas::Endpoint scSourceEndpoint = ConvertToScriptCanvasEndpoint(sourcePoint); ScriptCanvas::Endpoint scTargetEndpoint = ConvertToScriptCanvasEndpoint(targetPoint); @@ -1110,23 +1098,23 @@ namespace ScriptCanvasEditor return CanCreateConnectionBetween(scSourceEndpoint, scTargetEndpoint).IsSuccess(); } - AZStd::string Graph::GetDataTypeString(const AZ::Uuid&) + AZStd::string EditorGraph::GetDataTypeString(const AZ::Uuid&) { // This is used by the default tooltip setting in GraphCanvas, returning an empty string // in order for tooltips to be fully controlled by ScriptCanvas return {}; } - void Graph::OnRemoveUnusedNodes() + void EditorGraph::OnRemoveUnusedNodes() { } - void Graph::OnRemoveUnusedElements() + void EditorGraph::OnRemoveUnusedElements() { RemoveUnusedVariables(); } - bool Graph::AllowReset(const GraphCanvas::Endpoint& endpoint) const + bool EditorGraph::AllowReset(const GraphCanvas::Endpoint& endpoint) const { ScriptCanvas::Endpoint scEndpoint = ConvertToScriptCanvasEndpoint(endpoint); @@ -1158,7 +1146,7 @@ namespace ScriptCanvasEditor return false; } - GraphCanvas::NodePropertyDisplay* Graph::CreateDataSlotPropertyDisplay(const AZ::Uuid& dataType, const GraphCanvas::NodeId& nodeId, const GraphCanvas::SlotId& slotId) const + GraphCanvas::NodePropertyDisplay* EditorGraph::CreateDataSlotPropertyDisplay(const AZ::Uuid& dataType, const GraphCanvas::NodeId& nodeId, const GraphCanvas::SlotId& slotId) const { (void)dataType; @@ -1173,7 +1161,7 @@ namespace ScriptCanvasEditor return CreateDisplayPropertyForSlot(scriptCanvasNodeId, scriptCanvasSlotId); } - GraphCanvas::NodePropertyDisplay* Graph::CreatePropertySlotPropertyDisplay(const AZ::Crc32& propertyId, const GraphCanvas::NodeId& nodeId, const GraphCanvas::NodeId& slotId) const + GraphCanvas::NodePropertyDisplay* EditorGraph::CreatePropertySlotPropertyDisplay(const AZ::Crc32& propertyId, const GraphCanvas::NodeId& nodeId, const GraphCanvas::NodeId& slotId) const { (void)slotId; @@ -1233,7 +1221,7 @@ namespace ScriptCanvasEditor return nullptr; } - AZ::EntityId Graph::ConvertToScriptCanvasNodeId(const GraphCanvas::NodeId& nodeId) const + AZ::EntityId EditorGraph::ConvertToScriptCanvasNodeId(const GraphCanvas::NodeId& nodeId) const { AZStd::any* userData = nullptr; @@ -1242,7 +1230,7 @@ namespace ScriptCanvasEditor return (userData && userData->is()) ? *AZStd::any_cast(userData) : AZ::EntityId(); } - GraphCanvas::NodePropertyDisplay* Graph::CreateDisplayPropertyForSlot(const AZ::EntityId& scriptCanvasNodeId, const ScriptCanvas::SlotId& scriptCanvasSlotId) const + GraphCanvas::NodePropertyDisplay* EditorGraph::CreateDisplayPropertyForSlot(const AZ::EntityId& scriptCanvasNodeId, const ScriptCanvas::SlotId& scriptCanvasSlotId) const { ScriptCanvas::Slot* slot = nullptr; ScriptCanvas::NodeRequestBus::EventResult(slot, scriptCanvasNodeId, &ScriptCanvas::NodeRequests::GetSlot, scriptCanvasSlotId); @@ -1353,13 +1341,13 @@ namespace ScriptCanvasEditor return nullptr; } - void Graph::SignalDirty() + void EditorGraph::SignalDirty() { SourceHandle handle(m_owner, {}, {}); GeneralRequestBus::Broadcast(&GeneralRequests::SignalSceneDirty, handle); } - void Graph::HighlightNodesByType(const ScriptCanvas::NodeTypeIdentifier& nodeTypeIdentifier) + void EditorGraph::HighlightNodesByType(const ScriptCanvas::NodeTypeIdentifier& nodeTypeIdentifier) { for (const auto& nodePair : GetNodeMapping()) { @@ -1370,7 +1358,7 @@ namespace ScriptCanvasEditor } } - void Graph::HighlightEBusNodes(const ScriptCanvas::EBusBusId& busId, const ScriptCanvas::EBusEventId& eventId) + void EditorGraph::HighlightEBusNodes(const ScriptCanvas::EBusBusId& busId, const ScriptCanvas::EBusEventId& eventId) { ScriptCanvas::NodeTypeIdentifier ebusIdentifier = ScriptCanvas::NodeUtils::ConstructEBusIdentifier(busId); @@ -1393,7 +1381,7 @@ namespace ScriptCanvasEditor } } - void Graph::HighlightScriptEventNodes(const ScriptCanvas::EBusBusId& busId, const ScriptCanvas::EBusEventId& eventId) + void EditorGraph::HighlightScriptEventNodes(const ScriptCanvas::EBusBusId& busId, const ScriptCanvas::EBusEventId& eventId) { ScriptCanvas::NodeTypeIdentifier sendScriptEventIdentifier = ScriptCanvas::NodeUtils::ConstructSendScriptEventIdentifier(busId, eventId); ScriptCanvas::NodeTypeIdentifier receiveScriptEventIdentifier = ScriptCanvas::NodeUtils::ConstructScriptEventIdentifier(busId); @@ -1421,7 +1409,7 @@ namespace ScriptCanvasEditor } } - void Graph::HighlightScriptCanvasEntity(const AZ::EntityId& scriptCanvasId) + void EditorGraph::HighlightScriptCanvasEntity(const AZ::EntityId& scriptCanvasId) { GraphCanvas::SceneMemberGlowOutlineConfiguration glowConfiguration; @@ -1445,7 +1433,7 @@ namespace ScriptCanvasEditor } } - AZ::EntityId Graph::FindGraphCanvasSlotId(const AZ::EntityId& graphCanvasNodeId, const ScriptCanvas::SlotId& slotId) + AZ::EntityId EditorGraph::FindGraphCanvasSlotId(const AZ::EntityId& graphCanvasNodeId, const ScriptCanvas::SlotId& slotId) { AZ::EntityId graphCanvasSlotId; SlotMappingRequestBus::EventResult(graphCanvasSlotId, graphCanvasNodeId, &SlotMappingRequests::MapToGraphCanvasId, slotId); @@ -1466,7 +1454,7 @@ namespace ScriptCanvasEditor return graphCanvasSlotId; } - bool Graph::ConfigureConnectionUserData(const ScriptCanvas::Endpoint& sourceEndpoint, const ScriptCanvas::Endpoint& targetEndpoint, GraphCanvas::ConnectionId connectionId) + bool EditorGraph::ConfigureConnectionUserData(const ScriptCanvas::Endpoint& sourceEndpoint, const ScriptCanvas::Endpoint& targetEndpoint, GraphCanvas::ConnectionId connectionId) { bool isConfigured = true; @@ -1492,7 +1480,7 @@ namespace ScriptCanvasEditor return isConfigured; } - void Graph::HandleQueuedUpdates() + void EditorGraph::HandleQueuedUpdates() { bool signalDirty = false; @@ -1572,7 +1560,7 @@ namespace ScriptCanvasEditor } } - bool Graph::IsNodeVersionConverting(const AZ::EntityId& graphCanvasNodeId) const + bool EditorGraph::IsNodeVersionConverting(const AZ::EntityId& graphCanvasNodeId) const { bool isConverting = false; @@ -1597,7 +1585,7 @@ namespace ScriptCanvasEditor return isConverting; } - void Graph::OnPreNodeDeleted(const AZ::EntityId& nodeId) + void EditorGraph::OnPreNodeDeleted(const AZ::EntityId& nodeId) { // If we are cdeleteing a HandlerEventNode we don't need to do anything since they are purely visual. // And the underlying ScriptCanvas nodes will persist and maintain all of their state. @@ -1629,7 +1617,7 @@ namespace ScriptCanvasEditor } } - void Graph::OnPreConnectionDeleted(const AZ::EntityId& connectionId) + void EditorGraph::OnPreConnectionDeleted(const AZ::EntityId& connectionId) { AZStd::any* userData = nullptr; GraphCanvas::ConnectionRequestBus::EventResult(userData, connectionId, &GraphCanvas::ConnectionRequests::GetUserData); @@ -1670,22 +1658,22 @@ namespace ScriptCanvasEditor DisconnectConnection(connectionId); } - void Graph::OnUnknownPaste([[maybe_unused]] const QPointF& scenePos) + void EditorGraph::OnUnknownPaste([[maybe_unused]] const QPointF& scenePos) { GraphVariablesTableView::HandleVariablePaste(GetScriptCanvasId()); } - void Graph::OnSelectionChanged() + void EditorGraph::OnSelectionChanged() { ClearHighlights(); } - AZ::u32 Graph::GetNewVariableCounter() + AZ::u32 EditorGraph::GetNewVariableCounter() { return ++m_variableCounter; } - void Graph::ReleaseVariableCounter(AZ::u32 variableCounter) + void EditorGraph::ReleaseVariableCounter(AZ::u32 variableCounter) { if (m_variableCounter == variableCounter) { @@ -1693,32 +1681,32 @@ namespace ScriptCanvasEditor } } - void Graph::RequestUndoPoint() + void EditorGraph::RequestUndoPoint() { GeneralRequestBus::Broadcast(&GeneralRequests::PostUndoPoint, GetScriptCanvasId()); } - void Graph::RequestPushPreventUndoStateUpdate() + void EditorGraph::RequestPushPreventUndoStateUpdate() { GeneralRequestBus::Broadcast(&GeneralRequests::PushPreventUndoStateUpdate); } - void Graph::RequestPopPreventUndoStateUpdate() + void EditorGraph::RequestPopPreventUndoStateUpdate() { GeneralRequestBus::Broadcast(&GeneralRequests::PopPreventUndoStateUpdate); } - void Graph::TriggerUndo() + void EditorGraph::TriggerUndo() { GeneralRequestBus::Broadcast(&GeneralRequests::TriggerUndo); } - void Graph::TriggerRedo() + void EditorGraph::TriggerRedo() { GeneralRequestBus::Broadcast(&GeneralRequests::TriggerRedo); } - void Graph::EnableNodes(const AZStd::unordered_set< GraphCanvas::NodeId >& nodeIds) + void EditorGraph::EnableNodes(const AZStd::unordered_set< GraphCanvas::NodeId >& nodeIds) { bool enabledNodes = false; for (auto graphCanvasNodeId : nodeIds) @@ -1744,7 +1732,7 @@ namespace ScriptCanvasEditor } } - void Graph::DisableNodes(const AZStd::unordered_set< GraphCanvas::NodeId >& nodeIds) + void EditorGraph::DisableNodes(const AZStd::unordered_set< GraphCanvas::NodeId >& nodeIds) { bool disabledNodes = false; for (auto graphCanvasNodeId : nodeIds) @@ -1765,12 +1753,12 @@ namespace ScriptCanvasEditor } } - void Graph::PostDeletionEvent() + void EditorGraph::PostDeletionEvent() { GeneralRequestBus::Broadcast(&GeneralRequests::PostUndoPoint, GetScriptCanvasId()); } - void Graph::PostCreationEvent() + void EditorGraph::PostCreationEvent() { GeneralRequestBus::Broadcast(&GeneralRequests::PushPreventUndoStateUpdate); if (m_wrapperNodeDropTarget.IsValid()) @@ -1978,7 +1966,7 @@ namespace ScriptCanvasEditor GeneralRequestBus::Broadcast(&GeneralRequests::PostUndoPoint, GetScriptCanvasId()); } - void Graph::PostRestore(const UndoData&) + void EditorGraph::PostRestore(const UndoData&) { AZStd::vector graphCanvasNodeIds; GraphCanvas::SceneRequestBus::EventResult(graphCanvasNodeIds, GetGraphCanvasGraphId(), &GraphCanvas::SceneRequests::GetNodes); @@ -1994,23 +1982,23 @@ namespace ScriptCanvasEditor GraphCanvas::ViewRequestBus::Event(viewId, &GraphCanvas::ViewRequests::RefreshView); } - void Graph::OnPasteBegin() + void EditorGraph::OnPasteBegin() { GeneralRequestBus::Broadcast(&GeneralRequests::PushPreventUndoStateUpdate); } - void Graph::OnPasteEnd() + void EditorGraph::OnPasteEnd() { GeneralRequestBus::Broadcast(&GeneralRequests::PopPreventUndoStateUpdate); GeneralRequestBus::Broadcast(&GeneralRequests::PostUndoPoint, GetScriptCanvasId()); } - void Graph::OnGraphCanvasNodeCreated(const AZ::EntityId& nodeId) + void EditorGraph::OnGraphCanvasNodeCreated(const AZ::EntityId& nodeId) { m_lastGraphCanvasCreationGroup.emplace_back(nodeId); } - void Graph::ResetSlotToDefaultValue(const GraphCanvas::Endpoint& endpoint) + void EditorGraph::ResetSlotToDefaultValue(const GraphCanvas::Endpoint& endpoint) { ScriptCanvas::Endpoint scEndpoint = ConvertToScriptCanvasEndpoint(endpoint); @@ -2022,13 +2010,13 @@ namespace ScriptCanvasEditor } } - void Graph::ResetReference(const GraphCanvas::Endpoint& endpoint) + void EditorGraph::ResetReference(const GraphCanvas::Endpoint& endpoint) { // ResetSlotToDefault deals with resetting the reference internal to the function call on the node. ResetSlotToDefaultValue(endpoint); } - void Graph::ResetProperty(const GraphCanvas::NodeId& nodeId, const AZ::Crc32& propertyId) + void EditorGraph::ResetProperty(const GraphCanvas::NodeId& nodeId, const AZ::Crc32& propertyId) { AZ::EntityId scriptCanvasNodeId = ConvertToScriptCanvasNodeId(nodeId); ScriptCanvas::Node* canvasNode = FindNode(scriptCanvasNodeId); @@ -2039,7 +2027,7 @@ namespace ScriptCanvasEditor } } - void Graph::RemoveSlot(const GraphCanvas::Endpoint& endpoint) + void EditorGraph::RemoveSlot(const GraphCanvas::Endpoint& endpoint) { ScriptCanvas::Endpoint scEndpoint = ConvertToScriptCanvasEndpoint(endpoint); @@ -2066,7 +2054,7 @@ namespace ScriptCanvasEditor } } - bool Graph::IsSlotRemovable(const GraphCanvas::Endpoint& endpoint) const + bool EditorGraph::IsSlotRemovable(const GraphCanvas::Endpoint& endpoint) const { ScriptCanvas::Endpoint scEndpoint = ConvertToScriptCanvasEndpoint(endpoint); @@ -2080,7 +2068,7 @@ namespace ScriptCanvasEditor return false; } - bool Graph::ConvertSlotToReference(const GraphCanvas::Endpoint& endpoint, bool isNewSlot) + bool EditorGraph::ConvertSlotToReference(const GraphCanvas::Endpoint& endpoint, bool isNewSlot) { ScriptCanvas::Endpoint scEndpoint = ConvertToScriptCanvasEndpoint(endpoint); ScriptCanvas::Node* canvasNode = FindNode(scEndpoint.GetNodeId()); @@ -2093,7 +2081,7 @@ namespace ScriptCanvasEditor return false; } - bool Graph::CanConvertSlotToReference(const GraphCanvas::Endpoint& endpoint, bool isNewSlot) + bool EditorGraph::CanConvertSlotToReference(const GraphCanvas::Endpoint& endpoint, bool isNewSlot) { ScriptCanvas::Endpoint scEndpoint = ConvertToScriptCanvasEndpoint(endpoint); ScriptCanvas::Node* canvasNode = FindNode(scEndpoint.GetNodeId()); @@ -2110,7 +2098,7 @@ namespace ScriptCanvasEditor return false; } - GraphCanvas::CanHandleMimeEventOutcome Graph::CanHandleReferenceMimeEvent(const GraphCanvas::Endpoint& endpoint, const QMimeData* mimeData) + GraphCanvas::CanHandleMimeEventOutcome EditorGraph::CanHandleReferenceMimeEvent(const GraphCanvas::Endpoint& endpoint, const QMimeData* mimeData) { ScriptCanvas::Endpoint scEndpoint = ConvertToScriptCanvasEndpoint(endpoint); ScriptCanvas::Node* canvasNode = FindNode(scEndpoint.GetNodeId()); @@ -2143,7 +2131,7 @@ namespace ScriptCanvasEditor return AZ::Failure(AZStd::string("Unable to find Node")); } - bool Graph::HandleReferenceMimeEvent(const GraphCanvas::Endpoint& endpoint, const QMimeData* mimeData) + bool EditorGraph::HandleReferenceMimeEvent(const GraphCanvas::Endpoint& endpoint, const QMimeData* mimeData) { bool handledEvent = false; @@ -2169,7 +2157,7 @@ namespace ScriptCanvasEditor return handledEvent; } - bool Graph::CanPromoteToVariable(const GraphCanvas::Endpoint& endpoint, [[maybe_unused]] bool isNewSlot) const + bool EditorGraph::CanPromoteToVariable(const GraphCanvas::Endpoint& endpoint, [[maybe_unused]] bool isNewSlot) const { ScriptCanvas::Endpoint scriptCanvasEndpoint = ConvertToScriptCanvasEndpoint(endpoint); auto activeSlot = FindSlot(scriptCanvasEndpoint); @@ -2188,7 +2176,7 @@ namespace ScriptCanvasEditor return false; } - bool Graph::PromoteToVariableAction(const GraphCanvas::Endpoint& endpoint, bool isNewSlot) + bool EditorGraph::PromoteToVariableAction(const GraphCanvas::Endpoint& endpoint, bool isNewSlot) { ScriptCanvas::Endpoint scriptCanvasEndpoint = ConvertToScriptCanvasEndpoint(endpoint); @@ -2294,7 +2282,7 @@ namespace ScriptCanvasEditor return addOutcome.IsSuccess(); } - bool Graph::SynchronizeReferences(const GraphCanvas::Endpoint& referenceSource, const GraphCanvas::Endpoint& referenceTarget) + bool EditorGraph::SynchronizeReferences(const GraphCanvas::Endpoint& referenceSource, const GraphCanvas::Endpoint& referenceTarget) { ScriptCanvas::Endpoint scriptCanvasSourceEndpoint = ConvertToScriptCanvasEndpoint(referenceSource); ScriptCanvas::Endpoint scriptCanvasTargetEndpoint = ConvertToScriptCanvasEndpoint(referenceTarget); @@ -2332,7 +2320,7 @@ namespace ScriptCanvasEditor return false; } - bool Graph::ConvertSlotToValue(const GraphCanvas::Endpoint& endpoint) + bool EditorGraph::ConvertSlotToValue(const GraphCanvas::Endpoint& endpoint) { ScriptCanvas::Endpoint scEndpoint = ConvertToScriptCanvasEndpoint(endpoint); ScriptCanvas::Node* canvasNode = FindNode(scEndpoint.GetNodeId()); @@ -2345,7 +2333,7 @@ namespace ScriptCanvasEditor return false; } - bool Graph::CanConvertSlotToValue(const GraphCanvas::Endpoint& endpoint) + bool EditorGraph::CanConvertSlotToValue(const GraphCanvas::Endpoint& endpoint) { ScriptCanvas::Endpoint scEndpoint = ConvertToScriptCanvasEndpoint(endpoint); ScriptCanvas::Node* canvasNode = FindNode(scEndpoint.GetNodeId()); @@ -2359,7 +2347,7 @@ namespace ScriptCanvasEditor return false; } - GraphCanvas::CanHandleMimeEventOutcome Graph::CanHandleValueMimeEvent(const GraphCanvas::Endpoint& endpoint, const QMimeData* mimeData) + GraphCanvas::CanHandleMimeEventOutcome EditorGraph::CanHandleValueMimeEvent(const GraphCanvas::Endpoint& endpoint, const QMimeData* mimeData) { AZ_UNUSED(endpoint); AZ_UNUSED(mimeData); @@ -2369,7 +2357,7 @@ namespace ScriptCanvasEditor return AZ::Failure(AZStd::string("Unimplemented drag and drop flow")); } - bool Graph::HandleValueMimeEvent(const GraphCanvas::Endpoint& endpoint, const QMimeData* mimeData) + bool EditorGraph::HandleValueMimeEvent(const GraphCanvas::Endpoint& endpoint, const QMimeData* mimeData) { AZ_UNUSED(endpoint); AZ_UNUSED(mimeData); @@ -2377,7 +2365,7 @@ namespace ScriptCanvasEditor return false; } - GraphCanvas::SlotId Graph::RequestExtension(const GraphCanvas::NodeId& nodeId, const GraphCanvas::ExtenderId& extenderId, GraphModelRequests::ExtensionRequestReason reason) + GraphCanvas::SlotId EditorGraph::RequestExtension(const GraphCanvas::NodeId& nodeId, const GraphCanvas::ExtenderId& extenderId, GraphModelRequests::ExtensionRequestReason reason) { GraphCanvas::SlotId graphCanvasSlotId; @@ -2412,7 +2400,7 @@ namespace ScriptCanvasEditor return graphCanvasSlotId; } - void Graph::ExtensionCancelled(const GraphCanvas::NodeId& nodeId, const GraphCanvas::ExtenderId& extenderId) + void EditorGraph::ExtensionCancelled(const GraphCanvas::NodeId& nodeId, const GraphCanvas::ExtenderId& extenderId) { AZ::EntityId scNodeId = ConvertToScriptCanvasNodeId(nodeId); @@ -2427,7 +2415,7 @@ namespace ScriptCanvasEditor } } - void Graph::FinalizeExtension(const GraphCanvas::NodeId& nodeId, const GraphCanvas::ExtenderId& extenderId) + void EditorGraph::FinalizeExtension(const GraphCanvas::NodeId& nodeId, const GraphCanvas::ExtenderId& extenderId) { AZ::EntityId scNodeId = ConvertToScriptCanvasNodeId(nodeId); @@ -2442,7 +2430,7 @@ namespace ScriptCanvasEditor } } - bool Graph::ShouldWrapperAcceptDrop(const AZ::EntityId& wrapperNode, const QMimeData* mimeData) const + bool EditorGraph::ShouldWrapperAcceptDrop(const AZ::EntityId& wrapperNode, const QMimeData* mimeData) const { if (!mimeData->hasFormat(Widget::NodePaletteDockWidget::GetMimeType())) { @@ -2490,7 +2478,7 @@ namespace ScriptCanvasEditor return true; } - void Graph::AddWrapperDropTarget(const AZ::EntityId& wrapperNode) + void EditorGraph::AddWrapperDropTarget(const AZ::EntityId& wrapperNode) { if (!m_wrapperNodeDropTarget.IsValid()) { @@ -2498,7 +2486,7 @@ namespace ScriptCanvasEditor } } - void Graph::RemoveWrapperDropTarget(const AZ::EntityId& wrapperNode) + void EditorGraph::RemoveWrapperDropTarget(const AZ::EntityId& wrapperNode) { if (m_wrapperNodeDropTarget == wrapperNode) { @@ -2506,7 +2494,7 @@ namespace ScriptCanvasEditor } } - GraphCanvas::GraphId Graph::GetGraphCanvasGraphId() const + GraphCanvas::GraphId EditorGraph::GetGraphCanvasGraphId() const { if (m_saveFormatConverted) { @@ -2523,7 +2511,7 @@ namespace ScriptCanvasEditor } } - NodeIdPair Graph::CreateCustomNode(const AZ::Uuid& typeId, const AZ::Vector2& position) + NodeIdPair EditorGraph::CreateCustomNode(const AZ::Uuid& typeId, const AZ::Vector2& position) { CreateCustomNodeMimeEvent mimeEvent(typeId); @@ -2537,7 +2525,7 @@ namespace ScriptCanvasEditor return NodeIdPair(); } - void Graph::AddCrcCache(const AZ::Crc32& crcValue, const AZStd::string& cacheString) + void EditorGraph::AddCrcCache(const AZ::Crc32& crcValue, const AZStd::string& cacheString) { auto mapIter = m_crcCacheMap.find(crcValue); @@ -2551,7 +2539,7 @@ namespace ScriptCanvasEditor } } - void Graph::RemoveCrcCache(const AZ::Crc32& crcValue) + void EditorGraph::RemoveCrcCache(const AZ::Crc32& crcValue) { auto mapIter = m_crcCacheMap.find(crcValue); @@ -2566,7 +2554,7 @@ namespace ScriptCanvasEditor } } - AZStd::string Graph::DecodeCrc(const AZ::Crc32& crcValue) + AZStd::string EditorGraph::DecodeCrc(const AZ::Crc32& crcValue) { auto mapIter = m_crcCacheMap.find(crcValue); @@ -2578,7 +2566,7 @@ namespace ScriptCanvasEditor return ""; } - void Graph::ClearHighlights() + void EditorGraph::ClearHighlights() { for (const GraphCanvas::GraphicsEffectId& effectId : m_highlights) { @@ -2588,7 +2576,7 @@ namespace ScriptCanvasEditor m_highlights.clear(); } - void Graph::HighlightMembersFromTreeItem(const GraphCanvas::GraphCanvasTreeItem* treeItem) + void EditorGraph::HighlightMembersFromTreeItem(const GraphCanvas::GraphCanvasTreeItem* treeItem) { ClearHighlights(); @@ -2606,7 +2594,7 @@ namespace ScriptCanvasEditor } } - void Graph::HighlightVariables(const AZStd::unordered_set< ScriptCanvas::VariableId >& variableIds) + void EditorGraph::HighlightVariables(const AZStd::unordered_set< ScriptCanvas::VariableId >& variableIds) { ClearHighlights(); @@ -2621,7 +2609,7 @@ namespace ScriptCanvasEditor } } - void Graph::HighlightNodes(const AZStd::vector& nodes) + void EditorGraph::HighlightNodes(const AZStd::vector& nodes) { ClearHighlights(); @@ -2631,7 +2619,7 @@ namespace ScriptCanvasEditor } } - void Graph::RemoveUnusedVariables() + void EditorGraph::RemoveUnusedVariables() { RequestPushPreventUndoStateUpdate(); auto variableData = GetVariableData(); @@ -2677,7 +2665,7 @@ namespace ScriptCanvasEditor } } - bool Graph::CanConvertVariableNodeToReference(const GraphCanvas::NodeId& nodeId) + bool EditorGraph::CanConvertVariableNodeToReference(const GraphCanvas::NodeId& nodeId) { AZ::EntityId scriptCanvasNodeId = ConvertToScriptCanvasNodeId(nodeId); @@ -2723,7 +2711,7 @@ namespace ScriptCanvasEditor return false; } - bool Graph::ConvertVariableNodeToReference(const GraphCanvas::NodeId& nodeId) + bool EditorGraph::ConvertVariableNodeToReference(const GraphCanvas::NodeId& nodeId) { AZ::EntityId scriptCanvasNodeId = ConvertToScriptCanvasNodeId(nodeId); @@ -2897,12 +2885,12 @@ namespace ScriptCanvasEditor return true; } - bool Graph::ConvertReferenceToVariableNode([[maybe_unused]] const GraphCanvas::Endpoint& endpoint) + bool EditorGraph::ConvertReferenceToVariableNode([[maybe_unused]] const GraphCanvas::Endpoint& endpoint) { return false; } - bool Graph::OnVersionConversionBegin(ScriptCanvas::Node& scriptCanvasNode) + bool EditorGraph::OnVersionConversionBegin(ScriptCanvas::Node& scriptCanvasNode) { auto insertResult = m_convertingNodes.insert(scriptCanvasNode.GetEntityId()); @@ -2921,7 +2909,7 @@ namespace ScriptCanvasEditor return true; } - void Graph::OnVersionConversionEnd(ScriptCanvas::Node& scriptCanvasNode) + void EditorGraph::OnVersionConversionEnd(ScriptCanvas::Node& scriptCanvasNode) { EditorNodeNotificationBus::Event(scriptCanvasNode.GetEntityId(), &EditorNodeNotifications::OnVersionConversionEnd); @@ -3039,7 +3027,7 @@ namespace ScriptCanvasEditor } } - AZStd::vector Graph::GetNodesOfType(const ScriptCanvas::NodeTypeIdentifier& nodeTypeIdentifier) + AZStd::vector EditorGraph::GetNodesOfType(const ScriptCanvas::NodeTypeIdentifier& nodeTypeIdentifier) { AZStd::vector nodeIdPairs; @@ -3118,7 +3106,7 @@ namespace ScriptCanvasEditor return nodeIdPairs; } - AZStd::vector Graph::GetVariableNodes(const ScriptCanvas::VariableId& variableId) + AZStd::vector EditorGraph::GetVariableNodes(const ScriptCanvas::VariableId& variableId) { AZStd::vector variableNodes; @@ -3141,7 +3129,7 @@ namespace ScriptCanvasEditor return variableNodes; } - void Graph::QueueVersionUpdate(const AZ::EntityId& graphCanvasNodeId) + void EditorGraph::QueueVersionUpdate(const AZ::EntityId& graphCanvasNodeId) { bool queueUpdate = m_queuedConvertingNodes.empty(); auto insertResult = m_queuedConvertingNodes.insert(graphCanvasNodeId); @@ -3153,7 +3141,7 @@ namespace ScriptCanvasEditor } } - bool Graph::CanExposeEndpoint(const GraphCanvas::Endpoint& endpoint) + bool EditorGraph::CanExposeEndpoint(const GraphCanvas::Endpoint& endpoint) { bool isEnabled = false; @@ -3211,7 +3199,7 @@ namespace ScriptCanvasEditor return isEnabled && !isNodeling; } - ScriptCanvas::Endpoint Graph::ConvertToScriptCanvasEndpoint(const GraphCanvas::Endpoint& endpoint) const + ScriptCanvas::Endpoint EditorGraph::ConvertToScriptCanvasEndpoint(const GraphCanvas::Endpoint& endpoint) const { AZStd::any* userData = nullptr; @@ -3228,7 +3216,7 @@ namespace ScriptCanvasEditor return scriptCanvasEndpoint; } - GraphCanvas::Endpoint Graph::ConvertToGraphCanvasEndpoint(const ScriptCanvas::Endpoint& endpoint) const + GraphCanvas::Endpoint EditorGraph::ConvertToGraphCanvasEndpoint(const ScriptCanvas::Endpoint& endpoint) const { GraphCanvas::Endpoint graphCanvasEndpoint; @@ -3238,7 +3226,7 @@ namespace ScriptCanvasEditor return graphCanvasEndpoint; } - void Graph::OnSaveDataDirtied(const AZ::EntityId& savedElement) + void EditorGraph::OnSaveDataDirtied(const AZ::EntityId& savedElement) { // The EbusHandlerEvent's are a visual only representation of alternative data, and should not be saved. if (EBusHandlerEventNodeDescriptorRequestBus::FindFirstHandler(savedElement) != nullptr @@ -3290,12 +3278,12 @@ namespace ScriptCanvasEditor } } - bool Graph::NeedsSaveConversion() const + bool EditorGraph::NeedsSaveConversion() const { return !m_saveFormatConverted; } - void Graph::ConvertSaveFormat() + void EditorGraph::ConvertSaveFormat() { if (!m_saveFormatConverted) { @@ -3324,7 +3312,7 @@ namespace ScriptCanvasEditor } } - void Graph::ConstructSaveData() + void EditorGraph::ConstructSaveData() { // Save out the SceneData // @@ -3343,7 +3331,7 @@ namespace ScriptCanvasEditor } } - void Graph::OnToastInteraction() + void EditorGraph::OnToastInteraction() { const AzToolsFramework::ToastId* toastId = AzToolsFramework::ToastNotificationBus::GetCurrentBusId(); @@ -3368,7 +3356,7 @@ namespace ScriptCanvasEditor } } - void Graph::OnToastDismissed() + void EditorGraph::OnToastDismissed() { const AzToolsFramework::ToastId* toastId = AzToolsFramework::ToastNotificationBus::GetCurrentBusId(); @@ -3378,7 +3366,7 @@ namespace ScriptCanvasEditor } } - void Graph::OnUndoRedoEnd() + void EditorGraph::OnUndoRedoEnd() { for (const auto& nodePair : GetNodeMapping()) { @@ -3386,7 +3374,7 @@ namespace ScriptCanvasEditor } } - void Graph::ReportError(const ScriptCanvas::Node& node, const AZStd::string& errorSource, const AZStd::string& errorMessage) + void EditorGraph::ReportError(const ScriptCanvas::Node& node, const AZStd::string& errorSource, const AZStd::string& errorMessage) { AzQtComponents::ToastConfiguration toastConfiguration(AzQtComponents::ToastType::Error, errorSource.c_str(), errorMessage.c_str()); @@ -3400,13 +3388,13 @@ namespace ScriptCanvasEditor m_toastNodeIds[toastId] = node.GetEntityId(); } - void Graph::UnregisterToast(const AzToolsFramework::ToastId& toastId) + void EditorGraph::UnregisterToast(const AzToolsFramework::ToastId& toastId) { AzToolsFramework::ToastNotificationBus::MultiHandler::BusDisconnect(toastId); m_toastNodeIds.erase(toastId); } - void Graph::DisplayUpdateToast() + void EditorGraph::DisplayUpdateToast() { GraphCanvas::ViewId viewId; GraphCanvas::SceneRequestBus::EventResult(viewId, GetGraphCanvasGraphId(), &GraphCanvas::SceneRequests::GetViewId); @@ -3440,12 +3428,12 @@ namespace ScriptCanvasEditor } } - const GraphStatisticsHelper& Graph::GetNodeUsageStatistics() const + const GraphStatisticsHelper& EditorGraph::GetNodeUsageStatistics() const { return m_statisticsHelper; } - void Graph::CreateGraphCanvasScene() + void EditorGraph::CreateGraphCanvasScene() { if (!m_saveFormatConverted) { @@ -3490,7 +3478,7 @@ namespace ScriptCanvasEditor m_focusHelper.SetActiveGraph(GetGraphCanvasGraphId()); } - bool Graph::UpgradeGraph(SourceHandle& asset, UpgradeRequest request, bool isVerbose) + bool EditorGraph::UpgradeGraph(SourceHandle& asset, UpgradeRequest request, bool isVerbose) { m_upgradeSM.SetAsset(asset); m_upgradeSM.SetVerbose(isVerbose); @@ -3507,7 +3495,7 @@ namespace ScriptCanvasEditor } } - void Graph::ConnectGraphCanvasBuses() + void EditorGraph::ConnectGraphCanvasBuses() { GraphCanvas::GraphId graphCanvasGraphId = GetGraphCanvasGraphId(); @@ -3515,14 +3503,14 @@ namespace ScriptCanvasEditor GraphCanvas::SceneNotificationBus::Handler::BusConnect(graphCanvasGraphId); } - void Graph::DisconnectGraphCanvasBuses() + void EditorGraph::DisconnectGraphCanvasBuses() { GraphCanvas::GraphModelRequestBus::Handler::BusDisconnect(); GraphCanvas::SceneNotificationBus::Handler::BusDisconnect(); } - void Graph::OnSystemTick() + void EditorGraph::OnSystemTick() { if (!m_allowVersionUpdate) { @@ -3537,7 +3525,7 @@ namespace ScriptCanvasEditor } } - void Graph::DisplayGraphCanvasScene() + void EditorGraph::DisplayGraphCanvasScene() { m_variableDataModel.Activate(GetScriptCanvasId()); @@ -3837,17 +3825,17 @@ namespace ScriptCanvasEditor MarkVersion(); } - void Graph::OnGraphCanvasSceneVisible() + void EditorGraph::OnGraphCanvasSceneVisible() { DisplayUpdateToast(); } - AZStd::unordered_map< AZ::EntityId, GraphCanvas::EntitySaveDataContainer* > Graph::GetGraphCanvasSaveData() + AZStd::unordered_map< AZ::EntityId, GraphCanvas::EntitySaveDataContainer* > EditorGraph::GetGraphCanvasSaveData() { return m_graphCanvasSaveData; } - void Graph::UpdateGraphCanvasSaveData(const AZStd::unordered_map< AZ::EntityId, GraphCanvas::EntitySaveDataContainer* >& saveData) + void EditorGraph::UpdateGraphCanvasSaveData(const AZStd::unordered_map< AZ::EntityId, GraphCanvas::EntitySaveDataContainer* >& saveData) { QScopedValueRollback ignoreRequests(m_ignoreSaveRequests, true); @@ -3866,7 +3854,7 @@ namespace ScriptCanvasEditor DisplayGraphCanvasScene(); } - void Graph::ClearGraphCanvasScene() + void EditorGraph::ClearGraphCanvasScene() { GraphCanvas::GraphId graphCanvasGraphId = GetGraphCanvasGraphId(); diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp index 363f477fbf..6b20348e78 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp @@ -166,7 +166,7 @@ namespace ScriptCanvasEditor } } - void GraphStatisticsHelper::PopulateStatisticData(const Graph* editorGraph) + void GraphStatisticsHelper::PopulateStatisticData(const EditorGraph* editorGraph) { // Opportunistically use this time to refresh out node count array. m_nodeIdentifierCount.clear(); diff --git a/Gems/ScriptCanvas/Code/Editor/Components/GraphUpgrade.cpp b/Gems/ScriptCanvas/Code/Editor/Components/GraphUpgrade.cpp index fec813b0c1..d23c371096 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/GraphUpgrade.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/GraphUpgrade.cpp @@ -25,7 +25,7 @@ namespace ScriptCanvasEditor namespace Helpers { - static AZStd::string ConnectionToText(ScriptCanvasEditor::Graph* graph, ScriptCanvas::Endpoint& from, ScriptCanvas::Endpoint& to) + static AZStd::string ConnectionToText(ScriptCanvasEditor::EditorGraph* graph, ScriptCanvas::Endpoint& from, ScriptCanvas::Endpoint& to) { AZ_Assert(graph, "A valid graph must be provided"); @@ -653,7 +653,7 @@ namespace ScriptCanvasEditor #define RegisterState(stateName) m_states.emplace_back(new stateName(this)); - EditorGraphUpgradeMachine::EditorGraphUpgradeMachine(Graph* graph) + EditorGraphUpgradeMachine::EditorGraphUpgradeMachine(EditorGraph* graph) : m_graph(graph) { RegisterState(Start); diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h index ba7ff6abaf..34d4c62d7f 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h @@ -45,7 +45,7 @@ namespace ScriptCanvas namespace ScriptCanvasEditor { //! EditorGraph is the editor version of the ScriptCanvas::Graph component that is activated when executing the script canvas engine - class Graph + class EditorGraph : public ScriptCanvas::Graph , private NodeCreationNotificationBus::Handler , private SceneCounterRequestBus::Handler @@ -77,7 +77,7 @@ namespace ScriptCanvasEditor typedef AZStd::unordered_map< AZ::EntityId, AZ::EntityId > WrappedNodeGroupingMap; - static void ConvertToGetVariableNode(Graph* graph, ScriptCanvas::VariableId variableId, const AZ::EntityId& nodeId, AZStd::unordered_map& setVariableRemapping); + static void ConvertToGetVariableNode(EditorGraph* graph, ScriptCanvas::VariableId variableId, const AZ::EntityId& nodeId, AZStd::unordered_map& setVariableRemapping); struct CRCCache { @@ -100,13 +100,13 @@ namespace ScriptCanvasEditor }; public: - AZ_COMPONENT(Graph, "{4D755CA9-AB92-462C-B24F-0B3376F19967}", ScriptCanvas::Graph); + AZ_COMPONENT(EditorGraph, "{4D755CA9-AB92-462C-B24F-0B3376F19967}", ScriptCanvas::Graph); static ScriptCanvas::DataPtr Create(); static void Reflect(AZ::ReflectContext* context); - Graph(const ScriptCanvas::ScriptCanvasId& scriptCanvasId = AZ::Entity::MakeId()) + EditorGraph(const ScriptCanvas::ScriptCanvasId& scriptCanvasId = AZ::Entity::MakeId()) : ScriptCanvas::Graph(scriptCanvasId) , m_variableCounter(0) , m_graphCanvasSceneEntity(nullptr) @@ -115,11 +115,21 @@ namespace ScriptCanvasEditor , m_upgradeSM(this) {} - ~Graph() override; + ~EditorGraph() override; void Activate() override; void Deactivate() override; + static const char* GetMimeType() + { + return "application/x-o3de-scriptcanvas"; + } + + static const char* GetWrappedNodeGroupingMimeType() + { + return "application/x-03de-scriptcanvas-wrappednodegrouping"; + } + static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided) { ScriptCanvas::Graph::GetProvidedServices(provided); @@ -326,7 +336,7 @@ namespace ScriptCanvasEditor void UnregisterToast(const AzToolsFramework::ToastId& toastId); - Graph(const Graph&) = delete; + EditorGraph(const EditorGraph&) = delete; void DisplayUpdateToast(); diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorUtils.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorUtils.h index a4522198b7..d99da61d8d 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorUtils.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorUtils.h @@ -28,7 +28,7 @@ namespace ScriptCanvasEditor // if CompleteDescription() succeeds, sets the handle to the result, else does nothing bool CompleteDescriptionInPlace(SourceHandle& source); - class Graph; + class EditorGraph; class NodePaletteModel; class NodeIdentifierFactory @@ -48,7 +48,7 @@ namespace ScriptCanvasEditor virtual ~GraphStatisticsHelper() = default; - void PopulateStatisticData(const Graph* editorGraph); + void PopulateStatisticData(const EditorGraph* editorGraph); AZStd::unordered_map< ScriptCanvas::NodeTypeIdentifier, int > m_nodeIdentifierCount; diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/GraphUpgrade.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/GraphUpgrade.h index 9fedc2d1f3..78b59e48d1 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/GraphUpgrade.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/GraphUpgrade.h @@ -20,7 +20,7 @@ namespace ScriptCanvas namespace ScriptCanvasEditor { - class Graph; + class EditorGraph; class StateMachine; //! StateTraits provides each state the ability to provide its own compile time ID @@ -158,7 +158,7 @@ namespace ScriptCanvasEditor public: AZ_RTTI(EditorGraphUpgradeMachine, "{C7EABC22-A3DD-4ABE-8303-418EA3CD1246}", StateMachine); - EditorGraphUpgradeMachine(Graph* graph); + EditorGraphUpgradeMachine(EditorGraph* graph); AZStd::unordered_set m_allNodes; AZStd::unordered_set m_outOfDateNodes; @@ -180,7 +180,7 @@ namespace ScriptCanvasEditor bool m_graphNeedsDirtying = false; - Graph* m_graph = nullptr; + EditorGraph* m_graph = nullptr; SourceHandle m_asset; void SetAsset(SourceHandle& assetasset); diff --git a/Gems/ScriptCanvas/Code/Editor/ScriptCanvasEditorGem.cpp b/Gems/ScriptCanvas/Code/Editor/ScriptCanvasEditorGem.cpp index 7c204e8790..1a3bb0e4f9 100644 --- a/Gems/ScriptCanvas/Code/Editor/ScriptCanvasEditorGem.cpp +++ b/Gems/ScriptCanvas/Code/Editor/ScriptCanvasEditorGem.cpp @@ -81,7 +81,7 @@ namespace ScriptCanvas ScriptCanvasEditor::EditorAssetSystemComponent::CreateDescriptor(), ScriptCanvasEditor::EditorScriptCanvasComponent::CreateDescriptor(), ScriptCanvasEditor::EntityMimeDataHandler::CreateDescriptor(), - ScriptCanvasEditor::Graph::CreateDescriptor(), + ScriptCanvasEditor::EditorGraph::CreateDescriptor(), ScriptCanvasEditor::IconComponent::CreateDescriptor(), ScriptCanvasEditor::ReflectComponent::CreateDescriptor(), ScriptCanvasEditor::SystemComponent::CreateDescriptor(), diff --git a/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp b/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp index 1b5e97ba36..6087dfb98f 100644 --- a/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp @@ -183,7 +183,7 @@ namespace ScriptCanvasEditor { if (entity) { - auto graph = entity->CreateComponent(); + auto graph = entity->CreateComponent(); entity->CreateComponent(graph->GetScriptCanvasId()); } } diff --git a/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.cpp b/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.cpp index f497b83b08..eb42daa3d8 100644 --- a/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.cpp @@ -35,7 +35,7 @@ namespace ScriptCanvasEditor { } - void GraphItemCommand::Capture(Graph*, bool) + void GraphItemCommand::Capture(EditorGraph*, bool) { } @@ -104,7 +104,7 @@ namespace ScriptCanvasEditor RestoreItem(m_redoState); } - void GraphItemChangeCommand::Capture(Graph* graph, bool captureUndo) + void GraphItemChangeCommand::Capture(EditorGraph* graph, bool captureUndo) { m_scriptCanvasId = graph->GetScriptCanvasId(); m_graphCanvasGraphId = graph->GetGraphCanvasGraphId(); @@ -203,7 +203,7 @@ namespace ScriptCanvasEditor RestoreItem(m_redoState); } - void GraphItemAddCommand::Capture(Graph* graph, bool) + void GraphItemAddCommand::Capture(EditorGraph* graph, bool) { GraphItemChangeCommand::Capture(graph, false); } @@ -224,7 +224,7 @@ namespace ScriptCanvasEditor RestoreItem(m_redoState); } - void GraphItemRemovalCommand::Capture(Graph* graph, bool) + void GraphItemRemovalCommand::Capture(EditorGraph* graph, bool) { GraphItemChangeCommand::Capture(graph, true); } diff --git a/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.h b/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.h index 9b36a7beb0..38eb1099ac 100644 --- a/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.h +++ b/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.h @@ -44,7 +44,7 @@ namespace ScriptCanvasEditor void Undo() override; void Redo() override; - virtual void Capture(Graph* graph, bool captureUndo); + virtual void Capture(EditorGraph* graph, bool captureUndo); bool Changed() const override; @@ -74,7 +74,7 @@ namespace ScriptCanvasEditor void Undo() override; void Redo() override; - void Capture(Graph* graph, bool captureUndo) override; + void Capture(EditorGraph* graph, bool captureUndo) override; void RestoreItem(const AZStd::vector& restoreBuffer) override; @@ -101,7 +101,7 @@ namespace ScriptCanvasEditor void Undo() override; void Redo() override; - void Capture(Graph* graph, bool captureUndo) override; + void Capture(EditorGraph* graph, bool captureUndo) override; protected: GraphItemAddCommand(const GraphItemAddCommand&) = delete; @@ -122,7 +122,7 @@ namespace ScriptCanvasEditor void Undo() override; void Redo() override; - void Capture(Graph* graph, bool captureUndo) override; + void Capture(EditorGraph* graph, bool captureUndo) override; protected: GraphItemRemovalCommand(const GraphItemRemovalCommand&) = delete; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index b5b4fc7787..c0b6758147 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -1545,7 +1545,7 @@ namespace ScriptCanvasEditor { int outTabIndex = -1; - ScriptCanvas::DataPtr graph = Graph::Create(); + ScriptCanvas::DataPtr graph = EditorGraph::Create(); AZ::Uuid assetId = AZ::Uuid::CreateRandom(); ScriptCanvasEditor::SourceHandle handle = ScriptCanvasEditor::SourceHandle(graph, assetId, assetPath); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp index 39cd6f565e..7646ef9dcd 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp @@ -154,7 +154,7 @@ namespace ScriptCanvasEditor { asset.Mod()->UpgradeGraph ( asset - , m_view->forceUpgrade->isChecked() ? Graph::UpgradeRequest::Forced : Graph::UpgradeRequest::IfOutOfDate + , m_view->forceUpgrade->isChecked() ? EditorGraph::UpgradeRequest::Forced : EditorGraph::UpgradeRequest::IfOutOfDate , m_view->verbose->isChecked()); } }; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp index 1e00e70075..7f659952e8 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp @@ -328,9 +328,9 @@ namespace ScriptCanvas return AZ::EntityUtils::FindFirstDerivedComponent(m_scriptCanvasEntity.get()); } - const ScriptCanvasEditor::Graph* ScriptCanvasData::GetEditorGraph() const + const ScriptCanvasEditor::EditorGraph* ScriptCanvasData::GetEditorGraph() const { - return reinterpret_cast(GetGraph()); + return reinterpret_cast(GetGraph()); } Graph* ScriptCanvasData::ModGraph() @@ -338,8 +338,8 @@ namespace ScriptCanvas return AZ::EntityUtils::FindFirstDerivedComponent(m_scriptCanvasEntity.get()); } - ScriptCanvasEditor::Graph* ScriptCanvasData::ModEditorGraph() + ScriptCanvasEditor::EditorGraph* ScriptCanvasData::ModEditorGraph() { - return reinterpret_cast(ModGraph()); + return reinterpret_cast(ModGraph()); } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h index c29a648eca..5de5c7adb8 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h @@ -316,10 +316,10 @@ namespace ScriptCanvas namespace ScriptCanvasEditor { - class Graph; + class EditorGraph; - using GraphPtr = Graph*; - using GraphPtrConst = const Graph*; + using GraphPtr = EditorGraph*; + using GraphPtrConst = const EditorGraph*; class SourceDescription { @@ -411,11 +411,11 @@ namespace ScriptCanvas const Graph* GetGraph() const; - const ScriptCanvasEditor::Graph* GetEditorGraph() const; + const ScriptCanvasEditor::EditorGraph* GetEditorGraph() const; Graph* ModGraph(); - ScriptCanvasEditor::Graph* ModEditorGraph(); + ScriptCanvasEditor::EditorGraph* ModEditorGraph(); AZStd::unique_ptr m_scriptCanvasEntity; private: diff --git a/Gems/Vegetation/Code/Tests/VegetationMocks.h b/Gems/Vegetation/Code/Tests/VegetationMocks.h index ece0833433..3361afa177 100644 --- a/Gems/Vegetation/Code/Tests/VegetationMocks.h +++ b/Gems/Vegetation/Code/Tests/VegetationMocks.h @@ -444,6 +444,15 @@ namespace UnitTest m_GetVisibilityOutput = visibility; } + void SetRayTracingEnabled([[maybe_unused]] bool enabled) override + { + } + + bool GetRayTracingEnabled() const override + { + return false; + } + AZ::Data::AssetId m_assetIdOutput; void SetModelAssetId(AZ::Data::AssetId modelAssetId) override { diff --git a/Gems/WhiteBox/Code/CMakeLists.txt b/Gems/WhiteBox/Code/CMakeLists.txt index 91536503ac..1a37a1ce34 100644 --- a/Gems/WhiteBox/Code/CMakeLists.txt +++ b/Gems/WhiteBox/Code/CMakeLists.txt @@ -198,6 +198,8 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) AZ::AzTestShared AZ::AzManipulatorTestFramework.Static Gem::WhiteBox.Editor.Static + RUNTIME_DEPENDENCIES + Gem::PhysX.Editor ) ly_add_googletest( diff --git a/cmake/PAL.cmake b/cmake/PAL.cmake index ef431ff92a..0359408200 100644 --- a/cmake/PAL.cmake +++ b/cmake/PAL.cmake @@ -298,21 +298,27 @@ function(ly_get_absolute_pal_filename out_name in_name) # parent relative path is optional if(${ARGC} GREATER 4) - set(parent_relative_path ${ARGV4}) + if(ARGV4) + set(parent_relative_path ${ARGV4}) + endif() endif() # The Default object path for path is the LY_ROOT_FOLDER cmake_path(SET object_path NORMALIZE "${LY_ROOT_FOLDER}") if(${ARGC} GREATER 3) - # The user has supplied an object restricted path, the object path for consideration - cmake_path(SET object_path NORMALIZE ${ARGV3}) + if(ARGV3) + # The user has supplied an object restricted path, the object path for consideration + cmake_path(SET object_path NORMALIZE ${ARGV3}) + endif() endif() # The default restricted object path is O3DE_ENGINE_RESTRICTED_PATH cmake_path(SET object_restricted_path NORMALIZE "${O3DE_ENGINE_RESTRICTED_PATH}") if(${ARGC} GREATER 2) - # The user has supplied an object restricted path - cmake_path(SET object_restricted_path NORMALIZE ${ARGV2}) + if(ARGV3) + # The user has supplied an object restricted path + cmake_path(SET object_restricted_path NORMALIZE ${ARGV2}) + endif() endif() if(${ARGC} GREATER 4) @@ -394,27 +400,33 @@ function(ly_get_list_relative_pal_filename out_name in_name) # parent relative path is optional if(${ARGC} GREATER 4) - set(parent_relative_path ${ARGV4}) + if(ARGV4) + set(parent_relative_path ${ARGV4}) + endif() endif() # The Default object path for path is the LY_ROOT_FOLDER cmake_path(SET object_path NORMALIZE "${LY_ROOT_FOLDER}") if(${ARGC} GREATER 3) - # The user has supplied an object restricted path, the object path for consideration - cmake_path(SET object_path NORMALIZE ${ARGV3}) + if(ARGV3) + # The user has supplied an object restricted path, the object path for consideration + cmake_path(SET object_path NORMALIZE ${ARGV3}) + endif() endif() # The default restricted object path is O3DE_ENGINE_RESTRICTED_PATH cmake_path(SET object_restricted_path NORMALIZE "${O3DE_ENGINE_RESTRICTED_PATH}") if(${ARGC} GREATER 2) - # The user has supplied an object restricted path - cmake_path(SET object_restricted_path NORMALIZE ${ARGV2}) + if(ARGV2) + # The user has supplied an object restricted path + cmake_path(SET object_restricted_path NORMALIZE ${ARGV2}) + endif() endif() if(${ARGC} GREATER 4) - o3de_pal_dir(abs_name ${in_name} ${object_restricted_path} ${object_path} ${parent_relative_path}) + o3de_pal_dir(abs_name ${in_name} "${object_restricted_path}" "${object_path}" "${parent_relative_path}") else() - o3de_pal_dir(abs_name ${in_name} ${object_restricted_path} ${object_path}) + o3de_pal_dir(abs_name ${in_name} "${object_restricted_path}" "${object_path}") endif() cmake_path(RELATIVE_PATH abs_name BASE_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} OUTPUT_VARIABLE relative_name)