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-10-13 00:24:45 +0300
committerPablo Dobarro <pablodp606@gmail.com>2020-10-13 22:53:07 +0300
commitec9edd36ca1f8f73373435a7941abff77df53719 (patch)
tree4f8c7b5bea8b3337fa5ce01991610dfd4c855c46 /source/blender/blenkernel/BKE_paint.h
parent9722e369cd42532bc41c6ad884c71d88a8f547a9 (diff)
Sculpt: Use plasticity for softbody influence
Previously the softbody strength property was controlling the strength of the constraints that pin all vertices to the original location. This was causing problems when the forces were trying to deform the vertices too much, like when using gravity or grab brushes. Now softbody is implemented with plasticity, which creates constraints to a separate coordinates array. These coordinates are deformed with the simulation, and the plasticity parameter controls how much the simulation moves the coordinates (plasticity 0), or the coordinates move the simulation back to its previous position (plasticity 1). This creates much better and predictable results and adding softbody plasticity to the brushes can increase its control and the stability of the simulation. Reviewed By: sergey, zeddb Differential Revision: https://developer.blender.org/D9187
Diffstat (limited to 'source/blender/blenkernel/BKE_paint.h')
-rw-r--r--source/blender/blenkernel/BKE_paint.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h
index a7a837406ac..64910e5f1a9 100644
--- a/source/blender/blenkernel/BKE_paint.h
+++ b/source/blender/blenkernel/BKE_paint.h
@@ -272,8 +272,11 @@ typedef enum eSculptClothConstraintType {
/* Constraint that references the position of a vertex and a position in deformation_pos which
can be deformed by the tools. */
SCULPT_CLOTH_CONSTRAINT_DEFORMATION = 1,
- /* Constarint that references the vertex position and its initial position. */
+ /* Constarint that references the vertex position and a editable softbody position for
+ plasticity. */
SCULPT_CLOTH_CONSTRAINT_SOFTBODY = 2,
+ /* Constarint that references the vertex position and its initial position. */
+ SCULPT_CLOTH_CONSTRAINT_PIN = 3,
} eSculptClothConstraintType;
typedef struct SculptClothLengthConstraint {
@@ -314,10 +317,12 @@ typedef struct SculptClothSimulation {
float mass;
float damping;
+ float softbody_strength;
float (*acceleration)[3];
float (*pos)[3];
float (*init_pos)[3];
+ float (*softbody_pos)[3];
float (*prev_pos)[3];
float (*last_iteration_pos)[3];