Exemplo n.º 1
0
bool
Action::KeyframeSet::set_param(const synfig::String& name, const Action::Param &param)
{
	if(name=="keyframe" && param.get_type()==Param::TYPE_KEYFRAME)
	{
		synfig::info("KeyframeSet::set_param():old_time: %s",keyframe.get_time().get_string().c_str());
		keyframe=param.get_keyframe();
		synfig::info("KeyframeSet::set_param():new_time: %s",keyframe.get_time().get_string().c_str());
		synfig::info("KeyframeSet::set_param():get_keyframe(): %s",param.get_keyframe().get_time().get_string().c_str());

		return true;
	}

	return Action::CanvasSpecific::set_param(name,param);
}
Exemplo n.º 2
0
bool
Action::KeyframeDuplicate::set_param(const synfig::String& name, const Action::Param &param)
{
	if(name=="keyframe" && param.get_type()==Param::TYPE_KEYFRAME)
	{
		keyframe=param.get_keyframe();
		new_keyframe.set_description(keyframe.get_description()+_(" (Duplicate)"));

		//! TODO add and use keyframe::operator=

		//! Copy the kf's Waypoint::model is exist
		if(keyframe.has_model())
		    new_keyframe.apply_model(keyframe.get_waypoint_model());
		//! Copy the active status
		new_keyframe.set_active(keyframe.active());

		return true;
	}
	if(name=="time" && param.get_type()==Param::TYPE_TIME)
	{
		new_keyframe.set_time(param.get_time());

		return true;
	}

	return Action::CanvasSpecific::set_param(name,param);
}
Exemplo n.º 3
0
bool
Action::KeyframeAdd::set_param(const synfig::String& name, const Action::Param &param)
{
	if(name=="keyframe" && param.get_type()==Param::TYPE_KEYFRAME)
	{
		keyframe=param.get_keyframe();

		return true;
	}

	return Action::CanvasSpecific::set_param(name,param);
}
Exemplo n.º 4
0
bool
Action::KeyframeRemove::set_param(const synfig::String& name, const Action::Param &param)
{
	if(name=="keyframe" && param.get_type()==Param::TYPE_KEYFRAME)
	{
		keyframe=param.get_keyframe();
		// For some reason the state of the keyframe is not always passed correctly
		// Make sure to get it right:
		keyframe.set_active(get_canvas()->keyframe_list().find(keyframe)->active());
		return true;
	}

	return Action::CanvasSpecific::set_param(name,param);
}
Exemplo n.º 5
0
bool
Action::KeyframeWaypointSet::set_param(const synfig::String& name, const Action::Param &param)
{
	if(name=="keyframe" && param.get_type()==Param::TYPE_KEYFRAME)
	{
		keyframe=param.get_keyframe();

		return true;
	}
	if(name=="model" && param.get_type()==Param::TYPE_WAYPOINTMODEL)
	{
		waypoint_model=param.get_waypoint_model();

		return true;
	}

	return Action::CanvasSpecific::set_param(name,param);
}
Exemplo n.º 6
0
bool
Action::KeyframeToggl::set_param(const synfig::String& name, const Action::Param &param)
{
	if(name=="keyframe" && param.get_type()==Param::TYPE_KEYFRAME)
	{
		keyframe=param.get_keyframe();

		return true;
	}

	if(name=="new_status" && param.get_type()==Param::TYPE_BOOL)
	{
		new_status=param.get_bool();

		return true;
	}

	return Action::CanvasSpecific::set_param(name,param);
}