Fix T39435 paint overlay not always getting correctly refreshed.

Initialize the nodetree first, like paint stroke does.
This commit is contained in:
Antonis Ryakiotakis 2014-03-27 12:09:50 +02:00
parent eca6264ab0
commit 688257d1a2
Notes: blender-bot 2023-02-14 10:54:26 +01:00
Referenced by issue #39435, Painting Overlay update issue with node texture
1 changed files with 7 additions and 0 deletions

View File

@ -45,6 +45,7 @@
#include "BKE_brush.h"
#include "BKE_context.h"
#include "BKE_image.h"
#include "BKE_node.h"
#include "BKE_paint.h"
#include "BKE_colortools.h"
@ -197,6 +198,9 @@ static int load_tex(Brush *br, ViewContext *vc, float zoom, bool col, bool prima
pool = BKE_image_pool_new();
if (mtex->tex && mtex->tex->nodetree)
ntreeTexBeginExecTree(mtex->tex->nodetree); /* has internal flag to detect it only does it once */
#pragma omp parallel for schedule(static)
for (j = 0; j < size; j++) {
int i;
@ -272,6 +276,9 @@ static int load_tex(Brush *br, ViewContext *vc, float zoom, bool col, bool prima
}
}
if (mtex->tex && mtex->tex->nodetree)
ntreeTexEndExecTree(mtex->tex->nodetree->execdata);
if (pool)
BKE_image_pool_free(pool);