Repository navigation
Make preview surfaces renderer agnostic - #7189
kellyguo11 merged 4 commits into
Conversation
Greptile SummaryThe PR replaces Kit-specific preview-surface authoring and visual-material binding with standard OpenUSD APIs, then removes renderer-specific material workarounds from three MPM demos.
Confidence Score: 4/5The PR should not merge until Kitless binding continues to tolerate visual materials whose Kit-only spawners did not create a material prim. A Kitless scene using an existing MDL visual-material configuration now reaches the changed missing-material check and aborts construction, whereas the previous binding path returned without failing. Files Needing Attention: source/isaaclab/isaaclab/sim/utils/prims.py Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
Cfg[Visual material config] --> Spawn[Spawn material]
Spawn -->|PreviewSurfaceCfg| USD[Author UsdShade material]
Spawn -->|MDL without Kit| Missing[No material prim created]
USD --> Bind[MaterialBindingAPI.Bind]
Missing --> Bind
Bind -->|Material exists| Geometry[Bound geometry]
Bind -->|Material missing| Error[ValueError during scene construction]
Reviews (1): Last reviewed commit: "Make preview surfaces renderer agnostic" | Re-trigger Greptile |
| if not material_prim.IsValid(): | ||
| raise ValueError(f"Visual material '{material_path}' does not exist.") |
There was a problem hiding this comment.
Kitless MDL binding aborts scenes
When a Kitless scene assigns a Kit-only visual material such as GlassMdlCfg, its spawner returns without creating the material, but bind_visual_material now raises ValueError for the missing path, causing scene construction to fail instead of leaving the geometry unbound.
Knowledge Base Used: IsaacLab Core Simulation Layer
There was a problem hiding this comment.
Isaac Lab Review Bot
The PR correctly replaces Kit-only preview-surface authoring and binding commands with standard OpenUSD APIs and removes renderer-specific workarounds from the MPM demos. However, removing the Kit guard from bind_visual_material introduces a Kit-less failure for MDL materials, whose spawning remains Kit-gated.
- Design and architecture: Moving
PreviewSurfaceCfgauthoring intoUsdShadeand usingMaterialBindingAPIis appropriately centralized and renderer-agnostic. The design remains incomplete for the existing MDL path: Kit-less MDL spawning is skipped, but material binding now proceeds and treats the intentionally absent material as an error. - API: The public signatures and preview-surface
/Shaderlayout remain stable. Kit-less behavior ofbind_visual_materialchanges materially forMdlFileCfgandGlassMdlCfgconsumers, from returningFalseto raisingValueErrorbecause their material prim is not authored without Kit. - Implementation: The preview-surface shader ID, typed inputs, surface output connection, and updated demo call sites are consistent with the intended portable USD representation. The binding implementation needs to retain a graceful Kit-less path for MDL materials rather than validating their intentionally absent material prim and aborting asset spawning.
Minor fixes needed. Posted 1 actionable finding inline.
Automated review; human maintainers own approval decisions.
| if not prim.IsValid(): | ||
| raise ValueError(f"Target prim '{prim_path}' does not exist.") | ||
| material_prim = stage.GetPrimAtPath(material_path) | ||
| if not material_prim.IsValid(): |
There was a problem hiding this comment.
🟡 Warning · Implementation — Kit-less MDL binding now raises instead of skipping
The removed if not has_kit(): return False guard also covered MDL materials. MDL spawning remains Kit-gated (has_kit is still imported and used in visual_materials.py), so in a Kit-less run an MdlFileCfg/GlassMdlCfg visual material authors no prim at material_path, and the subsequent bind call now raises ValueError and aborts asset spawning where it previously returned False. Preserve the graceful skip when the material prim is absent.
|
@pbarejko can you please review this change? I am not an expert in this matter |
|
this doesn't seem to be connected to this PR |
## Summary Cherry-picks the following merged PRs from `develop` onto `release/3.0.0`, preserving each as an individual commit with `-x` provenance: - #7193 — Bake CI pytest deps into the built Docker image - #7077 — Add OVPhysX support to Franka deformable lift tasks - #7175 — Raise on unsupported camera renderer outputs - #7174 — Fix benchmark play inference scope - #7173 — Report resolved backend for play benchmarks - #7172 — Add video recording to play benchmarks - #7215 — Reduce GearAssembly default environment count - #7214 — Remove Kamino preset from open drawer - #7213 — Fix OvPhysX scene gravity randomization - #7212 — Fix OVPhysX material binding device selection - #7189 — Make preview surfaces renderer agnostic - #7206 — Fix OVPhysX benchmark articulation setup All cherry-picks and the final rebase onto the latest `release/3.0.0` tip completed without conflicts. ## Validation - Verified all 12 backported commits have patch IDs identical to their source squash commits and retain their `cherry picked from` footers. - `git diff --check upstream/release/3.0.0..HEAD` - Bash syntax validation for the modified CI shell scripts. - YAML parsing for the modified composite actions. - Changelog validation against `release/3.0.0`. - Targeted pytest coverage for benchmark APIs/play, video recording, GearAssembly defaults, OVPhysX presets and runtime semantics, and renderer-agnostic materials: **81 passed, 4 skipped, 1 deselected**. - The deselected case is an unchanged test that hard-codes a POSIX `/tmp` path and fails on Windows path normalization. - `uv run isaaclab -f` passed all hooks except the changelog hook's known release-branch baseline finding for `source/isaaclab/changelog.d/core-test-config-fixtures.skip`; the targeted release-base changelog check passed. --------- Co-authored-by: Matthew Taylor <[email protected]> Co-authored-by: Antoine RICHARD <[email protected]> Co-authored-by: Mike Yan Michelis <[email protected]> Co-authored-by: Maximilian Krause <[email protected]> Co-authored-by: Octi Zhang <[email protected]> Co-authored-by: Mustafa H <[email protected]>

Summary
Author
PreviewSurfaceCfgand visual-material bindings with standard OpenUSD APIs so they work without an Omniverse Kit runtime.Root cause
spawn_preview_surfaceusedCreateShaderPrimFromSdrCommand, andbind_visual_materialusedBindMaterialCommand. Both functions returned early when Kit was unavailable. As a result, non-Kit renderers imported otherwise valid USD geometry without its configured material and rendered the default neutral gray. MPM demos compensated with visualizer-specific conditionals.Changes
UsdPreviewSurfaceshader directly withUsdShadeUsdShade.MaterialBindingAPIPreviewSurfaceCfgandbind_visual_materialretain their existing public signatures and prim layout. MDL material spawning remains Kit-only.Impact
This is a core fix, not an MPM-specific material implementation. Existing
PreviewSurfaceCfgconsumers automatically gain standard USD material authoring in Kitless runs. The repository currently uses the configuration from 89 Python files, including 18 demos, 8 tutorials, and 10 task files. No other visualizer-specific preview-surface workarounds were found; only the three MPM demos required call-site cleanup.Examples that benefit without source changes include Newton ray-cast demos, visualization markers, UR10 Particle Push, lift and handover tasks, terrain materials, and asset-spawning tutorials. Existing Kit consumers keep the same configuration interface and
/Shaderprim layout.Validation
UsdPreviewSurfaceauthoring and binding smoke passedPreviewSurfaceCfgdeclarationsgit diff --checkpasseduv.lockandpyproject.tomlare unchanged