newton.usd#

Utilities for working with the Universal Scene Description (USD) format.

This module provides both low-level USD utility helpers and public schema resolver types used by newton.ModelBuilder.add_usd().

Classes

PrimType

Enumeration of USD prim types that can be resolved by schema resolvers.

SchemaResolver

Base class mapping USD schema attributes to Newton attributes.

SchemaResolverMjc

Schema resolver for MuJoCo USD attributes.

SchemaResolverNewton

Schema resolver for Newton-authored USD attributes.

SchemaResolverPhysx

Schema resolver for PhysX USD attributes.

Functions

get_attribute()

Get an attribute value from a USD prim, returning a default if not found.

get_attributes_in_namespace(prim, namespace)

Get all attributes in a namespace from a USD prim.

get_custom_attribute_declarations(prim)

Get custom attribute declarations from a USD prim, typically from a PhysicsScene prim.

get_custom_attribute_values(prim, ...[, context])

Get custom attribute values from a USD prim and a set of known custom attributes.

get_float()

Get a float attribute value from a USD prim, validating that it's finite.

get_gprim_axis(prim[, name, default])

Get an axis attribute from a USD prim and convert it to an Axis enum.

get_mesh()

Load a triangle mesh from a USD prim that has the UsdGeom.Mesh schema.

get_quat()

Get a quaternion attribute value from a USD prim, validating that it's finite and non-zero.

get_scale(prim[, local, xform_cache])

Extract the scale component from a USD prim's transformation.

get_transform(prim[, local, xform_cache])

Extract the transform (position and rotation) from a USD Xform prim.

has_applied_api_schema(prim, schema_name)

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

has_attribute(prim, name)

Check if a USD prim has a valid and authored attribute.

type_to_warp(v)

Determine the Warp type, e.g. wp.quat, wp.vec3, or wp.float32, from a USD value.

value_to_warp(v[, warp_dtype])

Convert a USD value (such as Gf.Quat, Gf.Vec3, or float) to a Warp value.