**
** This package is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License as
**
** This package is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License as
/* === M A C R O S ========================================================= */
ACTION_INIT(Action::WaypointAdd);
/* === M A C R O S ========================================================= */
ACTION_INIT(Action::WaypointAdd);
-ACTION_SET_NAME(Action::WaypointAdd,"waypoint_add");
-ACTION_SET_LOCAL_NAME(Action::WaypointAdd,"Add Waypoint");
+ACTION_SET_NAME(Action::WaypointAdd,"WaypointAdd");
+ACTION_SET_LOCAL_NAME(Action::WaypointAdd,N_("Add Waypoint"));
ACTION_SET_TASK(Action::WaypointAdd,"add");
ACTION_SET_CATEGORY(Action::WaypointAdd,Action::CATEGORY_WAYPOINT);
ACTION_SET_PRIORITY(Action::WaypointAdd,0);
ACTION_SET_VERSION(Action::WaypointAdd,"0.0");
ACTION_SET_TASK(Action::WaypointAdd,"add");
ACTION_SET_CATEGORY(Action::WaypointAdd,Action::CATEGORY_WAYPOINT);
ACTION_SET_PRIORITY(Action::WaypointAdd,0);
ACTION_SET_VERSION(Action::WaypointAdd,"0.0");
ret.push_back(ParamDesc("value_node",Param::TYPE_VALUENODE)
.set_local_name(_("Destination ValueNode (Animated)"))
);
ret.push_back(ParamDesc("value_node",Param::TYPE_VALUENODE)
.set_local_name(_("Destination ValueNode (Animated)"))
);
- if(candidate_check(get_param_vocab(),x))
- {
- if(!ValueNode_Animated::Handle::cast_dynamic(x.find("value_node")->second.get_value_node()))
- return false;
-
- // We need either a waypoint or a time.
- if(x.count("waypoint") || x.count("time"))
- return true;
- }
- return false;
+ return (candidate_check(get_param_vocab(),x) &&
+ // We need an animated valuenode.
+ ValueNode_Animated::Handle::cast_dynamic(x.find("value_node")->second.get_value_node()) &&
+ // We need either a waypoint or a time.
+ (x.count("waypoint") || x.count("time")));
return static_cast<bool>(value_node);
}
if(name=="waypoint" && param.get_type()==Param::TYPE_WAYPOINT && !time_set)
{
waypoint=param.get_waypoint();
return static_cast<bool>(value_node);
}
if(name=="waypoint" && param.get_type()==Param::TYPE_WAYPOINT && !time_set)
{
waypoint=param.get_waypoint();
// a waypoint. In this case, we need to calculate the value
// of the waypoint
void
Action::WaypointAdd::calc_waypoint()
// a waypoint. In this case, we need to calculate the value
// of the waypoint
void
Action::WaypointAdd::calc_waypoint()
waypoint.mimic(original);
waypoint.set_before(synfigapp::Main::get_interpolation());
waypoint.set_after(synfigapp::Main::get_interpolation());
waypoint.mimic(original);
waypoint.set_before(synfigapp::Main::get_interpolation());
waypoint.set_after(synfigapp::Main::get_interpolation());
/*
ValueNode_Animated::WaypointList &waypoint_list(value_node->waypoint_list());
ValueNode_Animated::WaypointList::iterator iter;
/*
ValueNode_Animated::WaypointList &waypoint_list(value_node->waypoint_list());
ValueNode_Animated::WaypointList::iterator iter;
for(iter=waypoint_list.begin();iter!=waypoint_list.end();++iter)
{
const Real dist(abs(iter->get_time()-time));
for(iter=waypoint_list.begin();iter!=waypoint_list.end();++iter)
{
const Real dist(abs(iter->get_time()-time));