~siretart/ubuntu/utopic/blender/libav10

« back to all changes in this revision

Viewing changes to release/scripts/addons/render_povray/update_files.py

  • Committer: Package Import Robot
  • Author(s): Matteo F. Vescovi
  • Date: 2012-07-23 08:54:18 UTC
  • mfrom: (14.2.16 sid)
  • mto: (14.2.19 sid)
  • mto: This revision was merged to the branch mainline in revision 42.
  • Revision ID: package-import@ubuntu.com-20120723085418-9foz30v6afaf5ffs
Tags: 2.63a-2
* debian/: Cycles support added (Closes: #658075)
  For now, this top feature has been enabled only
  on [any-amd64 any-i386] architectures because
  of OpenImageIO failing on all others
* debian/: scripts installation path changed
  from /usr/lib to /usr/share:
  + debian/patches/: patchset re-worked for path changing
  + debian/control: "Breaks" field added on yafaray-exporter

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# ##### BEGIN GPL LICENSE BLOCK #####
 
2
#
 
3
#  This program is free software; you can redistribute it and/or
 
4
#  modify it under the terms of the GNU General Public License
 
5
#  as published by the Free Software Foundation; either version 2
 
6
#  of the License, or (at your option) any later version.
 
7
#
 
8
#  This program is distributed in the hope that it will be useful,
 
9
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
#  GNU General Public License for more details.
 
12
#
 
13
#  You should have received a copy of the GNU General Public License
 
14
#  along with this program; if not, write to the Free Software Foundation,
 
15
#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
16
#
 
17
# ##### END GPL LICENSE BLOCK #####
 
18
 
 
19
# <pep8 compliant>
 
20
 
 
21
 
 
22
import bpy
 
23
from bpy.props import (StringProperty,
 
24
                       BoolProperty,
 
25
                       IntProperty,
 
26
                       FloatProperty,
 
27
                       FloatVectorProperty,
 
28
                       EnumProperty)
 
29
 
 
30
 
 
31
def update2_0_0_9():
 
32
    # Temporally register old props, so we can access their values.
 
33
    register()
 
34
 
 
35
    # Mapping old names -> old default values
 
36
    # XXX We could also store the new name, but as it is just the same without leading pov_ ...
 
37
    # Get default values of pov scene props.
 
38
    old_sce_props = {}
 
39
    for k in ["pov_tempfiles_enable", "pov_deletefiles_enable", "pov_scene_name", "pov_scene_path",
 
40
              "pov_renderimage_path", "pov_list_lf_enable", "pov_radio_enable",
 
41
              "pov_radio_display_advanced", "pov_media_enable", "pov_media_samples", "pov_media_color",
 
42
              "pov_baking_enable", "pov_indentation_character", "pov_indentation_spaces",
 
43
              "pov_comments_enable", "pov_command_line_switches", "pov_antialias_enable",
 
44
              "pov_antialias_method", "pov_antialias_depth", "pov_antialias_threshold",
 
45
              "pov_jitter_enable", "pov_jitter_amount", "pov_antialias_gamma", "pov_max_trace_level",
 
46
              "pov_photon_spacing", "pov_photon_max_trace_level", "pov_photon_adc_bailout",
 
47
              "pov_photon_gather_min", "pov_photon_gather_max", "pov_radio_adc_bailout",
 
48
              "pov_radio_always_sample", "pov_radio_brightness", "pov_radio_count",
 
49
              "pov_radio_error_bound", "pov_radio_gray_threshold", "pov_radio_low_error_factor",
 
50
              "pov_radio_media", "pov_radio_minimum_reuse", "pov_radio_nearest_count",
 
51
              "pov_radio_normal", "pov_radio_recursion_limit", "pov_radio_pretrace_start",
 
52
              "pov_radio_pretrace_end"]:
 
53
        old_sce_props[k] = getattr(bpy.types.Scene, k)[1].get('default', None)
 
54
 
 
55
    # Get default values of pov material props.
 
56
    old_mat_props = {}
 
57
    for k in ["pov_irid_enable", "pov_mirror_use_IOR", "pov_mirror_metallic", "pov_conserve_energy",
 
58
              "pov_irid_amount", "pov_irid_thickness", "pov_irid_turbulence", "pov_interior_fade_color",
 
59
              "pov_caustics_enable", "pov_fake_caustics", "pov_fake_caustics_power",
 
60
              "pov_photons_refraction", "pov_photons_dispersion", "pov_photons_reflection",
 
61
              "pov_refraction_type", "pov_replacement_text"]:
 
62
        old_mat_props[k] = getattr(bpy.types.Material, k)[1].get('default', None)
 
63
 
 
64
    # Get default values of pov texture props.
 
65
    old_tex_props = {}
 
66
    for k in ["pov_tex_gamma_enable", "pov_tex_gamma_value", "pov_replacement_text"]:
 
67
        old_tex_props[k] = getattr(bpy.types.Texture, k)[1].get('default', None)
 
68
 
 
69
    # Get default values of pov object props.
 
70
    old_obj_props = {}
 
71
    for k in ["pov_importance_value", "pov_collect_photons", "pov_replacement_text"]:
 
72
        old_obj_props[k] = getattr(bpy.types.Object, k)[1].get('default', None)
 
73
 
 
74
    # Get default values of pov camera props.
 
75
    old_cam_props = {}
 
76
    for k in ["pov_dof_enable", "pov_dof_aperture", "pov_dof_samples_min", "pov_dof_samples_max",
 
77
              "pov_dof_variance", "pov_dof_confidence", "pov_replacement_text"]:
 
78
        old_cam_props[k] = getattr(bpy.types.Camera, k)[1].get('default', None)
 
79
 
 
80
    # Get default values of pov text props.
 
81
    old_txt_props = {}
 
82
    for k in ["pov_custom_code"]:
 
83
        old_txt_props[k] = getattr(bpy.types.Text, k)[1].get('default', None)
 
84
 
 
85
    ################################################################################################
 
86
    # Now, update !
 
87
    # For each old pov property of each scene, if its value is not equal to the default one,
 
88
    # copy it to relevant new prop...
 
89
    for sce in bpy.data.scenes:
 
90
        for k, d in old_sce_props.items():
 
91
            val = getattr(sce, k, d)
 
92
            if val != d:
 
93
                setattr(sce.pov, k[4:], val)
 
94
    # The same goes for materials, textures, etc.
 
95
    for mat in bpy.data.materials:
 
96
        for k, d in old_mat_props.items():
 
97
            val = getattr(mat, k, d)
 
98
            if val != d:
 
99
                setattr(mat.pov, k[4:], val)
 
100
    for tex in bpy.data.textures:
 
101
        for k, d in old_tex_props.items():
 
102
            val = getattr(tex, k, d)
 
103
            if val != d:
 
104
                setattr(tex.pov, k[4:], val)
 
105
    for obj in bpy.data.objects:
 
106
        for k, d in old_obj_props.items():
 
107
            val = getattr(obj, k, d)
 
108
            if val != d:
 
109
                setattr(obj.pov, k[4:], val)
 
110
    for cam in bpy.data.cameras:
 
111
        for k, d in old_cam_props.items():
 
112
            val = getattr(cam, k, d)
 
113
            if val != d:
 
114
                setattr(cam.pov, k[4:], val)
 
115
    for txt in bpy.data.texts:
 
116
        for k, d in old_txt_props.items():
 
117
            val = getattr(txt, k, d)
 
118
            if val != d:
 
119
                setattr(txt.pov, k[4:], val)
 
120
    # Finally, unregister old props !
 
121
    unregister()
 
122
 
 
123
 
 
124
class RenderCopySettings(bpy.types.Operator):
 
125
    '''
 
126
    Update old POV properties to new ones.
 
127
    '''
 
128
    bl_idname = "scene.pov_update_properties"
 
129
    bl_label = "PovRay render: Update to script v0.0.9"
 
130
    bl_option = {'REGISTER'}
 
131
 
 
132
    @classmethod
 
133
    def poll(cls, context):
 
134
        return True
 
135
 
 
136
    def execute(self, context):
 
137
        update2_0_0_9()
 
138
        return {'FINISHED'}
 
139
 
 
140
 
 
141
def register():
 
142
    Scene = bpy.types.Scene
 
143
    Mat = bpy.types.Material
 
144
    Tex = bpy.types.Texture
 
145
    Obj = bpy.types.Object
 
146
    Cam = bpy.types.Camera
 
147
    Text = bpy.types.Text
 
148
    ###########################SCENE##################################
 
149
 
 
150
    # File Options
 
151
    Scene.pov_tempfiles_enable = BoolProperty(
 
152
            name="Enable Tempfiles",
 
153
            description="Enable the OS-Tempfiles. Otherwise set the path where to save the files",
 
154
            default=True)
 
155
    Scene.pov_deletefiles_enable = BoolProperty(
 
156
            name="Delete files",
 
157
            description="Delete files after rendering. Doesn't work with the image",
 
158
            default=True)
 
159
    Scene.pov_scene_name = StringProperty(
 
160
            name="Scene Name",
 
161
            description="Name of POV-Ray scene to create. Empty name will use the name of the blend file",
 
162
            default="", maxlen=1024)
 
163
    Scene.pov_scene_path = StringProperty(
 
164
            name="Export scene path",
 
165
            # description="Path to directory where the exported scene (POV and INI) is created",  # Bug in POV-Ray RC3
 
166
            description="Path to directory where the files are created",
 
167
            default="", maxlen=1024, subtype="DIR_PATH")
 
168
    Scene.pov_renderimage_path = StringProperty(
 
169
            name="Rendered image path",
 
170
            description="Full path to directory where the rendered image is saved",
 
171
            default="", maxlen=1024, subtype="DIR_PATH")
 
172
    Scene.pov_list_lf_enable = BoolProperty(
 
173
            name="LF in lists",
 
174
            description="Enable line breaks in lists (vectors and indices). Disabled: lists are exported in one line",
 
175
            default=True)
 
176
 
 
177
    # Not a real pov option, just to know if we should write
 
178
    Scene.pov_radio_enable = BoolProperty(
 
179
            name="Enable Radiosity",
 
180
            description="Enable POV-Rays radiosity calculation",
 
181
            default=False)
 
182
    Scene.pov_radio_display_advanced = BoolProperty(
 
183
            name="Advanced Options",
 
184
            description="Show advanced options",
 
185
            default=False)
 
186
    Scene.pov_media_enable = BoolProperty(
 
187
            name="Enable Media",
 
188
            description="Enable POV-Rays atmospheric media",
 
189
            default=False)
 
190
    Scene.pov_media_samples = IntProperty(
 
191
            name="Samples", description="Number of samples taken from camera to first object encountered along ray path for media calculation",
 
192
            min=1, max=100, default=35)
 
193
 
 
194
    Scene.pov_media_color = FloatVectorProperty(
 
195
            name="Media Color",
 
196
            description="The atmospheric media color",
 
197
            subtype='COLOR',
 
198
            precision=4,
 
199
            step=0.01,
 
200
            min=0,
 
201
            soft_max=1,
 
202
            default=(0.001, 0.001, 0.001),
 
203
            options={'ANIMATABLE'})
 
204
 
 
205
    Scene.pov_baking_enable = BoolProperty(
 
206
            name="Enable Baking",
 
207
            description="Enable POV-Rays texture baking",
 
208
            default=False)
 
209
    Scene.pov_indentation_character = EnumProperty(
 
210
            name="Indentation",
 
211
            description="Select the indentation type",
 
212
            items=(("0", "None", "No indentation"),
 
213
               ("1", "Tabs", "Indentation with tabs"),
 
214
               ("2", "Spaces", "Indentation with spaces")),
 
215
            default="2")
 
216
    Scene.pov_indentation_spaces = IntProperty(
 
217
            name="Quantity of spaces",
 
218
            description="The number of spaces for indentation",
 
219
            min=1, max=10, default=4)
 
220
 
 
221
    Scene.pov_comments_enable = BoolProperty(
 
222
            name="Enable Comments",
 
223
            description="Add comments to pov file",
 
224
            default=True)
 
225
 
 
226
    # Real pov options
 
227
    Scene.pov_command_line_switches = StringProperty(name="Command Line Switches",
 
228
            description="Command line switches consist of a + (plus) or - (minus) sign, followed by one or more alphabetic characters and possibly a numeric value",
 
229
            default="", maxlen=500)
 
230
 
 
231
    Scene.pov_antialias_enable = BoolProperty(
 
232
            name="Anti-Alias", description="Enable Anti-Aliasing",
 
233
            default=True)
 
234
 
 
235
    Scene.pov_antialias_method = EnumProperty(
 
236
            name="Method",
 
237
            description="AA-sampling method. Type 1 is an adaptive, non-recursive, super-sampling method. Type 2 is an adaptive and recursive super-sampling method",
 
238
            items=(("0", "non-recursive AA", "Type 1 Sampling in POV-Ray"),
 
239
               ("1", "recursive AA", "Type 2 Sampling in POV-Ray")),
 
240
            default="1")
 
241
 
 
242
    Scene.pov_antialias_depth = IntProperty(
 
243
            name="Antialias Depth", description="Depth of pixel for sampling",
 
244
            min=1, max=9, default=3)
 
245
 
 
246
    Scene.pov_antialias_threshold = FloatProperty(
 
247
            name="Antialias Threshold", description="Tolerance for sub-pixels",
 
248
            min=0.0, max=1.0, soft_min=0.05, soft_max=0.5, default=0.1)
 
249
 
 
250
    Scene.pov_jitter_enable = BoolProperty(
 
251
            name="Jitter", description="Enable Jittering. Adds noise into the sampling process (it should be avoided to use jitter in animation)",
 
252
            default=True)
 
253
 
 
254
    Scene.pov_jitter_amount = FloatProperty(
 
255
            name="Jitter Amount", description="Amount of jittering",
 
256
            min=0.0, max=1.0, soft_min=0.01, soft_max=1.0, default=1.0)
 
257
 
 
258
    Scene.pov_antialias_gamma = FloatProperty(
 
259
            name="Antialias Gamma", description="POV-Ray compares gamma-adjusted values for super sampling. Antialias Gamma sets the Gamma before comparison",
 
260
            min=0.0, max=5.0, soft_min=0.01, soft_max=2.5, default=2.5)
 
261
 
 
262
    Scene.pov_max_trace_level = IntProperty(
 
263
            name="Max Trace Level", description="Number of reflections/refractions allowed on ray path",
 
264
            min=1, max=256, default=5)
 
265
 
 
266
    Scene.pov_photon_spacing = FloatProperty(
 
267
            name="Spacing", description="Average distance between photons on surfaces. half this get four times as many surface photons",
 
268
            min=0.001, max=1.000, soft_min=0.001, soft_max=1.000, default=0.005, precision=3)
 
269
 
 
270
    Scene.pov_photon_max_trace_level = IntProperty(
 
271
            name="Max Trace Level", description="Number of reflections/refractions allowed on ray path",
 
272
            min=1, max=256, default=5)
 
273
 
 
274
    Scene.pov_photon_adc_bailout = FloatProperty(
 
275
            name="ADC Bailout", description="The adc_bailout for photons. Use adc_bailout = 0.01 / brightest_ambient_object for good results",
 
276
            min=0.0, max=1000.0, soft_min=0.0, soft_max=1.0, default=0.1, precision=3)
 
277
 
 
278
    Scene.pov_photon_gather_min = IntProperty(
 
279
            name="Gather Min", description="Minimum number of photons gathered for each point",
 
280
            min=1, max=256, default=20)
 
281
 
 
282
    Scene.pov_photon_gather_max = IntProperty(
 
283
            name="Gather Max", description="Maximum number of photons gathered for each point",
 
284
            min=1, max=256, default=100)
 
285
 
 
286
    Scene.pov_radio_adc_bailout = FloatProperty(
 
287
            name="ADC Bailout", description="The adc_bailout for radiosity rays. Use adc_bailout = 0.01 / brightest_ambient_object for good results",
 
288
            min=0.0, max=1000.0, soft_min=0.0, soft_max=1.0, default=0.01, precision=3)
 
289
 
 
290
    Scene.pov_radio_always_sample = BoolProperty(
 
291
            name="Always Sample", description="Only use the data from the pretrace step and not gather any new samples during the final radiosity pass",
 
292
            default=True)
 
293
 
 
294
    Scene.pov_radio_brightness = FloatProperty(
 
295
            name="Brightness", description="Amount objects are brightened before being returned upwards to the rest of the system",
 
296
            min=0.0, max=1000.0, soft_min=0.0, soft_max=10.0, default=1.0)
 
297
 
 
298
    Scene.pov_radio_count = IntProperty(
 
299
            name="Ray Count", description="Number of rays for each new radiosity value to be calculated (halton sequence over 1600)",
 
300
            min=1, max=10000, soft_max=1600, default=35)
 
301
 
 
302
    Scene.pov_radio_error_bound = FloatProperty(
 
303
            name="Error Bound", description="One of the two main speed/quality tuning values, lower values are more accurate",
 
304
            min=0.0, max=1000.0, soft_min=0.1, soft_max=10.0, default=1.8)
 
305
 
 
306
    Scene.pov_radio_gray_threshold = FloatProperty(
 
307
            name="Gray Threshold", description="One of the two main speed/quality tuning values, lower values are more accurate",
 
308
            min=0.0, max=1.0, soft_min=0, soft_max=1, default=0.0)
 
309
 
 
310
    Scene.pov_radio_low_error_factor = FloatProperty(
 
311
            name="Low Error Factor", description="Just enough samples is slightly blotchy. Low error changes error tolerance for less critical last refining pass",
 
312
            min=0.0, max=1.0, soft_min=0.0, soft_max=1.0, default=0.5)
 
313
 
 
314
    # max_sample - not available yet
 
315
    Scene.pov_radio_media = BoolProperty(
 
316
            name="Media", description="Radiosity estimation can be affected by media",
 
317
            default=False)
 
318
 
 
319
    Scene.pov_radio_minimum_reuse = FloatProperty(
 
320
            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)",
 
321
            min=0.0, max=1.0, soft_min=0.1, soft_max=0.1, default=0.015, precision=3)
 
