[Bf-blender-cvs] [7300e8a9fe8] blender-v2.83-release: GPencil: Change defaults for Gradient materials
Antonio Vazquez
noreply at git.blender.org
Mon Apr 27 10:49:40 CEST 2020
Commit: 7300e8a9fe8f82204ffa30e496578ccc04ff7891
Author: Antonio Vazquez
Date: Mon Apr 27 10:49:33 2020 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rB7300e8a9fe8f82204ffa30e496578ccc04ff7891
GPencil: Change defaults for Gradient materials
The old values did not display a valid gradient by default.
===================================================================
M source/blender/blenkernel/intern/material.c
M source/blender/blenloader/intern/versioning_defaults.c
===================================================================
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c
index f641531d577..1b21ff9b36e 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -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;
}
diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c
index 19606b92479..8343895c8dd 100644
--- a/source/blender/blenloader/intern/versioning_defaults.c
+++ b/source/blender/blenloader/intern/versioning_defaults.c
@@ -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);
More information about the Bf-blender-cvs
mailing list