From 2663fb8f4f05f512149fba24ccd01337ff22de81 Mon Sep 17 00:00:00 2001 From: Fabien Castan Date: Wed, 31 Jan 2024 21:56:11 +0100 Subject: [PATCH] [core] command line: do not export an empty list on the command line but export empty string params on the command line (avoid to switch to another default value from the command line if not provided). --- meshroom/core/node.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/meshroom/core/node.py b/meshroom/core/node.py index fa3246f083..79f17c6802 100644 --- a/meshroom/core/node.py +++ b/meshroom/core/node.py @@ -713,7 +713,8 @@ def _buildAttributeCmdVars(cmdVars, name, attr): cmdVars[name] = '--{name} "{value}"'.format(name=name, value=v) cmdVars[name + 'Value'] = str(v) - if v: + # do not export on the command line, if it is an empty list + if not isinstance(attr, ListAttribute) or v: cmdVars[group] = cmdVars.get(group, '') + ' ' + cmdVars[name] elif isinstance(attr, GroupAttribute): assert isinstance(attr.value, DictModel) @@ -764,7 +765,8 @@ def _buildAttributeCmdVars(cmdVars, name, attr): self._cmdVars[name] = '--{name} "{value}"'.format(name=name, value=v) self._cmdVars[name + 'Value'] = str(v) - if v: + # do not export on the command line, if it is an empty list + if not isinstance(attr, ListAttribute) or v: self._cmdVars[attr.attributeDesc.group] = self._cmdVars.get(attr.attributeDesc.group, '') + \ ' ' + self._cmdVars[name]