From c920f95d1ec24806ed1547d85ce304bc4f7c876d Mon Sep 17 00:00:00 2001 From: scrawl <720642+scrawl@users.noreply.github.com> Date: Sun, 31 Dec 2017 23:49:43 +0000 Subject: [PATCH] Don't incorrectly discard root node transformation (Fixes #4272) --- components/nifosg/nifloader.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/nifosg/nifloader.cpp b/components/nifosg/nifloader.cpp index a3b81338e..6e04c6405 100644 --- a/components/nifosg/nifloader.cpp +++ b/components/nifosg/nifloader.cpp @@ -268,7 +268,7 @@ namespace NifOsg osg::ref_ptr skel = new SceneUtil::Skeleton; osg::Group* root = created->asGroup(); - if (root && root->getDataVariance() == osg::Object::STATIC) + if (root && root->getDataVariance() == osg::Object::STATIC && !root->asTransform()) { skel->setStateSet(root->getStateSet()); skel->setName(root->getName()); @@ -440,7 +440,7 @@ namespace NifOsg // The Root node can be created as a Group if no transformation is required. // This takes advantage of the fact root nodes can't have additional controllers // loaded from an external .kf file (original engine just throws "can't find node" errors if you try). - if (!nifNode->parent && nifNode->controller.empty()) + if (!nifNode->parent && nifNode->controller.empty() && nifNode->trafo.isIdentity()) { node = new osg::Group; dataVariance = osg::Object::STATIC;