Search Tips

Search is based on keyword.

`Ex: "Procedures"`

Do not search with natural language

`Ex: "How do I write a new procedure?"`

Give Feedback Support Portal

# Creating Your Own Resolvers

# Custom Resolvers in the Node Graph

You can use OpScripts or custom Ops to create your own resolvers, including having them run implicitly.

There are a number of modes available for OpScript, GenericOp, and Op execution. These are controlled by the resolveIds values in the attributes. There are two modes available for the execution mode:

• immediate - the script/Op is run at the locations specified in the applyWhere parameter as it is evaluated at this node's point in the node graph.

• deferred - the script/Op is set up by this node but won't actually be run until a later node in the node graph, as specified by the applyWhen parameter.

And depending on what you choose, you have the option to set where or when the script/Op is run. When the execution mode is immediate, the applyWhere parameter can be set:

• at all locations - at all the locations in the node graph.

• at specific location - at only the location specified by the location parameter. If this location doesn't exist, it is created automatically.

• at locations matching CEL - at only those locations in the node graph that match the CEL statements.

When the execution mode is deferred, the applyWhen parameter can be set:

• during op resolve - the script/Op and its arguments are added as attributes to be executed later by an OpResolve node. If the Op isn't run by an explicit OpResolve node placed in the node graph, it is automatically run at render time by the implicit resolvers.

• during material resolve - the script/Op and its arguments are added as attributes under the material.ops group attribute. This is primarily intended for material scene graph locations, allowing the material to specify a procedural process that is run at every location that the material is assigned to. The script/Op is run as part of the material resolve process, and is executed just after the initial values for the material shader are created at the location. Examples of its use include randomizing or procedural control over shader parameters.

• during katana look file resolve - the script/Op and its arguments are added as attributes under the ops group attribute and are evaluated by a LookFileResolve node or by the first implicit resolver if no LookFileResolve node is present.

For more information on OpScripts, see the Working with Attributes section. For more information on GenericOp and Op API, refer to The Op API.

# Custom Implicit Resolvers

Custom implicit resolvers can also be made persistent across the Katana session, without the need for additional nodes in the node graph. The Nodes3DAPI module provides the RegisterImplicitResolver() function for this purpose, with the following signature:

RegisterImplicitResolver(stage, opType, opArgs, addSystemArgs=False)

The stage parameter determines where the new resolver should be inserted in the chain of implicit resolvers. The stages are described in Implicit Resolvers. Its value should be one of:

• ImplicitResolverStage.BeforePreprocessResolvers

• ImplicitResolverStage.BeforeStandardResolvers

• ImplicitResolverStage.AfterStandardResolvers

• ImplicitResolverStage.AfterPostprocessResolvers

Op types, args, and system args are described in The Op API.

Note: See more in the Katana Developer Guide: Attribute Conventions - Ops and Proxies.