[Bf-blender-cvs] [08fe34b7fdc] blender-v2.83-release: Fix T91557: Texture Paint Stencil doesnt use assigned UV Layer

Philipp Oeser noreply at git.blender.org
Mon Sep 27 08:38:11 CEST 2021


Commit: 08fe34b7fdc982af0b01b8a0fecf39ed3e31f367
Author: Philipp Oeser
Date:   Tue Sep 21 13:11:08 2021 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rB08fe34b7fdc982af0b01b8a0fecf39ed3e31f367

Fix T91557: Texture Paint Stencil doesnt use assigned UV Layer

Choosing a UV layer would actually affect the overlay in the viewport
and also painting with the mask brush was in that UV space, but the
resulting stencil mask was always applied with the active UV (not the
explicitly selected stencil UV -- the one one is looking at in the
viewport!) to painting.

This has been like that as far as I have checked back (at least 2.79b),
I am surprised this has not come up before, but it does not seem to make
sense at all...

Now use the UV specified for the stencil layer when applying the mask for
painting, so it corresponds to the stencil mask one is looking at in the
viewport.

Maniphest Tasks: T91557

Differential Revision: https://developer.blender.org/D12583

===================================================================

M	source/blender/editors/sculpt_paint/paint_image_proj.c

===================================================================

diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c
index 92ca082311a..832f56738ce 100644
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@ -1670,7 +1670,9 @@ static float project_paint_uvpixel_mask(const ProjPaintState *ps,
 
     if (other_tpage && (ibuf_other = BKE_image_acquire_ibuf(other_tpage, NULL, NULL))) {
       const MLoopTri *lt_other = &ps->mlooptri_eval[tri_index];
-      const float *lt_other_tri_uv[3] = {PS_LOOPTRI_AS_UV_3(ps->poly_to_loop_uv, lt_other)};
+      const float *lt_other_tri_uv[3] = {ps->mloopuv_stencil_eval[lt_other->tri[0]].uv,
+                                         ps->mloopuv_stencil_eval[lt_other->tri[1]].uv,
+                                         ps->mloopuv_stencil_eval[lt_other->tri[2]].uv};
 
       /* BKE_image_acquire_ibuf - TODO - this may be slow */
       uchar rgba_ub[4];



More information about the Bf-blender-cvs mailing list