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 Transformusd:set_transform |
stageprim_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 Transformusd:get_transform |
stageprim_path = "/" |
list | Gets the local transform of a prim as a 4x4 matrix. |
Get World Transformusd:get_world_transform |
stageprim_path = "/" |
list | Gets the transform of a prim in the world as a 4x4 matrix. |
Get Bounding Boxusd:get_bounding_box |
stageprim_path = "/" |
list | Gets the bounds of a prim and what is below it, in the world. |
Set Visibilityusd:set_visibility |
stageprim_path = "/"visible = True |
stage | Shows or hides a prim and what is below it. |
Set Purposeusd:set_purpose |
stageprim_path = "/"purpose = "default" |
stage | Sets what a prim is drawn for: default, render, proxy or guide. |
Create Cubeusd:create_cube |
stageprim_path = "/"size = 1.0 |
stage | Defines a cube prim. |
Create Sphereusd:create_sphere |
stageprim_path = "/"radius = 1.0 |
stage | Defines a sphere prim. |
Create Meshusd:create_mesh |
stageprim_path = "/"points = []face_vertex_counts = []face_vertex_indices = [] |
stage | Defines a polygon mesh prim. |
Create Materialusd:create_material |
stageprim_path = "/"diffuse_color = [0.8, 0.8, 0.8] |
stage | Defines a material with a UsdPreviewSurface shader. |
Bind Materialusd:bind_material |
stageprim_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,CubeandMesh, 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 takesdefault,render,proxyorguide. - 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
UsdPreviewSurfaceshader namedPreviewSurfacebelow it, with thediffuse_colorgiven. Bind Material binds a material to a prim and what is below it, and fails if the path is not a material.