Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace // with \\ before sending path to Blender #85335

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion modules/gltf/editor/editor_scene_importer_blend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,19 @@ Node *EditorSceneFormatImporterBlend::import_scene(const String &p_path, uint32_

// Get global paths for source and sink.
// Escape paths to be valid Python strings to embed in the script.
const String source_global = ProjectSettings::get_singleton()->globalize_path(p_path).c_escape();
String source_global = ProjectSettings::get_singleton()->globalize_path(p_path);

#ifdef WINDOWS_ENABLED
// On Windows, when using a network share path, the above will return a path starting with "//"
// which once handed to Blender will be treated like a relative path. So we need to replace the
// first two characters with "\\" to make it absolute again.
if (source_global.is_network_share_path()) {
source_global = "\\\\" + source_global.substr(2);
}
#endif

source_global = source_global.c_escape();

const String blend_basename = p_path.get_file().get_basename();
const String sink = ProjectSettings::get_singleton()->get_imported_files_path().path_join(
vformat("%s-%s.gltf", blend_basename, p_path.md5_text()));
Expand Down
Loading