[Bf-blender-cvs] [708d96cd631] greasepencil-refactor: GPencil: Change Monkey and Stroke primitives to linear color
Antonio Vazquez
noreply at git.blender.org
Mon Jan 6 17:14:24 CET 2020
Commit: 708d96cd6316a799a0fe557d7a1def532c600769
Author: Antonio Vazquez
Date: Mon Jan 6 17:14:16 2020 +0100
Branches: greasepencil-refactor
https://developer.blender.org/rB708d96cd6316a799a0fe557d7a1def532c600769
GPencil: Change Monkey and Stroke primitives to linear color
Before it was using sRGB, but now all must be linear.
===================================================================
M source/blender/editors/gpencil/gpencil_add_monkey.c
M source/blender/editors/gpencil/gpencil_add_stroke.c
===================================================================
diff --git a/source/blender/editors/gpencil/gpencil_add_monkey.c b/source/blender/editors/gpencil/gpencil_add_monkey.c
index 77524c12b1c..387d0748c8b 100644
--- a/source/blender/editors/gpencil/gpencil_add_monkey.c
+++ b/source/blender/editors/gpencil/gpencil_add_monkey.c
@@ -66,7 +66,10 @@ static int gpencil_monkey_color(
ma = BKE_gpencil_object_material_new(bmain, ob, pct->name, &idx);
copy_v4_v4(ma->gp_style->stroke_rgba, pct->line);
+ srgb_to_linearrgb_v4(ma->gp_style->stroke_rgba, ma->gp_style->stroke_rgba);
+
copy_v4_v4(ma->gp_style->fill_rgba, pct->fill);
+ srgb_to_linearrgb_v4(ma->gp_style->fill_rgba, ma->gp_style->fill_rgba);
if (!stroke) {
ma->gp_style->flag &= ~GP_STYLE_STROKE_SHOW;
diff --git a/source/blender/editors/gpencil/gpencil_add_stroke.c b/source/blender/editors/gpencil/gpencil_add_stroke.c
index 4915738bc3a..0dd941f1847 100644
--- a/source/blender/editors/gpencil/gpencil_add_stroke.c
+++ b/source/blender/editors/gpencil/gpencil_add_stroke.c
@@ -65,7 +65,10 @@ static int gp_stroke_material(Main *bmain, Object *ob, const ColorTemplate *pct,
ma = BKE_gpencil_object_material_new(bmain, ob, pct->name, &idx);
copy_v4_v4(ma->gp_style->stroke_rgba, pct->line);
+ srgb_to_linearrgb_v4(ma->gp_style->stroke_rgba, ma->gp_style->stroke_rgba);
+
copy_v4_v4(ma->gp_style->fill_rgba, pct->fill);
+ srgb_to_linearrgb_v4(ma->gp_style->fill_rgba, ma->gp_style->fill_rgba);
if (fill) {
ma->gp_style->flag |= GP_STYLE_FILL_SHOW;
More information about the Bf-blender-cvs
mailing list