Ok I hope this helps someone with the same problem. I've been on
vacation and thinking about it non-stop and ta-da it works now.
If anyone has a cleaner way of doing it please let me know. This is
all I could come up with! Thanks for the help!
class setModelName : public osg::NodeVisitor {
public:
setModelName();
setModelName(const std::string &name) :
osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN) {
nodeName = name;
}
virtual void apply(osg::Node &node) {
// This makes sure the bones don't get renamed
if (node.getName() == "BlenderModel") {
node.setName(nodeName);
}
traverse(node);
}
private:
std::string nodeName;
};
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org