diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-12-27 11:06:51 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-27 11:06:51 +0100 |
commit | be4b7da5187219efa2b41a94712e86d110df4fb2 (patch) | |
tree | e51dc4f57834dd2ca1718749bbbc32977a820633 | |
parent | de4d7a785e06b2508dad5c4bf3f43a1b836f8b7a (diff) | |
parent | 9c7ca687b2658b07e53f06ccfe9393342992b5ca (diff) |
Merge pull request #24623 from akien-mga/obj-mtl-not-found
Make error more explicit when OBJ/MTL files are missing
-rw-r--r-- | editor/import/resource_importer_obj.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/editor/import/resource_importer_obj.cpp b/editor/import/resource_importer_obj.cpp index c237d2e854..ae118e3e01 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<String, Ref<SpatialMaterial> > &material_map, List<String> *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<SpatialMaterial> current; @@ -206,7 +207,7 @@ static Error _parse_material_library(const String &p_path, Map<String, Ref<Spati static Error _parse_obj(const String &p_path, List<Ref<Mesh> > &r_meshes, bool p_single_mesh, bool p_generate_tangents, bool p_optimize, Vector3 p_scale_mesh, List<String> *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<ArrayMesh> mesh; @@ -217,11 +218,6 @@ static Error _parse_obj(const String &p_path, List<Ref<Mesh> > &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<Vector3> vertices; Vector<Vector3> normals; Vector<Vector2> uvs; |