f5c052e7f0cd87d3f2a53f713b7476d22aad986c
[blender.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"),
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
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 = EnumProperty(
138                 name="Integrator",
139                 description="Method to sample lights and materials",
140                 items=enum_integrator,
141                 default='PATH',
142                 )
143
144         cls.use_square_samples = BoolProperty(
145                 name="Square Samples",
146                 description="Square sampling values for easier artist control",
147                 default=False,
148                 )
149
150         cls.samples = IntProperty(
151                 name="Samples",
152                 description="Number of samples to render for each pixel",
153                 min=1, max=2147483647,
154                 default=10,
155                 )
156         cls.preview_samples = IntProperty(
157                 name="Preview Samples",
158                 description="Number of samples to render in the viewport, unlimited if 0",
159                 min=0, max=2147483647,
160                 default=10,
161                 )
162         cls.preview_pause = BoolProperty(
163                 name="Pause Preview",
164                 description="Pause all viewport preview renders",
165                 default=False,
166                 )
167         cls.preview_active_layer = BoolProperty(
168                 name="Preview Active Layer",
169                 description="Preview active render layer in viewport",
170                 default=False,
171                 )
172
173         cls.aa_samples = IntProperty(
174                 name="AA Samples",
175                 description="Number of antialiasing samples to render for each pixel",
176                 min=1, max=10000,
177                 default=4,
178                 )
179         cls.preview_aa_samples = IntProperty(
180                 name="AA Samples",
181                 description="Number of antialiasing samples to render in the viewport, unlimited if 0",
182                 min=0, max=10000,
183                 default=4,
184                 )
185         cls.diffuse_samples = IntProperty(
186                 name="Diffuse Samples",
187                 description="Number of diffuse bounce samples to render for each AA sample",
188                 min=1, max=10000,
189                 default=1,
190                 )
191         cls.glossy_samples = IntProperty(
192                 name="Glossy Samples",
193                 description="Number of glossy bounce samples to render for each AA sample",
194                 min=1, max=10000,
195                 default=1,
196                 )
197         cls.transmission_samples = IntProperty(
198                 name="Transmission Samples",
199                 description="Number of transmission bounce samples to render for each AA sample",
200                 min=1, max=10000,
201                 default=1,
202                 )
203         cls.ao_samples = IntProperty(
204                 name="Ambient Occlusion Samples",
205                 description="Number of ambient occlusion samples to render for each AA sample",
206                 min=1, max=10000,
207                 default=1,
208                 )
209         cls.mesh_light_samples = IntProperty(
210                 name="Mesh Light Samples",
211                 description="Number of mesh emission light samples to render for each AA sample",
212                 min=1, max=10000,
213                 default=1,
214                 )
215
216         cls.subsurface_samples = IntProperty(
217                 name="Subsurface Samples",
218                 description="Number of subsurface scattering samples to render for each AA sample",
219                 min=1, max=10000,
220                 default=1,
221                 )
222
223         cls.sampling_pattern = EnumProperty(
224                 name="Sampling Pattern",
225                 description="Random sampling pattern used by the integrator",
226                 items=enum_sampling_pattern,
227                 default='SOBOL',
228                 )
229
230         cls.use_layer_samples = EnumProperty(
231                 name="Layer Samples",
232                 description="How to use per render layer sample settings",
233                 items=enum_use_layer_samples,
234                 default='USE',
235                 )
236
237         cls.no_caustics = BoolProperty(
238                 name="No Caustics",
239                 description="Leave out caustics, resulting in a darker image with less noise",
240                 default=False,
241                 )
242         cls.blur_glossy = FloatProperty(
243                 name="Filter Glossy",
244                 description="Adaptively blur glossy shaders after blurry bounces, "
245                             "to reduce noise at the cost of accuracy",
246                 min=0.0, max=10.0,
247                 default=0.0,
248                 )
249
250         cls.min_bounces = IntProperty(
251                 name="Min Bounces",
252                 description="Minimum number of bounces, setting this lower "
253                             "than the maximum enables probabilistic path "
254                             "termination (faster but noisier)",
255                 min=0, max=1024,
256                 default=3,
257                 )
258         cls.max_bounces = IntProperty(
259                 name="Max Bounces",
260                 description="Total maximum number of bounces",
261                 min=0, max=1024,
262                 default=12,
263                 )
264
265         cls.diffuse_bounces = IntProperty(
266                 name="Diffuse Bounces",
267                 description="Maximum number of diffuse reflection bounces, bounded by total maximum",
268                 min=0, max=1024,
269                 default=4,
270                 )
271         cls.glossy_bounces = IntProperty(
272                 name="Glossy Bounces",
273                 description="Maximum number of glossy reflection bounces, bounded by total maximum",
274                 min=0, max=1024,
275                 default=4,
276                 )
277         cls.transmission_bounces = IntProperty(
278                 name="Transmission Bounces",
279                 description="Maximum number of transmission bounces, bounded by total maximum",
280                 min=0, max=1024,
281                 default=12,
282                 )
283
284         cls.transparent_min_bounces = IntProperty(
285                 name="Transparent Min Bounces",
286                 description="Minimum number of transparent bounces, setting "
287                             "this lower than the maximum enables "
288                             "probabilistic path termination (faster but "
289                             "noisier)",
290                 min=0, max=1024,
291                 default=8,
292                 )
293         cls.transparent_max_bounces = IntProperty(
294                 name="Transparent Max Bounces",
295                 description="Maximum number of transparent bounces",
296                 min=0, max=1024,
297                 default=8,
298                 )
299         cls.use_transparent_shadows = BoolProperty(
300                 name="Transparent Shadows",
301                 description="Use transparency of surfaces for rendering shadows",
302                 default=True,
303                 )
304
305         cls.film_exposure = FloatProperty(
306                 name="Exposure",
307                 description="Image brightness scale",
308                 min=0.0, max=10.0,
309                 default=1.0,
310                 )
311         cls.film_transparent = BoolProperty(
312                 name="Transparent",
313                 description="World background is transparent with premultiplied alpha",
314                 default=False,
315                 )
316
317         cls.filter_type = EnumProperty(
318                 name="Filter Type",
319                 description="Pixel filter type",
320                 items=enum_filter_types,
321                 default='GAUSSIAN',
322                 )
323         cls.filter_width = FloatProperty(
324                 name="Filter Width",
325                 description="Pixel filter width",
326                 min=0.01, max=10.0,
327                 default=1.5,
328                 )
329
330         cls.seed = IntProperty(
331                 name="Seed",
332                 description="Seed value for integrator to get different noise patterns",
333                 min=0, max=2147483647,
334                 default=0,
335                 )
336
337         cls.sample_clamp = FloatProperty(
338                 name="Clamp",
339                 description="If non-zero, the maximum value for a sample, "
340                             "higher values will be scaled down to avoid too "
341                             "much noise and slow convergence at the cost of accuracy",
342                 min=0.0, max=1e8,
343                 default=0.0,
344                 )
345
346         cls.debug_tile_size = IntProperty(
347                 name="Tile Size",
348                 description="",
349                 min=1, max=4096,
350                 default=1024,
351                 )
352
353         cls.preview_start_resolution = IntProperty(
354                 name="Start Resolution",
355                 description="Resolution to start rendering preview at, "
356                             "progressively increasing it to the full viewport size",
357                 min=8, max=16384,
358                 default=64,
359                 )
360
361         cls.debug_reset_timeout = FloatProperty(
362                 name="Reset timeout",
363                 description="",
364                 min=0.01, max=10.0,
365                 default=0.1,
366                 )
367         cls.debug_cancel_timeout = FloatProperty(
368                 name="Cancel timeout",
369                 description="",
370                 min=0.01, max=10.0,
371                 default=0.1,
372                 )
373         cls.debug_text_timeout = FloatProperty(
374                 name="Text timeout",
375                 description="",
376                 min=0.01, max=10.0,
377                 default=1.0,
378                 )
379
380         cls.debug_bvh_type = EnumProperty(
381                 name="Viewport BVH Type",
382                 description="Choose between faster updates, or faster render",
383                 items=enum_bvh_types,
384                 default='DYNAMIC_BVH',
385                 )
386         cls.debug_use_spatial_splits = BoolProperty(
387                 name="Use Spatial Splits",
388                 description="Use BVH spatial splits: longer builder time, faster render",
389                 default=False,
390                 )
391         cls.use_cache = BoolProperty(
392                 name="Cache BVH",
393                 description="Cache last built BVH to disk for faster re-render if no geometry changed",
394                 default=False,
395                 )
396         cls.tile_order = EnumProperty(
397                 name="Tile Order",
398                 description="Tile order for rendering",
399                 items=enum_tile_order,
400                 default='CENTER',
401                 options=set(),  # Not animatable!
402                 )
403         cls.use_progressive_refine = BoolProperty(
404                 name="Progressive Refine",
405                 description="Instead of rendering each tile until it is finished, "
406                             "refine the whole image progressively "
407                             "(this renders somewhat slower, "
408                             "but time can be saved by manually stopping the render when the noise is low enough)",
409                 default=False,
410                 )
411
412     @classmethod
413     def unregister(cls):
414         del bpy.types.Scene.cycles
415
416
417 class CyclesCameraSettings(bpy.types.PropertyGroup):
418     @classmethod
419     def register(cls):
420         import math
421
422         bpy.types.Camera.cycles = PointerProperty(
423                 name="Cycles Camera Settings",
424                 description="Cycles camera settings",
425                 type=cls,
426                 )
427
428         cls.aperture_type = EnumProperty(
429                 name="Aperture Type",
430                 description="Use F/stop number or aperture radius",
431                 items=enum_aperture_types,
432                 default='RADIUS',
433                 )
434         cls.aperture_fstop = FloatProperty(
435                 name="Aperture F/stop",
436                 description="F/stop ratio (lower numbers give more defocus, higher numbers give a sharper image)",
437                 min=0.0, soft_min=0.1, soft_max=64.0,
438                 default=5.6,
439                 step=10,
440                 precision=1,
441                 )
442         cls.aperture_size = FloatProperty(
443                 name="Aperture Size",
444                 description="Radius of the aperture for depth of field (higher values give more defocus)",
445                 min=0.0, soft_max=10.0,
446                 default=0.0,
447                 step=1,
448                 precision=4,
449                 subtype='DISTANCE',
450                 )
451         cls.aperture_blades = IntProperty(
452                 name="Aperture Blades",
453                 description="Number of blades in aperture for polygonal bokeh (at least 3)",
454                 min=0, max=100,
455                 default=0,
456                 )
457         cls.aperture_rotation = FloatProperty(
458                 name="Aperture Rotation",
459                 description="Rotation of blades in aperture",
460                 soft_min=-math.pi, soft_max=math.pi,
461                 subtype='ANGLE',
462                 default=0,
463                 )
464         cls.panorama_type = EnumProperty(
465                 name="Panorama Type",
466                 description="Distortion to use for the calculation",
467                 items=enum_panorama_types,
468                 default='FISHEYE_EQUISOLID',
469                 )
470         cls.fisheye_fov = FloatProperty(
471                 name="Field of View",
472                 description="Field of view for the fisheye lens",
473                 min=0.1745, soft_max=2.0 * math.pi, max=10.0 * math.pi,
474                 subtype='ANGLE',
475                 default=math.pi,
476                 )
477         cls.fisheye_lens = FloatProperty(
478                 name="Fisheye Lens",
479                 description="Lens focal length (mm)",
480                 min=0.01, soft_max=15.0, max=100.0,
481                 default=10.5,
482                 )
483
484     @classmethod
485     def unregister(cls):
486         del bpy.types.Camera.cycles
487
488
489 class CyclesMaterialSettings(bpy.types.PropertyGroup):
490     @classmethod
491     def register(cls):
492         bpy.types.Material.cycles = PointerProperty(
493                 name="Cycles Material Settings",
494                 description="Cycles material settings",
495                 type=cls,
496                 )
497         cls.sample_as_light = BoolProperty(
498                 name="Multiple Importance Sample",
499                 description="Use multiple importance sampling for this material, "
500                             "disabling may reduce overall noise for large "
501                             "objects that emit little light compared to other light sources",
502                 default=True,
503                 )
504         cls.use_transparent_shadow = BoolProperty(
505                 name="Transparent Shadows",
506                 description="Use transparent shadows for this material if it contains a Transparent BSDF, "
507                             "disabling will render faster but not give accurate shadows",
508                 default=True,
509                 )
510         cls.homogeneous_volume = BoolProperty(
511                 name="Homogeneous Volume",
512                 description="When using volume rendering, assume volume has the same density everywhere, "
513                             "for faster rendering",
514                 default=False,
515                 )
516
517     @classmethod
518     def unregister(cls):
519         del bpy.types.Material.cycles
520
521
522 class CyclesLampSettings(bpy.types.PropertyGroup):
523     @classmethod
524     def register(cls):
525         bpy.types.Lamp.cycles = PointerProperty(
526                 name="Cycles Lamp Settings",
527                 description="Cycles lamp settings",
528                 type=cls,
529                 )
530         cls.cast_shadow = BoolProperty(
531                 name="Cast Shadow",
532                 description="Lamp casts shadows",
533                 default=True,
534                 )
535         cls.samples = IntProperty(
536                 name="Samples",
537                 description="Number of light samples to render for each AA sample",
538                 min=1, max=10000,
539                 default=1,
540                 )
541         cls.use_multiple_importance_sampling = BoolProperty(
542                 name="Multiple Importance Sample",
543                 description="Use multiple importance sampling for the lamp, "
544                             "reduces noise for area lamps and sharp glossy materials",
545                 default=False,
546                 )
547
548     @classmethod
549     def unregister(cls):
550         del bpy.types.Lamp.cycles
551
552
553 class CyclesWorldSettings(bpy.types.PropertyGroup):
554     @classmethod
555     def register(cls):
556         bpy.types.World.cycles = PointerProperty(
557                 name="Cycles World Settings",
558                 description="Cycles world settings",
559                 type=cls,
560                 )
561         cls.sample_as_light = BoolProperty(
562                 name="Multiple Importance Sample",
563                 description="Use multiple importance sampling for the environment, "
564                             "enabling for non-solid colors is recommended",
565                 default=False,
566                 )
567         cls.sample_map_resolution = IntProperty(
568                 name="Map Resolution",
569                 description="Importance map size is resolution x resolution; "
570                             "higher values potentially produce less noise, at the cost of memory and speed",
571                 min=4, max=8096,
572                 default=256,
573                 )
574         cls.samples = IntProperty(
575                 name="Samples",
576                 description="Number of light samples to render for each AA sample",
577                 min=1, max=10000,
578                 default=4,
579                 )
580
581     @classmethod
582     def unregister(cls):
583         del bpy.types.World.cycles
584
585
586 class CyclesVisibilitySettings(bpy.types.PropertyGroup):
587     @classmethod
588     def register(cls):
589         bpy.types.Object.cycles_visibility = PointerProperty(
590                 name="Cycles Visibility Settings",
591                 description="Cycles visibility settings",
592                 type=cls,
593                 )
594
595         bpy.types.World.cycles_visibility = PointerProperty(
596                 name="Cycles Visibility Settings",
597                 description="Cycles visibility settings",
598                 type=cls,
599                 )
600
601         cls.camera = BoolProperty(
602                 name="Camera",
603                 description="Object visibility for camera rays",
604                 default=True,
605                 )
606         cls.diffuse = BoolProperty(
607                 name="Diffuse",
608                 description="Object visibility for diffuse reflection rays",
609                 default=True,
610                 )
611         cls.glossy = BoolProperty(
612                 name="Glossy",
613                 description="Object visibility for glossy reflection rays",
614                 default=True,
615                 )
616         cls.transmission = BoolProperty(
617                 name="Transmission",
618                 description="Object visibility for transmission rays",
619                 default=True,
620                 )
621         cls.shadow = BoolProperty(
622                 name="Shadow",
623                 description="Object visibility for shadow rays",
624                 default=True,
625                 )
626
627     @classmethod
628     def unregister(cls):
629         del bpy.types.Object.cycles_visibility
630         del bpy.types.World.cycles_visibility
631
632
633 class CyclesMeshSettings(bpy.types.PropertyGroup):
634     @classmethod
635     def register(cls):
636         bpy.types.Mesh.cycles = PointerProperty(
637                 name="Cycles Mesh Settings",
638                 description="Cycles mesh settings",
639                 type=cls,
640                 )
641         bpy.types.Curve.cycles = PointerProperty(
642                 name="Cycles Mesh Settings",
643                 description="Cycles mesh settings",
644                 type=cls,
645                 )
646         bpy.types.MetaBall.cycles = PointerProperty(
647                 name="Cycles Mesh Settings",
648                 description="Cycles mesh settings",
649                 type=cls,
650                 )
651
652         cls.displacement_method = EnumProperty(
653                 name="Displacement Method",
654                 description="Method to use for the displacement",
655                 items=enum_displacement_methods,
656                 default='BUMP',
657                 )
658         cls.use_subdivision = BoolProperty(
659                 name="Use Subdivision",
660                 description="Subdivide mesh for rendering",
661                 default=False,
662                 )
663         cls.dicing_rate = FloatProperty(
664                 name="Dicing Rate",
665                 description="",
666                 min=0.001, max=1000.0,
667                 default=1.0,
668                 )
669
670     @classmethod
671     def unregister(cls):
672         del bpy.types.Mesh.cycles
673         del bpy.types.Curve.cycles
674         del bpy.types.MetaBall.cycles
675
676
677 class CyclesCurveRenderSettings(bpy.types.PropertyGroup):
678     @classmethod
679     def register(cls):
680         bpy.types.Scene.cycles_curves = PointerProperty(
681                 name="Cycles Hair Rendering Settings",
682                 description="Cycles hair rendering settings",
683                 type=cls,
684                 )
685         cls.primitive = EnumProperty(
686                 name="Primitive",
687                 description="Type of primitive used for hair rendering",
688                 items=enum_curve_primitives,
689                 default='LINE_SEGMENTS',
690                 )
691         cls.shape = EnumProperty(
692                 name="Shape",
693                 description="Form of hair",
694                 items=enum_curve_shape,
695                 default='THICK',
696                 )
697         cls.cull_backfacing = BoolProperty(
698                 name="Cull back-faces",
699                 description="Do not test the back-face of each strand",
700                 default=True,
701                 )
702         cls.use_curves = BoolProperty(
703                 name="Use Cycles Hair Rendering",
704                 description="Activate Cycles hair rendering for particle system",
705                 default=True,
706                 )
707         cls.resolution = IntProperty(
708                 name="Resolution",
709                 description="Resolution of generated mesh",
710                 min=3, max=64,
711                 default=3,
712                 )
713         cls.minimum_width = FloatProperty(
714                 name="Minimal width",
715                 description="Minimal pixel width for strands (0 - deactivated)",
716                 min=0.0, max=100.0,
717                 default=0.0,
718                 )
719         cls.maximum_width = FloatProperty(
720                 name="Maximal width",
721                 description="Maximum extension that strand radius can be increased by",
722                 min=0.0, max=100.0,
723                 default=0.1,
724                 )
725         cls.subdivisions = IntProperty(
726                 name="Subdivisions",
727                 description="Number of subdivisions used in Cardinal curve intersection (power of 2)",
728                 min=0, max=24,
729                 default=4,
730                 )
731
732     @classmethod
733     def unregister(cls):
734         del bpy.types.Scene.cycles_curves
735
736
737 class CyclesCurveSettings(bpy.types.PropertyGroup):
738     @classmethod
739     def register(cls):
740         bpy.types.ParticleSettings.cycles = PointerProperty(
741                 name="Cycles Hair Settings",
742                 description="Cycles hair settings",
743                 type=cls,
744                 )
745         cls.radius_scale = FloatProperty(
746                 name="Radius Scaling",
747                 description="Multiplier of width properties",
748                 min=0.0, max=1000.0,
749                 default=0.01,
750                 )
751         cls.root_width = FloatProperty(
752                 name="Root Size",
753                 description="Strand's width at root",
754                 min=0.0, max=1000.0,
755                 default=1.0,
756                 )
757         cls.tip_width = FloatProperty(
758                 name="Tip Multiplier",
759                 description="Strand's width at tip",
760                 min=0.0, max=1000.0,
761                 default=0.0,
762                 )
763         cls.shape = FloatProperty(
764                 name="Strand Shape",
765                 description="Strand shape parameter",
766                 min=-1.0, max=1.0,
767                 default=0.0,
768                 )
769         cls.use_closetip = BoolProperty(
770                 name="Close tip",
771                 description="Set tip radius to zero",
772                 default=True,
773                 )
774
775     @classmethod
776     def unregister(cls):
777         del bpy.types.ParticleSettings.cycles
778
779
780 def register():
781     bpy.utils.register_class(CyclesRenderSettings)
782     bpy.utils.register_class(CyclesCameraSettings)
783     bpy.utils.register_class(CyclesMaterialSettings)
784     bpy.utils.register_class(CyclesLampSettings)
785     bpy.utils.register_class(CyclesWorldSettings)
786     bpy.utils.register_class(CyclesVisibilitySettings)
787     bpy.utils.register_class(CyclesMeshSettings)
788     bpy.utils.register_class(CyclesCurveRenderSettings)
789     bpy.utils.register_class(CyclesCurveSettings)
790
791
792 def unregister():
793     bpy.utils.unregister_class(CyclesRenderSettings)
794     bpy.utils.unregister_class(CyclesCameraSettings)
795     bpy.utils.unregister_class(CyclesMaterialSettings)
796     bpy.utils.unregister_class(CyclesLampSettings)
797     bpy.utils.unregister_class(CyclesWorldSettings)
798     bpy.utils.unregister_class(CyclesMeshSettings)
799     bpy.utils.unregister_class(CyclesVisibilitySettings)
800     bpy.utils.unregister_class(CyclesCurveRenderSettings)
801     bpy.utils.unregister_class(CyclesCurveSettings)