[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [48552] branches/soc-2011-tomato/source/ blender/compositor: Tomato: skip cache for Movieclip input node only when rendering
Sergey Sharybin
sergey.vfx at gmail.com
Tue Jul 3 18:23:17 CEST 2012
Revision: 48552
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48552
Author: nazgul
Date: 2012-07-03 16:23:15 +0000 (Tue, 03 Jul 2012)
Log Message:
-----------
Tomato: skip cache for Movieclip input node only when rendering
Modified Paths:
--------------
branches/soc-2011-tomato/source/blender/compositor/nodes/COM_MovieClipNode.cpp
branches/soc-2011-tomato/source/blender/compositor/operations/COM_MovieClipOperation.cpp
branches/soc-2011-tomato/source/blender/compositor/operations/COM_MovieClipOperation.h
Modified: branches/soc-2011-tomato/source/blender/compositor/nodes/COM_MovieClipNode.cpp
===================================================================
--- branches/soc-2011-tomato/source/blender/compositor/nodes/COM_MovieClipNode.cpp 2012-07-03 16:18:39 UTC (rev 48551)
+++ branches/soc-2011-tomato/source/blender/compositor/nodes/COM_MovieClipNode.cpp 2012-07-03 16:23:15 UTC (rev 48552)
@@ -81,6 +81,7 @@
operation->setMovieClip(movieClip);
operation->setMovieClipUser(movieClipUser);
operation->setFramenumber(context->getFramenumber());
+ operation->setCacheFrame(!context->isRendering());
graph->addOperation(operation);
MovieTrackingStabilization *stab = &movieClip->tracking.stabilization;
Modified: branches/soc-2011-tomato/source/blender/compositor/operations/COM_MovieClipOperation.cpp
===================================================================
--- branches/soc-2011-tomato/source/blender/compositor/operations/COM_MovieClipOperation.cpp 2012-07-03 16:18:39 UTC (rev 48551)
+++ branches/soc-2011-tomato/source/blender/compositor/operations/COM_MovieClipOperation.cpp 2012-07-03 16:23:15 UTC (rev 48552)
@@ -48,9 +48,16 @@
if (this->m_movieClip) {
BKE_movieclip_user_set_frame(this->m_movieClipUser, this->m_framenumber);
ImBuf *ibuf;
- int flag = this->m_movieClip->flag & MCLIP_TIMECODE_FLAGS;
- ibuf = BKE_movieclip_get_ibuf_flag(this->m_movieClip, this->m_movieClipUser, flag, MOVIECLIP_CACHE_SKIP);
+ if (this->m_cacheFrame) {
+ ibuf = BKE_movieclip_get_ibuf(this->m_movieClip, this->m_movieClipUser);
+ }
+ else {
+ int flag = this->m_movieClip->flag & MCLIP_TIMECODE_FLAGS;
+
+ ibuf = BKE_movieclip_get_ibuf_flag(this->m_movieClip, this->m_movieClipUser, flag, MOVIECLIP_CACHE_SKIP);
+ }
+
if (ibuf) {
this->m_movieClipBuffer = ibuf;
if (ibuf->rect_float == NULL || ibuf->userflags & IB_RECT_INVALID) {
Modified: branches/soc-2011-tomato/source/blender/compositor/operations/COM_MovieClipOperation.h
===================================================================
--- branches/soc-2011-tomato/source/blender/compositor/operations/COM_MovieClipOperation.h 2012-07-03 16:18:39 UTC (rev 48551)
+++ branches/soc-2011-tomato/source/blender/compositor/operations/COM_MovieClipOperation.h 2012-07-03 16:23:15 UTC (rev 48552)
@@ -43,6 +43,7 @@
int m_movieClipheight;
int m_movieClipwidth;
int m_framenumber;
+ bool m_cacheFrame;
/**
* Determine the output resolution. The resolution is retrieved from the Renderer
@@ -56,6 +57,7 @@
void deinitExecution();
void setMovieClip(MovieClip *image) { this->m_movieClip = image; }
void setMovieClipUser(MovieClipUser *imageuser) { this->m_movieClipUser = imageuser; }
+ void setCacheFrame(bool value) { this->m_cacheFrame = value; }
void setFramenumber(int framenumber) { this->m_framenumber = framenumber; }
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
More information about the Bf-blender-cvs
mailing list