newton.usd.has_applied_api_schema#

newton.usd.has_applied_api_schema(prim, schema_name)[source]#

Check if a USD prim has an applied API schema, even if the schema is not registered with USD’s schema registry.

For registered schemas (e.g. UsdPhysics.RigidBodyAPI), prim.HasAPI() is sufficient. However, non-core schemas that may be in draft state or not yet registered (e.g. MuJoCo-specific schemas like MjcSiteAPI) will not be found by HasAPI(). This helper falls back to inspecting the raw apiSchemas metadata on the prim.

Parameters:
  • prim (Prim) – The USD prim to query.

  • schema_name (str) – The API schema name to check for (e.g. "MjcSiteAPI").

Returns:

True if the schema is applied to the prim, False otherwise.

Return type:

bool