Skip to content

Commit

Permalink
Remove rename from RenameBonesVisitor, rename to RenameAnimCallbacksV…
Browse files Browse the repository at this point in the history
…isitor
  • Loading branch information
cykoder committed Apr 19, 2024
1 parent d09f32d commit b7aa3b9
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions components/resource/scenemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -383,18 +383,16 @@ namespace Resource
}
}

class RenameBonesVisitor : public osg::NodeVisitor
class RenameAnimCallbacksVisitor : public osg::NodeVisitor
{
public:
RenameBonesVisitor()
RenameAnimCallbacksVisitor()
: osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN)
{
}

void apply(osg::MatrixTransform& node) override
{
node.setName(Misc::StringUtils::underscoresToSpaces(node.getName()));

// osgAnimation update callback name must match bone name/channel targets
osg::Callback* cb = node.getUpdateCallback();
while (cb)
Expand Down Expand Up @@ -687,7 +685,7 @@ namespace Resource
{
// 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
Resource::RenameBonesVisitor renameBoneVisitor;
Resource::RenameAnimCallbacksVisitor renameBoneVisitor;
node->accept(renameBoneVisitor);

if (osg::Group* group = dynamic_cast<osg::Group*>(node))
Expand Down

0 comments on commit b7aa3b9

Please sign in to comment.