obj2png
obj2png copied to clipboard
ValueError: invalid literal for int() with base 10: '1/'
Hello dear pclausen,
first things first: thank you so much for this script, it is exactly what I need!
But when running the script as you propose, I am facing the following issue:
Traceback (most recent call last):
File "obj2png.py", line 121, in <module>
ob = ObjFile.ObjFile(objfile)
File "/Users/obj2png/src/ObjFile.py", line 59, in __init__
self.ObjParse(obj_file)
File "/Users/obj2png/src/ObjFile.py", line 97, in ObjParse
faces.append(ObjFile.ToInts(f[1:]))
File "/Users/obj2png/src/ObjFile.py", line 133, in ToInts
v.append(int(nn))
ValueError: invalid literal for int() with base 10: '1/'
Apparently, I am not able to fix this issue. Can you help?
Cheers :)
@simonbirkerhtwg sorry for taking so long to reply. I suspect your .obj file has some format my very simply parser does not recognize. If you could upload the file it would help a lot.
Same error here :( Any solution? Thanks.
Your .obj
file is most likely formatted differently. Within ObjFile.py
, try changing the following line
faces.append(ObjFile.ToInts(f[1:]))
to
faces.append(ObjFile.ToInts([s.split('/')[0] for s in f[1:]]))
@PascalHbr Thanks for simple fix.
@simonbirkerhtwg @agGitHub Issue is now fixed