User guide
187
}
interface.execOp(opType.getValue("", false), opArgs);
}
}
The deleteSelf() Function
void deleteSelf();
Thus far, we have only seen mechanisms to add data to the scene graph, but the deleteSelf() function and the
associated function deleteChild() allow you to remove locations from the scene graph. Their behavior is self-
explanatory but their side effects are less intuitive and are explained fully in Reading Scene Graph Input. For now,
however, an example for what a Prune Op may look like by using the deleteSelf() function call is shown below:
// Use CEL Utility function to evaluate CEL expression
FnAttribute::StringAttribute celAttr = interface.getOpArg("CEL");
if (!celAttr.isValid())
return;
Foundry::Katana::MatchesCELInfo info;
Foundry::Katana::MatchesCEL(info, interface, celAttr);
if (!info.matches)
return;
// Otherwise, delete myself
interface.deleteSelf();
return;
The stopChildTraversal() Function
void stopChildTraversal();
The stopChildTraversal() function is one of the functions that allows you to control on which locations your Op is
run. It stops the execution of this Op at any child of the current location being evaluated. It is best explained by way
of example.
Say we have an input scene:
/root
/world
/light
Say what we want is:
/root
/world
24 OP API | THE OP API EXPLAINED