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

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaurice Raybaud <mauriceraybaud@hotmail.fr>2011-01-22 11:40:26 +0300
committerMaurice Raybaud <mauriceraybaud@hotmail.fr>2011-01-22 11:40:26 +0300
commit5b308e020969a14359f662cb8d69d144288c53a6 (patch)
tree576c4c52ad84b86c0f10752be6c753414ba88e82 /render_povray
parentca49ad6c19b92f95dfc89127b43c20b6fd414dd9 (diff)
Fixed Campbell's noticed strange code: a useless or statement
and made clearer clamping for Front and back diffuse.
Diffstat (limited to 'render_povray')
-rw-r--r--render_povray/render.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/render_povray/render.py b/render_povray/render.py
index 3f3ad96c..00391bf5 100644
--- a/render_povray/render.py
+++ b/render_povray/render.py
@@ -359,9 +359,9 @@ def write_pov(filename, scene=None, info_callback=None):
elif frontDiffuse == backDiffuse:
frontDiffuse = backDiffuse = 0.5 # Try to respect the user's 'intention' by comparing the two values but bringing the total back to one
elif frontDiffuse > backDiffuse: # Let the highest value stay the highest value
- backDiffuse = 1 - (1 - frontDiffuse) # XXX FIXME!
+ backDiffuse = min(backDiffuse, (1.0 - frontDiffuse)) # clamps the sum below 1
else:
- frontDiffuse = 1 - (1 - backDiffuse) # XXX FIXME!
+ frontDiffuse = min(frontDiffuse, (1.0 - backDiffuse))
# map hardness between 0.0 and 1.0
roughness = ((1.0 - ((material.specular_hardness - 1.0) / 510.0)))
@@ -1256,7 +1256,7 @@ def write_pov(filename, scene=None, info_callback=None):
#For simple flat background:
if not world.use_sky_blend:
#Non fully transparent background could premultiply alpha and avoid anti-aliasing display issue:
- if render.alpha_mode == 'PREMUL' or render.alpha_mode == 'PREMUL': # XXX FIXME!
+ if render.alpha_mode == 'PREMUL':
tabWrite("background {rgbt<%.3g, %.3g, %.3g, 0.75>}\n" % (world.horizon_color[:]))
#Currently using no alpha with Sky option:
elif render.alpha_mode == 'SKY':