model-converter-python/conv3d/loadmodel.py

19 lines
349 B
Python
Raw Normal View History

2016-11-22 10:27:42 +00:00
#!/usr/bin/env python3
from .obj import is_obj, OBJParser
from .ply import is_ply, PLYParser
def load_model(path):
parser = None
if is_obj(path):
parser = OBJParser()
elif is_ply(path):
parser = PLYParser()
else:
raise Exception("File format not supported")
parser.parse_file(path)
return parser