Skip to content
Snippets Groups Projects
__init__.py 145 KiB
Newer Older
# ##### BEGIN GPL LICENSE BLOCK #####
Luca Bonavita's avatar
Luca Bonavita committed
#
#  This program is free software; you can redistribute it and/or
#  modify it under the terms of the GNU General Public License
#  as published by the Free Software Foundation; either version 2
#  of the License, or (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software Foundation,
#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####

    "name": "POV-3.7",
    "author": "Campbell Barton, Silvio Falcinelli, Maurice Raybaud, "
              "Constantin Rahn, Bastien Montagne, Leonid Desyatkov",
    "version": (0, 1, 0),
    "blender": (2, 80, 0),
    "location": "Render > Engine > POV-Ray 3.7",
    "description": "Basic POV-Ray 3.7 integration for blender",
    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"
                "Scripts/Render/POV-Ray",
Luca Bonavita's avatar
Luca Bonavita committed

if "bpy" in locals():
    import importlib
    importlib.reload(ui)
    importlib.reload(render)
    importlib.reload(shading)
    importlib.reload(update_files)

else:
    import bpy
    from bpy.utils import register_class
    #import addon_utils # To use some other addons
    import nodeitems_utils #for Nodes
    from nodeitems_utils import NodeCategory, NodeItem #for Nodes
    from bl_operators.presets import AddPresetBase
    from bpy.types import (
            AddonPreferences,
            PropertyGroup,
            )
    from bpy.props import (
            StringProperty,
            BoolProperty,
            IntProperty,
            FloatProperty,
            FloatVectorProperty,
            EnumProperty,
            PointerProperty,
            )
    from . import (
            ui,
            render,
            update_files,
            )
def string_strip_hyphen(name):
    return name.replace("-", "")
Luca Bonavita's avatar
Luca Bonavita committed

