diff --git a/applications/osgviewer/osgviewer.cpp b/applications/osgviewer/osgviewer.cpp index 0bdcc3681..d868c3faa 100644 --- a/applications/osgviewer/osgviewer.cpp +++ b/applications/osgviewer/osgviewer.cpp @@ -112,7 +112,7 @@ int main(int argc, char** argv) while (arguments.read("-p",pathfile)) { osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(pathfile); - if (apm || !apm->valid()) + if (apm && !apm->getAnimationPath()->empty()) { apm->setTimeScale(animationSpeed); diff --git a/applications/present3D/present3D.cpp b/applications/present3D/present3D.cpp index f5cb84cf7..ca2c5840e 100644 --- a/applications/present3D/present3D.cpp +++ b/applications/present3D/present3D.cpp @@ -484,7 +484,7 @@ int main( int argc, char **argv ) while (arguments.read("-p",pathfile)) { osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(pathfile); - if (apm || !apm->valid()) + if (apm && !apm->getAnimationPath()->empty()) { unsigned int num = keyswitchManipulator->getNumMatrixManipulators(); keyswitchManipulator->addMatrixManipulator( keyForAnimationPath, "Path", apm ); diff --git a/examples/osgCMakeExample/main.cpp b/examples/osgCMakeExample/main.cpp index d790d3873..e7592c8be 100644 --- a/examples/osgCMakeExample/main.cpp +++ b/examples/osgCMakeExample/main.cpp @@ -113,7 +113,7 @@ int main(int argc, char** argv) while (arguments.read("-p",pathfile)) { osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(pathfile); - if (apm || !apm->valid()) + if (apm && !apm->getAnimationPath()->empty()) { apm->setTimeScale(animationSpeed); diff --git a/examples/osgCMakeExampleModern/main.cpp b/examples/osgCMakeExampleModern/main.cpp index d790d3873..e7592c8be 100644 --- a/examples/osgCMakeExampleModern/main.cpp +++ b/examples/osgCMakeExampleModern/main.cpp @@ -113,7 +113,7 @@ int main(int argc, char** argv) while (arguments.read("-p",pathfile)) { osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(pathfile); - if (apm || !apm->valid()) + if (apm && !apm->getAnimationPath()->empty()) { apm->setTimeScale(animationSpeed);