diff options
author | Pablo Dobarro <pablodp606@gmail.com> | 2020-04-14 22:06:49 +0300 |
---|---|---|
committer | Pablo Dobarro <pablodp606@gmail.com> | 2020-04-14 22:07:29 +0300 |
commit | 47f46637be1bef9672ede0ab6795a7e9ea97fc6a (patch) | |
tree | 224be030fb8f26e240715d74153e87d7668e3a7e /source/blender/blenkernel/BKE_paint.h | |
parent | 7dd8c889f18e9df5c86356fedb063e5ff9261577 (diff) |
Sculpt: New Layer Brush
The Layer brush was in Blender before 2.81, when the sculpt API was
introduced. It had a huge amount of bugs and glitches which made it
almost unusable for anything but the most trivial cases. Also, it needed
some hacks in the code just to support the persistent base.
The brush was completely rewritten using the Sculpt API. It fulfills the
same use case as the old one, but it has:
- All previous artifacts fixed
- Simpler code
- Persistent base now works with multires thanks to the sculpt API
- Small cursor widget to preview the layer height
- More controllable and smoother strength and deformation
- More correct masking support
- More predictable invert support. When using persistent base, the brush invert mode resets to layer height 0, instead of jumping from +1 to -1. The brush can still be inverted in the brush direction property.
Reviewed By: jbakker
Differential Revision: https://developer.blender.org/D7147
Diffstat (limited to 'source/blender/blenkernel/BKE_paint.h')
-rw-r--r-- | source/blender/blenkernel/BKE_paint.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h index 012188bed96..f78a142704b 100644 --- a/source/blender/blenkernel/BKE_paint.h +++ b/source/blender/blenkernel/BKE_paint.h @@ -279,6 +279,12 @@ typedef struct SculptClothSimulation { } SculptClothSimulation; +typedef struct SculptLayerPersistentBase { + float co[3]; + float no[3]; + float disp; +} SculptLayerPersistentBase; + /* Session data (mode-specific) */ typedef struct SculptSession { @@ -329,9 +335,6 @@ typedef struct SculptSession { unsigned int texcache_side, *texcache, texcache_actual; struct ImagePool *tex_pool; - /* Layer brush persistence between strokes */ - float (*layer_co)[3]; /* Copy of the mesh vertices' locations */ - struct StrokeCache *cache; struct FilterCache *filter_cache; @@ -359,6 +362,10 @@ typedef struct SculptSession { float pose_origin[3]; SculptPoseIKChain *pose_ik_chain_preview; + /* Layer brush persistence between strokes */ + /* This is freed with the PBVH, so it is always in sync with the mesh. */ + SculptLayerPersistentBase *layer_base; + /* Transform operator */ float pivot_pos[3]; float pivot_rot[4]; |