322
 
 
323
    Scene.pov_radio_nearest_count = IntProperty(
 
324
            name="Nearest Count", description="Number of old ambient values blended together to create a new interpolated value",
 
325
            min=1, max=20, default=5)
 
326
 
 
327
    Scene.pov_radio_normal = BoolProperty(
 
328
            name="Normals", description="Radiosity estimation can be affected by normals",
 
329
            default=False)
 
330
 
 
331
    Scene.pov_radio_recursion_limit = IntProperty(
 
332
            name="Recursion Limit", description="how many recursion levels are used to calculate the diffuse inter-reflection",
 
333
            min=1, max=20, default=3)
 
334
 
 
335
    Scene.pov_radio_pretrace_start = FloatProperty(
 
336
            name="Pretrace Start", description="Fraction of the screen width which sets the size of the blocks in the mosaic preview first pass",
 
337
            min=0.01, max=1.00, soft_min=0.02, soft_max=1.0, default=0.08)
 
338
 
 
339
    Scene.pov_radio_pretrace_end = FloatProperty(
 
340
            name="Pretrace End", description="Fraction of the screen width which sets the size of the blocks in the mosaic preview last pass",
 
341
            min=0.001, max=1.00, soft_min=0.01, soft_max=1.00, default=0.04, precision=3)
 
