jpcy / xatlas

Mesh parameterization / UV unwrapping library
MIT License
2.06k stars 221 forks source link

Keep original UVs? #99

Closed mvijfwinkel closed 2 years ago

mvijfwinkel commented 2 years ago

I'd like to use XAtlas to generate a secondary UV channel on some meshes (for baking a lightmap).

I'm playing with the example project that imports an OBJ. Generating the new UVs works really well, but XAtlas does not retain the original UVs. Is there an easy way to generate a new UV channel, while keeping the original UV's? (I would export the meshes as an FBX file).

XAtlas generates new vertices, and I don't know how to map back the original UVs on the new mesh.

jpcy commented 2 years ago

xatlas::Vertex::xref maps back to the original vertex.