Fixed several material editor bugs related to file paths and hot reload prompts (#6374)
* draft Signed-off-by: Guthrie Adams <guthadam@amazon.com> * Removes automatic generation of relative paths for external references for materials Updated material editor functions for creating new materials, creating or saving model or lighting presets, to save to the project asset folder instead of the material folder which is not included in the new templates Changed function for getting saved file names to handle case where Qt save file dialog adds double extensions if the extension contains a dot Signed-off-by: Guthrie Adams <guthadam@amazon.com> * Fixed problems with material editor hot reloading after documents or dependencies changed. Triggering message boxes within the tick function, which is executed from the main application timer, caused the tick function to be called a second time recursively. Switched from using the tick bus to a timer so that the documents re opening and dialogs are triggered outside of the main tick. Signed-off-by: Guthrie Adams <guthadam@amazon.com>
This commit is contained in:
+3
-6
@@ -9,7 +9,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/Component/Component.h>
|
||||
#include <AzCore/Component/TickBus.h>
|
||||
#include <AzCore/std/smart_ptr/shared_ptr.h>
|
||||
#include <AzCore/Asset/AssetCommon.h>
|
||||
|
||||
@@ -28,7 +27,6 @@ namespace AtomToolsFramework
|
||||
//! AtomToolsDocumentSystemComponent is the central component of the Material Editor Core gem
|
||||
class AtomToolsDocumentSystemComponent
|
||||
: public AZ::Component
|
||||
, private AZ::TickBus::Handler
|
||||
, private AtomToolsDocumentNotificationBus::Handler
|
||||
, private AtomToolsDocumentSystemRequestBus::Handler
|
||||
{
|
||||
@@ -59,10 +57,8 @@ namespace AtomToolsFramework
|
||||
void OnDocumentExternallyModified(const AZ::Uuid& documentId) override;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// AZ::TickBus::Handler overrides...
|
||||
void OnTick(float deltaTime, AZ::ScriptTimePoint time) override;
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
void QueueReopenDocuments();
|
||||
void ReopenDocuments();
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// AtomToolsDocumentSystemRequestBus::Handler overrides...
|
||||
@@ -87,6 +83,7 @@ namespace AtomToolsFramework
|
||||
AZStd::unordered_map<AZ::Uuid, AZStd::shared_ptr<AtomToolsDocument>> m_documentMap;
|
||||
AZStd::unordered_set<AZ::Uuid> m_documentIdsWithExternalChanges;
|
||||
AZStd::unordered_set<AZ::Uuid> m_documentIdsWithDependencyChanges;
|
||||
bool m_queueReopenDocuments = false;
|
||||
const size_t m_maxMessageBoxLineCount = 15;
|
||||
};
|
||||
} // namespace AtomToolsFramework
|
||||
|
||||
Reference in New Issue
Block a user