I’m writing a USD Exporter for Rhino3d and running into an odd issue when using references. Below is a screenshot of what it looks like with the mac preview (usdview also looks like this). As far as I can tell, if I remove the transforms the geometry is fine, but the second I add them back, it gets very strange. The transforms are all simple X/Y translations and involve no scaling whatsoever.
What might be causing this issue? My best guess is my meshes are bad but I’m not sure how best to diagnose this.
Looks like you wrote out the transform matrices with column-major convention rather than row-major. Here’s what your file looks like if I manually fixup your first 6 instances:
If you use the UsdGeomXformable API’s on the Mesh to set the transformation (or the UsdGeomXformCommonAPI), you can set the translate (and other) components individually, and not need to worry about constructing a complete, properly oriented 4x4.
Ah… given the inherent trickiness is distinguishing reflections from rotations in matrix decomposition, may not be worth trying to do if you’re only given a matrix!