pymel.core.rendering.shadingNetworkCompare

shadingNetworkCompare(*args, **kwargs)

This command allows you to compare two shading networks.

Flags:
Long name (short name) Argument Types Properties
byName (nam) bool ../../../_images/create.gif
 

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) bool ../../../_images/create.gif
 

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) bool ../../../_images/create.gif
 
Deletes the specified comparison from memory. Flag can have multiple arguments, passed either as a tuple or a list.
equivalent (eq) bool ../../../_images/query.gif
 
Returns an int. 1 if the shading networks in the specified comparison are equivalent. 0 otherwise.
network1 (n1) bool ../../../_images/query.gif
 

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) bool ../../../_images/query.gif
 

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) bool ../../../_images/create.gif
 

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’.

Derived from mel command maya.cmds.shadingNetworkCompare

Example:

import pymel.core as pm

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

Previous topic

pymel.core.rendering.shadingConnection

Next topic

pymel.core.rendering.shadingNode

Core

Core Modules

Other Modules

This Page