Fix texture paint crash when painting onto stencil
authorCampbell Barton <ideasman42@gmail.com>
Thu, 13 Jul 2017 10:48:55 +0000 (20:48 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 13 Jul 2017 10:50:02 +0000 (20:50 +1000)
source/blender/editors/sculpt_paint/paint_image_proj.c

index d0f1cc99b8d92e8fe22140a57c4a27d184e43b15..b43581170d0fc6fd31ddd5dd02d4a8620208d4ce 100644 (file)
@@ -3712,8 +3712,12 @@ static void project_paint_prepare_all_faces(
                                }
 
                                /* don't allow using the same inage for painting and stencilling */
-                               if (slot->ima == ps->stencil_ima)
+                               if (slot->ima == ps->stencil_ima) {
+                                       /* While this shouldn't be used, face-winding reads all polys.
+                                        * It's less trouble to set all faces to valid UV's, avoiding NULL checks all over. */
+                                       ps->dm_mloopuv[lt->poly] = mloopuv_base;
                                        continue;
+                               }
                                
                                tpage = slot->ima;
                        }