diff options
author | Pablo Dobarro <pablodp606@gmail.com> | 2020-03-26 17:50:03 +0300 |
---|---|---|
committer | Pablo Dobarro <pablodp606@gmail.com> | 2020-03-26 17:50:25 +0300 |
commit | 458f50ba73bcd233176f9afadc3273acf05e4f53 (patch) | |
tree | 6367e23772dfec1735d6b93c159ea1df3ac874ac /source/blender/gpu/intern/gpu_buffers.c | |
parent | 83947ea2537086d0ebb233414447dea2a9d1404c (diff) |
Fix T74780: Face sets operators not aware of SCULPT_FACE_SET_NONE
SCULPT_FACE_SET_NONE default value is 0 and it is rendered hidden, so
the invert sign operation to show it was not working. Now the show all
function sets this face set to ID 1 before setting its sign.
I also refactored this check in gpu_buffers.
Not related to the reported issue, but the mesh in attached contains non
manifold geometry with hidden loose vertices, so the visibility state
was not syncing correctly to those vertices. Now the toggle operators
checks the current visibility only on the face sets, so no manifold
vertices are ignored (as they are in the rest of operations in sculpt
mode).
Reviewed By: jbakker
Maniphest Tasks: T74780
Differential Revision: https://developer.blender.org/D7188
Diffstat (limited to 'source/blender/gpu/intern/gpu_buffers.c')
-rw-r--r-- | source/blender/gpu/intern/gpu_buffers.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c index 3dc5052d472..d06d11023b6 100644 --- a/source/blender/gpu/intern/gpu_buffers.c +++ b/source/blender/gpu/intern/gpu_buffers.c @@ -206,6 +206,15 @@ static void face_set_overlay_color_get(const int face_set, const int seed, uchar rgba_float_to_uchar(r_color, rgba); } +static bool gpu_pbvh_is_looptri_visible(const MLoopTri *lt, + const MVert *mvert, + const MLoop *mloop, + const int *sculpt_face_sets) +{ + return (!paint_is_face_hidden(lt, mvert, mloop) && sculpt_face_sets && + sculpt_face_sets[lt->poly] > SCULPT_FACE_SET_NONE); +} + /* Threaded - do not call any functions that use OpenGL calls! */ void GPU_pbvh_mesh_buffers_update(GPU_PBVH_Buffers *buffers, const MVert *mvert, @@ -315,11 +324,7 @@ void GPU_pbvh_mesh_buffers_update(GPU_PBVH_Buffers *buffers, buffers->mloop[lt->tri[2]].v, }; - if (paint_is_face_hidden(lt, mvert, buffers->mloop)) { - continue; - } - - if (sculpt_face_sets[lt->poly] <= 0) { + if (!gpu_pbvh_is_looptri_visible(lt, mvert, buffers->mloop, sculpt_face_sets)) { continue; } @@ -384,15 +389,6 @@ void GPU_pbvh_mesh_buffers_update(GPU_PBVH_Buffers *buffers, buffers->mvert = mvert; } -static bool gpu_pbvh_is_looptri_visible(const MLoopTri *lt, - const MVert *mvert, - const MLoop *mloop, - const int *sculpt_face_sets) -{ - return (!paint_is_face_hidden(lt, mvert, mloop) && sculpt_face_sets && - sculpt_face_sets[lt->poly] > 0); -} - /* Threaded - do not call any functions that use OpenGL calls! */ GPU_PBVH_Buffers *GPU_pbvh_mesh_buffers_build(const int (*face_vert_indices)[3], const MPoly *mpoly, |