SuperTools

Introduction to SuperTools

TBD

Using SuperTools in the NetworkMaterial Node Graph Context

In order to allow your SuperTool to be used in the NetworkMaterial Context, and to expose it in the Node Graph tab’s layered menus, you must apply the context’s Node Flavor:

>>> NodegraphAPI.AddNodeFlavor(<SuperToolTypeName>, NodegraphAPI.Context.NetworkMaterial)

Additionally if your SuperTool should only be used in association with a particular renderer, you should also add the following Node Flavor:

>>> NodegraphAPI.AddNodeFlavor(<SuperToolTypeName>, <rendererName>)

If this flavor is added, it will only appear in the Node Graph tab’s layered menu when the renderer set in the context matches that of the SuperTool.

Alternatively, if your SuperTool can be used with all shading nodes types, you should add the following Node Flavor:

>>> NodegraphAPI.AddNodeFlavor(<SuperToolTypeName>, NodegraphAPI.Flavor.Predefined.RendererAgnostic)
NodegraphAPI.RegisterSuperTool(name, superToolClass)

Register a new SuperTool. Give the name of the node and a class derived from SuperTool.

class NodegraphAPI.SuperTool

Bases: PythonGroupNode

Class used for super tool plugins. Each SuperTool instance is attached to a SuperTool delegate. The delegate is a set of functions that are presented as methods on the SuperTool instance.

__init__()

Called to initialize a newly created supertool node. This is not called for loading existing nodes. It must not call the base class constructor.

getNodesCreatingSceneGraphLocations()
Return type:list of NodegraphAPI.Node or None
Returns:A list of internal nodes that implement getScenegraphLocation() and are desirable to access from outside of the SuperTool.
Since:Katana 4.0v1
hideNodegraphGroupControls()

Remove the group-like controls for this node from the Node Graph tab. Should be called from the init method.

isChildNodePersistent(node)
Parameters:node (NodegraphAPI.Node) – A child node of the SuperTool.
Return type:bool
Returns:True if the child node should be saved to the Katana document, otherwise False.
polish()

This method is automatically called on the SuperTool after it has finished loading and initialization. It will only be called once.

classmethod superToolRegistered()