[Bf-blender-cvs] [2882430d37d] greasepencil-object: Reorganize Mix Color with Texture

Antonio Vazquez noreply at git.blender.org
Thu Jun 7 17:51:53 CEST 2018


Commit: 2882430d37d8a43330af08d2abdc1c0092e105b6
Author: Antonio Vazquez
Date:   Thu Jun 7 17:51:12 2018 +0200
Branches: greasepencil-object
https://developer.blender.org/rB2882430d37d8a43330af08d2abdc1c0092e105b6

Reorganize Mix Color with Texture

Now, the mis is only with texture to avoid duplicate texture parameters that made the panel difficult to understand.

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

M	release/scripts/startup/bl_ui/properties_material_gpencil.py
M	source/blender/draw/engines/gpencil/shaders/gpencil_fill_frag.glsl

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

diff --git a/release/scripts/startup/bl_ui/properties_material_gpencil.py b/release/scripts/startup/bl_ui/properties_material_gpencil.py
index 037646b09d9..7084dadef82 100644
--- a/release/scripts/startup/bl_ui/properties_material_gpencil.py
+++ b/release/scripts/startup/bl_ui/properties_material_gpencil.py
@@ -188,7 +188,7 @@ class MATERIAL_PT_gpencil_fillcolor(GPMaterialButtonsPanel, Panel):
         layout.use_property_split = True
 
         ma = context.object.active_material
-        if (ma is not None) and (ma.grease_pencil):
+        if ma is not None and ma.grease_pencil:
             gpcolor = ma.grease_pencil
 
             # color settings
@@ -205,7 +205,7 @@ class MATERIAL_PT_gpencil_fillcolor(GPMaterialButtonsPanel, Panel):
                 if gpcolor.fill_style in ('GRADIENT', 'CHESSBOARD'):
                     col.prop(gpcolor, "mix_color", text="Secondary Color")
 
-                if gpcolor.texture_mix is True or gpcolor.fill_style == 'GRADIENT':
+                if gpcolor.fill_style == 'GRADIENT':
                     col.prop(gpcolor, "mix_factor", text="Mix Factor", slider=True)
 
                 if gpcolor.fill_style in ('GRADIENT', 'CHESSBOARD'):
@@ -223,10 +223,6 @@ class MATERIAL_PT_gpencil_fillcolor(GPMaterialButtonsPanel, Panel):
                 if gpcolor.fill_style == 'CHESSBOARD':
                     col.prop(gpcolor, "pattern_boxsize", text="Box")
 
-            # Solid
-            if gpcolor.fill_style == 'SOLID':
-                col.prop(gpcolor, "texture_mix", text="Mix With Texture")
-
             # Texture
             if gpcolor.fill_style == 'TEXTURE' or (gpcolor.texture_mix is True and gpcolor.fill_style == 'SOLID'):
                 col.template_ID(gpcolor, "fill_image", open="image.open")
@@ -242,6 +238,13 @@ class MATERIAL_PT_gpencil_fillcolor(GPMaterialButtonsPanel, Panel):
                 col.prop(gpcolor, "texture_opacity")
                 col.prop(gpcolor, "texture_clamp", text="Clip Image")
 
+                if gpcolor.use_fill_pattern is False:
+                    col.prop(gpcolor, "texture_mix", text="Mix With Color")
+
+                    if gpcolor.texture_mix is True:
+                        col.prop(gpcolor, "fill_color", text="Mix Color")
+                        col.prop(gpcolor, "mix_factor", text="Mix Factor", slider=True)
+
 
 class MATERIAL_PT_gpencil_options(GPMaterialButtonsPanel, Panel):
     bl_label = "Options"
diff --git a/source/blender/draw/engines/gpencil/shaders/gpencil_fill_frag.glsl b/source/blender/draw/engines/gpencil/shaders/gpencil_fill_frag.glsl
index 0eebd865bb7..da5cfdc457f 100644
--- a/source/blender/draw/engines/gpencil/shaders/gpencil_fill_frag.glsl
+++ b/source/blender/draw/engines/gpencil/shaders/gpencil_fill_frag.glsl
@@ -80,7 +80,7 @@ void main()
 
 	/* solid fill */
 	if (fill_type == SOLID) {
-		fragColor = (texture_mix == 1) ? mix(finalColor, text_color, mix_factor) : finalColor;
+		fragColor = finalColor;
 	}
 	else {
 		vec2 center = vec2(0.5, 0.5) + gradient_shift;
@@ -118,7 +118,7 @@ void main()
 		}
 		/* texture */
 		if (fill_type == TEXTURE) {
-			fragColor = text_color;
+			fragColor = (texture_mix == 1) ? mix(text_color, finalColor, mix_factor) : text_color;
 		}
 		/* pattern */
 		if (fill_type == PATTERN) {



More information about the Bf-blender-cvs mailing list