From 9c7ca687b2658b07e53f06ccfe9393342992b5ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Thu, 27 Dec 2018 10:39:41 +0100 Subject: [PATCH] Make error more explicit when OBJ/MTL files are missing Fixes #24595. --- editor/import/resource_importer_obj.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/editor/import/resource_importer_obj.cpp b/editor/import/resource_importer_obj.cpp index c237d2e85494..ae118e3e0180 100644 --- a/editor/import/resource_importer_obj.cpp +++ b/editor/import/resource_importer_obj.cpp @@ -45,6 +45,7 @@ uint32_t EditorOBJImporter::get_import_flags() const { static Error _parse_material_library(const String &p_path, Map > &material_map, List *r_missing_deps) { FileAccessRef f = FileAccess::open(p_path, FileAccess::READ); + ERR_EXPLAIN(vformat("Couldn't open MTL file '%s', it may not exist or not be readable.", p_path)); ERR_FAIL_COND_V(!f, ERR_CANT_OPEN); Ref current; @@ -206,7 +207,7 @@ static Error _parse_material_library(const String &p_path, Map > &r_meshes, bool p_single_mesh, bool p_generate_tangents, bool p_optimize, Vector3 p_scale_mesh, List *r_missing_deps) { FileAccessRef f = FileAccess::open(p_path, FileAccess::READ); - + ERR_EXPLAIN(vformat("Couldn't open OBJ file '%s', it may not exist or not be readable.", p_path)); ERR_FAIL_COND_V(!f, ERR_CANT_OPEN); Ref mesh; @@ -217,11 +218,6 @@ static Error _parse_obj(const String &p_path, List > &r_meshes, bool p bool flip_faces = false; int mesh_flags = p_optimize ? Mesh::ARRAY_COMPRESS_DEFAULT : 0; - //bool flip_faces = p_options["force/flip_faces"]; - //bool force_smooth = p_options["force/smooth_shading"]; - //bool weld_vertices = p_options["force/weld_vertices"]; - //float weld_tolerance = p_options["force/weld_tolerance"]; - Vector vertices; Vector normals; Vector uvs;