Browse Source

Fixed AZ_CLASS_ALLOCATOR usage. Some other class missing AZ_CLASS_ALLOCATOR.
Fixed materials not loading on fresh run.
Minor change to when parameters are disabled during mesh/model loading.

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

Jason Dela Cruz 2 years ago
parent
commit
4136843bca

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

@@ -39,7 +39,7 @@ namespace GeomNodes
 		Color
 	};
 
-    static constexpr AZStd::string_view AssetsFolderPath = "assets/geomNodes/";
+    static constexpr AZStd::string_view AssetsFolderPath = "assets/geomnodes/";
     static constexpr AZStd::string_view MaterialsFolder = "materials";
     static constexpr AZStd::string_view MaterialExtension = ".material";
     static constexpr AZStd::string_view AzMaterialExtension = ".azmaterial";

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

@@ -227,10 +227,10 @@ namespace GeomNodes
             }
             else if (jsonDocument.HasMember(Field::SHMOpen) && jsonDocument.HasMember(Field::MapId))
             {
+                SetWorkInProgress(true);
                 AZ::u64 mapId = jsonDocument[Field::MapId].GetInt64();
                 m_controller->ReadData(mapId);
                 m_instance->CloseMap(mapId);
-                SetWorkInProgress(false);
                 m_controller->RebuildRenderMesh();
             }
             else if (jsonDocument.HasMember(Field::Export) && jsonDocument.HasMember(Field::Error))

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

@@ -6,7 +6,7 @@
 
 namespace GeomNodes
 {
-    AZ_CLASS_ALLOCATOR_IMPL(GNConfiguration, AZ::SystemAllocator, 0);
+    AZ_CLASS_ALLOCATOR_IMPL(GNConfiguration, AZ::SystemAllocator);
 
     /*static*/ void GNConfiguration::Reflect(AZ::ReflectContext* context)
     {

+ 1 - 1
Gems/O3DE/GeomNodes/Code/Source/Editor/Modules/GeomNodesEditorModule.cpp

@@ -12,7 +12,7 @@ namespace GeomNodes
     {
     public:
         AZ_RTTI(GeomNodesEditorModule, "{49C42A73-EF4E-4D42-8ECF-0ADE7F942CCD}", GeomNodesModuleInterface);
-        AZ_CLASS_ALLOCATOR(GeomNodesEditorModule, AZ::SystemAllocator, 0);
+        AZ_CLASS_ALLOCATOR(GeomNodesEditorModule, AZ::SystemAllocator);
 
         GeomNodesEditorModule()
             : m_gnSystem(AZStd::make_unique<GNEditorSettingsRegistryManager>())

+ 5 - 3
Gems/O3DE/GeomNodes/Code/Source/Editor/Rendering/GNMeshController.cpp

@@ -113,10 +113,9 @@ namespace GeomNodes
 				m_renderMesh->UpdateTransform(m_worldFromLocal);
 				AzFramework::BoundsRequestBus::Handler::BusConnect(m_entityId);
 				AzToolsFramework::EditorComponentSelectionRequestsBus::Handler::BusConnect(m_entityId);
+				EditorGeomNodesComponentRequestBus::Event(m_entityId, &EditorGeomNodesComponentRequests::SetWorkInProgress, false);
 			});
 		}
-
-		m_requestingMeshRebuild = false;
 	}
 
 	void GNMeshController::ReadData(AZ::u64 mapId)
@@ -163,6 +162,9 @@ namespace GeomNodes
 					m_materialWaitList.push_back(azMaterialPath);
 				}
 			}
+			else {
+				m_materialWaitList.push_back(azMaterialPath);
+			}
 		}
 	}
 
@@ -255,7 +257,7 @@ namespace GeomNodes
 					if (iter != m_materialWaitList.end())
 					{
 						m_materialWaitList.erase(iter);
-						if (m_requestingMeshRebuild && m_materialWaitList.empty()) {
+						if (m_materialWaitList.empty()) {
 							RebuildRenderMesh();
 						}
 					}

+ 0 - 2
Gems/O3DE/GeomNodes/Code/Source/Editor/Rendering/GNMeshController.h

@@ -59,8 +59,6 @@ namespace GeomNodes
 
 		AZStd::string m_blenderFilename;
 		AZStd::vector<AZStd::string> m_materialWaitList;	//!< List for materials building in AP. Having an empty list all materials are built and ready for loading.
-		
-		bool m_requestingMeshRebuild = false;
     };
 
 } // namespace GeomNodes

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

@@ -163,7 +163,7 @@ namespace GeomNodes
     public:
         typedef GNProperty* (*ParamTypeFactory)(GNParamDataContext& context, int valueIndex, const char* name);
 
