summaryrefslogtreecommitdiff
path: root/modules/gltf/editor
diff options
context:
space:
mode:
authorjuliuse98 <julius.ewert1@gmail.com>2023-03-06 22:36:03 +0100
committerYuri Sizov <yuris@humnom.net>2023-03-13 22:19:36 +0100
commite3e117cac538eab4adb1c9c5f145cc89047185d0 (patch)
tree930d594f8328cf17e5ae2fa6e1f65e50a43163f4 /modules/gltf/editor
parent494449f2129b19d00e30b41666b7d7d65fb501b4 (diff)
Fix blend-file import when using custom color management in blender
When using custom color management in blender the --version command will output additional information infront of the "normal" output and this prevented the import. Fixes #74439. (cherry picked from commit 7a0d12182e2808df083a58511f3d6b6023487e70)
Diffstat (limited to 'modules/gltf/editor')
-rw-r--r--modules/gltf/editor/editor_scene_importer_blend.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/gltf/editor/editor_scene_importer_blend.cpp b/modules/gltf/editor/editor_scene_importer_blend.cpp
index 7dcdc8e7cf..a736e36c6a 100644
--- a/modules/gltf/editor/editor_scene_importer_blend.cpp
+++ b/modules/gltf/editor/editor_scene_importer_blend.cpp
@@ -297,13 +297,14 @@ static bool _test_blender_path(const String &p_path, String *r_err = nullptr) {
}
return false;
}
-
- if (pipe.find("Blender ") != 0) {
+ int bl = pipe.find("Blender ");
+ if (bl == -1) {
if (r_err) {
*r_err = vformat(TTR("Unexpected --version output from Blender binary at: %s"), path);
}
return false;
}
+ pipe = pipe.substr(bl);
pipe = pipe.replace_first("Blender ", "");
int pp = pipe.find(".");
if (pp == -1) {