From 8b2bf12e8fa55327ac9896c741ef366993a87570 Mon Sep 17 00:00:00 2001 From: Nelsson Huotari Date: Tue, 15 Dec 2020 13:51:49 +0200 Subject: [PATCH] Use bip01 for root bone name --- apps/openmw/mwrender/animation.cpp | 2 -- components/resource/keyframemanager.cpp | 2 +- components/sceneutil/osgacontroller.cpp | 4 ++-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/apps/openmw/mwrender/animation.cpp b/apps/openmw/mwrender/animation.cpp index 8c9f5f493..f8ff3780d 100644 --- a/apps/openmw/mwrender/animation.cpp +++ b/apps/openmw/mwrender/animation.cpp @@ -782,8 +782,6 @@ namespace MWRender NodeMap::const_iterator found = nodeMap.find("bip01"); if (found == nodeMap.end()) found = nodeMap.find("root bone"); - if (found == nodeMap.end()) - found = nodeMap.find("root"); if (found != nodeMap.end()) mAccumRoot = found->second; diff --git a/components/resource/keyframemanager.cpp b/components/resource/keyframemanager.cpp index 0ffe59712..d739392e8 100644 --- a/components/resource/keyframemanager.cpp +++ b/components/resource/keyframemanager.cpp @@ -21,7 +21,7 @@ namespace Resource void RetrieveAnimationsVisitor::apply(osg::Node& node) { - if (node.libraryName() == std::string("osgAnimation") && node.className() == std::string("Bone") && node.getName() == std::string("root")) + if (node.libraryName() == std::string("osgAnimation") && node.className() == std::string("Bone") && node.getName() == std::string("bip01")) { osg::ref_ptr callback = new SceneUtil::OsgAnimationController(); diff --git a/components/sceneutil/osgacontroller.cpp b/components/sceneutil/osgacontroller.cpp index f0eb7da6f..37aa525af 100644 --- a/components/sceneutil/osgacontroller.cpp +++ b/components/sceneutil/osgacontroller.cpp @@ -83,7 +83,7 @@ namespace SceneUtil { osgAnimation::UpdateMatrixTransform* umt = dynamic_cast(cb); if (umt) - if (node.getName() != "root") link(umt); + if (node.getName() != "bip01") link(umt); cb = cb->getNestedCallback(); } @@ -133,7 +133,7 @@ namespace SceneUtil for (const auto& channel: channels) { - if (channel->getTargetName() != "root" || channel->getName() != "transform") continue; + if (channel->getTargetName() != "bip01" || channel->getName() != "transform") continue; if ( osgAnimation::MatrixLinearSampler* templateSampler = dynamic_cast (channel->getSampler()) ) {