Преглед изворни кода

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.
juliuse98 пре 2 година
родитељ
комит
7a0d12182e
1 измењених фајлова са 3 додато и 2 уклоњено
  1. 3 2
      modules/gltf/editor/editor_scene_importer_blend.cpp

+ 3 - 2
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;
 		return false;
 	}
 	}
-
-	if (pipe.find("Blender ") != 0) {
+	int bl = pipe.find("Blender ");
+	if (bl == -1) {
 		if (r_err) {
 		if (r_err) {
 			*r_err = vformat(TTR("Unexpected --version output from Blender binary at: %s"), path);
 			*r_err = vformat(TTR("Unexpected --version output from Blender binary at: %s"), path);
 		}
 		}
 		return false;
 		return false;
 	}
 	}
+	pipe = pipe.substr(bl);
 	pipe = pipe.replace_first("Blender ", "");
 	pipe = pipe.replace_first("Blender ", "");
 	int pp = pipe.find(".");
 	int pp = pipe.find(".");
 	if (pp == -1) {
 	if (pp == -1) {