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:
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r--source/blender/makesrna/intern/rna_brush.c33
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c5
2 files changed, 38 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c
index 70d613f8b21..eed278c3980 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -557,6 +557,19 @@ static bool rna_BrushCapabilitiesSculpt_has_gravity_get(PointerRNA *ptr)
return !ELEM(br->sculpt_tool, SCULPT_TOOL_MASK, SCULPT_TOOL_SMOOTH);
}
+static bool rna_BrushCapabilitiesSculpt_has_tilt_get(PointerRNA *ptr)
+{
+ Brush *br = (Brush *)ptr->data;
+ return ELEM(br->sculpt_tool,
+ SCULPT_TOOL_DRAW,
+ SCULPT_TOOL_DRAW_SHARP,
+ SCULPT_TOOL_FLATTEN,
+ SCULPT_TOOL_FILL,
+ SCULPT_TOOL_SCRAPE,
+ SCULPT_TOOL_CLAY_STRIPS,
+ SCULPT_TOOL_CLAY_THUMB);
+}
+
static bool rna_TextureCapabilities_has_texture_angle_source_get(PointerRNA *ptr)
{
MTex *mtex = (MTex *)ptr->data;
@@ -1137,6 +1150,7 @@ static void rna_def_sculpt_capabilities(BlenderRNA *brna)
SCULPT_TOOL_CAPABILITY(has_strength_pressure, "Has Strength Pressure");
SCULPT_TOOL_CAPABILITY(has_direction, "Has Direction");
SCULPT_TOOL_CAPABILITY(has_gravity, "Has Gravity");
+ SCULPT_TOOL_CAPABILITY(has_tilt, "Has Tilt");
# undef SCULPT_CAPABILITY
}
@@ -2796,6 +2810,15 @@ static void rna_def_brush(BlenderRNA *brna)
"Best used on low-poly meshes as it has a performance impact");
RNA_def_property_update(prop, 0, "rna_Brush_update");
+ prop = RNA_def_property(srna, "tilt_strength_factor", PROP_FLOAT, PROP_FACTOR);
+ RNA_def_property_float_sdna(prop, NULL, "tilt_strength_factor");
+ RNA_def_property_float_default(prop, 0);
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
+ RNA_def_property_ui_text(
+ prop, "Tilt Strength", "How much the tilt of the pen will affect the brush");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
+
prop = RNA_def_property(srna, "normal_radius_factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "normal_radius_factor");
RNA_def_property_range(prop, 0.0f, 2.0f);
@@ -3417,6 +3440,16 @@ static void rna_def_operator_stroke_element(BlenderRNA *brna)
RNA_def_property_flag(prop, PROP_IDPROPERTY);
RNA_def_property_ui_text(prop, "Flip", "");
+ prop = RNA_def_property(srna, "x_tilt", PROP_FLOAT, PROP_FACTOR);
+ RNA_def_property_flag(prop, PROP_IDPROPERTY);
+ RNA_def_property_range(prop, -1.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Tilt X", "");
+
+ prop = RNA_def_property(srna, "y_tilt", PROP_FLOAT, PROP_FACTOR);
+ RNA_def_property_flag(prop, PROP_IDPROPERTY);
+ RNA_def_property_range(prop, -1.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Tilt Y", "");
+
/* used in uv painting */
prop = RNA_def_property(srna, "time", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_flag(prop, PROP_IDPROPERTY);
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 633611b9e50..6698e0ff237 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -6178,6 +6178,11 @@ static void rna_def_userdef_experimental(BlenderRNA *brna)
prop = RNA_def_property(srna, "use_tools_missing_icons", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "use_tools_missing_icons", 1);
RNA_def_property_ui_text(prop, "Tools with Missing Icons", "Show tools with missing icons");
+
+ prop = RNA_def_property(srna, "use_sculpt_tools_tilt", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "use_sculpt_tools_tilt", 1);
+ RNA_def_property_ui_text(
+ prop, "Sculpt Mode Tilt Support", "Support for pen tablet tilt events in Sculpt Mode");
}
static void rna_def_userdef_addon_collection(BlenderRNA *brna, PropertyRNA *cprop)