diff options
author | Pablo Dobarro <pablodp606@gmail.com> | 2020-03-05 16:53:23 +0300 |
---|---|---|
committer | Pablo Dobarro <pablodp606@gmail.com> | 2020-03-05 23:07:20 +0300 |
commit | 38d6533f212bf9001cd5f70ed8757eccb9b39dad (patch) | |
tree | 239533648a8f075e2d4697ff3b44ccad5deb766c /source/blender/draw/engines/overlay/overlay_sculpt.c | |
parent | e56471bcd3a5f0a9bdc369cc4ca9ceb061e321dd (diff) |
Sculpt Face Sets
Face Sets are the new system to control the visibility state of the mesh in sculpt and paint modes. They are designed to work in modes where brushes are the primary way of interaction and they provide much more control when working with meshes with complex shapes and overlapping surfaces.
This initial commit includes:
- Sculpt Face Sets data structures and PBVH rendering.
- Face Set overlay and opacity controls.
- Sculpt Undo support.
- Remesher reprojection support. The visibility state of the mesh is also preserved when remeshing.
- Automasking and Mesh filter support.
- Mask expand operator mode to expand Face Sets (Shift + W) and flood fill areas by connectivity (press Ctrl while expanding).
- Sculpt Mode Face Sets and Visibility API.
- Sculpt Face Sets creation and visibility management operators.
- Operator to randomize the Face Sets colors.
- Draw Face Sets brush tool to create and edit the Face Sets. Drawing on the mesh creates a new Face Set. Pressing Ctrl before drawing modifies the Face Set under the brush at the beginning of the stroke.
- Updated keymap and menu to work with Face Sets from Sculpt Mode (H to toggle visibility, Alt + H to show all, Shit + H to hide).
- Pie menu on the W key with Face common Sets operations.
Know limitations:
- Multires support. The Face Sets and Visibility API needs to be implemented for Multires.
Reviewed By: jbakker, #user_interface, Severin
Differential Revision: https://developer.blender.org/D6070
Diffstat (limited to 'source/blender/draw/engines/overlay/overlay_sculpt.c')
-rw-r--r-- | source/blender/draw/engines/overlay/overlay_sculpt.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/draw/engines/overlay/overlay_sculpt.c b/source/blender/draw/engines/overlay/overlay_sculpt.c index dc286d36e9e..ba37f56800b 100644 --- a/source/blender/draw/engines/overlay/overlay_sculpt.c +++ b/source/blender/draw/engines/overlay/overlay_sculpt.c @@ -34,12 +34,14 @@ void OVERLAY_sculpt_cache_init(OVERLAY_Data *vedata) OVERLAY_PrivateData *pd = vedata->stl->pd; DRWShadingGroup *grp; - DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_EQUAL | DRW_STATE_BLEND_ALPHA; + DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_EQUAL | DRW_STATE_BLEND_MUL; DRW_PASS_CREATE(psl->sculpt_mask_ps, state | pd->clipping_state); GPUShader *sh = OVERLAY_shader_sculpt_mask(); pd->sculpt_mask_grp = grp = DRW_shgroup_create(sh, psl->sculpt_mask_ps); DRW_shgroup_uniform_float_copy(grp, "maskOpacity", pd->overlay.sculpt_mode_mask_opacity); + DRW_shgroup_uniform_float_copy( + grp, "faceSetsOpacity", pd->overlay.sculpt_mode_face_sets_opacity); } void OVERLAY_sculpt_cache_populate(OVERLAY_Data *vedata, Object *ob) @@ -51,7 +53,7 @@ void OVERLAY_sculpt_cache_populate(OVERLAY_Data *vedata, Object *ob) const bool use_pbvh = BKE_sculptsession_use_pbvh_draw(ob, draw_ctx->v3d); if (use_pbvh || !ob->sculpt->deform_modifiers_active || ob->sculpt->shapekey_active) { - if (!use_pbvh || pbvh_has_mask(pbvh)) { + if (!use_pbvh || pbvh_has_mask(pbvh) || pbvh_has_face_sets(pbvh)) { DRW_shgroup_call_sculpt(pd->sculpt_mask_grp, ob, false, true, false); } } @@ -60,10 +62,10 @@ void OVERLAY_sculpt_cache_populate(OVERLAY_Data *vedata, Object *ob) void OVERLAY_sculpt_draw(OVERLAY_Data *vedata) { OVERLAY_PassList *psl = vedata->psl; - OVERLAY_FramebufferList *fbl = vedata->fbl; + DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get(); if (DRW_state_is_fbo()) { - GPU_framebuffer_bind(fbl->overlay_default_fb); + GPU_framebuffer_bind(dfbl->default_fb); } DRW_draw_pass(psl->sculpt_mask_ps); |