Hi,
I have a osg-file with "UpdateCallbacks":
------------------------------------------------------------
[...]
MatrixTransform {
DataVariance DYNAMIC
name "Kugel01"
nodeMask 0xff
cullingActive TRUE
UpdateCallbacks {
AnimationPathCallback {
DataVariance DYNAMIC
[...]
I load the file with the line: osg::ref_ptr< ::osg::Node > fileScene
= osgDB::readNodeFile(path);
I see the scene, but the fileScene has no UpdateCallback. What is my
mistake? Anybody an idea? When I load the viel with the
"osg/bin/osgviewer" then it works fine?
I have write a NodeVisitor to check the UpdateCallback:
---------------------------------------------------------------------------------
class FindUpdateCallback : public osg::NodeVisitor
{
public:
FindUpdateCallback():osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN)
{
}
virtual void apply(osg::Node& node)
{
::osg::ref_ptr< ::osg::NodeCallback> ucb =
node.getUpdateCallback();
if(ucb.valid()) std::cout << "YES" << std::endl;
else std::cout << "NO" << std::endl;
traverse(node);
}
virtual void apply(osg::MatrixTransform& node)
{
apply((osg::Node&)node);
}
virtual void apply(osg::Group& node)
{
apply((osg::Node&)node);
}
virtual void apply(osg::Geode& node)
{
apply((osg::Node&)node);
}
};
It prints always "NO".
Cheers,
Martin
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org