+const synfig::Time get_time_offset_from_vdesc(const synfigapp::ValueDesc &v)
+{
+#ifdef ADJUST_WAYPOINTS_FOR_TIME_OFFSET
+ if(v.get_value_type() != synfig::ValueBase::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_param())
+ return synfig::Time::zero();
+
+ synfig::Layer::Handle layer = v.get_layer();
+
+ if (layer->get_name()!="PasteCanvas")
+ return synfig::Time::zero();
+
+ return layer->get_param("time_offset").get(Time());
+#else // ADJUST_WAYPOINTS_FOR_TIME_OFFSET
+ return synfig::Time::zero();
+#endif
+}
+