Example #1
0
bool
Action::LayerMove::set_param(const synfig::String& name, const Action::Param &param)
{
	if(name=="layer" && param.get_type()==Param::TYPE_LAYER)
	{

		layer=param.get_layer();

		return true;
	}

	if(name=="new_index" && param.get_type()==Param::TYPE_INTEGER)
	{
		new_index=param.get_integer();

		return true;
	}

	if(name=="dest_canvas" && param.get_type()==Param::TYPE_CANVAS)
	{
		dest_canvas=param.get_canvas();

		return true;
	}

	return Action::CanvasSpecific::set_param(name,param);
}
Example #2
0
bool
Action::LayerResetPose::set_param(const synfig::String& name, const Action::Param &param)
{
	if (name=="layer"
	 && param.get_type()==Param::TYPE_LAYER
	 && param.get_layer()->get_name() == "skeleton_deformation" )
	{
		layers.push_back(param.get_layer());
		return true;
	}

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

	return Action::CanvasSpecific::set_param(name,param);
}
Example #3
0
bool
Action::LayerMakeBLine::set_param(const synfig::String& name, const Action::Param &param)
{
	if(name=="layer" && param.get_type()==Param::TYPE_LAYER)
	{
		layer = param.get_layer();
		return true;
	}

	return Action::CanvasSpecific::set_param(name,param);
}
bool
Action::LayerLower::set_param(const synfig::String& name, const Action::Param &param)
{
	if(name=="layer" && param.get_type()==Param::TYPE_LAYER)
	{
		layers.push_back(param.get_layer());

		return true;
	}

	return Action::CanvasSpecific::set_param(name,param);
}
Example #5
0
bool
Action::LayerRemove::set_param(const synfig::String& name, const Action::Param &param)
{
	if(name=="layer" && param.get_type()==Param::TYPE_LAYER)
	{
		std::pair<synfig::Layer::Handle,int> layer_pair;
		layer_pair.first=param.get_layer();
		layer_list.push_back(layer_pair);

		return true;
	}

	return Action::CanvasSpecific::set_param(name,param);
}
bool
Action::TimepointsMove::set_param(const synfig::String& name, const Action::Param &param)
{
	if(name=="addlayer" && param.get_type()==Param::TYPE_LAYER)
	{
		//add a layer to the list
		sel_layers.push_back(param.get_layer());
		//synfig::info("action got layer");

		return true;
	}

	if(name=="addcanvas" && param.get_type()==Param::TYPE_CANVAS)
	{
		//add a layer to the list
		sel_canvases.push_back(param.get_canvas());
		//synfig::info("action got canvas");

		return true;
	}

	if(name=="addvaluedesc" && param.get_type()==Param::TYPE_VALUEDESC)
	{
		//add a layer to the list
		sel_values.push_back(param.get_value_desc());
		//synfig::info("action got valuedesc");

		return true;
	}

	if(name=="addtime" && param.get_type()==Param::TYPE_TIME)
	{
		//add a layer to the list
		sel_times.insert(param.get_time());
		//synfig::info("action got time");

		return true;
	}

	if(name=="deltatime" && param.get_type()==Param::TYPE_TIME)
	{
		timemove = param.get_time();
		//synfig::info("action got time to move");

		return true;
	}

	return Action::CanvasSpecific::set_param(name,param);
}
bool
Action::LayerSetDesc::set_param(const synfig::String& name, const Action::Param &param)
{
	if(name=="layer" && param.get_type()==Param::TYPE_LAYER)
	{
		layer=param.get_layer();

		return true;
	}

	if(name=="new_description" && param.get_type()==Param::TYPE_STRING)
	{
		new_description=param.get_string();

		return true;
	}

	return Action::CanvasSpecific::set_param(name,param);
}
Example #8
0
bool
Action::LayerAddFrame::set_param(const synfig::String& name, const Action::Param &param)
{
	if(name=="layer" && param.get_type()==Param::TYPE_LAYER)
	{
		layer_switch = etl::handle<Layer_Switch>::cast_dynamic(param.get_layer());
		if (layer_switch)
		{
			layer_base = layer_switch->get_current_layer();
			if (!layer_base) layer_switch = NULL;
		}
		return layer_switch;
	}
	if(name=="time" && param.get_type()==Param::TYPE_TIME)
	{
		time=param.get_time();
		return true;
	}

	return Action::CanvasSpecific::set_param(name,param);
}
Example #9
0
bool
Action::LayerEncapsulate::set_param(const synfig::String& name, const Action::Param &param)
{
	if(name=="layer" && param.get_type()==Param::TYPE_LAYER)
	{
		layers.push_back(param.get_layer());
		return true;
	}
	if(name=="description" && param.get_type()==Param::TYPE_STRING)
	{
		description = param.get_string();
		return true;
	}
        if(name=="children_lock" && param.get_type()==Param::TYPE_BOOL)
	{
		children_lock = param.get_bool();
		return true;
	}

	return Action::CanvasSpecific::set_param(name,param);
}
bool
Action::LayerEmbed::set_param(const synfig::String& name, const Action::Param &param)
{
	if(name=="layer" && param.get_type()==Param::TYPE_LAYER)
	{
		Layer::Handle layer = param.get_layer();

		etl::handle<synfig::Layer_PasteCanvas> layer_pastecanvas
			= etl::handle<synfig::Layer_PasteCanvas>::cast_dynamic(layer);
		if (layer_pastecanvas)
		{
			Canvas::Handle canvas = layer_pastecanvas->get_sub_canvas();
			if (canvas && canvas->is_root())
			{
				this->layer_pastecanvas = layer_pastecanvas;
				return true;
			}
		}

		Layer::Handle layer_import = layer;
		if (layer_import->get_param_list().count("filename") != 0)
		{
			String filename = layer_import->get_param("filename").get(String());
			// TODO: literal "container:"
			if (!filename.empty()
			  && filename.substr(0, String("#").size()) != "#"
		      && layer_import->dynamic_param_list().count("filename") == 0)
			{
				this->layer_import = layer_import;
				return true;
			}
		}

		return false;
	}

	return Action::CanvasSpecific::set_param(name,param);
}
Example #11
0
bool
Action::LayerEmbed::set_param(const synfig::String& name, const Action::Param &param)
{
	if(name=="layer" && param.get_type()==Param::TYPE_LAYER)
	{
		Layer::Handle layer = param.get_layer();

		etl::handle<synfig::Layer_PasteCanvas> layer_pastecanvas
			= etl::handle<synfig::Layer_PasteCanvas>::cast_dynamic(layer);
		if (layer_pastecanvas)
		{
			Canvas::Handle canvas = layer_pastecanvas->get_sub_canvas();
			if (canvas && canvas->is_root())
			{
				this->layer_pastecanvas = layer_pastecanvas;
				return true;
			}
		}

		Layer::Handle layer_import = layer;
		if (layer_import->get_param_list().count("filename") != 0)
		{
			String filename = layer_import->get_param("filename").get(String());
			if ( !CanvasFileNaming::is_embeded(filename)
		      && !layer_import->dynamic_param_list().count("filename") )
			{
				this->layer_import = layer_import;
				return true;
			}
		}

		return false;
	}

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