Revision: 20872 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=20872 Author: schlaile Date: 2009-06-14 12:59:54 +0200 (Sun, 14 Jun 2009)
Log Message: ----------- == Sequencer == This fixes: * free_imbuf_seq() didn't free all scenes. That will lead to steady memory growth in case of nested timelines with several scenes. * sequencer panels were always jumping around, depending on strip type, which was caused by choosing always the same panel position and the silly limitation, that * effect strips had no filter option, which was therefore added. So you can apply color balance on effect filter output now :) Modified Paths: -------------- trunk/blender/source/blender/src/buttons_scene.c trunk/blender/source/blender/src/sequence.c Modified: trunk/blender/source/blender/src/buttons_scene.c =================================================================== --- trunk/blender/source/blender/src/buttons_scene.c 2009-06-14 10:56:29 UTC (rev 20871) +++ trunk/blender/source/blender/src/buttons_scene.c 2009-06-14 10:59:54 UTC (rev 20872) @@ -570,7 +570,7 @@ UI_EMBOSS, UI_HELV, curarea->win); if(uiNewPanel(curarea, block, "Edit", "Sequencer", - 10, 230, 318, 204) == 0) return; + 0, 0, 318, 204) == 0) return; uiDefBut(block, LABEL, 0, give_seqname(last_seq), @@ -754,7 +754,7 @@ UI_EMBOSS, UI_HELV, curarea->win); if(uiNewPanel(curarea, block, "Input", "Sequencer", - 10, 230, 318, 204) == 0) return; + 320, 0, 318, 204) == 0) return; if (SEQ_HAS_PATH(last_seq)) { uiDefBut(block, TEX, @@ -897,7 +897,7 @@ UI_EMBOSS, UI_HELV, curarea->win); if(uiNewPanel(curarea, block, "Filter", "Sequencer", - 10, 230, 318, 204) == 0) return; + 640, 0, 318, 204) == 0) return; uiBlockBeginAlign(block); @@ -1024,7 +1024,7 @@ UI_EMBOSS, UI_HELV, curarea->win); if(uiNewPanel(curarea, block, "Filter", "Sequencer", - 10, 230, 318, 204) == 0) return; + 640, 0, 318, 204) == 0) return; uiBlockBeginAlign(block); uiDefButF(block, NUM, B_SEQ_BUT_RELOAD, "Gain (dB):", 10,50,150,19, &last_seq->level, -96.0, 6.0, 100, 0, ""); @@ -1040,7 +1040,7 @@ UI_EMBOSS, UI_HELV, curarea->win); if(uiNewPanel(curarea, block, "Effect", "Sequencer", - 10, 230, 318, 204) == 0) return; + 320, 0, 318, 204) == 0) return; if(last_seq->type == SEQ_PLUGIN) { PluginSeq *pis; @@ -1168,7 +1168,7 @@ UI_EMBOSS, UI_HELV, curarea->win); if(uiNewPanel(curarea, block, "Proxy", "Sequencer", - 10, 230, 318, 204) == 0) return; + 960, 0, 318, 204) == 0) return; uiBlockBeginAlign(block); @@ -1276,7 +1276,7 @@ } if (type == SEQ_PLUGIN || type >= SEQ_EFFECT) { - panels |= SEQ_PANEL_EFFECT | SEQ_PANEL_PROXY; + panels |= SEQ_PANEL_EFFECT | SEQ_PANEL_FILTER| SEQ_PANEL_PROXY; } if (panels & SEQ_PANEL_EDITING) { Modified: trunk/blender/source/blender/src/sequence.c =================================================================== --- trunk/blender/source/blender/src/sequence.c 2009-06-14 10:56:29 UTC (rev 20871) +++ trunk/blender/source/blender/src/sequence.c 2009-06-14 10:59:54 UTC (rev 20872) @@ -1480,7 +1480,8 @@ mul = seq->mul; - if(seq->blend_mode == SEQ_BLEND_REPLACE) { + if(seq->blend_mode == SEQ_BLEND_REPLACE && + !(seq->type & SEQ_EFFECT)) { if (seq->ipo && seq->ipo->curve.first) { do_seq_ipo(seq, cfra); mul *= seq->facf0; @@ -1568,7 +1569,8 @@ mul = seq->mul; - if(seq->blend_mode == SEQ_BLEND_REPLACE) { + if(seq->blend_mode == SEQ_BLEND_REPLACE && + !(seq->type & SEQ_EFFECT)) { if (seq->ipo && seq->ipo->curve.first) { do_seq_ipo(seq, cfra); mul *= seq->facf0; @@ -1822,10 +1824,14 @@ input_preprocess(seq, se, cfra); } } else if(seq->type & SEQ_EFFECT) { + int use_preprocess = FALSE; /* should the effect be recalculated? */ if (!build_proxy_run && se->ibuf == 0) { se->ibuf = seq_proxy_fetch(seq, cfra, render_size); + if (se->ibuf) { + use_preprocess = TRUE; + } } if(se->ibuf == 0) { @@ -1838,7 +1844,23 @@ se->ibuf= IMB_allocImBuf((short)seqrectx, (short)seqrecty, 32, IB_rect, 0); do_effect(cfra, seq, se); + if (input_have_to_preprocess(seq, se, cfra) && + !build_proxy_run) { + if ((se->se1 && (se->ibuf == se->se1->ibuf)) || + (se->se2 && (se->ibuf == se->se2->ibuf))) { + struct ImBuf * i + = IMB_dupImBuf(se->ibuf); + + IMB_freeImBuf(se->ibuf); + + se->ibuf = i; + } + use_preprocess = TRUE; + } } + if (use_preprocess) { + input_preprocess(seq, se, cfra); + } } else if(seq->type == SEQ_IMAGE) { if(se->ok == STRIPELEM_OK && se->ibuf == 0) { StripElem * s_elem = give_stripelem(seq, cfra); @@ -2946,9 +2968,8 @@ END_SEQ } -void free_imbuf_seq() +static void free_imbuf_seq_editing(Editing * ed) { - Editing *ed= G.scene->ed; Sequence *seq; TStripElem *se; int a; @@ -2990,6 +3011,15 @@ END_SEQ } +void free_imbuf_seq() +{ + Scene * sce = G.main->scene.first; + while(sce) { + free_imbuf_seq_editing(sce->ed); + sce= sce->id.next; + } +} + void free_imbuf_seq_with_ipo(struct Ipo *ipo) { /* force update of all sequences with this ipo, on ipo changes */ @@ -3074,12 +3104,17 @@ /* bad levell call... */ void do_render_seq(RenderResult *rr, int cfra) { + static int recurs_depth = 0; ImBuf *ibuf; G.f |= G_PLAYANIM; /* waitcursor patch */ + recurs_depth++; + ibuf= give_ibuf_seq(rr->rectx, rr->recty, cfra, 0, G.scene->r.size); + recurs_depth--; + if(ibuf) { if(ibuf->rect_float) { if (!rr->rectf) @@ -3115,7 +3150,7 @@ on freeing _all_ buffers every time on long timelines...) (schlaile) */ - { + if (recurs_depth == 0) { /* with nested scenes, only free on toplevel... */ uintptr_t mem_in_use; uintptr_t mmap_in_use; uintptr_t max; _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs