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>2020-10-08 01:00:36 +0300
committerPablo Dobarro <pablodp606@gmail.com>2020-10-15 20:00:51 +0300
commit0d5ec990a9844e639fa6ab989b14b2e051ac8c42 (patch)
tree4130069e315263bcef6d66f2939c02fea13a6550 /source/blender/editors/sculpt_paint/sculpt_intern.h
parent6dda0779fcdef704a17ed3c0150073f77534d5e5 (diff)
Sculpt: Experimental Pen Tilt Support
This adds support for pen tilt in sculpt mode. For now, pen tilt is used by tweaking the tilt strength property, which controls how much the pen angle affects the sculpt normal. This is available in Draw, Draw Sharp, Flatten, Fill, Scrape and Clay Strips brushes, but it can be enabled in more tools later. The purpose of this patch is to have a usable implementation of pen tilt in a painting mode, so users can test and see in which hardware and platforms this feature is supported and how well it works. If it works ok, more tools and features that rely on pen tilt can be implemented, like brushes that blend between two deformations depending on the angle. Reviewed By: sergey Differential Revision: https://developer.blender.org/D8893
Diffstat (limited to 'source/blender/editors/sculpt_paint/sculpt_intern.h')
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_intern.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt_intern.h b/source/blender/editors/sculpt_paint/sculpt_intern.h
index 41982a441ad..6cdaafb548c 100644
--- a/source/blender/editors/sculpt_paint/sculpt_intern.h
+++ b/source/blender/editors/sculpt_paint/sculpt_intern.h
@@ -799,6 +799,11 @@ float SCULPT_brush_strength_factor(struct SculptSession *ss,
const int vertex_index,
const int thread_id);
+/* Tilts a normal by the x and y tilt values using the view axis. */
+void SCULPT_tilt_apply_to_normal(float r_normal[3],
+ struct StrokeCache *cache,
+ const float tilt_strength);
+
/* just for vertex paint. */
bool SCULPT_pbvh_calc_area_normal(const struct Brush *brush,
Object *ob,
@@ -852,6 +857,8 @@ typedef struct StrokeCache {
float mouse[2];
float bstrength;
float normal_weight; /* from brush (with optional override) */
+ float x_tilt;
+ float y_tilt;
float (*prev_colors)[4];