tobj
tobj copied to clipboard
Support Pixar tag (`t`) extension
Pixar has an undocumented extension for OBJ files where tags can be stored in the OBJ. Commonly those are attached to vertices (or edges/edge chains, by specifying them through the contained vertices). Each tag can contain integer and/or float and/or string tokens.
An example is found in the tinyobjloader
repo. where this is used to store crease values on edges for rendering the geometry as a subdivison surface.
The code for parsing the crease tags is found here.
One of the issues is that Pixar decided to just export these tags from the Ri inteface representation which uses zero-based indexing. I.e. if this was to be adopted on a wider scale for import/export of OBJs it would probably make sense to use 1-based indexing for any references e.g. stored in a tag's integer tokens (referencing geometry inside the OBJ).