342
 
 
343
    #############################MATERIAL######################################
 
344
 
 
345
    Mat.pov_irid_enable = BoolProperty(
 
346
            name="Enable Iridescence",
 
347
            description="Newton's thin film interference (like an oil slick on a puddle of water or the rainbow hues of a soap bubble.)",
 
348
            default=False)
 
349
 
 
350
    Mat.pov_mirror_use_IOR = BoolProperty(
 
351
            name="Correct Reflection",
 
352
            description="Use same IOR as raytrace transparency to calculate mirror reflections. More physically correct",
 
353
            default=False)
 
354
 
 
355
    Mat.pov_mirror_metallic = BoolProperty(
 
356
            name="Metallic Reflection",
 
357
            description="mirror reflections get colored as diffuse (for metallic materials)",
 
358
            default=False)
 
359
 
 
360
    Mat.pov_conserve_energy = BoolProperty(
 
361
            name="Conserve Energy",
 
362
            description="Light transmitted is more correctly reduced by mirror reflections, also the sum of diffuse and translucency gets reduced below one ",
 
363
            default=True)
 
364
 
 
365
    Mat.pov_irid_amount = FloatProperty(
 
366
            name="amount",
 
367
            description="Contribution of the iridescence effect to the overall surface color. As a rule of thumb keep to around 0.25 (25% contribution) or less, but experiment. If the surface is coming out too white, try lowering the diffuse and possibly the ambient values of the surface",
 
368
            min=0.0, max=1.0, soft_min=0.01, soft_max=1.0, default=0.25)
 
