Example #1
0
bool
Action::ValueDescSet::set_param(const synfig::String& name, const Action::Param &param)
{
	if(name=="value_desc" && param.get_type()==Param::TYPE_VALUEDESC)
	{
		value_desc=param.get_value_desc();
		return true;
	}
	if(name=="new_value" && param.get_type()==Param::TYPE_VALUE)
	{
		value=param.get_value();
		return true;
	}
	if(name=="time" && param.get_type()==Param::TYPE_TIME)
	{
		time=param.get_time();
		return true;
	}
	if(name=="recursive" && param.get_type()==Param::TYPE_BOOL)
	{
		recursive=param.get_bool();
		return true;
	}
	if(name=="animate" && param.get_type()==Param::TYPE_BOOL)
	{
		animate=param.get_bool();
		return true;
	}

	return Action::CanvasSpecific::set_param(name,param);
}
bool
Action::ValueNodeConstSet::set_param(const synfig::String& name, const Action::Param &param)
{
	if(name=="value_node" && param.get_type()==Param::TYPE_VALUENODE)
	{
		value_node=ValueNode_Const::Handle::cast_dynamic(param.get_value_node());

		return (bool)value_node;
	}

	if(name=="new_value" && param.get_type()==Param::TYPE_VALUE)
	{
		new_value=param.get_value();

		return true;
	}

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