Environment Setup
Let's make sure everything is installed and ready to go.
It's a pip package made by Pixar. It gives you the
pxr Python module, which is basically all of USD's power
without needing any GUI or renderer. You just pip install usd-core and you can
create, compose, and inspect 3D scenes right from a Python script. That's it.
Your First USD Stage
Create a simple scene, save it to disk, and read it back.
.usda text file, then re-open it to make sure everything survived the trip.
Procedural Scene Generation
Now the fun part: let's generate a full drone racing track with code.
gate:index, gate:width,
and gate:height. This shows how USD lets you store whatever data you want on any prim.
A drone gets placed at the first gate as a starting position.
Play with the parameters below and see what happens!
Layer Composition
Split the scene into separate layers that compose together automatically.
•
base_layer, the original track geometry (weakest)•
sim_layer, where we move a gate and hide another one•
data_layer, where we tag things as "obstacle" or "agent" (strongest)The beauty of this? Three different people (or teams) can work on the same scene at the same time without ever touching each other's files.
VariantSets
Give each gate a "shape" dropdown: square, circle, or narrow.
.usda per variant so you can see the difference.
Time Samples & Animation
Make the drone actually fly through the gates. This is the best part.
(frame, value) pairs on any attribute. You set a position at frame 1, another
at frame 15, another at frame 30, and USD fills in everything in between automatically.
We'll place a keyframe at each gate, spread across frames 1 to 120, so the drone flies
the full circuit and loops back to the start. Then we double-check that the interpolation
actually works correctly.
Once this runs, hit View in 3D to watch the drone fly!
Validation & Quality Checks
Make sure nothing is broken before shipping these files anywhere.
Batch Processing & Flattening
Generate 20 different tracks at once, then flatten one to see what happens.