369
 
 
370
    Mat.pov_irid_thickness = FloatProperty(
 
371
            name="thickness",
 
372
            description="A very thin film will have a high frequency of color changes while a thick film will have large areas of color",
 
373
            min=0.0, max=1000.0, soft_min=0.1, soft_max=10.0, default=1)
 
374
 
 
375
    Mat.pov_irid_turbulence = FloatProperty(
 
376
            name="turbulence",
 
377
            description="This parameter varies the thickness",
 
378
            min=0.0, max=10.0, soft_min=0.000, soft_max=1.0, default=0)
 
379
 
 
380
    Mat.pov_interior_fade_color = FloatVectorProperty(
 
381
            name="Fade Color",
 
382
            description="Color of filtered attenuation for transparent materials",
 
383
            subtype='COLOR',
 
384
            precision=4,
 
385
            step=0.01,
 
386
            min=0.0,
 
387
            soft_max=1.0,
 
388
            default=(0, 0, 0),
 
389
            options={'ANIMATABLE'})
 
390
 
 
391
    Mat.pov_caustics_enable = BoolProperty(
 
392
            name="Caustics",
 
393
            description="use only fake refractive caustics (default) or photon based reflective/refractive caustics",
 
394
            default=True)
 
395
 
 
396
    Mat.pov_fake_caustics = BoolProperty(
 
397
            name="Fake Caustics",
 
398
            description="use only (Fast) fake refractive caustics",
 
399
            default=True)
 
