Cannot set Friction Combine Mode via Python

While setting components of a robot’s physics material properties, I noticed a potential bug with regards to being unable to set the Friction Combine Mode via Python script without first updating it manually through the UI.

Below is the code that is exported via the Commands window after successfully updating this parameter via the UI. After restarting Isaac Sim, executing this either during setup or in the Script Editor appears to have no effect as well as no error output. This code only begins to function if I manually update either Friction Combine Mode or Restitution Combine Mode, even to values other than my desired value, and then run the code in the Script Editor.

import omni.kit.commands
from pxr import Sdf

omni.kit.commands.execute('ChangeProperty',
	prop_path=Sdf.Path('/fetch/drive_wheel_material.physxMaterial:frictionCombineMode'),
	value='max',
	prev=None)

This behavior seems to occur across any physics material. Any insight into this behavior and solutions for how to resolve this in code would be greatly appreciated.

The problem is most likely that the PhysxMaterialAPI was not applied, you are trying to set a loose attribute.
You might be missing something like:

PhysxSchema.PhysxMaterialAPI.Apply(prim)

Regards,
Ales

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.