X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Fsrc%2Fmodules%2Fmod_noise%2Fvaluenode_random.cpp;h=1aeb3252f2d6b19dd8f6780060e303f2ba14bea2;hb=dbc88fd05c8d29849d2e6227d23605508eb188ae;hp=1ae09a49116d44d80a4624f3977114aa46df26de;hpb=adfc80c126f482d7ea2bac38001a2c4a7c7df88c;p=synfig.git diff --git a/synfig-core/src/modules/mod_noise/valuenode_random.cpp b/synfig-core/src/modules/mod_noise/valuenode_random.cpp index 1ae09a4..1aeb325 100644 --- a/synfig-core/src/modules/mod_noise/valuenode_random.cpp +++ b/synfig-core/src/modules/mod_noise/valuenode_random.cpp @@ -55,6 +55,8 @@ using namespace synfig; ValueNode_Random::ValueNode_Random(const ValueBase &value): LinkableValueNode(value.get_type()) { + Vocab ret(get_children_vocab()); + set_children_vocab(ret); random.set_seed(time(NULL)); set_link("radius",ValueNode_Const::create(Real(1))); @@ -89,8 +91,6 @@ ValueNode_Random::ValueNode_Random(const ValueBase &value): default: throw Exception::BadType(ValueBase::type_local_name(get_type())); } - - DCAST_HACK_ENABLE(); } LinkableValueNode* @@ -302,3 +302,50 @@ ValueNode_Random::randomize_seed() set_link(i, ValueNode_Const::create(seed)); } } + +LinkableValueNode::Vocab +ValueNode_Random::get_children_vocab_vfunc()const +{ + if(children_vocab.size()) + return children_vocab; + + LinkableValueNode::Vocab ret; + + ret.push_back(ParamDesc(ValueBase(),"link") + .set_local_name(_("Link")) + .set_description(_("The value node source that provides the central value")) + ); + + ret.push_back(ParamDesc(ValueBase(),"radius") + .set_local_name(_("Radius")) + .set_description(_("The value of the maximum random difference")) + ); + + ret.push_back(ParamDesc(ValueBase(),"seed") + .set_local_name(_("Seed")) + .set_description(_("Seeds the random number generator")) + ); + + ret.push_back(ParamDesc(ValueBase(),"speed") + .set_local_name(_("Speed")) + .set_description(_("Defines how often a new random value is chosen (in choices per second) ")) + ); + + ret.push_back(ParamDesc(ValueBase(),"smooth") + .set_local_name(_("Interpolation")) + .set_description(_("Determines how the value is interpolated from one random choice to the next")) + .set_hint("enum") + .add_enum_value(RandomNoise::SMOOTH_DEFAULT,"default",_("No interpolation")) + .add_enum_value(RandomNoise::SMOOTH_LINEAR,"linear",_("Linear")) + .add_enum_value(RandomNoise::SMOOTH_COSINE,"cosine",_("Cosine")) + .add_enum_value(RandomNoise::SMOOTH_SPLINE,"spline",_("Spline")) + .add_enum_value(RandomNoise::SMOOTH_CUBIC,"cubic",_("Cubic")) + ); + + + ret.push_back(ParamDesc(ValueBase(),"loop") + .set_local_name(_("Loop Time")) + .set_description(_("Makes the random value repeat after the given time")) + ); + return ret; +}