-        AZ_CLASS_ALLOCATOR(GNParamContextImpl, AZ::SystemAllocator, 0);
+        AZ_CLASS_ALLOCATOR(GNParamContextImpl, AZ::SystemAllocator);
 
         GNParamContextImpl();
         ~GNParamContextImpl() = default;
@@ -177,7 +177,7 @@ namespace GeomNodes
         friend class EditorGeomNodesComponent;
 
     public:
-        AZ_CLASS_ALLOCATOR(GNParamContext, AZ::SystemAllocator, 0);
+        AZ_CLASS_ALLOCATOR(GNParamContext, AZ::SystemAllocator);
 
         AZ_TYPE_INFO(GeomNodes::GNParamContext, "{AA9713B7-70F1-43CB-9F95-5BEC9F44F556}");
 

+ 5 - 5
Gems/O3DE/GeomNodes/Code/Source/Editor/Systems/GNProperty.h

@@ -106,7 +106,7 @@ namespace GeomNodes
     class GNParamNil : public GNProperty
     {
     public:
-        AZ_CLASS_ALLOCATOR(GNParamNil, AZ::SystemAllocator, 0);
+        AZ_CLASS_ALLOCATOR(GNParamNil, AZ::SystemAllocator);
         AZ_RTTI(GeomNodes::GNParamNil, "{519D98C7-054A-4047-BCEB-28DCD38CFCD4}", GNProperty);
 
         static void Reflect(AZ::ReflectContext* reflection);
@@ -134,7 +134,7 @@ namespace GeomNodes
     class GNParamBoolean : public GNProperty
     {
     public:
-        AZ_CLASS_ALLOCATOR(GNParamBoolean, AZ::SystemAllocator, 0);
+        AZ_CLASS_ALLOCATOR(GNParamBoolean, AZ::SystemAllocator);
         AZ_RTTI(GeomNodes::GNParamBoolean, "{6A05BCAB-50F7-4988-96E1-0EDB6B76C3A3}", GNProperty);
 
         static void Reflect(AZ::ReflectContext* reflection);
@@ -175,7 +175,7 @@ namespace GeomNodes
     class GNParamInt : public GNProperty
     {
     public:
-        AZ_CLASS_ALLOCATOR(GNParamInt, AZ::SystemAllocator, 0);
+        AZ_CLASS_ALLOCATOR(GNParamInt, AZ::SystemAllocator);
         AZ_RTTI(GNParamInt, "{B2457A3D-F30C-43F9-90F0-5BFAFFFD0F59}", GNProperty);
 
         static void Reflect(AZ::ReflectContext* reflection);
@@ -228,7 +228,7 @@ namespace GeomNodes
     class GNParamValue : public GNProperty
     {
     public:
-        AZ_CLASS_ALLOCATOR(GNParamValue, AZ::SystemAllocator, 0);
+        AZ_CLASS_ALLOCATOR(GNParamValue, AZ::SystemAllocator);
         AZ_RTTI(GeomNodes::GNParamValue, "{4790660B-B942-4421-B942-AE27DF67BF4F}", GNProperty);
 
         static void Reflect(AZ::ReflectContext* reflection);
@@ -281,7 +281,7 @@ namespace GeomNodes
     class GNParamString : public GNProperty
     {
     public:
-        AZ_CLASS_ALLOCATOR(GNParamString, AZ::SystemAllocator, 0);
+        AZ_CLASS_ALLOCATOR(GNParamString, AZ::SystemAllocator);
         AZ_RTTI(GeomNodes::GNParamString, "{9296C827-0281-4DBF-AC1A-B6636BCEC716}", GNProperty);
 
         static void Reflect(AZ::ReflectContext* reflection);

+ 1 - 1
Gems/O3DE/GeomNodes/Code/Source/Editor/UI/ConfigurationWidget.h

@@ -19,7 +19,7 @@ namespace GeomNodes
             Q_OBJECT
 
         public:
-            AZ_CLASS_ALLOCATOR(ConfigurationWidget, AZ::SystemAllocator, 0);
+            AZ_CLASS_ALLOCATOR(ConfigurationWidget, AZ::SystemAllocator);
 
             explicit ConfigurationWidget(QWidget* parent = nullptr);
             ~ConfigurationWidget() override;

+ 1 - 1
Gems/O3DE/GeomNodes/Code/Source/Editor/UI/EditorWindow.h

@@ -23,7 +23,7 @@ namespace GeomNodes
         {
             Q_OBJECT
         public:
-            AZ_CLASS_ALLOCATOR(EditorWindow, AZ::SystemAllocator, 0);
+            AZ_CLASS_ALLOCATOR(EditorWindow, AZ::SystemAllocator);
             static void RegisterViewClass();
 
             explicit EditorWindow(QWidget* parent = nullptr);

+ 2 - 1
Gems/O3DE/GeomNodes/Code/Source/Editor/UI/PropertyFileSelect.h

@@ -18,6 +18,7 @@ namespace GeomNodes
         Q_OBJECT
 
     public:
+        AZ_CLASS_ALLOCATOR(PropertyFileSelectCtrl, AZ::SystemAllocator)
         typedef QString(* FileSelectFuncType)(const QString&);
 
         PropertyFileSelectCtrl(QWidget* pParent = nullptr);
@@ -34,7 +35,7 @@ namespace GeomNodes
     class PropertyFileSelectHandler
         : public AzToolsFramework::PropertyHandler<AZStd::string, PropertyFileSelectCtrl>
     {
-        AZ_CLASS_ALLOCATOR(PropertyFileSelectHandler, AZ::SystemAllocator, 0);
+        AZ_CLASS_ALLOCATOR(PropertyFileSelectHandler, AZ::SystemAllocator);
 
     public:
         PropertyFileSelectHandler(ValidationHandler* valHdlr);

+ 3 - 3
Gems/O3DE/GeomNodes/Code/Source/Editor/UI/PropertyFuncValBrowseEdit.h

@@ -20,14 +20,14 @@ namespace GeomNodes
         Q_OBJECT
 
     public:
-        AZ_CLASS_ALLOCATOR(PropertyFuncValBrowseEditCtrl, AZ::SystemAllocator, 0);
+        AZ_CLASS_ALLOCATOR(PropertyFuncValBrowseEditCtrl, AZ::SystemAllocator);
 
         using ValidationCallbackType = AZ::Edit::AttributeFunction<void(const AZStd::string&)>;
 
         PropertyFuncValBrowseEditCtrl(QWidget* pParent = nullptr);
 
         virtual QString GetValue() const;
-        // Sets value programmtically and triggers validation
+        // Sets value programmatically and triggers validation
         virtual void SetValue(const QString& value);
         // Sets value as if user set it
         void SetValueUser(const QString& value);
@@ -63,7 +63,7 @@ namespace GeomNodes
     class PropertyFuncValBrowseEditHandler
         : public AzToolsFramework::PropertyHandler <AZStd::string, PropertyFuncValBrowseEditCtrl>
     {
-        AZ_CLASS_ALLOCATOR(PropertyFuncValBrowseEditHandler, AZ::SystemAllocator, 0);
+        AZ_CLASS_ALLOCATOR(PropertyFuncValBrowseEditHandler, AZ::SystemAllocator);
 
     public:
         PropertyFuncValBrowseEditHandler(ValidationHandler* valHdlr);

+ 1 - 1
Gems/O3DE/GeomNodes/Code/Source/Editor/UI/SettingsWidget.h

@@ -17,7 +17,7 @@ namespace GeomNodes
             Q_OBJECT
 
         public:
-            AZ_CLASS_ALLOCATOR(SettingsWidget, AZ::SystemAllocator, 0);
+            AZ_CLASS_ALLOCATOR(SettingsWidget, AZ::SystemAllocator);
 
             explicit SettingsWidget(QWidget* parent = nullptr);
 

+ 1 - 1
Gems/O3DE/GeomNodes/Code/Source/GeomNodes/Modules/GeomNodesModule.cpp

@@ -10,7 +10,7 @@ namespace GeomNodes
     {
     public:
         AZ_RTTI(GeomNodesModule, "{49C42A73-EF4E-4D42-8ECF-0ADE7F942CCD}", GeomNodesModuleInterface);
-        AZ_CLASS_ALLOCATOR(GeomNodesModule, AZ::SystemAllocator, 0);
+        AZ_CLASS_ALLOCATOR(GeomNodesModule, AZ::SystemAllocator);
     };
 }// namespace GeomNodes
 

+ 1 - 1
Gems/O3DE/GeomNodes/Code/Source/GeomNodesModuleInterface.h

@@ -10,7 +10,7 @@ namespace GeomNodes
     {
     public:
         AZ_RTTI(GeomNodesModuleInterface, "{2D38307D-709D-4B17-9878-AF59F988FC54}", AZ::Module);
-        AZ_CLASS_ALLOCATOR(GeomNodesModuleInterface, AZ::SystemAllocator, 0);
+        AZ_CLASS_ALLOCATOR(GeomNodesModuleInterface, AZ::SystemAllocator);
 
         GeomNodesModuleInterface()
         {