Fix T47317: Dynamic paint crashes with no UV layer

This commit is contained in:
Campbell Barton 2016-02-04 14:17:52 +11:00
parent 24eecb00de
commit 50a19cc852
Notes: blender-bot 2023-02-14 08:15:57 +01:00
Referenced by issue #47317, Dynamic Paint image sequence bake crashes if mesh has no UV layer
Referenced by issue #47321, Driver gets lost when performing a Scripted Expression
Referenced by issue #47311, render crash
1 changed files with 4 additions and 2 deletions

View File

@ -2189,8 +2189,10 @@ int dynamicPaint_createUVSurface(Scene *scene, DynamicPaintSurface *surface)
tottri = dm->getNumLoopTri(dm);
/* get uv map */
CustomData_validate_layer_name(&dm->loopData, CD_MLOOPUV, surface->uvlayer_name, uvname);
mloopuv = CustomData_get_layer_named(&dm->loopData, CD_MLOOPUV, uvname);
if (CustomData_has_layer(&dm->loopData, CD_MLOOPUV)) {
CustomData_validate_layer_name(&dm->loopData, CD_MLOOPUV, surface->uvlayer_name, uvname);
mloopuv = CustomData_get_layer_named(&dm->loopData, CD_MLOOPUV, uvname);
}
/* Check for validity */
if (!mloopuv)