[Bf-extensions-cvs] [45532d6] master: Global POV Properties added and GUI updated (photons; radiosity; encoding...)

Maurice Raybaud noreply at git.blender.org
Tue Jan 31 22:30:53 CET 2017


Commit: 45532d6b7d6e3055a11ad0909bb6ef0a21546cb5
Author: Maurice Raybaud
Date:   Tue Jan 31 22:30:40 2017 +0100
Branches: master
https://developer.blender.org/rBA45532d6b7d6e3055a11ad0909bb6ef0a21546cb5

Global POV Properties added and GUI updated (photons; radiosity; encoding...)

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

M	render_povray/__init__.py
M	render_povray/render.py
M	render_povray/ui.py

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

diff --git a/render_povray/__init__.py b/render_povray/__init__.py
index 85c4e60..7b23f6c 100644
--- a/render_povray/__init__.py
+++ b/render_povray/__init__.py
@@ -220,6 +220,80 @@ class RenderPovSettingsScene(PropertyGroup):
             description="Number of reflections/refractions allowed on ray "
                         "path",
             min=1, max=256, default=5)
+            
+#######NEW from Lanuhum            
+    adc_bailout_enable = BoolProperty(
+            name="Enable",
+            description="",
+            default=False)
+
+    adc_bailout = FloatProperty(
+            name="ADC Bailout",
+            description="",
+            min=0.0, max=1000.0,default=0.00392156862745, precision=3)
+
+    ambient_light_enable = BoolProperty(
+            name="Enable",
+            description="",
+            default=False)
+
+    ambient_light = FloatVectorProperty(
+            name="Ambient Light", description="Ambient light is used to simulate the effect of inter-diffuse reflection",
+            precision=4, step=0.01, min=0, soft_max=1,
+            default=(1, 1, 1), options={'ANIMATABLE'}, subtype='COLOR')
+
+    global_settings_advanced = BoolProperty(
+            name="Advanced",
+            description="",
+            default=False)
+
+    irid_wavelength_enable = BoolProperty(
+            name="Enable",
+            description="",
+            default=False)
+
+    irid_wavelength = FloatVectorProperty(
+            name="Irid Wavelength", description="Iridescence calculations depend upon the dominant wavelengths of the primary colors of red, green and blue light.",
+            precision=4, step=0.01, min=0, soft_max=1,
+            default=(0.25,0.18,0.14), options={'ANIMATABLE'}, subtype='COLOR')
+
+    charset = EnumProperty(
+            name="Charset",
+            description="This allows you to specify the assumed character set of all text strings.",
+            items=(("ascii", "ASCII", ""),
+                   ("utf8", "UTF-8", ""),
+                   ("sys", "SYS", "")),
+            default="utf8")
+
+    max_intersections_enable = BoolProperty(
+            name="Enable",
+            description="",
+            default=False)
+
+    max_intersections = IntProperty(
+            name="Max Intersections",
+            description="POV-Ray uses a set of internal stacks to collect ray/object intersection points.",
+            min=2, max=1024, default=64)
+
+    number_of_waves_enable = BoolProperty(
+            name="Enable",
+            description="",
+            default=False)
+
+    number_of_waves = IntProperty(
+            name="Number Waves",
+            description="The waves and ripples patterns are generated by summing a series of waves, each with a slightly different center and size.",
+            min=1, max=10, default=1000)
+
+    noise_generator_enable = BoolProperty(
+            name="Enable",
+            description="",
+            default=False)
+
+    noise_generator = IntProperty(
+            name="Noise Generator",
+            description="There are three noise generators implemented.",
+            min=1, max=3, default=2)
 
     ########################### PHOTONS #######################################
     photon_enable = BoolProperty(
@@ -276,7 +350,7 @@ class RenderPovSettingsScene(PropertyGroup):
             name="Always Sample",
             description="Only use the data from the pretrace step and not gather "
                         "any new samples during the final radiosity pass",
-            default=True)
+            default=False)
 
     radio_brightness = FloatProperty(
             name="Brightness",
@@ -308,17 +382,26 @@ class RenderPovSettingsScene(PropertyGroup):
                         "tolerance for less critical last refining pass",
             min=0.000001, max=1.0, soft_min=0.000001, soft_max=1.0, default=0.5)
 
-    # max_sample - not available yet
     radio_media = BoolProperty(
             name="Media", description="Radiosity estimation can be affected by media",
             default=False)
 
+    radio_subsurface = BoolProperty(
+            name="Subsurface", description="Radiosity estimation can be affected by Subsurface Light Transport",
+            default=False)
+
     radio_minimum_reuse = FloatProperty(
             name="Minimum Reuse",
             description="Fraction of the screen width which sets the minimum radius of reuse "
                         "for each sample point (At values higher than 2% expect errors)",
             min=0.0, max=1.0, soft_min=0.1, soft_max=0.1, default=0.015, precision=3)
 
