Go to: Synopsis. Return value. Keywords. Flags. Python examples.

Synopsis

shadingNetworkCompare([byName=boolean], [byValue=boolean], [delete=boolean], [equivalent=boolean], [network1=boolean], [network2=boolean], [upstreamOnly=boolean])

Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.

shadingNetworkCompare is NOT undoable, queryable, and NOT editable.

This command allows you to compare two shading networks.

Return value

string[]|string|int

In query mode, return type is based on queried flag.

Keywords

shader, shading, network

Flags

byName, byValue, delete, equivalent, network1, network2, upstreamOnly
Long name (short name) Argument types Properties
byName(nam) boolean create
Indicates whether the comparison should consider node names. If true, two shading networks will be considered equivalent only if the names of corresponding nodes are the same, ignoring namespaces. If false, two shading networks will be considered equivalent even if corresponding nodes are named differently. Default is 'false'.
byValue(val) boolean create
Indicates whether the comparison should consider the values of unconnected attributes. If true, two shading networks will be considered equivalent only if corresponding, unconnected attributes are the same type and have the same value. Only attributes of type 'int', 'bool', 'float', and 'string' will have their values compared. If false, two shading networks will be considered equivalent even if corresponding, unconnected attributes have different values or are different types. Default is 'true'.
delete(delete) boolean create
Deletes the specified comparison from memory.
equivalent(eq) boolean query
Returns an int. 1 if the shading networks in the specified comparison are equivalent. 0 otherwise.
network1(n1) boolean query
Returns a string[]. Returns an empty string array if the shading networks in the specified comparison are not equivalent. Otherwise returns the nodes in the first shading network.
network2(n2) boolean query
Returns a string[]. Returns an empty string array if the shading networks in the specified comparison are not equivalent. Otherwise returns the nodes in the second shading network.
upstreamOnly(up) boolean create
Indicates whether the comparison should consider nodes which are connected downstream from shading network nodes. If true, only those nodes which are upstream from the shading group will be considered. If, following only downstream connections, there is no connection path from a node to one of the shader attributes on the shading group, the node will not be considered. If false, a node will be considered if a connection path can found, following either upstream or downstream connections, which terminates with an input connection to one of the shading groups shader attributes. These dangling nodes do not directly contribute to the color, displacement, or volume characteristics of the shading group. Default is 'false'.

Flag can appear in Create mode of command Flag can appear in Edit mode of command
Flag can appear in Query mode of command Flag can have multiple arguments, passed either as a tuple or a list.

Python examples

import maya.cmds as cmds

cmds.shadingNetworkCompare( 'blinn1SG', 'blinn2SG' )
# Result: shadingNetworkComparison1
cmds.shadingNetworkCompare( 'shadingNetworkComparison1', query=True, equivalent=True )
# Result: 1
cmds.shadingNetworkCompare( 'shadingNetworkComparison1', query=True, network1=True )
# Result: blinn1SG blinn1
cmds.shadingNetworkCompare( 'shadingNetworkComparison1', delete=True )