-
-
Notifications
You must be signed in to change notification settings - Fork 872
Expand file tree
/
Copy pathConvertMesh.py
More file actions
64 lines (58 loc) · 2.14 KB
/
ConvertMesh.py
File metadata and controls
64 lines (58 loc) · 2.14 KB
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
__version__ = "2.0"
from meshroom.core import desc
from meshroom.core.utils import VERBOSE_LEVEL
class ConvertMesh(desc.AVCommandLineNode):
"""
Convert a 3D mesh from one file format to another.
Supported formats include OBJ, FBX, glTF, GLB, STL and PLY. The node can optionally flip
face normals (which may be required depending on the winding-order convention used by the
target application) and copy associated texture image files to the output folder.
"""
commandLine = "aliceVision_convertMesh {allParams}"
category = "Utils"
inputs = [
desc.File(
name="inputMesh",
label="Input Mesh",
description="Input mesh (*.obj, *.fbx, *.gltf, *.glb, *.stl, *.ply).",
value="",
),
desc.ChoiceParam(
name="outputMeshFileType",
label="Output File Type",
description="Output mesh format (*.obj, *.fbx, *.gltf, *.glb, *.stl, *.ply).",
value="obj",
values=["obj", "fbx", "gltf", "glb", "stl", "ply"],
commandLineGroup="",
),
desc.BoolParam(
name="flipNormals",
label="Flip Normals",
description="Flip face normals. It can be needed as it depends on the vertices order "
"in triangles and the convention changes from one software to another.",
value=False,
advanced=True,
),
desc.BoolParam(
name="copyTextures",
label="Copy Textures",
description="Copy input mesh texture files to the output mesh folder.",
value=True,
advanced=True,
),
desc.ChoiceParam(
name="verboseLevel",
label="Verbose Level",
description="Verbosity level (fatal, error, warning, info, debug, trace).",
values=VERBOSE_LEVEL,
value="info",
),
]
outputs = [
desc.File(
name="output",
label="Mesh",
description="Output mesh (*.obj, *.fbx, *.gltf, *.glb, *.stl, *.ply).",
value="{nodeCacheFolder}/mesh.{outputMeshFileTypeValue}",
),
]