Skip to content

Instantly share code, notes, and snippets.

@ColinKennedy
Last active April 19, 2023 02:08
Show Gist options
  • Save ColinKennedy/1997d1f0850031d22245f529cd92872f to your computer and use it in GitHub Desktop.
Save ColinKennedy/1997d1f0850031d22245f529cd92872f to your computer and use it in GitHub Desktop.
A USD file with as much syntax details as possible
#usda 1.0
(
doc = """This is a docstring"""
subLayers = [ # This is an in-line comment
@./external_path.usda@,
@/absolute/path.usda@,
@uri:blah?extension=.usda:.usd:.usdc&meta=data@
]
)
class "_some_class_1" {}
over "root"
{
def Xform "SomePrim" (
doc = "Docstrings can also be single quoted"
kind = "component"
add references = @./base.usda@</Foo/Bar>
prepend variantSets = "forwarding_variant_set"
variants = {
string forwarding_variant_set = "selection_1"
}
)
{
custom float some_property = 1
variantSet "forwarding_variant_set" = {
"selection_1" (
payload = @some/thing.usdc@
)
{
rel another = </Forwarder1.something>
}
"selection_2" {
rel another = </Forwarder2.something>
}
"selection_3" {
rel another = </Forwarder3.something>
}
}
}
def Mesh "card" (
inherits = </_some_class_1>
)
{
float3[] extent = [(-430, -145, 0), (430, 145, 0)]
int[] faceVertexCounts = [4]
int[] faceVertexIndices = [0, 1, 2, 3]
rel material:binding = </TexModel/card/boardMat>
point3f[] points = [(-430, -145, 0), (430, -145, 0), (430, 145, 0), (-430, 145, 0)]
texCoord2f[] primvars:st = [(0, 0), (1, 0), (1, 1), (0, 1)] (
interpolation = "varying"
)
double3 xformOp:translate:move.timeSamples = {
0: (0, 0, 0),
10: (0, 0, 20),
}
uniform token[] blah = ["thing"]
def Material "boardMat"
{
token inputs:frame:stPrimvarName = "st"
token outputs:surface.connect = </TexModel/card/boardMat/PBRShader.outputs:surface>
def Shader "PBRShader"
{
uniform token info:id = "UsdPreviewSurface"
color3f inputs:diffuseColor.connect = </TexModel/card/boardMat/diffuseTexture.outputs:rgb>
float inputs:metallic = 0
float inputs:roughness = 0.4
token outputs:surface
}
def Shader "stReader"
{
uniform token info:id = "UsdPrimvarReader_float2"
token inputs:varname.connect = </TexModel/card/boardMat.inputs:frame:stPrimvarName>
float2 outputs:result
}
def Shader "diffuseTexture"
{
uniform token info:id = "UsdUVTexture"
asset inputs:file = @./USDLogoLrg.png@
float2 inputs:st.connect = </TexModel/card/boardMat/stReader.outputs:result>
float3 outputs:rgb
}
}
}
def "typeless_child"
{
rel collection:Erasers:includes = [
</Office_set/Desk_Assembly/Cup_grp/Pencil_1/Geom/EraserHead>,
</Office_set/Desk_Assembly/Cup_grp/Pencil_2/Geom/EraserHead>,
</Office_set/Desk_Assembly/Cup_grp/Pencil_3/Geom/EraserHead>,
</Office_set/Desk_Assembly/Cup_grp/Pencil_4/Geom/EraserHead>,
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment