From 125d5d2be5f62c71a7c718fcc105c7e30a6b8f9c Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 23 Feb 2016 15:26:05 +0100 Subject: Fix T47444: Texture node in compositing nodes does not update --- .../compositor/operations/COM_TextureOperation.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'source/blender/compositor/operations') diff --git a/source/blender/compositor/operations/COM_TextureOperation.cpp b/source/blender/compositor/operations/COM_TextureOperation.cpp index c75c4040823..ed8b0343e51 100644 --- a/source/blender/compositor/operations/COM_TextureOperation.cpp +++ b/source/blender/compositor/operations/COM_TextureOperation.cpp @@ -26,6 +26,10 @@ #include "BLI_threads.h" #include "BKE_image.h" +extern "C" { +#include "BKE_node.h" +} + static ThreadMutex mutex_lock = BLI_MUTEX_INITIALIZER; TextureBaseOperation::TextureBaseOperation() : SingleThreadedOperation() @@ -53,6 +57,9 @@ void TextureBaseOperation::initExecution() this->m_inputOffset = getInputSocketReader(0); this->m_inputSize = getInputSocketReader(1); this->m_pool = BKE_image_pool_new(); + if (this->m_texture->nodetree && this->m_texture->use_nodes) { + ntreeTexBeginExecTree(this->m_texture->nodetree); + } SingleThreadedOperation::initExecution(); } void TextureBaseOperation::deinitExecution() @@ -61,6 +68,13 @@ void TextureBaseOperation::deinitExecution() this->m_inputOffset = NULL; BKE_image_pool_free(this->m_pool); this->m_pool = NULL; + if (this->m_texture != NULL && + this->m_texture->use_nodes && + this->m_texture->nodetree != NULL && + this->m_texture->nodetree->execdata != NULL) + { + ntreeTexEndExecTree(this->m_texture->nodetree->execdata); + } SingleThreadedOperation::deinitExecution(); } @@ -82,7 +96,8 @@ void TextureAlphaOperation::executePixelSampled(float output[4], float x, float { float color[4]; TextureBaseOperation::executePixelSampled(color, x, y, sampler); - output[0] = color[3];} + output[0] = color[3]; +} void TextureBaseOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler) { -- cgit v1.2.3