- SGAnimation * animation = 0;
- const char * type = node->getStringValue("type", "none");
- if (!strcmp("none", type)) {
- animation = new SGNullAnimation(node);
- } else if (!strcmp("range", type)) {
- animation = new SGRangeAnimation(prop_root, node);
- } else if (!strcmp("billboard", type)) {
- animation = new SGBillboardAnimation(node);
- } else if (!strcmp("select", type)) {
- animation = new SGSelectAnimation(prop_root, node);
- } else if (!strcmp("spin", type)) {
- animation = new SGSpinAnimation(prop_root, node, sim_time_sec );
- } else if (!strcmp("timed", type)) {
- animation = new SGTimedAnimation(node);
- } else if (!strcmp("rotate", type)) {
- animation = new SGRotateAnimation(prop_root, node);
- } else if (!strcmp("translate", type)) {
- animation = new SGTranslateAnimation(prop_root, node);
- } else if (!strcmp("scale", type)) {
- animation = new SGScaleAnimation(prop_root, node);
- } else if (!strcmp("texrotate", type)) {
- animation = new SGTexRotateAnimation(prop_root, node);
- } else if (!strcmp("textranslate", type)) {
- animation = new SGTexTranslateAnimation(prop_root, node);
- } else if (!strcmp("texmultiple", type)) {
- animation = new SGTexMultipleAnimation(prop_root, node);
- } else if (!strcmp("blend", type)) {
- animation = new SGBlendAnimation(prop_root, node);
- } else if (!strcmp("alpha-test", type)) {
- animation = new SGAlphaTestAnimation(node);
- } else if (!strcmp("flash", type)) {
- animation = new SGFlashAnimation(node);
- } else if (!strcmp("dist-scale", type)) {
- animation = new SGDistScaleAnimation(node);
- } else {
- animation = new SGNullAnimation(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());
- if (object == 0) {
- SG_LOG(SG_INPUT, SG_ALERT, "Object " << name_nodes[0]->getStringValue()
- << " not found");
- delete animation;
- animation = 0;