Merge branch 'genete_static_values'
[synfig.git] / synfig-core / src / modules / lyr_std / import.cpp
index f7385a9..d37eecf 100644 (file)
@@ -67,6 +67,8 @@ SYNFIG_LAYER_SET_CVS_ID(Import,"$Id$");
 Import::Import()
 {
        time_offset=0;
+       Layer::Vocab voc(get_param_vocab());
+       Layer::fill_static(voc);
 }
 
 Import::~Import()
@@ -86,6 +88,7 @@ Import::set_param(const String & param, const ValueBase &value)
        IMPORT(time_offset);
        if(param=="filename" && value.same_type_as(filename))
        {
+               set_param_static(param, value.get_static());
                if(!get_canvas())
                {
                        filename=value.get(filename);
@@ -162,7 +165,7 @@ Import::set_param(const String & param, const ValueBase &value)
                }
 
                surface.clear();
-               if(!newimporter->get_frame(surface,Time(0),trimmed,width,height,top,left))
+               if(!newimporter->get_frame(surface,get_canvas()->rend_desc(),Time(0),trimmed,width,height,top,left))
                {
                        synfig::warning(strprintf("Unable to get frame from \"%s\"",filename_with_path.c_str()));
                }
@@ -187,8 +190,11 @@ Import::get_param(const String & param)const
        {
                if(param=="filename")
                {
+                       ValueBase ret(ValueBase::TYPE_STRING);
+                       ret.set_static(get_param_static(param));
                        string curpath(cleanup_path(absolute_path(get_canvas()->get_file_path())));
-                       return relative_path(curpath,abs_filename);
+                       ret=relative_path(curpath,abs_filename);
+                       return ret;
                }
        }
        else
@@ -222,7 +228,7 @@ Import::set_time(Context context, Time time)const
 {
        if(get_amount() && importer &&
           importer->is_animated())
-               importer->get_frame(surface,time+time_offset,trimmed,width,height,top,left);
+               importer->get_frame(surface,get_canvas()->rend_desc(),time+time_offset,trimmed,width,height,top,left);
 
        context.set_time(time);
 }
@@ -232,7 +238,7 @@ Import::set_time(Context context, Time time, const Point &pos)const
 {
        if(get_amount() && importer &&
           importer->is_animated())
-               importer->get_frame(surface,time+time_offset,trimmed,width,height,top,left);
+               importer->get_frame(surface,get_canvas()->rend_desc(),time+time_offset,trimmed,width,height,top,left);
 
        context.set_time(time,pos);
 }