Add parameter static option for various layers
authorCarlos Lopez <genetita@gmail.com>
Sun, 29 Aug 2010 08:14:32 +0000 (10:14 +0200)
committerCarlos Lopez <genetita@gmail.com>
Sun, 29 Aug 2010 08:14:32 +0000 (10:14 +0200)
12 files changed:
synfig-core/src/modules/lyr_std/insideout.cpp
synfig-core/src/modules/lyr_std/sphere_distort.cpp
synfig-core/src/modules/lyr_std/stretch.cpp
synfig-core/src/modules/lyr_std/twirl.cpp
synfig-core/src/modules/lyr_std/warp.cpp
synfig-core/src/modules/mod_example/filledrect.cpp
synfig-core/src/modules/mod_example/metaballs.cpp
synfig-core/src/modules/mod_example/simplecircle.cpp
synfig-core/src/modules/mod_filter/colorcorrect.cpp
synfig-core/src/modules/mod_filter/halftone2.cpp
synfig-core/src/modules/mod_filter/halftone3.cpp
synfig-core/src/modules/mod_noise/distort.cpp

index 1ed9c2c..8dd633e 100644 (file)
@@ -64,6 +64,8 @@ SYNFIG_LAYER_SET_CVS_ID(InsideOut,"$Id$");
 InsideOut::InsideOut():
        origin(0,0)
 {
+       Layer::Vocab voc(get_param_vocab());
+       Layer::fill_static(voc);
 }
 
 bool
index 9c0003e..5786a46 100644 (file)
@@ -87,6 +87,8 @@ percent(1.0),
 type(TYPE_NORMAL),
 clip(false)
 {
+       Layer::Vocab voc(get_param_vocab());
+       Layer::fill_static(voc);
 }
 
 
index 0f1c37d..65ae87f 100644 (file)
@@ -68,6 +68,8 @@ Layer_Stretch::Layer_Stretch():
        amount(1,1),
        center(0,0)
 {
+       Layer::Vocab voc(get_param_vocab());
+       Layer::fill_static(voc);
 }
 
 
index 38d2097..89a4785 100644 (file)
@@ -71,6 +71,8 @@ Twirl::Twirl():
        distort_inside(true),
        distort_outside(false)
 {
+       Layer::Vocab voc(get_param_vocab());
+       Layer::fill_static(voc);
 }
 
 bool
index f11c290..729272e 100644 (file)
@@ -74,6 +74,8 @@ Warp::Warp():
 {
        sync();
        horizon=4;
+       Layer::Vocab voc(get_param_vocab());
+       Layer::fill_static(voc);
 }
 
 Warp::~Warp()
index 663c0db..d78f45e 100644 (file)
@@ -75,6 +75,8 @@ FilledRect::FilledRect():
        bevel(0),
        bevCircle(0)
 {
+       Layer::Vocab voc(get_param_vocab());
+       Layer::fill_static(voc);
 }
 
 bool
index 6d79e68..44ef9ec 100644 (file)
@@ -74,6 +74,8 @@ Metaballs::Metaballs():
        centers.push_back(Point( 0, -1.5));     radii.push_back(2.5);   weights.push_back(1);
        centers.push_back(Point(-2,  1));       radii.push_back(2.5);   weights.push_back(1);
        centers.push_back(Point( 2,  1));       radii.push_back(2.5);   weights.push_back(1);
+       Layer::Vocab voc(get_param_vocab());
+       Layer::fill_static(voc);
 }
 
 bool
index f6fc8ef..2269cbe 100644 (file)
@@ -70,6 +70,8 @@ SimpleCircle::SimpleCircle():
        center(0,0),
        radius(0.5)
 {
+       Layer::Vocab voc(get_param_vocab());
+       Layer::fill_static(voc);
 }
 
 bool
index 3a0468e..f595db2 100644 (file)
@@ -68,6 +68,8 @@ Layer_ColorCorrect::Layer_ColorCorrect():
        contrast(1.0),
        exposure(0.0)
 {
+       Layer::Vocab voc(get_param_vocab());
+       Layer::fill_static(voc);
 }
 
 inline Color
@@ -172,6 +174,7 @@ Layer_ColorCorrect::set_param(const String & param, const ValueBase &value)
        if(param=="gamma" && value.get_type()==ValueBase::TYPE_REAL)
        {
                gamma.set_gamma(1.0/value.get(Real()));
+               set_param_static(param, value.get_static());
                return true;
        }
        return false;
@@ -186,7 +189,11 @@ Layer_ColorCorrect::get_param(const String &param)const
        EXPORT(exposure);
 
        if(param=="gamma")
-               return 1.0/gamma.get_gamma();
+       {
+               ValueBase ret(1.0/gamma.get_gamma());
+               ret.set_static(get_param_static(param));
+               return ret;
+       }
 
        EXPORT_NAME();
        EXPORT_VERSION();
index 177f6a0..f4f29da 100644 (file)
@@ -73,6 +73,9 @@ Halftone2::Halftone2():
        halftone.type=TYPE_SYMMETRIC;
 
        set_blend_method(Color::BLEND_STRAIGHT);
+
+       Layer::Vocab voc(get_param_vocab());
+       Layer::fill_static(voc);
 }
 
 inline Color
index a2a4283..8b9c841 100644 (file)
@@ -101,6 +101,9 @@ Halftone3::Halftone3()
                        inverse_matrix[i][j]=(j==i)?1.0f:0.0f;
 
        sync();
+
+       Layer::Vocab voc(get_param_vocab());
+       Layer::fill_static(voc);
 }
 
 void
index 1660c7d..c946440 100644 (file)
@@ -72,6 +72,8 @@ NoiseDistort::NoiseDistort():
        random.set_seed(time(NULL));
        turbulent=false;
        displacement=Vector(0.25,0.25);
+       Layer::Vocab voc(get_param_vocab());
+       Layer::fill_static(voc);
 }
 
 inline Color
@@ -159,6 +161,7 @@ NoiseDistort::set_param(const String & param, const ValueBase &value)
        if(param=="seed" && value.same_type_as(int()))
        {
                random.set_seed(value.get(int()));
+               set_param_static(param, value.get_static());
                return true;
        }
        IMPORT(size);
@@ -174,7 +177,11 @@ ValueBase
 NoiseDistort::get_param(const String & param)const
 {
        if(param=="seed")
-               return random.get_seed();
+       {
+               ValueBase ret(random.get_seed());
+               ret.set_static(get_param_static(param));
+               return ret;
+       }
        EXPORT(size);
        EXPORT(speed);
        EXPORT(smooth);