Просмотр исходного кода

- Fixes for latest stabilization/2305
- Minor cleanup

Signed-off-by: Jason Dela Cruz <[email protected]>

Jason Dela Cruz 2 лет назад
Родитель
Сommit
e12983f861

+ 7 - 0
Gems/O3DE/GeomNodes/Code/Include/GeomNodes/GeomNodesTypeIds.h

@@ -24,6 +24,9 @@ namespace GeomNodes
     // Interface TypeIds
     inline constexpr const char* GeomNodesRequestsTypeId = "{A5ECC740-0242-4ED8-A4BB-DFC9B5CBAD44}";
 
+    // Component TypeIds
+    inline constexpr const char* EditorGeomNodesComponentTypeId = "{E59507EF-9EBB-4F6C-8D89-92DCA57722E5}";
+
     // Other TypeIds
     inline constexpr const char* GNRenderMeshTypeId = "{4E293CD2-F9E6-417C-92B7-DDAF312F46CF}";
     inline constexpr const char* GNRenderMeshInterfaceTypeId = "{908CB056-4814-42FF-9D60-2D67A720D829}";
@@ -35,4 +38,8 @@ namespace GeomNodes
     inline constexpr const char* GNParamValueTypeId = "{4790660B-B942-4421-B942-AE27DF67BF4F}";
     inline constexpr const char* GNParamStringTypeId = "{9296C827-0281-4DBF-AC1A-B6636BCEC716}";
     inline constexpr const char* GNSystemInterfaceTypeId = "{83173679-DAF6-4496-BEFA-B0D252C40366}";
+    inline constexpr const char* GNPropertyGroupTypeId = "{439E8395-77B5-4BC6-94D6-5A0F51DBE9FD}";
+    inline constexpr const char* GNParamContextTypeId = "{AA9713B7-70F1-43CB-9F95-5BEC9F44F556}";
+    inline constexpr const char* GNParamDataContextTypeId = "{61ED88BA-210A-458B-A5E5-C71C05C05411}";
+    inline constexpr const char* GNConfigurationTypeId = "{828F21E8-D1C4-480E-A29B-33B618695874}";
 } // namespace GeomNodes

+ 4 - 0
Gems/O3DE/GeomNodes/Code/Source/Editor/Common/GNAPI.h

@@ -20,10 +20,14 @@ typedef unsigned int u32;
 
 typedef long (*HandlerCallback)(u64, const char*, u64);
 #endif