400
 
 
401
    Mat.pov_fake_caustics_power = FloatProperty(
 
402
            name="Fake caustics power",
 
403
            description="Values typically range from 0.0 to 1.0 or higher. Zero is no caustics. Low, non-zero values give broad hot-spots while higher values give tighter, smaller simulated focal points",
 
404
            min=0.00, max=10.0, soft_min=0.00, soft_max=1.10, default=0.1)
 
405
 
 
406
    Mat.pov_photons_refraction = BoolProperty(
 
407
            name="Refractive Photon Caustics",
 
408
            description="more physically correct",
 
409
            default=False)
 
410
 
 
411
    Mat.pov_photons_dispersion = FloatProperty(
 
412
            name="chromatic dispersion",
 
413
            description="Light passing through will be separated according to wavelength. This ratio of refractive indices for violet to red controls how much the colors are spread out 1 = no dispersion, good values are 1.01 to 1.1",
 
414
            min=1.0000, max=10.000, soft_min=1.0000, soft_max=1.1000, precision=4, default=1.0000)
 
415
 
 
416
    Mat.pov_photons_reflection = BoolProperty(
 
417
            name="Reflective Photon Caustics",
 
418
            description="Use this to make your Sauron's ring ;-P",
 
419
            default=False)
 
420
 
 
421
    Mat.pov_refraction_type = EnumProperty(
 
422
            items=[("0", "None", "use only reflective caustics"),
 
423
                   ("1", "Fake Caustics", "use fake caustics"),
 
424
                   ("2", "Photons Caustics", "use photons for refractive caustics"),
 
425
                   ],
 
426
            name="Refractive",
 
427
            description="use fake caustics (fast) or true photons for refractive Caustics",
 
428
            default="1")
 
