Transform USD Prim
Move, rotate, scale — and don't trip the footgun
- USD
- translation
- rotation
- scale
- USD
Transform USD Prim is the pack's "place the prop" node: give it a prim path and translation/rotation/scale vectors, and it moves that prim in the scene. It's the everyday scene-building tool of the ComfyUI-OpenUSD pack - load a mesh, transform it into position, color it, save. Nothing fancy, and mostly it isn't. But it ships with one footgun that will eat an afternoon, so read the warning before you wire it into anything that matters.
Why you'd reach for it
Once you can load a stage, the next thing you want is to arrange it - and USD scenes are organized as a tree of xformable prims (Xforms, meshes, cameras, lights), each with its own local transform. Transform USD Prim is how you set that transform from the graph. The prim_path field also accepts wildcards, so you can move a whole family of prims in one shot: an exact path for one prim, a * for every child at a level, or a ** pattern for everything matching anywhere. That's genuinely handy for lining up a collection of parts.
How it works
For each matching prim it clears the existing transform operations and writes three fresh ones in the standard TRS order: translate, then rotate, then scale. Rotation is in degrees (the AddRotateXYZOp convention), which matches the node UI and will only surprise you if you came from math where rotation is radians. Non-xformable prims are skipped quietly.
Now the footgun, spelled out because it's in the source and it bites: ClearXformOpOrder wipes every existing transform op on the prim. That includes a baked xformOp:transform matrix, a transform authored by a reference, and - the bad one - time-sampled transforms. Feed it a prim that's animated and this node deletes the animation's transform entirely and replaces it with your static TRS. The author did it deliberately to guarantee an absolute result rather than a conflicted one, and that's a fine trade for a static scene. It is not fine for an animated asset you care about.
The inputs that matter
prim_path- which prim (or wildcard set) to transform.translation- XYZ offset, in stage units.rotation- XYZ Euler angles in degrees.scale- per-axis scale. Default is1,1,1in spirit but0,0,0in the widget. The VEC3 widget starts at zero, and if you don't touch scale, the code happily writes a zero scale op - your mesh collapses to a point and you'll swear the viewer is broken. Set scale to1,1,1unless you actually want it squished.
The VEC3 inputs are the pack's custom type: each renders as an inline x/y/z box so you can type values, and each can also be driven by a Create USD Vec3 node if you want the transform controlled from the graph instead of by hand.
Output is the same USD stage with the transform authored.
Install
Same pack, same path - ComfyUI Manager (search "ComfyUI-OpenUSD") or:
cd ComfyUI/custom_nodes
git clone https://github.com/cjhosken/ComfyUI-OpenUSD
Restart and let usd-core==26.5, numpy, trimesh, and pygltflib install. No model downloads; the one-time usd-core install is the heavy part.
Troubleshooting
- The mesh vanished after running - you left scale at
0,0,0. Set it to1,1,1. This is the #1 trap on this node. - An animated prim is suddenly frozen -
ClearXformOpOrderdeleted its animated transform. Don't use this node on prims you didn't author; use it on prims you fully own, or drive the animation throughUSD Python Scriptinstead. - Nothing moved but no error - either the path matched nothing (check it against
USD to Text) or the prim isn't xformable and was skipped.
Same pack-level caveat as the rest: v0.1.1, no community track record yet. The transform math is solid; the clearing behavior is the design decision to understand before you build a workflow on it.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| USD | USD | — | |
| prim_path | STRING | /Root/Mesh | — |
| translation | VEC3 | — | |
| rotation | VEC3 | — | |
| scale | VEC3 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| USD | USD | — |