diff options
author | Jeroen Bakker <j.bakker@atmind.nl> | 2020-05-12 14:59:16 +0300 |
---|---|---|
committer | Jeroen Bakker <j.bakker@atmind.nl> | 2020-05-12 17:21:38 +0300 |
commit | be4b3c64ad76a4bf12ac1cbcd948f8d9bc7be20e (patch) | |
tree | 04bcdf4c15c81c8fb4a38362cccc042ef408b65c /source | |
parent | 8da7ab11cf63d36577b5bd1e96bae637b0bd464c (diff) |
Fix T74694: Sculpt Mask Influences Weight/Vertex Paint Drawing
Sculpt overlay assumed that the sculpt session was always in sculpt
mode. But the sculpt session was also used for Vertex/Weight painting.
This resulted that when a mask was defined in the sculpt mode this
resulted into render artifacts.
This patch adds a check to see if the object has a sculpt session for
OB_MODE_SCULPT.
Reviewed By: Clément Foucault
Differential Revision: https://developer.blender.org/D7704
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/BKE_paint.h | 2 | ||||
-rw-r--r-- | source/blender/draw/engines/overlay/overlay_engine.c | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h index 7822f285c3b..a354cb52f59 100644 --- a/source/blender/blenkernel/BKE_paint.h +++ b/source/blender/blenkernel/BKE_paint.h @@ -402,7 +402,7 @@ typedef struct SculptSession { /* TODO: identify sculpt-only fields */ // struct { ... } sculpt; } mode; - int mode_type; + eObjectMode mode_type; /* This flag prevents PBVH from being freed when creating the vp_handle for texture paint. */ bool building_vp_handle; diff --git a/source/blender/draw/engines/overlay/overlay_engine.c b/source/blender/draw/engines/overlay/overlay_engine.c index 395ea9f9a8f..e875f2c8291 100644 --- a/source/blender/draw/engines/overlay/overlay_engine.c +++ b/source/blender/draw/engines/overlay/overlay_engine.c @@ -30,6 +30,7 @@ #include "ED_view3d.h" #include "BKE_object.h" +#include "BKE_paint.h" #include "overlay_engine.h" #include "overlay_private.h" @@ -237,7 +238,8 @@ static void OVERLAY_cache_populate(void *vedata, Object *ob) const bool in_particle_edit_mode = ob->mode == OB_MODE_PARTICLE_EDIT; const bool in_paint_mode = (ob == draw_ctx->obact) && (draw_ctx->object_mode & OB_MODE_ALL_PAINT); - const bool in_sculpt_mode = (ob == draw_ctx->obact) && (ob->sculpt != NULL); + const bool in_sculpt_mode = (ob == draw_ctx->obact) && (ob->sculpt != NULL) && + (ob->sculpt->mode_type == OB_MODE_SCULPT); const bool has_surface = ELEM(ob->type, OB_MESH, OB_CURVE, |