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:
+6
-2
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user