I have troubles importing obj (and mtl files) into vpython using the script at
https://github.com/jcoady/vpython-load-obj-file. While the cubes from the demo program work fine, as soon as I try to import some free obj (and mtl) objects from sites like
https://www.kenney.nl/assets/city-kit-suburban the program complains with this error:
line 48, in obj_to_triangles
curtexture = str(material.texture._path)
^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute '_path'
After I chanted the offending code line into:
if material.texture is not None:
curtexture = str(material.texture._path)
the demo works (the cubes are spinning) and i can even see my imported object (it's a list of vp.compounds), but only in white, without any colors/textures
What must I do so that i can import the object AND the textures ?
also, vpython complains about: "Unimplemented OBJ format statement 'g' on line 'g tree_small'", is this important?