[node] Add SfMFilter node

Select views using regex
This commit is contained in:
jmelou 2024-10-25 15:18:08 +02:00 committed by Fabien Castan
parent c2d4159cef
commit 2519a57e76

View file

@ -0,0 +1,54 @@
__version__ = "1.0"
from meshroom.core import desc
from meshroom.core.utils import VERBOSE_LEVEL
class SfMFilter(desc.CommandLineNode):
commandLine = 'aliceVision_sfmFilter {allParams}'
category = 'Utils'
documentation = '''
This node allows select views from sfmData file using a regular expresion.
'''
inputs = [
desc.File(
name="inputFile",
label="inputFile",
description="SfMData file.",
value="",
uid=[],
),
desc.StringParam(
name="fileMatchingPattern",
label="File Matching Pattern",
description="Matching regular expression.\n"
"You should capture specific parts of the filepath with parentheses to define matching elements.\n"
"Some examples of patterns:\n"
" - Match the filename without extension (default value): "
r'".*\/(.*?)\.\w{3}"' + "\n"
" - Match the filename suffix after \"_\": "
r'".*\/.*(_.*?\.\w{3})"' + "\n"
" - Match the filename prefix before \"_\": "
r'".*\/(.*?)_.*\.\w{3}"',
value=r'.*\/(.*?)\.\w{3}',
uid=[],
),
]
outputs = [
desc.File(
name="outputSfMData_selected",
label="SfMData_selected",
description="Output SfMData file containing selected views.",
value=desc.Node.internalFolder + "/selectedSfmData.sfm",
uid=[],
),
desc.File(
name="outputSfMData_unselected",
label="SfMData_unselected",
description="Output SfMData file containing remaining views.",
value=desc.Node.internalFolder + "/unselectedSfmData.sfm",
uid=[],
),
]