From eaedf3497554a7fa3c6226098e386263a1bf6dae Mon Sep 17 00:00:00 2001 From: Alexei Dobrohotov Date: Sat, 10 Aug 2019 19:21:36 +0300 Subject: [PATCH] Fix ventriloquism --- components/nifosg/nifloader.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/components/nifosg/nifloader.cpp b/components/nifosg/nifloader.cpp index ac7d883d5..c23dc0c44 100644 --- a/components/nifosg/nifloader.cpp +++ b/components/nifosg/nifloader.cpp @@ -1118,16 +1118,6 @@ namespace NifOsg ctrl = static_cast(nifNode)->controller; else ctrl = static_cast(nifNode)->controller; - handleMorphController(ctrl, drawable, geom, parentNode, composite, boundTextures, animflags); - - if (!drawable.get()) - drawable = geom; - drawable->setName(nifNode->name); - parentNode->addChild(drawable); - } - - void handleMorphController(Nif::ControllerPtr ctrl, osg::Drawable *drawable, osg::ref_ptr geom, osg::Node* parentNode, SceneUtil::CompositeStateSetUpdater* composite, const std::vector& boundTextures, int animflags) - { for (; !ctrl.empty(); ctrl = ctrl->next) { if (!(ctrl->flags & Nif::NiNode::ControllerFlag_Active)) @@ -1143,6 +1133,10 @@ namespace NifOsg break; } } + if (!drawable.get()) + drawable = geom; + drawable->setName(nifNode->name); + parentNode->addChild(drawable); } osg::ref_ptr handleMorphGeometry(const Nif::NiGeomMorpherController* morpher, osg::ref_ptr sourceGeometry, osg::Node* parentNode, SceneUtil::CompositeStateSetUpdater* composite, const std::vector& boundTextures, int animflags)