GP: Fix missing initialization converting 2.7 files
authorAntonioya <blendergit@gmail.com>
Sun, 6 Jan 2019 16:22:03 +0000 (17:22 +0100)
committerAntonioya <blendergit@gmail.com>
Sun, 6 Jan 2019 16:22:03 +0000 (17:22 +0100)
source/blender/editors/gpencil/gpencil_old.c

index a2012be..8f1344a 100644 (file)
@@ -127,7 +127,18 @@ static int gpencil_convert_old_files_exec(bContext *C, wmOperator *UNUSED(op))
                                MaterialGPencilStyle *gp_style = ma->gp_style;
                                copy_v4_v4(gp_style->stroke_rgba, palcolor->color);
                                copy_v4_v4(gp_style->fill_rgba, palcolor->fill);
-                               gp_style->flag = palcolor->flag;
+
+                               /* set basic settings */
+                               gp_style->pattern_gridsize = 0.1f;
+                               gp_style->gradient_radius = 0.5f;
+                               ARRAY_SET_ITEMS(gp_style->mix_rgba, 1.0f, 1.0f, 1.0f, 0.2f);
+                               ARRAY_SET_ITEMS(gp_style->gradient_scale, 1.0f, 1.0f);
+                               ARRAY_SET_ITEMS(gp_style->texture_scale, 1.0f, 1.0f);
+                               gp_style->texture_opacity = 1.0f;
+                               gp_style->texture_pixsize = 100.0f;
+
+                               gp_style->flag |= GP_STYLE_STROKE_SHOW;
+                               gp_style->flag |= GP_STYLE_FILL_SHOW;
 
                                /* fix strokes */
                                for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) {