Skip to content

Preserve physical properties in USD IO#1534

Open
yutingye wants to merge 2 commits into
mainfrom
export-D104556530
Open

Preserve physical properties in USD IO#1534
yutingye wants to merge 2 commits into
mainfrom
export-D104556530

Conversation

@yutingye

Copy link
Copy Markdown
Contributor

Summary:
Round-trips per-joint physical mass properties through USD, mirroring the FBX support.

On save, each entry is serialized to JSON and stored as a per-joint child prim under /SkelRoot/PhysicalProperties, carrying a momentum:joint name attribute and a momentum:physicalProperties string attribute, instead of a character-level attribute on /SkelRoot. On load, the stage is traversed and each stored body is mapped back to its joint by name. Joint resolution on save reuses resolvePhysicalPropertiesJointIndex, and an entry referencing an unknown joint is rejected on save.

Adds round-trip coverage built on the shared withTestPhysicalProperties and comparePhysicalProperties helpers, plus structural assertions that the SkelRoot does not carry momentum:physicalProperties and that each stored physical body maps back to its joint.

Reviewed By: cstollmeta

Differential Revision: D104556530

yutingye added 2 commits June 17, 2026 18:42
Summary:
Round-trips per-joint physical mass properties (mass, center-of-mass offset, inertia tensor, and inertia rotation) through FBX. 

On save, each entry is serialized to JSON and written as a `physicalProperties` string custom property on the owning FBX skeleton node. On load it is read back from those joint nodes. Root metadata remains only character metadata; the physical body data is owned by the skeleton nodes it describes.

Joint resolution on save reuses `resolvePhysicalPropertiesJointIndex` (the same helper the glTF path uses), so a stale cached `jointIndex` falls back to the joint name. The loader is resilient: a joint whose `physicalProperties` property is malformed, or whose embedded JSON fails to parse or validate, is logged and skipped rather than aborting the whole character load.

Adds shared test helpers that are reused across the IO round-trip tests: `withTestPhysicalProperties` (builds a deterministic two-joint fixture) and `comparePhysicalProperties` (asserts equality, matching entries by joint name so the comparison is independent of save/load ordering). `compareChars` now delegates to `comparePhysicalProperties`.

Reviewed By: cstollmeta

Differential Revision: D104556525
Summary:
Round-trips per-joint physical mass properties through USD, mirroring the FBX support. 

On save, each entry is serialized to JSON and stored as a per-joint child prim under `/SkelRoot/PhysicalProperties`, carrying a `momentum:joint` name attribute and a `momentum:physicalProperties` string attribute, instead of a character-level attribute on `/SkelRoot`. On load, the stage is traversed and each stored body is mapped back to its joint by name. Joint resolution on save reuses `resolvePhysicalPropertiesJointIndex`, and an entry referencing an unknown joint is rejected on save.

Adds round-trip coverage built on the shared `withTestPhysicalProperties` and `comparePhysicalProperties` helpers, plus structural assertions that the SkelRoot does not carry `momentum:physicalProperties` and that each stored physical body maps back to its joint.

Reviewed By: cstollmeta

Differential Revision: D104556530
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jun 18, 2026
@meta-codesync

meta-codesync Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

@yutingye has exported this pull request. If you are a Meta employee, you can view the originating Diff in D104556530.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant