[Bf-blender-cvs] [889a0707c19] greasepencil-object: Make boundary lines display optional
Antonio Vazquez
noreply at git.blender.org
Wed Jan 3 19:25:59 CET 2018
Commit: 889a0707c19ac9c8e7912f0dda4d65d8a0e62ad8
Author: Antonio Vazquez
Date: Wed Jan 3 19:21:47 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rB889a0707c19ac9c8e7912f0dda4d65d8a0e62ad8
Make boundary lines display optional
Now the red lines display that help to show the boundary of strokes is optional.
===================================================================
M release/scripts/startup/bl_ui/properties_grease_pencil_common.py
M source/blender/editors/gpencil/gpencil_fill.c
M source/blender/makesdna/DNA_gpencil_types.h
M source/blender/makesrna/intern/rna_scene.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
index f3af97c4897..bb248de1ddc 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -387,6 +387,8 @@ class GreasePencilBrushPanel:
row.prop(brush, "fill_leak", text="Leak Size")
row = layout.row(align=True)
row.prop(brush, "fill_hide", text="Hide Lines")
+ row = layout.row(align=True)
+ row.prop(brush, "fill_show_boundary", text="Show Boundary Lines")
class GreasePencilBrushOptionsPanel:
diff --git a/source/blender/editors/gpencil/gpencil_fill.c b/source/blender/editors/gpencil/gpencil_fill.c
index 05f2f188210..ca093ed9539 100644
--- a/source/blender/editors/gpencil/gpencil_fill.c
+++ b/source/blender/editors/gpencil/gpencil_fill.c
@@ -927,7 +927,9 @@ static int gpencil_fill_invoke(bContext *C, wmOperator *op, const wmEvent *event
}
/* Enable custom drawing handlers */
- tgpf->draw_handle_3d = ED_region_draw_cb_activate(tgpf->ar->type, gpencil_fill_draw_3d, tgpf, REGION_DRAW_POST_VIEW);
+ if (tgpf->flag & GP_BRUSH_FILL_SHOW_BOUNDARY) {
+ tgpf->draw_handle_3d = ED_region_draw_cb_activate(tgpf->ar->type, gpencil_fill_draw_3d, tgpf, REGION_DRAW_POST_VIEW);
+ }
WM_cursor_modal_set(CTX_wm_window(C), BC_PAINTBRUSHCURSOR);
@@ -962,7 +964,7 @@ static int gpencil_fill_modal(bContext *C, wmOperator *op, const wmEvent *event)
}
if ELEM(event->type, LEFTMOUSE) {
/* first time the event is not enabled to show help lines */
- if (tgpf->oldkey != -1) {
+ if ((tgpf->oldkey != -1) || ((tgpf->flag & GP_BRUSH_FILL_SHOW_BOUNDARY) == 0)) {
ARegion *ar = BKE_area_find_region_xy(CTX_wm_area(C), RGN_TYPE_ANY, event->x, event->y);
if (ar) {
rcti region_rect;
diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h
index 491cf0f75f1..0f0249fc037 100644
--- a/source/blender/makesdna/DNA_gpencil_types.h
+++ b/source/blender/makesdna/DNA_gpencil_types.h
@@ -148,6 +148,8 @@ typedef enum eGPDbrush_Flag {
GP_BRUSH_FILL_ONLY = (1 << 7),
/* fill hide transparent */
GP_BRUSH_FILL_HIDE = (1 << 8),
+ /* fill show boundary lines */
+ GP_BRUSH_FILL_SHOW_BOUNDARY = (1 << 9),
} eGPDbrush_Flag;
/* ***************************************** */
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 7bcbd9d87f8..ad9d42ac56e 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -2362,6 +2362,11 @@ static void rna_def_gpencil_brush(BlenderRNA *brna)
RNA_def_property_boolean_default(prop, true);
RNA_def_property_ui_text(prop, "Fill Only", "The brush is only for filling strokes");
+ prop = RNA_def_property(srna, "fill_show_boundary", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_BRUSH_FILL_SHOW_BOUNDARY);
+ RNA_def_property_boolean_default(prop, true);
+ RNA_def_property_ui_text(prop, "Show Boundary Lines", "Show help lines to visualize stroke boundaries");
+
prop = RNA_def_property(srna, "fill_hide", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_BRUSH_FILL_HIDE);
RNA_def_property_boolean_default(prop, true);
More information about the Bf-blender-cvs
mailing list