Khai-J-Bach opened this issue on Aug 27, 2010 · 1684 posts
odf posted Sun, 05 September 2010 at 2:35 AM Online Now!
ADP, I have a suggestion (I'll post this on the peanut gallery, as well, so it doesn't get lost):
If you look at my GeometryExporter class, you'll see that it doesn't do anything too complicated. It's essentially just a bit of glue between different components. It calls a function that extracts geometry information from Poser, sticks that in a Geometry object, calls a few methods on it, grabs the data and writes it to the Lux output file. You can take that code and change it any way you like. If you don't want per-vertex normals, don't compute them (Lux will then compute and use its own per-face normals). If you don't want triangles, loop over geom.polys instead of geom.triangles. If you want to output a trianglemesh instead of a mesh, or change some of the options, you can do just that.
I think that's really how it should work. I provide the basic operations for preparing the data, such as computing normals, subdividing and triangulating, and you, bagginsbill or whoever uses the pydough library is responsible for calling the right methods in the right order and producing the output. Then you can experiment with all the different options that Lux provides at your heart's content and figure out what works best in which situation. If there's need for additional functionality (such as converting hair data into actual geometric objects, which I'm about to start on), give me a holler.
For now I'll add another argument to GeometryExporter.init(), namely a function that will be called whenever a mesh object gets written to the output file, right after the opening 'Shape "mesh"' command. That method can then write additional parameters for that mesh directly onto the output. It will get passed all the relevant parameters plus a pointer to the Geometry object that's being exported.
-- I'm not mad at you, just Westphalian.