[Bf-blender-cvs] [de280ff] master: Freestyle: Fix for a wrong formula used for RGB to grayscale conversion.
Tamito Kajiyama
noreply at git.blender.org
Thu Jun 5 05:58:18 CEST 2014
Commit: de280ffa32e48f1526ffe259d448673f1019ad0f
Author: Tamito Kajiyama
Date: Thu Jun 5 12:55:22 2014 +0900
https://developer.blender.org/rBde280ffa32e48f1526ffe259d448673f1019ad0f
Freestyle: Fix for a wrong formula used for RGB to grayscale conversion.
This bug fix is likely to affect the visual results of existing Freestyle setups using the
Material color/alpha/thickness modifiers with the 'material_attribute' parameter set to
either 'Diffuse' (default) or 'Specular', and also the Ramp option enabled in the case
of the Material color modifier.
===================================================================
M release/scripts/freestyle/modules/parameter_editor.py
===================================================================
diff --git a/release/scripts/freestyle/modules/parameter_editor.py b/release/scripts/freestyle/modules/parameter_editor.py
index 38203e9..34645b9 100644
--- a/release/scripts/freestyle/modules/parameter_editor.py
+++ b/release/scripts/freestyle/modules/parameter_editor.py
@@ -464,7 +464,7 @@ def iter_material_value(stroke, material_attribute):
material = func(Interface0DIterator(it))
if material_attribute == 'DIFF':
r, g, b = material.diffuse[0:3]
- t = 0.35 * r + 0.45 * r + 0.2 * b
+ t = 0.35 * r + 0.45 * g + 0.2 * b
elif material_attribute == 'DIFF_R':
t = material.diffuse[0]
elif material_attribute == 'DIFF_G':
@@ -473,7 +473,7 @@ def iter_material_value(stroke, material_attribute):
t = material.diffuse[2]
elif material_attribute == 'SPEC':
r, g, b = material.specular[0:3]
- t = 0.35 * r + 0.45 * r + 0.2 * b
+ t = 0.35 * r + 0.45 * g + 0.2 * b
elif material_attribute == 'SPEC_R':
t = material.specular[0]
elif material_attribute == 'SPEC_G':
More information about the Bf-blender-cvs
mailing list