+
 namespace GeomNodes
 {
     namespace API
     {
+        /*!
+        * Interface for Bridge methods
+        */
         bool Init(u64 id, HandlerCallback cb);
         void Uninitialize();
         void SendMsg(const char* data, u64 length, u64 id);

+ 1 - 0
Gems/O3DE/GeomNodes/Code/Source/Editor/Common/GNConstants.h

@@ -10,6 +10,7 @@
 
 namespace GeomNodes
 {
+	//! Keys used for IPC JSON messages between clients(blender instances) and server(gem)
 	namespace Field
 	{
 		static constexpr char Initialized[] = "Initialized";

+ 2 - 1
Gems/O3DE/GeomNodes/Code/Source/Editor/Components/EditorGeomNodesComponent.h

@@ -27,7 +27,7 @@ namespace GeomNodes
         , private EditorGeomNodesComponentRequestBus::Handler
     {
     public:
-        AZ_EDITOR_COMPONENT(EditorGeomNodesComponent, "{E59507EF-9EBB-4F6C-8D89-92DCA57722E5}", EditorComponentBase);
+        AZ_EDITOR_COMPONENT(EditorGeomNodesComponent, EditorGeomNodesComponentTypeId, EditorComponentBase);
 
         static void Reflect(AZ::ReflectContext* context);
 
@@ -92,6 +92,7 @@ namespace GeomNodes
         void AddDataElement(GNProperty* gnParam, ElementInfo& ei);
 
         const char* CacheString(const char* str);
+    
         AZStd::unordered_map<const void*, AZStd::string> m_cachedStrings;
         AZStd::unordered_map<const void*, ElementInfo> m_dataElements;
         AZStd::unordered_map<AZStd::string, AZStd::string> m_defaultObjectInfos;

+ 0 - 3
Gems/O3DE/GeomNodes/Code/Source/Editor/Components/EditorGeomNodesSystemComponent.cpp

@@ -17,9 +17,6 @@ AZ_DEFINE_BUDGET(GeomNodes);
 
 namespace GeomNodes
 {
-    AZ_COMPONENT_IMPL(EditorGeomNodesSystemComponent, "EditorGeomNodesSystemComponent",
-        GeomNodesEditorSystemComponentTypeId, BaseSystemComponent);
-
     void EditorGeomNodesSystemComponent::Reflect(AZ::ReflectContext* context)
     {
         GNConfiguration::Reflect(context);

+ 2 - 2
Gems/O3DE/GeomNodes/Code/Source/Editor/Components/EditorGeomNodesSystemComponent.h

@@ -24,8 +24,8 @@ namespace GeomNodes
     {
         using BaseSystemComponent = GeomNodesSystemComponent;
     public:
-        AZ_COMPONENT_DECL(EditorGeomNodesSystemComponent);
-        
+        AZ_COMPONENT(EditorGeomNodesSystemComponent, GeomNodesEditorSystemComponentTypeId, BaseSystemComponent);
+
         static void Reflect(AZ::ReflectContext* context);
 
         EditorGeomNodesSystemComponent();

+ 2 - 1
Gems/O3DE/GeomNodes/Code/Source/Editor/Configuration/GNConfiguration.h

@@ -10,6 +10,7 @@
 
 #include <AzCore/std/string/string.h>
 #include <AzCore/Memory/Memory.h>
+#include <GeomNodes/GeomNodesTypeIds.h>
 
 namespace AZ
 {
@@ -22,7 +23,7 @@ namespace GeomNodes
     struct GNConfiguration
     {
         AZ_CLASS_ALLOCATOR_DECL;
-        AZ_TYPE_INFO(GNConfiguration, "{828F21E8-D1C4-480E-A29B-33B618695874}");
+        AZ_TYPE_INFO(GNConfiguration, GNConfigurationTypeId);
         static void Reflect(AZ::ReflectContext* context);
 
         static GNConfiguration CreateDefault();

+ 4 - 3
Gems/O3DE/GeomNodes/Code/Source/Editor/Systems/GNParamContext.h

@@ -12,6 +12,7 @@
 #include <AzCore/JSON/document.h>
 #include <AzCore/JSON/rapidjson.h>
 #include <Editor/Common/GNConstants.h>
+#include <GeomNodes/GeomNodesTypeIds.h>
 
 namespace GeomNodes
 {
@@ -69,7 +70,7 @@ namespace GeomNodes
 
     struct GNPropertyGroup
     {
-        AZ_TYPE_INFO(GNPropertyGroup, "{439E8395-77B5-4BC6-94D6-5A0F51DBE9FD}");
+        AZ_TYPE_INFO(GNPropertyGroup, GNPropertyGroupTypeId);
         AZStd::string m_name;
         AZStd::vector<GNProperty*> m_properties;
         AZStd::vector<GNPropertyGroup> m_groups;
@@ -102,7 +103,7 @@ namespace GeomNodes
     {
         friend GNParamContext;
     public:
-        AZ_TYPE_INFO(GNParamDataContext, "{61ED88BA-210A-458B-A5E5-C71C05C05411}");
+        AZ_TYPE_INFO(GNParamDataContext, GNParamDataContextTypeId);
 
         GNParamDataContext()
         {
@@ -187,7 +188,7 @@ namespace GeomNodes
     public:
         AZ_CLASS_ALLOCATOR(GNParamContext, AZ::SystemAllocator);
 
-        AZ_TYPE_INFO(GeomNodes::GNParamContext, "{AA9713B7-70F1-43CB-9F95-5BEC9F44F556}");
+        AZ_TYPE_INFO(GeomNodes::GNParamContext, GNParamContextTypeId);
 
         GNParamContext();
         ~GNParamContext();

+ 0 - 3
Gems/O3DE/GeomNodes/Code/Source/GeomNodes/Components/GeomNodesSystemComponent.cpp

@@ -14,9 +14,6 @@
 
 namespace GeomNodes
 {
-    AZ_COMPONENT_IMPL(GeomNodesSystemComponent, "GeomNodesSystemComponent",
-        GeomNodesSystemComponentTypeId);
-
     void GeomNodesSystemComponent::Reflect(AZ::ReflectContext* context)
     {
         if (auto serializeContext = azrtti_cast<AZ::SerializeContext*>(context))

+ 1 - 1
Gems/O3DE/GeomNodes/Code/Source/GeomNodes/Components/GeomNodesSystemComponent.h

@@ -20,7 +20,7 @@ namespace GeomNodes
         , public AZ::TickBus::Handler
     {
     public:
-        AZ_COMPONENT_DECL(GeomNodesSystemComponent);
+		AZ_COMPONENT(GeomNodesSystemComponent, GeomNodesSystemComponentTypeId);
 
         static void Reflect(AZ::ReflectContext* context);
 

+ 0 - 40
Gems/O3DE/GeomNodes/Code/Source/GeomNodesModuleInterface.cpp

@@ -1,40 +0,0 @@
-/*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
-
-#include "GeomNodesModuleInterface.h"
-#include <AzCore/Memory/Memory.h>
-
-#include <GeomNodes/GeomNodesTypeIds.h>
-
-#include <GeomNodes/Components/GeomNodesSystemComponent.h>
-
-namespace GeomNodes
-{
-    AZ_TYPE_INFO_WITH_NAME_IMPL(GeomNodesModuleInterface,
-        "GeomNodesModuleInterface", GeomNodesModuleInterfaceTypeId);
-    AZ_RTTI_NO_TYPE_INFO_IMPL(GeomNodesModuleInterface, AZ::Module);
-    AZ_CLASS_ALLOCATOR_IMPL(GeomNodesModuleInterface, AZ::SystemAllocator);
-
-    GeomNodesModuleInterface::GeomNodesModuleInterface()
-    {
-        // Push results of [MyComponent]::CreateDescriptor() into m_descriptors here.
-        // Add ALL components descriptors associated with this gem to m_descriptors.
-        // This will associate the AzTypeInfo information for the components with the the SerializeContext, BehaviorContext and EditContext.
-        // This happens through the [MyComponent]::Reflect() function.
-        m_descriptors.insert(m_descriptors.end(), {
-            GeomNodesSystemComponent::CreateDescriptor(),
-            });
-    }
-
-    AZ::ComponentTypeList GeomNodesModuleInterface::GetRequiredSystemComponents() const
-    {
-        return AZ::ComponentTypeList{
-            azrtti_typeid<GeomNodesSystemComponent>(),
-        };
-    }
-} // namespace GeomNodes

+ 20 - 8
Gems/O3DE/GeomNodes/Code/Source/GeomNodesModuleInterface.h

@@ -10,6 +10,8 @@
 #include <AzCore/Module/Module.h>
 #include <AzCore/RTTI/RTTIMacros.h>
 #include <AzCore/RTTI/TypeInfoSimple.h>
+#include <GeomNodes/GeomNodesTypeIds.h>
+#include <GeomNodes/Components/GeomNodesSystemComponent.h>
 
 namespace GeomNodes
 {
@@ -17,15 +19,25 @@ namespace GeomNodes
         : public AZ::Module
     {
     public:
-        AZ_TYPE_INFO_WITH_NAME_DECL(GeomNodesModuleInterface)
-        AZ_RTTI_NO_TYPE_INFO_DECL()
-        AZ_CLASS_ALLOCATOR_DECL
+        AZ_RTTI(GeomNodesModuleInterface, GeomNodesModuleInterfaceTypeId, AZ::Module);
+        AZ_CLASS_ALLOCATOR(GeomNodesModuleInterface, AZ::SystemAllocator);
 
-        GeomNodesModuleInterface();
+        GeomNodesModuleInterface()
+        {
+            // Push results of [MyComponent]::CreateDescriptor() into m_descriptors here.
+            // Add ALL components descriptors associated with this gem to m_descriptors.
+            // This will associate the AzTypeInfo information for the components with the the SerializeContext, BehaviorContext and EditContext.
+            // This happens through the [MyComponent]::Reflect() function.
+            m_descriptors.insert(m_descriptors.end(), {
+                GeomNodesSystemComponent::CreateDescriptor(),
+                });
+        }
 
-        /**
-         * Add required SystemComponents to the SystemEntity.
-         */
-        AZ::ComponentTypeList GetRequiredSystemComponents() const override;
+        AZ::ComponentTypeList GetRequiredSystemComponents() const
+        {
+            return AZ::ComponentTypeList{
+                azrtti_typeid<GeomNodesSystemComponent>(),
+            };
+        }
     };
 }// namespace GeomNodes

+ 0 - 1
Gems/O3DE/GeomNodes/Code/geomnodes_private_files.cmake

@@ -7,7 +7,6 @@
 #
 
 set(FILES
-    Source/GeomNodesModuleInterface.cpp
     Source/GeomNodesModuleInterface.h
     Source/GeomNodes/Components/GeomNodesSystemComponent.cpp
     Source/GeomNodes/Components/GeomNodesSystemComponent.h