[Bf-blender-cvs] [660ff65c977] greasepencil-object: GPencil: Show line in Multiframe for Vertex Paint
Antonio Vazquez
noreply at git.blender.org
Sun Nov 17 10:30:31 CET 2019
Commit: 660ff65c977e2235ee4edb42e2a9a886459e21a2
Author: Antonio Vazquez
Date: Sun Nov 17 10:30:17 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rB660ff65c977e2235ee4edb42e2a9a886459e21a2
GPencil: Show line in Multiframe for Vertex Paint
===================================================================
M release/scripts/startup/bl_ui/space_view3d.py
M source/blender/draw/engines/gpencil/gpencil_draw_utils.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index abbc9bb3710..75ce96d2dc2 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -6379,6 +6379,7 @@ class VIEW3D_PT_overlay_gpencil_options(Panel):
layout.prop(overlay, "vertex_opacity", text="Vertex Opacity", slider=True)
if context.object.mode in {'PAINT_GPENCIL', 'EDIT_GPENCIL', 'SCULPT_GPENCIL', 'VERTEX_GPENCIL'}:
+ layout.prop(overlay, "use_gpencil_multiedit_line_only", text="Show Edit Lines only in multiframe")
layout.label(text="Vertex Paint")
layout.prop(overlay, "gpencil_vertex_paint_opacity", text="Opacity", slider=True)
diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
index 21c403a3d21..6217a657eb9 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
@@ -1154,6 +1154,9 @@ static void gpencil_add_editpoints_vertexdata(GpencilBatchCache *cache,
(GP_VERTEX_MASK_SELECTMODE_POINT |
GP_VERTEX_MASK_SELECTMODE_SEGMENT)));
+ const bool hide_vertex_lines = (GPENCIL_VERTEX_MODE(gpd) && (use_vertex_mask) &&
+ ((v3d->gp_flag & V3D_GP_SHOW_MULTIEDIT_LINES) == 0));
+
MaterialGPencilStyle *gp_style = BKE_material_gpencil_settings_get(ob, gps->mat_nr + 1);
/* alpha factor for edit points/line to make them more subtle */
@@ -1175,6 +1178,7 @@ static void gpencil_add_editpoints_vertexdata(GpencilBatchCache *cache,
* Edit mode: Not in Stroke selection mode
* Sculpt mode: Not in Stroke mask mode and any other mask mode enabled
* Weight mode: Always
+ * Vertex mode: Always
*/
const bool show_points = (show_sculpt_points) || (show_vertex_points) || (is_weight_paint) ||
(is_vertex_paint) ||
@@ -1182,14 +1186,14 @@ static void gpencil_add_editpoints_vertexdata(GpencilBatchCache *cache,
((ts->gpencil_selectmode_edit != GP_SELECTMODE_STROKE) ||
(gps->totpoints == 1)));
- if (GPENCIL_VERTEX_MODE(gpd) && (!use_vertex_mask)) {
+ if (GPENCIL_VERTEX_MODE(gpd) && (!use_vertex_mask) &&
+ ((v3d->gp_flag & V3D_GP_SHOW_MULTIEDIT_LINES) == 0)) {
return;
}
if (cache->is_dirty) {
if ((obact == ob) && (is_overlay) && (v3d->gp_flag & V3D_GP_SHOW_EDIT_LINES) &&
- (gps->totpoints > 1) && (!is_vertex_paint)) {
-
+ (gps->totpoints > 1) && (!hide_vertex_lines)) {
/* line of the original stroke */
gpencil_get_edlin_geom(&cache->b_edlin, gps, edit_alpha, hide_select);
@@ -1258,8 +1262,7 @@ static void gpencil_draw_strokes(GpencilBatchCache *cache,
const bool playing = stl->storage->is_playing;
const bool is_render = (bool)stl->storage->is_render;
const bool is_mat_preview = (bool)stl->storage->is_mat_preview;
- const bool overlay_multiedit = v3d != NULL ? ((!(v3d->gp_flag & V3D_GP_SHOW_MULTIEDIT_LINES)) ||
- (GPENCIL_VERTEX_MODE(gpd))) :
+ const bool overlay_multiedit = v3d != NULL ? (!(v3d->gp_flag & V3D_GP_SHOW_MULTIEDIT_LINES)) :
true;
/* Get evaluation context */
More information about the Bf-blender-cvs
mailing list