[Bf-blender-cvs] [77e8e73ed9a] master: Fix T103555: File output node saving to the wrong folder

Alaska noreply at git.blender.org
Wed Jan 4 11:08:29 CET 2023


Commit: 77e8e73ed9a16e25eb92c6b549713a723bfa1373
Author: Alaska
Date:   Wed Jan 4 20:57:52 2023 +1100
Branches: master
https://developer.blender.org/rB77e8e73ed9a16e25eb92c6b549713a723bfa1373

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]: 9f6a045e23cf4ab132ef78eeaf070bd53d0c509f

Ref D16888

===================================================================

M	source/blender/compositor/nodes/COM_OutputFileNode.cc

===================================================================

diff --git a/source/blender/compositor/nodes/COM_OutputFileNode.cc b/source/blender/compositor/nodes/COM_OutputFileNode.cc
index 50989f73986..e591b4aed9e 100644
--- a/source/blender/compositor/nodes/COM_OutputFileNode.cc
+++ b/source/blender/compositor/nodes/COM_OutputFileNode.cc
@@ -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;



More information about the Bf-blender-cvs mailing list