Skip to content

Latest commit

 

History

History
49 lines (35 loc) · 2.03 KB

File metadata and controls

49 lines (35 loc) · 2.03 KB

OpenUSD Exchange Samples: createTransforms

This sample demonstrates how to open/create a stage with key metadata and apply transforms to prims using the OpenUSD Exchange SDK.

USD Modules

The Gf, Sdf, and Usd modules are used

OpenUSD Exchange SDK functions

  • createStage()
  • defineXform()
  • getLocalTransform()
  • getLocalTransformComponents()
  • getValidChildNames()
  • saveStage()
  • setLocalTransform()

Languages

This sample is implemented in both C++ and Python. To run:

  • [./]run.[bat, sh] createTransforms
  • [./]python.[bat, sh] source/createTransforms/createTransforms.py

Hardcoded items

  • If a stage is created, it has a default prim named "World", Y-up axis, 1 cm linear units
  • A prim (either found or created) is rotated 45 degrees in the prim's middle rotation axis
    • The prim is found using a method called stage traversal
    • If a xformable prim isn't found a cube will be created to rotate
    • Note that the typical rotation order is XYZ, so the expectation is that the sample rotates the prim on the Y axis
  • A Xform prim named "groundXform" is created and lowered 55 cm
  • A cube prim named "groundCube" is created as a child of "groundXform" with a scale of (20, 0.1, 20)

Command Line Arguments

Usage:
  createTransforms [OPTION...]

  -a, --usda          Output a text stage rather than binary
  -h, --help          Print usage
  -p, --path arg      Alternate destination stage path (default: c:/Users/username/AppData/Local/Temp/usdex/sample.usdc)