429
    ##################################CustomPOV Code############################
 
430
    Mat.pov_replacement_text = StringProperty(
 
431
            name="Declared name:",
 
432
            description="Type the declared name in custom POV code or an external .inc it points at. texture {} expected",
 
433
            default="")
 
434
 
 
435
    #Only DUMMIES below for now:
 
436
    Tex.pov_replacement_text = StringProperty(
 
437
            name="Declared name:",
 
438
            description="Type the declared name in custom POV code or an external .inc it points at. pigment {} expected",
 
439
            default="")
 
440
 
 
441
    Obj.pov_replacement_text = StringProperty(
 
442
            name="Declared name:",
 
443
            description="Type the declared name in custom POV code or an external .inc it points at. Any POV shape expected e.g: isosurface {}",
 
444
            default="")
 
445
 
 
446
    Cam.pov_replacement_text = StringProperty(
 
447
            name="Texts in blend file",
 
448
            description="Type the declared name in custom POV code or an external .inc it points at. camera {} expected",
 
449
            default="")
 
450
    ##############################TEXTURE######################################
 
451
 
 
452
    #Custom texture gamma
 
453
    Tex.pov_tex_gamma_enable = BoolProperty(
 
454
            name="Enable custom texture gamma",
 
455
            description="Notify some custom gamma for which texture has been precorrected without the file format carrying it and only if it differs from your OS expected standard (see pov doc)",
 
456
            default=False)
 
