Revert "Check for a Geometry node when attaching bodyparts"

This reverts commit 3fc8634206.
pull/280/head
scrawl 7 years ago
parent 47d6c5091f
commit a1e3fb7604

@ -1130,8 +1130,6 @@ namespace NifOsg
triShapeToGeometry(triShape, geometry, parentNode, composite, boundTextures, animflags); triShapeToGeometry(triShape, geometry, parentNode, composite, boundTextures, animflags);
} }
geometry->setName(triShape->name);
if (geometry->getDataVariance() == osg::Object::DYNAMIC) if (geometry->getDataVariance() == osg::Object::DYNAMIC)
{ {
// Add a copy, we will alternate between the two copies every other frame using the FrameSwitch // Add a copy, we will alternate between the two copies every other frame using the FrameSwitch
@ -1221,7 +1219,6 @@ namespace NifOsg
osg::ref_ptr<SceneUtil::RigGeometry> rig(new SceneUtil::RigGeometry); osg::ref_ptr<SceneUtil::RigGeometry> rig(new SceneUtil::RigGeometry);
rig->setSourceGeometry(geometry); rig->setSourceGeometry(geometry);
rig->setName(triShape->name);
const Nif::NiSkinInstance *skin = triShape->skin.getPtr(); const Nif::NiSkinInstance *skin = triShape->skin.getPtr();

@ -32,29 +32,29 @@ namespace SceneUtil
virtual void apply(osg::MatrixTransform& node) virtual void apply(osg::MatrixTransform& node)
{ {
traverse(node); applyNode(node);
}
virtual void apply(osg::Geometry& node)
{
applyNode(node);
} }
virtual void apply(osg::Node& node) virtual void apply(osg::Node& node)
{ {
traverse(node); applyNode(node);
} }
virtual void apply(osg::Group& node) virtual void apply(osg::Group& node)
{ {
traverse(node); applyNode(node);
} }
virtual void apply(osg::Geometry& geom) void applyNode(osg::Node& node)
{ {
std::string lowerName = Misc::StringUtils::lowerCase(geom.getName()); std::string lowerName = Misc::StringUtils::lowerCase(node.getName());
if ((lowerName.size() >= mFilter.size() && lowerName.compare(0, mFilter.size(), mFilter) == 0) if ((lowerName.size() >= mFilter.size() && lowerName.compare(0, mFilter.size(), mFilter) == 0)
|| (lowerName.size() >= mFilter2.size() && lowerName.compare(0, mFilter2.size(), mFilter2) == 0)) || (lowerName.size() >= mFilter2.size() && lowerName.compare(0, mFilter2.size(), mFilter2) == 0))
{ mToCopy.push_back(&node);
osg::Node* node = &geom; else
while (node && node->getNumParents() && !node->getStateSet()) traverse(node);
node = node->getParent(0);
if (node)
mToCopy.push_back(node);
}
} }
void doCopy() void doCopy()

Loading…
Cancel
Save