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>2017-02-01 00:30:40 +0300
committerMaurice Raybaud <mauriceraybaud@hotmail.fr>2017-02-01 00:30:40 +0300
commit45532d6b7d6e3055a11ad0909bb6ef0a21546cb5 (patch)
tree82c06bb0e75a164edd5fa3808b03359decf65d07 /render_povray
parent7faf5784ea3be9a16c65f7c3fba133e7fdf68616 (diff)
Global POV Properties added and GUI updated (photons; radiosity; encoding...)
Diffstat (limited to 'render_povray')
-rw-r--r--render_povray/__init__.py87
-rw-r--r--render_povray/render.py46
-rw-r--r--render_povray/ui.py83
3 files changed, 182 insertions, 34 deletions
diff --git a/render_povray/__init__.py b/render_povray/__init__.py
index 85c4e608..7b23f6c4 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 ae23dd27..8d247b8c 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 fcdb25a9..21dcbd5e 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='PREFERENCES')
+ else:
+ self.layout.prop(scene.pov, "global_settings_advanced", text="", icon='SETTINGS')
def draw(self, context):
layout = self.layout
@@ -451,19 +458,59 @@ class RENDER_PT_povray_render_settings(RenderButtonsPanel, bpy.types.Panel):
col.label(text="Global Settings:")
col.prop(scene.pov, "max_trace_level", text="Ray Depth")
+
+ if scene.pov.global_settings_advanced:
+ layout.prop(scene.pov,"charset")
+ align = True
+ row = layout.row(align = align)
+ row.prop(scene.pov,"adc_bailout_enable",text = "")
+ row.prop(scene.pov,"adc_bailout")
+ row = layout.row(align = align)
+ row.prop(scene.pov,"ambient_light_enable",text = "")
+ row.prop(scene.pov,"ambient_light")
+ row = layout.row(align = align)
+ row.prop(scene.pov,"irid_wavelength_enable",text = "")
+ row.prop(scene.pov,"irid_wavelength")
+ row = layout.row(align = align)
+ row.prop(scene.pov,"max_intersections_enable",text = "")
+ row.prop(scene.pov,"max_intersections")
+ row = layout.row(align = align)
+ row.prop(scene.pov,"number_of_waves_enable",text = "")
+ row.prop(scene.pov,"number_of_waves")
+ row = layout.row(align = align)
+ row.prop(scene.pov,"noise_generator_enable",text = "")
+ row.prop(scene.pov,"noise_generator")
+
+class RENDER_PT_povray_photons(RenderButtonsPanel, bpy.types.Panel):
+ bl_label = "Photons"
+ COMPAT_ENGINES = {'POVRAY_RENDER'}
- col.label(text="Global Photons:")
- col.prop(scene.pov, "photon_max_trace_level", text="Photon Depth")
+ # def draw_header(self, context):
+ # self.layout.label(icon='SETTINGS')
- split = layout.split()
+ def draw_header(self, context):
+ scene = context.scene
+ if scene.pov.photon_enable:
+ self.layout.prop(scene.pov, "photon_enable", text="", icon='PMARKER_ACT')
+ else:
+ self.layout.prop(scene.pov, "photon_enable", text="", icon='PMARKER')
+ def draw(self, context):
+ scene = context.scene
+ layout = self.layout
+ if scene.pov.photon_enable:
+ col = layout.column()
+ #col.label(text="Global Photons:")
+ col.prop(scene.pov, "photon_max_trace_level", text="Photon Depth")
- col = split.column()
- col.prop(scene.pov, "photon_spacing", text="Spacing")
- col.prop(scene.pov, "photon_gather_min")
+ split = layout.split()
- col = split.column()
- col.prop(scene.pov, "photon_adc_bailout", text="Photon ADC")
- col.prop(scene.pov, "photon_gather_max")
+ col = split.column()
+ col.prop(scene.pov, "photon_spacing", text="Spacing")
+ col.prop(scene.pov, "photon_gather_min")
+
+ col = split.column()
+ col.prop(scene.pov, "photon_adc_bailout", text="Photon ADC")
+ col.prop(scene.pov, "photon_gather_max")
class RENDER_PT_povray_antialias(RenderButtonsPanel, bpy.types.Panel):
@@ -557,24 +604,24 @@ class RENDER_PT_povray_radiosity(RenderButtonsPanel, bpy.types.Panel):
col = split.column()
col.prop(scene.pov, "radio_adc_bailout", slider=True)
+ col.prop(scene.pov, "radio_minimum_reuse", text="Min Reuse")
col.prop(scene.pov, "radio_gray_threshold", slider=True)
- col.prop(scene.pov, "radio_low_error_factor", slider=True)
col.prop(scene.pov, "radio_pretrace_start", slider=True)
-
+ col.prop(scene.pov, "radio_low_error_factor", slider=True)
+
col = split.column()
col.prop(scene.pov, "radio_brightness")
- col.prop(scene.pov, "radio_minimum_reuse", text="Min Reuse")
+ col.prop(scene.pov, "radio_maximum_reuse", text="Max Reuse")
col.prop(scene.pov, "radio_nearest_count")
col.prop(scene.pov, "radio_pretrace_end", slider=True)
- split = layout.split()
-
- col = split.column()
+ col = layout.column()
col.label(text="Estimation Influence:")
- col.prop(scene.pov, "radio_media")
+ col.prop(scene.pov, "radio_always_sample")
col.prop(scene.pov, "radio_normal")
+ col.prop(scene.pov, "radio_media")
+ col.prop(scene.pov, "radio_subsurface")
- split.prop(scene.pov, "radio_always_sample")
class RENDER_PT_povray_media(WorldButtonsPanel, bpy.types.Panel):