static bool is_not_supported(const synfigapp::ValueDesc& x) { return x.get_value_type() == type_string || x.get_value_type() == type_canvas || x.get_value_type() == type_gradient || x.get_value_type() == type_list || x.get_value_type() == type_segment; }
//kind of a hack... pointer is ugly void get_change_times_from_vdesc(const synfigapp::ValueDesc &v, std::set<synfig::Time> ×) { if (v.is_value_node()) { if ( v.get_value_type() == type_string || v.get_value_type() == type_bool || v.get_value_type() == type_canvas ) { std::map<Time, ValueBase> x; v.get_value_node()->get_values(x); for(std::map<Time, ValueBase>::const_iterator i = x.begin(); i != x.end(); ++i) times.insert(i->first); } } }
const synfig::Time get_time_offset_from_vdesc(const synfigapp::ValueDesc &v) { #ifdef ADJUST_WAYPOINTS_FOR_TIME_OFFSET if(getenv("SYNFIG_SHOW_CANVAS_PARAM_WAYPOINTS") || v.get_value_type() != synfig::type_canvas) return synfig::Time::zero(); synfig::Canvas::Handle canvasparam = v.get_value().get(Canvas::Handle()); if(!canvasparam) return synfig::Time::zero(); if (!v.parent_is_layer()) return synfig::Time::zero(); synfig::Layer::Handle layer = v.get_layer(); if (etl::handle<Layer_PasteCanvas>::cast_dynamic(layer)) return synfig::Time::zero(); return layer->get_param("time_offset").get(Time()); #else // ADJUST_WAYPOINTS_FOR_TIME_OFFSET return synfig::Time::zero(); #endif }
CurveStruct(const synfigapp::ValueDesc& x): value_desc(x) { Type &type(value_desc.get_value_type()); if (type == type_real) { channels.push_back(Channel()); channels.back().name="real"; channels.back().color=Gdk::Color("#007f7f"); } else if (type == type_time) { channels.push_back(Channel()); channels.back().name="time"; channels.back().color=Gdk::Color("#7f7f00"); } else if (type == type_integer) { channels.push_back(Channel()); channels.back().name="int"; channels.back().color=Gdk::Color("#7f0000"); } else if (type == type_bool) { channels.push_back(Channel()); channels.back().name="bool"; channels.back().color=Gdk::Color("#ff7f00"); } else if (type == type_angle) { channels.push_back(Channel()); channels.back().name="theta"; channels.back().color=Gdk::Color("#004f4f"); } else if (type == type_color) { channels.push_back(Channel()); channels.back().name="red"; channels.back().color=Gdk::Color("#7f0000"); channels.push_back(Channel()); channels.back().name="green"; channels.back().color=Gdk::Color("#007f00"); channels.push_back(Channel()); channels.back().name="blue"; channels.back().color=Gdk::Color("#00007f"); channels.push_back(Channel()); channels.back().name="alpha"; channels.back().color=Gdk::Color("#000000"); } else if (type == type_vector) { channels.push_back(Channel()); channels.back().name="x"; channels.back().color=Gdk::Color("#7f007f"); channels.push_back(Channel()); channels.back().name="y"; channels.back().color=Gdk::Color("#007f7f"); } else if (type == type_bline_point) { channels.push_back(Channel()); channels.back().name="v.x"; channels.back().color=Gdk::Color("#ff7f00"); channels.push_back(Channel()); channels.back().name="v.y"; channels.back().color=Gdk::Color("#7f3f00"); channels.push_back(Channel()); channels.back().name="width"; channels.back().color=Gdk::Color("#000000"); channels.push_back(Channel()); channels.back().name="origin"; channels.back().color=Gdk::Color("#ffffff"); channels.push_back(Channel()); channels.back().name="tsplit"; channels.back().color=Gdk::Color("#ff00ff"); channels.push_back(Channel()); channels.back().name="t1.x"; channels.back().color=Gdk::Color("#ff0000"); channels.push_back(Channel()); channels.back().name="t1.y"; channels.back().color=Gdk::Color("#7f0000"); channels.push_back(Channel()); channels.back().name="t2.x"; channels.back().color=Gdk::Color("#ffff00"); channels.push_back(Channel()); channels.back().name="t2.y"; channels.back().color=Gdk::Color("#7f7f00"); channels.push_back(Channel()); channels.back().name="rsplit"; channels.back().color=Gdk::Color("#ff00ff"); channels.push_back(Channel()); channels.back().name="asplit"; channels.back().color=Gdk::Color("#ff00ff"); } else if (type == type_width_point) { channels.push_back(Channel()); channels.back().name="position"; channels.back().color=Gdk::Color("#ff0000"); channels.push_back(Channel()); channels.back().name="width"; channels.back().color=Gdk::Color("#00ff00"); } else if (type == type_dash_item) { channels.push_back(Channel()); channels.back().name="offset"; channels.back().color=Gdk::Color("#ff0000"); channels.push_back(Channel()); channels.back().name="length"; channels.back().color=Gdk::Color("#00ff00"); } else { throw synfig::Exception::BadType("Bad type for curves"); } }