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-02-28 16:40:40 +0300
committerPablo Dobarro <pablodp606@gmail.com>2020-02-28 19:03:20 +0300
commit4a373afa5fb8f9eab92314fac1b140b7803f30fe (patch)
treeb546d18088f5c61441e770eae4e8c6e12a4d3ed9 /source/blender/makesdna/DNA_brush_types.h
parent793135e190c7450d30451617e9b8ae2d5ecec94a (diff)
Sculpt: Cloth brush
This brush has a simple physics solver that helps when sculpting cloth. - The mass and the damping properties of the simulation are properties of the brush. - It has two additional radius control to limit the influence and falloff of the simulation. - Masked vertices are pinned in the simulation, and it applies the sculpt gravity directly in the solver. - The Cloth Brush has 7 deformation modes with 2 falloff types (radial and plane). The brush can create the constraints only on the required PBVH nodes, so the simulation is isolated on high poly meshes. As long as the brush size is not too big it should be possible to keep it real time. Known issues: - The way constraints are created is extremely basic and it creates repeated constraints. Maybe there is another way to create fewer constraints while keeping the simulation quality decent. This part can also be multithreaded. (As it is it works ok, but it could be better) Reviewed By: jbakker Differential Revision: https://developer.blender.org/D6715
Diffstat (limited to 'source/blender/makesdna/DNA_brush_types.h')
-rw-r--r--source/blender/makesdna/DNA_brush_types.h31
1 files changed, 29 insertions, 2 deletions
diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_types.h
index a5baa7a5c75..e14732ee77a 100644
--- a/source/blender/makesdna/DNA_brush_types.h
+++ b/source/blender/makesdna/DNA_brush_types.h
@@ -210,6 +210,21 @@ typedef enum eBrushElasticDeformType {
BRUSH_ELASTIC_DEFORM_TWIST = 4,
} eBrushElasticDeformType;
+typedef enum eBrushClothDeformType {
+ BRUSH_CLOTH_DEFORM_DRAG = 0,
+ BRUSH_CLOTH_DEFORM_PUSH = 1,
+ BRUSH_CLOTH_DEFORM_GRAB = 2,
+ BRUSH_CLOTH_DEFORM_PINCH_POINT = 3,
+ BRUSH_CLOTH_DEFORM_PINCH_PERPENDICULAR = 4,
+ BRUSH_CLOTH_DEFORM_INFLATE = 5,
+ BRUSH_CLOTH_DEFORM_EXPAND = 6,
+} eBrushClothDeformType;
+
+typedef enum eBrushClothForceFalloffType {
+ BRUSH_CLOTH_FORCE_FALLOFF_RADIAL = 0,
+ BRUSH_CLOTH_FORCE_FALLOFF_PLANE = 1,
+} eBrushClothForceFalloffType;
+
typedef enum eAutomasking_flag {
BRUSH_AUTOMASKING_TOPOLOGY = (1 << 0),
} eAutomasking_flag;
@@ -291,7 +306,7 @@ typedef struct Brush {
/** Source for fill tool color gradient application. */
char gradient_fill_mode;
- char _pad0;
+ char _pad0[5];
/** Projection shape (sphere, circle). */
char falloff_shape;
@@ -311,7 +326,7 @@ typedef struct Brush {
char mask_tool;
/** Active grease pencil tool. */
char gpencil_tool;
- char _pad1[5];
+ char _pad1[1];
float autosmooth_factor;
@@ -343,6 +358,16 @@ typedef struct Brush {
int pose_smooth_iterations;
int pose_ik_segments;
+ /* cloth */
+ int cloth_deform_type;
+ int cloth_force_falloff_type;
+
+ float cloth_mass;
+ float cloth_damping;
+
+ float cloth_sim_limit;
+ float cloth_sim_falloff;
+
/* multiplane scrape */
float multiplane_scrape_angle;
@@ -512,6 +537,7 @@ typedef enum eBrushSculptTool {
SCULPT_TOOL_MULTIPLANE_SCRAPE = 23,
SCULPT_TOOL_SLIDE_RELAX = 24,
SCULPT_TOOL_CLAY_THUMB = 25,
+ SCULPT_TOOL_CLOTH = 26,
} eBrushSculptTool;
/* Brush.uv_sculpt_tool */
@@ -547,6 +573,7 @@ typedef enum eBrushUVSculptTool {
(ELEM(t, /* These brushes, as currently coded, cannot support dynamic topology */ \
SCULPT_TOOL_GRAB, \
SCULPT_TOOL_ROTATE, \
+ SCULPT_TOOL_CLOTH, \
SCULPT_TOOL_THUMB, \
SCULPT_TOOL_LAYER, \
SCULPT_TOOL_DRAW_SHARP, \