diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-02-04 06:17:52 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-02-04 06:19:32 +0300 |
commit | 50a19cc8524b1bb81e71e69595d737a93511b3bc (patch) | |
tree | 17d3209713dd045a301bcf64b71bb36ac2017607 /source/blender/blenkernel/intern | |
parent | 24eecb00de225377d5a77e082c1c4eab83f7eecd (diff) |
Fix T47317: Dynamic paint crashes with no UV layer
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/dynamicpaint.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c index 6c8eae69ccc..dbf095d3832 100644 --- a/source/blender/blenkernel/intern/dynamicpaint.c +++ b/source/blender/blenkernel/intern/dynamicpaint.c @@ -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) |