Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Dobarro <pablodp606@gmail.com>2020-07-30 02:36:12 +0300
committerPablo Dobarro <pablodp606@gmail.com>2020-07-30 16:59:35 +0300
commit49c1359b5568109244aac384f8e50e5bb12da95f (patch)
tree7ef457d3c73fbd6c4961ddecbaab011d94842693 /source/blender/editors/sculpt_paint/sculpt.c
parent27b643d27adc0b135df2b69794885778ca5b5718 (diff)
Sculpt: Enable persistent base for the cloth brush
The cloth brush builds the constraints when the stroke starts usign the current state of the mesh. This means that deformations profuced by the simulattion will accumulate after multiple strokes as it will always start from the previous deformed state. While this is useful in many cases, for other uses it is convenient to always simulate the same initial shape, but applying different forces to it. The persistent base options work like the persistent base in the layer brush and allows the cloth brush to not accumulate deformation after each stroke. When enabled, constraints are created for the shape stored in the persistent base instead of from the current state of the mesh. Reviewed By: sergey Differential Revision: https://developer.blender.org/D8428
Diffstat (limited to 'source/blender/editors/sculpt_paint/sculpt.c')
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 92beb396629..2c110e23ac0 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -196,7 +196,7 @@ void SCULPT_vertex_normal_get(SculptSession *ss, int index, float no[3])
}
}
-static const float *sculpt_vertex_persistent_co_get(SculptSession *ss, int index)
+const float *SCULPT_vertex_persistent_co_get(SculptSession *ss, int index)
{
if (ss->persistent_base) {
return ss->persistent_base[index].co;
@@ -204,7 +204,7 @@ static const float *sculpt_vertex_persistent_co_get(SculptSession *ss, int index
return SCULPT_vertex_co_get(ss, index);
}
-static void sculpt_vertex_persistent_normal_get(SculptSession *ss, int index, float no[3])
+void SCULPT_vertex_persistent_normal_get(SculptSession *ss, int index, float no[3])
{
if (ss->persistent_base) {
copy_v3_v3(no, ss->persistent_base[index].no);
@@ -4341,9 +4341,9 @@ static void do_layer_brush_task_cb_ex(void *__restrict userdata,
float normal[3];
if (use_persistent_base) {
- sculpt_vertex_persistent_normal_get(ss, vi, normal);
+ SCULPT_vertex_persistent_normal_get(ss, vi, normal);
mul_v3_fl(normal, brush->height);
- madd_v3_v3v3fl(final_co, sculpt_vertex_persistent_co_get(ss, vi), normal, *disp_factor);
+ madd_v3_v3v3fl(final_co, SCULPT_vertex_persistent_co_get(ss, vi), normal, *disp_factor);
}
else {
normal_short_to_float_v3(normal, orig_data.no);