GPencil: Change defaults for Gradient materials

The old values did not display a valid gradient by default.
This commit is contained in:
Antonio Vazquez 2020-04-27 10:49:33 +02:00
parent bb1e794d58
commit 7300e8a9fe
2 changed files with 14 additions and 1 deletions

View File

@ -168,9 +168,11 @@ void BKE_gpencil_material_attr_init(Material *ma)
/* set basic settings */
gp_style->stroke_rgba[3] = 1.0f;
gp_style->fill_rgba[3] = 1.0f;
ARRAY_SET_ITEMS(gp_style->mix_rgba, 1.0f, 1.0f, 1.0f, 0.2f);
ARRAY_SET_ITEMS(gp_style->mix_rgba, 1.0f, 1.0f, 1.0f, 1.0f);
ARRAY_SET_ITEMS(gp_style->texture_scale, 1.0f, 1.0f);
gp_style->texture_offset[0] = -0.5f;
gp_style->texture_pixsize = 100.0f;
gp_style->mix_factor = 0.5f;
gp_style->flag |= GP_MATERIAL_STROKE_SHOW;
}

View File

@ -433,10 +433,21 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template)
}
ma->gp_style->mode = GP_MATERIAL_MODE_SQUARE;
/* Change Solid Stroke settings. */
ma = BLI_findstring(&bmain->materials, "Solid Stroke", offsetof(ID, name) + 2);
if (ma != NULL) {
ma->gp_style->mix_rgba[3] = 1.0f;
ma->gp_style->texture_offset[0] = -0.5f;
ma->gp_style->mix_factor = 0.5f;
}
/* Change Solid Fill settings. */
ma = BLI_findstring(&bmain->materials, "Solid Fill", offsetof(ID, name) + 2);
if (ma != NULL) {
ma->gp_style->flag &= ~GP_MATERIAL_STROKE_SHOW;
ma->gp_style->mix_rgba[3] = 1.0f;
ma->gp_style->texture_offset[0] = -0.5f;
ma->gp_style->mix_factor = 0.5f;
}
Object *ob = BLI_findstring(&bmain->objects, "Stroke", offsetof(ID, name) + 2);