Skip to main content

JSON-native OpenUSD authoring: a verb-based CLI, daemon, and MCP server over pxr.

Project description

usdq

PyPI Python License

A command-line tool and Python library for authoring and composing OpenUSD scenes through structured JSON. Every command takes plain arguments and returns JSON, so scripts and LLM agents can build USD stages without importing pxr or writing .usda by hand. The surface is self-describing: usdq verbs emits the full machine-readable spec.

pip install usdq          # CLI + daemon + MCP server; usd-core is the only dependency
usdq verbs                # the full command surface as JSON (start here)
usdq mcp                  # serve every verb as MCP tools over stdio

Agents should read AGENTS.md for the JSON contract and canonical workflows; usdq with no arguments prints the same reference.

Status

Version 0.1.2, under active development. The command surface spans three areas:

  • Authoring & composition — prims and attributes, references and other composition arcs, variants, layers, collections, schemas, renaming, masked-write guards, and deferred-save sessions.
  • Geometry & shading — mesh arrays, tube and ribbon meshes, point instancers, HD primitives, and textured UsdPreviewSurface material networks.
  • Introspection & batchingverbs and schemas for discovery, batch for grouped execution.

The library wraps OpenUSD's pxr. The intended deployment is a thin client talking to a long-running daemon that holds the USD runtime, so repeated calls avoid repeated startup cost.

Run

pip install usdq                         # installs the `usdq` and `usdq-render` commands

usdq init /tmp/scene.usda --default-prim /World
usdq define-prim /tmp/scene.usda /World Mesh
usdq schema-info Mesh --pretty
usdq verbs --pretty

The first command auto-spawns a background daemon (per-user, on-demand) that owns the heavy USD runtime; subsequent calls reuse it. Pass --no-daemon to run in-process. For local development from a checkout: pip install -e ".[dev]".

Rendering

usdq-render adapters (usdrecord / blender / web-preview) require external tools that are not pip-installable — a full OpenUSD install for usdrecord (the usd-core wheel does not bundle it), Blender for Cycles + USD→glTF, and Chrome for web screenshots. Missing tools fail cleanly with renderer_not_found; core authoring needs none of them. See PORTABILITY.md for what survives across renderers.

Quality Gates

.venv/bin/ruff check --no-cache .
.venv/bin/pytest -q

# Optional local renderer smoke tests; not run by default in CI.
USDQ_RUN_REAL_RENDER_TESTS=1 .venv/bin/pytest -q -m real_render tests/test_render_cli.py

Design Contract

  • JSON success responses go to stdout.
  • Structured JSON errors go to stderr with non-zero exit codes.
  • set-attr refuses writes that would be silently masked by stronger root-layer-stack opinions unless --force is passed.
  • batch is deferred-save execution, not rollback-transactional execution: successful ops before a halt are persisted. The CLI exits non-zero if any submitted op fails, with the structured batch response on stderr.
  • begin-session / flush-session / end-session pin one stage across daemon requests and defer persistence until an explicit flush. Daemon auto-session remains opt-in through USDQ_AUTOSESSION=1.
  • The public CLI, core dispatch, and verbs manifest are generated from the same verb registry.

See DOCS.md for the full command reference and NOTES.md for the design log.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

usdq-0.1.2.tar.gz (188.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

usdq-0.1.2-py3-none-any.whl (121.8 kB view details)

Uploaded Python 3

File details

Details for the file usdq-0.1.2.tar.gz.

File metadata

  • Download URL: usdq-0.1.2.tar.gz
  • Upload date:
  • Size: 188.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for usdq-0.1.2.tar.gz
Algorithm Hash digest
SHA256 e50af4ee841b98dcf9a0b39699d671743390bde06eb4c684783edccba37630f1
MD5 f81fae4e709bda68f177a01d9fb340fb
BLAKE2b-256 d9d586f0a36d8d9b9300426d7cbe28d37b2f9186295ecfc4a05a4eb2f00595af

See more details on using hashes here.

File details

Details for the file usdq-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: usdq-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 121.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for usdq-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 14662fc15b1fca29db83927d2d3fc6dc07376ef162854154f0fa7a4484e242e7
MD5 452059efab1669eef23c135330a06e00
BLAKE2b-256 dbeb2ac272b5380dd124c0b2cec732c467b7963e84d55f1787f5ce4c74991720

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page