diff --git a/components/resource/keyframemanager.cpp b/components/resource/keyframemanager.cpp index d084d6a08e..421b0ddf7b 100644 --- a/components/resource/keyframemanager.cpp +++ b/components/resource/keyframemanager.cpp @@ -23,12 +23,6 @@ namespace OsgAOpenMW { if (node.libraryName() == std::string("osgAnimation") && node.className() == std::string("Bone") && node.getName() == std::string("root")) { - if (!mAnimationManager) - { - traverse(node); - return; - } - osg::ref_ptr callback = new OsgaController::KeyframeController(); std::vector emulatedAnimations; @@ -125,8 +119,11 @@ namespace Resource { osg::ref_ptr scene = const_cast ( mSceneManager->getTemplate(normalized).get() ); osg::ref_ptr bam = dynamic_cast (scene->getUpdateCallback()); - OsgAOpenMW::RetrieveAnimationsVisitor rav(*loaded.get(), bam); - scene->accept(rav); + if (bam) + { + OsgAOpenMW::RetrieveAnimationsVisitor rav(*loaded.get(), bam); + scene->accept(rav); + } } mCache->addEntryToObjectCache(normalized, loaded); return loaded;