|
@@ -53,10 +53,13 @@ Node *EditorSceneFormatImporterFBX::import_scene(const String &p_path, uint32_t
|
|
List<String> *r_missing_deps, Error *r_err) {
|
|
List<String> *r_missing_deps, Error *r_err) {
|
|
// Get global paths for source and sink.
|
|
// Get global paths for source and sink.
|
|
|
|
|
|
- const String source_global = ProjectSettings::get_singleton()->globalize_path(p_path);
|
|
|
|
|
|
+ // Don't use `c_escape()` as it can generate broken paths. These paths will be
|
|
|
|
+ // enclosed in double quotes by OS::execute(), so we only need to escape those.
|
|
|
|
+ // `c_escape_multiline()` seems to do this (escapes `\` and `"` only).
|
|
|
|
+ const String source_global = ProjectSettings::get_singleton()->globalize_path(p_path).c_escape_multiline();
|
|
const String sink = ProjectSettings::get_singleton()->get_imported_files_path().plus_file(
|
|
const String sink = ProjectSettings::get_singleton()->get_imported_files_path().plus_file(
|
|
vformat("%s-%s.glb", p_path.get_file().get_basename(), p_path.md5_text()));
|
|
vformat("%s-%s.glb", p_path.get_file().get_basename(), p_path.md5_text()));
|
|
- const String sink_global = ProjectSettings::get_singleton()->globalize_path(sink);
|
|
|
|
|
|
+ const String sink_global = ProjectSettings::get_singleton()->globalize_path(sink).c_escape_multiline();
|
|
|
|
|
|
// Run fbx2gltf.
|
|
// Run fbx2gltf.
|
|
|
|
|
|
@@ -65,9 +68,9 @@ Node *EditorSceneFormatImporterFBX::import_scene(const String &p_path, uint32_t
|
|
List<String> args;
|
|
List<String> args;
|
|
args.push_back("--pbr-metallic-roughness");
|
|
args.push_back("--pbr-metallic-roughness");
|
|
args.push_back("--input");
|
|
args.push_back("--input");
|
|
- args.push_back(vformat("\"%s\"", source_global));
|
|
|
|
|
|
+ args.push_back(source_global);
|
|
args.push_back("--output");
|
|
args.push_back("--output");
|
|
- args.push_back(vformat("\"%s\"", sink_global));
|
|
|
|
|
|
+ args.push_back(sink_global);
|
|
args.push_back("--binary");
|
|
args.push_back("--binary");
|
|
|
|
|
|
String standard_out;
|
|
String standard_out;
|