ACTION_INIT(Action::WaypointSet);
ACTION_SET_NAME(Action::WaypointSet,"waypoint_set");
ACTION_INIT(Action::WaypointSet);
ACTION_SET_NAME(Action::WaypointSet,"waypoint_set");
ACTION_SET_TASK(Action::WaypointSet,"set");
ACTION_SET_CATEGORY(Action::WaypointSet,Action::CATEGORY_WAYPOINT);
ACTION_SET_PRIORITY(Action::WaypointSet,0);
ACTION_SET_VERSION(Action::WaypointSet,"0.0");
ACTION_SET_TASK(Action::WaypointSet,"set");
ACTION_SET_CATEGORY(Action::WaypointSet,Action::CATEGORY_WAYPOINT);
ACTION_SET_PRIORITY(Action::WaypointSet,0);
ACTION_SET_VERSION(Action::WaypointSet,"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(name=="value_node" && param.get_type()==Param::TYPE_VALUENODE)
{
value_node=ValueNode_Animated::Handle::cast_dynamic(param.get_value_node());
if(name=="value_node" && param.get_type()==Param::TYPE_VALUENODE)
{
value_node=ValueNode_Animated::Handle::cast_dynamic(param.get_value_node());
return static_cast<bool>(value_node);
}
if(name=="waypoint" && param.get_type()==Param::TYPE_WAYPOINT)
{
//NOTE: at the moment there is no error checking for multiple sets!!!
waypoints.push_back(param.get_waypoint());
return static_cast<bool>(value_node);
}
if(name=="waypoint" && param.get_type()==Param::TYPE_WAYPOINT)
{
//NOTE: at the moment there is no error checking for multiple sets!!!
waypoints.push_back(param.get_waypoint());
//check to see which valuenodes are going to override because of the time...
ValueNode_Animated::findresult timeiter;
//check to see which valuenodes are going to override because of the time...
ValueNode_Animated::findresult timeiter;
{
vector<Waypoint>::iterator oi = overwritten_waypoints.begin(),
oend = overwritten_waypoints.end();
{
vector<Waypoint>::iterator oi = overwritten_waypoints.begin(),
oend = overwritten_waypoints.end();
//find the value at the old time before we replace it
ValueNode_Animated::findresult timeiter;
timeiter = value_node->find_time(waypoint.get_time());
//find the value at the old time before we replace it
ValueNode_Animated::findresult timeiter;
timeiter = value_node->find_time(waypoint.get_time());
//we only want to track overwrites (not inplace modifications)
if(timeiter.second && waypoint.get_uid() == timeiter.first->get_uid())
{
//we only want to track overwrites (not inplace modifications)
if(timeiter.second && waypoint.get_uid() == timeiter.first->get_uid())
{
//if we've found a unique one then we need to erase it, but store it first
if(timeiter.second)
{
time_overwrite = true;
overwritten_wp = *timeiter.first;
//if we've found a unique one then we need to erase it, but store it first
if(timeiter.second)
{
time_overwrite = true;
overwritten_wp = *timeiter.first;
//add back in all the points that we removed before...
{
vector<Waypoint>::iterator oi = overwritten_waypoints.begin(),
//add back in all the points that we removed before...
{
vector<Waypoint>::iterator oi = overwritten_waypoints.begin(),