[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [1403] trunk/py/scripts/addons/ render_povray: Added some formatting of the pov files and some UI tweaks made by Constantin Rahn (Thanks!).
Maurice Raybaud
mauriceraybaud at hotmail.fr
Fri Jan 14 22:55:46 CET 2011
Revision: 1403
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-extensions&revision=1403
Author: mauriceraybaud
Date: 2011-01-14 21:55:46 +0000 (Fri, 14 Jan 2011)
Log Message:
-----------
Added some formatting of the pov files and some UI tweaks made by Constantin Rahn (Thanks!). Also the version number had not been updated for a while, I don't know about API number
Modified Paths:
--------------
trunk/py/scripts/addons/render_povray/__init__.py
trunk/py/scripts/addons/render_povray/render.py
Modified: trunk/py/scripts/addons/render_povray/__init__.py
===================================================================
--- trunk/py/scripts/addons/render_povray/__init__.py 2011-01-14 21:31:18 UTC (rev 1402)
+++ trunk/py/scripts/addons/render_povray/__init__.py 2011-01-14 21:55:46 UTC (rev 1403)
@@ -18,9 +18,9 @@
bl_info = {
"name": "PovRay 3.7",
- "author": "Campbell Barton, Silvio Falcinelli, Maurice Raybaud",
- "version": (0, 0, 3),
- "blender": (2, 5, 4),
+ "author": "Campbell Barton, Silvio Falcinelli, Maurice Raybaud, Constantin Rahn",
+ "version": (0, 0, 4),
+ "blender": (2, 5, 6),
"api": 31667,
"location": "Info Header (engine dropdown)",
"description": "Basic povray 3.7 integration for blender",
@@ -77,7 +77,7 @@
Scene.pov_radio_adc_bailout = FloatProperty(
name="ADC Bailout", description="The adc_bailout for radiosity rays. Use adc_bailout = 0.01 / brightest_ambient_object for good results",
- min=0.0, max=1000.0, soft_min=0.0, soft_max=1.0, default=0.01)
+ min=0.0, max=1000.0, soft_min=0.0, soft_max=1.0, default=0.01, precision=3)
Scene.pov_radio_always_sample = BoolProperty(
name="Always Sample", description="Only use the data from the pretrace step and not gather any new samples during the final radiosity pass",
@@ -110,7 +110,7 @@
Scene.pov_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)
+ min=0.0, max=1.0, soft_min=0.1, soft_max=0.1, default=0.015, precision=3)
Scene.pov_radio_nearest_count = IntProperty(
name="Nearest Count", description="Number of old ambient values blended together to create a new interpolated value",
@@ -130,7 +130,7 @@
Scene.pov_radio_pretrace_end = FloatProperty(
name="Pretrace End", description="Fraction of the screen width which sets the size of the blocks in the mosaic preview last pass",
- min=0.01, max=1.00, soft_min=0.02, soft_max=1.0, default=0.04)
+ min=0.001, max=1.00, soft_min=0.01, soft_max=1.00, default=0.04, precision=3)
########################################MR######################################
Mat = bpy.types.Material
Modified: trunk/py/scripts/addons/render_povray/render.py
===================================================================
--- trunk/py/scripts/addons/render_povray/render.py 2011-01-14 21:31:18 UTC (rev 1402)
+++ trunk/py/scripts/addons/render_povray/render.py 2011-01-14 21:55:46 UTC (rev 1403)
@@ -189,11 +189,11 @@
if material: #and material.transparency_method == 'RAYTRACE':#Commented out: always write IOR to be able to use it for SSS, Fresnel reflections...
#But there can be only one!
if material.subsurface_scattering.use:#SSS IOR get highest priority
- file.write('\tinterior { ior %.6f\n' % material.subsurface_scattering.ior)
+ file.write('\tinterior {\n\t\tior %.6f\n' % material.subsurface_scattering.ior)
elif material.pov_mirror_use_IOR:#Then the raytrace IOR taken from raytrace transparency properties and used for reflections if IOR Mirror option is checked
- file.write('\tinterior { ior %.6f\n' % material.raytrace_transparency.ior)
+ file.write('\tinterior {\n\t\tior %.6f\n' % material.raytrace_transparency.ior)
else:
- file.write('\tinterior { ior %.6f\n' % material.raytrace_transparency.ior)
+ file.write('\tinterior {\n\t\tior %.6f\n' % material.raytrace_transparency.ior)
pov_fake_caustics = False
pov_photons_refraction = False
@@ -214,9 +214,9 @@
#Last, if none of the above is specified, user can set up "un-physical" fresnel reflections in raytrace mirror parameters. And pov IOR defaults to 1.
if material.pov_caustics_enable:
if pov_fake_caustics:
- file.write('\tcaustics %.3g\n' % material.pov_fake_caustics_power)
+ file.write('\t\tcaustics %.3g\n' % material.pov_fake_caustics_power)
if pov_photons_refraction:
- file.write('\tdispersion %.3g\n' % material.pov_photons_dispersion) #Default of 1 means no dispersion
+ file.write('\t\tdispersion %.3g\n' % material.pov_photons_dispersion) #Default of 1 means no dispersion
#TODO
# Other interior args
# if material.use_transparency and material.transparency_method == 'RAYTRACE':
@@ -665,7 +665,7 @@
file.write('\t\t%s' % (len(me.vertices))) # vert count
for v in me.vertices:
file.write(',\n\t\t<%.6f, %.6f, %.6f>' % tuple(v.co)) # vert count
- file.write('\n }\n')
+ file.write('\n\t}\n')
# Build unique Normal list
@@ -688,7 +688,7 @@
file.write(',\n\t\t<%.6f, %.6f, %.6f>' % no) # vert count
index[0] = idx
idx += 1
- file.write('\n }\n')
+ file.write('\n\t}\n')
# Vertex colours
@@ -722,7 +722,7 @@
file.write('\t\t1') # vert count
file.write(',\n\t\t<0.0, 0.0>')
'''
- file.write('\n }\n')
+ file.write('\n\t}\n')
if me.vertex_colors:
@@ -868,7 +868,7 @@
if texturesDif == '':
if texturesAlpha !='':
mappingAlpha = (" translate <%.4g-0.75,%.4g-0.75,%.4g-0.75> scale <%.4g,%.4g,%.4g>" % (t_alpha.offset.x / 10 ,t_alpha.offset.y / 10 ,t_alpha.offset.z / 10, t_alpha.scale.x / 2.25, t_alpha.scale.y / 2.25, t_alpha.scale.z / 2.25)) #strange that the translation factor for scale is not the same as for translate. ToDo: verify both matches with blender internal.
- file.write('\n\t\t\t\tpigment {pigment_pattern {uv_mapping image_map{%s \"%s\" %s}%s}' % (imageFormat(texturesAlpha) ,texturesAlpha ,imgMap(t_alpha),mappingAlpha))
+ file.write('\n\t\t\tpigment {pigment_pattern {uv_mapping image_map{%s \"%s\" %s}%s}' % (imageFormat(texturesAlpha) ,texturesAlpha ,imgMap(t_alpha),mappingAlpha))
file.write('\n\t\t\t\t\tpigment_map {')
file.write('\n\t\t\t\t\t\t[0 color rgbft<0,0,0,1,1>]')
file.write('\n\t\t\t\t\t\t[1 color rgbft<%.3g, %.3g, %.3g, %.3g, %.3g>]\n\t\t\t\t\t}' % (col[0], col[1], col[2], 1.0 - material.alpha, trans))
@@ -876,7 +876,7 @@
else:
- file.write('\n\t\t\t\tpigment {rgbft<%.3g, %.3g, %.3g, %.3g, %.3g>}' % (col[0], col[1], col[2], 1.0 - material.alpha, trans))
+ file.write('\n\t\t\tpigment {rgbft<%.3g, %.3g, %.3g, %.3g, %.3g>}' % (col[0], col[1], col[2], 1.0 - material.alpha, trans))
if texturesSpec !='':
file.write('finish {%s}' % (safety(material_finish, Level=1)))# Level 1 is no specular
@@ -888,13 +888,13 @@
mappingDif = (" translate <%.4g-0.75,%.4g-0.75,%.4g-0.75> scale <%.4g,%.4g,%.4g>" % (t_dif.offset.x / 10 ,t_dif.offset.y / 10 ,t_dif.offset.z / 10, t_dif.scale.x / 2.25, t_dif.scale.y / 2.25, t_dif.scale.z / 2.25)) #strange that the translation factor for scale is not the same as for translate. ToDo: verify both matches with blender internal.
if texturesAlpha !='':
mappingAlpha = (" translate <%.4g-0.75,%.4g-0.75,%.4g-0.75> scale <%.4g,%.4g,%.4g>" % (t_alpha.offset.x / 10 ,t_alpha.offset.y / 10 ,t_alpha.offset.z / 10, t_alpha.scale.x / 2.25, t_alpha.scale.y / 2.25, t_alpha.scale.z / 2.25)) #strange that the translation factor for scale is not the same as for translate. ToDo: verify both matches with blender internal.
- file.write('\n\t\t\t\tpigment {pigment_pattern {uv_mapping image_map{%s \"%s\" %s}%s}' % (imageFormat(texturesAlpha),texturesAlpha,imgMap(t_alpha),mappingAlpha))
+ file.write('\n\t\t\tpigment {pigment_pattern {uv_mapping image_map{%s \"%s\" %s}%s}' % (imageFormat(texturesAlpha),texturesAlpha,imgMap(t_alpha),mappingAlpha))
file.write('\n\t\t\t\t\tpigment_map {\n\t\t\t\t\t\t[0 color rgbft<0,0,0,1,1>]')
file.write('\n\t\t\t\t\t\t[1 uv_mapping image_map {%s \"%s\" %s}%s]\n\t\t\t\t}' % (imageFormat(texturesDif),texturesDif,(imgGamma + imgMap(t_dif)),mappingDif))
file.write('\n\t\t\t\t}')
else:
- file.write("\n\t\t\t\tpigment {uv_mapping image_map {%s \"%s\" %s}%s}" % (imageFormat(texturesDif),texturesDif,(imgGamma + imgMap(t_dif)),mappingDif))
+ file.write("\n\t\t\tpigment {uv_mapping image_map {%s \"%s\" %s}%s}" % (imageFormat(texturesDif),texturesDif,(imgGamma + imgMap(t_dif)),mappingDif))
if texturesSpec !='':
file.write('finish {%s}' % (safety(material_finish, Level=1)))# Level 1 is no specular
@@ -920,14 +920,14 @@
if texturesDif == '':
if texturesAlpha !='':
mappingAlpha = (" translate <%.4g-0.75,%.4g-0.75,%.4g-0.75> scale <%.4g,%.4g,%.4g>" % (t_alpha.offset.x / 10 ,t_alpha.offset.y / 10 ,t_alpha.offset.z / 10, t_alpha.scale.x / 2.25, t_alpha.scale.y / 2.25, t_alpha.scale.z / 2.25)) #strange that the translation factor for scale is not the same as for translate. ToDo: verify both matches with blender internal.
- file.write('\n\t\t\t\tpigment {pigment_pattern {uv_mapping image_map{%s \"%s\" %s}%s}' % (imageFormat(texturesAlpha) ,texturesAlpha ,imgMap(t_alpha),mappingAlpha))
+ file.write('\n\t\t\tpigment {pigment_pattern {uv_mapping image_map{%s \"%s\" %s}%s}' % (imageFormat(texturesAlpha) ,texturesAlpha ,imgMap(t_alpha),mappingAlpha))
file.write('\n\t\t\t\t\tpigment_map {')
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-extensions-cvs
mailing list