[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [1916] trunk/py/scripts/addons/ render_povray: Fixed previous commit and Added dispersion_samples for controlling number of color steps in chromatic dispersions

Maurice Raybaud mauriceraybaud at hotmail.fr
Tue May 10 20:40:05 CEST 2011


Revision: 1916
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=1916
Author:   mauriceraybaud
Date:     2011-05-10 18:40:05 +0000 (Tue, 10 May 2011)
Log Message:
-----------
Fixed previous commit and Added dispersion_samples for controlling number of  color steps in chromatic dispersions

Modified Paths:
--------------
    trunk/py/scripts/addons/render_povray/__init__.py
    trunk/py/scripts/addons/render_povray/render.py
    trunk/py/scripts/addons/render_povray/ui.py

Modified: trunk/py/scripts/addons/render_povray/__init__.py
===================================================================
--- trunk/py/scripts/addons/render_povray/__init__.py	2011-05-10 17:48:00 UTC (rev 1915)
+++ trunk/py/scripts/addons/render_povray/__init__.py	2011-05-10 18:40:05 UTC (rev 1916)
@@ -353,12 +353,16 @@
             default=False)
 
     photons_dispersion = FloatProperty(
-            name="chromatic dispersion",
+            name="Chromatic Dispersion",
             description="Light passing through will be separated according to wavelength. " \
                         "This ratio of refractive indices for violet to red controls how much " \
                         "the colors are spread out 1 = no dispersion, good values are 1.01 to 1.1",
             min=1.0000, max=10.000, soft_min=1.0000, soft_max=1.1000, precision=4, default=1.0000)
 
+    photons_dispersion_samples = IntProperty(
+            name="Dispersion Samples", description="Number of color-steps for dispersion",
+            min=2, max=128, default=7)
+
     photons_reflection = BoolProperty(
             name="Reflective Photon Caustics",
             description="Use this to make your Sauron's ring ;-P",

Modified: trunk/py/scripts/addons/render_povray/render.py
===================================================================
--- trunk/py/scripts/addons/render_povray/render.py	2011-05-10 17:48:00 UTC (rev 1915)
+++ trunk/py/scripts/addons/render_povray/render.py	2011-05-10 18:40:05 UTC (rev 1916)
@@ -314,6 +314,7 @@
                 if pov_photons_refraction:
                     # Default of 1 means no dispersion
                     tabWrite("dispersion %.6f\n" % material.pov.photons_dispersion)
+                    tabWrite("dispersion_samples %.d\n" % material.pov.photons_dispersion_samples)
             #TODO
             # Other interior args
             if material.use_transparency and material.transparency_method == 'RAYTRACE':
@@ -330,18 +331,18 @@
 
             # (variable) dispersion_samples (constant count for now)
             tabWrite("}\n")
+            
+            tabWrite("photons{")
             if not ob.pov.collect_photons:
-                tabWrite("photons{collect off}\n")
-
-            else:
-                tabWrite("photons{\n")
+                tabWrite("collect off\n")
                 tabWrite("target %.3g\n" % ob.pov.spacing_multiplier)
-                if pov_photons_refraction:
-                    tabWrite("refraction on\n")
-                if pov_photons_reflection:
-                    tabWrite("reflection on\n")
-                tabWrite("}\n")
+            if pov_photons_refraction:
+                tabWrite("refraction on\n")
+            if pov_photons_reflection:
+                tabWrite("reflection on\n")
+            tabWrite("}\n")
 
+
     materialNames = {}
     DEF_MAT_NAME = "Default"
 

Modified: trunk/py/scripts/addons/render_povray/ui.py
===================================================================
--- trunk/py/scripts/addons/render_povray/ui.py	2011-05-10 17:48:00 UTC (rev 1915)
+++ trunk/py/scripts/addons/render_povray/ui.py	2011-05-10 18:40:05 UTC (rev 1916)
@@ -492,6 +492,7 @@
                 col.prop(mat.pov, "fake_caustics_power", slider=True)
             elif mat.pov.refraction_type == "2":
                 col.prop(mat.pov, "photons_dispersion", slider=True)
+                col.prop(mat.pov, "photons_dispersion_samples", slider=True)
             col.prop(mat.pov, "photons_reflection")
 
             if mat.pov.refraction_type == "0" and not mat.pov.photons_reflection:



More information about the Bf-extensions-cvs mailing list