User guide
66
else if (name == "xform")
{
FnKat::GroupBuilder gb;
double translate[] = {0.0, 0.0, -10.0};
gb.set("translate",
FnKat::DoubleAttribute(translate,
3, 3));
gb.setGroupInherit(false);
return gb.build();
}
else if (name == "errorMessage"
&& !_errorMessage.empty())
{
return FnKat::StringAttribute(
_errorMessage);
}
return FnKat::Attribute(0x0);
}
In order to stop Katana from using an SGG plug-in for creating further scene graph locations, if an error in the
creation of locations and/or attributes occurs, the plug-in has to explicitly check for errors, and the getFirstChild()
and getNextSibling() functions of its context classes have to return 0x0, as shown in the following examples:
FnKat::ScenegraphContext*
CubeRootContext::getFirstChild() const
{
if (!_errorOccurred && _numCubes > 0)
{
return new CubeContext(_numCubes, 0);
}
return 0x0;
}
FnKat::ScenegraphContext*
CubeContext::getNextSibling() const
{
if (!_errorOccurred
&& _index < _numberOfCubes - 1)
{
8 SCENE GRAPH GENERATOR PLUG-INS | SGG PLUG-IN API CLASSES