|
12 | 12 | from pxr import Usd, UsdPhysics, UsdShade |
13 | 13 |
|
14 | 14 | from isaaclab.sim.utils import clone, safe_set_attribute_on_usd_prim, safe_set_attribute_on_usd_schema |
| 15 | +from isaaclab.utils.string import to_camel_case |
15 | 16 |
|
16 | 17 | if TYPE_CHECKING: |
17 | 18 | from . import physics_materials_cfg |
@@ -71,7 +72,7 @@ def spawn_rigid_body_material(prim_path: str, cfg: physics_materials_cfg.RigidBo |
71 | 72 | safe_set_attribute_on_usd_schema(usd_physics_material_api, attr_name, value, camel_case=True) |
72 | 73 | # set into PhysX API |
73 | 74 | for attr_name, value in cfg.items(): |
74 | | - safe_set_attribute_on_usd_prim(prim, f"physxMaterial:{attr_name}", value, camel_case=False) |
| 75 | + safe_set_attribute_on_usd_prim(prim, f"physxMaterial:{to_camel_case(attr_name)}", value, camel_case=False) |
75 | 76 | # return the prim |
76 | 77 | return prim |
77 | 78 |
|
@@ -124,6 +125,8 @@ def spawn_deformable_body_material(prim_path: str, cfg: physics_materials_cfg.De |
124 | 125 | del cfg["func"] |
125 | 126 | # set into PhysX API |
126 | 127 | for attr_name, value in cfg.items(): |
127 | | - safe_set_attribute_on_usd_prim(prim, f"physxDeformableBodyMaterial:{attr_name}", value, camel_case=False) |
| 128 | + safe_set_attribute_on_usd_prim( |
| 129 | + prim, f"physxDeformableBodyMaterial:{to_camel_case(attr_name)}", value, camel_case=False |
| 130 | + ) |
128 | 131 | # return the prim |
129 | 132 | return prim |
0 commit comments