From ecafd43f41e4b3b349dd09fd723b4eaa2bca02fc Mon Sep 17 00:00:00 2001 From: JannisX11 Date: Wed, 29 May 2024 19:47:37 +0200 Subject: [PATCH] Fix rare mesh painting issue --- js/texturing/painter.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/js/texturing/painter.js b/js/texturing/painter.js index 47014072..65eb9e31 100644 --- a/js/texturing/painter.js +++ b/js/texturing/painter.js @@ -285,6 +285,7 @@ const Painter = { delete Painter.current.texture; delete Painter.current.textures; delete Painter.current.uv_rects; + delete Painter.current.uv_islands; Painter.painting = false; Painter.currentPixel = [-1, -1]; }, @@ -331,6 +332,7 @@ const Painter = { let island = Painter.getMeshUVIsland(Painter.current.face, current_face); island.forEach(fkey => { let face = Mesh.selected[0].faces[fkey]; + if (!face) return; for (let vkey in face.uv) { min_x = Math.min(min_x, face.uv[vkey][0]); max_x = Math.max(max_x, face.uv[vkey][0]); min_y = Math.min(min_y, face.uv[vkey][1]); max_y = Math.max(max_y, face.uv[vkey][1]);