Skip to content

[pull] dev from mrdoob:dev #656

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
129 changes: 129 additions & 0 deletions docs/examples/en/exporters/USDZExporter.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<base href="../../../" />
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
<h1>[name]</h1>

<p class="desc">
An exporter for `USDZ`.
<br /><br />
[link:https://graphics.pixar.com/usd/docs/index.html USDZ] (Universal Scene Description ZIP archive) is a
[link:https://openusd.org/release/index.html USD-based format] for 3D content optimized for sharing and viewing.
USDZ files are ZIP archives containing USD scene data and associated textures. The format supports meshes,
materials, textures, and cameras.
</p>

<h2>Import</h2>

<p>
[name] is an add-on, and must be imported explicitly.
See [link:#manual/introduction/Installation Installation / Addons].
</p>

<code>
import { USDZExporter } from 'three/addons/exporters/USDZExporter.js';
</code>

<h2>Features</h2>

<p>
USDZExporter supports the following features:
</p>

<ul>
<li>Meshes with MeshStandardMaterial</li>
<li>Textures (diffuse, normal, emissive, roughness, metalness, alpha, ambient occlusion)</li>
<li>Clearcoat and clearcoat roughness (from MeshPhysicalMaterial)</li>
<li>Cameras (perspective and orthographic)</li>
<li>AR anchoring properties for iOS Quick Look</li>
<li>Texture compression support with texture utils</li>
</ul>

<h2>Code Example</h2>

<code>
// Instantiate a exporter
const exporter = new USDZExporter();

// Configure export options
const options = { maxTextureSize: 2048 };

try {

// Parse the input and generate the USDZ output
const arraybuffer = await exporter.parseAsync( scene, options );
downloadUSDZ( arraybuffer );

} catch ( error ) {

console.error( 'Export failed:', error );

}
</code>

<h2>Examples</h2>

<p>
[example:misc_exporter_usdz]
</p>

<h2>Constructor</h2>

<h3>[name]()</h3>
<p>
</p>
<p>
Creates a new [name].
</p>

<h2>Methods</h2>

<h3>[method:undefined parse]( [param:Object3D scene], [param:Function onCompleted], [param:Function onError], [param:Object options] )</h3>

<p>
[page:Object3D scene] — Scene or object to export.<br />
[page:Function onCompleted] — Will be called when the export completes. The argument will be the generated USDZ ArrayBuffer.<br />
[page:Function onError] — Will be called if there are any errors during the USDZ generation.<br />
[page:Options options] — Export options<br />
<ul>
<li>`maxTextureSize` - int. Restricts the image maximum size (both width and height) to the given value. Default is 1024.</li>
<li>`includeAnchoringProperties` - bool. Whether to include anchoring properties for AR. Default is true.</li>
<li>`quickLookCompatible` - bool. Whether to make the exported USDZ compatible with Apple's QuickLook. Default is false.</li>
<li>`ar` - Object. AR-specific options including anchoring type and plane anchoring alignment.</li>
</ul>
</p>
<p>
Generates a USDZ ArrayBuffer output from the input Object3D. Note that only MeshStandardMaterial is supported.
</p>

<h3>[method:Promise parseAsync]( [param:Object3D scene], [param:Object options] )</h3>

<p>
Generates a USDZ ArrayBuffer output from the input Object3D.
</p>
<p>
This is just like the [page:.parse]() method, but instead of
accepting callbacks it returns a promise that resolves with the
ArrayBuffer result, and otherwise accepts the same options.
</p>

<h3>[method:undefined setTextureUtils]( [param:Object utils] )</h3>

<p>
Sets the texture utils for this exporter. Only relevant when compressed textures have to be exported.
Depending on whether you use WebGLRenderer or WebGPURenderer, you must inject the corresponding
texture utils WebGLTextureUtils or WebGPUTextureUtils.
</p>

<h2>Source</h2>

<p>
[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/exporters/USDZExporter.js examples/jsm/exporters/USDZExporter.js]
</p>
</body>
</html>
3 changes: 2 additions & 1 deletion docs/list.json
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,8 @@
"GLTFExporter": "examples/en/exporters/GLTFExporter",
"OBJExporter": "examples/en/exporters/OBJExporter",
"PLYExporter": "examples/en/exporters/PLYExporter",
"STLExporter": "examples/en/exporters/STLExporter"
"STLExporter": "examples/en/exporters/STLExporter",
"USDZExporter": "examples/en/exporters/USDZExporter"
},

"Math": {
Expand Down
Loading