Skip to content

USDC quat values come out with axes scrambled (byte-order mismatch with USDA) #63

@bresilla

Description

@bresilla

hey, found a fun one.

Value::Quatf / Quatd / Quath end up with a different element order depending on whether they came from .usda or .usdc. So the same scene file in both formats gives different rotations, and Pixar-authored binaries (Isaac Sim, Omniverse robotics assets, anything saved by usdcat) come out with their rotations wrong.

Why: Pixar's GfQuat<T> declares _imaginary (Vec3) before _real (scalar), so the in-memory layout is [x, y, z, w]. The C++ USDC code (pxr/usd/sdf/crateFile.cpp:223) marks GfQuat as bitwise-RW and just memcpy's the struct to disk → on-disk bytes are [x, y, z, w]. But USDA text uses (real, i, j, k) = (w, x, y, z), and the crate's USDA parser (src/usda/parser.rs:1433) stores the parsed tuple verbatim → array is (w, x, y, z). Same Rust type, two conventions.

Hit this loading the Agilebot GBT-C5A robot (Isaac Sim asset, USDC) — every link came out tilted into a wall. Took a probe to figure out it wasn't my code, it was the byte order.

Fix coming in a follow-up PR. Just opening this so others searching for the same symptom can find it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions