diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-05-08 12:39:45 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-05-08 12:39:45 +0300 |
commit | 0411cfea9d8bfcad6271ccec51bc9a9c641c798c (patch) | |
tree | e2a2cf4ee43b9c91954f5b3f59365b5a0f832825 /source/blender/blenkernel/intern/dynamicpaint.c | |
parent | 1955754934425de7a6c51fe71bf79e965035d28f (diff) |
Fix T48373: Crash when using dynamic paint with brush material.
`dynamicPaint_doMaterialTex` was called from inside an omp parallel section with brush->dm
itself, and not the local dm copy. Generating looptri data is not thread safe at all...
Diffstat (limited to 'source/blender/blenkernel/intern/dynamicpaint.c')
-rw-r--r-- | source/blender/blenkernel/intern/dynamicpaint.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c index dbf095d3832..0da2bb0b1c4 100644 --- a/source/blender/blenkernel/intern/dynamicpaint.c +++ b/source/blender/blenkernel/intern/dynamicpaint.c @@ -3466,8 +3466,11 @@ static int dynamicPaint_paintMesh(DynamicPaintSurface *surface, sampleColor[2] = brush->b; /* Get material+textures color on hit point if required */ - if (brush_usesMaterial(brush, scene)) - dynamicPaint_doMaterialTex(bMats, sampleColor, &alpha_factor, brushOb, bData->realCoord[bData->s_pos[index] + ss].v, hitCoord, hitTri, brush->dm); + if (brush_usesMaterial(brush, scene)) { + dynamicPaint_doMaterialTex(bMats, sampleColor, &alpha_factor, brushOb, + bData->realCoord[bData->s_pos[index] + ss].v, + hitCoord, hitTri, dm); + } /* Sample proximity colorband if required */ if ((hit_found == HIT_PROXIMITY) && (brush->proximity_falloff == MOD_DPAINT_PRFALL_RAMP)) { |