How to apply ForceFieldAPI in Isaac-sim-5.1.0

Isaac Sim Version

5.1.0

Operating System

Windows 11

GPU Information

  • Model: RTX 5090
  • Driver Version:

Detailed Description

As I known, the old forcefield API has been superseded by the new API schema named PhysxForceFieldAPI.

I have seen https://forums.developer.nvidia.com/t/force-filed-extension-removed/345686, but I still cannot find where the API is.

I only found it in USDRT, but I can’t make it work.

I tried to apply it with python:

import omni.usd
from usdrt import Gf, Sdf, Usd, ForceFieldSchema

ctx = omni.usd.get_context()
rtstage = Usd.Stage.Attach(ctx.get_stage_id())
path = "/World/WindField"

omni.kit.commands.execute('CreatePrim',
    prim_path=path,
    prim_type='Xform',
    select_new_prim=True)

wind_xform = rtstage.GetPrimAtPath(path)
force_field_api = ForceFieldSchema.PhysxForceFieldAPI(wind_xform, "wind_field")
wind_field_api = ForceFieldSchema.PhysxForceFieldWindAPI(wind_xform,"wind_field")
# Also tried 
#force_field_api = ForceFieldSchema.PhysxForceFieldAPI.Apply(wind_xform, "wind_field")
print(force_field_api)

And I got :

PhysxForceFieldAPI(invalid)

The “WindField” xform in Isaac-sim still not having the API.

I also check the “Edit API Schema”, and didn’t see any ForceFieldAPI.

I wonder how to apply the ForceFieldAPI correctly.