User guide

22
Editing Rules
You can edit rules and add new ones by overwriting list entries using Nodes2DAPI.NodeColorDelegate. For
example, to edit the color associated with the flavor composite to pure red, enter the following in the Python tab:
Nodes2DAPI.NodeColorDelegate.rules[ 2 ] = ( 'composite', ( 0, 0, 1 ) )
Creating New Rules
You can create a new rule using:
NodegraphAPI.Flavor.AddNodeFlavor( 'nodeName', 'flavorName')
To append a rule to the active rules use:
import Nodes2DAPI.NodeColorDelegate
Nodes2DAPI.NodeColorDelegate.rules.append( 'nodeName', 'flavorName' )
Editing Flavors
Flavors are collections of node types. You can see a list of all flavors in use in a recipe by entering:
print( NodegraphAPI.GetAllFlavors() )
You should see something like the following, which is a list of the flavors defined with Katana, as shipped:
[ '2d', '3d', '_dap', '_hide', '_macro', '_supertool', 'analysis', 'color',
'composite', 'constraint', 'filter', 'i/o', 'input', 'lookfile', 'output',
'procedural', 'resolve', 'source', 'transform' ]
You can see a list of all nodes that comprise a particular flavor by entering:
NodegraphAPI.GetFlavorNodes( 'flavorName' )
For example, to see a list of all nodes in the flavor color, enter:
print( NodegraphAPI.GetFlavorNodes( 'color' ) )
You should see something like the following, which is a list of the members of the flavor color with Katana, as
shipped:
['ImageBrightness', 'ImageBackgroundColor', 'ImageChannels', 'ImageContrast',
'ImageExposure', 'ImageFade', 'ImageGain', 'ImageGamma', 'ImageInvert',
'OCIOCDLTransform', 'OCIOColorSpace', 'OCIODisplay', 'OCIOFileTransform',
'OCIOLogConvert', 'OCIOLookTransform', 'ImageSaturation', 'ImageClamp', 'ImageLevels',
'ImagePixelStats', 'ImageThreshold']
NOTE: Flavor assignments are stored on the node itself, and each node can have multiple assignments. If
competing rules overlap on the same node type, the first rule applied wins.
4 CUSTOM NODE COLORS |