User guide
184
The Op running at its current location will read a, c, and x. For each child GroupAttribute of c it creates a new child
location with the GroupAttribute’s name, for example, child1/child2, and pass the GroupAttribute as that location’s
arguments.
Creating a child in code makes use of the following key function call:
void createChild(const std::string& name,
const std::string& optype = "",
const FnAttribute::Attribute& args = FnAttribute::Attribute(),
ResetRoot resetRoot = ResetRootAuto,
void* privateData = 0x0,
void (*deletePrivateData)(void* data) = 0x0);
The createChild() function creates a child of the location where the Op is being evaluated at. The function also
instructs the Runtime the type of Op that should run there (by default, the same type of Op as the Op that called
createChild()) and the arguments that should be passed to it. In StaticSceneCreate this looks as follows:
for (int childindex = 0; childindex < c.getNumberOfChildren(); ++childindex)
{
std::string childName = c.getChildName(childindex);
FnAttribute::GroupAttribute childArgs = c.getChildByIndex(childindex);
interface.createChild(childName, "", childArgs);
}
Scene Graph Creation
One of the main tasks of an Op is to produce scene graph locations and attributes. The Op API offers a rich set of
functionality in order to do this. There are five key functions that can be used to modify scene graph topology and
control Op execution, which we'll explain below.
24 OP API | THE OP API EXPLAINED