Welcome to mirror list, hosted at ThFree Co, Russian Federation.

ExportAnimatedCamera.py « aliceVision « nodes « meshroom - github.com/alicevision/meshroom.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4eb378d866db17094617d4842bd5f34ae824f51d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
__version__ = "2.0"

from meshroom.core import desc


class ExportAnimatedCamera(desc.CommandLineNode):
    commandLine = 'aliceVision_exportAnimatedCamera {allParams}'

    category = 'Export'
    documentation = '''
Convert cameras from an SfM scene into an animated cameras in Alembic file format.
Based on the input image filenames, it will recognize the input video sequence to create an animated camera.
'''

    inputs = [
        desc.File(
            name='input',
            label='Input SfMData',
            description='SfMData file containing a complete SfM.',
            value='',
            uid=[0],
        ),
        desc.File(
            name='sfmDataFilter',
            label='SfMData Filter',
            description='Filter out cameras from the export if they are part of this SfMData. Export all cameras if empty.',
            value='',
            uid=[0],
        ),
        desc.File(
            name='viewFilter',
            label='View Filter',
            description='Select the cameras to export using an expression based on the image filepath. Export all cameras if empty.',
            value='',
            uid=[0],
        ),
        desc.BoolParam(
            name='exportUVMaps',
            label='Export UV Maps',
            description='Export UV Maps, absolutes values (x,y) of distortion are encoding in  UV channels.',
            value=True,
            uid=[0],
        ),
        desc.BoolParam(
            name='exportUndistortedImages',
            label='Export Undistorted Images',
            description='Export Undistorted Images.',
            value=False,
            uid=[0],
        ),
       desc.ChoiceParam(
            name='undistortedImageType',
            label='Undistort Image Format ',
            description='Image file format to use for undistorted images ("jpg", "png", "tif", "exr (half)").',
            value='exr',
            values=['jpg', 'png', 'tif', 'exr'],
            exclusive=True,
            uid=[0],
            enabled= lambda node: node.exportUndistortedImages.value,
        ),
        desc.BoolParam(
            name='exportFullROD',
            label='Export Full ROD',
            description='Export Full ROD.',
            value=False,
            enabled=lambda node: node.exportUndistortedImages.value and node.undistortedImageType.value == 'exr',
            uid=[0],
        ),
        desc.BoolParam(
            name='correctPrincipalPoint',
            label='Correct Principal Point ',
            description='Correct Principal Point.',
            value=True,
            uid=[0],
        ),
        desc.ChoiceParam(
            name='verboseLevel',
            label='Verbose Level',
            description='Verbosity level (fatal, error, warning, info, debug, trace).',
            value='info',
            values=['fatal', 'error', 'warning', 'info', 'debug', 'trace'],
            exclusive=True,
            uid=[],
        ),
    ]

    outputs = [
        desc.File(
            name='output',
            label='Output filepath',
            description='Output filepath for the alembic animated camera.',
            value=desc.Node.internalFolder,
            uid=[],
        ),
        desc.File(
            name='outputCamera',
            label='Output Camera Filepath',
            description='Output filename for the alembic animated camera.',
            value=desc.Node.internalFolder + 'camera.abc',
            group='',  # exclude from command line
            uid=[],
        ),
        desc.File(
            name='outputUndistorted',
            label='Output Undistorted images Filepath',
            description='Output Undistorted images.',
            value=desc.Node.internalFolder + 'undistort',
            group='',  # exclude from command line
            uid=[],
        ),
        ]