Cycles Hair: Strand Minimum Pixel Size
[blender.git] / intern / cycles / blender / addon / properties.py
1 #
2 # Copyright 2011, Blender Foundation.
3 #
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.
8 #
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.
13 #
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.
17 #
18
19 # <pep8 compliant>
20
21 import bpy
22 from bpy.props import (BoolProperty,
23                        EnumProperty,
24                        FloatProperty,
25                        IntProperty,
26                        PointerProperty)
27
28 # enums
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 enum_feature_set = (
35     ('SUPPORTED', "Supported", "Only use finished and supported features"),
36     ('EXPERIMENTAL', "Experimental", "Use experimental and incomplete features that might be broken or change in the future"),
37     )
38
39 enum_displacement_methods = (
40     ('BUMP', "Bump", "Bump mapping to simulate the appearance of displacement"),
41     ('TRUE', "True", "Use true displacement only, requires fine subdivision"),
42     ('BOTH', "Both", "Combination of displacement and bump mapping"),
43     )
44
45 enum_bvh_types = (
46     ('DYNAMIC_BVH', "Dynamic BVH", "Objects can be individually updated, at the cost of slower render time"),
47     ('STATIC_BVH', "Static BVH", "Any object modification requires a complete BVH rebuild, but renders faster"),
48     )
49
50 enum_filter_types = (
51     ('BOX', "Box", "Box filter"),
52     ('GAUSSIAN', "Gaussian", "Gaussian filter"),
53     )
54
55 enum_aperture_types = (
56     ('RADIUS', "Radius", "Directly change the size of the aperture"),
57     ('FSTOP', "F/stop", "Change the size of the aperture by f/stops"),
58     )
59
60 enum_panorama_types = (
61     ('EQUIRECTANGULAR', "Equirectangular", "Render the scene with a spherical camera, also known as Lat Long panorama"),
62     ('FISHEYE_EQUIDISTANT', "Fisheye Equidistant", "Ideal for fulldomes, ignore the sensor dimensions"),
63     ('FISHEYE_EQUISOLID', "Fisheye Equisolid",
64                           "Similar to most fisheye modern lens, takes sensor dimensions into consideration"),
65     )
66
67 enum_curve_presets = (
68     ('CUSTOM', "Custom", "Set general parameters"),
69     ('FAST_PLANES', "Fast Planes", "Use camera facing triangles (fast but memory intensive)"),
70     ('TANGENT_SHADING', "Tangent Normal", "Use planar line segments and tangent normals"),
71     ('TRUE_NORMAL', "True Normal", "Use true normals with line segments(good for thin strands)"),
72     ('ACCURATE_PRESET', "Accurate", "Use best line segment settings (suitable for glass materials)"),
73     ('SMOOTH_CURVES', "Smooth Curves", "Use smooth cardinal curves (slowest)"),
74     ('SMOOTH_RIBBONS', "Ribbons", "Use smooth cardinal curves without thickness"),
75     )
76
77 enum_curve_primitives = (
78     ('TRIANGLES', "Triangles", "Create triangle geometry around strands"),
79     ('LINE_SEGMENTS', "Line Segments", "Use line segment primitives"),
80     ('CURVE_SEGMENTS', "Curve Segments", "Use segmented cardinal curve primitives"),
81     ('CURVE_RIBBONS', "Curve Ribbons", "Use smooth cardinal curve ribbon primitives"),
82     )
83
84 enum_triangle_curves = (
85     ('CAMERA_TRIANGLES', "Planes", "Create individual triangles forming planes that face camera"),
86     ('RIBBON_TRIANGLES', "Ribbons", "Create individual triangles forming ribbon"),
87     ('TESSELLATED_TRIANGLES', "Tessellated", "Create mesh surrounding each strand"),
88     )
89
90 enum_line_curves = (
91     ('ACCURATE', "Accurate", "Always take into consideration strand width for intersections"),
92     ('QT_CORRECTED', "Corrected", "Ignore width for initial intersection and correct later"),
93     ('ENDCORRECTED', "Correct found", "Ignore width for all intersections and only correct closest"),
94     ('QT_UNCORRECTED', "Uncorrected", "Calculate intersections without considering width"),
95     )
96
97 enum_curves_interpolation = (
98     ('LINEAR', "Linear interpolation", "Use Linear interpolation between segments"),
99     ('CARDINAL', "Cardinal interpolation", "Use cardinal interpolation between segments"),
100     ('BSPLINE', "B-spline interpolation", "Use b-spline interpolation between segments"),
101     )
102
103 enum_tile_order = (
104     ('CENTER', "Center", "Render from center to the edges"),
105     ('RIGHT_TO_LEFT', "Right to Left", "Render from right to left"),
106     ('LEFT_TO_RIGHT', "Left to Right", "Render from left to right"),
107     ('TOP_TO_BOTTOM', "Top to Bottom", "Render from top to bottom"),
108     ('BOTTOM_TO_TOP', "Bottom to Top", "Render from bottom to top"),
109     )
110
111
112 class CyclesRenderSettings(bpy.types.PropertyGroup):
113     @classmethod
114     def register(cls):
115         bpy.types.Scene.cycles = PointerProperty(
116                 name="Cycles Render Settings",
117                 description="Cycles render settings",
118                 type=cls,
119                 )
120         cls.device = EnumProperty(
121                 name="Device",
122                 description="Device to use for rendering",
123                 items=enum_devices,
124                 default='CPU',
125                 )
126         cls.feature_set = EnumProperty(
127                 name="Feature Set",
128                 description="Feature set to use for rendering",
129                 items=enum_feature_set,
130                 default='SUPPORTED',
131                 )
132         cls.shading_system = BoolProperty(
133                 name="Open Shading Language",
134                 description="Use Open Shading Language (CPU rendering only)",
135                 )
136
137         cls.progressive = BoolProperty(
138                 name="Progressive",
139                 description="Use progressive sampling of lighting",
140                 default=True,
141                 )
142
143         cls.samples = IntProperty(
144                 name="Samples",
145                 description="Number of samples to render for each pixel",
146                 min=1, max=2147483647,
147                 default=10,
148                 )
149         cls.preview_samples = IntProperty(
150                 name="Preview Samples",
151                 description="Number of samples to render in the viewport, unlimited if 0",
152                 min=0, max=2147483647,
153                 default=10,
154                 )
155         cls.preview_pause = BoolProperty(
156                 name="Pause Preview",
157                 description="Pause all viewport preview renders",
158                 default=False,
159                 )
160         cls.preview_active_layer = BoolProperty(
161                 name="Preview Active Layer",
162                 description="Preview active render layer in viewport",
163                 default=False,
164                 )
165
166         cls.aa_samples = IntProperty(
167                 name="AA Samples",
168                 description="Number of antialiasing samples to render for each pixel",
169                 min=1, max=10000,
170                 default=4,
171                 )
172         cls.preview_aa_samples = IntProperty(
173                 name="AA Samples",
174                 description="Number of antialiasing samples to render in the viewport, unlimited if 0",
175                 min=0, max=10000,
176                 default=4,
177                 )
178         cls.diffuse_samples = IntProperty(
179                 name="Diffuse Samples",
180                 description="Number of diffuse bounce samples to render for each AA sample",
181                 min=1, max=10000,
182                 default=1,
183                 )
184         cls.glossy_samples = IntProperty(
185                 name="Glossy Samples",
186                 description="Number of glossy bounce samples to render for each AA sample",
187                 min=1, max=10000,
188                 default=1,
189                 )
190         cls.transmission_samples = IntProperty(
191                 name="Transmission Samples",
192                 description="Number of transmission bounce samples to render for each AA sample",
193                 min=1, max=10000,
194                 default=1,
195                 )
196         cls.ao_samples = IntProperty(
197                 name="Ambient Occlusion Samples",
198                 description="Number of ambient occlusion samples to render for each AA sample",
199                 min=1, max=10000,
200                 default=1,
201                 )
202         cls.mesh_light_samples = IntProperty(
203                 name="Mesh Light Samples",
204                 description="Number of mesh emission light samples to render for each AA sample",
205                 min=1, max=10000,
206                 default=1,
207                 )
208
209         cls.subsurface_samples = IntProperty(
210                 name="Subsurface Samples",
211                 description="Number of subsurface scattering samples to render for each AA sample",
212                 min=1, max=10000,
213                 default=1,
214                 )
215
216         cls.no_caustics = BoolProperty(
217                 name="No Caustics",
218                 description="Leave out caustics, resulting in a darker image with less noise",
219                 default=False,
220                 )
221         cls.blur_glossy = FloatProperty(
222                 name="Filter Glossy",
223                 description="Adaptively blur glossy shaders after blurry bounces, "
224                             "to reduce noise at the cost of accuracy",
225                 min=0.0, max=10.0,
226                 default=0.0,
227                 )
228
229         cls.min_bounces = IntProperty(
230                 name="Min Bounces",
231                 description="Minimum number of bounces, setting this lower "
232                             "than the maximum enables probabilistic path "
233                             "termination (faster but noisier)",
234                 min=0, max=1024,
235                 default=3,
236                 )
237         cls.max_bounces = IntProperty(
238                 name="Max Bounces",
239                 description="Total maximum number of bounces",
240                 min=0, max=1024,
241                 default=8,
242                 )
243
244         cls.diffuse_bounces = IntProperty(
245                 name="Diffuse Bounces",
246                 description="Maximum number of diffuse reflection bounces, bounded by total maximum",
247                 min=0, max=1024,
248                 default=128,
249                 )
250         cls.glossy_bounces = IntProperty(
251                 name="Glossy Bounces",
252                 description="Maximum number of glossy reflection bounces, bounded by total maximum",
253                 min=0, max=1024,
254                 default=128,
255                 )
256         cls.transmission_bounces = IntProperty(
257                 name="Transmission Bounces",
258                 description="Maximum number of transmission bounces, bounded by total maximum",
259                 min=0, max=1024,
260                 default=128,
261                 )
262
263         cls.transparent_min_bounces = IntProperty(
264                 name="Transparent Min Bounces",
265                 description="Minimum number of transparent bounces, setting "
266                             "this lower than the maximum enables "
267                             "probabilistic path termination (faster but "
268                             "noisier)",
269                 min=0, max=1024,
270                 default=8,
271                 )
272         cls.transparent_max_bounces = IntProperty(
273                 name="Transparent Max Bounces",
274                 description="Maximum number of transparent bounces",
275                 min=0, max=1024,
276                 default=8,
277                 )
278         cls.use_transparent_shadows = BoolProperty(
279                 name="Transparent Shadows",
280                 description="Use transparency of surfaces for rendering shadows",
281                 default=True,
282                 )
283
284         cls.film_exposure = FloatProperty(
285                 name="Exposure",
286                 description="Image brightness scale",
287                 min=0.0, max=10.0,
288                 default=1.0,
289                 )
290         cls.film_transparent = BoolProperty(
291                 name="Transparent",
292                 description="World background is transparent with premultiplied alpha",
293                 default=False,
294                 )
295
296         cls.filter_type = EnumProperty(
297                 name="Filter Type",
298                 description="Pixel filter type",
299                 items=enum_filter_types,
300                 default='GAUSSIAN',
301                 )
302         cls.filter_width = FloatProperty(
303                 name="Filter Width",
304                 description="Pixel filter width",
305                 min=0.01, max=10.0,
306                 default=1.5,
307                 )
308
309         cls.seed = IntProperty(
310                 name="Seed",
311                 description="Seed value for integrator to get different noise patterns",
312                 min=0, max=2147483647,
313                 default=0,
314                 )
315
316         cls.sample_clamp = FloatProperty(
317                 name="Clamp",
318                 description="If non-zero, the maximum value for a sample, "
319                             "higher values will be scaled down to avoid too "
320                             "much noise and slow convergence at the cost of accuracy",
321                 min=0.0, max=1e8,
322                 default=0.0,
323                 )
324
325         cls.debug_tile_size = IntProperty(
326                 name="Tile Size",
327                 description="",
328                 min=1, max=4096,
329                 default=1024,
330                 )
331
332         cls.preview_start_resolution = IntProperty(
333                 name="Start Resolution",
334                 description="Resolution to start rendering preview at, "
335                             "progressively increasing it to the full viewport size",
336                 min=8, max=16384,
337                 default=64,
338                 )
339
340         cls.debug_reset_timeout = FloatProperty(
341                 name="Reset timeout",
342                 description="",
343                 min=0.01, max=10.0,
344                 default=0.1,
345                 )
346         cls.debug_cancel_timeout = FloatProperty(
347                 name="Cancel timeout",
348                 description="",
349                 min=0.01, max=10.0,
350                 default=0.1,
351                 )
352         cls.debug_text_timeout = FloatProperty(
353                 name="Text timeout",
354                 description="",
355                 min=0.01, max=10.0,
356                 default=1.0,
357                 )
358
359         cls.debug_bvh_type = EnumProperty(
360                 name="Viewport BVH Type",
361                 description="Choose between faster updates, or faster render",
362                 items=enum_bvh_types,
363                 default='DYNAMIC_BVH',
364                 )
365         cls.debug_use_spatial_splits = BoolProperty(
366                 name="Use Spatial Splits",
367                 description="Use BVH spatial splits: longer builder time, faster render",
368                 default=False,
369                 )
370         cls.use_cache = BoolProperty(
371                 name="Cache BVH",
372                 description="Cache last built BVH to disk for faster re-render if no geometry changed",
373                 default=False,
374                 )
375         cls.tile_order = EnumProperty(
376                 name="Tile Order",
377                 description="Tile order for rendering",
378                 items=enum_tile_order,
379                 default='CENTER',
380                 )
381         cls.use_progressive_refine = BoolProperty(
382                 name="Progressive Refine",
383                 description="Instead of rendering each tile until it is finished, "
384                             "refine the whole image progressively "
385                             "(this renders somewhat slower, "
386                             "but time can be saved by manually stopping the render when the noise is low enough)",
387                 default=False,
388                 )
389
390     @classmethod
391     def unregister(cls):
392         del bpy.types.Scene.cycles
393
394
395 class CyclesCameraSettings(bpy.types.PropertyGroup):
396     @classmethod
397     def register(cls):
398         import math
399
400         bpy.types.Camera.cycles = PointerProperty(
401                 name="Cycles Camera Settings",
402                 description="Cycles camera settings",
403                 type=cls,
404                 )
405
406         cls.aperture_type = EnumProperty(
407                 name="Aperture Type",
408                 description="Use F/stop number or aperture radius",
409                 items=enum_aperture_types,
410                 default='RADIUS',
411                 )
412         cls.aperture_fstop = FloatProperty(
413                 name="Aperture F/stop",
414                 description="F/stop ratio (lower numbers give more defocus, higher numbers give a sharper image)",
415                 min=0.0, soft_min=0.1, soft_max=64.0,
416                 default=5.6,
417                 step=10,
418                 precision=1,
419                 )
420         cls.aperture_size = FloatProperty(
421                 name="Aperture Size",
422                 description="Radius of the aperture for depth of field (higher values give more defocus)",
423                 min=0.0, soft_max=10.0,
424                 default=0.0,
425                 step=1,
426                 precision=4,
427                 subtype='DISTANCE',
428                 )
429         cls.aperture_blades = IntProperty(
430                 name="Aperture Blades",
431                 description="Number of blades in aperture for polygonal bokeh (at least 3)",
432                 min=0, max=100,
433                 default=0,
434                 )
435         cls.aperture_rotation = FloatProperty(
436                 name="Aperture Rotation",
437                 description="Rotation of blades in aperture",
438                 soft_min=-math.pi, soft_max=math.pi,
439                 subtype='ANGLE',
440                 default=0,
441                 )
442         cls.panorama_type = EnumProperty(
443                 name="Panorama Type",
444                 description="Distortion to use for the calculation",
445                 items=enum_panorama_types,
446                 default='FISHEYE_EQUISOLID',
447                 )
448         cls.fisheye_fov = FloatProperty(
449                 name="Field of View",
450                 description="Field of view for the fisheye lens",
451                 min=0.1745, soft_max=2 * math.pi, max=10.0 * math.pi,
452                 subtype='ANGLE',
453                 default=math.pi,
454                 )
455         cls.fisheye_lens = FloatProperty(
456                 name="Fisheye Lens",
457                 description="Lens focal length (mm)",
458                 min=0.01, soft_max=15.0, max=100.0,
459                 default=10.5,
460                 )
461
462     @classmethod
463     def unregister(cls):
464         del bpy.types.Camera.cycles
465
466
467 class CyclesMaterialSettings(bpy.types.PropertyGroup):
468     @classmethod
469     def register(cls):
470         bpy.types.Material.cycles = PointerProperty(
471                 name="Cycles Material Settings",
472                 description="Cycles material settings",
473                 type=cls,
474                 )
475         cls.sample_as_light = BoolProperty(
476                 name="Multiple Importance Sample",
477                 description="Use multiple importance sampling for this material, "
478                             "disabling may reduce overall noise for large "
479                             "objects that emit little light compared to other light sources",
480                 default=True,
481                 )
482         cls.homogeneous_volume = BoolProperty(
483                 name="Homogeneous Volume",
484                 description="When using volume rendering, assume volume has the same density everywhere, "
485                             "for faster rendering",
486                 default=False,
487                 )
488
489     @classmethod
490     def unregister(cls):
491         del bpy.types.Material.cycles
492
493
494 class CyclesLampSettings(bpy.types.PropertyGroup):
495     @classmethod
496     def register(cls):
497         bpy.types.Lamp.cycles = PointerProperty(
498                 name="Cycles Lamp Settings",
499                 description="Cycles lamp settings",
500                 type=cls,
501                 )
502         cls.cast_shadow = BoolProperty(
503                 name="Cast Shadow",
504                 description="Lamp casts shadows",
505                 default=True,
506                 )
507         cls.samples = IntProperty(
508                 name="Samples",
509                 description="Number of light samples to render for each AA sample",
510                 min=1, max=10000,
511                 default=1,
512                 )
513         cls.use_multiple_importance_sampling = BoolProperty(
514                 name="Multiple Importance Sample",
515                 description="Use multiple importance sampling for the lamp, "
516                             "reduces noise for area lamps and sharp glossy materials",
517                 default=False,
518                 )
519
520     @classmethod
521     def unregister(cls):
522         del bpy.types.Lamp.cycles
523
524
525 class CyclesWorldSettings(bpy.types.PropertyGroup):
526     @classmethod
527     def register(cls):
528         bpy.types.World.cycles = PointerProperty(
529                 name="Cycles World Settings",
530                 description="Cycles world settings",
531                 type=cls,
532                 )
533         cls.sample_as_light = BoolProperty(
534                 name="Multiple Importance Sample",
535                 description="Use multiple importance sampling for the environment, "
536                             "enabling for non-solid colors is recommended",
537                 default=False,
538                 )
539         cls.sample_map_resolution = IntProperty(
540                 name="Map Resolution",
541                 description="Importance map size is resolution x resolution; "
542                             "higher values potentially produce less noise, at the cost of memory and speed",
543                 min=4, max=8096,
544                 default=256,
545                 )
546         cls.samples = IntProperty(
547                 name="Samples",
548                 description="Number of light samples to render for each AA sample",
549                 min=1, max=10000,
550                 default=4,
551                 )
552
553     @classmethod
554     def unregister(cls):
555         del bpy.types.World.cycles
556
557
558 class CyclesVisibilitySettings(bpy.types.PropertyGroup):
559     @classmethod
560     def register(cls):
561         bpy.types.Object.cycles_visibility = PointerProperty(
562                 name="Cycles Visibility Settings",
563                 description="Cycles visibility settings",
564                 type=cls,
565                 )
566
567         cls.camera = BoolProperty(
568                 name="Camera",
569                 description="Object visibility for camera rays",
570                 default=True,
571                 )
572         cls.diffuse = BoolProperty(
573                 name="Diffuse",
574                 description="Object visibility for diffuse reflection rays",
575                 default=True,
576                 )
577         cls.glossy = BoolProperty(
578                 name="Glossy",
579                 description="Object visibility for glossy reflection rays",
580                 default=True,
581                 )
582         cls.transmission = BoolProperty(
583                 name="Transmission",
584                 description="Object visibility for transmission rays",
585                 default=True,
586                 )
587         cls.shadow = BoolProperty(
588                 name="Shadow",
589                 description="Object visibility for shadow rays",
590                 default=True,
591                 )
592
593     @classmethod
594     def unregister(cls):
595         del bpy.types.Object.cycles_visibility
596
597
598 class CyclesMeshSettings(bpy.types.PropertyGroup):
599     @classmethod
600     def register(cls):
601         bpy.types.Mesh.cycles = PointerProperty(
602                 name="Cycles Mesh Settings",
603                 description="Cycles mesh settings",
604                 type=cls,
605                 )
606         bpy.types.Curve.cycles = PointerProperty(
607                 name="Cycles Mesh Settings",
608                 description="Cycles mesh settings",
609                 type=cls,
610                 )
611         bpy.types.MetaBall.cycles = PointerProperty(
612                 name="Cycles Mesh Settings",
613                 description="Cycles mesh settings",
614                 type=cls,
615                 )
616
617         cls.displacement_method = EnumProperty(
618                 name="Displacement Method",
619                 description="Method to use for the displacement",
620                 items=enum_displacement_methods,
621                 default='BUMP',
622                 )
623         cls.use_subdivision = BoolProperty(
624                 name="Use Subdivision",
625                 description="Subdivide mesh for rendering",
626                 default=False,
627                 )
628         cls.dicing_rate = FloatProperty(
629                 name="Dicing Rate",
630                 description="",
631                 min=0.001, max=1000.0,
632                 default=1.0,
633                 )
634
635     @classmethod
636     def unregister(cls):
637         del bpy.types.Mesh.cycles
638         del bpy.types.Curve.cycles
639         del bpy.types.MetaBall.cycles
640
641
642 class CyclesCurveRenderSettings(bpy.types.PropertyGroup):
643     @classmethod
644     def register(cls):
645         bpy.types.Scene.cycles_curves = PointerProperty(
646                 name="Cycles Hair Rendering Settings",
647                 description="Cycles hair rendering settings",
648                 type=cls,
649                 )
650         cls.preset = EnumProperty(
651                 name="Mode",
652                 description="Hair rendering mode",
653                 items=enum_curve_presets,
654                 default='TRUE_NORMAL',
655                 )
656         cls.primitive = EnumProperty(
657                 name="Primitive",
658                 description="Type of primitive used for hair rendering",
659                 items=enum_curve_primitives,
660                 default='LINE_SEGMENTS',
661                 )
662         cls.triangle_method = EnumProperty(
663                 name="Mesh Geometry",
664                 description="Method for creating triangle geometry",
665                 items=enum_triangle_curves,
666                 default='CAMERA_TRIANGLES',
667                 )
668         cls.line_method = EnumProperty(
669                 name="Intersection Method",
670                 description="Method for line segment intersection",
671                 items=enum_line_curves,
672                 default='ACCURATE',
673                 )
674         cls.interpolation = EnumProperty(
675                 name="Interpolation",
676                 description="Interpolation method",
677                 items=enum_curves_interpolation,
678                 default='BSPLINE',
679                 )
680         cls.use_backfacing = BoolProperty(
681                 name="Check back-faces",
682                 description="Test back-faces of strands",
683                 default=False,
684                 )
685         cls.use_encasing = BoolProperty(
686                 name="Exclude encasing",
687                 description="Ignore strands encasing a ray's initial location",
688                 default=True,
689                 )
690         cls.use_tangent_normal_geometry = BoolProperty(
691                 name="Tangent normal geometry",
692                 description="Use the tangent normal for actual normal",
693                 default=False,
694                 )
695         cls.use_tangent_normal = BoolProperty(
696                 name="Tangent normal default",
697                 description="Use the tangent normal for all normals",
698                 default=False,
699                 )
700         cls.use_tangent_normal_correction = BoolProperty(
701                 name="Strand slope correction",
702                 description="Correct the tangent normal for the strand's slope",
703                 default=False,
704                 )
705         cls.use_parents = BoolProperty(
706                 name="Use parent strands",
707                 description="Use parents with children",
708                 default=False,
709                 )
710         cls.use_smooth = BoolProperty(
711                 name="Smooth Strands",
712                 description="Use vertex normals",
713                 default=True,
714                 )
715         cls.use_joined = BoolProperty(
716                 name="Join",
717                 description="Fill gaps between segments (requires more memory)",
718                 default=False,
719                 )
720         cls.use_curves = BoolProperty(
721                 name="Use Cycles Hair Rendering",
722                 description="Activate Cycles hair rendering for particle system",
723                 default=True,
724                 )
725         cls.segments = IntProperty(
726                 name="Segments",
727                 description="Number of segments between path keys (note that this combines with the 'draw step' value)",
728                 min=1, max=64,
729                 default=1,
730                 )
731         cls.resolution = IntProperty(
732                 name="Resolution",
733                 description="Resolution of generated mesh",
734                 min=3, max=64,
735                 default=3,
736                 )
737         cls.normalmix = FloatProperty(
738                 name="Normal mix",
739                 description="Scale factor for tangent normal removal (zero gives ray normal)",
740                 min=0, max=2.0,
741                 default=1,
742                 )
743         cls.encasing_ratio = FloatProperty(
744                 name="Encasing ratio",
745                 description="Scale factor for encasing strand width",
746                 min=0, max=100.0,
747                 default=1.01,
748                 )
749         cls.minimum_width = FloatProperty(
750                 name="Minimal width",
751                 description="Minimal pixel width for strands (0 - deactivated)",
752                 min=0, max=100,
753                 default=0.0,
754                 )
755         cls.maximum_width = FloatProperty(
756                 name="Maximal width",
757                 description="Maximum extension that strand radius can be increased by",
758                 min=0, max=100,
759                 default=0.1,
760                 )
761         cls.subdivisions = IntProperty(
762                 name="Subdivisions",
763                 description="Number of subdivisions used in Cardinal curve intersection (power of 2)",
764                 min=0, max=24,
765                 default=4,
766                 )
767
768     @classmethod
769     def unregister(cls):
770         del bpy.types.Scene.cycles_curves
771
772
773 class CyclesCurveSettings(bpy.types.PropertyGroup):
774     @classmethod
775     def register(cls):
776         bpy.types.ParticleSettings.cycles = PointerProperty(
777                 name="Cycles Hair Settings",
778                 description="Cycles hair settings",
779                 type=cls,
780                 )
781         cls.radius_scale = FloatProperty(
782                 name="Radius Scaling",
783                 description="Multiplier of width properties",
784                 min=0.0, max=1000.0,
785                 default=0.01,
786                 )
787         cls.root_width = FloatProperty(
788                 name="Root Size",
789                 description="Strand's width at root",
790                 min=0.0, max=1000.0,
791                 default=1.0,
792                 )
793         cls.tip_width = FloatProperty(
794                 name="Tip Multiplier",
795                 description="Strand's width at tip",
796                 min=0.0, max=1000.0,
797                 default=0.0,
798                 )
799         cls.shape = FloatProperty(
800                 name="Strand Shape",
801                 description="Strand shape parameter",
802                 min=-1.0, max=1.0,
803                 default=0.0,
804                 )
805         cls.use_closetip = BoolProperty(
806                 name="Close tip",
807                 description="Set tip radius to zero",
808                 default=True,
809                 )
810
811     @classmethod
812     def unregister(cls):
813         del bpy.types.ParticleSettings.cycles
814
815
816 def register():
817     bpy.utils.register_class(CyclesRenderSettings)
818     bpy.utils.register_class(CyclesCameraSettings)
819     bpy.utils.register_class(CyclesMaterialSettings)
820     bpy.utils.register_class(CyclesLampSettings)
821     bpy.utils.register_class(CyclesWorldSettings)
822     bpy.utils.register_class(CyclesVisibilitySettings)
823     bpy.utils.register_class(CyclesMeshSettings)
824     bpy.utils.register_class(CyclesCurveRenderSettings)
825     bpy.utils.register_class(CyclesCurveSettings)
826
827
828 def unregister():
829     bpy.utils.unregister_class(CyclesRenderSettings)
830     bpy.utils.unregister_class(CyclesCameraSettings)
831     bpy.utils.unregister_class(CyclesMaterialSettings)
832     bpy.utils.unregister_class(CyclesLampSettings)
833     bpy.utils.unregister_class(CyclesWorldSettings)
834     bpy.utils.unregister_class(CyclesMeshSettings)
835     bpy.utils.unregister_class(CyclesVisibilitySettings)
836     bpy.utils.unregister_class(CyclesCurveRenderSettings)
837     bpy.utils.unregister_class(CyclesCurveSettings)