Cycles: Expose volume voxel data interpolation to the interface
[blender-staging.git] / intern / cycles / blender / addon / properties.py
1 #
2 # Copyright 2011-2013 Blender Foundation
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 # http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License
15 #
16
17 # <pep8 compliant>
18
19 import bpy
20 from bpy.props import (BoolProperty,
21                        EnumProperty,
22                        FloatProperty,
23                        IntProperty,
24                        PointerProperty)
25
26 # enums
27
28 import _cycles
29
30 enum_devices = (
31     ('CPU', "CPU", "Use CPU for rendering"),
32     ('GPU', "GPU Compute", "Use GPU compute device for rendering, configured in user preferences"),
33     )
34
35 if _cycles.with_network:
36     enum_devices += (('NETWORK', "Networked Device", "Use networked device for rendering"),)
37
38 enum_feature_set = (
39     ('SUPPORTED', "Supported", "Only use finished and supported features"),
40     ('EXPERIMENTAL', "Experimental", "Use experimental and incomplete features that might be broken or change in the future", 'ERROR', 1),
41     )
42
43 enum_displacement_methods = (
44     ('BUMP', "Bump", "Bump mapping to simulate the appearance of displacement"),
45     ('TRUE', "True", "Use true displacement only, requires fine subdivision"),
46     ('BOTH', "Both", "Combination of displacement and bump mapping"),
47     )
48
49 enum_bvh_types = (
50     ('DYNAMIC_BVH', "Dynamic BVH", "Objects can be individually updated, at the cost of slower render time"),
51     ('STATIC_BVH', "Static BVH", "Any object modification requires a complete BVH rebuild, but renders faster"),
52     )
53
54 enum_filter_types = (
55     ('BOX', "Box", "Box filter"),
56     ('GAUSSIAN', "Gaussian", "Gaussian filter"),
57     )
58
59 enum_aperture_types = (
60     ('RADIUS', "Radius", "Directly change the size of the aperture"),
61     ('FSTOP', "F/stop", "Change the size of the aperture by f/stops"),
62     )
63
64 enum_panorama_types = (
65     ('EQUIRECTANGULAR', "Equirectangular", "Render the scene with a spherical camera, also known as Lat Long panorama"),
66     ('FISHEYE_EQUIDISTANT', "Fisheye Equidistant", "Ideal for fulldomes, ignore the sensor dimensions"),
67     ('FISHEYE_EQUISOLID', "Fisheye Equisolid",
68                           "Similar to most fisheye modern lens, takes sensor dimensions into consideration"),
69     )
70
71 enum_curve_primitives = (
72     ('TRIANGLES', "Triangles", "Create triangle geometry around strands"),
73     ('LINE_SEGMENTS', "Line Segments", "Use line segment primitives"),
74     ('CURVE_SEGMENTS', "Curve Segments", "Use segmented cardinal curve primitives"),
75     )
76
77 enum_triangle_curves = (
78     ('CAMERA_TRIANGLES', "Planes", "Create individual triangles forming planes that face camera"),
79     ('TESSELLATED_TRIANGLES', "Tessellated", "Create mesh surrounding each strand"),
80     )
81
82 enum_curve_shape = (
83     ('RIBBONS', "Ribbons", "Ignore thickness of each strand"),
84     ('THICK', "Thick", "Use thickness of strand when rendering"),
85     )
86
87 enum_tile_order = (
88     ('CENTER', "Center", "Render from center to the edges"),
89     ('RIGHT_TO_LEFT', "Right to Left", "Render from right to left"),
90     ('LEFT_TO_RIGHT', "Left to Right", "Render from left to right"),
91     ('TOP_TO_BOTTOM', "Top to Bottom", "Render from top to bottom"),
92     ('BOTTOM_TO_TOP', "Bottom to Top", "Render from bottom to top"),
93     )
94
95 enum_use_layer_samples = (
96     ('USE', "Use", "Per render layer number of samples override scene samples"),
97     ('BOUNDED', "Bounded", "Bound per render layer number of samples by global samples"),
98     ('IGNORE', "Ignore", "Ignore per render layer number of samples"),
99     )
100
101 enum_sampling_pattern = (
102     ('SOBOL', "Sobol", "Use Sobol random sampling pattern"),
103     ('CORRELATED_MUTI_JITTER', "Correlated Multi-Jitter", "Use Correlated Multi-Jitter random sampling pattern"),
104     )
105
106 enum_integrator = (
107     ('BRANCHED_PATH', "Branched Path Tracing", "Path tracing integrator that branches on the first bounce, giving more control over the number of light and material samples"),
108     ('PATH', "Path Tracing", "Pure path tracing integrator"),
109     )
110
111 enum_volume_sampling = (
112     ('DISTANCE', "Distance", "Use distance sampling, best for dense volumes with lights far away"),
113     ('EQUIANGULAR', "Equiangular", "Use equiangular sampling, best for volumes with low density with light inside or near the volume"),
114     ('MULTIPLE_IMPORTANCE', "Multiple Importance", "Combine distance and equi-angular sampling for volumes where neither method is ideal"),
115     )
116
117 enum_volume_interpolation = (
118     ('LINEAR', "Linear", "Good smoothness and speed"),
119     ('CUBIC', 'Cubic', 'Smoothed high quality interpolation, but slower')
120     )
121
122
123 class CyclesRenderSettings(bpy.types.PropertyGroup):
124     @classmethod
125     def register(cls):
126         bpy.types.Scene.cycles = PointerProperty(
127                 name="Cycles Render Settings",
128                 description="Cycles render settings",
129                 type=cls,
130                 )
131         cls.device = EnumProperty(
132                 name="Device",
133                 description="Device to use for rendering",
134                 items=enum_devices,
135                 default='CPU',
136                 )
137         cls.feature_set = EnumProperty(
138                 name="Feature Set",
139                 description="Feature set to use for rendering",
140                 items=enum_feature_set,
141                 default='SUPPORTED',
142                 )
143         cls.shading_system = BoolProperty(
144                 name="Open Shading Language",
145                 description="Use Open Shading Language (CPU rendering only)",
146                 )
147
148         cls.progressive = EnumProperty(
149                 name="Integrator",
150                 description="Method to sample lights and materials",
151                 items=enum_integrator,
152                 default='PATH',
153                 )
154
155         cls.use_square_samples = BoolProperty(
156                 name="Square Samples",
157                 description="Square sampling values for easier artist control",
158                 default=False,
159                 )
160
161         cls.samples = IntProperty(
162                 name="Samples",
163                 description="Number of samples to render for each pixel",
164                 min=1, max=2147483647,
165                 default=10,
166                 )
167         cls.preview_samples = IntProperty(
168                 name="Preview Samples",
169                 description="Number of samples to render in the viewport, unlimited if 0",
170                 min=0, max=2147483647,
171                 default=10,
172                 )
173         cls.preview_pause = BoolProperty(
174                 name="Pause Preview",
175                 description="Pause all viewport preview renders",
176                 default=False,
177                 )
178         cls.preview_active_layer = BoolProperty(
179                 name="Preview Active Layer",
180                 description="Preview active render layer in viewport",
181                 default=False,
182                 )
183
184         cls.aa_samples = IntProperty(
185                 name="AA Samples",
186                 description="Number of antialiasing samples to render for each pixel",
187                 min=1, max=10000,
188                 default=4,
189                 )
190         cls.preview_aa_samples = IntProperty(
191                 name="AA Samples",
192                 description="Number of antialiasing samples to render in the viewport, unlimited if 0",
193                 min=0, max=10000,
194                 default=4,
195                 )
196         cls.diffuse_samples = IntProperty(
197                 name="Diffuse Samples",
198                 description="Number of diffuse bounce samples to render for each AA sample",
199                 min=1, max=10000,
200                 default=1,
201                 )
202         cls.glossy_samples = IntProperty(
203                 name="Glossy Samples",
204                 description="Number of glossy bounce samples to render for each AA sample",
205                 min=1, max=10000,
206                 default=1,
207                 )
208         cls.transmission_samples = IntProperty(
209                 name="Transmission Samples",
210                 description="Number of transmission bounce samples to render for each AA sample",
211                 min=1, max=10000,
212                 default=1,
213                 )
214         cls.ao_samples = IntProperty(
215                 name="Ambient Occlusion Samples",
216                 description="Number of ambient occlusion samples to render for each AA sample",
217                 min=1, max=10000,
218                 default=1,
219                 )
220         cls.mesh_light_samples = IntProperty(
221                 name="Mesh Light Samples",
222                 description="Number of mesh emission light samples to render for each AA sample",
223                 min=1, max=10000,
224                 default=1,
225                 )
226
227         cls.subsurface_samples = IntProperty(
228                 name="Subsurface Samples",
229                 description="Number of subsurface scattering samples to render for each AA sample",
230                 min=1, max=10000,
231                 default=1,
232                 )
233
234         cls.volume_samples = IntProperty(
235                 name="Volume Samples",
236                 description="Number of volume scattering samples to render for each AA sample",
237                 min=1, max=10000,
238                 default=0,
239                 )
240
241         cls.sampling_pattern = EnumProperty(
242                 name="Sampling Pattern",
243                 description="Random sampling pattern used by the integrator",
244                 items=enum_sampling_pattern,
245                 default='SOBOL',
246                 )
247
248         cls.use_layer_samples = EnumProperty(
249                 name="Layer Samples",
250                 description="How to use per render layer sample settings",
251                 items=enum_use_layer_samples,
252                 default='USE',
253                 )
254
255         cls.sample_all_lights_direct = BoolProperty(
256                 name="Sample All Direct Lights",
257                 description="Sample all lights (for direct samples), rather than randomly picking one",
258                 default=True,
259                 )
260
261         cls.sample_all_lights_indirect = BoolProperty(
262                 name="Sample All Indirect Lights",
263                 description="Sample all lights (for indirect samples), rather than randomly picking one",
264                 default=True,
265                 )
266
267         cls.caustics_reflective = BoolProperty(
268                 name="Reflective Caustics",
269                 description="Use reflective caustics, resulting in a brighter image (more noise but added realism)",
270                 default=True,
271                 )
272
273         cls.caustics_refractive = BoolProperty(
274                 name="Refractive Caustics",
275                 description="Use refractive caustics, resulting in a brighter image (more noise but added realism)",
276                 default=True,
277                 )
278
279         cls.blur_glossy = FloatProperty(
280                 name="Filter Glossy",
281                 description="Adaptively blur glossy shaders after blurry bounces, "
282                             "to reduce noise at the cost of accuracy",
283                 min=0.0, max=10.0,
284                 default=0.0,
285                 )
286
287         cls.min_bounces = IntProperty(
288                 name="Min Bounces",
289                 description="Minimum number of bounces, setting this lower "
290                             "than the maximum enables probabilistic path "
291                             "termination (faster but noisier)",
292                 min=0, max=1024,
293                 default=3,
294                 )
295         cls.max_bounces = IntProperty(
296                 name="Max Bounces",
297                 description="Total maximum number of bounces",
298                 min=0, max=1024,
299                 default=12,
300                 )
301
302         cls.diffuse_bounces = IntProperty(
303                 name="Diffuse Bounces",
304                 description="Maximum number of diffuse reflection bounces, bounded by total maximum",
305                 min=0, max=1024,
306                 default=4,
307                 )
308         cls.glossy_bounces = IntProperty(
309                 name="Glossy Bounces",
310                 description="Maximum number of glossy reflection bounces, bounded by total maximum",
311                 min=0, max=1024,
312                 default=4,
313                 )
314         cls.transmission_bounces = IntProperty(
315                 name="Transmission Bounces",
316                 description="Maximum number of transmission bounces, bounded by total maximum",
317                 min=0, max=1024,
318                 default=12,
319                 )
320         cls.volume_bounces = IntProperty(
321                 name="Volume Bounces",
322                 description="Maximum number of volumetric scattering events",
323                 min=0, max=1024,
324                 default=0,
325                 )
326
327         cls.transparent_min_bounces = IntProperty(
328                 name="Transparent Min Bounces",
329                 description="Minimum number of transparent bounces, setting "
330                             "this lower than the maximum enables "
331                             "probabilistic path termination (faster but "
332                             "noisier)",
333                 min=0, max=1024,
334                 default=8,
335                 )
336         cls.transparent_max_bounces = IntProperty(
337                 name="Transparent Max Bounces",
338                 description="Maximum number of transparent bounces",
339                 min=0, max=1024,
340                 default=8,
341                 )
342         cls.use_transparent_shadows = BoolProperty(
343                 name="Transparent Shadows",
344                 description="Use transparency of surfaces for rendering shadows",
345                 default=True,
346                 )
347
348         cls.volume_step_size = FloatProperty(
349                 name="Step Size",
350                 description="Distance between volume shader samples when rendering the volume "
351                             "(lower values give more accurate and detailed results, but also increased render time)",
352                 default=0.1,
353                 min=0.0000001, max=100000.0
354                 )
355
356         cls.volume_max_steps = IntProperty(
357                 name="Max Steps",
358                 description="Maximum number of steps through the volume before giving up, "
359                             "to avoid extremely long render times with big objects or small step sizes",
360                 default=1024,
361                 min=2, max=65536
362                 )
363
364         cls.film_exposure = FloatProperty(
365                 name="Exposure",
366                 description="Image brightness scale",
367                 min=0.0, max=10.0,
368                 default=1.0,
369                 )
370         cls.film_transparent = BoolProperty(
371                 name="Transparent",
372                 description="World background is transparent with premultiplied alpha",
373                 default=False,
374                 )
375
376         cls.filter_type = EnumProperty(
377                 name="Filter Type",
378                 description="Pixel filter type",
379                 items=enum_filter_types,
380                 default='GAUSSIAN',
381                 )
382         cls.filter_width = FloatProperty(
383                 name="Filter Width",
384                 description="Pixel filter width",
385                 min=0.01, max=10.0,
386                 default=1.5,
387                 )
388
389         cls.seed = IntProperty(
390                 name="Seed",
391                 description="Seed value for integrator to get different noise patterns",
392                 min=0, max=2147483647,
393                 default=0,
394                 )
395
396         cls.sample_clamp_direct = FloatProperty(
397                 name="Clamp Direct",
398                 description="If non-zero, the maximum value for a direct sample, "
399                             "higher values will be scaled down to avoid too "
400                             "much noise and slow convergence at the cost of accuracy",
401                 min=0.0, max=1e8,
402                 default=0.0,
403                 )
404
405         cls.sample_clamp_indirect = FloatProperty(
406                 name="Clamp Indirect",
407                 description="If non-zero, the maximum value for an indirect sample, "
408                             "higher values will be scaled down to avoid too "
409                             "much noise and slow convergence at the cost of accuracy",
410                 min=0.0, max=1e8,
411                 default=0.0,
412                 )
413
414         cls.debug_tile_size = IntProperty(
415                 name="Tile Size",
416                 description="",
417                 min=1, max=4096,
418                 default=1024,
419                 )
420
421         cls.preview_start_resolution = IntProperty(
422                 name="Start Resolution",
423                 description="Resolution to start rendering preview at, "
424                             "progressively increasing it to the full viewport size",
425                 min=8, max=16384,
426                 default=64,
427                 )
428
429         cls.debug_reset_timeout = FloatProperty(
430                 name="Reset timeout",
431                 description="",
432                 min=0.01, max=10.0,
433                 default=0.1,
434                 )
435         cls.debug_cancel_timeout = FloatProperty(
436                 name="Cancel timeout",
437                 description="",
438                 min=0.01, max=10.0,
439                 default=0.1,
440                 )
441         cls.debug_text_timeout = FloatProperty(
442                 name="Text timeout",
443                 description="",
444                 min=0.01, max=10.0,
445                 default=1.0,
446                 )
447
448         cls.debug_bvh_type = EnumProperty(
449                 name="Viewport BVH Type",
450                 description="Choose between faster updates, or faster render",
451                 items=enum_bvh_types,
452                 default='DYNAMIC_BVH',
453                 )
454         cls.debug_use_spatial_splits = BoolProperty(
455                 name="Use Spatial Splits",
456                 description="Use BVH spatial splits: longer builder time, faster render",
457                 default=False,
458                 )
459         cls.use_cache = BoolProperty(
460                 name="Cache BVH",
461                 description="Cache last built BVH to disk for faster re-render if no geometry changed",
462                 default=False,
463                 )
464         cls.tile_order = EnumProperty(
465                 name="Tile Order",
466                 description="Tile order for rendering",
467                 items=enum_tile_order,
468                 default='CENTER',
469                 options=set(),  # Not animatable!
470                 )
471         cls.use_progressive_refine = BoolProperty(
472                 name="Progressive Refine",
473                 description="Instead of rendering each tile until it is finished, "
474                             "refine the whole image progressively "
475                             "(this renders somewhat slower, "
476                             "but time can be saved by manually stopping the render when the noise is low enough)",
477                 default=False,
478                 )
479
480         cls.bake_type = EnumProperty(
481             name="Bake Type",
482             default='COMBINED',
483             description="Type of pass to bake",
484             items = (
485                 ('COMBINED', "Combined", ""),
486                 ('AO', "Ambient Occlusion", ""),
487                 ('SHADOW', "Shadow", ""),
488                 ('NORMAL', "Normal", ""),
489                 ('UV', "UV", ""),
490                 ('EMIT', "Emit", ""),
491                 ('ENVIRONMENT', "Environment", ""),
492                 ('DIFFUSE_DIRECT', "Diffuse Direct", ""),
493                 ('DIFFUSE_INDIRECT', "Diffuse Indirect", ""),
494                 ('DIFFUSE_COLOR', "Diffuse Color", ""),
495                 ('GLOSSY_DIRECT', "Glossy Direct", ""),
496                 ('GLOSSY_INDIRECT', "Glossy Indirect", ""),
497                 ('GLOSSY_COLOR', "Glossy Color", ""),
498                 ('TRANSMISSION_DIRECT', "Transmission Direct", ""),
499                 ('TRANSMISSION_INDIRECT', "Transmission Indirect", ""),
500                 ('TRANSMISSION_COLOR', "Transmission Color", ""),
501                 ('SUBSURFACE_DIRECT', "Subsurface Direct", ""),
502                 ('SUBSURFACE_INDIRECT', "Subsurface Indirect", ""),
503                 ('SUBSURFACE_COLOR', "Subsurface Color", ""),
504                 ),
505             )
506
507     @classmethod
508     def unregister(cls):
509         del bpy.types.Scene.cycles
510
511
512 class CyclesCameraSettings(bpy.types.PropertyGroup):
513     @classmethod
514     def register(cls):
515         import math
516
517         bpy.types.Camera.cycles = PointerProperty(
518                 name="Cycles Camera Settings",
519                 description="Cycles camera settings",
520                 type=cls,
521                 )
522
523         cls.aperture_type = EnumProperty(
524                 name="Aperture Type",
525                 description="Use F/stop number or aperture radius",
526                 items=enum_aperture_types,
527                 default='RADIUS',
528                 )
529         cls.aperture_fstop = FloatProperty(
530                 name="Aperture F/stop",
531                 description="F/stop ratio (lower numbers give more defocus, higher numbers give a sharper image)",
532                 min=0.0, soft_min=0.1, soft_max=64.0,
533                 default=5.6,
534                 step=10,
535                 precision=1,
536                 )
537         cls.aperture_size = FloatProperty(
538                 name="Aperture Size",
539                 description="Radius of the aperture for depth of field (higher values give more defocus)",
540                 min=0.0, soft_max=10.0,
541                 default=0.0,
542                 step=1,
543                 precision=4,
544                 subtype='DISTANCE',
545                 )
546         cls.aperture_blades = IntProperty(
547                 name="Aperture Blades",
548                 description="Number of blades in aperture for polygonal bokeh (at least 3)",
549                 min=0, max=100,
550                 default=0,
551                 )
552         cls.aperture_rotation = FloatProperty(
553                 name="Aperture Rotation",
554                 description="Rotation of blades in aperture",
555                 soft_min=-math.pi, soft_max=math.pi,
556                 subtype='ANGLE',
557                 default=0,
558                 )
559         cls.aperture_ratio = FloatProperty(
560                 name="Aperture Ratio",
561                 description="Distortion to simulate anamorphic lens bokeh",
562                 min=0.01, soft_min=1.0, soft_max=2.0,
563                 default=1.0,
564                 precision=4,
565                 )
566         cls.panorama_type = EnumProperty(
567                 name="Panorama Type",
568                 description="Distortion to use for the calculation",
569                 items=enum_panorama_types,
570                 default='FISHEYE_EQUISOLID',
571                 )
572         cls.fisheye_fov = FloatProperty(
573                 name="Field of View",
574                 description="Field of view for the fisheye lens",
575                 min=0.1745, soft_max=2.0 * math.pi, max=10.0 * math.pi,
576                 subtype='ANGLE',
577                 default=math.pi,
578                 )
579         cls.fisheye_lens = FloatProperty(
580                 name="Fisheye Lens",
581                 description="Lens focal length (mm)",
582                 min=0.01, soft_max=15.0, max=100.0,
583                 default=10.5,
584                 )
585
586     @classmethod
587     def unregister(cls):
588         del bpy.types.Camera.cycles
589
590
591 class CyclesMaterialSettings(bpy.types.PropertyGroup):
592     @classmethod
593     def register(cls):
594         bpy.types.Material.cycles = PointerProperty(
595                 name="Cycles Material Settings",
596                 description="Cycles material settings",
597                 type=cls,
598                 )
599         cls.sample_as_light = BoolProperty(
600                 name="Multiple Importance Sample",
601                 description="Use multiple importance sampling for this material, "
602                             "disabling may reduce overall noise for large "
603                             "objects that emit little light compared to other light sources",
604                 default=True,
605                 )
606         cls.use_transparent_shadow = BoolProperty(
607                 name="Transparent Shadows",
608                 description="Use transparent shadows for this material if it contains a Transparent BSDF, "
609                             "disabling will render faster but not give accurate shadows",
610                 default=True,
611                 )
612         cls.homogeneous_volume = BoolProperty(
613                 name="Homogeneous Volume",
614                 description="When using volume rendering, assume volume has the same density everywhere "
615                             "(not using any textures), for faster rendering",
616                 default=False,
617                 )
618         cls.volume_sampling = EnumProperty(
619                 name="Volume Sampling",
620                 description="Sampling method to use for volumes",
621                 items=enum_volume_sampling,
622                 default='DISTANCE',
623                 )
624
625         cls.volume_interpolation = EnumProperty(
626                 name="Volume Interpolation",
627                 description="Interpolation method to use for volumes",
628                 items=enum_volume_interpolation,
629                 default='LINEAR',
630                 )
631
632     @classmethod
633     def unregister(cls):
634         del bpy.types.Material.cycles
635
636
637 class CyclesLampSettings(bpy.types.PropertyGroup):
638     @classmethod
639     def register(cls):
640         bpy.types.Lamp.cycles = PointerProperty(
641                 name="Cycles Lamp Settings",
642                 description="Cycles lamp settings",
643                 type=cls,
644                 )
645         cls.cast_shadow = BoolProperty(
646                 name="Cast Shadow",
647                 description="Lamp casts shadows",
648                 default=True,
649                 )
650         cls.samples = IntProperty(
651                 name="Samples",
652                 description="Number of light samples to render for each AA sample",
653                 min=1, max=10000,
654                 default=1,
655                 )
656         cls.use_multiple_importance_sampling = BoolProperty(
657                 name="Multiple Importance Sample",
658                 description="Use multiple importance sampling for the lamp, "
659                             "reduces noise for area lamps and sharp glossy materials",
660                 default=False,
661                 )
662
663     @classmethod
664     def unregister(cls):
665         del bpy.types.Lamp.cycles
666
667
668 class CyclesWorldSettings(bpy.types.PropertyGroup):
669     @classmethod
670     def register(cls):
671         bpy.types.World.cycles = PointerProperty(
672                 name="Cycles World Settings",
673                 description="Cycles world settings",
674                 type=cls,
675                 )
676         cls.sample_as_light = BoolProperty(
677                 name="Multiple Importance Sample",
678                 description="Use multiple importance sampling for the environment, "
679                             "enabling for non-solid colors is recommended",
680                 default=False,
681                 )
682         cls.sample_map_resolution = IntProperty(
683                 name="Map Resolution",
684                 description="Importance map size is resolution x resolution; "
685                             "higher values potentially produce less noise, at the cost of memory and speed",
686                 min=4, max=8096,
687                 default=256,
688                 )
689         cls.samples = IntProperty(
690                 name="Samples",
691                 description="Number of light samples to render for each AA sample",
692                 min=1, max=10000,
693                 default=4,
694                 )
695         cls.homogeneous_volume = BoolProperty(
696                 name="Homogeneous Volume",
697                 description="When using volume rendering, assume volume has the same density everywhere"
698                             "(not using any textures), for faster rendering",
699                 default=False,
700                 )
701         cls.volume_sampling = EnumProperty(
702                 name="Volume Sampling",
703                 description="Sampling method to use for volumes",
704                 items=enum_volume_sampling,
705                 default='EQUIANGULAR',
706                 )
707
708         cls.volume_interpolation = EnumProperty(
709                 name="Volume Interpolation",
710                 description="Interpolation method to use for volumes",
711                 items=enum_volume_interpolation,
712                 default='LINEAR',
713                 )
714
715     @classmethod
716     def unregister(cls):
717         del bpy.types.World.cycles
718
719
720 class CyclesVisibilitySettings(bpy.types.PropertyGroup):
721     @classmethod
722     def register(cls):
723         bpy.types.Object.cycles_visibility = PointerProperty(
724                 name="Cycles Visibility Settings",
725                 description="Cycles visibility settings",
726                 type=cls,
727                 )
728
729         bpy.types.World.cycles_visibility = PointerProperty(
730                 name="Cycles Visibility Settings",
731                 description="Cycles visibility settings",
732                 type=cls,
733                 )
734
735         cls.camera = BoolProperty(
736                 name="Camera",
737                 description="Object visibility for camera rays",
738                 default=True,
739                 )
740         cls.diffuse = BoolProperty(
741                 name="Diffuse",
742                 description="Object visibility for diffuse reflection rays",
743                 default=True,
744                 )
745         cls.glossy = BoolProperty(
746                 name="Glossy",
747                 description="Object visibility for glossy reflection rays",
748                 default=True,
749                 )
750         cls.transmission = BoolProperty(
751                 name="Transmission",
752                 description="Object visibility for transmission rays",
753                 default=True,
754                 )
755         cls.shadow = BoolProperty(
756                 name="Shadow",
757                 description="Object visibility for shadow rays",
758                 default=True,
759                 )
760         cls.scatter = BoolProperty(
761                 name="Volume Scatter",
762                 description="Object visibility for volume scatter rays",
763                 default=True,
764                 )
765
766     @classmethod
767     def unregister(cls):
768         del bpy.types.Object.cycles_visibility
769         del bpy.types.World.cycles_visibility
770
771
772 class CyclesMeshSettings(bpy.types.PropertyGroup):
773     @classmethod
774     def register(cls):
775         bpy.types.Mesh.cycles = PointerProperty(
776                 name="Cycles Mesh Settings",
777                 description="Cycles mesh settings",
778                 type=cls,
779                 )
780         bpy.types.Curve.cycles = PointerProperty(
781                 name="Cycles Mesh Settings",
782                 description="Cycles mesh settings",
783                 type=cls,
784                 )
785         bpy.types.MetaBall.cycles = PointerProperty(
786                 name="Cycles Mesh Settings",
787                 description="Cycles mesh settings",
788                 type=cls,
789                 )
790
791         cls.displacement_method = EnumProperty(
792                 name="Displacement Method",
793                 description="Method to use for the displacement",
794                 items=enum_displacement_methods,
795                 default='BUMP',
796                 )
797         cls.use_subdivision = BoolProperty(
798                 name="Use Subdivision",
799                 description="Subdivide mesh for rendering",
800                 default=False,
801                 )
802         cls.dicing_rate = FloatProperty(
803                 name="Dicing Rate",
804                 description="",
805                 min=0.001, max=1000.0,
806                 default=1.0,
807                 )
808
809     @classmethod
810     def unregister(cls):
811         del bpy.types.Mesh.cycles
812         del bpy.types.Curve.cycles
813         del bpy.types.MetaBall.cycles
814
815
816 class CyclesObjectBlurSettings(bpy.types.PropertyGroup):
817
818     @classmethod
819     def register(cls):
820
821         bpy.types.Object.cycles = PointerProperty(
822                 name="Cycles Object Settings",
823                 description="Cycles object settings",
824                 type=cls,
825                 )
826
827         cls.use_motion_blur = BoolProperty(
828                 name="Use Motion Blur",
829                 description="Use motion blur for this object",
830                 default=True,
831                 )
832
833         cls.use_deform_motion = BoolProperty(
834                 name="Use Deformation Motion",
835                 description="Use deformation motion blur for this object",
836                 default=True,
837                 )
838
839         cls.motion_steps = IntProperty(
840                 name="Motion Steps",
841                 description="Control accuracy of deformation motion blur, more steps gives more memory usage (actual number of steps is 2^(steps - 1))",
842                 min=1, soft_max=8,
843                 default=1,
844                 )
845
846     @classmethod
847     def unregister(cls):
848         del bpy.types.Object.cycles
849
850
851 class CyclesCurveRenderSettings(bpy.types.PropertyGroup):
852     @classmethod
853     def register(cls):
854         bpy.types.Scene.cycles_curves = PointerProperty(
855                 name="Cycles Hair Rendering Settings",
856                 description="Cycles hair rendering settings",
857                 type=cls,
858                 )
859         cls.primitive = EnumProperty(
860                 name="Primitive",
861                 description="Type of primitive used for hair rendering",
862                 items=enum_curve_primitives,
863                 default='LINE_SEGMENTS',
864                 )
865         cls.shape = EnumProperty(
866                 name="Shape",
867                 description="Form of hair",
868                 items=enum_curve_shape,
869                 default='THICK',
870                 )
871         cls.cull_backfacing = BoolProperty(
872                 name="Cull back-faces",
873                 description="Do not test the back-face of each strand",
874                 default=True,
875                 )
876         cls.use_curves = BoolProperty(
877                 name="Use Cycles Hair Rendering",
878                 description="Activate Cycles hair rendering for particle system",
879                 default=True,
880                 )
881         cls.resolution = IntProperty(
882                 name="Resolution",
883                 description="Resolution of generated mesh",
884                 min=3, max=64,
885                 default=3,
886                 )
887         cls.minimum_width = FloatProperty(
888                 name="Minimal width",
889                 description="Minimal pixel width for strands (0 - deactivated)",
890                 min=0.0, max=100.0,
891                 default=0.0,
892                 )
893         cls.maximum_width = FloatProperty(
894                 name="Maximal width",
895                 description="Maximum extension that strand radius can be increased by",
896                 min=0.0, max=100.0,
897                 default=0.1,
898                 )
899         cls.subdivisions = IntProperty(
900                 name="Subdivisions",
901                 description="Number of subdivisions used in Cardinal curve intersection (power of 2)",
902                 min=0, max=24,
903                 default=4,
904                 )
905
906     @classmethod
907     def unregister(cls):
908         del bpy.types.Scene.cycles_curves
909
910
911 class CyclesCurveSettings(bpy.types.PropertyGroup):
912     @classmethod
913     def register(cls):
914         bpy.types.ParticleSettings.cycles = PointerProperty(
915                 name="Cycles Hair Settings",
916                 description="Cycles hair settings",
917                 type=cls,
918                 )
919         cls.radius_scale = FloatProperty(
920                 name="Radius Scaling",
921                 description="Multiplier of width properties",
922                 min=0.0, max=1000.0,
923                 default=0.01,
924                 )
925         cls.root_width = FloatProperty(
926                 name="Root Size",
927                 description="Strand's width at root",
928                 min=0.0, max=1000.0,
929                 default=1.0,
930                 )
931         cls.tip_width = FloatProperty(
932                 name="Tip Multiplier",
933                 description="Strand's width at tip",
934                 min=0.0, max=1000.0,
935                 default=0.0,
936                 )
937         cls.shape = FloatProperty(
938                 name="Strand Shape",
939                 description="Strand shape parameter",
940                 min=-1.0, max=1.0,
941                 default=0.0,
942                 )
943         cls.use_closetip = BoolProperty(
944                 name="Close tip",
945                 description="Set tip radius to zero",
946                 default=True,
947                 )
948
949     @classmethod
950     def unregister(cls):
951         del bpy.types.ParticleSettings.cycles
952
953
954 def register():
955     bpy.utils.register_class(CyclesRenderSettings)
956     bpy.utils.register_class(CyclesCameraSettings)
957     bpy.utils.register_class(CyclesMaterialSettings)
958     bpy.utils.register_class(CyclesLampSettings)
959     bpy.utils.register_class(CyclesWorldSettings)
960     bpy.utils.register_class(CyclesVisibilitySettings)
961     bpy.utils.register_class(CyclesMeshSettings)
962     bpy.utils.register_class(CyclesCurveRenderSettings)
963     bpy.utils.register_class(CyclesCurveSettings)
964
965
966 def unregister():
967     bpy.utils.unregister_class(CyclesRenderSettings)
968     bpy.utils.unregister_class(CyclesCameraSettings)
969     bpy.utils.unregister_class(CyclesMaterialSettings)
970     bpy.utils.unregister_class(CyclesLampSettings)
971     bpy.utils.unregister_class(CyclesWorldSettings)
972     bpy.utils.unregister_class(CyclesMeshSettings)
973     bpy.utils.unregister_class(CyclesVisibilitySettings)
974     bpy.utils.unregister_class(CyclesCurveRenderSettings)
975     bpy.utils.unregister_class(CyclesCurveSettings)