From: Carlos Lopez Date: Sun, 29 Aug 2010 08:14:32 +0000 (+0200) Subject: Add parameter static option for various layers X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=35ab927bc9abb7455ff4aaf3cd02f3be9a18f5df;p=synfig.git Add parameter static option for various layers --- diff --git a/synfig-core/src/modules/lyr_std/insideout.cpp b/synfig-core/src/modules/lyr_std/insideout.cpp index 1ed9c2c..8dd633e 100644 --- a/synfig-core/src/modules/lyr_std/insideout.cpp +++ b/synfig-core/src/modules/lyr_std/insideout.cpp @@ -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 diff --git a/synfig-core/src/modules/lyr_std/sphere_distort.cpp b/synfig-core/src/modules/lyr_std/sphere_distort.cpp index 9c0003e..5786a46 100644 --- a/synfig-core/src/modules/lyr_std/sphere_distort.cpp +++ b/synfig-core/src/modules/lyr_std/sphere_distort.cpp @@ -87,6 +87,8 @@ percent(1.0), type(TYPE_NORMAL), clip(false) { + Layer::Vocab voc(get_param_vocab()); + Layer::fill_static(voc); } diff --git a/synfig-core/src/modules/lyr_std/stretch.cpp b/synfig-core/src/modules/lyr_std/stretch.cpp index 0f1c37d..65ae87f 100644 --- a/synfig-core/src/modules/lyr_std/stretch.cpp +++ b/synfig-core/src/modules/lyr_std/stretch.cpp @@ -68,6 +68,8 @@ Layer_Stretch::Layer_Stretch(): amount(1,1), center(0,0) { + Layer::Vocab voc(get_param_vocab()); + Layer::fill_static(voc); } diff --git a/synfig-core/src/modules/lyr_std/twirl.cpp b/synfig-core/src/modules/lyr_std/twirl.cpp index 38d2097..89a4785 100644 --- a/synfig-core/src/modules/lyr_std/twirl.cpp +++ b/synfig-core/src/modules/lyr_std/twirl.cpp @@ -71,6 +71,8 @@ Twirl::Twirl(): distort_inside(true), distort_outside(false) { + Layer::Vocab voc(get_param_vocab()); + Layer::fill_static(voc); } bool diff --git a/synfig-core/src/modules/lyr_std/warp.cpp b/synfig-core/src/modules/lyr_std/warp.cpp index f11c290..729272e 100644 --- a/synfig-core/src/modules/lyr_std/warp.cpp +++ b/synfig-core/src/modules/lyr_std/warp.cpp @@ -74,6 +74,8 @@ Warp::Warp(): { sync(); horizon=4; + Layer::Vocab voc(get_param_vocab()); + Layer::fill_static(voc); } Warp::~Warp() diff --git a/synfig-core/src/modules/mod_example/filledrect.cpp b/synfig-core/src/modules/mod_example/filledrect.cpp index 663c0db..d78f45e 100644 --- a/synfig-core/src/modules/mod_example/filledrect.cpp +++ b/synfig-core/src/modules/mod_example/filledrect.cpp @@ -75,6 +75,8 @@ FilledRect::FilledRect(): bevel(0), bevCircle(0) { + Layer::Vocab voc(get_param_vocab()); + Layer::fill_static(voc); } bool diff --git a/synfig-core/src/modules/mod_example/metaballs.cpp b/synfig-core/src/modules/mod_example/metaballs.cpp index 6d79e68..44ef9ec 100644 --- a/synfig-core/src/modules/mod_example/metaballs.cpp +++ b/synfig-core/src/modules/mod_example/metaballs.cpp @@ -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 diff --git a/synfig-core/src/modules/mod_example/simplecircle.cpp b/synfig-core/src/modules/mod_example/simplecircle.cpp index f6fc8ef..2269cbe 100644 --- a/synfig-core/src/modules/mod_example/simplecircle.cpp +++ b/synfig-core/src/modules/mod_example/simplecircle.cpp @@ -70,6 +70,8 @@ SimpleCircle::SimpleCircle(): center(0,0), radius(0.5) { + Layer::Vocab voc(get_param_vocab()); + Layer::fill_static(voc); } bool diff --git a/synfig-core/src/modules/mod_filter/colorcorrect.cpp b/synfig-core/src/modules/mod_filter/colorcorrect.cpp index 3a0468e..f595db2 100644 --- a/synfig-core/src/modules/mod_filter/colorcorrect.cpp +++ b/synfig-core/src/modules/mod_filter/colorcorrect.cpp @@ -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 ¶m)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(); diff --git a/synfig-core/src/modules/mod_filter/halftone2.cpp b/synfig-core/src/modules/mod_filter/halftone2.cpp index 177f6a0..f4f29da 100644 --- a/synfig-core/src/modules/mod_filter/halftone2.cpp +++ b/synfig-core/src/modules/mod_filter/halftone2.cpp @@ -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 diff --git a/synfig-core/src/modules/mod_filter/halftone3.cpp b/synfig-core/src/modules/mod_filter/halftone3.cpp index a2a4283..8b9c841 100644 --- a/synfig-core/src/modules/mod_filter/halftone3.cpp +++ b/synfig-core/src/modules/mod_filter/halftone3.cpp @@ -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 diff --git a/synfig-core/src/modules/mod_noise/distort.cpp b/synfig-core/src/modules/mod_noise/distort.cpp index 1660c7d..c946440 100644 --- a/synfig-core/src/modules/mod_noise/distort.cpp +++ b/synfig-core/src/modules/mod_noise/distort.cpp @@ -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);