Repository navigation
feat(exporting): add OpenUSD USDA and USDZ geometry export - #516
Open
JarrettSJohnson wants to merge 15 commits into
Open
JarrettSJohnson wants to merge 15 commits into
JarrettSJohnson wants to merge 15 commits into
Conversation
…pe analytic solid writer
…es, honor quality settings
…und-capped solids
AR Quick Look ignores primvar readers, so displayColor never reached the material and everything rendered translucent gray on device. Colors now come from one constant UsdPreviewSurface material per quantized color and opacity, bound per face through GeomSubsets on meshes. Opaque materials carry no opacity input, which renderers would treat as translucent. - USDZ stores the ASCII layer directly, no usdcat dependency, and the scene is scaled to fit within one meter and stands on the ground - USDA tessellates all solids into one mesh, since Blender's importer drops the material of analytic prims; USDZ keeps analytic prims - Ramp colors are resolved at each vertex instead of exported black - Two-color solids split halfway, as each face takes one material - Indexed color primvars and 6 significant digits keep USDA size close to the COLLADA export - Revert unrelated .gitignore and Scene.h changes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Build the package in memory and return it from the save function, so that save() writes it with _write_file_atomic like any other format and a failed export no longer truncates an existing file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the OpenUSD part of #497: export of the displayed geometry as USDA (for 3D software) and USDZ (for AR viewers), via
cmd.save,cmd.get_usdaand the File > Export menu. No external tools are needed.USDA (
cmd.save("x.usda"),cmd.get_usda())metersPerUnit = 1e-10, like the COLLADA export. Camera space, or model space withgeometry_export_mode=1. Blender applies that scale on import by default; its "Apply Unit Conversion Scale" option turns it off (noted in theget_usdahelp).USDZ (
cmd.save("x.usdz"))scene.usdalayer. AR Quick Look accepts ASCII layers, as Mol*'s USDZ export also relies on.UsdGeomprims where possible. Transparent or open-ended solids become meshes, with domes instead of buried hemispheres.Colors and materials
displayColorcannot drive the material (confirmed on device: such files render translucent gray). Every color gets a constantUsdPreviewSurfacematerial instead, bound per face withGeomSubsets on meshes.displayColor/displayOpacityare still written, as indexed primvars.opacityinput, since renderers such as Hydra Storm treat any material with a connected opacity as translucent.Testing
testing/tests/api/exporting_geom.py; the fulltesting/tests/apisuite passes.Known limitations
🤖 Generated with Claude Code