fix: support PreviewSurface binding in kitless mode#5205
Open
eric-heiden wants to merge 1 commit intoisaac-sim:developfrom
Open
fix: support PreviewSurface binding in kitless mode#5205eric-heiden wants to merge 1 commit intoisaac-sim:developfrom
eric-heiden wants to merge 1 commit intoisaac-sim:developfrom
Conversation
Contributor
|
Greptile encountered an error while reviewing this PR. Please reach out to support@greptile.com for assistance. |
There was a problem hiding this comment.
Clean PR that properly extends kitless mode support for UsdPreviewSurface materials. The approach of using pure USD APIs as a fallback when Kit is unavailable is the right pattern.
What this does well:
- The kitless shader creation in
visual_materials.pycorrectly defines all standardUsdPreviewSurfaceinputs (diffuseColor,emissiveColor,roughness,metallic,opacity,opacityThreshold,ior) plus the requiredsurface/displacementoutputs, matching the USD spec. - The
MaterialBindingAPIfallback inprims.pyproperly applies the API schema withApply()when not already present, and correctly passesUsdShade.Tokensfor binding strength rather than the string tokens used by the Kit command. - Removing the early-return guards in
from_files.pyandvisual_materials.pynow that the downstream functions handle kitless mode is the right cleanup. - Good test coverage across three new test files, including parametric binding-strength verification.
One minor nit (non-blocking):
In prims.py, the binding_strength string variable (lines 771–774) is now only consumed inside the has_kit() branch. Consider moving it inside that block to avoid computing a value that goes unused in kitless mode:
if has_kit():
binding_strength = "strongerThanDescendants" if stronger_than_descendants else "weakerThanDescendants"
import omni.kit.commands
...Purely cosmetic — the code is correct as-is.
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
UsdPreviewSurfacematerials in kitless mode using pure USD APIs instead of skippingPreviewMaterialcreationUsdShade.MaterialBindingAPIfor visual material binding when Kit commands are unavailableTesting
pytest -q source/isaaclab/test/sim/test_kitless_visual_materials.py source/isaaclab/test/sim/test_spawn_shapes_kitless_preview_surface.pypython -m pytest -q source/isaaclab/test/sim/test_spawn_from_files.py -k visual_materialpython -m compileall source/isaaclab/isaaclab/sim/spawners/from_files/from_files.py source/isaaclab/isaaclab/sim/spawners/materials/visual_materials.py source/isaaclab/isaaclab/sim/utils/prims.py source/isaaclab/test/sim/test_kitless_visual_materials.py source/isaaclab/test/sim/test_spawn_shapes_kitless_preview_surface.py source/isaaclab/test/sim/test_spawn_from_files.py