pymesh
pymesh copied to clipboard
Failed to load OBJ file.
mesh = obj.Obj('dapeng.obj') Traceback (most recent call last): File "/home/quantumliu/anaconda3/lib/python3.5/site-packages/pymesh/obj.py", line 52, in __read elif line.lstrip().startswith("vn"): TypeError: startswith first arg must be bytes or a tuple of bytes, not str
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "
So I think I figured out the issue. When you open the file with the "rb" parameter, future methods need to use byte literals instead of strings. So change that in the __read(fh)
method in obj.py. In other words:
elif line.lstrip().startswith("vn"):
becomes
elif line.lstrip().startswith(b"vn"):
That fixed it for me.