mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-05-24 06:26:29 +02:00
[nodes] ImageProcessing: bug fix and minor code simplification
This commit is contained in:
parent
67a87a5f09
commit
6888322adc
1 changed files with 16 additions and 10 deletions
|
@ -9,19 +9,25 @@ def outputImagesValueFunct(attr):
|
|||
fileStem = os.path.splitext(basename)[0]
|
||||
inputExt = os.path.splitext(basename)[1]
|
||||
outputExt = ('.' + attr.node.extension.value) if attr.node.extension.value else None
|
||||
|
||||
|
||||
if inputExt in ['.abc', '.sfm']:
|
||||
# If we have an SfM in input
|
||||
return desc.Node.internalFolder + '*' + (outputExt or '.*')
|
||||
elif inputExt :
|
||||
|
||||
if inputExt:
|
||||
# if we have one or multiple files in input
|
||||
return desc.Node.internalFolder + fileStem + (outputExt or inputExt)
|
||||
else:
|
||||
if '*' in fileStem:
|
||||
# Assume the input fileStem is a regular expression to files
|
||||
return desc.Node.internalFolder + fileStem + (outputExt or '.*')
|
||||
else:
|
||||
# No extension mean it is a folder path
|
||||
return desc.Node.internalFolder + fileStem + '/' + (outputExt or '.*')
|
||||
|
||||
|
||||
if '*' in fileStem:
|
||||
# The fileStem of the input param is a regular expression,
|
||||
# so even if there is no file extension,
|
||||
# we consider that the expression represents files.
|
||||
return desc.Node.internalFolder + fileStem + (outputExt or '.*')
|
||||
|
||||
# No extension and no expression means that the input param is a folder path
|
||||
return desc.Node.internalFolder + '*' + (outputExt or '.*')
|
||||
|
||||
|
||||
class ImageProcessing(desc.CommandLineNode):
|
||||
commandLine = 'aliceVision_utils_imageProcessing {allParams}'
|
||||
size = desc.DynamicNodeSize('input')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue