X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fsynfig%2Fcanvas.cpp;h=ede95013805a50094d765d636d533eadd4ba174e;hb=63e709f66d50c124cc0ece2325f4773ac4ae7b20;hp=eaa90627fa8607ee7324a35e1ea2232a958f8d23;hpb=b177280b8815c394cb67c713eb34260ebb72de94;p=synfig.git diff --git a/synfig-core/trunk/src/synfig/canvas.cpp b/synfig-core/trunk/src/synfig/canvas.cpp index eaa9062..ede9501 100644 --- a/synfig-core/trunk/src/synfig/canvas.cpp +++ b/synfig-core/trunk/src/synfig/canvas.cpp @@ -71,6 +71,7 @@ int _CanvasCounter::counter(0); Canvas::Canvas(const String &id): id_ (id), + version_ (CURRENT_CANVAS_VERSION), cur_time_ (0), is_inline_ (false), is_dirty_ (true), @@ -91,7 +92,6 @@ Canvas::~Canvas() { //if(is_inline() && parent_) assert(0); _CanvasCounter::counter--; - //DEBUGPOINT(); clear(); begin_delete(); } @@ -412,7 +412,6 @@ Canvas::add_value_node(ValueNode::Handle x, const String &id) return parent_->add_value_node(x,id); // throw runtime_error("You cannot add a ValueNode to an inline Canvas"); - //DEBUGPOINT(); if(x->is_exported()) throw runtime_error("ValueNode is already exported"); @@ -424,16 +423,13 @@ Canvas::add_value_node(ValueNode::Handle x, const String &id) try { - //DEBUGPOINT(); if(PlaceholderValueNode::Handle::cast_dynamic(value_node_list_.find(id))) throw Exception::IDNotFound("add_value_node()"); - //DEBUGPOINT(); throw Exception::IDAlreadyExists(id); } catch(Exception::IDNotFound) { - //DEBUGPOINT(); x->set_id(id); x->set_parent_canvas(this); @@ -443,7 +439,6 @@ Canvas::add_value_node(ValueNode::Handle x, const String &id) synfig::error("Unable to add ValueNode"); throw std::runtime_error("Unable to add ValueNode"); } - //DEBUGPOINT(); return; } @@ -663,7 +658,6 @@ Canvas::create() void Canvas::push_back(etl::handle x) { -// DEBUGPOINT(); // int i(x->count()); insert(end(),x); //if(x->count()!=i+1)synfig::info("push_back before %d, after %d",i,x->count()); @@ -672,7 +666,6 @@ Canvas::push_back(etl::handle x) void Canvas::push_front(etl::handle x) { -// DEBUGPOINT(); // int i(x->count()); insert(begin(),x); //if(x->count()!=i+1)synfig::error("push_front before %d, after %d",i,x->count()); @@ -1017,6 +1010,11 @@ Canvas::get_meta_data_keys()const return ret; } +/* note - the "Motion Blur" and "Duplicate" layers need the dynamic + parameters of any PasteCanvas layers they loop over to be + maintained. When the variables in the following function + refer to "motion blur", they mean either of these two + layers. */ void synfig::optimize_layers(Context context, Canvas::Handle op_canvas, bool seen_motion_blur_in_parent) { @@ -1045,7 +1043,7 @@ synfig::optimize_layers(Context context, Canvas::Handle op_canvas, bool seen_mot if(value.get_type()==ValueBase::TYPE_REAL && value.get(Real())==0) continue; - if(layer->get_name()=="MotionBlur") + if(layer->get_name()=="MotionBlur" || layer->get_name()=="duplicate") { float z_depth(layer->get_z_depth()*1.0001+i);