Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2013-02-03 21:01:21 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2013-02-03 21:01:21 +0400
commit7e3e3a2270488a8bd5c447880bdc10bdb796c78b (patch)
tree19071c91e131ddf2f13f7b0bf79b6208a6bef2ea /release/scripts/freestyle/style_modules
parent99f3a70aeb4de2c2ff39d4287d0d5184f4ae3f26 (diff)
Freestyle Python API improvements - part 2.
The API syntax of FrsMaterial was updated by means of getter/setter properties. Python style modules (including the Parameter Editor) were updated accordingly.
Diffstat (limited to 'release/scripts/freestyle/style_modules')
-rw-r--r--release/scripts/freestyle/style_modules/parameter_editor.py38
-rw-r--r--release/scripts/freestyle/style_modules/shaders.py6
2 files changed, 22 insertions, 22 deletions
diff --git a/release/scripts/freestyle/style_modules/parameter_editor.py b/release/scripts/freestyle/style_modules/parameter_editor.py
index 1cec55fc4d4..51664fe4ac6 100644
--- a/release/scripts/freestyle/style_modules/parameter_editor.py
+++ b/release/scripts/freestyle/style_modules/parameter_editor.py
@@ -365,13 +365,13 @@ def iter_material_color(stroke, material_attr):
while not it.isEnd():
material = func(it.castToInterface0DIterator())
if material_attr == "DIFF":
- color = (material.diffuseR(),
- material.diffuseG(),
- material.diffuseB())
+ color = (material.diffuse[0],
+ material.diffuse[1],
+ material.diffuse[2])
elif material_attr == "SPEC":
- color = (material.specularR(),
- material.specularG(),
- material.specularB())
+ color = (material.specular[0],
+ material.specular[1],
+ material.specular[2])
else:
raise ValueError("unexpected material attribute: " + material_attr)
yield it, color
@@ -383,31 +383,31 @@ def iter_material_value(stroke, material_attr):
while not it.isEnd():
material = func(it.castToInterface0DIterator())
if material_attr == "DIFF":
- r = material.diffuseR()
- g = material.diffuseG()
- b = material.diffuseB()
+ r = material.diffuse[0]
+ g = material.diffuse[1]
+ b = material.diffuse[2]
t = 0.35 * r + 0.45 * r + 0.2 * b
elif material_attr == "DIFF_R":
- t = material.diffuseR()
+ t = material.diffuse[0]
elif material_attr == "DIFF_G":
- t = material.diffuseG()
+ t = material.diffuse[1]
elif material_attr == "DIFF_B":
- t = material.diffuseB()
+ t = material.diffuse[2]
elif material_attr == "SPEC":
- r = material.specularR()
- g = material.specularG()
- b = material.specularB()
+ r = material.specular[0]
+ g = material.specular[1]
+ b = material.specular[2]
t = 0.35 * r + 0.45 * r + 0.2 * b
elif material_attr == "SPEC_R":
- t = material.specularR()
+ t = material.specular[0]
elif material_attr == "SPEC_G":
- t = material.specularG()
+ t = material.specular[1]
elif material_attr == "SPEC_B":
- t = material.specularB()
+ t = material.specular[2]
elif material_attr == "SPEC_HARDNESS":
t = material.shininess()
elif material_attr == "ALPHA":
- t = material.diffuseA()
+ t = material.diffuse[3]
else:
raise ValueError("unexpected material attribute: " + material_attr)
yield it, t
diff --git a/release/scripts/freestyle/style_modules/shaders.py b/release/scripts/freestyle/style_modules/shaders.py
index c91153af111..25a12b447fd 100644
--- a/release/scripts/freestyle/style_modules/shaders.py
+++ b/release/scripts/freestyle/style_modules/shaders.py
@@ -459,9 +459,9 @@ class pyMaterialColorShader(StrokeShader):
toto = it.castToInterface0DIterator()
mat = func(toto)
- r = mat.diffuseR()
- g = mat.diffuseG()
- b = mat.diffuseB()
+ r = mat.diffuse[0]
+ g = mat.diffuse[1]
+ b = mat.diffuse[2]
X = 0.412453*r + 0.35758 *g + 0.180423*b
Y = 0.212671*r + 0.71516 *g + 0.072169*b