User guide

9 Porting Plug-ins
This chapter covers information on how to port existing Scene Graph Generator and Attribute
Modifier Plugins to the new Op API in post-2.0v1 versions of Katana. This is assuming that you have
one or more SGG or AMP plug-ins that you have written yourself, and that you are familiar with their
workings.
Introduction
In Katana 1.x there are two APIs available for the creation of custom plug-ins that can process the scene. The Scene
Graph Generator (SGG) API allows you to create new locations, for example, a geometry cache reader, and the
Attribute Modifier Plugin API (AMP) lets you modify existing locations. This strong divide makes matters complicated
if you want to do both, as SGGs can’t see the incoming scene and AMPs can’t create new locations. Often you end up
with a tool requiring several nodes, and convoluted AttributeCopy steps to make the right data available. Ultimately,
it's not possible to write anything like a Merge node.
Fortunately, with Katana 2.0v1 and later versions, this is a thing of the past - thanks to the Op API. The Op API gives
you the same API that all Katana Ops are built on, and allows you to do more with less code than you could with the
old SGG and AMP plug-ins.
Both SGGs and AMPs are now replaced with Ops. You may prefer to read the chapter on the Op API on page176 It
outlines the key concepts of Geolib3, Ops, and the new Runtime, and understanding this is essential for porting
existing plug-ins to be used as Ops.
Implications for Existing Plug-ins
Katana 2.0v1 and later versions provide Ops that host either existing SGGs or AMPs. This means you can continue to
use your current code, albeit with a re-compile and some header updates, in these later versions. There are a few
caveats to using these existing plug-ins however. In particular, the name of a location is no longer an attribute, and
AMPs can't change the name of current location.
Ops Versus Scene Graph Generators
Probably the most significant differences between Ops and SGGs are that:
The purpose of an SGG is to generate Attribute data on demand, and provide iterators to the scene graph children
and peers of a location when requested, whereas the purpose of an Op is to cook all of the Attribute data that
defines a particular scene graph location and name any potential children the location has, and