diff --git a/examples/osganimationtimeline/osganimationtimeline.cpp b/examples/osganimationtimeline/osganimationtimeline.cpp index 0b9e5923d..58592b8da 100644 --- a/examples/osganimationtimeline/osganimationtimeline.cpp +++ b/examples/osganimationtimeline/osganimationtimeline.cpp @@ -1,5 +1,5 @@ /* -*-c++-*- - * Copyright (C) 2008 Cedric Pinson + * Copyright (C) 2008 Cedric Pinson * * This library is open source and may be redistributed and/or modified under * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or @@ -157,22 +157,26 @@ struct ExampleTimelineUsage : public osgGA::GUIEventHandler int main (int argc, char* argv[]) { - std::cerr << "This example works only with osgAnimation/nathan.osg" << std::endl; + std::cerr << "This example works only with nathan.osg" << std::endl; osg::ArgumentParser psr(&argc, argv); osgViewer::Viewer viewer(psr); - std::string file = "osgAnimation/nathan.osg"; + std::string file = "nathan.osg"; if(argc >= 2) file = psr[1]; // replace the manager osg::Group* root = dynamic_cast(osgDB::readNodeFile(file)); + if (!root) { + osg::notify(osg::FATAL) << "can't read file " << file << std::endl; + return 1; + } osgAnimation::AnimationManagerBase* animationManager = dynamic_cast(root->getUpdateCallback()); if(!animationManager) { - std::cerr << "Did not find AnimationManagerBase updateCallback needed to animate elements" << std::endl; + osg::notify(osg::FATAL) << "Did not find AnimationManagerBase updateCallback needed to animate elements" << std::endl; return 1; }