|
| 1 | +__version__ = "1.0" |
| 2 | + |
| 3 | +from meshroom.core import desc |
| 4 | +from meshroom.core.utils import VERBOSE_LEVEL |
| 5 | + |
| 6 | + |
| 7 | +class SfMFilter(desc.CommandLineNode): |
| 8 | + commandLine = 'aliceVision_sfmFilter {allParams}' |
| 9 | + category = 'Utils' |
| 10 | + documentation = ''' |
| 11 | +This node allows select views from sfmData file using a regular expresion. |
| 12 | +''' |
| 13 | + |
| 14 | + inputs = [ |
| 15 | + desc.File( |
| 16 | + name="inputFile", |
| 17 | + label="inputFile", |
| 18 | + description="SfMData file.", |
| 19 | + value="", |
| 20 | + uid=[], |
| 21 | + ), |
| 22 | + desc.StringParam( |
| 23 | + name="fileMatchingPattern", |
| 24 | + label="File Matching Pattern", |
| 25 | + description="Matching regular expression.\n" |
| 26 | + "You should capture specific parts of the filepath with parentheses to define matching elements.\n" |
| 27 | + "Some examples of patterns:\n" |
| 28 | + " - Match the filename without extension (default value): " |
| 29 | + r'".*\/(.*?)\.\w{3}"' + "\n" |
| 30 | + " - Match the filename suffix after \"_\": " |
| 31 | + r'".*\/.*(_.*?\.\w{3})"' + "\n" |
| 32 | + " - Match the filename prefix before \"_\": " |
| 33 | + r'".*\/(.*?)_.*\.\w{3}"', |
| 34 | + value=r'.*\/(.*?)\.\w{3}', |
| 35 | + uid=[], |
| 36 | + ), |
| 37 | + ] |
| 38 | + |
| 39 | + outputs = [ |
| 40 | + desc.File( |
| 41 | + name="outputSfMData_selected", |
| 42 | + label="SfMData_selected", |
| 43 | + description="Output SfMData file containing selected views.", |
| 44 | + value=desc.Node.internalFolder + "/selectedSfmData.sfm", |
| 45 | + uid=[], |
| 46 | + ), |
| 47 | + desc.File( |
| 48 | + name="outputSfMData_unselected", |
| 49 | + label="SfMData_unselected", |
| 50 | + description="Output SfMData file containing remaining views.", |
| 51 | + value=desc.Node.internalFolder + "/unselectedSfmData.sfm", |
| 52 | + uid=[], |
| 53 | + ), |
| 54 | + ] |
0 commit comments