Updated Material Editor to use the available default fallback images to visually indicate a missing texture.

Material Editor also warns the user when saving a material that is populated with fallback image references.
Factored out the path strings for the default images to ImateSystemInterface.h.

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
This commit is contained in:
santorac
2021-11-10 19:28:42 -08:00
parent e40b226374
commit f27203a5fa
10 changed files with 113 additions and 27 deletions
@@ -73,6 +73,9 @@ namespace AtomToolsFramework
//! Can the document be saved
virtual bool IsSavable() const = 0;
//! Get a list of warnings about the data that would be good to know before saving
virtual AZStd::vector<AZStd::string> GetDataWarnings() const { return {}; }
//! Returns true if there are reversible modifications to the document
virtual bool CanUndo() const = 0;
@@ -365,6 +365,24 @@ namespace AtomToolsFramework
return false;
}
AZStd::vector<AZStd::string> dataWarnings;
AtomToolsDocumentRequestBus::EventResult(dataWarnings, documentId, &AtomToolsDocumentRequestBus::Events::GetDataWarnings);
if (!dataWarnings.empty())
{
AZStd::string allWarnings;
AzFramework::StringFunc::Join(allWarnings, dataWarnings.begin(), dataWarnings.end(), "\n");
auto result = QMessageBox::warning(
QApplication::activeWindow(), QString("Data Warnings"),
QString("Are you sure you want to save with the following data warnings? \n\n%1").arg(allWarnings.c_str()),
QMessageBox::StandardButton::Yes, QMessageBox::StandardButton::No);
if (result == QMessageBox::StandardButton::No)
{
return false;
}
}
AtomToolsFramework::TraceRecorder traceRecorder(m_maxMessageBoxLineCount);
bool result = false;