User guide
14 Resolvers
Resolvers are filters that need to be run before actual rendering in order to get data into the correct final form.
Typically they are used for things like material assignments, executing overrides, and calculating the effects of
constraints.
As previously discussed, the only data the can be passed from one filter to the next is the scene graph with its
attributes. Resolvers are procedural processes that can be executed purely based on attribute data, which then
allows us to separate executing procedural process into two stages:
1.Set up appropriate attributes in the scene graph which define what process to run and any parameters that need
to be handed to the procedural.
2.Run a resolver that reads those attributes and executes the procedural process.
This separation into two stages gives us a lot more flexibility than if all procedural processes had to be executed
immediately. Because they are only dependent on the correct attributes being set at locations in the scene the
configuration to set up the process can be done in variety of different ways.
For instance, material assignment is based on a single string attribute called materialAssign which gives the path to
the location for the material to be used. This attribute is then used in a resolver called MaterialResolve which takes
that material from that path and creates a local copy of the material with all the relevant attributes set to their
correct values taking into account things like material overrrides. Because MaterialResolve only looks for an attribute
called materialAssign we can set up material assignment in a number of different ways:
• Using MaterialAssign nodes, which simply set the materialAssign attribute at locations that match the CEL
expression on the node.
• Using an AttributeScript to set the value of materialAssign using a Python script.
• Using a custom C++ procedural, such as a Scene Graph Generator or Attribute Modifier, that set the values of
'materialAssign' appropriately.
You can also use a LookFile that resolves the correct value for materialAssign onto given objects.
NOTE: Using a LookFile, material assignment is resolved, rather than just setting the materialAssign
attribute. The materialAssign attribute does not survive the processing that occurs in a LookFileResolve
node.
Resolvers allow us to keep the data high-level and user meaningful as possible since until the resolver runs the user
can directly manipulate the attributes that describe how the process should run instead of only being able to
manipulate the data that comes out of the process.
For instance, since material assignment is only based on the materialAssign attribute we can:
• Change what material an object gets by just changing that one attribute values.