###############################################################################
# Scene POV properties.
###############################################################################
class RenderPovSettingsScene(PropertyGroup):
    #Linux SDL-window enable
    sdl_window_enable: BoolProperty(
            name="Enable SDL window",
            description="Enable the SDL window in Linux OS",
            default=True)
    # File Options
    text_block: StringProperty(
            name="Text Scene Name",
            description="Name of POV-Ray scene to use. "
                        "Set when clicking Run to render current text only",
            maxlen=1024)
    tempfiles_enable: BoolProperty(
            name="Enable Tempfiles",
            description="Enable the OS-Tempfiles. Otherwise set the path where"
                        " to save the files",
            default=True)
    pov_editor: BoolProperty(
            name="POV-Ray editor",
            description="Don't Close POV-Ray editor after rendering (Overridden"
                        " by /EXIT command)",
    deletefiles_enable: BoolProperty(
            name="Delete files",
            description="Delete files after rendering. "
                        "Doesn't work with the image",
            default=True)
    scene_name: StringProperty(
            name="Scene Name",
            description="Name of POV-Ray scene to create. Empty name will use "
                        "the name of the blend file",
    scene_path: StringProperty(
            name="Export scene path",
            # Bug in POV-Ray RC3
            # description="Path to directory where the exported scene "
                        # "(POV and INI) is created",
            description="Path to directory where the files are created",
            maxlen=1024, subtype="DIR_PATH")
    renderimage_path: StringProperty(
            name="Rendered image path",
            description="Full path to directory where the rendered image is "
                        "saved",
            maxlen=1024, subtype="DIR_PATH")
    list_lf_enable: BoolProperty(
            name="LF in lists",
            description="Enable line breaks in lists (vectors and indices). "
                        "Disabled: lists are exported in one line",
            default=True)
    # Not a real pov option, just to know if we should write
    radio_enable: BoolProperty(
            name="Enable Radiosity",
            description="Enable POV-Rays radiosity calculation",
    radio_display_advanced: BoolProperty(
            name="Advanced Options",
            description="Show advanced options",
            default=False)
    media_enable: BoolProperty(
            name="Enable Media",
            description="Enable POV-Rays atmospheric media",
            default=False)
    media_samples: IntProperty(
            description="Number of samples taken from camera to first object "
                        "encountered along ray path for media calculation",
            min=1, max=100, default=35)
    media_scattering_type: EnumProperty(
            name="Scattering Type",
            description="Scattering model",
            items=(('1', "1 Isotropic", "The simplest form of scattering because"
                                      " it is independent of direction."),
                   ('2', "2 Mie haze ", "For relatively small particles such as "
                                      "minuscule water droplets of fog, cloud "
                                      "particles, and particles responsible "
                                      "for the polluted sky. In this model the"
                                      " scattering is extremely directional in"
                                      " the forward direction i.e. the amount "
                                      "of scattered light is largest when the "
                                      "incident light is anti-parallel to the "
                                      "viewing direction (the light goes "
                                      "directly to the viewer). It is smallest"
                                      " when the incident light is parallel to"
                                      " the viewing direction. "),
                   ('3', "3 Mie murky", "Like haze but much more directional"),
                   ('4', "4 Rayleigh", "For extremely small particles such as "
                                     "molecules of the air. The amount of "
                                     "scattered light depends on the incident"
                                     " light angle. It is largest when the "
                                     "incident light is parallel or "
                                     "anti-parallel to the viewing direction "
                                     "and smallest when the incident light is "
                                     "perpendicular to viewing direction."),
                   ('5', "5 Henyey-Greenstein", "The default eccentricity value "
                                              "of zero defines isotropic "
                                              "scattering while positive "
                                              "values lead to scattering in "
                                              "the direction of the light and "
                                              "negative values lead to "
                                              "scattering in the opposite "
                                              "direction of the light. Larger "
                                              "values of e (or smaller values "
                                              "in the negative case) increase "
                                              "the directional property of the"
                                              " scattering.")),
    media_diffusion_scale: FloatProperty(
            name="Scale", description="Scale factor of Media Diffusion Color",
            precision=12, step=0.00000001, min=0.000000001, max=1.0,
            default=(1.0))
    media_diffusion_color: FloatVectorProperty(
            name="Media Diffusion Color", description="The atmospheric media color",
            precision=4, step=0.01, min=0, soft_max=1,
            default=(0.001, 0.001, 0.001),
            options={'ANIMATABLE'},
    media_absorption_scale: FloatProperty(
            name="Scale", description="Scale factor of Media Absorption Color. "
                                      "use 1/depth of media volume in meters",
            precision=12, step=0.000001, min=0.000000001, max=1.0,
            default=(0.00002))
    media_absorption_color: FloatVectorProperty(
            name="Media Absorption Color", description="The atmospheric media absorption color",
            precision=4, step=0.01, min=0, soft_max=1,
            default=(0.0, 0.0, 0.0),
            options={'ANIMATABLE'},
Campbell Barton's avatar
Campbell Barton committed
            subtype='COLOR')
    media_eccentricity: FloatProperty(
            name="Media Eccenticity Factor", description="Positive values lead"
                 " to scattering in the direction of the light and negative "
                 "values lead to scattering in the opposite direction of the "
                 "light. Larger values of e (or smaller values in the negative"
                 " case) increase the directional property of the scattering.",
            precision=2, step=0.01, min=-1.0, max=1.0,
            default=(0.0),
            options={'ANIMATABLE'})
    baking_enable: BoolProperty(
Maurice Raybaud's avatar
Maurice Raybaud committed
            name="Enable Baking",
            description="Enable POV-Rays texture baking",
Maurice Raybaud's avatar
Maurice Raybaud committed
            default=False)
    indentation_character: EnumProperty(
Maurice Raybaud's avatar
Maurice Raybaud committed
            name="Indentation",
            description="Select the indentation type",
            items=(('NONE', "None", "No indentation"),
                   ('TAB', "Tabs", "Indentation with tabs"),
                   ('SPACE', "Spaces", "Indentation with spaces")),
            default='SPACE')
    indentation_spaces: IntProperty(
Maurice Raybaud's avatar
Maurice Raybaud committed
            name="Quantity of spaces",
            description="The number of spaces for indentation",
            min=1, max=10, default=4)
    comments_enable: BoolProperty(
Maurice Raybaud's avatar
Maurice Raybaud committed
            name="Enable Comments",
            description="Add comments to pov file",
Maurice Raybaud's avatar
Maurice Raybaud committed
            default=True)

    # Real pov options
    command_line_switches: StringProperty(
            description="Command line switches consist of a + (plus) or - "
                        "(minus) sign, followed by one or more alphabetic "
                        "characters and possibly a numeric value",
    antialias_enable: BoolProperty(
            name="Anti-Alias", description="Enable Anti-Aliasing",
            default=True)
    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. 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"),
                   ("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.03)
    jitter_enable: BoolProperty(
            description="Enable Jittering. Adds noise into the sampling "
                        "process (it should be avoided to use jitter in "
                        "animation)",
    jitter_amount: FloatProperty(
            name="Jitter Amount", description="Amount of jittering",
            min=0.0, max=1.0, soft_min=0.01, soft_max=1.0, default=1.0)
    antialias_gamma: FloatProperty(
            description="POV-Ray compares gamma-adjusted values for super "
                        "sampling. Antialias Gamma sets the Gamma before "
                        "comparison",
            min=0.0, max=5.0, soft_min=0.01, soft_max=2.5, default=2.5)
    max_trace_level: IntProperty(
            description="Number of reflections/refractions allowed on ray "
                        "path",
Maurice Raybaud's avatar
Maurice Raybaud committed
            min=1, max=256, default=5)
Campbell Barton's avatar
Campbell Barton committed

#######NEW from Lanuhum
    adc_bailout_enable: BoolProperty(
    adc_bailout: FloatProperty(
            name="ADC Bailout",
            description="",
            min=0.0, max=1000.0,default=0.00392156862745, precision=3)

    ambient_light_enable: BoolProperty(
    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(
    irid_wavelength_enable: BoolProperty(
    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(
            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(
    max_intersections: IntProperty(
            description="POV-Ray uses a set of internal stacks to collect ray/object intersection points",
    number_of_waves_enable: BoolProperty(
    number_of_waves: IntProperty(
            description=(
                "The waves and ripples patterns are generated by summing a series of waves, "
                "each with a slightly different center and size"
            ),
    noise_generator_enable: BoolProperty(
    noise_generator: IntProperty(
            description="There are three noise generators implemented",
    ########################### PHOTONS #######################################
    photon_enable: BoolProperty(
            name="Photons",
            description="Enable global photons",
            default=False)

    photon_enable_count: BoolProperty(
            name="Spacing / Count",
            description="Enable count photons",
            default=False)

    photon_count: IntProperty(
            name="Count",
            description="Photons count",
            min=1, max=100000000, default=20000)
    photon_spacing: FloatProperty(
            description="Average distance between photons on surfaces. half "
                        "this get four times as many surface photons",
            min=0.001, max=1.000, default=0.005,
            soft_min=0.001, soft_max=1.000, precision=3)
    photon_max_trace_level: IntProperty(
            description="Number of reflections/refractions allowed on ray "
                        "path",
            min=1, max=256, default=5)

    photon_adc_bailout: FloatProperty(
Loading
Loading full blame...