Skip to content

Transform, geometry and shading nodes

Tags: transform, geometry, shading

Move prims, make basic shapes and meshes, and give them materials.

Node Inputs Output What it does
Set Transform
usd:set_transform
stage
prim_path = "/"
translate = [0.0, 0.0, 0.0]
rotate = [0.0, 0.0, 0.0]
scale = [1.0, 1.0, 1.0]
stage Sets the local transform of a prim, replacing its transform operations.
Get Transform
usd:get_transform
stage
prim_path = "/"
list Gets the local transform of a prim as a 4x4 matrix.
Get World Transform
usd:get_world_transform
stage
prim_path = "/"
list Gets the transform of a prim in the world as a 4x4 matrix.
Get Bounding Box
usd:get_bounding_box
stage
prim_path = "/"
list Gets the bounds of a prim and what is below it, in the world.
Set Visibility
usd:set_visibility
stage
prim_path = "/"
visible = True
stage Shows or hides a prim and what is below it.
Set Purpose
usd:set_purpose
stage
prim_path = "/"
purpose = "default"
stage Sets what a prim is drawn for: default, render, proxy or guide.
Create Cube
usd:create_cube
stage
prim_path = "/"
size = 1.0
stage Defines a cube prim.
Create Sphere
usd:create_sphere
stage
prim_path = "/"
radius = 1.0
stage Defines a sphere prim.
Create Mesh
usd:create_mesh
stage
prim_path = "/"
points = []
face_vertex_counts = []
face_vertex_indices = []
stage Defines a polygon mesh prim.
Create Material
usd:create_material
stage
prim_path = "/"
diffuse_color = [0.8, 0.8, 0.8]
stage Defines a material with a UsdPreviewSurface shader.
Bind Material
usd:bind_material
stage
prim_path = "/"
material_path
stage Binds a material to a prim and what is below it.

Notes

  • Set Transform replaces the transform operations of the prim with a translate, a rotate (X, Y, Z in degrees) and a scale, applied in that order. Only the prims of types that can be transformed, like Xform, Cube and Mesh, work.
  • Get Transform and Get World Transform give a 4x4 matrix as a list of rows. The translation is the last row: [10, 0, 0, 1]. The world transform includes the parents.
  • Get Bounding Box gives [[min x, y, z], [max x, y, z]] of the prim and what is below it, in the world. A prim with nothing to measure has a minimum larger than its maximum.
  • Set Visibility needs a prim that is drawable (Imageable), Set Purpose takes default, render, proxy or guide.
  • Create Mesh checks that the counts add up to the indices and that every index is one of the points.
  • Create Material makes a material with a UsdPreviewSurface shader named PreviewSurface below it, with the diffuse_color given. Bind Material binds a material to a prim and what is below it, and fails if the path is not a material.