Fix T103555: File output node saving to the wrong folder

Regression in [0], caused by reliance on BLI_join_dirfile adding a
trailing slash when an empty file was passed in.

[0]: 9f6a045e23

Ref D16888
This commit is contained in:
Alaska 2023-01-04 20:57:52 +11:00 committed by Campbell Barton
parent cdd07ddb93
commit 77e8e73ed9
Notes: blender-bot 2023-02-14 06:17:14 +01:00
Referenced by issue #103555, File output nodes don't use the extra slash on the end unless there is a file sub path leading to incorrect file locations
1 changed files with 7 additions and 1 deletions

View File

@ -104,7 +104,13 @@ void OutputFileNode::convert_to_operations(NodeConverter &converter,
char path[FILE_MAX];
/* combine file path for the input */
BLI_path_join(path, FILE_MAX, storage->base_path, sockdata->path);
if (sockdata->path[0]) {
BLI_path_join(path, FILE_MAX, storage->base_path, sockdata->path);
}
else {
BLI_strncpy(path, storage->base_path, FILE_MAX);
BLI_path_slash_ensure(path, FILE_MAX);
}
NodeOperation *output_operation = nullptr;