From e85b5a8c48c1e47ad00eab7c13f4be2bffef84e6 Mon Sep 17 00:00:00 2001 From: guthadam Date: Wed, 9 Jun 2021 00:35:31 -0500 Subject: [PATCH 1/5] Fixing material editor startup and critical asset issues Added builder and tool aliases Added dependency to Atom Bridge --- Gems/Atom/Tools/MaterialEditor/Code/CMakeLists.txt | 5 +++++ Gems/Atom/Tools/MaterialEditor/gem.json | 10 ++++++++++ Gems/AtomLyIntegration/AtomBridge/Code/CMakeLists.txt | 1 + 3 files changed, 16 insertions(+) create mode 100644 Gems/Atom/Tools/MaterialEditor/gem.json diff --git a/Gems/Atom/Tools/MaterialEditor/Code/CMakeLists.txt b/Gems/Atom/Tools/MaterialEditor/Code/CMakeLists.txt index 134f605200..dddb339cfb 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/CMakeLists.txt +++ b/Gems/Atom/Tools/MaterialEditor/Code/CMakeLists.txt @@ -113,6 +113,11 @@ ly_add_target( Gem::MaterialEditor.Document ) +# Add a 'builders' alias to allow the MaterialEditor root gem path to be added to the generated +# cmake_dependencies..assetprocessor.setreg to allow the asset scan folder for it to be added +ly_create_alias(NAME MaterialEditor.Builders NAMESPACE Gem) +ly_create_alias(NAME MaterialEditor.Tools NAMESPACE Gem) + # Add build dependency to Editor for the MaterialEditor application since # Editor opens up the MaterialEditor ly_add_dependencies(Editor Gem::MaterialEditor) diff --git a/Gems/Atom/Tools/MaterialEditor/gem.json b/Gems/Atom/Tools/MaterialEditor/gem.json new file mode 100644 index 0000000000..5113effc0a --- /dev/null +++ b/Gems/Atom/Tools/MaterialEditor/gem.json @@ -0,0 +1,10 @@ +{ + "gem_name": "MaterialEditor", + "display_name": "Atom Material Editor", + "summary": "Editor for creating, modifying, and previewing materials", + "canonical_tags": [ + "Gem" + ], + "user_tags": [ + ] +} diff --git a/Gems/AtomLyIntegration/AtomBridge/Code/CMakeLists.txt b/Gems/AtomLyIntegration/AtomBridge/Code/CMakeLists.txt index 4df40e3d13..abc4dfb2c6 100644 --- a/Gems/AtomLyIntegration/AtomBridge/Code/CMakeLists.txt +++ b/Gems/AtomLyIntegration/AtomBridge/Code/CMakeLists.txt @@ -111,6 +111,7 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) Gem::AtomToolsFramework.Editor Gem::AtomViewportDisplayInfo Gem::AtomViewportDisplayIcons.Editor + Gem::MaterialEditor.Builders ) From 0fbeec7f176169074ef64535ec81794f0e5ca2b5 Mon Sep 17 00:00:00 2001 From: guthadam Date: Wed, 9 Jun 2021 11:57:21 -0500 Subject: [PATCH 2/5] Enabling linux compilation --- Gems/Atom/Tools/MaterialEditor/Code/CMakeLists.txt | 1 - .../MaterialEditor/Code/Source/Platform/Linux/PAL_linux.cmake | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Gems/Atom/Tools/MaterialEditor/Code/CMakeLists.txt b/Gems/Atom/Tools/MaterialEditor/Code/CMakeLists.txt index dddb339cfb..07449fe59f 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/CMakeLists.txt +++ b/Gems/Atom/Tools/MaterialEditor/Code/CMakeLists.txt @@ -116,7 +116,6 @@ ly_add_target( # Add a 'builders' alias to allow the MaterialEditor root gem path to be added to the generated # cmake_dependencies..assetprocessor.setreg to allow the asset scan folder for it to be added ly_create_alias(NAME MaterialEditor.Builders NAMESPACE Gem) -ly_create_alias(NAME MaterialEditor.Tools NAMESPACE Gem) # Add build dependency to Editor for the MaterialEditor application since # Editor opens up the MaterialEditor diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Platform/Linux/PAL_linux.cmake b/Gems/Atom/Tools/MaterialEditor/Code/Source/Platform/Linux/PAL_linux.cmake index 70d49fdb2c..77d41d4561 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Platform/Linux/PAL_linux.cmake +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Platform/Linux/PAL_linux.cmake @@ -9,4 +9,4 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # -set(PAL_TRAIT_ATOM_MATERIAL_EDITOR_APPLICATION_SUPPORTED FALSE) +set(PAL_TRAIT_ATOM_MATERIAL_EDITOR_APPLICATION_SUPPORTED TRUE) From 6675d06b677d89c099b2ab933a4c219cb806708c Mon Sep 17 00:00:00 2001 From: guthadam Date: Wed, 9 Jun 2021 12:32:55 -0500 Subject: [PATCH 3/5] Fixing linux build --- .../Window/PerformanceMonitor/PerformanceMonitorWidget.cpp | 2 +- .../Source/Window/PerformanceMonitor/PerformanceMonitorWidget.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PerformanceMonitor/PerformanceMonitorWidget.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PerformanceMonitor/PerformanceMonitorWidget.cpp index 72c8daa63c..70a4361409 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PerformanceMonitor/PerformanceMonitorWidget.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PerformanceMonitor/PerformanceMonitorWidget.cpp @@ -15,7 +15,7 @@ #include #include -#include +#include namespace MaterialEditor { diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PerformanceMonitor/PerformanceMonitorWidget.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PerformanceMonitor/PerformanceMonitorWidget.h index a75e856d83..dd31faef90 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PerformanceMonitor/PerformanceMonitorWidget.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PerformanceMonitor/PerformanceMonitorWidget.h @@ -13,7 +13,7 @@ #pragma once #include -#include +#include namespace Ui { From af42705bc9dd8433a1b04d439de3785f74651bbd Mon Sep 17 00:00:00 2001 From: guthadam Date: Wed, 9 Jun 2021 12:49:35 -0500 Subject: [PATCH 4/5] Fixing linux build --- .../Code/Source/Window/MaterialEditorBrowserInteractions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorBrowserInteractions.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorBrowserInteractions.cpp index 9b79bcb6d9..c4007616c5 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorBrowserInteractions.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorBrowserInteractions.cpp @@ -30,7 +30,7 @@ #include #include -#include +#include #include #include From 1339d453fc828879513acd3a2cac48d66df8aff9 Mon Sep 17 00:00:00 2001 From: guthadam Date: Wed, 9 Jun 2021 13:21:59 -0500 Subject: [PATCH 5/5] Adding PAL implementation for Linux --- .../Platform/Linux/MaterialEditor_Linux.cpp | 42 +++++++++++++++++++ .../Linux/MaterialEditor_Traits_Linux.h | 15 +++++++ .../Linux/MaterialEditor_Traits_Platform.h | 14 +++++++ .../Platform/Linux/platform_linux_files.cmake | 3 ++ 4 files changed, 74 insertions(+) create mode 100644 Gems/Atom/Tools/MaterialEditor/Code/Source/Platform/Linux/MaterialEditor_Linux.cpp create mode 100644 Gems/Atom/Tools/MaterialEditor/Code/Source/Platform/Linux/MaterialEditor_Traits_Linux.h create mode 100644 Gems/Atom/Tools/MaterialEditor/Code/Source/Platform/Linux/MaterialEditor_Traits_Platform.h diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Platform/Linux/MaterialEditor_Linux.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Platform/Linux/MaterialEditor_Linux.cpp new file mode 100644 index 0000000000..6a83c8c6de --- /dev/null +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Platform/Linux/MaterialEditor_Linux.cpp @@ -0,0 +1,42 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates, or +* a third party where indicated. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#include +#include +#include + +namespace Platform +{ + void LoadPluginDependencies() + { + AZ_Warning("Material Editor", false, "LoadPluginDependencies() function is not implemented"); + } + + void ProcessInput(void* message) + { + AZ_Warning("Material Editor", false, "ProcessInput() function is not implemented"); + } + + AzFramework::NativeWindowHandle GetWindowHandle(WId winId) + { + AZ_Warning("Material Editor", false, "GetWindowHandle() function is not implemented"); + AZ_UNUSED(winId); + return nullptr; + } + + AzFramework::WindowSize GetClientAreaSize(AzFramework::NativeWindowHandle window) + { + AZ_Warning("Material Editor", false, "GetClientAreaSize() function is not implemented"); + AZ_UNUSED(window); + return AzFramework::WindowSize{1,1}; + } +} diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Platform/Linux/MaterialEditor_Traits_Linux.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Platform/Linux/MaterialEditor_Traits_Linux.h new file mode 100644 index 0000000000..6f4eee610a --- /dev/null +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Platform/Linux/MaterialEditor_Traits_Linux.h @@ -0,0 +1,15 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ +#pragma once + +#define AZ_TRAIT_MATERIALEDITOR_EXT "" + diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Platform/Linux/MaterialEditor_Traits_Platform.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Platform/Linux/MaterialEditor_Traits_Platform.h new file mode 100644 index 0000000000..9cd502877d --- /dev/null +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Platform/Linux/MaterialEditor_Traits_Platform.h @@ -0,0 +1,14 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ +#pragma once + +#include diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Platform/Linux/platform_linux_files.cmake b/Gems/Atom/Tools/MaterialEditor/Code/Source/Platform/Linux/platform_linux_files.cmake index 5714be5dfb..038a605109 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Platform/Linux/platform_linux_files.cmake +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Platform/Linux/platform_linux_files.cmake @@ -10,4 +10,7 @@ # set(FILES + MaterialEditor_Traits_Platform.h + MaterialEditor_Traits_Linux.h + MaterialEditor_Linux.cpp )