Hello,
I’d like to ask for a simple clarification when declaring primvars with constant interpolation:
The user guide says “Note that you still need to provide an array (that contains a single element) for the primvar.”
But when declaring a single element primvar without using an array, usdview still interprets everything nicely, like shown in the following file:
#usda 1.0
(
defaultPrim = "Root"
metersPerUnit = 1
upAxis = "Y"
)
def Xform "Root"
{
def Sphere "MySphere" (
prepend apiSchemas = ["MaterialBindingAPI"]
)
{
rel material:binding = </Root/MyMaterial>
float3 primvars:myColor = (0, 0, 1) ( interpolation = "constant" )
double radius = 0.5
}
def Material "MyMaterial"
{
token outputs:surface.connect = <PreviewSurface.outputs:surface>
def Shader "ColorReader"
{
uniform token info:id = "UsdPrimvarReader_float3"
float3 inputs:fallback = (0, 1, 0)
string inputs:varname = "myColor"
float3 outputs:result
}
def Shader "PreviewSurface"
{
uniform token info:id = "UsdPreviewSurface"
color3f inputs:diffuseColor = (1, 0, 0)
color3f inputs:diffuseColor.connect = <../ColorReader.outputs:result>
float inputs:metallic = 0
float inputs:roughness = 0.5
token outputs:surface
}
}
}
So, is this intentionally supported and should I expect other renderers than Storm to have the same behavior if they follow the canonical spec? If yes, what is the recommended declaration, knowing that for example Maya exposes non-array attributes in the ExtraAttributes of a prim while array attributes are not shown at all.
Thanks a lot!
Marcel