457
 
 
458
    Tex.pov_tex_gamma_value = FloatProperty(
 
459
            name="Custom texture gamma",
 
460
            description="value for which the file was issued e.g. a Raw photo is gamma 1.0",
 
461
            min=0.45, max=5.00, soft_min=1.00, soft_max=2.50, default=1.00)
 
462
 
 
463
    #################################OBJECT####################################
 
464
 
 
465
    #Importance sampling
 
466
    Obj.pov_importance_value = FloatProperty(
 
467
            name="Radiosity Importance",
 
468
            description="Priority value relative to other objects for sampling radiosity rays. Increase to get more radiosity rays at comparatively small yet bright objects",
 
469
            min=0.01, max=1.00, default=1.00)
 
470
 
 
471
    #Collect photons
 
472
    Obj.pov_collect_photons = BoolProperty(
 
473
            name="Receive Photon Caustics",
 
474
            description="Enable object to collect photons from other objects caustics. Turn off for objects that don't really need to receive caustics (e.g. objects that generate caustics often don't need to show any on themselves) ",
 
475
            default=True)
 
476
 
 
477
    ##################################CAMERA###################################
 
478
 
 
479
    #DOF Toggle
 
480
    Cam.pov_dof_enable = BoolProperty(
 
481
            name="Depth Of Field",
 
482
            description="Enable POV-Ray Depth Of Field ",
 
483
            default=True)
 
484
 
 
485
    #Aperture (Intensity of the Blur)
 
486
    Cam.pov_dof_aperture = FloatProperty(
 
487
            name="Aperture",
 
488
            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",
 
489
            min=0.01, max=1.00, default=0.25)
 
490
 
 
491
    #Aperture adaptive sampling
 
492
    Cam.pov_dof_samples_min = IntProperty(
 
493
            name="Samples Min",
 
494
            description="Minimum number of rays to use for each pixel",
 
495
            min=1, max=128, default=96)
 
496
 
 
497
    Cam.pov_dof_samples_max = IntProperty(
 
498
            name="Samples Max",
 
499
            description="Maximum number of rays to use for each pixel",
 
500
            min=1, max=128, default=128)
 
501
 
 
502
    Cam.pov_dof_variance = IntProperty(
 
503
            name="Variance",
 
504
            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",
 
505
            min=1, max=100000, soft_max=10000, default=256)
 
506
 
 
507
    Cam.pov_dof_confidence = FloatProperty(
 
508
            name="Confidence",
 
509
            description="Probability to reach the real color value. Larger confidence values will lead to more samples, slower traces and better images",
 
510
            min=0.01, max=0.99, default=0.90)
 
511
 
 
512
    ###################################TEXT####################################
 
513
 
 
514
    Text.pov_custom_code = BoolProperty(
 
515
            name="Custom Code",
 
516
            description="Add this text at the top of the exported POV-Ray file",
 
517
            default=False)
 
518
 
 
519
 
 
520
def unregister():
 
521
    Scene = bpy.types.Scene
 
522
    Mat = bpy.types.Material
 
523
    Tex = bpy.types.Texture
 
524
    Obj = bpy.types.Object
 
525
    Cam = bpy.types.Camera
 
526
    Text = bpy.types.Text
 
527
    del Scene.pov_tempfiles_enable  # CR
 
528
    del Scene.pov_scene_name  # CR
 
