moderngl-window
moderngl-window copied to clipboard
load_scene has incorrect mesh name
In an obj file with o MyObject accompanied by a mtl file with newmtl MyMaterial the mesh.name has the same value as mash.material.name.
Definitely it looks like the material name is used for the mesh name. I don't quite remember why this was done.
https://github.com/moderngl/moderngl-window/blob/200f2b9ea8b350b0ac9bb6a2d24310c0d8227794/moderngl_window/loaders/scene/wavefront.py#L111
I think it's because vertices with the same material are by default consolidated into a single mesh. This is also reflected in the json/bin cache files when that is enabled. Will have to look at the possibilities later in 3.0. obj files are generally a nightmare to deal with due to the loose standard. The best path is likely to make a new loader using trimesh. Just archive or throw out the old one.