Newton USD schemas provide extensions to OpenUSD's UsdPhysics specification, allowing USD layers to fully specify the Newton runtime data model.
These schemas can be deployed into any python runtime with USD support, allowing content creators to author Newton compatible robots, props, and environments in any application of their choice, without requiring the Newton runtime itself.
This project is part of Newton, a Linux Foundation project which is community-built and maintained.
These schemas are codeless, in that they contain no compiled code nor any public API of their own. Since codeless schemas do not provide any code, clients do not need to recompile USD to use or update these schemas. They are deployed as a python module via a wheel package for convenience, as all Newton projects use pyproject based dependencies & most USD authoring workflows include a python runtime.
To start using the schemas, install the python wheel into a virtual environment using your favorite package manager:
python -m venv .venv
source .venv/bin/activate
pip install newton-usd-schemasAt runtime, simply import the module to register the schemas with OpenUSD.
Important: Schemas must be registered before the
Usd.SchemaRegistryis initialized. Make sure to import the module very early in the process.
import newton_usd_schemas # this registers the schema
from pxr import Usd, UsdPhysics
stage: Usd.Stage = Usd.Stage.CreateInMemory()
# create a UsdPhysics.Scene and set gravity
prim: Usd.Prim = UsdPhysics.Scene.Define(stage, "/scene").GetPrim()
prim.GetAttribute("physics:gravityMagnitude").Set(9.81)
# TODO: uncomment once we have an API schema to use
# apply a Newton schema and set some of its attributes
# prim.ApplyAPI("NewtonSceneAPI")
# prim.GetAttribute("newton:timeStep").Set(10)
stage.Export("/tmp/my_robot.usd")Once a USD layer is authored to storage, it can be loaded into a Newton runtime using Newton's USD Parsing mechanism.
Contributions from the community are welcome. See CONTRIBUTING.md to learn about contributing via GitHub issues, as well as building the project from source and our development workflow.
General contribution guidelines for Newton repositories are available here.
For questions about these newton-usd-schemas, feel free to join or start a GitHub Discussions.
By participating in this community, you agree to abide by the Linux Foundation Code of Conduct.
newton-usd-schemas is provided under the Apache License, Version 2.0