From 68d44ac1032eec257edec44f925efe68e4002163 Mon Sep 17 00:00:00 2001 From: david Date: Sun, 3 Nov 2002 15:48:08 +0000 Subject: [PATCH] Removed debug print statements. Added ability to set a name for an animation and refer to it in subsequent animations. --- src/Model/model.cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Model/model.cxx b/src/Model/model.cxx index 88490eec3..026438332 100644 --- a/src/Model/model.cxx +++ b/src/Model/model.cxx @@ -174,6 +174,7 @@ read_interpolation_table (SGPropertyNode_ptr props) static void make_animation (ssgBranch * model, + const char * name, vector &name_nodes, SGPropertyNode_ptr node) { @@ -198,6 +199,9 @@ make_animation (ssgBranch * model, 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()); @@ -223,11 +227,8 @@ make_animation (ssgBranch * model, 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); @@ -295,9 +296,10 @@ fgLoad3DModel (const string &path) vector 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 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 -- 2.39.5