+ action->set_param("canvas",get_canvas());
+ action->set_param("canvas_interface",get_canvas_interface());
+ action->set_param("time",time);
+ action->set_param("new_value",(*parent_value_node->get_link(4))(time));
+ action->set_param("value_desc",ValueDesc(parent_value_node,5));
+
+ if(!action->is_ready())
+ throw Error(Error::TYPE_NOTREADY);
+
+ add_action(action);
+ }
+ else
+ {
+ // we are merging tangents
+
+ // the merged tangent should be the average of the 2 tangents we're merging
+ ValueBase average(((Vector)((*parent_value_node->get_link("t1"))(time)) +
+ (Vector)((*parent_value_node->get_link("t2"))(time))) / 2);
+
+ {
+ Action::Handle action(Action::create("value_desc_set"));
+
+ if(!action)
+ throw Error(_("Unable to find action value_desc_set (bug)"));
+
+ action->set_param("canvas",get_canvas());
+ action->set_param("canvas_interface",get_canvas_interface());
+ action->set_param("time",time);
+ action->set_param("new_value",average);
+ action->set_param("value_desc",ValueDesc(parent_value_node,4));
+
+ if(!action->is_ready())
+ throw Error(Error::TYPE_NOTREADY);
+
+ add_action(action);
+ }
+
+ {
+ Action::Handle action(Action::create("value_desc_set"));
+
+ if(!action)
+ throw Error(_("Unable to find action value_desc_set (bug)"));
+
+ action->set_param("canvas",get_canvas());
+ action->set_param("canvas_interface",get_canvas_interface());
+ action->set_param("time",time);
+ action->set_param("new_value",average);
+ action->set_param("value_desc",ValueDesc(parent_value_node,5));
+
+ if(!action->is_ready())
+ throw Error(Error::TYPE_NOTREADY);
+
+ add_action(action);
+ }
+ }