svn merge -r 22628:22714 https://svn.blender.org/svnroot/bf-blender/branches/blender2...
[blender-staging.git] / release / ui / buttons_material.py
1         
2 import bpy
3
4 class MaterialButtonsPanel(bpy.types.Panel):
5         __space_type__ = 'PROPERTIES'
6         __region_type__ = 'WINDOW'
7         __context__ = "material"
8         # COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
9
10         def poll(self, context):
11                 return (context.material) and (context.scene.render_data.engine in self.COMPAT_ENGINES)
12
13 class MATERIAL_PT_preview(MaterialButtonsPanel):
14         __label__ = "Preview"
15         COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
16
17         def draw(self, context):
18                 layout = self.layout
19                 
20                 mat = context.material
21                 
22                 layout.template_preview(mat)
23                 
24 class MATERIAL_PT_context_material(MaterialButtonsPanel):
25         __show_header__ = False
26         COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
27
28         def poll(self, context):
29                 # An exception, dont call the parent poll func because
30                 # this manages materials for all engine types
31                 
32                 return (context.object) and (context.scene.render_data.engine in self.COMPAT_ENGINES)
33
34         def draw(self, context):
35                 layout = self.layout
36                 
37                 mat = context.material
38                 ob = context.object
39                 slot = context.material_slot
40                 space = context.space_data
41
42                 if ob:
43                         row = layout.row()
44
45                         row.template_list(ob, "materials", ob, "active_material_index", rows=2)
46
47                         col = row.column(align=True)
48                         col.itemO("object.material_slot_add", icon='ICON_ZOOMIN', text="")
49                         col.itemO("object.material_slot_remove", icon='ICON_ZOOMOUT', text="")
50
51                         if ob.mode == 'EDIT':
52                                 row = layout.row(align=True)
53                                 row.itemO("object.material_slot_assign", text="Assign")
54                                 row.itemO("object.material_slot_select", text="Select")
55                                 row.itemO("object.material_slot_deselect", text="Deselect")
56
57                 split = layout.split(percentage=0.65)
58
59                 if ob:
60                         split.template_ID(ob, "active_material", new="material.new")
61                         row = split.row()
62                         if slot:
63                                 row.itemR(slot, "link", text="")
64                         else:
65                                 row.itemL()
66                 elif mat:
67                         split.template_ID(space, "pin_id")
68                         split.itemS()
69
70                 layout.itemR(mat, "type", expand=True)
71         
72 class MATERIAL_PT_shading(MaterialButtonsPanel):
73         __label__ = "Shading"
74         COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
75
76         def poll(self, context):
77                 return (context.material.type in ('SURFACE', 'WIRE', 'HALO'))
78
79         def draw(self, context):
80                 layout = self.layout
81                 
82                 mat = context.material
83                 ob = context.object
84                 slot = context.material_slot
85                 space = context.space_data
86
87                 if mat:
88
89                         if mat.type in ('SURFACE', 'WIRE'):
90                                 split = layout.split()
91         
92                                 col = split.column()
93                                 sub = col.column()
94                                 sub.active = not mat.shadeless
95                                 sub.itemR(mat, "emit")
96                                 sub.itemR(mat, "ambient")
97                                 sub = col.column()
98                                 sub.itemR(mat, "translucency")
99                                 
100                                 col = split.column()
101                                 col.itemR(mat, "shadeless")     
102                                 sub = col.column()
103                                 sub.active = not mat.shadeless
104                                 sub.itemR(mat, "tangent_shading")
105                                 sub.itemR(mat, "cubic")
106                                 
107                         elif mat.type == 'HALO':
108                                 layout.itemR(mat, "alpha")
109                         
110 class MATERIAL_PT_strand(MaterialButtonsPanel):
111         __label__ = "Strand"
112         __default_closed__ = True
113         COMPAT_ENGINES = set(['BLENDER_RENDER'])
114
115         def poll(self, context):
116                 mat = context.material
117                 return mat and (mat.type in ('SURFACE', 'WIRE')) and (context.scene.render_data.engine in self.COMPAT_ENGINES)
118         
119         def poll(self, context):
120                 return context.material.type in ('SURFACE', 'WIRE', 'HALO')
121         
122         def draw(self, context):
123                 layout = self.layout
124                 
125                 mat = context.material
126                 tan = mat.strand
127                 
128                 split = layout.split()
129                 
130                 col = split.column(align=True)
131                 col.itemL(text="Size:")
132                 col.itemR(tan, "start_size", text="Root")
133                 col.itemR(tan, "end_size", text="Tip")
134                 col.itemR(tan, "min_size", text="Minimum")
135                 col.itemR(tan, "blender_units")
136                 sub = col.column()
137                 sub.active = (not mat.shadeless)
138                 sub.itemR(tan, "tangent_shading")
139                 col.itemR(tan, "shape")
140                 
141                 col = split.column()
142                 col.itemL(text="Shading:")
143                 col.itemR(tan, "width_fade")
144                 col.itemR(tan, "uv_layer")
145                 col.itemS()
146                 sub = col.column()
147                 sub.active = (not mat.shadeless)
148                 sub.itemR(tan, "surface_diffuse")
149                 sub = col.column()
150                 sub.active = tan.surface_diffuse
151                 sub.itemR(tan, "blend_distance", text="Distance")
152                 
153 class MATERIAL_PT_physics(MaterialButtonsPanel):
154         __label__ = "Physics"
155         COMPAT_ENGINES = set(['BLENDER_GAME'])
156         
157         def draw(self, context):
158                 layout = self.layout
159                 
160                 mat = context.material
161                 phys = mat.physics
162                 
163                 split = layout.split()
164                 
165                 col = split.column()
166                 col.itemR(phys, "distance")
167                 col.itemR(phys, "friction")
168                 col.itemR(phys, "align_to_normal")
169                 
170                 col = split.column()
171                 col.itemR(phys, "force", slider=True)
172                 col.itemR(phys, "elasticity", slider=True)
173                 col.itemR(phys, "damp", slider=True)
174                 
175 class MATERIAL_PT_options(MaterialButtonsPanel):
176         __label__ = "Options"
177         COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
178
179         def poll(self, context):
180                 return (context.material.type in ('SURFACE', 'WIRE', 'HALO'))
181
182         def draw(self, context):
183                 layout = self.layout
184                 
185                 mat = context.material
186                 
187                 split = layout.split()
188                 
189                 col = split.column()
190                 col.itemR(mat, "traceable")
191                 col.itemR(mat, "full_oversampling")
192                 col.itemR(mat, "sky")
193                 col.itemR(mat, "exclude_mist")
194                 col.itemR(mat, "invert_z")
195                 sub = col.column(align=True)
196                 sub.itemL(text="Light Group:")
197                 sub.itemR(mat, "light_group", text="")
198                 row = sub.row()
199                 row.active = mat.light_group
200                 row.itemR(mat, "light_group_exclusive", text="Exclusive")
201
202                 col = split.column()
203                 col.itemR(mat, "face_texture")
204                 sub = col.column()
205                 sub.active = mat.face_texture
206                 sub.itemR(mat, "face_texture_alpha")
207                 col.itemS()
208                 col.itemR(mat, "vertex_color_paint")
209                 col.itemR(mat, "vertex_color_light")
210                 col.itemR(mat, "object_color")
211
212 class MATERIAL_PT_shadow(MaterialButtonsPanel):
213         __label__ = "Shadow"
214         __default_closed__ = True
215         COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
216         
217         def poll(self, context):
218                 return context.material.type in ('SURFACE', 'WIRE')
219
220         def draw(self, context):
221                 layout = self.layout
222                 
223                 mat = context.material
224                 
225                 split = layout.split()
226                 
227                 col = split.column()
228                 col.itemR(mat, "shadows", text="Receive")
229                 col.itemR(mat, "transparent_shadows", text="Receive Transparent")
230                 col.itemR(mat, "only_shadow", text="Shadows Only")
231                 col.itemR(mat, "cast_shadows_only", text="Cast Only")
232                 col.itemR(mat, "shadow_casting_alpha", text="Casting Alpha")
233                 
234                 col = split.column()
235                 col.itemR(mat, "cast_buffer_shadows")
236                 sub = col.column()
237                 sub.active = mat.cast_buffer_shadows
238                 sub.itemR(mat, "shadow_buffer_bias", text="Buffer Bias")
239                 col.itemR(mat, "ray_shadow_bias", text="Auto Ray Bias")
240                 sub = col.column()
241                 sub.active = (not mat.ray_shadow_bias)
242                 sub.itemR(mat, "shadow_ray_bias", text="Ray Bias")
243                 
244
245 class MATERIAL_PT_diffuse(MaterialButtonsPanel):
246         __label__ = "Diffuse"
247         COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
248
249         def poll(self, context):
250                 mat = context.material
251                 return mat and (mat.type in ('SURFACE', 'WIRE')) and (context.scene.render_data.engine in self.COMPAT_ENGINES)
252
253         def draw(self, context):
254                 layout = self.layout
255                 
256                 mat = context.material  
257                 
258                 split = layout.split()
259                 
260                 col = split.column()
261                 col.itemR(mat, "diffuse_color", text="")
262                 sub = col.column()
263                 sub.active = (not mat.shadeless)
264                 sub.itemR(mat, "diffuse_reflection", text="Intensity")
265                 
266                 col = split.column()
267                 col.active = (not mat.shadeless)
268                 col.itemR(mat, "diffuse_shader", text="")
269                 col.itemR(mat, "use_diffuse_ramp", text="Ramp")
270                 
271                 col = layout.column()
272                 col.active = (not mat.shadeless)
273                 if mat.diffuse_shader == 'OREN_NAYAR':
274                         col.itemR(mat, "roughness")
275                 elif mat.diffuse_shader == 'MINNAERT':
276                         col.itemR(mat, "darkness")
277                 elif mat.diffuse_shader == 'TOON':
278                         row = col.row()
279                         row.itemR(mat, "diffuse_toon_size", text="Size")
280                         row.itemR(mat, "diffuse_toon_smooth", text="Smooth")
281                 elif mat.diffuse_shader == 'FRESNEL':
282                         row = col.row()
283                         row.itemR(mat, "diffuse_fresnel", text="Fresnel")
284                         row.itemR(mat, "diffuse_fresnel_factor", text="Factor")
285                         
286                 if mat.use_diffuse_ramp:
287                         layout.itemS()
288                         layout.template_color_ramp(mat.diffuse_ramp, expand=True)
289                         layout.itemS()
290                         row = layout.row()
291                         split = row.split(percentage=0.3)
292                         split.itemL(text="Input:")
293                         split.itemR(mat, "diffuse_ramp_input", text="")
294                         split = row.split(percentage=0.3)
295                         split.itemL(text="Blend:")
296                         split.itemR(mat, "diffuse_ramp_blend", text="")
297                         
298                 
299 class MATERIAL_PT_specular(MaterialButtonsPanel):
300         __label__ = "Specular"
301         COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
302
303         def poll(self, context):
304                 mat = context.material
305                 return mat and (mat.type in ('SURFACE', 'WIRE')) and (context.scene.render_data.engine in self.COMPAT_ENGINES)
306
307         def draw(self, context):
308                 layout = self.layout
309                 
310                 mat = context.material
311                 
312                 layout.active = (not mat.shadeless)
313                 
314                 split = layout.split()
315                 
316                 col = split.column()
317                 col.itemR(mat, "specular_color", text="")
318                 col.itemR(mat, "specular_reflection", text="Intensity")
319
320                 col = split.column()
321                 col.itemR(mat, "specular_shader", text="")
322                 col.itemR(mat, "use_specular_ramp", text="Ramp")
323
324                 col = layout.column()
325                 if mat.specular_shader in ('COOKTORR', 'PHONG'):
326                         col.itemR(mat, "specular_hardness", text="Hardness")
327                 elif mat.specular_shader == 'BLINN':
328                         row = col.row()
329                         row.itemR(mat, "specular_hardness", text="Hardness")
330                         row.itemR(mat, "specular_ior", text="IOR")
331                 elif mat.specular_shader == 'WARDISO':
332                         col.itemR(mat, "specular_slope", text="Slope")
333                 elif mat.specular_shader == 'TOON':
334                         row = col.row()
335                         row.itemR(mat, "specular_toon_size", text="Size")
336                         row.itemR(mat, "specular_toon_smooth", text="Smooth")
337                 
338                 if mat.use_specular_ramp:
339                         layout.itemS()
340                         layout.template_color_ramp(mat.specular_ramp, expand=True)
341                         layout.itemS()
342                         row = layout.row()
343                         split = row.split(percentage=0.3)
344                         split.itemL(text="Input:")
345                         split.itemR(mat, "specular_ramp_input", text="")
346                         split = row.split(percentage=0.3)
347                         split.itemL(text="Blend:")
348                         split.itemR(mat, "specular_ramp_blend", text="")
349                 
350 class MATERIAL_PT_sss(MaterialButtonsPanel):
351         __label__ = "Subsurface Scattering"
352         __default_closed__ = True
353         COMPAT_ENGINES = set(['BLENDER_RENDER'])
354         
355         def poll(self, context):
356                 mat = context.material
357                 return mat and (mat.type in ('SURFACE', 'WIRE')) and (context.scene.render_data.engine in self.COMPAT_ENGINES)
358
359         def draw_header(self, context):
360                 layout = self.layout
361                 sss = context.material.subsurface_scattering
362                 mat = context.material
363                 
364                 layout.active = (not mat.shadeless)
365                 layout.itemR(sss, "enabled", text="")
366         
367         def draw(self, context):
368                 layout = self.layout
369                 
370                 mat = context.material
371                 sss = context.material.subsurface_scattering
372
373                 layout.active = sss.enabled     
374                 
375                 split = layout.split()
376                 split.active = (not mat.shadeless)
377                 
378                 col = split.column()
379                 col.itemR(sss, "ior")
380                 col.itemR(sss, "scale")
381                 col.itemR(sss, "color", text="")
382                 col.itemR(sss, "radius", text="RGB Radius")
383                 
384                 col = split.column()
385                 sub = col.column(align=True)
386                 sub.itemL(text="Blend:")
387                 sub.itemR(sss, "color_factor", text="Color")
388                 sub.itemR(sss, "texture_factor", text="Texture")
389                 sub.itemL(text="Scattering Weight:")
390                 sub.itemR(sss, "front")
391                 sub.itemR(sss, "back")
392                 col.itemS()
393                 col.itemR(sss, "error_tolerance", text="Error")
394
395 class MATERIAL_PT_mirror(MaterialButtonsPanel):
396         __label__ = "Mirror"
397         __default_closed__ = True
398         COMPAT_ENGINES = set(['BLENDER_RENDER'])
399         
400         def poll(self, context):
401                 mat = context.material
402                 return mat and (mat.type in ('SURFACE', 'WIRE')) and (context.scene.render_data.engine in self.COMPAT_ENGINES)
403         
404         def draw_header(self, context):
405                 layout = self.layout
406                 
407                 raym = context.material.raytrace_mirror
408
409                 layout.itemR(raym, "enabled", text="")
410         
411         def draw(self, context):
412                 layout = self.layout
413                 
414                 mat = context.material
415                 raym = context.material.raytrace_mirror
416                 
417                 layout.active = raym.enabled
418                 
419                 split = layout.split()
420                 
421                 col = split.column()
422                 col.itemR(raym, "reflect", text="Reflectivity")
423                 col.itemR(mat, "mirror_color", text="")
424                 
425                 
426                 col = split.column()
427                 col.itemR(raym, "fresnel")
428                 sub = col.column()
429                 sub.active = raym.fresnel > 0
430                 sub.itemR(raym, "fresnel_factor", text="Blend")
431                 
432                 split = layout.split()
433                 
434                 col = split.column()
435                 col.itemS()
436                 col.itemR(raym, "distance", text="Max Dist")
437                 col.itemR(raym, "depth")
438                 col.itemS()
439                 sub = col.split(percentage=0.4)
440                 sub.itemL(text="Fade To:")
441                 sub.itemR(raym, "fade_to", text="")
442                 
443                 col = split.column()
444                 col.itemL(text="Gloss:")
445                 col.itemR(raym, "gloss", text="Amount")
446                 sub = col.column()
447                 sub.active = raym.gloss < 1
448                 sub.itemR(raym, "gloss_threshold", text="Threshold")
449                 sub.itemR(raym, "gloss_samples", text="Samples")
450                 sub.itemR(raym, "gloss_anisotropic", text="Anisotropic")
451                 
452                 
453 class MATERIAL_PT_transp(MaterialButtonsPanel):
454         __label__= "Transparency"
455         __default_closed__ = True
456         COMPAT_ENGINES = set(['BLENDER_RENDER'])
457                 
458         def poll(self, context):
459                 mat = context.material
460                 return mat and (mat.type in ('SURFACE', 'WIRE')) and (context.scene.render_data.engine in self.COMPAT_ENGINES)
461
462         def draw_header(self, context):
463                 layout = self.layout
464                 
465                 mat = context.material
466                 layout.itemR(mat, "transparency", text="")
467
468         def draw(self, context):
469                 layout = self.layout
470                 
471                 mat = context.material
472                 rayt = context.material.raytrace_transparency
473                 
474                 row= layout.row()
475                 row.itemR(mat, "transparency_method", expand=True)
476                 row.active = mat.transparency and (not mat.shadeless)
477                 
478                 split = layout.split()
479                 
480                 col = split.column()
481                 row = col.row()
482                 row.itemR(mat, "alpha")
483                 row = col.row()
484                 row.active = mat.transparency and (not mat.shadeless)
485                 row.itemR(mat, "specular_alpha", text="Specular")
486                 
487                 
488                 col = split.column()
489                 col.active = (not mat.shadeless)
490                 col.itemR(rayt, "fresnel")
491                 sub = col.column()
492                 sub.active = rayt.fresnel > 0
493                 sub.itemR(rayt, "fresnel_factor", text="Blend")
494
495                 if mat.transparency_method == 'RAYTRACE':
496                         layout.itemS()
497                         split = layout.split()
498                         split.active = mat.transparency
499
500                         col = split.column()
501                         col.itemR(rayt, "ior")
502                         col.itemR(rayt, "filter")
503                         col.itemR(rayt, "falloff")
504                         col.itemR(rayt, "limit")
505                         col.itemR(rayt, "depth")
506                         
507                         col = split.column()
508                         col.itemL(text="Gloss:")
509                         col.itemR(rayt, "gloss", text="Amount")
510                         sub = col.column()
511                         sub.active = rayt.gloss < 1
512                         sub.itemR(rayt, "gloss_threshold", text="Threshold")
513                         sub.itemR(rayt, "gloss_samples", text="Samples")
514
515 class MATERIAL_PT_volume_shading(MaterialButtonsPanel):
516         __label__ = "Shading"
517         __default_closed__ = False
518         COMPAT_ENGINES = set(['BLENDER_RENDER'])
519         
520         def poll(self, context):
521                 return (context.material.type == 'VOLUME') and (context.scene.render_data.engine in self.COMPAT_ENGINES)
522         
523         def draw(self, context):
524                 layout = self.layout
525
526                 mat = context.material
527                 vol = context.material.volume
528                 
529                 split = layout.split()
530                 
531                 row = split.row()
532                 row.itemR(vol, "density")
533                 row.itemR(vol, "scattering")
534                 
535                 split = layout.split()
536                 col = split.column()
537                 col.itemR(vol, "absorption")
538                 col.itemR(vol, "absorption_color", text="")
539                 
540                                 
541                 col = split.column()
542                 col.itemR(vol, "emission")
543                 col.itemR(vol, "emission_color", text="")
544                 
545                 
546
547 class MATERIAL_PT_volume_scattering(MaterialButtonsPanel):
548         __label__ = "Scattering"
549         __default_closed__ = False
550         COMPAT_ENGINES = set(['BLENDER_RENDER'])
551         
552         def poll(self, context):
553                 return (context.material.type == 'VOLUME') and (context.scene.render_data.engine in self.COMPAT_ENGINES)
554         
555         def draw(self, context):
556                 layout = self.layout
557                 
558                 mat = context.material
559                 vol = context.material.volume
560                 
561                 split = layout.split()
562                 
563                 col = split.column()
564                 col.itemR(vol, "scattering_mode", text="")
565                 if vol.scattering_mode == 'SINGLE_SCATTERING':
566                         col.itemR(vol, "light_cache")
567                         sub = col.column()
568                         sub.active = vol.light_cache
569                         sub.itemR(vol, "cache_resolution")
570                 elif vol.scattering_mode in ('MULTIPLE_SCATTERING', 'SINGLE_PLUS_MULTIPLE_SCATTERING'):
571                         col.itemR(vol, "cache_resolution")
572                         
573                         col = col.column(align=True)
574                         col.itemR(vol, "ms_diffusion")
575                         col.itemR(vol, "ms_spread")
576                         col.itemR(vol, "ms_intensity")
577                 
578                 col = split.column()
579                 # col.itemL(text="Anisotropic Scattering:")
580                 col.itemR(vol, "phase_function", text="")
581                 if vol.phase_function in ('SCHLICK', 'HENYEY-GREENSTEIN'):
582                         col.itemR(vol, "asymmetry")
583
584 class MATERIAL_PT_volume_transp(MaterialButtonsPanel):
585         __label__= "Transparency"
586         COMPAT_ENGINES = set(['BLENDER_RENDER'])
587                 
588         def poll(self, context):
589                 mat = context.material
590                 return mat and (mat.type == 'VOLUME') and (context.scene.render_data.engine in self.COMPAT_ENGINES)
591
592         def draw_header(self, context):
593                 layout = self.layout
594
595         def draw(self, context):
596                 layout = self.layout
597                 
598                 mat = context.material
599                 rayt = context.material.raytrace_transparency
600                 
601                 row= layout.row()
602                 row.itemR(mat, "transparency_method", expand=True)
603                 row.active = mat.transparency and (not mat.shadeless)
604                 
605 class MATERIAL_PT_volume_integration(MaterialButtonsPanel):
606         __label__ = "Integration"
607         __default_closed__ = False
608         COMPAT_ENGINES = set(['BLENDER_RENDER'])
609         
610         def poll(self, context):
611                 return (context.material.type == 'VOLUME') and (context.scene.render_data.engine in self.COMPAT_ENGINES)
612         
613         def draw(self, context):
614                 layout = self.layout
615                 
616                 mat = context.material
617                 vol = context.material.volume
618                 
619                 split = layout.split()
620                 
621                 col = split.column()
622                 col.itemL(text="Step Calculation:")
623                 col.itemR(vol, "step_calculation", text="")
624                 col = col.column(align=True)
625                 col.itemR(vol, "step_size")
626                 col.itemR(vol, "shading_step_size")
627                 
628                 col = split.column()
629                 col.itemL()
630                 col.itemR(vol, "depth_cutoff")
631                 col.itemR(vol, "density_scale")
632                 
633                 
634 class MATERIAL_PT_halo(MaterialButtonsPanel):
635         __label__= "Halo"
636         COMPAT_ENGINES = set(['BLENDER_RENDER'])
637         
638         def poll(self, context):
639                 mat = context.material
640                 return mat and (mat.type == 'HALO') and (context.scene.render_data.engine in self.COMPAT_ENGINES)
641         
642         def draw(self, context):
643                 layout = self.layout
644                 
645                 mat = context.material
646                 halo = mat.halo
647
648                 split = layout.split()
649                 
650                 col = split.column()
651                 col.itemR(mat, "diffuse_color", text="")
652                 col.itemR(halo, "size")
653                 col.itemR(halo, "hardness")
654                 col.itemR(halo, "add")
655                 col.itemL(text="Options:")
656                 col.itemR(halo, "use_texture", text="Texture")
657                 col.itemR(halo, "use_vertex_normal", text="Vertex Normal")
658                 col.itemR(halo, "xalpha")
659                 col.itemR(halo, "shaded")
660                 col.itemR(halo, "soft")
661
662                 col = split.column()
663                 col.itemR(halo, "ring")
664                 sub = col.column()
665                 sub.active = halo.ring
666                 sub.itemR(halo, "rings")
667                 sub.itemR(mat, "mirror_color", text="")
668                 col.itemS()
669                 col.itemR(halo, "lines")
670                 sub = col.column()
671                 sub.active = halo.lines
672                 sub.itemR(halo, "line_number", text="Lines")
673                 sub.itemR(mat, "specular_color", text="")
674                 col.itemS()
675                 col.itemR(halo, "star")
676                 sub = col.column()
677                 sub.active = halo.star
678                 sub.itemR(halo, "star_tips")
679                 
680 class MATERIAL_PT_flare(MaterialButtonsPanel):
681         __label__= "Flare"
682         COMPAT_ENGINES = set(['BLENDER_RENDER'])
683         
684         def poll(self, context):
685                 mat = context.material
686                 return mat and (mat.type == 'HALO') and (context.scene.render_data.engine in self.COMPAT_ENGINES)
687         
688         def draw_header(self, context):
689                 layout = self.layout
690                 
691                 mat = context.material
692                 halo = mat.halo
693                 layout.itemR(halo, "flare_mode", text="")
694         
695         def draw(self, context):
696                 layout = self.layout
697                 
698                 mat = context.material
699                 halo = mat.halo
700
701                 layout.active = halo.flare_mode
702                 
703                 split = layout.split()
704                 
705                 col = split.column()
706                 col.itemR(halo, "flare_size", text="Size")
707                 col.itemR(halo, "flare_boost", text="Boost")
708                 col.itemR(halo, "flare_seed", text="Seed")
709                 col = split.column()
710                 col.itemR(halo, "flares_sub", text="Subflares")
711                 col.itemR(halo, "flare_subsize", text="Subsize")
712
713 bpy.types.register(MATERIAL_PT_context_material)
714 bpy.types.register(MATERIAL_PT_preview)
715 bpy.types.register(MATERIAL_PT_diffuse)
716 bpy.types.register(MATERIAL_PT_specular)
717 bpy.types.register(MATERIAL_PT_shading)
718 bpy.types.register(MATERIAL_PT_transp)
719 bpy.types.register(MATERIAL_PT_mirror)
720 bpy.types.register(MATERIAL_PT_sss)
721 bpy.types.register(MATERIAL_PT_volume_shading)
722 bpy.types.register(MATERIAL_PT_volume_scattering)
723 bpy.types.register(MATERIAL_PT_volume_transp)
724 bpy.types.register(MATERIAL_PT_volume_integration)
725 bpy.types.register(MATERIAL_PT_halo)
726 bpy.types.register(MATERIAL_PT_flare)
727 bpy.types.register(MATERIAL_PT_physics)
728 bpy.types.register(MATERIAL_PT_strand)
729 bpy.types.register(MATERIAL_PT_options)
730 bpy.types.register(MATERIAL_PT_shadow)
731