Hej, I have to following file and didn’t expect the resulting image.
#usda 1.0
def Sphere "sr" (prepend apiSchemas = ["MaterialBindingAPI"]) {
rel material:binding = </red_material>
}
def Sphere "sg" (prepend apiSchemas = ["MaterialBindingAPI"]) {
rel material:binding = </green_material>
double3 xformOp:translate = (2, 0, 0)
uniform token[] xformOpOrder = ["xformOp:translate"]
}
def Sphere "sb" (prepend apiSchemas = ["MaterialBindingAPI"]) {
rel material:binding = </blue_material>
double3 xformOp:translate = (4, 0, 0)
uniform token[] xformOpOrder = ["xformOp:translate"]
}
def Material "material"
{
token outputs:surface.connect = </material/usd_preview.outputs:surface>
color3f inputs:LEGO:diffuse_color = (0.6, 0.8, 1.0)
def Shader "usd_preview"
{
uniform token info:id = "UsdPreviewSurface"
color3f inputs:diffuseColor.connect = </material.inputs:LEGO:diffuse_color>
token outputs:surface
}
}
def "red_material" (
references = </material>
) {
}
def "green_material" (
references = </material>
) {
color3f inputs:LEGO:diffuse_color = (0.0, 1.0, 0.0)
}
def "blue_material" (
instanceable = true
references = </material>
) {
color3f inputs:LEGO:diffuse_color = (0.0, 0.0, 1.0)
}
and I get this in usdview (22.11 / Windows 10)
Why is the sphere sb
not blue when I use instancing? I only “overwrite” the inputs:LEGO:diffuse_color
attribute of the root node? Or is the the connection between nodes in the subgraph and node that references broken?
Also, why is the sb
sphere (right) gray and not bright blue as the sr
(left)? This is the “default” color I set in the material
Material.