Working on making Material Editor able to open materials that have missing textures.

Made it a warning instead of an error when MaterialAssetCreator can't find a texture.
Updated the Material Editor's MaterialDocument class to not elevate warnings to errors.
Material Editor uses new features in TraceRecorder to show a message dialog when warnings are detected so the user is notified of the missing texture.

Next I will work on making MaterialAssetCreator put a "missing" texture in place of the requested one.

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
This commit is contained in:
santorac
2021-11-10 14:02:17 -08:00
parent 87c7023e3c
commit cd28d210ab
5 changed files with 84 additions and 6 deletions
@@ -495,8 +495,6 @@ namespace AtomToolsFramework
return AZ::Uuid::CreateNull();
}
traceRecorder.GetDump().clear();
bool openResult = false;
AtomToolsDocumentRequestBus::EventResult(openResult, documentId, &AtomToolsDocumentRequestBus::Events::Open, requestedPath);
if (!openResult)
@@ -507,6 +505,12 @@ namespace AtomToolsFramework
AtomToolsDocumentSystemRequestBus::Broadcast(&AtomToolsDocumentSystemRequestBus::Events::DestroyDocument, documentId);
return AZ::Uuid::CreateNull();
}
else if (traceRecorder.GetWarningCount(true) > 0)
{
QMessageBox::warning(
QApplication::activeWindow(), QString("Document opened with warnings"),
QString("Warnings encountered: \n%1\n\n%2").arg(requestedPath.c_str()).arg(traceRecorder.GetDump().c_str()));
}
return documentId;
}