Newer
Older
# ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 #####
"author": "Campbell Barton, Silvio Falcinelli, Maurice Raybaud, "
"Constantin Rahn, Bastien Montagne, Leonid Desyatkov",
Jonathan Smith
committed
"location": "Render > Engine > POV-Ray 3.7",
"description": "Basic POV-Ray 3.7 integration for blender",
Campbell Barton
committed
"wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"
"Scripts/Render/POV-Ray",
"category": "Render",
}
import importlib
importlib.reload(ui)
importlib.reload(render)
importlib.reload(update_files)
from bpy.utils import register_class
Maurice Raybaud
committed
#import addon_utils # To use some other addons
import nodeitems_utils #for Nodes
from nodeitems_utils import NodeCategory, NodeItem #for Nodes
from bpy.types import (
AddonPreferences,
PropertyGroup,
)
from bpy.props import (
StringProperty,
BoolProperty,
IntProperty,
FloatProperty,
FloatVectorProperty,
EnumProperty,
PointerProperty,
)
from . import (
ui,
render,
update_files,
)
CoDEmanX
committed
def string_strip_hyphen(name):
return name.replace("-", "")
Maurice Raybaud
committed
Bastien Montagne
committed
###############################################################################
# Scene POV properties.
###############################################################################
class RenderPovSettingsScene(PropertyGroup):
name="Enable SDL window",
description="Enable the SDL window in Linux OS",
default=True)
Maurice Raybaud
committed
name="Text Scene Name",
description="Name of POV-Ray scene to use. "
"Set when clicking Run to render current text only",
maxlen=1024)
description="Enable the OS-Tempfiles. Otherwise set the path where"
" to save the files",
name="POV-Ray editor",
description="Don't Close POV-Ray editor after rendering (Overridden"
description="Delete files after rendering. "
"Doesn't work with the image",
description="Name of POV-Ray scene to create. Empty name will use "
"the name of the blend file",
# Bug in POV-Ray RC3
# description="Path to directory where the exported scene "
description="Path to directory where the files are created",
maxlen=1024, subtype="DIR_PATH")
renderimage_path: StringProperty(
description="Full path to directory where the rendered image is "
"saved",
maxlen=1024, subtype="DIR_PATH")
description="Enable line breaks in lists (vectors and indices). "
"Disabled: lists are exported in one line",
# Not a real pov option, just to know if we should write
description="Enable POV-Rays radiosity calculation",
radio_display_advanced: BoolProperty(
name="Advanced Options",
description="Show advanced options",
default=False)
name="Enable Media",
description="Enable POV-Rays atmospheric media",
default=False)
Bastien Montagne
committed
name="Samples",
Campbell Barton
committed
description="Number of samples taken from camera to first object "
Bastien Montagne
committed
"encountered along ray path for media calculation",
min=1, max=100, default=35)
media_scattering_type: EnumProperty(
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
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"
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",
Bastien Montagne
committed
precision=4, step=0.01, min=0, soft_max=1,
default=(0.001, 0.001, 0.001),
Bastien Montagne
committed
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'},
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'})
description="Enable POV-Rays texture baking",
indentation_character: EnumProperty(
name="Indentation",
description="Select the indentation type",
Campbell Barton
committed
items=(('NONE', "None", "No indentation"),
('TAB', "Tabs", "Indentation with tabs"),
('SPACE', "Spaces", "Indentation with spaces")),
default='SPACE')
name="Quantity of spaces",
description="The number of spaces for indentation",
Constantin Rahn
committed
description="Add comments to pov file",
command_line_switches: StringProperty(
Bastien Montagne
committed
name="Command Line Switches",
description="Command line switches consist of a + (plus) or - "
"(minus) sign, followed by one or more alphabetic "
"characters and possibly a numeric value",
name="Anti-Alias", description="Enable Anti-Aliasing",
default=True)
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")),
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)
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)
Bastien Montagne
committed
name="Jitter",
description="Enable Jittering. Adds noise into the sampling "
"process (it should be avoided to use jitter in "
"animation)",
default=False)
name="Jitter Amount", description="Amount of jittering",
min=0.0, max=1.0, soft_min=0.01, soft_max=1.0, default=1.0)
Bastien Montagne
committed
name="Antialias Gamma",
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)
Bastien Montagne
committed
name="Max Trace Level",
description="Number of reflections/refractions allowed on ray "
"path",
adc_bailout_enable: BoolProperty(
Maurice Raybaud
committed
name="Enable",
description="",
default=False)
Maurice Raybaud
committed
name="ADC Bailout",
description="",
min=0.0, max=1000.0,default=0.00392156862745, precision=3)
ambient_light_enable: BoolProperty(
Maurice Raybaud
committed
name="Enable",
description="",
default=False)
ambient_light: FloatVectorProperty(
name="Ambient Light",
description="Ambient light is used to simulate the effect of inter-diffuse reflection",
Maurice Raybaud
committed
precision=4, step=0.01, min=0, soft_max=1,
default=(1, 1, 1), options={'ANIMATABLE'}, subtype='COLOR',
)
global_settings_advanced: BoolProperty(
Maurice Raybaud
committed
name="Advanced",
description="",
default=False)
irid_wavelength_enable: BoolProperty(
Maurice Raybaud
committed
name="Enable",
description="",
default=False)
irid_wavelength: FloatVectorProperty(
name="Irid Wavelength",
description=(
"Iridescence calculations depend upon the dominant "
"wavelengths of the primary colors of red, green and blue light"
),
Maurice Raybaud
committed
precision=4, step=0.01, min=0, soft_max=1,
default=(0.25,0.18,0.14), options={'ANIMATABLE'}, subtype='COLOR')
Maurice Raybaud
committed
name="Charset",
description="This allows you to specify the assumed character set of all text strings",
Maurice Raybaud
committed
items=(("ascii", "ASCII", ""),
("utf8", "UTF-8", ""),
("sys", "SYS", "")),
default="utf8")
max_intersections_enable: BoolProperty(
Maurice Raybaud
committed
name="Enable",
description="",
default=False)
Maurice Raybaud
committed
name="Max Intersections",
description="POV-Ray uses a set of internal stacks to collect ray/object intersection points",
Maurice Raybaud
committed
min=2, max=1024, default=64)
number_of_waves_enable: BoolProperty(
Maurice Raybaud
committed
name="Enable",
description="",
default=False)
Maurice Raybaud
committed
name="Number Waves",
description=(
"The waves and ripples patterns are generated by summing a series of waves, "
"each with a slightly different center and size"
),
Maurice Raybaud
committed
min=1, max=10, default=1000)
noise_generator_enable: BoolProperty(
Maurice Raybaud
committed
name="Enable",
description="",
default=False)
Maurice Raybaud
committed
name="Noise Generator",
description="There are three noise generators implemented",
Maurice Raybaud
committed
min=1, max=3, default=2)
########################### PHOTONS #######################################
name="Photons",
description="Enable global photons",
default=False)
photon_enable_count: BoolProperty(
name="Spacing / Count",
description="Enable count photons",
default=False)
name="Count",
description="Photons count",
min=1, max=100000000, default=20000)
Bastien Montagne
committed
name="Spacing",
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(
Bastien Montagne
committed
name="Max Trace Level",
description="Number of reflections/refractions allowed on ray "
"path",
photon_adc_bailout: FloatProperty(
Loading
Loading full blame...