Skip to content

Conversation

@cbentejac
Copy link
Contributor

Description

This PR adds the support for multiple Publish nodes with different output folders in meshroom_batch. Prior to it, a graph could have several Publish nodes, but only one path could be provided to the --output option, meaning all the nodes were writing their outputs in the same folder.

With this PR, specific Publish nodes can have their output folder set using the syntax NAME=FOLDER (e.g -o Publish_1=/path/to/output/folder). Different cases are covered:

  1. All the Publish nodes are specified individually (-o Publish_1=/path/to/folder1 Publish_2=/path/to/folder2): they will be set with their provided output folders.
  2. None of the Publish node has a specified path (-o /path/to/output/folder): all the Publish nodes will be set with the same provided value (this was the behaviour up until this PR).
  3. Some Publish nodes are specified individually, but some are not (-o Publish_1=/path/to/folder1): all the Publish nodes that do not have a specified output folder will use the first specified node's (here, /path/to/folder1).
  4. Some Publish nodes 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.
  5. None of the Publish nodes have a specified path, but several paths are provided (-o /path/to/folder1 /path/to/folder2): all the Publish nodes will be set with the last path that was provided (here /path/to/folder2).

Additionally, the Publish node is slightly modified to replace os.mkdir with os.makedirs when 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.

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
Copy link

codecov bot commented Aug 29, 2025

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 77.46%. Comparing base (5dda2ac) to head (c0b8027).
⚠️ Report is 7 commits behind head on develop.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
meshroom/nodes/general/Publish.py 0.00% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment on lines +260 to +261
if globalPublishPath == "": # Fallback in case some nodes would have no path
globalPublishPath = value
Copy link
Member

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.

Copy link
Contributor Author

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?

@cbentejac cbentejac merged commit 5ed67e2 into develop Sep 4, 2025
4 of 5 checks passed
@cbentejac cbentejac deleted the dev/batchPublish branch September 4, 2025 12:41
@cbentejac cbentejac linked an issue Sep 5, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[request] meshroom_photogrammetry: deal with multiple Publish nodes

4 participants