User guide
182
You can find concrete examples of the above concepts in the $KATANA_HOME/plugins/Src/Ops directory where
the source code for a number of core Ops is kept. Below is a brief overview of some of these Ops, and examples of
where they are currently used:
• AttributeCopy - provides the implementation for the AttributeCopy node, which copies attributes at locations from
one branch of a scene to another.
• AttributeSet - the back-end to the AttributeSet node, it allows you to set, change, and delete attributes at arbitrary
locations in the incoming scene graph.
• HierarchyCopy - like the AttributeSet Op, it's the back-end to the HierarchyCopy node, allowing you to copy
arbitrary portions of scene graph hierarchy to other parts of the scene graph.
• Prune - removes any locations that match the CEL expression you provide from the scene.
• StaticSceneCreate - produces a static hierarchy based on a set of arguments you provide. This Op is the core of
HierarchyCreate, and is used extensively by other Ops and nodes to produce the hierarchies of locations and
attributes that they need. For example, the CameraCreate node uses a StaticSceneCreate Op to produce the
required hierarchy for a camera location.
The Cook Interface
The cook interface is the interface Geolib3 provides to implement your Op’s functionality. You are passed a valid
instance of this interface when your Op’s cook() method is called. As discussed above, this interface provides
methods that allow you to interrogate arguments, create or modify scene graph topology, and read scene graph
input. You can find a full list of the available methods on the cook interface in $KATANA_HOME/plugin_
apis/include/FnGeolib/op/FnGeolibCookInterface.h.
Op Arguments
As discussed previously, Ops are provided with two forms of input: scene graph input created by upstream Ops and
Op arguments, which are passed to the Op to configure how it should run. Examples of user arguments include CEL
statements describing the locations where the Op should run, a file path pointing to a geometry cache that should be
loaded, or a list of child locations the Op should create.
We’ll first look at the simple case of interrogating arguments and then look at a common pattern of recursively
passing arguments down to child locations.
Reading Arguments
Arguments are passed to your Op as instances of the FnAttribute class. The cook interface has the following
function call to retrieve Op arguments:
FnAttribute::Attribute getOpArg(
const std::string& specificArgName = std::string()) const;
24 OP API | THE OP API EXPLAINED