Files
test2/tests/files/usd/usd_materials_node_graph.usda
Jesse Yurkovich bcd5af34f9 Fix: USD: Traverse through UsdShadeNodeGraph nodes during material import
Follow connections through `UsdShadeNodeGraph` nodes when reading
materials rather than looking only for `UsdShadeShader` nodes.

Found while investigating the Intel Sponza research sample:
https://www.intel.com/content/www/us/en/developer/topic-technology/graphics-research/samples.html

Pull Request: https://projects.blender.org/blender/blender/pulls/140565
2025-06-18 20:25:29 +02:00

92 lines
3.5 KiB
Plaintext

#usda 1.0
(
defaultPrim = "root"
doc = "Blender v4.5.0 Beta"
metersPerUnit = 1
upAxis = "Z"
)
def Xform "root" (
customData = {
dictionary Blender = {
bool generated = 1
}
}
)
{
def Xform "Cube"
{
def Mesh "Cube" (
active = true
prepend apiSchemas = ["MaterialBindingAPI"]
)
{
uniform bool doubleSided = 1
float3[] extent = [(-1, -1, -1), (1, 1, 1)]
int[] faceVertexCounts = [4, 4, 4, 4, 4, 4]
int[] faceVertexIndices = [0, 4, 6, 2, 3, 2, 6, 7, 7, 6, 4, 5, 5, 1, 3, 7, 1, 0, 2, 3, 5, 4, 0, 1]
rel material:binding = </root/_materials/Material>
normal3f[] normals = [(0, 0, 1), (0, 0, 1), (0, 0, 1), (0, 0, 1), (0, -1, 0), (0, -1, 0), (0, -1, 0), (0, -1, 0), (-1, 0, 0), (-1, 0, 0), (-1, 0, 0), (-1, 0, 0), (0, 0, -1), (0, 0, -1), (0, 0, -1), (0, 0, -1), (1, 0, 0), (1, 0, 0), (1, 0, 0), (1, 0, 0), (0, 1, 0), (0, 1, 0), (0, 1, 0), (0, 1, 0)] (
interpolation = "faceVarying"
)
point3f[] points = [(1, 1, 1), (1, 1, -1), (1, -1, 1), (1, -1, -1), (-1, 1, 1), (-1, 1, -1), (-1, -1, 1), (-1, -1, -1)]
texCoord2f[] primvars:st = [(0.625, 0.5), (0.875, 0.5), (0.875, 0.75), (0.625, 0.75), (0.375, 0.75), (0.625, 0.75), (0.625, 1), (0.375, 1), (0.375, 0), (0.625, 0), (0.625, 0.25), (0.375, 0.25), (0.125, 0.5), (0.375, 0.5), (0.375, 0.75), (0.125, 0.75), (0.375, 0.5), (0.625, 0.5), (0.625, 0.75), (0.375, 0.75), (0.375, 0.25), (0.625, 0.25), (0.625, 0.5), (0.375, 0.5)] (
interpolation = "faceVarying"
)
uniform token subdivisionScheme = "none"
}
}
def Scope "_materials"
{
def Material "Material"
{
token outputs:surface.connect = </root/_materials/Material/Principled_BSDF.outputs:surface>
def Shader "Principled_BSDF"
{
uniform token info:id = "UsdPreviewSurface"
float inputs:clearcoat = 0
float inputs:clearcoatRoughness = 0.03
color3f inputs:diffuseColor.connect = </root/_materials/Material/node_graph_BaseColor.outputs:rgb>
float inputs:ior = 1.45
float inputs:metallic = 0
float inputs:opacity = 1
float inputs:roughness = 0.5
float inputs:specular = 0.5
token outputs:surface
}
def NodeGraph "node_graph_BaseColor" (
prepend references = </root/_materials/node_graph_BaseColor>
)
{
}
}
def NodeGraph "node_graph_BaseColor"
{
string inputs:frame:st = "st"
float3 outputs:rgb.connect = </root/_materials/node_graph_BaseColor/node_graph_BaseColor.outputs:rgb>
def Shader "node_graph_BaseColor"
{
uniform token info:id = "UsdUVTexture"
asset inputs:file = @./textures/test_single.png@
float2 inputs:st.connect = </root/_materials/node_graph_BaseColor/PrimvarReader_st.outputs:result>
token inputs:wrapS = "repeat"
token inputs:wrapT = "repeat"
float3 outputs:rgb
}
def Shader "PrimvarReader_st"
{
uniform token info:id = "UsdPrimvarReader_float2"
string inputs:varname.connect = </root/_materials/node_graph_BaseColor.inputs:frame:st>
float2 outputs:result
}
}
}
}