1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-10-16 13:16:33 +00:00

Remove rename from RenameBonesVisitor, rename to RenameAnimCallbacksVisitor

This commit is contained in:
Sam Hellawell 2024-04-19 07:48:26 +01:00
parent d09f32d9e4
commit b7aa3b9f47

View file

@ -383,18 +383,16 @@ namespace Resource
} }
} }
class RenameBonesVisitor : public osg::NodeVisitor class RenameAnimCallbacksVisitor : public osg::NodeVisitor
{ {
public: public:
RenameBonesVisitor() RenameAnimCallbacksVisitor()
: osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN) : osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN)
{ {
} }
void apply(osg::MatrixTransform& node) override void apply(osg::MatrixTransform& node) override
{ {
node.setName(Misc::StringUtils::underscoresToSpaces(node.getName()));
// osgAnimation update callback name must match bone name/channel targets // osgAnimation update callback name must match bone name/channel targets
osg::Callback* cb = node.getUpdateCallback(); osg::Callback* cb = node.getUpdateCallback();
while (cb) while (cb)
@ -687,7 +685,7 @@ namespace Resource
{ {
// Collada bones may have underscores in place of spaces due to a collada limitation // Collada bones may have underscores in place of spaces due to a collada limitation
// we should rename the bones and update callbacks here at load time // we should rename the bones and update callbacks here at load time
Resource::RenameBonesVisitor renameBoneVisitor; Resource::RenameAnimCallbacksVisitor renameBoneVisitor;
node->accept(renameBoneVisitor); node->accept(renameBoneVisitor);
if (osg::Group* group = dynamic_cast<osg::Group*>(node)) if (osg::Group* group = dynamic_cast<osg::Group*>(node))