2 # Copyright 2011, Blender Foundation.
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software Foundation,
16 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 from bpy.props import (BoolProperty,
33 class CyclesRenderSettings(bpy.types.PropertyGroup):
36 bpy.types.Scene.cycles = PointerProperty(
37 name="Cycles Render Settings",
38 description="Cycles render settings",
41 cls.device = EnumProperty(
43 description="Device to use for rendering",
47 cls.feature_set = EnumProperty(
49 description="Feature set to use for rendering",
50 items=enums.feature_set,
53 cls.shading_system = EnumProperty(
54 name="Shading System",
55 description="Shading system to use for rendering",
56 items=enums.shading_systems,
57 default='GPU_COMPATIBLE',
60 cls.progressive = BoolProperty(
62 description="Use progressive sampling of lighting",
66 cls.samples = IntProperty(
68 description="Number of samples to render for each pixel",
69 min=1, max=2147483647,
72 cls.preview_samples = IntProperty(
73 name="Preview Samples",
74 description="Number of samples to render in the viewport, unlimited if 0",
75 min=0, max=2147483647,
78 cls.preview_pause = BoolProperty(
80 description="Pause all viewport preview renders",
83 cls.preview_active_layer = BoolProperty(
84 name="Preview Active Layer",
85 description="Preview active render layer in viewport",
89 cls.aa_samples = IntProperty(
91 description="Number of antialiasing samples to render for each pixel",
95 cls.preview_aa_samples = IntProperty(
97 description="Number of antialiasing samples to render in the viewport, unlimited if 0",
101 cls.diffuse_samples = IntProperty(
102 name="Diffuse Samples",
103 description="Number of diffuse bounce samples to render for each AA sample",
107 cls.glossy_samples = IntProperty(
108 name="Glossy Samples",
109 description="Number of glossy bounce samples to render for each AA sample",
113 cls.transmission_samples = IntProperty(
114 name="Transmission Samples",
115 description="Number of transmission bounce samples to render for each AA sample",
119 cls.ao_samples = IntProperty(
120 name="Ambient Occlusion Samples",
121 description="Number of ambient occlusion samples to render for each AA sample",
125 cls.mesh_light_samples = IntProperty(
126 name="Mesh Light Samples",
127 description="Number of mesh emission light samples to render for each AA sample",
132 cls.no_caustics = BoolProperty(
134 description="Leave out caustics, resulting in a darker image with less noise",
137 cls.blur_glossy = FloatProperty(
138 name="Filter Glossy",
139 description="Adaptively blur glossy shaders after blurry bounces, to reduce noise at the cost of accuracy",
144 cls.min_bounces = IntProperty(
146 description="Minimum number of bounces, setting this lower "
147 "than the maximum enables probabilistic path "
148 "termination (faster but noisier)",
152 cls.max_bounces = IntProperty(
154 description="Total maximum number of bounces",
159 cls.diffuse_bounces = IntProperty(
160 name="Diffuse Bounces",
161 description="Maximum number of diffuse reflection bounces, bounded by total maximum",
165 cls.glossy_bounces = IntProperty(
166 name="Glossy Bounces",
167 description="Maximum number of glossy reflection bounces, bounded by total maximum",
171 cls.transmission_bounces = IntProperty(
172 name="Transmission Bounces",
173 description="Maximum number of transmission bounces, bounded by total maximum",
178 cls.transparent_min_bounces = IntProperty(
179 name="Transparent Min Bounces",
180 description="Minimum number of transparent bounces, setting "
181 "this lower than the maximum enables "
182 "probabilistic path termination (faster but "
187 cls.transparent_max_bounces = IntProperty(
188 name="Transparent Max Bounces",
189 description="Maximum number of transparent bounces",
193 cls.use_transparent_shadows = BoolProperty(
194 name="Transparent Shadows",
195 description="Use transparency of surfaces for rendering shadows",
199 cls.film_exposure = FloatProperty(
201 description="Image brightness scale",
205 cls.film_transparent = BoolProperty(
207 description="World background is transparent",
211 cls.filter_type = EnumProperty(
213 description="Pixel filter type",
214 items=enums.filter_types,
217 cls.filter_width = FloatProperty(
219 description="Pixel filter width",
224 cls.seed = IntProperty(
226 description="Seed value for integrator to get different noise patterns",
227 min=0, max=2147483647,
231 cls.sample_clamp = FloatProperty(
233 description="If non-zero, the maximum value for a sample, higher values will be scaled down to avoid too much noise and slow convergence at the cost of accuracy",
238 cls.debug_tile_size = IntProperty(
244 cls.debug_min_size = IntProperty(
250 cls.debug_reset_timeout = FloatProperty(
251 name="Reset timeout",
256 cls.debug_cancel_timeout = FloatProperty(
257 name="Cancel timeout",
262 cls.debug_text_timeout = FloatProperty(
269 cls.debug_bvh_type = EnumProperty(
270 name="Viewport BVH Type",
271 description="Choose between faster updates, or faster render",
272 items=enums.bvh_types,
273 default='DYNAMIC_BVH',
275 cls.debug_use_spatial_splits = BoolProperty(
276 name="Use Spatial Splits",
277 description="Use BVH spatial splits: longer builder time, faster render",
280 cls.use_cache = BoolProperty(
282 description="Cache last built BVH to disk for faster re-render if no geometry changed",
288 del bpy.types.Scene.cycles
291 class CyclesCameraSettings(bpy.types.PropertyGroup):
294 bpy.types.Camera.cycles = PointerProperty(
295 name="Cycles Camera Settings",
296 description="Cycles camera settings",
300 cls.aperture_type = EnumProperty(
301 name="Aperture Type",
302 description="Use F/stop number or aperture radius",
303 items=enums.aperture_types,
306 cls.aperture_fstop = FloatProperty(
307 name="Aperture F/stop",
308 description="F/stop ratio (lower numbers give more defocus, higher numbers give a sharper image)",
309 min=0.0, soft_min=0.1, soft_max=64.0,
314 cls.aperture_size = FloatProperty(
315 name="Aperture Size",
316 description="Radius of the aperture for depth of field (higher values give more defocus)",
317 min=0.0, soft_max=10.0,
322 cls.aperture_blades = IntProperty(
323 name="Aperture Blades",
324 description="Number of blades in aperture for polygonal bokeh (at least 3)",
328 cls.aperture_rotation = FloatProperty(
329 name="Aperture Rotation",
330 description="Rotation of blades in aperture",
331 soft_min=-math.pi, soft_max=math.pi,
335 cls.panorama_type = EnumProperty(
336 name="Panorama Type",
337 description="Distortion to use for the calculation",
338 items=enums.panorama_types,
339 default='FISHEYE_EQUISOLID',
341 cls.fisheye_fov = FloatProperty(
342 name="Field of View",
343 description="Field of view for the fisheye lens",
344 min=0.1745, soft_max=2 * math.pi, max=10.0 * math.pi,
348 cls.fisheye_lens = FloatProperty(
350 description="Lens focal length (mm)",
351 min=0.01, soft_max=15.0, max=100.0,
357 del bpy.types.Camera.cycles
360 class CyclesMaterialSettings(bpy.types.PropertyGroup):
363 bpy.types.Material.cycles = PointerProperty(
364 name="Cycles Material Settings",
365 description="Cycles material settings",
368 cls.sample_as_light = BoolProperty(
369 name="Sample as Lamp",
370 description="Use direct light sampling for this material, disabling may reduce overall noise for large objects that emit little light compared to other light sources",
373 cls.homogeneous_volume = BoolProperty(
374 name="Homogeneous Volume",
375 description="When using volume rendering, assume volume has the same density everywhere, for faster rendering",
381 del bpy.types.Material.cycles
384 class CyclesLampSettings(bpy.types.PropertyGroup):
387 bpy.types.Lamp.cycles = PointerProperty(
388 name="Cycles Lamp Settings",
389 description="Cycles lamp settings",
392 cls.cast_shadow = BoolProperty(
394 description="Lamp casts shadows",
397 cls.samples = IntProperty(
399 description="Number of light samples to render for each AA sample",
406 del bpy.types.Lamp.cycles
409 class CyclesWorldSettings(bpy.types.PropertyGroup):
412 bpy.types.World.cycles = PointerProperty(
413 name="Cycles World Settings",
414 description="Cycles world settings",
417 cls.sample_as_light = BoolProperty(
418 name="Sample as Lamp",
419 description="Use direct light sampling for the environment, enabling for non-solid colors is recommended",
422 cls.sample_map_resolution = IntProperty(
423 name="Map Resolution",
424 description="Importance map size is resolution x resolution; higher values potentially produce less noise, at the cost of memory and speed",
428 cls.samples = IntProperty(
430 description="Number of light samples to render for each AA sample",
437 del bpy.types.World.cycles
440 class CyclesVisibilitySettings(bpy.types.PropertyGroup):
443 bpy.types.Object.cycles_visibility = PointerProperty(
444 name="Cycles Visibility Settings",
445 description="Cycles visibility settings",
449 cls.camera = BoolProperty(
451 description="Object visibility for camera rays",
454 cls.diffuse = BoolProperty(
456 description="Object visibility for diffuse reflection rays",
459 cls.glossy = BoolProperty(
461 description="Object visibility for glossy reflection rays",
464 cls.transmission = BoolProperty(
466 description="Object visibility for transmission rays",
469 cls.shadow = BoolProperty(
471 description="Object visibility for shadow rays",
477 del bpy.types.Object.cycles_visibility
480 class CyclesMeshSettings(bpy.types.PropertyGroup):
483 bpy.types.Mesh.cycles = PointerProperty(
484 name="Cycles Mesh Settings",
485 description="Cycles mesh settings",
488 bpy.types.Curve.cycles = PointerProperty(
489 name="Cycles Mesh Settings",
490 description="Cycles mesh settings",
493 bpy.types.MetaBall.cycles = PointerProperty(
494 name="Cycles Mesh Settings",
495 description="Cycles mesh settings",
499 cls.displacement_method = EnumProperty(
500 name="Displacement Method",
501 description="Method to use for the displacement",
502 items=enums.displacement_methods,
505 cls.use_subdivision = BoolProperty(
506 name="Use Subdivision",
507 description="Subdivide mesh for rendering",
510 cls.dicing_rate = FloatProperty(
513 min=0.001, max=1000.0,
519 del bpy.types.Mesh.cycles
520 del bpy.types.Curve.cycles
521 del bpy.types.MetaBall.cycles
525 bpy.utils.register_class(CyclesRenderSettings)
526 bpy.utils.register_class(CyclesCameraSettings)
527 bpy.utils.register_class(CyclesMaterialSettings)
528 bpy.utils.register_class(CyclesLampSettings)
529 bpy.utils.register_class(CyclesWorldSettings)
530 bpy.utils.register_class(CyclesVisibilitySettings)
531 bpy.utils.register_class(CyclesMeshSettings)
535 bpy.utils.unregister_class(CyclesRenderSettings)
536 bpy.utils.unregister_class(CyclesCameraSettings)
537 bpy.utils.unregister_class(CyclesMaterialSettings)
538 bpy.utils.unregister_class(CyclesLampSettings)
539 bpy.utils.unregister_class(CyclesWorldSettings)
540 bpy.utils.unregister_class(CyclesMeshSettings)
541 bpy.utils.unregister_class(CyclesVisibilitySettings)