-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Fixes mesh converter not setting mesh collision approximation attribute #4082
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
base: main
Are you sure you want to change the base?
Conversation
Greptile OverviewGreptile SummaryThis PR fixes a critical bug where mesh collision approximation attributes were not being set on USD prims during mesh conversion. The fix ensures that collision approximation tokens (convex decomposition, triangle mesh, SDF, etc.) are properly applied to mesh collision APIs. Key changes:
The implementation correctly uses Confidence Score: 5/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant User
participant MeshConverter
participant schemas.py
participant MeshCollisionAPI
participant Prim
User->>MeshConverter: Convert mesh with collision config
MeshConverter->>schemas.py: modify_mesh_collision_properties(prim_path, cfg)
schemas.py->>Prim: Get prim at path
schemas.py->>MeshCollisionAPI: Apply(prim) if not already applied
schemas.py->>MeshCollisionAPI: Set Approximation attribute using cfg.mesh_approximation_token
Note over schemas.py,MeshCollisionAPI: NEW: Explicit approximation setting
schemas.py->>schemas.py: extract_mesh_collision_api_and_attrs(cfg)
Note over schemas.py: Excludes mesh_approximation_token from custom_attrs
schemas.py->>MeshCollisionAPI: Apply api_func (USD or PhysX)
schemas.py->>MeshCollisionAPI: Set custom attributes (hull_vertex_limit, etc.)
MeshCollisionAPI-->>schemas.py: Collision properties applied
schemas.py-->>MeshConverter: Properties set
MeshConverter-->>User: Mesh converted with correct approximation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4 files reviewed, no comments
|
|
||
| physx_func: callable = MISSING | ||
|
|
||
| mesh_approximation_token: UsdPhysics.Tokens | PhysxSchema.Tokens = MISSING |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add docstrings to all the attributes in this class? It seems previous MR missed out on this during the review process.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of tokens, can we make them "str" which gets remapped to tokens internally?
|
|
||
| mesh_collision_appx_type = type(cfg).__name__.partition("PropertiesCfg")[0] | ||
|
|
||
| if use_usd_api: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is still useful to keep docstrings for the logic on mesh API decision making
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the fix and adding the test! Made a few comments. Please also update the extension.toml and CHANGELOG files.
Co-authored-by: Mayank Mittal <12863862+Mayankm96@users.noreply.github.com> Signed-off-by: Fan Dongxuan <soappyooo@outlook.com>
|
Updated the code according to the review. Key Changes1. Replaced token-based API with string-based API
2. Enhanced validation and error handling
3. Updated all mesh collision configuration classes
4. Updated tests and version
|
Description
This PR fixes a bug in the mesh converter where collision approximation was missing when applying mesh collision properties. The fix ensures that the collision approximation token is properly set on the USD mesh collision API.
Fixes #4077
Key changes
mesh_approximation_tokenattribute to allMeshCollisionPropertiesCfgclassesmodify_mesh_collision_propertiesto explicitly set the mesh collision approximation using the tokenextract_mesh_collision_api_and_attrsto excludemesh_approximation_tokenfrom custom attributeslen(custom_attrs > 0)was used instead oflen(custom_attrs) > 0Type of change
Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there