Skip to content
Snippets Groups Projects
__init__.py 148 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, Maurice Raybaud, Leonid Desyatkov, "
              "Bastien Montagne, Constantin Rahn, Silvio Falcinelli",
    "version": (0, 1, 0),
    "blender": (2, 80, 0),
    "location": "Render > Engine > POV-Ray 3.7",
    "description": "POV-Ray 3.7 integration for blender",
    "wiki_url": "https://archive.blender.org/wiki/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, unregister_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(
Loading
Loading full blame...