This can indeed be handy.
However, this is not something that would be implemented at the .mtl parsing level as in your example.
There would be simply no mtl parsing at all.
Busy updating some parsers/exporters atm, so I should be able to add this very soon.

Fabrice

On Aug 11, 2009, at 12:32 AM, Eric Decker wrote:


Something I've run across with the Obj parser is some exporters
include the material reference regardless if a material was applied or
not. So even though there is no linked material, the file will
contain:
  mtllib example.mtl
  usemtl defaultMat
This will cause the parser to break. It's a simple fix (open the obj
file in notepad++ or equivalent and remove those two lines) but it can
become annoying. I think it would be good to have a property in the
Obj parser that can toggle whether or not the parser looks to apply a
material. I think something as simple as modify the following would
suffice, but you guys are the experts:

case "usemtl":
    if (useMaterial) aMeshes[aMeshes.length-1].materialid = trunk[1];
    break;

Anyways, hope this is useful feedback. As always, keep up the good
work.

-Eric

Reply via email to