From 017c9f143d13294bbace5ef2e8159e9d96325dad Mon Sep 17 00:00:00 2001 From: Maurice Raybaud Date: Thu, 5 Feb 2015 20:32:15 +0100 Subject: Added: UberPOV / POV Feature Set choice in user preferences Added: Stochastic antialiasing for UberPOV Added: Blurry Reflection for UberPOV Improved: Defaults for AA and Depth of Field to a better quality/time Improved: UV texture transforms more closely match BI and more functionalised --- render_povray/__init__.py | 36 +++++--- render_povray/render.py | 211 +++++++++++++++++++++++++++++++--------------- render_povray/ui.py | 48 ++++++++--- 3 files changed, 200 insertions(+), 95 deletions(-) diff --git a/render_povray/__init__.py b/render_povray/__init__.py index d0e6d855..716ce0cd 100644 --- a/render_povray/__init__.py +++ b/render_povray/__init__.py @@ -154,24 +154,30 @@ class RenderPovSettingsScene(PropertyGroup): antialias_method = EnumProperty( name="Method", description="AA-sampling method. Type 1 is an adaptive, non-recursive, super-sampling " - "method. Type 2 is an adaptive and recursive super-sampling method", + "method. Type 2 is an adaptive and recursive super-sampling method. " + "Type 3 is a stochastic halton based super-sampling method", items=(("0", "non-recursive AA", "Type 1 Sampling in POV-Ray"), - ("1", "recursive AA", "Type 2 Sampling in POV-Ray")), + ("1", "recursive AA", "Type 2 Sampling in POV-Ray"), + ("2", "stochastic AA", "Type 3 Sampling in UberPOV")), default="1") - + antialias_confidence = FloatProperty( + name="Antialias Confidence", description="how surely the computed color " + "of a given pixel is indeed" + "within the threshold error margin.", + min=0.0001, max=1.0000, default=0.9900, precision=4) antialias_depth = IntProperty( name="Antialias Depth", description="Depth of pixel for sampling", min=1, max=9, default=3) antialias_threshold = FloatProperty( name="Antialias Threshold", description="Tolerance for sub-pixels", - min=0.0, max=1.0, soft_min=0.05, soft_max=0.5, default=0.1) + min=0.0, max=1.0, soft_min=0.05, soft_max=0.5, default=0.03) jitter_enable = BoolProperty( name="Jitter", description="Enable Jittering. Adds noise into the sampling process (it should be " "avoided to use jitter in animation)", - default=True) + default=False) jitter_amount = FloatProperty( name="Jitter Amount", description="Amount of jittering", @@ -921,29 +927,29 @@ class RenderPovSettingsCamera(PropertyGroup): description="Similar to a real camera's aperture effect over focal blur (though not " "in physical units and independant of focal length). " "Increase to get more blur", - min=0.01, max=1.00, default=0.25) + min=0.01, max=1.00, default=0.50) # Aperture adaptive sampling dof_samples_min = IntProperty( name="Samples Min", description="Minimum number of rays to use for each pixel", - min=1, max=128, default=96) + min=1, max=128, default=3) dof_samples_max = IntProperty( name="Samples Max", description="Maximum number of rays to use for each pixel", - min=1, max=128, default=128) + min=1, max=128, default=9) dof_variance = IntProperty( name="Variance", description="Minimum threshold (fractional value) for adaptive DOF sampling (up " "increases quality and render time). The value for the variance should " "be in the range of the smallest displayable color difference", - min=1, max=100000, soft_max=10000, default=256) + min=1, max=100000, soft_max=10000, default=8192) dof_confidence = FloatProperty( name="Confidence", description="Probability to reach the real color value. Larger confidence values " "will lead to more samples, slower traces and better images", - min=0.01, max=0.99, default=0.90) + min=0.01, max=0.99, default=0.20) ##################################CustomPOV Code############################ # Only DUMMIES below for now: @@ -970,13 +976,21 @@ class RenderPovSettingsText(PropertyGroup): class PovrayPreferences(AddonPreferences): bl_idname = __name__ + branch_feature_set_povray = EnumProperty( + name="Feature Set", + description="Choose between official (POV-Ray) or (UberPOV) development branch features to write in the pov file", + items= (('povray', 'Official POV-Ray', '','PLUGIN', 0), ('uberpov', 'Unofficial UberPOV', '', 'PLUGIN', 1)), + default='povray' + ) + filepath_povray = StringProperty( - name="Povray Location", + name="Binary Location", description="Path to renderer executable", subtype='FILE_PATH', ) def draw(self, context): layout = self.layout + layout.prop(self, "branch_feature_set_povray") layout.prop(self, "filepath_povray") diff --git a/render_povray/render.py b/render_povray/render.py index 71ce7892..9ffa4c8b 100644 --- a/render_povray/render.py +++ b/render_povray/render.py @@ -82,10 +82,40 @@ def imgMap(ts): return image_map +def imgMapTransforms(ts): + # XXX TODO: unchecked textures give error of variable referenced before assignment XXX + # POV-Ray "scale" is not a number of repetitions factor, but ,its + # inverse, a standard scale factor. + # 0.5 Offset is needed relatively to scale because center of the + # scale is 0.5,0.5 in blender and 0,0 in POV + image_map_transforms = "" + image_map_transforms = ("scale <%.4g,%.4g,%.4g> translate <%.4g,%.4g,%.4g>" % \ + ( 1.0 / ts.scale.x, + 1.0 / ts.scale.y, + 1.0 / ts.scale.z, + 0.5-(0.5/ts.scale.x) - (ts.offset.x), + 0.5-(0.5/ts.scale.y) - (ts.offset.y), + ts.offset.z)) + # image_map_transforms = (" translate <-0.5,-0.5,0.0> scale <%.4g,%.4g,%.4g> translate <%.4g,%.4g,%.4g>" % \ + # ( 1.0 / ts.scale.x, + # 1.0 / ts.scale.y, + # 1.0 / ts.scale.z, + # (0.5 / ts.scale.x) + ts.offset.x, + # (0.5 / ts.scale.y) + ts.offset.y, + # ts.offset.z)) + # image_map_transforms = ("translate <-0.5,-0.5,0> scale <-1,-1,1> * <%.4g,%.4g,%.4g> translate <0.5,0.5,0> + <%.4g,%.4g,%.4g>" % \ + # (1.0 / ts.scale.x, + # 1.0 / ts.scale.y, + # 1.0 / ts.scale.z, + # ts.offset.x, + # ts.offset.y, + # ts.offset.z)) + return image_map_transforms + def imgMapBG(wts): image_mapBG = "" # texture_coords refers to the mapping of world textures: - if wts.texture_coords == 'VIEW': + if wts.texture_coords == 'VIEW' or wts.texture_coords == 'GLOBAL': image_mapBG = " map_type 0 " elif wts.texture_coords == 'ANGMAP': image_mapBG = " map_type 1 " @@ -104,8 +134,8 @@ def imgMapBG(wts): #if image_mapBG == "": # print(" No background texture image found ") return image_mapBG - - + + def path_image(image): return bpy.path.abspath(image.filepath, library=image.library) @@ -153,7 +183,7 @@ def renderable_objects(): tabLevel = 0 unpacked_images=[] - + def exportPattern(texture): tex=texture pat = tex.pov @@ -639,8 +669,19 @@ def write_pov(filename, scene=None, info_callback=None): world = scene.world global_matrix = mathutils.Matrix.Rotation(-pi / 2.0, 4, 'X') comments = scene.pov.comments_enable and not scene.pov.tempfiles_enable - linebreaksinlists= scene.pov.list_lf_enable and not scene.pov.tempfiles_enable + linebreaksinlists = scene.pov.list_lf_enable and not scene.pov.tempfiles_enable + feature_set = bpy.context.user_preferences.addons[__package__].preferences.branch_feature_set_povray + using_uberpov = (feature_set=='uberpov') + pov_binary = PovrayRender._locate_binary() + if using_uberpov: + print("Unofficial UberPOV feature set chosen in preferences") + else: + print("Official POV-Ray 3.7 feature set chosen in preferences") + if 'uber' in pov_binary: + print("probably rendering with Uber POV binary") + else: + print("probably rendering with standard POV binary") def setTab(tabtype, spaces): TabStr = "" if tabtype == 'NONE': @@ -933,16 +974,22 @@ def write_pov(filename, scene=None, info_callback=None): raytrace_mirror = material.raytrace_mirror if raytrace_mirror.reflect_factor: tabWrite("reflection {\n") - tabWrite("rgb <%.3g, %.3g, %.3g>" % material.mirror_color[:]) + tabWrite("rgb <%.3g, %.3g, %.3g>\n" % material.mirror_color[:]) if material.pov.mirror_metallic: - tabWrite("metallic %.3g" % (raytrace_mirror.reflect_factor)) + tabWrite("metallic %.3g\n" % (raytrace_mirror.reflect_factor)) + # Blurry reflections for UberPOV + if using_uberpov and raytrace_mirror.gloss_factor < 1.0: + #tabWrite("#ifdef(unofficial) #if(unofficial = \"patch\") #if(patch(\"upov-reflection-roughness\") > 0)\n") + tabWrite("roughness %.3g\n" % \ + (1.0/raytrace_mirror.gloss_factor)) + #tabWrite("#end #end #end\n") # This and previous comment for backward compatibility, messier pov code if material.pov.mirror_use_IOR: # WORKING ? # Removed from the line below: gives a more physically correct # material but needs proper IOR. --Maurice tabWrite("fresnel 1 ") tabWrite("falloff %.3g exponent %.3g} " % \ (raytrace_mirror.fresnel, raytrace_mirror.fresnel_factor)) - + if material.subsurface_scattering.use: subsurface_scattering = material.subsurface_scattering tabWrite("subsurface { translucency <%.3g, %.3g, %.3g> }\n" % ( @@ -2017,10 +2064,11 @@ def write_pov(filename, scene=None, info_callback=None): # inverse, a standard scale factor. # Offset seems needed relatively to scale so probably center of the # scale is not the same in blender and POV - mappingSpec = "translate <%.4g,%.4g,%.4g> scale <%.4g,%.4g,%.4g>\n" % \ - (-t_spec.offset.x, t_spec.offset.y, t_spec.offset.z, - 1.0 / t_spec.scale.x, 1.0 / t_spec.scale.y, - 1.0 / t_spec.scale.z) + mappingSpec =imgMapTransforms(t_spec) + # mappingSpec = "translate <%.4g,%.4g,%.4g> scale <%.4g,%.4g,%.4g>\n" % \ + # (-t_spec.offset.x, t_spec.offset.y, t_spec.offset.z, + # 1.0 / t_spec.scale.x, 1.0 / t_spec.scale.y, + # 1.0 / t_spec.scale.z) tabWrite("uv_mapping image_map{%s \"%s\" %s}\n" % \ (imageFormat(texturesSpec), texturesSpec, imgMap(t_spec))) tabWrite("%s\n" % mappingSpec) @@ -2038,11 +2086,12 @@ def write_pov(filename, scene=None, info_callback=None): # inverse, a standard scale factor. # Offset seems needed relatively to scale so probably center of the # scale is not the same in blender and POV - mappingAlpha = " translate <%.4g, %.4g, %.4g> " \ - "scale <%.4g, %.4g, %.4g>\n" % \ - (-t_alpha.offset.x, -t_alpha.offset.y, - t_alpha.offset.z, 1.0 / t_alpha.scale.x, - 1.0 / t_alpha.scale.y, 1.0 / t_alpha.scale.z) + mappingAlpha = imgMapTransforms(t_alpha) + # mappingAlpha = " translate <%.4g, %.4g, %.4g> " \ + # "scale <%.4g, %.4g, %.4g>\n" % \ + # (-t_alpha.offset.x, -t_alpha.offset.y, + # t_alpha.offset.z, 1.0 / t_alpha.scale.x, + # 1.0 / t_alpha.scale.y, 1.0 / t_alpha.scale.z) tabWrite("pigment {pigment_pattern {uv_mapping image_map" \ "{%s \"%s\" %s}%s" % \ (imageFormat(texturesAlpha), texturesAlpha, @@ -2069,24 +2118,15 @@ def write_pov(filename, scene=None, info_callback=None): tabWrite("finish {%s}\n" % (safety(material_finish, Level=2))) else: - # POV-Ray "scale" is not a number of repetitions factor, but its - # inverse, a standard scale factor. - # Offset seems needed relatively to scale so probably center of the - # scale is not the same in blender and POV - mappingDif = ("translate <%.4g,%.4g,%.4g> scale <%.4g,%.4g,%.4g>" % \ - (-t_dif.offset.x, -t_dif.offset.y, t_dif.offset.z, - 1.0 / t_dif.scale.x, 1.0 / t_dif.scale.y, - 1.0 / t_dif.scale.z)) + mappingDif = imgMapTransforms(t_dif) + if texturesAlpha != "": - # POV-Ray "scale" is not a number of repetitions factor, but its - # inverse, a standard scale factor. - # Offset seems needed relatively to scale so probably center of the - # scale is not the same in blender and POV - mappingAlpha = " translate <%.4g,%.4g,%.4g> " \ - "scale <%.4g,%.4g,%.4g>" % \ - (-t_alpha.offset.x, -t_alpha.offset.y, - t_alpha.offset.z, 1.0 / t_alpha.scale.x, - 1.0 / t_alpha.scale.y, 1.0 / t_alpha.scale.z) + mappingAlpha = imgMapTransforms(t_alpha) + # mappingAlpha = " translate <%.4g,%.4g,%.4g> " \ + # "scale <%.4g,%.4g,%.4g>" % \ + # (-t_alpha.offset.x, -t_alpha.offset.y, + # t_alpha.offset.z, 1.0 / t_alpha.scale.x, + # 1.0 / t_alpha.scale.y, 1.0 / t_alpha.scale.z) tabWrite("pigment {\n") tabWrite("pigment_pattern {\n") if texturesAlpha and texturesAlpha.startswith("PAT_"): @@ -2141,10 +2181,11 @@ def write_pov(filename, scene=None, info_callback=None): # inverse, a standard scale factor. # Offset seems needed relatively to scale so probably center of the # scale is not the same in blender and POV - mappingNor = " translate <%.4g,%.4g,%.4g> scale <%.4g,%.4g,%.4g>" % \ - (-t_nor.offset.x, -t_nor.offset.y, t_nor.offset.z, - 1.0 / t_nor.scale.x, 1.0 / t_nor.scale.y, - 1.0 / t_nor.scale.z) + mappingNor =imgMapTransforms(t_nor) + # mappingNor = " translate <%.4g,%.4g,%.4g> scale <%.4g,%.4g,%.4g>" % \ + # (-t_nor.offset.x, -t_nor.offset.y, t_nor.offset.z, + # 1.0 / t_nor.scale.x, 1.0 / t_nor.scale.y, + # 1.0 / t_nor.scale.z) #imageMapNor = ("{bump_map {%s \"%s\" %s mapping}" % \ # (imageFormat(texturesNorm),texturesNorm,imgMap(t_nor))) #We were not using the above maybe we should? @@ -2169,10 +2210,11 @@ def write_pov(filename, scene=None, info_callback=None): # Strange that the translation factor for scale is not the same as for # translate. # TODO: verify both matches with blender internal. - mappingAlpha = " translate <%.4g,%.4g,%.4g> scale <%.4g,%.4g,%.4g>\n" % \ - (-t_alpha.offset.x, -t_alpha.offset.y, t_alpha.offset.z, - 1.0 / t_alpha.scale.x, 1.0 / t_alpha.scale.y, - 1.0 / t_alpha.scale.z) + mappingAlpha = imgMapTransforms(t_alpha) + # mappingAlpha = " translate <%.4g,%.4g,%.4g> scale <%.4g,%.4g,%.4g>\n" % \ + # (-t_alpha.offset.x, -t_alpha.offset.y, t_alpha.offset.z, + # 1.0 / t_alpha.scale.x, 1.0 / t_alpha.scale.y, + # 1.0 / t_alpha.scale.z) if texturesAlpha and texturesAlpha.startswith("PAT_"): tabWrite("function{f%s(x,y,z).transmit}\n" %texturesAlpha) else: @@ -2205,24 +2247,23 @@ def write_pov(filename, scene=None, info_callback=None): tabWrite("finish {%s}\n" % (safety(material_finish, Level=2))) elif mater.pov.replacement_text == "": - # POV-Ray "scale" is not a number of repetitions factor, but its inverse, - # a standard scale factor. - # Offset seems needed relatively to scale so probably center of the scale is - # not the same in blender and POV - # Strange that the translation factor for scale is not the same as for - # translate. - # TODO: verify both matches with blender internal. - mappingDif = ("translate <%.4g,%.4g,%.4g> scale <%.4g,%.4g,%.4g>" % \ - (-t_dif.offset.x, -t_dif.offset.y, t_dif.offset.z, - 1.0 / t_dif.scale.x, 1.0 / t_dif.scale.y, 1.0 / t_dif.scale.z)) + mappingDif = imgMapTransforms(t_dif) + # mappingDif = ("scale <%.4g,%.4g,%.4g> translate <%.4g,%.4g,%.4g>" % \ + # ( 1.0 / t_dif.scale.x, + # 1.0 / t_dif.scale.y, + # 1.0 / t_dif.scale.z, + # 0.5-(0.5/t_dif.scale.x) + t_dif.offset.x, + # 0.5-(0.5/t_dif.scale.y) + t_dif.offset.y, + # 0.5-(0.5/t_dif.scale.z) + t_dif.offset.z)) if texturesAlpha != "": # Strange that the translation factor for scale is not the same as for # translate. # TODO: verify both matches with blender internal. - mappingAlpha = "translate <%.4g,%.4g,%.4g> scale <%.4g,%.4g,%.4g>" % \ - (-t_alpha.offset.x, -t_alpha.offset.y, t_alpha.offset.z, - 1.0 / t_alpha.scale.x, 1.0 / t_alpha.scale.y, - 1.0 / t_alpha.scale.z) + mappingAlpha = imgMapTransforms(t_alpha) + # mappingAlpha = "translate <%.4g,%.4g,%.4g> scale <%.4g,%.4g,%.4g>" % \ + # (-t_alpha.offset.x, -t_alpha.offset.y, t_alpha.offset.z, + # 1.0 / t_alpha.scale.x, 1.0 / t_alpha.scale.y, + # 1.0 / t_alpha.scale.z) if texturesAlpha and texturesAlpha.startswith("PAT_"): tabWrite("pigment{pigment_pattern {function{f%s(x,y,z).transmit}}\n" %texturesAlpha) else: @@ -2280,9 +2321,10 @@ def write_pov(filename, scene=None, info_callback=None): # a standard scale factor. # Offset seems needed relatively to scale so probably center of the scale is # not the same in blender and POV - mappingNor = (" translate <%.4g,%.4g,%.4g> scale <%.4g,%.4g,%.4g>" % \ - (-t_nor.offset.x, -t_nor.offset.y, t_nor.offset.z, - 1.0 / t_nor.scale.x, 1.0 / t_nor.scale.y, 1.0 / t_nor.scale.z)) + mappingNor =imgMapTransforms(t_nor) + # mappingNor = (" translate <%.4g,%.4g,%.4g> scale <%.4g,%.4g,%.4g>" % \ + # (-t_nor.offset.x, -t_nor.offset.y, t_nor.offset.z, + # 1.0 / t_nor.scale.x, 1.0 / t_nor.scale.y, 1.0 / t_nor.scale.z)) #imageMapNor = ("{bump_map {%s \"%s\" %s mapping}" % \ # (imageFormat(texturesNorm),texturesNorm,imgMap(t_nor))) #We were not using the above maybe we should? @@ -2612,11 +2654,21 @@ def write_pov(filename, scene=None, info_callback=None): if t_blend.texture_coords == 'ANGMAP': mappingBlend = "" else: - mappingBlend = " translate <%.4g-0.5,%.4g-0.5,%.4g-0.5> rotate<0,0,0> " \ - "scale <%.4g,%.4g,%.4g>" % \ - (t_blend.offset.x / 10.0, t_blend.offset.y / 10.0, - t_blend.offset.z / 10.0, t_blend.scale.x * 0.85, - t_blend.scale.y * 0.85, t_blend.scale.z * 0.85) + # POV-Ray "scale" is not a number of repetitions factor, but its + # inverse, a standard scale factor. + # 0.5 Offset is needed relatively to scale because center of the + # UV scale is 0.5,0.5 in blender and 0,0 in POV + # Further Scale by 2 and translate by -1 are + # required for the sky_sphere not to repeat + + mappingBlend = "scale 2 scale <%.4g,%.4g,%.4g> translate -1 translate <%.4g,%.4g,%.4g> " \ + "rotate<0,0,0> " % \ + ((1.0 / t_blend.scale.x), + (1.0 / t_blend.scale.y), + (1.0 / t_blend.scale.z), + 0.5-(0.5/t_blend.scale.x)- t_blend.offset.x, + 0.5-(0.5/t_blend.scale.y)- t_blend.offset.y, + t_blend.offset.z) # The initial position and rotation of the pov camera is probably creating # the rotation offset should look into it someday but at least background @@ -2832,6 +2884,8 @@ def write_pov(filename, scene=None, info_callback=None): def write_pov_ini(scene, filename_ini, filename_pov, filename_image): + feature_set = bpy.context.user_preferences.addons[__package__].preferences.branch_feature_set_povray + using_uberpov = (feature_set=='uberpov') #scene = bpy.data.scenes[0] render = scene.render @@ -2870,11 +2924,18 @@ def write_pov_ini(scene, filename_ini, filename_pov, filename_image): # method 2 (recursive) with higher max subdiv forced because no mipmapping in POV-Ray # needs higher sampling. # aa_mapping = {"5": 2, "8": 3, "11": 4, "16": 5} - method = {"0": 1, "1": 2} + if using_uberpov: + method = {"0": 1, "1": 2, "2": 3} + else: + method = {"0": 1, "1": 2, "2": 2} file.write("Antialias=on\n") - file.write("Sampling_Method=%s\n" % method[scene.pov.antialias_method]) file.write("Antialias_Depth=%d\n" % scene.pov.antialias_depth) file.write("Antialias_Threshold=%.3g\n" % scene.pov.antialias_threshold) + if using_uberpov and scene.pov.antialias_method == '2': + file.write("Sampling_Method=%s\n" % method[scene.pov.antialias_method]) + file.write("Antialias_Confidence=%.3g\n" % scene.pov.antialias_confidence) + else: + file.write("Sampling_Method=%s\n" % method[scene.pov.antialias_method]) file.write("Antialias_Gamma=%.3g\n" % scene.pov.antialias_gamma) if scene.pov.jitter_enable: file.write("Jitter=on\n") @@ -2904,7 +2965,7 @@ class PovrayRender(bpy.types.RenderEngine): if os.path.exists(pov_binary): return pov_binary else: - print("User Preference to povray %r NOT FOUND, checking $PATH" % pov_binary) + print("User Preferences path to povray %r NOT FOUND, checking $PATH" % pov_binary) # Windows Only # assume if there is a 64bit binary that the user has a 64bit capable OS @@ -2913,12 +2974,22 @@ class PovrayRender(bpy.types.RenderEngine): win_reg_key = winreg.OpenKey(winreg.HKEY_CURRENT_USER, "Software\\POV-Ray\\v3.7\\Windows") win_home = winreg.QueryValueEx(win_reg_key, "Home")[0] - # First try 64bits + # First try 64bits UberPOV + pov_binary = os.path.join(win_home, "bin", "uberpov64.exe") + if os.path.exists(pov_binary): + return pov_binary + + # Then try 64bits POV pov_binary = os.path.join(win_home, "bin", "pvengine64.exe") if os.path.exists(pov_binary): return pov_binary - # Then try 32bits + # Then try 32bits UberPOV + pov_binary = os.path.join(win_home, "bin", "uberpov32.exe") + if os.path.exists(pov_binary): + return pov_binary + + # Then try 32bits POV pov_binary = os.path.join(win_home, "bin", "pvengine.exe") if os.path.exists(pov_binary): return pov_binary @@ -3008,7 +3079,7 @@ class PovrayRender(bpy.types.RenderEngine): return False else: - print("POV-Ray 3.7 found") + print("Engine ready!...") print("Command line arguments passed: " + str(extra_args)) return True diff --git a/render_povray/ui.py b/render_povray/ui.py index 59d3b5c2..2d0b1099 100644 --- a/render_povray/ui.py +++ b/render_povray/ui.py @@ -269,7 +269,9 @@ class RENDER_PT_povray_antialias(RenderButtonsPanel, bpy.types.Panel): def draw_header(self, context): scene = context.scene - if scene.pov.antialias_enable: + if bpy.context.user_preferences.addons[__package__].preferences.branch_feature_set_povray != 'uberpov' and scene.pov.antialias_method =='2': + self.layout.prop(scene.pov, "antialias_enable", text="", icon='ERROR') + elif scene.pov.antialias_enable: self.layout.prop(scene.pov, "antialias_enable", text="", icon='ANTIALIASED') else: self.layout.prop(scene.pov, "antialias_enable", text="", icon='ALIASED') @@ -281,23 +283,41 @@ class RENDER_PT_povray_antialias(RenderButtonsPanel, bpy.types.Panel): layout.active = scene.pov.antialias_enable + row = layout.row() row.prop(scene.pov, "antialias_method", text="") - row.prop(scene.pov, "jitter_enable", text="Jitter") - - split = layout.split() - col = split.column() - col.prop(scene.pov, "antialias_depth", text="AA Depth") - sub = split.column() - sub.prop(scene.pov, "jitter_amount", text="Jitter Amount") - if scene.pov.jitter_enable: - sub.enabled = True + if bpy.context.user_preferences.addons[__package__].preferences.branch_feature_set_povray != 'uberpov' and scene.pov.antialias_method =='2': + col = layout.column() + col.alignment = 'CENTER' + col.label(text="Stochastic Anti Aliasing is") + col.label(text="Only Available with UberPOV") + col.label(text="Feature Set in User Preferences.") + col.label(text="Using Type 2 (recursive) instead") else: - sub.enabled = False + row.prop(scene.pov, "jitter_enable", text="Jitter") + + split = layout.split() + col = split.column() + col.prop(scene.pov, "antialias_depth", text="AA Depth") + sub = split.column() + sub.prop(scene.pov, "jitter_amount", text="Jitter Amount") + if scene.pov.jitter_enable: + sub.enabled = True + else: + sub.enabled = False + + row = layout.row() + row.prop(scene.pov, "antialias_threshold", text="AA Threshold") + row.prop(scene.pov, "antialias_gamma", text="AA Gamma") + + if bpy.context.user_preferences.addons[__package__].preferences.branch_feature_set_povray == 'uberpov': + row = layout.row() + row.prop(scene.pov, "antialias_confidence", text="AA Confidence") + if scene.pov.antialias_method =='2': + row.enabled = True + else: + row.enabled = False - row = layout.row() - row.prop(scene.pov, "antialias_threshold", text="AA Threshold") - row.prop(scene.pov, "antialias_gamma", text="AA Gamma") class RENDER_PT_povray_radiosity(RenderButtonsPanel, bpy.types.Panel): -- cgit v1.2.3