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:
authorAntonio Vazquez <blendergit@gmail.com>2021-08-04 16:54:54 +0300
committerAntonio Vazquez <blendergit@gmail.com>2021-08-04 16:54:54 +0300
commitc1730ed16568784552678908becfad2389ac391f (patch)
treef6e202d2173c4026658c6597091365bc8b88dad4 /source/blender/makesrna/intern/rna_brush.c
parent145270d8d7c6812de9fd1ba50cc51ffc53953881 (diff)
GPencil: New Brush option to define Caps type
This is used to set the default caps type for the stroke. Before always was rounded and only could be changed later in Edit mode Two new buttons has been added to topbar. NOTE: New icons are been designed (T90414) The buttons are expanded to list in Properties panel. Reviewed By: mendio, HooglyBoogly Differential Revision: https://developer.blender.org/D11999
Diffstat (limited to 'source/blender/makesrna/intern/rna_brush.c')
-rw-r--r--source/blender/makesrna/intern/rna_brush.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c
index 2b09ea51a84..eb968f9ecde 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -1281,6 +1281,12 @@ static void rna_def_gpencil_options(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL},
};
+ static EnumPropertyItem rna_enum_gpencil_brush_caps_types_items[] = {
+ {GP_STROKE_CAP_ROUND, "ROUND", ICON_HANDLETYPE_AUTO_CLAMP_VEC, "Round", ""},
+ {GP_STROKE_CAP_FLAT, "FLAT", ICON_HANDLETYPE_VECTOR_VEC, "Flat", ""},
+ {0, NULL, 0, NULL, NULL},
+ };
+
srna = RNA_def_struct(brna, "BrushGpencilSettings", NULL);
RNA_def_struct_sdna(srna, "BrushGpencilSettings");
RNA_def_struct_path_func(srna, "rna_BrushGpencilSettings_path");
@@ -1750,6 +1756,12 @@ static void rna_def_gpencil_options(BlenderRNA *brna)
RNA_def_property_update(
prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_eraser_mode_update");
+ prop = RNA_def_property(srna, "caps_type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "caps_type");
+ RNA_def_property_enum_items(prop, rna_enum_gpencil_brush_caps_types_items);
+ RNA_def_property_ui_text(prop, "Caps Type", "The shape of the start and end of the stroke");
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+
prop = RNA_def_property(srna, "fill_draw_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "fill_draw_mode");
RNA_def_property_enum_items(prop, rna_enum_gpencil_fill_draw_modes_items);