Skip to content

USDZExporter: Export scene hierarchy #31448

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 1 commit into from
Jul 21, 2025
Merged

Conversation

mkeblx
Copy link
Contributor

@mkeblx mkeblx commented Jul 19, 2025

Fixed #31235.

Description

Preserve the scene hierarchy when exporting.

@Mugen87
Copy link
Collaborator

Mugen87 commented Jul 20, 2025

For testing: https://rawcdn.githack.com/mkeblx/three.js/usdz-exp-scngrph/editor/index.html

I'm not sure if this particular PR introduces this issue or #31442/#31400 but it does not happen in r178. If you open the editor and add a box, ambient and directional light and export to USDZ, you can't import the cube back anymore. It's missing after the import without reporting any errors in the browser console.

When using https://threejs.org/editor/, the round trip works as expected (meaning the cube is restored). I'll attach the exported scene below.

model.usdz.zip

@Mugen87
Copy link
Collaborator

Mugen87 commented Jul 20, 2025

I have investigated this closer and the regression is not caused by USDZExporter.

@mrdoob It seems c63f839 introduced the above issue.

You can use https://rawcdn.githack.com/mrdoob/three.js/c63f83942915af85128e1b57e87fc93cb3962a4c/editor/index.html for testing. Just add a box, export it to USDZ, empty the scene and import the model back. The box is not displayed.

@Mugen87 Mugen87 added this to the r179 milestone Jul 20, 2025
@mrdoob
Copy link
Owner

mrdoob commented Jul 20, 2025

I'll investigate this later today 🙏

@Mugen87 Mugen87 merged commit 4a276d2 into mrdoob:dev Jul 21, 2025
8 checks passed
@mkeblx
Copy link
Contributor Author

mkeblx commented Jul 23, 2025

Thanks for testing. I'll look at too, and will be adding more test coverage including the round trip soon.

@mrdoob
Copy link
Owner

mrdoob commented Jul 24, 2025

Fixed! 173555e 🙏

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.

USDZExporter: export object hierarchy
3 participants