1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-03-03 17:49:41 +00:00

Don't incorrectly discard root node transformation (Fixes #4272)

This commit is contained in:
scrawl 2017-12-31 23:49:43 +00:00
parent 57257d057f
commit c920f95d1e
No known key found for this signature in database
GPG key ID: 2E6CC3676024C402

View file

@ -268,7 +268,7 @@ namespace NifOsg
osg::ref_ptr<SceneUtil::Skeleton> 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;