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-08-25 00:26:37 +0300
committerPablo Dobarro <pablodp606@gmail.com>2020-08-25 00:28:01 +0300
commit46eca3366efbdc83e4dcfbd9ac4cd23f70da6399 (patch)
treecf37cc05e13f6355d4c6bb0b93c4a45db189c800 /source/blender/blenkernel/BKE_paint.h
parent5a634735e6e2fe805b639b03168afa983c52fa5b (diff)
Sculpt: Cloth Snake Hook Brush
This implements Snake Hook as a deform type for the cloth brush. This brush changes the strength of the deformation constraints per brush step to avoid affecting the results of the simulation as much as possible. It allows to grab the cloth without producing any artifacts in the surface and create more natural looking folds than any of the other deformation modes. Reviewed By: sergey Differential Revision: https://developer.blender.org/D8621
Diffstat (limited to 'source/blender/blenkernel/BKE_paint.h')
-rw-r--r--source/blender/blenkernel/BKE_paint.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h
index b2794e9d9d6..dfc75e2fd54 100644
--- a/source/blender/blenkernel/BKE_paint.h
+++ b/source/blender/blenkernel/BKE_paint.h
@@ -259,6 +259,16 @@ typedef struct SculptPoseIKChain {
/* Cloth Brush */
+typedef enum eSculptClothConstraintType {
+ /* Constraint that creates the structure of the cloth. */
+ SCULPT_CLOTH_CONSTRAINT_STRUCTURAL = 0,
+ /* 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. */
+ SCULPT_CLOTH_CONSTRAINT_SOFTBODY = 2,
+} eSculptClothConstraintType;
+
typedef struct SculptClothLengthConstraint {
/* Elements that are affected by the constraint. */
/* Element a should always be a mesh vertex with the index stored in elem_index_a as it is always
@@ -274,6 +284,8 @@ typedef struct SculptClothLengthConstraint {
float length;
float strength;
+
+ eSculptClothConstraintType type;
} SculptClothLengthConstraint;
typedef struct SculptClothSimulation {
@@ -287,6 +299,7 @@ typedef struct SculptClothSimulation {
* final positions of the simulated vertices are updated with constraints that use these points
* as targets. */
float (*deformation_pos)[3];
+ float *deformation_strength;
float mass;
float damping;