static void
make_animation (ssgBranch * model,
+ const char * name,
vector<SGPropertyNode_ptr> &name_nodes,
SGPropertyNode_ptr node)
{
SG_LOG(SG_INPUT, SG_WARN, "Unknown animation type " << type);
}
+ if (name != 0)
+ animation->setName((char *)name);
+
ssgEntity * object;
if (name_nodes.size() > 0) {
object = find_named_node(model, name_nodes[0]->getStringValue());
animation = 0;
}
ssgBranch * oldParent = object->getParent(0);
- std::cerr << "Moving " << name << " to new parent\n";
branch->addKid(object);
oldParent->removeKid(object);
- std::cerr << " leaf has " << object->getNumParents() << " parents\n";
- std::cerr << " branch has " << branch->getNumKids() << " kids\n";
}
branch->setUserData(animation);
vector<SGPropertyNode_ptr> animation_nodes = props.getChildren("animation");
unsigned int i;
for (i = 0; i < animation_nodes.size(); i++) {
+ const char * name = animation_nodes[i]->getStringValue("name", 0);
vector<SGPropertyNode_ptr> name_nodes =
animation_nodes[i]->getChildren("object-name");
- make_animation(model, name_nodes, animation_nodes[i]);
+ make_animation(model, name, name_nodes, animation_nodes[i]);
}
// Load panels