OpenUSD schema definitions for the Newton physics engine
Project description
newton-usd-schemas
Overview
Newton USD schemas provide extensions to OpenUSD's UsdPhysics specification, allowing USD layers to configure 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.
Get Started
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-schemas
pip install usd-core # or any other USD runtime
At 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
scene: UsdPhysics.Scene = UsdPhysics.Scene.Define(stage, "/scene")
scene.GetGravityMagnitudeAttr().Set(9.81)
# apply a Newton schema and set some of its attributes
prim: Usd.Prim = scene.GetPrim()
prim.ApplyAPI("NewtonSceneAPI")
prim.GetAttribute("newton:timeStepsPerSecond").Set(500) # 2ms
stage.Export("/tmp/my_robot.usda") # or .usdc or .usd
Once a USD layer is authored to storage, it can be loaded into a Newton runtime using Newton's USD Parsing mechanism.
Design Principles
Newton schemas follow a minimalist approach to determine which attributes should be included, and are similar to the philosophy that UsdPhysics and the Newton API follow for capturing parameters that generalize across simulators. We view the Newton schemas as a proving and staging ground for physics parameters that should eventually be eligible for promotion into the UsdPhysics standard.
A USD attribute belongs in the Newton schema if it meets one of these criteria:
-
Clear Physical Meaning: The attribute represents a physically meaningful quantity rather than a modeling or approximation parameter (e.g., simulation time step
dt, or gravitational acceleration), and is supported by at least one Newton solver. -
Cross-Solver Support: The attribute has a direct (or transformable) correspondence to parameters supported by at least two Newton solvers. This mainly applies to physical modeling parameters (e.g., a viscous joint friction coefficient).
For solver-specific or workflow-specific parameters that are not in UsdPhysics or the Newton schema, Newton supports solver-specific schemas (e.g., mjcPhysics) or custom attributes.
Contribution Guidelines
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.
Community
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.
References
License
newton-usd-schemas is provided under the Apache License, Version 2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file newton_usd_schemas-0.1.0.tar.gz.
File metadata
- Download URL: newton_usd_schemas-0.1.0.tar.gz
- Upload date:
- Size: 61.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07420c425abd6282e1e9ac0dce4ef2d87bc6e08639f0b00db694de63684ef341
|
|
| MD5 |
827837d620ef81fe1ba10e837b19e3d6
|
|
| BLAKE2b-256 |
735e95a2c4872ca9bc0e6e31344ab7df5f6dceedacc5ea39d5832d352c98cdf4
|
Provenance
The following attestation bundles were made for newton_usd_schemas-0.1.0.tar.gz:
Publisher:
ci.yml on newton-physics/newton-usd-schemas
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
newton_usd_schemas-0.1.0.tar.gz -
Subject digest:
07420c425abd6282e1e9ac0dce4ef2d87bc6e08639f0b00db694de63684ef341 - Sigstore transparency entry: 1066862796
- Sigstore integration time:
-
Permalink:
newton-physics/newton-usd-schemas@a28b3879c34b654115afdf2d08cb504a20b831fb -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/newton-physics
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@a28b3879c34b654115afdf2d08cb504a20b831fb -
Trigger Event:
push
-
Statement type:
File details
Details for the file newton_usd_schemas-0.1.0-py3-none-any.whl.
File metadata
- Download URL: newton_usd_schemas-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da83ba6a571cf7a3acec449d83477c8273bf37260314aa135a74f85b64256583
|
|
| MD5 |
71a812a39ce96b4b21024c86902c39f0
|
|
| BLAKE2b-256 |
08d13c16c963f8026e6e813c442db724abc1293fc67442f9620caa0d295a5d7a
|
Provenance
The following attestation bundles were made for newton_usd_schemas-0.1.0-py3-none-any.whl:
Publisher:
ci.yml on newton-physics/newton-usd-schemas
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
newton_usd_schemas-0.1.0-py3-none-any.whl -
Subject digest:
da83ba6a571cf7a3acec449d83477c8273bf37260314aa135a74f85b64256583 - Sigstore transparency entry: 1066862844
- Sigstore integration time:
-
Permalink:
newton-physics/newton-usd-schemas@a28b3879c34b654115afdf2d08cb504a20b831fb -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/newton-physics
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@a28b3879c34b654115afdf2d08cb504a20b831fb -
Trigger Event:
push
-
Statement type: