User guide

18 Typed Connection Checking
The constituent nodes of a Network Material can specify which connections are valid, based on simple string tags.
Shaders can declare a set of named tags that indicate what they provide as outputs, and input connections. Shaders
can specify what what tags they require for that connection to be valid.
Shader Outputs
Any shader can declare a set of tags to represent what outputs the shader provides. Tags are all simple string values
and are declared in .args files using the following syntax:
<args format="1.0">
<output name="out">
<tags>
<tag value="color"/>
<tag value="color4"/>
<tag value="diffuse"/>
</tags>
</output>
</args>
The following is the equivalent hint dictionary syntax:
{"PrmanShadingNode.parameters": {
"containerHints":{
"": {"outputs":{"out":{"tags":["color","color4","diffuse"]}}},
"open": "True"},
}
For PRMan co-shaders, tag values are typically the names of methods the coshader provides, that can be
interrogated by another shader. For example, if a shader provides a method called outColor, this can be advertised
by declaring an output tag called outColor. The ability to declare multiple tags allows co-shaders to advertise any
number of different methods they provide.
For renderers - such as Arnold - where shader components provide strongly typed data, these tags can simply be the
names of the data types they provide, such as float, vector or color.
Tag values can also be used for higher level constructs, such as declaring that a shader provides all the outputs
necessary for a layerShader.