Skip to content

USDZExporter: Fix AR anchoring on root prim - #34066

Open
arielelkin wants to merge 3 commits into
mrdoob:devfrom
arielelkin:dev
Open

USDZExporter: Fix AR anchoring on root prim#34066
arielelkin wants to merge 3 commits into
mrdoob:devfrom
arielelkin:dev

Conversation

@arielelkin

@arielelkin arielelkin commented Jul 18, 2026

Copy link
Copy Markdown

Related issues:

Description

USDZExporter currently writes preliminary:anchoring:type and preliminary:planeAnchoring:alignment as bare token properties on the nested /Root/Scenes/Scene prim. Apple documents Preliminary_AnchoringAPI as an applied API schema and requires anchorable prims to be defined at the document root. As a result, Quick Look may ignore the requested alignment and fall back to horizontal placement.

This change applies Preliminary_AnchoringAPI to the root-level /Root model prim and authors both anchoring properties there as uniform token values. It also removes the legacy /Root/Scenes/Scene scene-library wrapper and authors exported scene content directly beneath /Root. The existing ar options, defaults, and USDZ packaging remain unchanged. When includeAnchoringProperties is false, the schema and both properties continue to be omitted without accessing options.ar.

The misc_exporter_usdz example now provides option to render a Bike (for horizontal anchoring) model and a Plaque (for vertical anchoring), with corresponding buttons and a “View in AR” action. Selecting a model updates both the Three.js preview and the USDZ targeted by the Quick Look link. AR launch is enabled only in Safari on iPhone and iPad; other browsers display a disabled availability message. Generated blobs use Quick Look’s model/vnd.usdz+zip MIME type.

Prior implementation context:

Apple schema references:

Tested with:

npm test

@github-actions

github-actions Bot commented Jul 18, 2026

Copy link
Copy Markdown

🖼️ E2E screenshot tests

✅ All examples render correctly again (run).

@alexwakeman

Copy link
Copy Markdown

This looks really useful - be great if maintainers could take a look

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants