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...
This commit is contained in:
Bastien Montagne 2016-05-08 11:39:45 +02:00
parent 1955754934
commit 0411cfea9d
Notes: blender-bot 2023-02-14 11:21:43 +01:00
Referenced by issue #48373, Dynamic paint crash
1 changed files with 5 additions and 2 deletions

View File

@ -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)) {