Fix material editor preview error

#704
This commit is contained in:
Wojtek Figat
2022-07-18 19:40:37 +02:00
parent 66d1015399
commit e346fa1dca

View File

@@ -188,11 +188,12 @@ namespace FlaxEditor.Viewport.Previews
}
// Surface
if (_previewModel.Model == null)
throw new Exception("Missing preview model asset.");
if (_previewModel.Model.WaitForLoaded())
throw new Exception("Preview model asset failed to load.");
_previewModel.SetMaterial(0, surfaceMaterial);
if (_previewModel.Model != null)
{
if (_previewModel.Model.WaitForLoaded())
throw new Exception("Preview model asset failed to load.");
_previewModel.SetMaterial(0, surfaceMaterial);
}
_previewModel.IsActive = usePreviewActor;
// PostFx