mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-06-03 19:31:58 +02:00
Merge pull request #2428 from alicevision/fix/outputExportAnimatedCamera
[nodes] Fix outputImages if no export in ExportAnimatedCamera
This commit is contained in:
commit
601fbc53f8
3 changed files with 18 additions and 15 deletions
|
@ -750,18 +750,20 @@ class BaseNode(BaseObject):
|
||||||
# Apply expressions for File attributes
|
# Apply expressions for File attributes
|
||||||
if attr.attributeDesc.isExpression:
|
if attr.attributeDesc.isExpression:
|
||||||
defaultValue = ""
|
defaultValue = ""
|
||||||
try:
|
# Do not evaluate expression for disabled attributes (the expression may refer to other attributes that are not defined)
|
||||||
defaultValue = attr.defaultValue()
|
if attr.enabled:
|
||||||
except AttributeError as e:
|
try:
|
||||||
# If we load an old scene, the lambda associated to the 'value' could try to access other params that could not exist yet
|
defaultValue = attr.defaultValue()
|
||||||
logging.warning('Invalid lambda evaluation for "{nodeName}.{attrName}"'.format(nodeName=self.name, attrName=attr.name))
|
except AttributeError as e:
|
||||||
try:
|
# If we load an old scene, the lambda associated to the 'value' could try to access other params that could not exist yet
|
||||||
attr.value = defaultValue.format(**self._cmdVars)
|
logging.warning('Invalid lambda evaluation for "{nodeName}.{attrName}"'.format(nodeName=self.name, attrName=attr.name))
|
||||||
attr._invalidationValue = defaultValue.format(**cmdVarsNoCache)
|
try:
|
||||||
except KeyError as e:
|
attr.value = defaultValue.format(**self._cmdVars)
|
||||||
logging.warning('Invalid expression with missing key on "{nodeName}.{attrName}" with value "{defaultValue}".\nError: {err}'.format(nodeName=self.name, attrName=attr.name, defaultValue=defaultValue, err=str(e)))
|
attr._invalidationValue = defaultValue.format(**cmdVarsNoCache)
|
||||||
except ValueError as e:
|
except KeyError as e:
|
||||||
logging.warning('Invalid expression value on "{nodeName}.{attrName}" with value "{defaultValue}".\nError: {err}'.format(nodeName=self.name, attrName=attr.name, defaultValue=defaultValue, err=str(e)))
|
logging.warning('Invalid expression with missing key on "{nodeName}.{attrName}" with value "{defaultValue}".\nError: {err}'.format(nodeName=self.name, attrName=attr.name, defaultValue=defaultValue, err=str(e)))
|
||||||
|
except ValueError as e:
|
||||||
|
logging.warning('Invalid expression value on "{nodeName}.{attrName}" with value "{defaultValue}".\nError: {err}'.format(nodeName=self.name, attrName=attr.name, defaultValue=defaultValue, err=str(e)))
|
||||||
|
|
||||||
v = attr.getValueStr(withQuotes=True)
|
v = attr.getValueStr(withQuotes=True)
|
||||||
|
|
||||||
|
|
|
@ -120,6 +120,7 @@ Based on the input image filenames, it will recognize the input video sequence t
|
||||||
value=desc.Node.internalFolder + "undistort/" + "<INTRINSIC_ID>_<FILESTEM>.{undistortedImageTypeValue}",
|
value=desc.Node.internalFolder + "undistort/" + "<INTRINSIC_ID>_<FILESTEM>.{undistortedImageTypeValue}",
|
||||||
semantic="image",
|
semantic="image",
|
||||||
group="", # exclude from command line
|
group="", # exclude from command line
|
||||||
|
enabled=lambda node: node.exportUndistortedImages.value,
|
||||||
uid=[],
|
uid=[],
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -81,7 +81,7 @@ def test_multiviewPipeline():
|
||||||
for node in graph1.nodes:
|
for node in graph1.nodes:
|
||||||
otherNode = otherGraph.node(node.name)
|
otherNode = otherGraph.node(node.name)
|
||||||
for key, attr in node.attributes.items():
|
for key, attr in node.attributes.items():
|
||||||
if attr.isOutput:
|
if attr.isOutput and attr.enabled:
|
||||||
otherAttr = otherNode.attribute(key)
|
otherAttr = otherNode.attribute(key)
|
||||||
assert attr.uid() != otherAttr.uid()
|
assert attr.uid() != otherAttr.uid()
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ def test_multiviewPipeline():
|
||||||
otherNode = graph2b.node(node.name)
|
otherNode = graph2b.node(node.name)
|
||||||
for key, attr in node.attributes.items():
|
for key, attr in node.attributes.items():
|
||||||
otherAttr = otherNode.attribute(key)
|
otherAttr = otherNode.attribute(key)
|
||||||
if attr.isOutput:
|
if attr.isOutput and attr.enabled:
|
||||||
assert attr.uid() == otherAttr.uid()
|
assert attr.uid() == otherAttr.uid()
|
||||||
else:
|
else:
|
||||||
for uidIndex in attr.desc.uid:
|
for uidIndex in attr.desc.uid:
|
||||||
|
@ -103,7 +103,7 @@ def test_multiviewPipeline():
|
||||||
otherNode = graph4b.node(node.name)
|
otherNode = graph4b.node(node.name)
|
||||||
for key, attr in node.attributes.items():
|
for key, attr in node.attributes.items():
|
||||||
otherAttr = otherNode.attribute(key)
|
otherAttr = otherNode.attribute(key)
|
||||||
if attr.isOutput:
|
if attr.isOutput and attr.enabled:
|
||||||
assert attr.uid() == otherAttr.uid()
|
assert attr.uid() == otherAttr.uid()
|
||||||
else:
|
else:
|
||||||
for uidIndex in attr.desc.uid:
|
for uidIndex in attr.desc.uid:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue