Commit: c248778601c337353272dac7da58deac78e70b45
Author: Antonio Vazquez
Date:   Wed Aug 30 16:41:28 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rBc248778601c337353272dac7da58deac78e70b45

Show only lines for MultiEdit strokes

===================================================================

M       source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
M       source/blender/makesrna/intern/rna_gpencil.c

===================================================================

diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c 
b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
index 3ab62fd5be8..507548a7d13 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
@@ -732,35 +732,37 @@ static void gpencil_draw_strokes(GpencilBatchCache 
*cache, GPENCIL_e_data *e_dat
                        stl->shgroups = p;
                }
 #endif
-               int id = stl->storage->shgroup_id;
-               if ((gps->totpoints > 1) && ((gps->palcolor->flag & 
PAC_COLOR_DOT) == 0)) {
-                       if (gps->totpoints > 2) {
-                               stl->shgroups[id].shgrps_fill = 
DRW_gpencil_shgroup_fill_create(e_data, vedata, psl->stroke_pass, 
e_data->gpencil_fill_sh, gpd, gps->palcolor, id);
+               if ((gpl->actframe->framenum == derived_gpf->framenum) || 
(!is_multiedit) || ((gpd->flag & GP_DATA_STROKE_MULTIEDIT_LINES) == 0)) {
+                       int id = stl->storage->shgroup_id;
+                       if ((gps->totpoints > 1) && ((gps->palcolor->flag & 
PAC_COLOR_DOT) == 0)) {
+                               if (gps->totpoints > 2) {
+                                       stl->shgroups[id].shgrps_fill = 
DRW_gpencil_shgroup_fill_create(e_data, vedata, psl->stroke_pass, 
e_data->gpencil_fill_sh, gpd, gps->palcolor, id);
+                               }
+                               else {
+                                       stl->shgroups[id].shgrps_fill = NULL;
+                               }
+                               stl->shgroups[id].shgrps_stroke = 
DRW_gpencil_shgroup_stroke_create(e_data, vedata, psl->stroke_pass, 
e_data->gpencil_stroke_sh, ob, gpd, gps->palcolor, id);
                        }
                        else {
                                stl->shgroups[id].shgrps_fill = NULL;
+                               stl->shgroups[id].shgrps_stroke = 
DRW_gpencil_shgroup_point_create(e_data, vedata, psl->stroke_pass, 
e_data->gpencil_point_sh, ob, gpd, gps->palcolor, id);
                        }
-                       stl->shgroups[id].shgrps_stroke = 
DRW_gpencil_shgroup_stroke_create(e_data, vedata, psl->stroke_pass, 
e_data->gpencil_stroke_sh, ob, gpd, gps->palcolor, id);
-               }
-               else {
-                       stl->shgroups[id].shgrps_fill = NULL;
-                       stl->shgroups[id].shgrps_stroke = 
DRW_gpencil_shgroup_point_create(e_data, vedata, psl->stroke_pass, 
e_data->gpencil_point_sh, ob, gpd, gps->palcolor, id);
-               }
-               ++stl->storage->shgroup_id;
+                       ++stl->storage->shgroup_id;
 
-               fillgrp = stl->shgroups[id].shgrps_fill;
-               strokegrp = stl->shgroups[id].shgrps_stroke;
+                       fillgrp = stl->shgroups[id].shgrps_fill;
+                       strokegrp = stl->shgroups[id].shgrps_stroke;
 
-               /* apply modifiers (only modify geometry, but not create ) */
-               if ((cache->is_dirty) && (ob->modifiers.first) && 
(!is_multiedit)) {
-                       BKE_gpencil_stroke_modifiers(ob, gpl, derived_gpf, gps);
-               }
-               /* fill */
-               if (fillgrp) {
-                       gpencil_add_fill_shgroup(cache, fillgrp, ob, gpd, gpl, 
derived_gpf, gps, tintcolor, false, custonion);
+                       /* apply modifiers (only modify geometry, but not 
create ) */
+                       if ((cache->is_dirty) && (ob->modifiers.first) && 
(!is_multiedit)) {
+                               BKE_gpencil_stroke_modifiers(ob, gpl, 
derived_gpf, gps);
+                       }
+                       /* fill */
+                       if (fillgrp) {
+                               gpencil_add_fill_shgroup(cache, fillgrp, ob, 
gpd, gpl, derived_gpf, gps, tintcolor, false, custonion);
+                       }
+                       /* stroke */
+                       gpencil_add_stroke_shgroup(cache, strokegrp, ob, gpd, 
gpl, derived_gpf, gps, opacity, tintcolor, false, custonion);
                }
-               /* stroke */
-               gpencil_add_stroke_shgroup(cache, strokegrp, ob, gpd, gpl, 
derived_gpf, gps, opacity, tintcolor, false, custonion);
 
                /* edit points (only in edit mode) */
                if (src_gps) {
diff --git a/source/blender/makesrna/intern/rna_gpencil.c 
b/source/blender/makesrna/intern/rna_gpencil.c
index 29e44af982f..b4041f1b9b5 100644
--- a/source/blender/makesrna/intern/rna_gpencil.c
+++ b/source/blender/makesrna/intern/rna_gpencil.c
@@ -1202,6 +1202,8 @@ static void rna_def_gpencil_data(BlenderRNA *brna)
        PropertyRNA *prop;
        FunctionRNA *func;
 
+       static float default_1[4] = { 0.6f, 0.6f, 0.6f, 0.3f };
+
        srna = RNA_def_struct(brna, "GreasePencil", "ID");
        RNA_def_struct_sdna(srna, "bGPdata");
        RNA_def_struct_ui_text(srna, "Grease Pencil", "Freehand annotation 
sketchbook");
@@ -1282,6 +1284,7 @@ static void rna_def_gpencil_data(BlenderRNA *brna)
        RNA_def_property_float_sdna(prop, NULL, "line_color");
        RNA_def_property_array(prop, 4);
        RNA_def_property_range(prop, 0.0f, 1.0f);
+       RNA_def_property_float_array_default(prop, default_1);
        RNA_def_property_ui_text(prop, "Edit Line Color", "Color for editing 
line");
        RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, 
"rna_GPencil_update");

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to