Hi!
I would like to change the “angular damping” rigid body parameter from python using kit.commands. However the code doesn’t work and there is no error output.
Here is the command I am running:
menv = Sdf.Layer.GetLoadedLayers()[2]
world_session = Sdf.Layer.GetLoadedLayers()[0]
omni.kit.commands.execute('ChangeProperty',
prop_path=Sdf.Path('/simple_pendulum/pendulum_link.physxRigidBody:angularDamping'),
value=0.0,
prev=0.05000000074505806,
target_layer=menv,
usd_context_name=Usd.Stage.Open(rootLayer=menv, sessionLayer=world_session))
I was able to modify the rigid body properties using the PhysxRigidBodyAPI.
from omni.isaac.kit import SimulationApp
simulation_app = SimulationApp({"headless": False})
# Must import pxr after starting simulation_app
from pxr import PhysxSchema
from omni.isaac.core.utils.prims import get_prim_at_path
# ...
prim = get_prim_at_path("/simple_pendulum/pendulum_link")
rb = PhysxSchema.PhysxRigidBodyAPI.Apply(prim)
rb.GetAngularDampingAttr().Set(0.0)
This worked for me.
Yes, just changing the attribute does not help, the API must be applied. These attributes belong to that API, those are not standalone attributes.