Atom Tools: Removing unnecessary modules, components, and dead code from ME
• Working toward creating a standalone application template Removing application level modules and system components that make it difficult to navigate the project and add a lot of boilerplate code • Temporarily keeping viewport module and components because shutting down the application deactivates module entities before system entities without respecting component service dependency order. This caused several RPI assets and names to leak because they were not being destroyed in the correct order. • Fixing include paths not referenced source folders • Mostly cleanup and reorganization, no behavioral changes Signed-off-by: Guthrie Adams <guthadam@amazon.com>
This commit is contained in:
@@ -7,18 +7,17 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/RTTI/RTTI.h>
|
||||
#include <AzCore/Asset/AssetCommon.h>
|
||||
#include <AzCore/Component/TickBus.h>
|
||||
#include <AzCore/Asset/AssetCommon.h>
|
||||
#include <AzCore/RTTI/RTTI.h>
|
||||
#include <AzToolsFramework/API/EditorAssetSystemAPI.h>
|
||||
|
||||
#include <Atom/RPI.Reflect/Material/MaterialAsset.h>
|
||||
#include <Atom/RPI.Edit/Material/MaterialSourceData.h>
|
||||
#include <Atom/RPI.Edit/Material/MaterialTypeSourceData.h>
|
||||
#include <Atom/RPI.Public/Material/Material.h>
|
||||
#include <Atom/Document/MaterialDocumentRequestBus.h>
|
||||
#include <Atom/RPI.Reflect/Material/MaterialAsset.h>
|
||||
#include <AtomToolsFramework/Document/AtomToolsDocument.h>
|
||||
#include <Document/MaterialDocumentRequestBus.h>
|
||||
|
||||
namespace MaterialEditor
|
||||
{
|
||||
|
||||
@@ -1,30 +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 <Atom/Document/MaterialDocumentModule.h>
|
||||
#include <AzToolsFramework/Asset/AssetSystemComponent.h>
|
||||
#include <Document/MaterialDocumentSystemComponent.h>
|
||||
|
||||
namespace MaterialEditor
|
||||
{
|
||||
MaterialDocumentModule::MaterialDocumentModule()
|
||||
{
|
||||
// Push results of [MyComponent]::CreateDescriptor() into m_descriptors here.
|
||||
m_descriptors.insert(m_descriptors.end(), {
|
||||
MaterialDocumentSystemComponent::CreateDescriptor(),
|
||||
});
|
||||
}
|
||||
|
||||
AZ::ComponentTypeList MaterialDocumentModule::GetRequiredSystemComponents() const
|
||||
{
|
||||
return AZ::ComponentTypeList{
|
||||
azrtti_typeid<AzToolsFramework::AssetSystem::AssetSystemComponent>(),
|
||||
azrtti_typeid<MaterialDocumentSystemComponent>(),
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <Atom/RPI.Public/Material/Material.h>
|
||||
#include <Atom/RPI.Reflect/Material/MaterialAsset.h>
|
||||
#include <Atom/RPI.Reflect/Material/MaterialPropertyDescriptor.h>
|
||||
#include <AzCore/Asset/AssetCommon.h>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
namespace RPI
|
||||
{
|
||||
class MaterialSourceData;
|
||||
class MaterialTypeSourceData;
|
||||
} // namespace RPI
|
||||
} // namespace AZ
|
||||
|
||||
namespace MaterialEditor
|
||||
{
|
||||
//! UVs are processed in a property group but will be handled differently.
|
||||
static constexpr const char UvGroupName[] = "uvSets";
|
||||
|
||||
class MaterialDocumentRequests
|
||||
: public AZ::EBusTraits
|
||||
{
|
||||
public:
|
||||
static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Multiple;
|
||||
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById;
|
||||
typedef AZ::Uuid BusIdType;
|
||||
|
||||
//! Get material asset created by MaterialDocument
|
||||
virtual AZ::Data::Asset<AZ::RPI::MaterialAsset> GetAsset() const = 0;
|
||||
|
||||
//! Get material instance created from asset loaded by MaterialDocument
|
||||
virtual AZ::Data::Instance<AZ::RPI::Material> GetInstance() const = 0;
|
||||
|
||||
//! Get the internal material source data
|
||||
virtual const AZ::RPI::MaterialSourceData* GetMaterialSourceData() const = 0;
|
||||
|
||||
//! Get the internal material type source data
|
||||
virtual const AZ::RPI::MaterialTypeSourceData* GetMaterialTypeSourceData() const = 0;
|
||||
};
|
||||
|
||||
using MaterialDocumentRequestBus = AZ::EBus<MaterialDocumentRequests>;
|
||||
} // namespace MaterialEditor
|
||||
@@ -6,9 +6,9 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <Atom/Document/MaterialDocumentSettings.h>
|
||||
#include <AzCore/RTTI/BehaviorContext.h>
|
||||
#include <AzCore/Serialization/EditContext.h>
|
||||
#include <Document/MaterialDocumentSettings.h>
|
||||
|
||||
namespace MaterialEditor
|
||||
{
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* 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
|
||||
|
||||
#if !defined(Q_MOC_RUN)
|
||||
#include <AzCore/Memory/Memory.h>
|
||||
#include <AzCore/RTTI/RTTI.h>
|
||||
#include <AzCore/RTTI/ReflectContext.h>
|
||||
#include <AzCore/UserSettings/UserSettings.h>
|
||||
#endif
|
||||
|
||||
namespace MaterialEditor
|
||||
{
|
||||
struct MaterialDocumentSettings
|
||||
: public AZ::UserSettings
|
||||
{
|
||||
AZ_RTTI(MaterialDocumentSettings, "{12E8461F-65AD-4AD2-8A1D-82C3B1183522}", AZ::UserSettings);
|
||||
AZ_CLASS_ALLOCATOR(MaterialDocumentSettings, AZ::SystemAllocator, 0);
|
||||
|
||||
static void Reflect(AZ::ReflectContext* context);
|
||||
|
||||
AZStd::string m_defaultMaterialTypeName = "StandardPBR";
|
||||
};
|
||||
} // namespace MaterialEditor
|
||||
-85
@@ -1,85 +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 <Atom/Document/MaterialDocumentRequestBus.h>
|
||||
#include <Atom/Document/MaterialDocumentSettings.h>
|
||||
#include <AtomToolsFramework/Document/AtomToolsDocumentSystemRequestBus.h>
|
||||
#include <AzCore/RTTI/BehaviorContext.h>
|
||||
#include <AzCore/Serialization/EditContext.h>
|
||||
#include <AzCore/Serialization/SerializeContext.h>
|
||||
#include <Document/MaterialDocument.h>
|
||||
#include <Document/MaterialDocumentSystemComponent.h>
|
||||
|
||||
namespace MaterialEditor
|
||||
{
|
||||
void MaterialDocumentSystemComponent::Reflect(AZ::ReflectContext* context)
|
||||
{
|
||||
MaterialDocumentSettings::Reflect(context);
|
||||
|
||||
if (AZ::SerializeContext* serialize = azrtti_cast<AZ::SerializeContext*>(context))
|
||||
{
|
||||
serialize->Class<MaterialDocumentSystemComponent, AZ::Component>()
|
||||
->Version(0);
|
||||
|
||||
if (AZ::EditContext* ec = serialize->GetEditContext())
|
||||
{
|
||||
ec->Class<MaterialDocumentSystemComponent>("MaterialDocumentSystemComponent", "Tool for editing Atom material files")
|
||||
->ClassElement(AZ::Edit::ClassElements::EditorData, "")
|
||||
->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC_CE("System"))
|
||||
->Attribute(AZ::Edit::Attributes::AutoExpand, true)
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
if (AZ::BehaviorContext* behaviorContext = azrtti_cast<AZ::BehaviorContext*>(context))
|
||||
{
|
||||
behaviorContext->EBus<MaterialDocumentRequestBus>("MaterialDocumentRequestBus")
|
||||
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common)
|
||||
->Attribute(AZ::Script::Attributes::Category, "Editor")
|
||||
->Attribute(AZ::Script::Attributes::Module, "materialeditor")
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
void MaterialDocumentSystemComponent::GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required)
|
||||
{
|
||||
required.push_back(AZ_CRC_CE("AtomToolsDocumentSystemService"));
|
||||
required.push_back(AZ_CRC_CE("AssetProcessorToolsConnection"));
|
||||
required.push_back(AZ_CRC_CE("AssetDatabaseService"));
|
||||
required.push_back(AZ_CRC_CE("PropertyManagerService"));
|
||||
required.push_back(AZ_CRC_CE("RPISystem"));
|
||||
}
|
||||
|
||||
void MaterialDocumentSystemComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided)
|
||||
{
|
||||
provided.push_back(AZ_CRC_CE("MaterialDocumentSystemService"));
|
||||
}
|
||||
|
||||
void MaterialDocumentSystemComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible)
|
||||
{
|
||||
incompatible.push_back(AZ_CRC_CE("MaterialDocumentSystemService"));
|
||||
}
|
||||
|
||||
void MaterialDocumentSystemComponent::Init()
|
||||
{
|
||||
}
|
||||
|
||||
void MaterialDocumentSystemComponent::Activate()
|
||||
{
|
||||
AtomToolsFramework::AtomToolsDocumentSystemRequestBus::Broadcast(
|
||||
&AtomToolsFramework::AtomToolsDocumentSystemRequestBus::Handler::RegisterDocumentType,
|
||||
[]()
|
||||
{
|
||||
return aznew MaterialDocument();
|
||||
});
|
||||
}
|
||||
|
||||
void MaterialDocumentSystemComponent::Deactivate()
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/Component/Component.h>
|
||||
|
||||
namespace MaterialEditor
|
||||
{
|
||||
//! MaterialDocumentSystemComponent
|
||||
class MaterialDocumentSystemComponent
|
||||
: public AZ::Component
|
||||
{
|
||||
public:
|
||||
AZ_COMPONENT(MaterialDocumentSystemComponent, "{E011DA51-855D-45FA-87A3-1C1CD6379091}");
|
||||
|
||||
MaterialDocumentSystemComponent() = default;
|
||||
~MaterialDocumentSystemComponent() = default;
|
||||
MaterialDocumentSystemComponent(const MaterialDocumentSystemComponent&) = delete;
|
||||
MaterialDocumentSystemComponent& operator=(const MaterialDocumentSystemComponent&) = delete;
|
||||
|
||||
static void Reflect(AZ::ReflectContext* context);
|
||||
|
||||
static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required);
|
||||
static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided);
|
||||
static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible);
|
||||
|
||||
private:
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// AZ::Component interface implementation
|
||||
void Init() override;
|
||||
void Activate() override;
|
||||
void Deactivate() override;
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
};
|
||||
} // namespace MaterialEditor
|
||||
@@ -6,22 +6,73 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <Atom/Document/MaterialDocumentModule.h>
|
||||
#include <Atom/Viewport/MaterialViewportModule.h>
|
||||
#include <Atom/Window/MaterialEditorWindowModule.h>
|
||||
#include <AtomToolsFramework/Document/AtomToolsDocumentSystemRequestBus.h>
|
||||
#include <AzCore/RTTI/BehaviorContext.h>
|
||||
#include <AzCore/Serialization/EditContext.h>
|
||||
#include <AzCore/Serialization/SerializeContext.h>
|
||||
#include <AzCore/Settings/SettingsRegistryMergeUtils.h>
|
||||
#include <AzToolsFramework/API/ToolsApplicationAPI.h>
|
||||
#include <Document/MaterialDocument.h>
|
||||
#include <Document/MaterialDocumentRequestBus.h>
|
||||
#include <Document/MaterialDocumentSettings.h>
|
||||
#include <MaterialEditorApplication.h>
|
||||
#include <MaterialEditor_Traits_Platform.h>
|
||||
#include <Viewport/MaterialViewportModule.h>
|
||||
#include <Window/MaterialEditorWindow.h>
|
||||
#include <Window/MaterialEditorWindowSettings.h>
|
||||
|
||||
void InitMaterialEditorResources()
|
||||
{
|
||||
// Must register qt resources from other modules
|
||||
Q_INIT_RESOURCE(MaterialEditor);
|
||||
Q_INIT_RESOURCE(InspectorWidget);
|
||||
Q_INIT_RESOURCE(AtomToolsAssetBrowser);
|
||||
}
|
||||
|
||||
namespace MaterialEditor
|
||||
{
|
||||
//! This function returns the build system target name of "MaterialEditor"
|
||||
AZStd::string MaterialEditorApplication::GetBuildTargetName() const
|
||||
MaterialEditorApplication::MaterialEditorApplication(int* argc, char*** argv)
|
||||
: Base(argc, argv)
|
||||
{
|
||||
#if !defined(LY_CMAKE_TARGET)
|
||||
#error "LY_CMAKE_TARGET must be defined in order to add this source file to a CMake executable target"
|
||||
#endif
|
||||
return AZStd::string{ LY_CMAKE_TARGET };
|
||||
InitMaterialEditorResources();
|
||||
|
||||
QApplication::setApplicationName("O3DE Material Editor");
|
||||
|
||||
// The settings registry has been created at this point, so add the CMake target
|
||||
AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddBuildSystemTargetSpecialization(
|
||||
*AZ::SettingsRegistry::Get(), GetBuildTargetName());
|
||||
|
||||
AzToolsFramework::EditorWindowRequestBus::Handler::BusConnect();
|
||||
AtomToolsFramework::AtomToolsMainWindowFactoryRequestBus::Handler::BusConnect();
|
||||
}
|
||||
|
||||
MaterialEditorApplication::~MaterialEditorApplication()
|
||||
{
|
||||
AtomToolsFramework::AtomToolsMainWindowFactoryRequestBus::Handler::BusDisconnect();
|
||||
AzToolsFramework::EditorWindowRequestBus::Handler::BusDisconnect();
|
||||
m_window.reset();
|
||||
}
|
||||
|
||||
void MaterialEditorApplication::Reflect(AZ::ReflectContext* context)
|
||||
{
|
||||
Base::Reflect(context);
|
||||
MaterialDocumentSettings::Reflect(context);
|
||||
MaterialEditorWindowSettings::Reflect(context);
|
||||
|
||||
if (AZ::BehaviorContext* behaviorContext = azrtti_cast<AZ::BehaviorContext*>(context))
|
||||
{
|
||||
behaviorContext->EBus<MaterialDocumentRequestBus>("MaterialDocumentRequestBus")
|
||||
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common)
|
||||
->Attribute(AZ::Script::Attributes::Category, "Editor")
|
||||
->Attribute(AZ::Script::Attributes::Module, "materialeditor")
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
void MaterialEditorApplication::CreateStaticModules(AZStd::vector<AZ::Module*>& outModules)
|
||||
{
|
||||
Base::CreateStaticModules(outModules);
|
||||
outModules.push_back(aznew MaterialViewportModule);
|
||||
}
|
||||
|
||||
const char* MaterialEditorApplication::GetCurrentConfigurationName() const
|
||||
@@ -35,26 +86,42 @@ namespace MaterialEditor
|
||||
#endif
|
||||
}
|
||||
|
||||
MaterialEditorApplication::MaterialEditorApplication(int* argc, char*** argv)
|
||||
: Base(argc, argv)
|
||||
void MaterialEditorApplication::StartCommon(AZ::Entity* systemEntity)
|
||||
{
|
||||
QApplication::setApplicationName("O3DE Material Editor");
|
||||
Base::StartCommon(systemEntity);
|
||||
|
||||
// The settings registry has been created at this point, so add the CMake target
|
||||
AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddBuildSystemTargetSpecialization(
|
||||
*AZ::SettingsRegistry::Get(), GetBuildTargetName());
|
||||
AtomToolsFramework::AtomToolsDocumentSystemRequestBus::Broadcast(
|
||||
&AtomToolsFramework::AtomToolsDocumentSystemRequestBus::Handler::RegisterDocumentType,
|
||||
[]() { return aznew MaterialDocument(); });
|
||||
}
|
||||
|
||||
void MaterialEditorApplication::CreateStaticModules(AZStd::vector<AZ::Module*>& outModules)
|
||||
AZStd::string MaterialEditorApplication::GetBuildTargetName() const
|
||||
{
|
||||
Base::CreateStaticModules(outModules);
|
||||
outModules.push_back(aznew MaterialDocumentModule);
|
||||
outModules.push_back(aznew MaterialViewportModule);
|
||||
outModules.push_back(aznew MaterialEditorWindowModule);
|
||||
#if !defined(LY_CMAKE_TARGET)
|
||||
#error "LY_CMAKE_TARGET must be defined in order to add this source file to a CMake executable target"
|
||||
#endif
|
||||
//! Returns the build system target name of "MaterialEditor"
|
||||
return AZStd::string{ LY_CMAKE_TARGET };
|
||||
}
|
||||
|
||||
AZStd::vector<AZStd::string> MaterialEditorApplication::GetCriticalAssetFilters() const
|
||||
{
|
||||
return AZStd::vector<AZStd::string>({ "passes/", "config/", "MaterialEditor/" });
|
||||
}
|
||||
|
||||
void MaterialEditorApplication::CreateMainWindow()
|
||||
{
|
||||
m_materialEditorBrowserInteractions.reset(aznew MaterialEditorBrowserInteractions);
|
||||
m_window.reset(aznew MaterialEditorWindow);
|
||||
}
|
||||
|
||||
void MaterialEditorApplication::DestroyMainWindow()
|
||||
{
|
||||
m_window.reset();
|
||||
}
|
||||
|
||||
QWidget* MaterialEditorApplication::GetAppMainWindow()
|
||||
{
|
||||
return m_window.get();
|
||||
}
|
||||
} // namespace MaterialEditor
|
||||
|
||||
@@ -9,6 +9,10 @@
|
||||
#pragma once
|
||||
|
||||
#include <AtomToolsFramework/Document/AtomToolsDocumentApplication.h>
|
||||
#include <AtomToolsFramework/Window/AtomToolsMainWindowFactoryRequestBus.h>
|
||||
#include <AzToolsFramework/API/EditorWindowRequestBus.h>
|
||||
#include <Window/MaterialEditorBrowserInteractions.h>
|
||||
#include <Window/MaterialEditorWindow.h>
|
||||
|
||||
namespace MaterialEditor
|
||||
{
|
||||
@@ -16,6 +20,8 @@ namespace MaterialEditor
|
||||
|
||||
class MaterialEditorApplication
|
||||
: public AtomToolsFramework::AtomToolsDocumentApplication
|
||||
, private AzToolsFramework::EditorWindowRequestBus::Handler
|
||||
, private AtomToolsFramework::AtomToolsMainWindowFactoryRequestBus::Handler
|
||||
{
|
||||
public:
|
||||
AZ_TYPE_INFO(MaterialEditor::MaterialEditorApplication, "{30F90CA5-1253-49B5-8143-19CEE37E22BB}");
|
||||
@@ -23,13 +29,26 @@ namespace MaterialEditor
|
||||
using Base = AtomToolsFramework::AtomToolsDocumentApplication;
|
||||
|
||||
MaterialEditorApplication(int* argc, char*** argv);
|
||||
~MaterialEditorApplication();
|
||||
|
||||
// AzFramework::Application overrides...
|
||||
void Reflect(AZ::ReflectContext* context) override;
|
||||
void CreateStaticModules(AZStd::vector<AZ::Module*>& outModules) override;
|
||||
const char* GetCurrentConfigurationName() const override;
|
||||
void StartCommon(AZ::Entity* systemEntity) override;
|
||||
|
||||
// AtomToolsFramework::AtomToolsApplication overrides...
|
||||
AZStd::string GetBuildTargetName() const override;
|
||||
AZStd::vector<AZStd::string> GetCriticalAssetFilters() const override;
|
||||
|
||||
// AtomToolsMainWindowFactoryRequestBus::Handler overrides...
|
||||
void CreateMainWindow() override;
|
||||
void DestroyMainWindow() override;
|
||||
|
||||
// AzToolsFramework::EditorWindowRequests::Bus::Handler
|
||||
QWidget* GetAppMainWindow() override;
|
||||
|
||||
AZStd::unique_ptr<MaterialEditorWindow> m_window;
|
||||
AZStd::unique_ptr<MaterialEditorBrowserInteractions> m_materialEditorBrowserInteractions;
|
||||
};
|
||||
} // namespace MaterialEditor
|
||||
|
||||
@@ -6,10 +6,9 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <AzCore/Math/Vector3.h>
|
||||
#include <AzCore/Component/TransformBus.h>
|
||||
|
||||
#include <Source/Viewport/InputController/Behavior.h>
|
||||
#include <AzCore/Math/Vector3.h>
|
||||
#include <Viewport/InputController/Behavior.h>
|
||||
#include <Viewport/InputController/MaterialEditorViewportInputController.h>
|
||||
|
||||
namespace MaterialEditor
|
||||
|
||||
+2
-2
@@ -6,11 +6,11 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <AzCore/Component/TransformBus.h>
|
||||
#include <AzCore/Math/MathUtils.h>
|
||||
#include <AzCore/Math/Vector3.h>
|
||||
#include <AzCore/Component/TransformBus.h>
|
||||
#include <Viewport/InputController/DollyCameraBehavior.h>
|
||||
#include <Viewport/InputController/MaterialEditorViewportInputController.h>
|
||||
#include <Source/Viewport/InputController/DollyCameraBehavior.h>
|
||||
|
||||
namespace MaterialEditor
|
||||
{
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <Source/Viewport/InputController/Behavior.h>
|
||||
#include <Viewport/InputController/Behavior.h>
|
||||
|
||||
namespace MaterialEditor
|
||||
{
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <Source/Viewport/InputController/IdleBehavior.h>
|
||||
#include <Viewport/InputController/IdleBehavior.h>
|
||||
|
||||
namespace MaterialEditor
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <Source/Viewport/InputController/Behavior.h>
|
||||
#include <Viewport/InputController/Behavior.h>
|
||||
|
||||
namespace MaterialEditor
|
||||
{
|
||||
|
||||
+12
-12
@@ -9,30 +9,30 @@
|
||||
#include <QApplication>
|
||||
#include <QWidget>
|
||||
|
||||
#include <AzCore/Serialization/SerializeContext.h>
|
||||
#include <AzCore/Component/TransformBus.h>
|
||||
#include <AzCore/Math/Matrix4x4.h>
|
||||
#include <AzCore/Serialization/SerializeContext.h>
|
||||
|
||||
#include <AzFramework/Components/CameraBus.h>
|
||||
#include <AzFramework/Input/Devices/Keyboard/InputDeviceKeyboard.h>
|
||||
#include <AzFramework/Input/Devices/Mouse/InputDeviceMouse.h>
|
||||
#include <AzFramework/Components/CameraBus.h>
|
||||
#include <AzFramework/Viewport/ScreenGeometry.h>
|
||||
#include <AzToolsFramework/Viewport/ViewportMessages.h>
|
||||
|
||||
#include <AtomLyIntegration/CommonFeatures/Mesh/MeshComponentBus.h>
|
||||
#include <Atom/Feature/SkyBox/SkyBoxFeatureProcessorInterface.h>
|
||||
#include <Atom/RPI.Public/RPISystemInterface.h>
|
||||
#include <Atom/RPI.Public/Scene.h>
|
||||
#include <Atom/RPI.Reflect/Model/ModelAsset.h>
|
||||
#include <Atom/Feature/SkyBox/SkyBoxFeatureProcessorInterface.h>
|
||||
#include <AtomLyIntegration/CommonFeatures/Mesh/MeshComponentBus.h>
|
||||
|
||||
#include <Source/Viewport/InputController/MaterialEditorViewportInputController.h>
|
||||
#include <Source/Viewport/InputController/IdleBehavior.h>
|
||||
#include <Source/Viewport/InputController/PanCameraBehavior.h>
|
||||
#include <Source/Viewport/InputController/OrbitCameraBehavior.h>
|
||||
#include <Source/Viewport/InputController/MoveCameraBehavior.h>
|
||||
#include <Source/Viewport/InputController/DollyCameraBehavior.h>
|
||||
#include <Source/Viewport/InputController/RotateModelBehavior.h>
|
||||
#include <Source/Viewport/InputController/RotateEnvironmentBehavior.h>
|
||||
#include <Viewport/InputController/DollyCameraBehavior.h>
|
||||
#include <Viewport/InputController/IdleBehavior.h>
|
||||
#include <Viewport/InputController/MaterialEditorViewportInputController.h>
|
||||
#include <Viewport/InputController/MoveCameraBehavior.h>
|
||||
#include <Viewport/InputController/OrbitCameraBehavior.h>
|
||||
#include <Viewport/InputController/PanCameraBehavior.h>
|
||||
#include <Viewport/InputController/RotateEnvironmentBehavior.h>
|
||||
#include <Viewport/InputController/RotateModelBehavior.h>
|
||||
|
||||
namespace MaterialEditor
|
||||
{
|
||||
|
||||
+2
-2
@@ -9,8 +9,8 @@
|
||||
|
||||
#include <AzFramework/Input/Events/InputChannelEventListener.h>
|
||||
#include <AzFramework/Viewport/SingleViewportController.h>
|
||||
#include <Atom/Viewport/InputController/MaterialEditorViewportInputControllerBus.h>
|
||||
#include <Source/Viewport/InputController/Behavior.h>
|
||||
#include <Viewport/InputController/Behavior.h>
|
||||
#include <Viewport/InputController/MaterialEditorViewportInputControllerBus.h>
|
||||
|
||||
namespace MaterialEditor
|
||||
{
|
||||
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/EBus/EBus.h>
|
||||
#include <AzCore/Math/Vector3.h>
|
||||
|
||||
namespace MaterialEditor
|
||||
{
|
||||
class MaterialEditorViewportInputControllerRequests
|
||||
: public AZ::EBusTraits
|
||||
{
|
||||
public:
|
||||
static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single;
|
||||
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single;
|
||||
|
||||
//! Get entityId of viewport camera
|
||||
virtual const AZ::EntityId& GetCameraEntityId() const = 0;
|
||||
|
||||
//! Get entityId of camera target
|
||||
virtual const AZ::EntityId& GetTargetEntityId() const = 0;
|
||||
|
||||
//! Get entityId of scene's IBL entity
|
||||
virtual const AZ::EntityId& GetIblEntityId() const = 0;
|
||||
|
||||
//! Get actual position where the camera is facing
|
||||
virtual const AZ::Vector3& GetTargetPosition() const = 0;
|
||||
|
||||
//! Set camera target position
|
||||
//! @param targetPosition world space position to point camera at
|
||||
virtual void SetTargetPosition(const AZ::Vector3& targetPosition) = 0;
|
||||
|
||||
//! Get distance between camera and its target
|
||||
virtual float GetDistanceToTarget() const = 0;
|
||||
|
||||
//! Get minimum and maximum camera distance to the model based on mesh size
|
||||
//! @param distanceMin closest camera can be to the target
|
||||
//! @param distanceMax furthest camera can be from the target
|
||||
virtual void GetExtents(float& distanceMin, float& distanceMax) const = 0;
|
||||
|
||||
//! Get bounding sphere radius of the active model
|
||||
virtual float GetRadius() const = 0;
|
||||
|
||||
//! Reset camera to default position and rotation
|
||||
virtual void Reset() = 0;
|
||||
|
||||
//! Modify camera's field of view
|
||||
//! @param value field of view in degrees
|
||||
virtual void SetFieldOfView(float value) = 0;
|
||||
|
||||
//! Check if camera is looking directly at a model
|
||||
virtual bool IsCameraCentered() const = 0;
|
||||
};
|
||||
|
||||
using MaterialEditorViewportInputControllerRequestBus = AZ::EBus<MaterialEditorViewportInputControllerRequests>;
|
||||
} // namespace MaterialEditor
|
||||
+3
-3
@@ -6,10 +6,10 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <AzCore/Math/Vector3.h>
|
||||
#include <AzCore/Component/TransformBus.h>
|
||||
#include <Atom/Viewport/InputController/MaterialEditorViewportInputControllerBus.h>
|
||||
#include <Source/Viewport/InputController/MoveCameraBehavior.h>
|
||||
#include <AzCore/Math/Vector3.h>
|
||||
#include <Viewport/InputController/MaterialEditorViewportInputControllerBus.h>
|
||||
#include <Viewport/InputController/MoveCameraBehavior.h>
|
||||
|
||||
namespace MaterialEditor
|
||||
{
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <Source/Viewport/InputController/Behavior.h>
|
||||
#include <Viewport/InputController/Behavior.h>
|
||||
|
||||
namespace MaterialEditor
|
||||
{
|
||||
|
||||
+1
-1
@@ -7,8 +7,8 @@
|
||||
*/
|
||||
|
||||
#include <AzCore/Component/TransformBus.h>
|
||||
#include <Source/Viewport/InputController/OrbitCameraBehavior.h>
|
||||
#include <Viewport/InputController/MaterialEditorViewportInputController.h>
|
||||
#include <Viewport/InputController/OrbitCameraBehavior.h>
|
||||
|
||||
namespace MaterialEditor
|
||||
{
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <Source/Viewport/InputController/Behavior.h>
|
||||
#include <Viewport/InputController/Behavior.h>
|
||||
|
||||
namespace MaterialEditor
|
||||
{
|
||||
|
||||
+4
-4
@@ -6,11 +6,11 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <AzCore/Math/Vector3.h>
|
||||
#include <AzCore/Math/Quaternion.h>
|
||||
#include <AzCore/Component/TransformBus.h>
|
||||
#include <Atom/Viewport/InputController/MaterialEditorViewportInputControllerBus.h>
|
||||
#include <Source/Viewport/InputController/PanCameraBehavior.h>
|
||||
#include <AzCore/Math/Quaternion.h>
|
||||
#include <AzCore/Math/Vector3.h>
|
||||
#include <Viewport/InputController/MaterialEditorViewportInputControllerBus.h>
|
||||
#include <Viewport/InputController/PanCameraBehavior.h>
|
||||
|
||||
namespace MaterialEditor
|
||||
{
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <Source/Viewport/InputController/Behavior.h>
|
||||
#include <Viewport/InputController/Behavior.h>
|
||||
|
||||
namespace MaterialEditor
|
||||
{
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@
|
||||
#include <Atom/RPI.Public/Scene.h>
|
||||
|
||||
#include <Viewport/InputController/MaterialEditorViewportInputController.h>
|
||||
#include <Source/Viewport/InputController/RotateEnvironmentBehavior.h>
|
||||
#include <Viewport/InputController/RotateEnvironmentBehavior.h>
|
||||
|
||||
namespace MaterialEditor
|
||||
{
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <Source/Viewport/InputController/Behavior.h>
|
||||
#include <Viewport/InputController/Behavior.h>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
|
||||
#include <AzCore/Component/TransformBus.h>
|
||||
#include <Viewport/InputController/MaterialEditorViewportInputController.h>
|
||||
#include <Source/Viewport/InputController/RotateModelBehavior.h>
|
||||
#include <Viewport/InputController/RotateModelBehavior.h>
|
||||
|
||||
namespace MaterialEditor
|
||||
{
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <Source/Viewport/InputController/Behavior.h>
|
||||
#include <Viewport/InputController/Behavior.h>
|
||||
|
||||
namespace MaterialEditor
|
||||
{
|
||||
|
||||
@@ -9,19 +9,19 @@
|
||||
#include <Atom/RPI.Edit/Common/AssetUtils.h>
|
||||
#include <Atom/RPI.Edit/Common/JsonUtils.h>
|
||||
#include <Atom/RPI.Reflect/Asset/AssetUtils.h>
|
||||
#include <Atom/Viewport/MaterialViewportNotificationBus.h>
|
||||
#include <Atom/Viewport/MaterialViewportSettings.h>
|
||||
#include <AzCore/Component/TickBus.h>
|
||||
#include <AzCore/RTTI/BehaviorContext.h>
|
||||
#include <AzCore/Serialization/EditContext.h>
|
||||
#include <AzCore/Serialization/Json/JsonUtils.h>
|
||||
#include <AzCore/Serialization/SerializeContext.h>
|
||||
#include <AzCore/StringFunc/StringFunc.h>
|
||||
#include <AzFramework/Asset/AssetSystemBus.h>
|
||||
#include <AzFramework/IO/LocalFileIO.h>
|
||||
#include <AzCore/StringFunc/StringFunc.h>
|
||||
#include <AzToolsFramework/API/EditorAssetSystemAPI.h>
|
||||
#include <AzToolsFramework/AssetBrowser/AssetBrowserEntry.h>
|
||||
#include <Viewport/MaterialViewportComponent.h>
|
||||
#include <Viewport/MaterialViewportNotificationBus.h>
|
||||
#include <Viewport/MaterialViewportSettings.h>
|
||||
|
||||
namespace MaterialEditor
|
||||
{
|
||||
@@ -42,7 +42,7 @@ namespace MaterialEditor
|
||||
{
|
||||
editContext->Class<MaterialViewportComponent>("MaterialViewport", "Manages configurations for lighting and models displayed in the viewport")
|
||||
->ClassElement(AZ::Edit::ClassElements::EditorData, "")
|
||||
->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("System", 0xc94d118b))
|
||||
->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC_CE("System"))
|
||||
->Attribute(AZ::Edit::Attributes::AutoExpand, true)
|
||||
;
|
||||
}
|
||||
@@ -103,18 +103,19 @@ namespace MaterialEditor
|
||||
|
||||
void MaterialViewportComponent::GetRequiredServices([[maybe_unused]] AZ::ComponentDescriptor::DependencyArrayType& required)
|
||||
{
|
||||
required.push_back(AZ_CRC("PerformanceMonitorService", 0x6a44241a));
|
||||
required.push_back(AZ_CRC("AtomImageBuilderService", 0x76ded592));
|
||||
required.push_back(AZ_CRC_CE("RPISystem"));
|
||||
required.push_back(AZ_CRC_CE("AssetDatabaseService"));
|
||||
required.push_back(AZ_CRC_CE("PerformanceMonitorService"));
|
||||
}
|
||||
|
||||
void MaterialViewportComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided)
|
||||
{
|
||||
provided.push_back(AZ_CRC("MaterialViewportService", 0xed9b44d7));
|
||||
provided.push_back(AZ_CRC_CE("MaterialViewportService"));
|
||||
}
|
||||
|
||||
void MaterialViewportComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible)
|
||||
{
|
||||
incompatible.push_back(AZ_CRC("MaterialViewportService", 0xed9b44d7));
|
||||
incompatible.push_back(AZ_CRC_CE("MaterialViewportService"));
|
||||
}
|
||||
|
||||
void MaterialViewportComponent::Init()
|
||||
|
||||
@@ -12,11 +12,11 @@
|
||||
#include <Atom/Feature/Utils/LightingPreset.h>
|
||||
#include <Atom/Feature/Utils/ModelPreset.h>
|
||||
#include <Atom/RPI.Reflect/System/AnyAsset.h>
|
||||
#include <Atom/Viewport/MaterialViewportRequestBus.h>
|
||||
#include <Atom/Viewport/MaterialViewportSettings.h>
|
||||
#include <AzCore/Asset/AssetCommon.h>
|
||||
#include <AzCore/Component/Component.h>
|
||||
#include <AzFramework/Asset/AssetCatalogBus.h>
|
||||
#include <Viewport/MaterialViewportRequestBus.h>
|
||||
#include <Viewport/MaterialViewportSettings.h>
|
||||
|
||||
namespace MaterialEditor
|
||||
{
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <Atom/Viewport/MaterialViewportModule.h>
|
||||
#include <Viewport/MaterialViewportComponent.h>
|
||||
#include <Viewport/MaterialViewportModule.h>
|
||||
#include <Viewport/PerformanceMonitorComponent.h>
|
||||
|
||||
namespace MaterialEditor
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/Module/Module.h>
|
||||
|
||||
namespace MaterialEditor
|
||||
{
|
||||
//! Entry point for Material Editor Viewport library. This module is responsible for registering and reflecting dependencies
|
||||
class MaterialViewportModule
|
||||
: public AZ::Module
|
||||
{
|
||||
public:
|
||||
AZ_RTTI(MaterialViewportModule, "{D4A53226-D31A-4FBD-A599-F17F740EC2BA}", AZ::Module);
|
||||
AZ_CLASS_ALLOCATOR(MaterialViewportModule, AZ::SystemAllocator, 0);
|
||||
|
||||
MaterialViewportModule();
|
||||
|
||||
//! Add required SystemComponents to the SystemEntity.
|
||||
AZ::ComponentTypeList GetRequiredSystemComponents() const override;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <ACES/Aces.h>
|
||||
#include <AzCore/EBus/EBus.h>
|
||||
#include <Atom/Feature/Utils/LightingPreset.h>
|
||||
#include <Atom/Feature/Utils/ModelPreset.h>
|
||||
|
||||
namespace MaterialEditor
|
||||
{
|
||||
class MaterialViewportNotifications
|
||||
: public AZ::EBusTraits
|
||||
{
|
||||
public:
|
||||
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single;
|
||||
static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Multiple;
|
||||
|
||||
//! Signal that all configs are about to be reloaded
|
||||
virtual void OnBeginReloadContent() {}
|
||||
|
||||
//! Signal that all configs were reloaded
|
||||
virtual void OnEndReloadContent() {}
|
||||
|
||||
//! Signal that a preset was added
|
||||
//! @param preset being added
|
||||
virtual void OnLightingPresetAdded([[maybe_unused]] AZ::Render::LightingPresetPtr preset) {}
|
||||
|
||||
//! Signal that a preset was selected
|
||||
//! @param preset being selected
|
||||
virtual void OnLightingPresetSelected([[maybe_unused]] AZ::Render::LightingPresetPtr preset) {}
|
||||
|
||||
//! Signal that a preset was changed
|
||||
//! @param preset being changed
|
||||
virtual void OnLightingPresetChanged([[maybe_unused]] AZ::Render::LightingPresetPtr preset) {}
|
||||
|
||||
//! Signal that a preset was added
|
||||
//! @param preset being added
|
||||
virtual void OnModelPresetAdded([[maybe_unused]] AZ::Render::ModelPresetPtr preset) {}
|
||||
|
||||
//! Signal that a preset was selected
|
||||
//! @param preset being selected
|
||||
virtual void OnModelPresetSelected([[maybe_unused]] AZ::Render::ModelPresetPtr preset) {}
|
||||
|
||||
//! Signal that a preset was changed
|
||||
//! @param preset being changed
|
||||
virtual void OnModelPresetChanged([[maybe_unused]] AZ::Render::ModelPresetPtr preset) {}
|
||||
|
||||
//! Notify when enabled state for shadow catcher changes
|
||||
virtual void OnShadowCatcherEnabledChanged([[maybe_unused]] bool enable) {}
|
||||
|
||||
//! Notify when enabled state for grid changes
|
||||
virtual void OnGridEnabledChanged([[maybe_unused]] bool enable) {}
|
||||
|
||||
//! Notify when enabled state for alternate skybox changes
|
||||
virtual void OnAlternateSkyboxEnabledChanged([[maybe_unused]] bool enable) {}
|
||||
|
||||
//! Notify when field of view changes
|
||||
virtual void OnFieldOfViewChanged([[maybe_unused]] float fieldOfView) {}
|
||||
|
||||
//! Notify when tone mapping changes
|
||||
virtual void OnDisplayMapperOperationTypeChanged([[maybe_unused]] AZ::Render::DisplayMapperOperationType operationType) {}
|
||||
};
|
||||
|
||||
using MaterialViewportNotificationBus = AZ::EBus<MaterialViewportNotifications>;
|
||||
} // namespace MaterialEditor
|
||||
@@ -8,51 +8,51 @@
|
||||
|
||||
#undef RC_INVOKED
|
||||
|
||||
#include <AzCore/Component/Entity.h>
|
||||
#include <AzCore/Component/Component.h>
|
||||
#include <AzCore/Component/Entity.h>
|
||||
|
||||
#include <AzFramework/Components/TransformComponent.h>
|
||||
#include <AzFramework/Components/NonUniformScaleComponent.h>
|
||||
#include <AzFramework/Components/TransformComponent.h>
|
||||
#include <AzFramework/Entity/GameEntityContextBus.h>
|
||||
|
||||
#include <AtomCore/Instance/InstanceDatabase.h>
|
||||
|
||||
#include <Atom/RPI.Public/WindowContext.h>
|
||||
#include <Atom/RPI.Public/Image/StreamingImage.h>
|
||||
#include <Atom/RPI.Public/Material/Material.h>
|
||||
#include <Atom/RPI.Public/Pass/Specific/SwapChainPass.h>
|
||||
#include <Atom/RPI.Public/RPISystemInterface.h>
|
||||
#include <Atom/RPI.Public/RenderPipeline.h>
|
||||
#include <Atom/RPI.Public/Scene.h>
|
||||
#include <Atom/RPI.Public/Material/Material.h>
|
||||
#include <Atom/RPI.Public/Image/StreamingImage.h>
|
||||
#include <Atom/RPI.Public/WindowContext.h>
|
||||
#include <Atom/RPI.Reflect/Asset/AssetUtils.h>
|
||||
|
||||
#include <Atom/Component/DebugCamera/CameraComponent.h>
|
||||
#include <Atom/Feature/PostProcessing/PostProcessingConstants.h>
|
||||
#include <Atom/Feature/PostProcess/PostProcessFeatureProcessorInterface.h>
|
||||
#include <Atom/Feature/ImageBasedLights/ImageBasedLightFeatureProcessorInterface.h>
|
||||
#include <Atom/Feature/ACES/AcesDisplayMapperFeatureProcessor.h>
|
||||
#include <Atom/Component/DebugCamera/NoClipControllerComponent.h>
|
||||
#include <Atom/Feature/ACES/AcesDisplayMapperFeatureProcessor.h>
|
||||
#include <Atom/Feature/ImageBasedLights/ImageBasedLightFeatureProcessorInterface.h>
|
||||
#include <Atom/Feature/PostProcess/PostProcessFeatureProcessorInterface.h>
|
||||
#include <Atom/Feature/PostProcessing/PostProcessingConstants.h>
|
||||
|
||||
#include <Atom/Document/MaterialDocumentRequestBus.h>
|
||||
#include <Atom/Feature/Utils/LightingPreset.h>
|
||||
#include <Atom/Feature/Utils/ModelPreset.h>
|
||||
#include <Atom/Viewport/MaterialViewportRequestBus.h>
|
||||
#include <Atom/Viewport/PerformanceMonitorRequestBus.h>
|
||||
#include <Atom/Viewport/MaterialViewportSettings.h>
|
||||
|
||||
#include <AtomLyIntegration/CommonFeatures/Grid/GridComponentConstants.h>
|
||||
#include <AtomLyIntegration/CommonFeatures/Grid/GridComponentConfig.h>
|
||||
#include <AtomLyIntegration/CommonFeatures/Grid/GridComponentConstants.h>
|
||||
#include <AtomLyIntegration/CommonFeatures/ImageBasedLights/ImageBasedLightComponentBus.h>
|
||||
#include <AtomLyIntegration/CommonFeatures/ImageBasedLights/ImageBasedLightComponentConstants.h>
|
||||
#include <AtomLyIntegration/CommonFeatures/Material/MaterialComponentConstants.h>
|
||||
#include <AtomLyIntegration/CommonFeatures/Material/MaterialComponentBus.h>
|
||||
#include <AtomLyIntegration/CommonFeatures/Mesh/MeshComponentConstants.h>
|
||||
#include <AtomLyIntegration/CommonFeatures/Material/MaterialComponentConstants.h>
|
||||
#include <AtomLyIntegration/CommonFeatures/Mesh/MeshComponentBus.h>
|
||||
#include <AtomLyIntegration/CommonFeatures/PostProcess/PostFxLayerComponentConstants.h>
|
||||
#include <AtomLyIntegration/CommonFeatures/Mesh/MeshComponentConstants.h>
|
||||
#include <AtomLyIntegration/CommonFeatures/PostProcess/ExposureControl/ExposureControlBus.h>
|
||||
#include <AtomLyIntegration/CommonFeatures/PostProcess/ExposureControl/ExposureControlComponentConstants.h>
|
||||
#include <AtomLyIntegration/CommonFeatures/PostProcess/PostFxLayerComponentConstants.h>
|
||||
|
||||
#include <Source/Viewport/MaterialViewportRenderer.h>
|
||||
#include <Document/MaterialDocumentRequestBus.h>
|
||||
#include <Viewport/MaterialViewportRenderer.h>
|
||||
#include <Viewport/MaterialViewportRequestBus.h>
|
||||
#include <Viewport/MaterialViewportSettings.h>
|
||||
#include <Viewport/PerformanceMonitorRequestBus.h>
|
||||
|
||||
namespace MaterialEditor
|
||||
{
|
||||
|
||||
@@ -11,12 +11,12 @@
|
||||
#include <Atom/Feature/CoreLights/DirectionalLightFeatureProcessorInterface.h>
|
||||
#include <Atom/Feature/SkyBox/SkyBoxFeatureProcessorInterface.h>
|
||||
#include <Atom/RPI.Public/Base.h>
|
||||
#include <Atom/Viewport/MaterialViewportNotificationBus.h>
|
||||
#include <AtomCore/Instance/Instance.h>
|
||||
#include <AtomToolsFramework/Document/AtomToolsDocumentNotificationBus.h>
|
||||
#include <AzCore/Component/TickBus.h>
|
||||
#include <AzCore/Component/TransformBus.h>
|
||||
#include <Viewport/InputController/MaterialEditorViewportInputController.h>
|
||||
#include <Viewport/MaterialViewportNotificationBus.h>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
|
||||
@@ -0,0 +1,138 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <ACES/Aces.h>
|
||||
#include <AzCore/EBus/EBus.h>
|
||||
#include <AzCore/std/containers/set.h>
|
||||
#include <AzCore/std/string/string.h>
|
||||
#include <Atom/Feature/Utils/LightingPreset.h>
|
||||
#include <Atom/Feature/Utils/ModelPreset.h>
|
||||
#include <QImage>
|
||||
|
||||
namespace MaterialEditor
|
||||
{
|
||||
using MaterialViewportPresetNameSet = AZStd::set<AZStd::string>;
|
||||
|
||||
class MaterialViewportRequests
|
||||
: public AZ::EBusTraits
|
||||
{
|
||||
public:
|
||||
static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single;
|
||||
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single;
|
||||
|
||||
//! Reload all presets
|
||||
virtual void ReloadContent() = 0;
|
||||
|
||||
//! Add lighting preset
|
||||
//! @param preset lighting preset to add for selection
|
||||
//! @returns pointer to new, managed preset
|
||||
virtual AZ::Render::LightingPresetPtr AddLightingPreset(const AZ::Render::LightingPreset& preset) = 0;
|
||||
|
||||
//! Get lighting presets
|
||||
//! @returns all presets
|
||||
virtual AZ::Render::LightingPresetPtrVector GetLightingPresets() const = 0;
|
||||
|
||||
//! Save lighting preset
|
||||
//! @returns true if preset was saved, otherwise false
|
||||
virtual bool SaveLightingPreset(AZ::Render::LightingPresetPtr preset, const AZStd::string& path) const = 0;
|
||||
|
||||
//! Get lighting preset by name
|
||||
//! @param name preset name to search for
|
||||
//! @returns the requested preset if found, otherwise nullptr
|
||||
virtual AZ::Render::LightingPresetPtr GetLightingPresetByName(const AZStd::string& name) const = 0;
|
||||
|
||||
//! Get selected lighting preset
|
||||
//! @returns selected preset if found, otherwise nullptr
|
||||
virtual AZ::Render::LightingPresetPtr GetLightingPresetSelection() const = 0;
|
||||
|
||||
//! Select lighting preset
|
||||
//! @param preset to select
|
||||
virtual void SelectLightingPreset(AZ::Render::LightingPresetPtr preset) = 0;
|
||||
|
||||
//! Select lighting preset by name
|
||||
//! @param name preset name to select
|
||||
virtual void SelectLightingPresetByName(const AZStd::string& name) = 0;
|
||||
|
||||
//! Get set of lighting preset names
|
||||
virtual MaterialViewportPresetNameSet GetLightingPresetNames() const = 0;
|
||||
|
||||
//! Get model preset last save path
|
||||
//! @param preset to lookup last save path
|
||||
virtual AZStd::string GetLightingPresetLastSavePath(AZ::Render::LightingPresetPtr preset) const = 0;
|
||||
|
||||
//! Add model preset
|
||||
//! @param preset model preset to add for selection
|
||||
//! @returns pointer to new, managed preset
|
||||
virtual AZ::Render::ModelPresetPtr AddModelPreset(const AZ::Render::ModelPreset& preset) = 0;
|
||||
|
||||
//! Get model presets
|
||||
//! @returns all presets
|
||||
virtual AZ::Render::ModelPresetPtrVector GetModelPresets() const = 0;
|
||||
|
||||
//! Save Model preset
|
||||
//! @returns true if preset was saved, otherwise false
|
||||
virtual bool SaveModelPreset(AZ::Render::ModelPresetPtr preset, const AZStd::string& path) const = 0;
|
||||
|
||||
//! Get model preset by name
|
||||
//! @param name preset name to search for
|
||||
//! @returns the requested preset if found, otherwise nullptr
|
||||
virtual AZ::Render::ModelPresetPtr GetModelPresetByName(const AZStd::string& name) const = 0;
|
||||
|
||||
//! Get selected model preset
|
||||
//! @returns selected preset if found, otherwise nullptr
|
||||
virtual AZ::Render::ModelPresetPtr GetModelPresetSelection() const = 0;
|
||||
|
||||
//! Select lighting preset
|
||||
//! @param name preset to select
|
||||
virtual void SelectModelPreset(AZ::Render::ModelPresetPtr preset) = 0;
|
||||
|
||||
//! Select model preset by name
|
||||
//! @param name preset name to select
|
||||
virtual void SelectModelPresetByName(const AZStd::string& name) = 0;
|
||||
|
||||
//! Get set of model preset names
|
||||
virtual MaterialViewportPresetNameSet GetModelPresetNames() const = 0;
|
||||
|
||||
//! Get model preset last save path
|
||||
//! @param preset to lookup last save path
|
||||
virtual AZStd::string GetModelPresetLastSavePath(AZ::Render::ModelPresetPtr preset) const = 0;
|
||||
|
||||
//! Set enabled state for shadow catcher
|
||||
virtual void SetShadowCatcherEnabled(bool enable) = 0;
|
||||
|
||||
//! Get enabled state for shadow catcher
|
||||
virtual bool GetShadowCatcherEnabled() const = 0;
|
||||
|
||||
//! Set enabled state for grid
|
||||
virtual void SetGridEnabled(bool enable) = 0;
|
||||
|
||||
//! Get enabled state for grid
|
||||
virtual bool GetGridEnabled() const = 0;
|
||||
|
||||
//! Set enabled state for alternate skybox
|
||||
virtual void SetAlternateSkyboxEnabled(bool enable) = 0;
|
||||
|
||||
//! Get enabled state for alternate skybox
|
||||
virtual bool GetAlternateSkyboxEnabled() const = 0;
|
||||
|
||||
//! Set field of view
|
||||
virtual void SetFieldOfView(float fieldOfView) = 0;
|
||||
|
||||
//! Get field of view
|
||||
virtual float GetFieldOfView() const = 0;
|
||||
|
||||
//! Set tone mapping type
|
||||
virtual void SetDisplayMapperOperationType(AZ::Render::DisplayMapperOperationType operationType) = 0;
|
||||
|
||||
//! Get tone mapping type
|
||||
virtual AZ::Render::DisplayMapperOperationType GetDisplayMapperOperationType() const = 0;
|
||||
};
|
||||
|
||||
using MaterialViewportRequestBus = AZ::EBus<MaterialViewportRequests>;
|
||||
} // namespace MaterialEditor
|
||||
@@ -6,9 +6,9 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <Atom/Viewport/MaterialViewportSettings.h>
|
||||
#include <AzCore/RTTI/BehaviorContext.h>
|
||||
#include <AzCore/Serialization/EditContext.h>
|
||||
#include <Viewport/MaterialViewportSettings.h>
|
||||
|
||||
namespace MaterialEditor
|
||||
{
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#if !defined(Q_MOC_RUN)
|
||||
#include <ACES/Aces.h>
|
||||
#include <AzCore/Memory/Memory.h>
|
||||
#include <AzCore/RTTI/RTTI.h>
|
||||
#include <AzCore/RTTI/ReflectContext.h>
|
||||
#include <AzCore/UserSettings/UserSettings.h>
|
||||
#endif
|
||||
|
||||
namespace MaterialEditor
|
||||
{
|
||||
struct MaterialViewportSettings
|
||||
: public AZ::UserSettings
|
||||
{
|
||||
AZ_RTTI(MaterialViewportSettings, "{16150503-A314-4765-82A3-172670C9EA90}", AZ::UserSettings);
|
||||
AZ_CLASS_ALLOCATOR(MaterialViewportSettings, AZ::SystemAllocator, 0);
|
||||
|
||||
static void Reflect(AZ::ReflectContext* context);
|
||||
|
||||
bool m_enableGrid = true;
|
||||
bool m_enableShadowCatcher = true;
|
||||
bool m_enableAlternateSkybox = false;
|
||||
float m_fieldOfView = 90.0f;
|
||||
AZ::Render::DisplayMapperOperationType m_displayMapperOperationType = AZ::Render::DisplayMapperOperationType::Aces;
|
||||
AZStd::string m_selectedModelPresetName = "Shader Ball";
|
||||
AZStd::string m_selectedLightingPresetName = "Neutral Urban";
|
||||
};
|
||||
} // namespace MaterialEditor
|
||||
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/Memory/Memory.h>
|
||||
#include <AzCore/RTTI/RTTI.h>
|
||||
#include <AzCore/RTTI/ReflectContext.h>
|
||||
#include <AzCore/Serialization/SerializeContext.h>
|
||||
|
||||
namespace MaterialEditor
|
||||
{
|
||||
//! Data structure containing performance metrics for Material Editor
|
||||
struct PerformanceMetrics final
|
||||
{
|
||||
AZ_CLASS_ALLOCATOR(PerformanceMetrics, AZ::SystemAllocator, 0);
|
||||
|
||||
double m_cpuFrameTimeMs = 0;
|
||||
double m_gpuFrameTimeMs = 0;
|
||||
};
|
||||
} // namespace MaterialEditor
|
||||
@@ -31,7 +31,7 @@ namespace MaterialEditor
|
||||
|
||||
void PerformanceMonitorComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided)
|
||||
{
|
||||
provided.push_back(AZ_CRC("PerformanceMonitorService", 0x6a44241a));
|
||||
provided.push_back(AZ_CRC_CE("PerformanceMonitorService"));
|
||||
}
|
||||
|
||||
void PerformanceMonitorComponent::Init()
|
||||
|
||||
@@ -8,11 +8,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <Atom/RPI.Public/Pass/Pass.h>
|
||||
#include <AzCore/Component/Component.h>
|
||||
#include <AzCore/Statistics/RunningStatistic.h>
|
||||
|
||||
#include <Atom/RPI.Public/Pass/Pass.h>
|
||||
#include <Atom/Viewport/PerformanceMonitorRequestBus.h>
|
||||
#include <Viewport/PerformanceMonitorRequestBus.h>
|
||||
|
||||
namespace MaterialEditor
|
||||
{
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/EBus/EBus.h>
|
||||
#include <Viewport/PerformanceMetrics.h>
|
||||
|
||||
namespace MaterialEditor
|
||||
{
|
||||
//! Provides communication with Performance Monitor
|
||||
class PerformanceMonitorRequests
|
||||
: public AZ::EBusTraits
|
||||
{
|
||||
public:
|
||||
static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single;
|
||||
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single;
|
||||
|
||||
//! Enable or disable CPU and GPU monitoring
|
||||
//! @param enabled whether performance monitoring should be enabled
|
||||
virtual void SetProfilerEnabled(bool enabled) = 0;
|
||||
//! Gather performance metrics for the current frame
|
||||
virtual void GatherMetrics() = 0;
|
||||
//! Get current metrics
|
||||
virtual const PerformanceMetrics& GetMetrics() = 0;
|
||||
};
|
||||
|
||||
using PerformanceMonitorRequestBus = AZ::EBus<PerformanceMonitorRequests>;
|
||||
} // namespace MaterialEditor
|
||||
+1
-1
@@ -6,7 +6,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <Atom/Document/MaterialDocumentSettings.h>
|
||||
#include <Atom/RPI.Edit/Common/AssetUtils.h>
|
||||
#include <Atom/RPI.Edit/Material/MaterialSourceData.h>
|
||||
#include <Atom/RPI.Edit/Material/MaterialTypeSourceData.h>
|
||||
@@ -15,6 +14,7 @@
|
||||
#include <AzFramework/Application/Application.h>
|
||||
#include <AzFramework/StringFunc/StringFunc.h>
|
||||
#include <AzQtComponents/Components/Widgets/FileDialog.h>
|
||||
#include <Document/MaterialDocumentSettings.h>
|
||||
#include <Window/CreateMaterialDialog/CreateMaterialDialog.h>
|
||||
|
||||
namespace MaterialEditor
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@
|
||||
|
||||
#include <AzCore/std/containers/vector.h>
|
||||
|
||||
#include <Source/Window/CreateMaterialDialog/ui_CreateMaterialDialog.h>
|
||||
#include <Window/CreateMaterialDialog/ui_CreateMaterialDialog.h>
|
||||
|
||||
#include <QFileInfo>
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <Source/Window/HelpDialog/HelpDialog.h>
|
||||
#include <Window/HelpDialog/HelpDialog.h>
|
||||
|
||||
namespace MaterialEditor
|
||||
{
|
||||
@@ -20,4 +20,4 @@ namespace MaterialEditor
|
||||
HelpDialog::~HelpDialog() = default;
|
||||
} // namespace MaterialEditor
|
||||
|
||||
#include <Source/Window/HelpDialog/moc_HelpDialog.cpp>
|
||||
#include <Window/HelpDialog/moc_HelpDialog.cpp>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // disable warnings spawned by QT
|
||||
#include <QDialog>
|
||||
#include <Source/Window/HelpDialog/ui_HelpDialog.h>
|
||||
#include <Window/HelpDialog/ui_HelpDialog.h>
|
||||
AZ_POP_DISABLE_WARNING
|
||||
#endif
|
||||
|
||||
|
||||
@@ -6,19 +6,19 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <Atom/Document/MaterialDocumentRequestBus.h>
|
||||
#include <Atom/RHI/Factory.h>
|
||||
#include <Atom/RPI.Edit/Material/MaterialSourceData.h>
|
||||
#include <Atom/RPI.Edit/Material/MaterialTypeSourceData.h>
|
||||
#include <Atom/Window/MaterialEditorWindowSettings.h>
|
||||
#include <AtomToolsFramework/Document/AtomToolsDocumentSystemRequestBus.h>
|
||||
#include <AtomToolsFramework/Util/Util.h>
|
||||
#include <AzQtComponents/Components/StyleManager.h>
|
||||
#include <AzQtComponents/Components/WindowDecorationWrapper.h>
|
||||
#include <Document/MaterialDocumentRequestBus.h>
|
||||
#include <Viewport/MaterialViewportWidget.h>
|
||||
#include <Window/CreateMaterialDialog/CreateMaterialDialog.h>
|
||||
#include <Window/HelpDialog/HelpDialog.h>
|
||||
#include <Window/MaterialEditorWindow.h>
|
||||
#include <Window/MaterialEditorWindowSettings.h>
|
||||
#include <Window/MaterialInspector/MaterialInspector.h>
|
||||
#include <Window/PerformanceMonitor/PerformanceMonitorWidget.h>
|
||||
#include <Window/SettingsDialog/SettingsDialog.h>
|
||||
|
||||
@@ -1,89 +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 <AtomToolsFramework/Window/AtomToolsMainWindowFactoryRequestBus.h>
|
||||
#include <AtomToolsFramework/Window/AtomToolsMainWindowRequestBus.h>
|
||||
#include <AzCore/RTTI/BehaviorContext.h>
|
||||
#include <AzCore/Serialization/EditContext.h>
|
||||
#include <AzCore/Serialization/SerializeContext.h>
|
||||
#include <AzToolsFramework/API/EditorAssetSystemAPI.h>
|
||||
#include <AzToolsFramework/API/ToolsApplicationAPI.h>
|
||||
#include <AzToolsFramework/API/ViewPaneOptions.h>
|
||||
#include <AzToolsFramework/UI/UICore/QWidgetSavedState.h>
|
||||
#include <Window/MaterialEditorWindow.h>
|
||||
#include <Window/MaterialEditorWindowComponent.h>
|
||||
#include <Window/ViewportSettingsInspector/ViewportSettingsInspector.h>
|
||||
|
||||
namespace MaterialEditor
|
||||
{
|
||||
void MaterialEditorWindowComponent::Reflect(AZ::ReflectContext* context)
|
||||
{
|
||||
MaterialEditorWindowSettings::Reflect(context);
|
||||
|
||||
if (AZ::SerializeContext* serialize = azrtti_cast<AZ::SerializeContext*>(context))
|
||||
{
|
||||
serialize->Class<MaterialEditorWindowComponent, AZ::Component>()
|
||||
->Version(0);
|
||||
}
|
||||
}
|
||||
|
||||
void MaterialEditorWindowComponent::GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required)
|
||||
{
|
||||
required.push_back(AZ_CRC_CE("AssetBrowserService"));
|
||||
required.push_back(AZ_CRC_CE("PropertyManagerService"));
|
||||
required.push_back(AZ_CRC_CE("SourceControlService"));
|
||||
required.push_back(AZ_CRC_CE("AtomToolsMainWindowSystemService"));
|
||||
}
|
||||
|
||||
void MaterialEditorWindowComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided)
|
||||
{
|
||||
provided.push_back(AZ_CRC_CE("MaterialEditorWindowService"));
|
||||
}
|
||||
|
||||
void MaterialEditorWindowComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible)
|
||||
{
|
||||
incompatible.push_back(AZ_CRC_CE("MaterialEditorWindowService"));
|
||||
}
|
||||
|
||||
void MaterialEditorWindowComponent::Init()
|
||||
{
|
||||
}
|
||||
|
||||
void MaterialEditorWindowComponent::Activate()
|
||||
{
|
||||
AzToolsFramework::EditorWindowRequestBus::Handler::BusConnect();
|
||||
AtomToolsFramework::AtomToolsMainWindowFactoryRequestBus::Handler::BusConnect();
|
||||
AzToolsFramework::SourceControlConnectionRequestBus::Broadcast(&AzToolsFramework::SourceControlConnectionRequests::EnableSourceControl, true);
|
||||
}
|
||||
|
||||
void MaterialEditorWindowComponent::Deactivate()
|
||||
{
|
||||
AtomToolsFramework::AtomToolsMainWindowFactoryRequestBus::Handler::BusDisconnect();
|
||||
AzToolsFramework::EditorWindowRequestBus::Handler::BusDisconnect();
|
||||
|
||||
m_window.reset();
|
||||
}
|
||||
|
||||
void MaterialEditorWindowComponent::CreateMainWindow()
|
||||
{
|
||||
m_materialEditorBrowserInteractions.reset(aznew MaterialEditorBrowserInteractions);
|
||||
|
||||
m_window.reset(aznew MaterialEditorWindow);
|
||||
}
|
||||
|
||||
void MaterialEditorWindowComponent::DestroyMainWindow()
|
||||
{
|
||||
m_window.reset();
|
||||
}
|
||||
|
||||
QWidget* MaterialEditorWindowComponent::GetAppMainWindow()
|
||||
{
|
||||
return m_window.get();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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
|
||||
|
||||
#include <AzCore/Component/Component.h>
|
||||
#include <AzToolsFramework/API/EditorWindowRequestBus.h>
|
||||
|
||||
#include <AtomToolsFramework/Window/AtomToolsMainWindowFactoryRequestBus.h>
|
||||
#include <Source/Window/MaterialEditorBrowserInteractions.h>
|
||||
#include <Source/Window/MaterialEditorWindow.h>
|
||||
|
||||
namespace MaterialEditor
|
||||
{
|
||||
//! MaterialEditorWindowComponent is the entry point for the Material Editor gem user interface, and is mainly
|
||||
//! used for initialization and registration of other classes, including MaterialEditorWindow.
|
||||
class MaterialEditorWindowComponent
|
||||
: public AZ::Component
|
||||
, private AzToolsFramework::EditorWindowRequestBus::Handler
|
||||
, private AtomToolsFramework::AtomToolsMainWindowFactoryRequestBus::Handler
|
||||
{
|
||||
public:
|
||||
AZ_COMPONENT(MaterialEditorWindowComponent, "{03976F19-3C74-49FE-A15F-7D3CADBA616C}");
|
||||
|
||||
static void Reflect(AZ::ReflectContext* context);
|
||||
|
||||
static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required);
|
||||
static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided);
|
||||
static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible);
|
||||
|
||||
private:
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// AtomToolsMainWindowFactoryRequestBus::Handler overrides...
|
||||
void CreateMainWindow() override;
|
||||
void DestroyMainWindow() override;
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// AzToolsFramework::EditorWindowRequests::Bus::Handler
|
||||
QWidget* GetAppMainWindow() override;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// AZ::Component interface implementation
|
||||
void Init() override;
|
||||
void Activate() override;
|
||||
void Deactivate() override;
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
AZStd::unique_ptr<MaterialEditorWindow> m_window;
|
||||
AZStd::unique_ptr<MaterialEditorBrowserInteractions> m_materialEditorBrowserInteractions;
|
||||
};
|
||||
}
|
||||
@@ -1,38 +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 <Atom/Window/MaterialEditorWindowModule.h>
|
||||
#include <Window/MaterialEditorWindowComponent.h>
|
||||
|
||||
void InitMaterialEditorResources()
|
||||
{
|
||||
//Must register qt resources from other modules
|
||||
Q_INIT_RESOURCE(MaterialEditor);
|
||||
Q_INIT_RESOURCE(InspectorWidget);
|
||||
Q_INIT_RESOURCE(AtomToolsAssetBrowser);
|
||||
}
|
||||
|
||||
namespace MaterialEditor
|
||||
{
|
||||
MaterialEditorWindowModule::MaterialEditorWindowModule()
|
||||
{
|
||||
InitMaterialEditorResources();
|
||||
|
||||
// Push results of [MyComponent]::CreateDescriptor() into m_descriptors here.
|
||||
m_descriptors.insert(m_descriptors.end(), {
|
||||
MaterialEditorWindowComponent::CreateDescriptor(),
|
||||
});
|
||||
}
|
||||
|
||||
AZ::ComponentTypeList MaterialEditorWindowModule::GetRequiredSystemComponents() const
|
||||
{
|
||||
return AZ::ComponentTypeList{
|
||||
azrtti_typeid<MaterialEditorWindowComponent>(),
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -6,9 +6,9 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <Atom/Window/MaterialEditorWindowSettings.h>
|
||||
#include <AzCore/RTTI/BehaviorContext.h>
|
||||
#include <AzCore/Serialization/EditContext.h>
|
||||
#include <Window/MaterialEditorWindowSettings.h>
|
||||
|
||||
namespace MaterialEditor
|
||||
{
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* 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
|
||||
|
||||
#if !defined(Q_MOC_RUN)
|
||||
#include <AzCore/Memory/Memory.h>
|
||||
#include <AzCore/RTTI/RTTI.h>
|
||||
#include <AzCore/RTTI/ReflectContext.h>
|
||||
#include <AzCore/std/containers/unordered_set.h>
|
||||
#include <AzCore/UserSettings/UserSettings.h>
|
||||
#endif
|
||||
|
||||
namespace MaterialEditor
|
||||
{
|
||||
struct MaterialEditorWindowSettings
|
||||
: public AZ::UserSettings
|
||||
{
|
||||
AZ_RTTI(MaterialEditorWindowSettings, "{BB9DEB77-B7BE-4DF5-9FDD-6D9F3136C4EA}", AZ::UserSettings);
|
||||
AZ_CLASS_ALLOCATOR(MaterialEditorWindowSettings, AZ::SystemAllocator, 0);
|
||||
|
||||
static void Reflect(AZ::ReflectContext* context);
|
||||
|
||||
AZStd::vector<char> m_mainWindowState;
|
||||
AZStd::unordered_set<AZ::u32> m_inspectorCollapsedGroups;
|
||||
};
|
||||
} // namespace MaterialEditor
|
||||
+1
-1
@@ -6,7 +6,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <Atom/Document/MaterialDocumentRequestBus.h>
|
||||
#include <Atom/RPI.Edit/Common/AssetUtils.h>
|
||||
#include <Atom/RPI.Edit/Material/MaterialPropertyId.h>
|
||||
#include <Atom/RPI.Edit/Material/MaterialTypeSourceData.h>
|
||||
@@ -15,6 +14,7 @@
|
||||
#include <AtomToolsFramework/DynamicProperty/DynamicPropertyGroup.h>
|
||||
#include <AtomToolsFramework/Inspector/InspectorPropertyGroupWidget.h>
|
||||
#include <AtomToolsFramework/Util/MaterialPropertyUtil.h>
|
||||
#include <Document/MaterialDocumentRequestBus.h>
|
||||
#include <Window/MaterialInspector/MaterialInspector.h>
|
||||
|
||||
namespace MaterialEditor
|
||||
|
||||
+1
-1
@@ -9,12 +9,12 @@
|
||||
#pragma once
|
||||
|
||||
#if !defined(Q_MOC_RUN)
|
||||
#include <Atom/Window/MaterialEditorWindowSettings.h>
|
||||
#include <AtomToolsFramework/Document/AtomToolsDocumentNotificationBus.h>
|
||||
#include <AtomToolsFramework/DynamicProperty/DynamicPropertyGroup.h>
|
||||
#include <AtomToolsFramework/Inspector/InspectorWidget.h>
|
||||
#include <AzCore/std/containers/unordered_map.h>
|
||||
#include <AzToolsFramework/UI/PropertyEditor/PropertyEditorAPI_Internals.h>
|
||||
#include <Window/MaterialEditorWindowSettings.h>
|
||||
#endif
|
||||
|
||||
namespace MaterialEditor
|
||||
|
||||
+4
-5
@@ -6,10 +6,9 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <Atom/Viewport/PerformanceMonitorRequestBus.h>
|
||||
|
||||
#include <Source/Window/PerformanceMonitor/PerformanceMonitorWidget.h>
|
||||
#include <Source/Window/PerformanceMonitor/ui_PerformanceMonitorWidget.h>
|
||||
#include <Viewport/PerformanceMonitorRequestBus.h>
|
||||
#include <Window/PerformanceMonitor/PerformanceMonitorWidget.h>
|
||||
#include <Window/PerformanceMonitor/ui_PerformanceMonitorWidget.h>
|
||||
|
||||
#include <QTimer>
|
||||
|
||||
@@ -55,4 +54,4 @@ namespace MaterialEditor
|
||||
}
|
||||
} // namespace MaterialEditor
|
||||
|
||||
#include <Source/Window/PerformanceMonitor/moc_PerformanceMonitorWidget.cpp>
|
||||
#include <Window/PerformanceMonitor/moc_PerformanceMonitorWidget.cpp>
|
||||
|
||||
+1
-1
@@ -8,9 +8,9 @@
|
||||
|
||||
#include <Atom/Feature/Utils/LightingPreset.h>
|
||||
#include <Atom/RPI.Edit/Common/AssetUtils.h>
|
||||
#include <Atom/Viewport/MaterialViewportRequestBus.h>
|
||||
#include <AtomToolsFramework/Util/Util.h>
|
||||
#include <AzFramework/Application/Application.h>
|
||||
#include <Viewport/MaterialViewportRequestBus.h>
|
||||
#include <Window/PresetBrowserDialogs/LightingPresetBrowserDialog.h>
|
||||
|
||||
namespace MaterialEditor
|
||||
|
||||
+1
-1
@@ -10,8 +10,8 @@
|
||||
|
||||
#if !defined(Q_MOC_RUN)
|
||||
#include <Atom/Feature/Utils/LightingPreset.h>
|
||||
#include <Atom/Viewport/MaterialViewportNotificationBus.h>
|
||||
#include <AzCore/std/containers/vector.h>
|
||||
#include <Viewport/MaterialViewportNotificationBus.h>
|
||||
#endif
|
||||
|
||||
#include <Window/PresetBrowserDialogs/PresetBrowserDialog.h>
|
||||
|
||||
+1
-1
@@ -7,9 +7,9 @@
|
||||
*/
|
||||
|
||||
#include <Atom/Feature/Utils/ModelPreset.h>
|
||||
#include <Atom/Viewport/MaterialViewportRequestBus.h>
|
||||
#include <AtomToolsFramework/Util/Util.h>
|
||||
#include <AzFramework/Application/Application.h>
|
||||
#include <Viewport/MaterialViewportRequestBus.h>
|
||||
#include <Window/PresetBrowserDialogs/ModelPresetBrowserDialog.h>
|
||||
|
||||
namespace MaterialEditor
|
||||
|
||||
+1
-1
@@ -10,8 +10,8 @@
|
||||
|
||||
#if !defined(Q_MOC_RUN)
|
||||
#include <Atom/Feature/Utils/ModelPreset.h>
|
||||
#include <Atom/Viewport/MaterialViewportNotificationBus.h>
|
||||
#include <AzCore/std/containers/vector.h>
|
||||
#include <Viewport/MaterialViewportNotificationBus.h>
|
||||
#endif
|
||||
|
||||
#include <Window/PresetBrowserDialogs/PresetBrowserDialog.h>
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
#pragma once
|
||||
|
||||
#if !defined(Q_MOC_RUN)
|
||||
#include <Atom/Document/MaterialDocumentSettings.h>
|
||||
#include <AtomToolsFramework/Document/AtomToolsDocumentSystemSettings.h>
|
||||
#include <AtomToolsFramework/Inspector/InspectorWidget.h>
|
||||
#include <AzToolsFramework/UI/PropertyEditor/PropertyEditorAPI_Internals.h>
|
||||
#include <Document/MaterialDocumentSettings.h>
|
||||
#endif
|
||||
|
||||
namespace MaterialEditor
|
||||
|
||||
+3
-3
@@ -6,9 +6,9 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <Source/Window/ToolBar/LightingPresetComboBox.h>
|
||||
#include <Atom/Viewport/MaterialViewportRequestBus.h>
|
||||
#include <Atom/Feature/Utils/LightingPreset.h>
|
||||
#include <Viewport/MaterialViewportRequestBus.h>
|
||||
#include <Window/ToolBar/LightingPresetComboBox.h>
|
||||
|
||||
namespace MaterialEditor
|
||||
{
|
||||
@@ -102,4 +102,4 @@ namespace MaterialEditor
|
||||
|
||||
} // namespace MaterialEditor
|
||||
|
||||
#include <Source/Window/ToolBar/moc_LightingPresetComboBox.cpp>
|
||||
#include <Window/ToolBar/moc_LightingPresetComboBox.cpp>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
#if !defined(Q_MOC_RUN)
|
||||
#include <QComboBox>
|
||||
#include <Atom/Viewport/MaterialViewportNotificationBus.h>
|
||||
#include <Viewport/MaterialViewportNotificationBus.h>
|
||||
#endif
|
||||
|
||||
namespace MaterialEditor
|
||||
|
||||
@@ -6,21 +6,21 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <Atom/Viewport/MaterialViewportNotificationBus.h>
|
||||
#include <Atom/Viewport/MaterialViewportRequestBus.h>
|
||||
#include <Atom/Viewport/MaterialViewportSettings.h>
|
||||
#include <AzCore/std/containers/vector.h>
|
||||
#include <Viewport/MaterialViewportNotificationBus.h>
|
||||
#include <Viewport/MaterialViewportRequestBus.h>
|
||||
#include <Viewport/MaterialViewportSettings.h>
|
||||
#include <Window/ToolBar/LightingPresetComboBox.h>
|
||||
#include <Window/ToolBar/MaterialEditorToolBar.h>
|
||||
#include <Window/ToolBar/ModelPresetComboBox.h>
|
||||
|
||||
AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // disable warnings spawned by QT
|
||||
#include <AzQtComponents/Components/Widgets/ToolBar.h>
|
||||
#include <QAbstractItemView>
|
||||
#include <QAction>
|
||||
#include <QIcon>
|
||||
#include <QMenu>
|
||||
#include <QToolButton>
|
||||
#include <QAbstractItemView>
|
||||
AZ_POP_DISABLE_WARNING
|
||||
|
||||
namespace MaterialEditor
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#if !defined(Q_MOC_RUN)
|
||||
#include <QAction>
|
||||
#include <QToolBar>
|
||||
#include <Atom/Viewport/MaterialViewportNotificationBus.h>
|
||||
#include <Viewport/MaterialViewportNotificationBus.h>
|
||||
#endif
|
||||
|
||||
namespace MaterialEditor
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <Source/Window/ToolBar/ModelPresetComboBox.h>
|
||||
#include <Atom/Viewport/MaterialViewportRequestBus.h>
|
||||
#include <Atom/Feature/Utils/ModelPreset.h>
|
||||
#include <Viewport/MaterialViewportRequestBus.h>
|
||||
#include <Window/ToolBar/ModelPresetComboBox.h>
|
||||
|
||||
namespace MaterialEditor
|
||||
{
|
||||
@@ -102,4 +102,4 @@ namespace MaterialEditor
|
||||
|
||||
} // namespace MaterialEditor
|
||||
|
||||
#include <Source/Window/ToolBar/moc_ModelPresetComboBox.cpp>
|
||||
#include <Window/ToolBar/moc_ModelPresetComboBox.cpp>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
#if !defined(Q_MOC_RUN)
|
||||
#include <QComboBox>
|
||||
#include <Atom/Viewport/MaterialViewportNotificationBus.h>
|
||||
#include <Viewport/MaterialViewportNotificationBus.h>
|
||||
#endif
|
||||
|
||||
namespace MaterialEditor
|
||||
|
||||
+2
-2
@@ -7,10 +7,10 @@
|
||||
*/
|
||||
|
||||
#include <Atom/RPI.Reflect/Model/ModelAsset.h>
|
||||
#include <Atom/Viewport/MaterialViewportRequestBus.h>
|
||||
#include <AtomToolsFramework/Inspector/InspectorPropertyGroupWidget.h>
|
||||
#include <AtomToolsFramework/Util/Util.h>
|
||||
#include <AzCore/Utils/Utils.h>
|
||||
#include <Viewport/MaterialViewportRequestBus.h>
|
||||
#include <Window/PresetBrowserDialogs/LightingPresetBrowserDialog.h>
|
||||
#include <Window/PresetBrowserDialogs/ModelPresetBrowserDialog.h>
|
||||
#include <Window/ViewportSettingsInspector/ViewportSettingsInspector.h>
|
||||
@@ -376,4 +376,4 @@ namespace MaterialEditor
|
||||
|
||||
} // namespace MaterialEditor
|
||||
|
||||
#include <Source/Window/ViewportSettingsInspector/moc_ViewportSettingsInspector.cpp>
|
||||
#include <Window/ViewportSettingsInspector/moc_ViewportSettingsInspector.cpp>
|
||||
|
||||
+3
-3
@@ -12,11 +12,11 @@
|
||||
#include <ACES/Aces.h>
|
||||
#include <Atom/Feature/Utils/LightingPreset.h>
|
||||
#include <Atom/Feature/Utils/ModelPreset.h>
|
||||
#include <Atom/Viewport/MaterialViewportNotificationBus.h>
|
||||
#include <Atom/Viewport/MaterialViewportSettings.h>
|
||||
#include <Atom/Window/MaterialEditorWindowSettings.h>
|
||||
#include <AtomToolsFramework/Inspector/InspectorWidget.h>
|
||||
#include <AzToolsFramework/UI/PropertyEditor/PropertyEditorAPI_Internals.h>
|
||||
#include <Viewport/MaterialViewportNotificationBus.h>
|
||||
#include <Viewport/MaterialViewportSettings.h>
|
||||
#include <Window/MaterialEditorWindowSettings.h>
|
||||
#endif
|
||||
|
||||
namespace MaterialEditor
|
||||
|
||||
Reference in New Issue
Block a user