Skip to content

Commit 3876631

Browse files
committed
[ui] app: Support initializing templates with values for CopyFiles nodes
1 parent 385399d commit 3876631

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

meshroom/ui/app.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,14 @@ def createMeshroomParser(args):
183183
action='store_true',
184184
help=argparse.SUPPRESS # This hides the option from the help message
185185
)
186+
project_group.add_argument(
187+
'-o', '--output',
188+
metavar='OUTPUT_FOLDER',
189+
type=str,
190+
required=False,
191+
nargs='*',
192+
help='Set the output folder for the CopyFiles nodes.'
193+
)
186194

187195
# Pipeline Options
188196
pipeline_group = parser.add_argument_group('Pipeline Options')
@@ -320,7 +328,16 @@ def __init__(self, inputArgs):
320328
self._activeProject.load(project)
321329
self.addRecentProjectFile(project)
322330
elif getattr(args, "import", None) or args.importRecursive or args.save or args.pipeline:
323-
self._activeProject.new()
331+
if args.output:
332+
# Initialize the template and keep the "CopyFiles" nodes
333+
self._activeProject.newWithCopyOutputs()
334+
# Use the provided output paths to initialize the "CopyFiles" nodes
335+
copyNodes = self._activeProject.graph.nodesOfType("CopyFiles")
336+
if len(copyNodes) > 0:
337+
for index, node in enumerate(copyNodes):
338+
node.output.value = args.output[index] if index < len(args.output) else args.output[0]
339+
else:
340+
self._activeProject.new()
324341

325342
# import is a python keyword, so we have to access the attribute by a string
326343
if getattr(args, "import", None):

0 commit comments

Comments
 (0)