OBJLoader enhancement: named groups support

I thought about how to correctly handle merge and smoothing groups and…

Options we have:

  1. Leave as is
    • Limited spec compliance
    • Free
    • Limited use cases support
    • Absolutely Safe
  2. Handle all group types just as name holders (proposed and implemented solution)
    • The same spec compiance
    • Easy
    • Extends OBJ usage for some real use cases
    • Possible break for users who hacks OBJLoader by using it’s protected fields or relies hard on current flat structure of resulting node tree
  3. Implement merging and smooting
    • Good spec compiance
    • Very complex
    • Extends OBJ usage for the same real use cases and for some hypothetical
    • Possible break at the same cases
  4. Ignore non-plain groups (leave “smooth” and “merge” groups at the same place as before - under the material-divided nodes with meaningless names)
    • The same spec compiance as proposed solution
    • Complex (much more corner cases)
    • Extends OBJ Usage at the same extent as proposed solution
    • Possible break in similar cases: will not break for users who relies hard on flat structure as long as their OBJ files contain only non-plain groups.

For me option 2 sounds the most reasonable.

PS: demo added in jme3-examples module.

3 Likes