diff options
author | Pablo Dobarro <pablodp606@gmail.com> | 2021-03-02 01:37:48 +0300 |
---|---|---|
committer | Pablo Dobarro <pablodp606@gmail.com> | 2021-03-02 18:53:56 +0300 |
commit | 82e7032477283a9bf2747ee607da7c5ba3eb8986 (patch) | |
tree | 743a44528168b9f2d688a96e72371831681e6c9e /source/blender/blenkernel | |
parent | 7f3649874070de38131263317d02906d50279f93 (diff) |
Sculpt: Expand Operator
Expand is a new operator for Sculpt Mode which is intended to be the main
tool for masking, Face Set editing, interacting with the filters and pattern
creation.
The fundamentals of the tool are similar to the previous sculpt.mask_expand
operator. It shares the same default shortcuts and functionality, making
the previous operator obsolete.
The shortcuts to execute the operator are:
- Shift + A: Expand mask
- Shift + Alt + A: Expand mask by normals
- Shift + W: Expand Face Set
- Shift + Alt + W: Resize current Face Set
The main changes compared to the previous sculpt.mask_expand operator are:
- Modal keymap, all operator options can be changed in real time while the
operator is running.
- Supports creating Mask, Face Sets and Sculpt Vertex Colors.
- Much better code, new features can be easily integrated.
Limitations:
- All Mask operations are supported for Sculpt Vertex colors, but not exposed
by default as their support is still experimental.
- Dyntopo does not support any Face Set or Sculpt Vertex Colors. functionality
(they are not implemented in general for Dyntopo).
- Multires does not support any feature related to geodesic distances.
- Multires does not support vertex colors.
- Multires does not support recursions.
- In Multires, Face Sets snaping does not initialize all current enabled Face
Sets when toggling snapping.
- In Multires, Face Sets are created at base mesh level (works by this by
design, like any other tool).
- Unlike the previous mask_expand operator, this one does not blur the mask
by default after finishing Expand as that does not fit the new design.
The mask can still be blurred by using the mask filter manually.
Reviewed By: JacquesLucke
Differential Revision: https://developer.blender.org/D10455
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_paint.h | 12 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/paint.c | 13 |
2 files changed, 24 insertions, 1 deletions
diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h index 4369f332c35..228b52123f3 100644 --- a/source/blender/blenkernel/BKE_paint.h +++ b/source/blender/blenkernel/BKE_paint.h @@ -469,10 +469,19 @@ typedef struct SculptSession { struct MPropCol *vcol; float *vmask; - /* Mesh connectivity */ + /* Mesh connectivity maps. */ + /* Vertices to adjacent polys. */ struct MeshElemMap *pmap; int *pmap_mem; + /* Edges to adjacent polys. */ + struct MeshElemMap *epmap; + int *epmap_mem; + + /* Vertices to adjacent edges. */ + struct MeshElemMap *vemap; + int *vemap_mem; + /* Mesh Face Sets */ /* Total number of polys of the base mesh. */ int totfaces; @@ -508,6 +517,7 @@ typedef struct SculptSession { struct StrokeCache *cache; struct FilterCache *filter_cache; + struct ExpandCache *expand_cache; /* Cursor data and active vertex for tools */ int active_vertex_index; diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c index d8fb2edb36d..08c5beedbf3 100644 --- a/source/blender/blenkernel/intern/paint.c +++ b/source/blender/blenkernel/intern/paint.c @@ -1422,6 +1422,12 @@ static void sculptsession_free_pbvh(Object *object) MEM_SAFE_FREE(ss->pmap); MEM_SAFE_FREE(ss->pmap_mem); + MEM_SAFE_FREE(ss->epmap); + MEM_SAFE_FREE(ss->epmap_mem); + + MEM_SAFE_FREE(ss->vemap); + MEM_SAFE_FREE(ss->vemap_mem); + MEM_SAFE_FREE(ss->persistent_base); MEM_SAFE_FREE(ss->preview_vert_index_list); @@ -1471,6 +1477,13 @@ void BKE_sculptsession_free(Object *ob) MEM_SAFE_FREE(ss->pmap); MEM_SAFE_FREE(ss->pmap_mem); + + MEM_SAFE_FREE(ss->epmap); + MEM_SAFE_FREE(ss->epmap_mem); + + MEM_SAFE_FREE(ss->vemap); + MEM_SAFE_FREE(ss->vemap_mem); + if (ss->bm_log) { BM_log_free(ss->bm_log); } |