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:
authorJacques Lucke <jacques@blender.org>2022-02-18 11:12:41 +0300
committerJacques Lucke <jacques@blender.org>2022-02-18 11:14:54 +0300
commit61aaeb3745ad72c681c17f4535dd06ffaaf78c58 (patch)
treec843b445e3e68938aa8c1f5f704dc55eb2be5c6d /source/blender/makesrna
parent964d3a38fac8fd9ba90e6a94d26546f2d0651116 (diff)
Curves: initial brush system integration for curves sculpt mode
This adds the boilerplate code that is necessary to use the tool/brush/paint systems in the new sculpt curves mode. Two temporary dummy tools are part of this patch. They do nothing and only serve to test the boilerplate. When the first actual tool is added, those dummy tools will be removed. Differential Revision: https://developer.blender.org/D14117
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/RNA_enum_items.h1
-rw-r--r--source/blender/makesrna/intern/rna_brush.c11
-rw-r--r--source/blender/makesrna/intern/rna_sculpt_paint.c6
3 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/makesrna/RNA_enum_items.h b/source/blender/makesrna/RNA_enum_items.h
index 4b68416f5d7..eb899aae3de 100644
--- a/source/blender/makesrna/RNA_enum_items.h
+++ b/source/blender/makesrna/RNA_enum_items.h
@@ -107,6 +107,7 @@ DEF_ENUM(rna_enum_brush_gpencil_types_items)
DEF_ENUM(rna_enum_brush_gpencil_vertex_types_items)
DEF_ENUM(rna_enum_brush_gpencil_sculpt_types_items)
DEF_ENUM(rna_enum_brush_gpencil_weight_types_items)
+DEF_ENUM(rna_enum_brush_curves_sculpt_tool_items);
DEF_ENUM(rna_enum_brush_image_tool_items)
DEF_ENUM(rna_enum_axis_xy_items)
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c
index f3c7d2747ac..667114a3598 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -243,6 +243,12 @@ const EnumPropertyItem rna_enum_brush_gpencil_weight_types_items[] = {
{0, NULL, 0, NULL, NULL},
};
+const EnumPropertyItem rna_enum_brush_curves_sculpt_tool_items[] = {
+ {CURVES_SCULPT_TOOL_TEST1, "TEST1", ICON_NONE, "Test 1", ""},
+ {CURVES_SCULPT_TOOL_TEST2, "TEST2", ICON_NONE, "Test 2", ""},
+ {0, NULL, 0, NULL, NULL},
+};
+
#ifndef RNA_RUNTIME
static EnumPropertyItem rna_enum_gpencil_brush_eraser_modes_items[] = {
{GP_BRUSH_ERASER_SOFT,
@@ -2312,6 +2318,11 @@ static void rna_def_brush(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Grease Pencil Weight Paint Tool", "");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+ prop = RNA_def_property(srna, "curves_sculpt_tool", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, rna_enum_brush_curves_sculpt_tool_items);
+ RNA_def_property_ui_text(prop, "Curves Sculpt Tool", "");
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+
/** End per mode tool properties. */
prop = RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c
index 1e7c67ef95e..cb105c22987 100644
--- a/source/blender/makesrna/intern/rna_sculpt_paint.c
+++ b/source/blender/makesrna/intern/rna_sculpt_paint.c
@@ -352,6 +352,12 @@ static bool rna_Brush_mode_with_tool_poll(PointerRNA *ptr, PointerRNA value)
}
mode = OB_MODE_WEIGHT_GPENCIL;
}
+ else if (paint_contains_brush_slot(&ts->curves_sculpt->paint, tslot, &slot_index)) {
+ if (slot_index != brush->curves_sculpt_tool) {
+ return false;
+ }
+ mode = OB_MODE_SCULPT_CURVES;
+ }
return brush->ob_mode & mode;
}