Load static USD visual shapes by default - #3694
Conversation
Import visual-only geometry outside rigid-body hierarchies as static shapes by default while retaining an explicit opt-out. Reuse the existing deformable scout so scenes without static visuals do not require another stage traversal.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughUSD import now supports loading visual-only geometry outside rigid-body hierarchies as static shapes by default. Builder and parser options control this behavior, scouting identifies candidates, traversal is bounded for the new pass, and tests cover the option combinations. ChangesStatic USD visual shapes
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant ModelBuilder.add_usd
participant parse_usd
participant _scout_deformable_prims
participant _load_visual_shapes_impl
ModelBuilder.add_usd->>parse_usd: Forward static visual loading option
parse_usd->>_scout_deformable_prims: Collect eligible static visual candidates
parse_usd->>_load_visual_shapes_impl: Load candidates without child recursion
_load_visual_shapes_impl-->>parse_usd: Register static shapes with shape_body == -1
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@newton/_src/utils/import_usd_deformable_utils.py`:
- Around line 921-922: Move the collect_static_visuals block that appends to
buckets.static_visuals below the ignore-path guard in the surrounding prim
traversal logic. Ensure ignored prims are excluded before appending, while
non-ignored prims matching _SCOUT_VISUAL_TYPE_NAMES continue to be collected.
In `@newton/_src/utils/import_usd.py`:
- Around line 3291-3301: Update the static-visual loop around
_deformable_prims.static_visuals to skip every prim identified as a CollisionAPI
before calling _load_visual_shapes_impl, using the existing collider/API
detection utilities. Preserve the native collider pass so disabled colliders are
handled there with their collider-specific configuration and visibility policy,
and add a regression test covering a disabled collider.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro Plus
Run ID: 97093944-029c-4264-81d0-c405013d1394
📒 Files selected for processing (5)
changelog.d/+static-usd-visuals-7b9e4c2a.added.mdnewton/_src/sim/builder.pynewton/_src/utils/import_usd.pynewton/_src/utils/import_usd_deformable_utils.pynewton/tests/test_import_usd.py
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Make static Gaussian splats honor the static visual loading flag. Keep disabled colliders visual-only and clarify the scout's type and traversal choices.
Description
Import visual-only USD geometry outside rigid-body hierarchies as static Newton shapes by default. Add
load_static_visual_shapestoModelBuilder.add_usd()andparse_usd()as an explicit opt-out.The importer previously loaded ordinary visual geometry only while processing rigid bodies; its standalone visual pass handled Gaussian splats only. As a result, composed static visuals such as
/Table/Visuals/TableGeomwere omitted. The new path collects supported geometry candidates during the existing deformable scout traversal, avoiding another full instance-proxy walk.Empty-case paired benchmarks found no measurable regression:
Checklist
CHANGELOG.mdhas been updated for this user-facing changeTest plan
origin/main.uv run --extra dev python -m unittest newton.tests.test_import_usd.TestImportSampleAssetsBasic.test_static_visual_shapes_loading_flag -vuv run --extra dev python -m unittest newton.tests.test_import_usd- 280 tests passed.git diff --checkdirectly.uvx pre-commit run -acould not start because the local Git 2.30.0 does not support thegit ls-files --deduplicateoption required by the installed pre-commit version.Bug fix
Steps to reproduce:
ModelBuilder.add_usd().path_shape_maponmain.Minimal reproduction:
New feature / API change
Summary by CodeRabbit
load_static_visual_shapesto control this behavior independently of other visual loading.load_static_visual_shapesinteractions with static visuals, colliders, and dynamic visuals.