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-05-10 21:48:00 +0400
committerMaurice Raybaud <mauriceraybaud@hotmail.fr>2011-05-10 21:48:00 +0400
commit298e81cc75faf7b3002140e31db8b6cca7d599fc (patch)
treeb1a041f1ba088dfcaf87c33b1eea7e4d0df5ee38 /render_povray
parenta53fabc21f8c40bd01180c82a97ff9bca1738ebd (diff)
Added spacing_multiplier to object photons block so per object photon count tuning is now possible (see tooltip)
Diffstat (limited to 'render_povray')
-rw-r--r--render_povray/__init__.py14
-rw-r--r--render_povray/render.py19
-rw-r--r--render_povray/ui.py5
3 files changed, 26 insertions, 12 deletions
diff --git a/render_povray/__init__.py b/render_povray/__init__.py
index 792d5b25..3c3848d3 100644
--- a/render_povray/__init__.py
+++ b/render_povray/__init__.py
@@ -353,12 +353,16 @@ class RenderPovSettingsMaterial(bpy.types.PropertyGroup):
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",
@@ -426,6 +430,14 @@ class RenderPovSettingsObject(bpy.types.PropertyGroup):
" that generate caustics often don't need to show any on themselves).",
default=True)
+ #Photons spacing_multiplier
+ spacing_multiplier = FloatProperty(
+ name="Photons Spacing Multiplier",
+ description="Multiplier value relative to global spacing of photons. " \
+ "Decrease by half to get 4x more photons at surface of " \
+ "this object (or 8x media photons than specified in the globals",
+ min=0.01, max=1.00, default=1.00)
+
##################################CustomPOV Code############################
#Only DUMMIES below for now:
replacement_text = StringProperty(
diff --git a/render_povray/render.py b/render_povray/render.py
index 87a4eb2d..43317289 100644
--- a/render_povray/render.py
+++ b/render_povray/render.py
@@ -314,6 +314,7 @@ def write_pov(filename, scene=None, info_callback=None):
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,17 +331,17 @@ def write_pov(filename, scene=None, info_callback=None):
# (variable) dispersion_samples (constant count for now)
tabWrite("}\n")
+
+ tabWrite("photons{")
if not ob.pov.collect_photons:
- tabWrite("photons{collect off}\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 or pov_photons_reflection:
- tabWrite("photons{\n")
- tabWrite("target\n")
- if pov_photons_refraction:
- tabWrite("refraction on\n")
- if pov_photons_reflection:
- tabWrite("reflection on\n")
- tabWrite("}\n")
materialNames = {}
DEF_MAT_NAME = "Default"
diff --git a/render_povray/ui.py b/render_povray/ui.py
index 9335e004..336424bd 100644
--- a/render_povray/ui.py
+++ b/render_povray/ui.py
@@ -492,6 +492,7 @@ class MATERIAL_PT_povray_caustics(MaterialButtonsPanel, bpy.types.Panel):
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:
@@ -560,13 +561,13 @@ class OBJECT_PT_povray_obj_importance(ObjectButtonsPanel, bpy.types.Panel):
obj = context.object
- layout.active = obj.pov.importance_value
-
col = layout.column()
col.label(text="Radiosity:")
col.prop(obj.pov, "importance_value", text="Importance")
col.label(text="Photons:")
col.prop(obj.pov, "collect_photons", text="Receive Photon Caustics")
+ if obj.pov.collect_photons:
+ col.prop(obj.pov, "spacing_multiplier", text="Photons Spacing Multiplier")
class OBJECT_PT_povray_replacement_text(ObjectButtonsPanel, bpy.types.Panel):