Tomato: skip cache for Movieclip input node only when rendering

This commit is contained in:
Sergey Sharybin 2012-07-03 16:23:15 +00:00
parent f56f492c5a
commit 9ac9040cfd
3 changed files with 12 additions and 2 deletions

@ -81,6 +81,7 @@ void MovieClipNode::convertToOperations(ExecutionSystem *graph, CompositorContex
operation->setMovieClip(movieClip); operation->setMovieClip(movieClip);
operation->setMovieClipUser(movieClipUser); operation->setMovieClipUser(movieClipUser);
operation->setFramenumber(context->getFramenumber()); operation->setFramenumber(context->getFramenumber());
operation->setCacheFrame(!context->isRendering());
graph->addOperation(operation); graph->addOperation(operation);
MovieTrackingStabilization *stab = &movieClip->tracking.stabilization; MovieTrackingStabilization *stab = &movieClip->tracking.stabilization;

@ -48,9 +48,16 @@ void MovieClipOperation::initExecution()
if (this->m_movieClip) { if (this->m_movieClip) {
BKE_movieclip_user_set_frame(this->m_movieClipUser, this->m_framenumber); BKE_movieclip_user_set_frame(this->m_movieClipUser, this->m_framenumber);
ImBuf *ibuf; ImBuf *ibuf;
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; 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); ibuf = BKE_movieclip_get_ibuf_flag(this->m_movieClip, this->m_movieClipUser, flag, MOVIECLIP_CACHE_SKIP);
}
if (ibuf) { if (ibuf) {
this->m_movieClipBuffer = ibuf; this->m_movieClipBuffer = ibuf;
if (ibuf->rect_float == NULL || ibuf->userflags & IB_RECT_INVALID) { if (ibuf->rect_float == NULL || ibuf->userflags & IB_RECT_INVALID) {

@ -43,6 +43,7 @@ protected:
int m_movieClipheight; int m_movieClipheight;
int m_movieClipwidth; int m_movieClipwidth;
int m_framenumber; int m_framenumber;
bool m_cacheFrame;
/** /**
* Determine the output resolution. The resolution is retrieved from the Renderer * Determine the output resolution. The resolution is retrieved from the Renderer
@ -56,6 +57,7 @@ public:
void deinitExecution(); void deinitExecution();
void setMovieClip(MovieClip *image) { this->m_movieClip = image; } void setMovieClip(MovieClip *image) { this->m_movieClip = image; }
void setMovieClipUser(MovieClipUser *imageuser) { this->m_movieClipUser = imageuser; } 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 setFramenumber(int framenumber) { this->m_framenumber = framenumber; }
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]); void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);