Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAras Pranckevicius <aras@nesnausk.org>2022-05-04 15:11:25 +0300
committerAras Pranckevicius <aras@nesnausk.org>2022-05-04 15:11:25 +0300
commit3bdda67e509587dcf97ef3cec3a8654e3383aec8 (patch)
treee782668335983412317d1eec1bd1f959c335c9ee /source/blender/io/wavefront_obj/importer/obj_import_file_reader.cc
parent48c0738d4a21bba04483ef3798403a718d6b8e6f (diff)
parentcbeb8770cc4daec5c81f8d8ce060a1b594c039bb (diff)
Merge branch 'blender-v3.2-release'
Diffstat (limited to 'source/blender/io/wavefront_obj/importer/obj_import_file_reader.cc')
-rw-r--r--source/blender/io/wavefront_obj/importer/obj_import_file_reader.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/io/wavefront_obj/importer/obj_import_file_reader.cc b/source/blender/io/wavefront_obj/importer/obj_import_file_reader.cc
index 6c3dc6e448b..f88b3e143a6 100644
--- a/source/blender/io/wavefront_obj/importer/obj_import_file_reader.cc
+++ b/source/blender/io/wavefront_obj/importer/obj_import_file_reader.cc
@@ -618,8 +618,13 @@ Span<std::string> OBJParser::mtl_libraries() const
return mtl_libraries_;
}
-void OBJParser::add_mtl_library(const std::string &path)
+void OBJParser::add_mtl_library(StringRef path)
{
+ /* Remove any quotes from start and end (T67266, T97794). */
+ if (path.size() > 2 && path.startswith("\"") && path.endswith("\"")) {
+ path = path.drop_prefix(1).drop_suffix(1);
+ }
+
if (!mtl_libraries_.contains(path)) {
mtl_libraries_.append(path);
}
@@ -642,7 +647,7 @@ void OBJParser::add_default_mtl_library()
}
}
-MTLParser::MTLParser(StringRef mtl_library, StringRefNull obj_filepath)
+MTLParser::MTLParser(StringRefNull mtl_library, StringRefNull obj_filepath)
{
char obj_file_dir[FILE_MAXDIR];
BLI_split_dir_part(obj_filepath.data(), obj_file_dir, FILE_MAXDIR);