529
    del Scene.pov_deletefiles_enable  # CR
 
530
    del Scene.pov_scene_path  # CR
 
531
    del Scene.pov_renderimage_path  # CR
 
532
    del Scene.pov_list_lf_enable  # CR
 
533
    del Scene.pov_radio_enable
 
534
    del Scene.pov_radio_display_advanced
 
535
    del Scene.pov_radio_adc_bailout
 
536
    del Scene.pov_radio_always_sample
 
537
    del Scene.pov_radio_brightness
 
538
    del Scene.pov_radio_count
 
539
    del Scene.pov_radio_error_bound
 
540
    del Scene.pov_radio_gray_threshold
 
541
    del Scene.pov_radio_low_error_factor
 
542
    del Scene.pov_radio_media
 
543
    del Scene.pov_radio_minimum_reuse
 
544
    del Scene.pov_radio_nearest_count
 
545
    del Scene.pov_radio_normal
 
546
    del Scene.pov_radio_recursion_limit
 
547
    del Scene.pov_radio_pretrace_start  # MR
 
548
    del Scene.pov_radio_pretrace_end  # MR
 
549
    del Scene.pov_media_enable  # MR
 
550
    del Scene.pov_media_samples  # MR
 
551
    del Scene.pov_media_color  # MR
 
552
    del Scene.pov_baking_enable  # MR
 
553
    del Scene.pov_max_trace_level  # MR
 
554
    del Scene.pov_photon_spacing  # MR
 
555
    del Scene.pov_photon_max_trace_level  # MR
 
556
    del Scene.pov_photon_adc_bailout  # MR
 
557
    del Scene.pov_photon_gather_min  # MR
 
558
    del Scene.pov_photon_gather_max  # MR
 
559
    del Scene.pov_antialias_enable  # CR
 
560
    del Scene.pov_antialias_method  # CR
 
561
    del Scene.pov_antialias_depth  # CR
 
562
    del Scene.pov_antialias_threshold  # CR
 
563
    del Scene.pov_antialias_gamma  # CR
 
564
    del Scene.pov_jitter_enable  # CR
 
565
    del Scene.pov_jitter_amount  # CR
 
566
    del Scene.pov_command_line_switches  # CR
 
567
    del Scene.pov_indentation_character  # CR
 
568
    del Scene.pov_indentation_spaces  # CR
 
569
    del Scene.pov_comments_enable  # CR
 
570
    del Mat.pov_irid_enable  # MR
 
571
    del Mat.pov_mirror_use_IOR  # MR
 
572
    del Mat.pov_mirror_metallic  # MR
 
573
    del Mat.pov_conserve_energy  # MR
 
574
    del Mat.pov_irid_amount  # MR
 
575
    del Mat.pov_irid_thickness  # MR
 
576
    del Mat.pov_irid_turbulence  # MR
 
577
    del Mat.pov_interior_fade_color  # MR
 
578
    del Mat.pov_caustics_enable  # MR
 
579
    del Mat.pov_fake_caustics  # MR
 
580
    del Mat.pov_fake_caustics_power  # MR
 
581
    del Mat.pov_photons_refraction  # MR
 
582
    del Mat.pov_photons_dispersion  # MR
 
583
    del Mat.pov_photons_reflection  # MR
 
584
    del Mat.pov_refraction_type  # MR
 
585
    del Mat.pov_replacement_text  # MR
 
586
    del Tex.pov_tex_gamma_enable  # MR
 
587
    del Tex.pov_tex_gamma_value  # MR
 
588
    del Tex.pov_replacement_text  # MR
 
589
    del Obj.pov_importance_value  # MR
 
590
    del Obj.pov_collect_photons  # MR
 
591
    del Obj.pov_replacement_text  # MR
 
592
    del Cam.pov_dof_enable  # MR
 
593
    del Cam.pov_dof_aperture  # MR
 
594
    del Cam.pov_dof_samples_min  # MR
 
595
    del Cam.pov_dof_samples_max  # MR
 
596
    del Cam.pov_dof_variance  # MR
 
597
    del Cam.pov_dof_confidence  # MR
 
598
    del Cam.pov_replacement_text  # MR
 
599
    del Text.pov_custom_code  # MR