diff options
author | Pablo Dobarro <pablodp606@gmail.com> | 2020-08-10 18:57:01 +0300 |
---|---|---|
committer | Pablo Dobarro <pablodp606@gmail.com> | 2020-08-10 19:04:00 +0300 |
commit | ed9c0464bae66411384c216ba3f34f65658e0f68 (patch) | |
tree | b0a5004801180bbf67ae220f92932d007397671f /source/blender/editors/sculpt_paint/sculpt_intern.h | |
parent | 71639cc8627fb26e50233b9bb942776a950b6ab1 (diff) |
Sculpt: Boundary Brush
This brush includes a set of deformation modes designed to deform and
control the shape of the mesh boundaries, which are really hard to do
with regular sculpt brushes (and even in edit mode). This is useful
for creating cloth assets and hard surface base meshes.
The brush detects the mesh boundary closest to the active vertex and
propagates the deformation using the brush falloff into the mesh.
It includes bend, expand, inflate, grab and twist deform modes.
The main use cases of this brush are the Bend and Expand deformation
modes, which depend on a grid topology to create the best results.
In order to do further adjustments and tweaks to the result of these
deformation modes, the brush also includes the Inflate, Grab and
Twist deformation modes, which do not depend that much on the topology.
Grab and Inflate are the same operation that is implemented in the
Grab and Inflate tools, they are also available in the boundary brush
as producing deformations with regular brushes in these areas is very
hard to control.
Even if this brush can produce deformations in triangle meshes and
meshes with a non-regular quad grid, the more regular and clean the
topology is, the better. Most of the assets this brush is intended to
deform are always created from a cylindrical or plane quad grid, so it
should be fine. Also, its algorithms can be improved in future versions
to handle more corner cases and topology patterns.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D8356
Diffstat (limited to 'source/blender/editors/sculpt_paint/sculpt_intern.h')
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt_intern.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt_intern.h b/source/blender/editors/sculpt_paint/sculpt_intern.h index 74feaa8ca00..79b1a5bde7b 100644 --- a/source/blender/editors/sculpt_paint/sculpt_intern.h +++ b/source/blender/editors/sculpt_paint/sculpt_intern.h @@ -392,6 +392,22 @@ struct SculptPoseIKChain *SCULPT_pose_ik_chain_init(struct Sculpt *sd, const float radius); void SCULPT_pose_ik_chain_free(struct SculptPoseIKChain *ik_chain); +/* Boundary Brush. */ +struct SculptBoundary *SCULPT_boundary_data_init(Object *object, + const int initial_vertex, + const float radius); +void SCULPT_boundary_data_free(struct SculptBoundary *bdata); +void SCULPT_do_boundary_brush(struct Sculpt *sd, + struct Object *ob, + struct PBVHNode **nodes, + int totnode); + +void SCULPT_boundary_edges_preview_draw(const uint gpuattr, + struct SculptSession *ss, + const float outline_col[3], + const float outline_alpha); +void SCULPT_boundary_pivot_line_preview_draw(const uint gpuattr, struct SculptSession *ss); + /* Multiplane Scrape Brush. */ void SCULPT_do_multiplane_scrape_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode); void SCULPT_multiplane_scrape_preview_draw(const uint gpuattr, @@ -630,6 +646,9 @@ typedef struct SculptThreadedTaskData { float transform_mats[8][4][4]; + /* Boundary brush */ + float boundary_deform_strength; + float cloth_time_step; SculptClothSimulation *cloth_sim; float *cloth_sim_initial_location; @@ -855,6 +874,9 @@ typedef struct StrokeCache { float initial_normal[3]; float true_initial_normal[3]; + /* Boundary brush */ + struct SculptBoundary *bdata[PAINT_SYMM_AREAS]; + /* Surface Smooth Brush */ /* Stores the displacement produced by the laplacian step of HC smooth. */ float (*surface_smooth_laplacian_disp)[3]; |