obj2egg - convert Wavefront .obj and .mtl into .egg format
I’ve been evaluating Panda3D, and I wanted to see if I could find a low-hassle way of getting Wavefront .obj format models into Panda’s .egg format. I found obj2egg could hatch a suitable .egg, but it couldn’t handle materials and textures.
Here’s my improved version: obj2egg.py. It handles basic diffuse texture maps. My particular need was for coloring untextured models, and it can do that too. There is some room for interpretation as to how one should interpret color information in a .obj and a .mtl, so it may not do what someone else wants. Oh yeah, it supports Wavefront’s polyline primitives if you’re into that sort of thing.
Caveats, bugs, limitations, etc: it isn’t the most efficient Python code I’ve put together, it probably won’t handle every .obj you might throw at it, it won’t handle embedded material definitions (they must be in a .mtl file), and probably does a bazillion other things wrong.
Licensed under the WTFPL.
Comments(1)