[Bf-blender-cvs] [92eb3572c54] greasepencil-object: Add Shift+Q to enable only multiedit lines
Antonio Vazquez
noreply at git.blender.org
Thu Aug 31 11:11:39 CEST 2017
Commit: 92eb3572c548e48a91264b2f98e249f3e2469a60
Author: Antonio Vazquez
Date: Thu Aug 31 11:11:05 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rB92eb3572c548e48a91264b2f98e249f3e2469a60
Add Shift+Q to enable only multiedit lines
===================================================================
M release/scripts/startup/bl_ui/space_view3d.py
M source/blender/editors/gpencil/gpencil_edit.c
M source/blender/editors/gpencil/gpencil_ops.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index 40958f3e626..7a2bc360b62 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -165,8 +165,9 @@ class VIEW3D_HT_header(Header):
row.prop(context.tool_settings.gpencil_sculpt, "selection_alpha", slider=True)
gpd = context.gpencil_data
- row = layout.row()
+ row = layout.row(align=True)
row.prop(gpd, "multiedit", text="Multi Edit", icon="FORCE_HARMONIC")
+ row.prop(gpd, "multiedit_line_only", text="", icon="GHOST")
class VIEW3D_MT_editor_menus(Menu):
diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c
index 97a2320e2a8..58c5183ef61 100644
--- a/source/blender/editors/gpencil/gpencil_edit.c
+++ b/source/blender/editors/gpencil/gpencil_edit.c
@@ -530,15 +530,21 @@ void GPENCIL_OT_selection_opacity_toggle(wmOperatorType *ot)
}
/* toggle multi edit strokes support */
-static int gpencil_multiedit_toggle_exec(bContext *C, wmOperator *UNUSED(op))
+static int gpencil_multiedit_toggle_exec(bContext *C, wmOperator *op)
{
bGPdata *gpd = ED_gpencil_data_get_active(C);
+ const int lines = RNA_int_get(op->ptr, "lines");
if (gpd == NULL)
return OPERATOR_CANCELLED;
/* Just toggle value */
- gpd->flag ^= GP_DATA_STROKE_MULTIEDIT;
+ if (lines == 0) {
+ gpd->flag ^= GP_DATA_STROKE_MULTIEDIT;
+ }
+ else {
+ gpd->flag ^= GP_DATA_STROKE_MULTIEDIT_LINES;
+ }
WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | ND_GPENCIL_EDITMODE, NULL);
WM_event_add_notifier(C, NC_SCENE | ND_MODE, NULL);
@@ -559,6 +565,9 @@ void GPENCIL_OT_multiedit_toggle(wmOperatorType *ot)
/* flags */
ot->flag = OPTYPE_UNDO | OPTYPE_REGISTER;
+
+ /* properties */
+ RNA_def_int(ot->srna, "lines", 0, 0, 1, "lines", "1 to toggle display lines only", 0, 1);
}
/* ************** Duplicate Selected Strokes **************** */
diff --git a/source/blender/editors/gpencil/gpencil_ops.c b/source/blender/editors/gpencil/gpencil_ops.c
index 624812cd3e8..7b4313042c3 100644
--- a/source/blender/editors/gpencil/gpencil_ops.c
+++ b/source/blender/editors/gpencil/gpencil_ops.c
@@ -346,7 +346,11 @@ static void ed_keymap_gpencil_editing(wmKeyConfig *keyconf)
WM_keymap_add_item(keymap, "GPENCIL_OT_selection_opacity_toggle", HKEY, KM_PRESS, KM_CTRL, 0);
/* toogle multiedit support */
- WM_keymap_add_item(keymap, "GPENCIL_OT_multiedit_toggle", QKEY, KM_PRESS, 0, 0);
+ kmi = WM_keymap_add_item(keymap, "GPENCIL_OT_multiedit_toggle", QKEY, KM_PRESS, 0, 0);
+ RNA_int_set(kmi->ptr, "lines", 0);
+
+ kmi = WM_keymap_add_item(keymap, "GPENCIL_OT_multiedit_toggle", QKEY, KM_PRESS, KM_SHIFT, 0);
+ RNA_int_set(kmi->ptr, "lines", 1);
/* Isolate Layer */
WM_keymap_add_item(keymap, "GPENCIL_OT_layer_isolate", PADASTERKEY, KM_PRESS, 0, 0);
More information about the Bf-blender-cvs
mailing list