Fix T97362: forward slashes in USD texture paths

Ensuring that relative paths to textures in exported USDs use
forward slash separators, for cross-platform compatibility.
This commit is contained in:
Michael Kowalski 2022-06-10 15:07:45 -04:00
parent 9e622e1d02
commit add1da52ad
Notes: blender-bot 2023-02-14 06:19:41 +01:00
Referenced by issue #99196, Regression: Rendering in the viewport is constantly restarted by some sculpting brushes and the position of mouse cursor
Referenced by issue #98784, Sculpting template crash
Referenced by issue #97362, USD image assets paths are not resolved in a cross platform manner
1 changed files with 2 additions and 1 deletions

View File

@ -590,6 +590,7 @@ static std::string get_tex_image_asset_path(bNode *node,
BLI_split_dir_part(stage_path.c_str(), dir_path, FILE_MAX);
BLI_path_join(exp_path, FILE_MAX, dir_path, "textures", file_path, nullptr);
}
BLI_str_replace_char(exp_path, '\\', '/');
return exp_path;
}
@ -608,7 +609,7 @@ static std::string get_tex_image_asset_path(bNode *node,
if (!BLI_path_is_rel(rel_path)) {
return path;
}
BLI_str_replace_char(rel_path, '\\', '/');
return rel_path + 2;
}