-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathqview.py
More file actions
executable file
·29 lines (24 loc) · 817 Bytes
/
qview.py
File metadata and controls
executable file
·29 lines (24 loc) · 817 Bytes
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
#!/usr/bin/env python
import argparse
import os
import os.path
import sys
from pyrender.renderer.OpenGL.GUIFrontEnd import GUIFrontEnd
from pyrender.scene.Scene import Scene
def parse_arguments():
parser = argparse.ArgumentParser(description="basic viewer for mesh");
parser.add_argument("mesh", nargs='?', help="input mesh");
parser.add_argument("-S", "--scene", "-S", help="scene file");
args = parser.parse_args();
return args;
def main():
args = parse_arguments();
if args.scene is not None:
scene = Scene.create_from_file(args.scene);
elif args.mesh is not None:
scene = Scene.create_basic_scene(args.mesh);
else:
raise RuntimeError("Please specify either a mesh or a scene.");
win = GUIFrontEnd(scene);
if __name__ == "__main__":
main();