+    radio_maximum_reuse = FloatProperty(
+            name="Maximum Reuse",
+            description="The maximum reuse parameter works in conjunction with, and is similar to that of minimum reuse, "
+                        "the only difference being that it is an upper bound rather than a lower one.",
+            min=0.0, max=1.0,default=0.2, precision=3)
+
     radio_nearest_count = IntProperty(
             name="Nearest Count",
             description="Number of old ambient values blended together to "
diff --git a/render_povray/render.py b/render_povray/render.py
index ae23dd2..8d247b8 100644
--- a/render_povray/render.py
+++ b/render_povray/render.py
@@ -3288,22 +3288,39 @@ def write_pov(filename, scene=None, info_callback=None):
         tabWrite("assumed_gamma 1.0\n")
         tabWrite("max_trace_level %d\n" % scene.pov.max_trace_level)
 
+        if scene.pov.charset != 'ascii':
+            file.write("    charset %s\n"%scene.pov.charset)
+        if scene.pov.global_settings_advanced:
+            if scene.pov.adc_bailout_enable and scene.pov.radio_enable == False:
+                file.write("    adc_bailout %.6f\n"%scene.pov.adc_bailout)
+            if scene.pov.ambient_light_enable:
+                file.write("    ambient_light <%.6f,%.6f,%.6f>\n"%scene.pov.ambient_light[:])
+            if scene.pov.irid_wavelength_enable:
+                file.write("    irid_wavelength <%.6f,%.6f,%.6f>\n"%scene.pov.irid_wavelength[:])
+            if scene.pov.max_intersections_enable:
+                file.write("    max_intersections %s\n"%scene.pov.max_intersections)
+            if scene.pov.number_of_waves_enable:
+                file.write("    number_of_waves %s\n"%scene.pov.number_of_waves)
+            if scene.pov.noise_generator_enable:
+                file.write("    noise_generator %s\n"%scene.pov.noise_generator) 
         if scene.pov.radio_enable:
             tabWrite("radiosity {\n")
             tabWrite("adc_bailout %.4g\n" % scene.pov.radio_adc_bailout)
-            tabWrite("always_sample %d\n" % scene.pov.radio_always_sample)
             tabWrite("brightness %.4g\n" % scene.pov.radio_brightness)
             tabWrite("count %d\n" % scene.pov.radio_count)
             tabWrite("error_bound %.4g\n" % scene.pov.radio_error_bound)
             tabWrite("gray_threshold %.4g\n" % scene.pov.radio_gray_threshold)
             tabWrite("low_error_factor %.4g\n" % scene.pov.radio_low_error_factor)
-            tabWrite("media %d\n" % scene.pov.radio_media)
+            tabWrite("maximum_reuse %.4g\n" % scene.pov.radio_maximum_reuse)            
             tabWrite("minimum_reuse %.4g\n" % scene.pov.radio_minimum_reuse)
             tabWrite("nearest_count %d\n" % scene.pov.radio_nearest_count)
-            tabWrite("normal %d\n" % scene.pov.radio_normal)
             tabWrite("pretrace_start %.3g\n" % scene.pov.radio_pretrace_start)
             tabWrite("pretrace_end %.3g\n" % scene.pov.radio_pretrace_end)
             tabWrite("recursion_limit %d\n" % scene.pov.radio_recursion_limit)
+            tabWrite("always_sample %d\n" % scene.pov.radio_always_sample)
+            tabWrite("normal %d\n" % scene.pov.radio_normal)
+            tabWrite("media %d\n" % scene.pov.radio_media)
+            tabWrite("subsurface %d\n" % scene.pov.radio_subsurface)
             tabWrite("}\n")
         onceSss = 1
         onceAmbient = 1
@@ -3328,17 +3345,18 @@ def write_pov(filename, scene=None, info_callback=None):
                 tabWrite("ambient_light rgb<%.3g, %.3g, %.3g>\n" % world.ambient_color[:])
                 onceAmbient = 0
 
-            if (oncePhotons and
-                    (material.pov.refraction_type == "2" or
-                    material.pov.photons_reflection == True)):
-                tabWrite("photons {\n")
-                tabWrite("spacing %.6f\n" % scene.pov.photon_spacing)
-                tabWrite("max_trace_level %d\n" % scene.pov.photon_max_trace_level)
-                tabWrite("adc_bailout %.3g\n" % scene.pov.photon_adc_bailout)
-                tabWrite("gather %d, %d\n" % (scene.pov.photon_gather_min,
-                    scene.pov.photon_gather_max))
-                tabWrite("}\n")
-                oncePhotons = 0
+            if scene.pov.photon_enable:
+                if (oncePhotons and
+                        (material.pov.refraction_type == "2" or
+                        material.pov.photons_reflection == True)):
+                    tabWrite("photons {\n")
+                    tabWrite("spacing %.6f\n" % scene.pov.photon_spacing)
+                    tabWrite("max_trace_level %d\n" % scene.pov.photon_max_trace_level)
+                    tabWrite("adc_bailout %.3g\n" % scene.pov.photon_adc_bailout)
+                    tabWrite("gather %d, %d\n" % (scene.pov.photon_gather_min,
+                        scene.pov.photon_gather_max))
+                    tabWrite("}\n")
+                    oncePhotons = 0
 
         tabWrite("}\n")
 
diff --git a/render_povray/ui.py b/render_povray/ui.py
index fcdb25a..21dcbd5 100644
--- a/render_povray/ui.py
+++ b/render_povray/ui.py
@@ -439,8 +439,15 @@ class RENDER_PT_povray_render_settings(RenderButtonsPanel, bpy.types.Panel):
     bl_icon = 'SETTINGS'
     COMPAT_ENGINES = {'POVRAY_RENDER'}
 
+    # def draw_header(self, context):
+        # self.layout.label(icon='SETTINGS')
+
     def draw_header(self, context):
-        self.layout.label(icon='SETTINGS')
+        scene = context.scene
+        if scene.pov.global_settings_advanced:
+            self.layout.prop(scene.pov, "global_settings_advanced", text="", icon='PREFEREN

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-extensions-cvs mailing list