-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[bin] meshroom_batch: Add support for setting multiple Publish nodes' output folders
#2867
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
Conversation
If the path that is provided to the `output` attribute does not exist, it should be created by the node. `os.mkdir` only creates one level of directory instead of creating all the intermediate folders, thus raising an error if there are several intermediate folders that do not exist.
`Publish` node names can be specified with the `-o` option to set these nodes' output folders individually. If node names are not specified, all the `Publish` nodes are set with the same output folder (as was the case until this commit).
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #2867 +/- ##
========================================
Coverage 77.46% 77.46%
========================================
Files 48 48
Lines 6735 6735
========================================
Hits 5217 5217
Misses 1518 1518 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| if globalPublishPath == "": # Fallback in case some nodes would have no path | ||
| globalPublishPath = value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would remove these 2 lines for clarity/simplicity of the rules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If some nodes don't have a specified path and there's no "global path", should we then throw an error?
Description
This PR adds the support for multiple
Publishnodes with different output folders inmeshroom_batch. Prior to it, a graph could have severalPublishnodes, but only one path could be provided to the--outputoption, meaning all the nodes were writing their outputs in the same folder.With this PR, specific
Publishnodes can have their output folder set using the syntaxNAME=FOLDER(e.g-o Publish_1=/path/to/output/folder). Different cases are covered:Publishnodes are specified individually (-o Publish_1=/path/to/folder1 Publish_2=/path/to/folder2): they will be set with their provided output folders.Publishnode has a specified path (-o /path/to/output/folder): all thePublishnodes will be set with the same provided value (this was the behaviour up until this PR).Publishnodes are specified individually, but some are not (-o Publish_1=/path/to/folder1): all thePublishnodes that do not have a specified output folder will use the first specified node's (here,/path/to/folder1).Publishnodes are specified individually, and a path that is not associated to any node is also provided (-o Publish_1=/path/to/folder1 /path/to/output): the specified nodes will be set with their own output folders, all the other ones will use the remaining path.Publishnodes have a specified path, but several paths are provided (-o /path/to/folder1 /path/to/folder2): all thePublishnodes will be set with the last path that was provided (here/path/to/folder2).Additionally, the
Publishnode is slightly modified to replaceos.mkdirwithos.makedirswhen the provided output folder does not exist and needs to be created. With that change, if the intermediate folders also do not exist, they will be created instead of an error being raised.