9765aa93ca4c485af1cd8a2fc7a19e0612c153c4
[blender-staging.git] / release / scripts / ui / buttons_texture.py
1
2 import bpy
3
4 class TextureButtonsPanel(bpy.types.Panel):
5         __space_type__ = 'PROPERTIES'
6         __region_type__ = 'WINDOW'
7         __context__ = "texture"
8         
9         def poll(self, context):
10                 tex = context.texture
11                 return (tex and (tex.type != 'NONE' or tex.use_nodes))
12                 
13 class TEXTURE_PT_preview(TextureButtonsPanel):
14         __label__ = "Preview"
15
16         def draw(self, context):
17                 layout = self.layout
18                 
19                 tex = context.texture
20                 slot = context.texture_slot
21                 ma = context.material
22                 la = context.lamp
23                 wo = context.world
24                 br = context.brush
25                 
26                 if ma:
27                         layout.template_preview(tex, parent=ma, slot=slot)
28                 elif la:
29                         layout.template_preview(tex, parent=la, slot=slot)
30                 elif wo:
31                         layout.template_preview(tex, parent=wo, slot=slot)
32                 elif br:
33                         layout.template_preview(tex, parent=br, slot=slot)
34                 else:
35                         layout.template_preview(tex, slot=slot)
36                         
37 class TEXTURE_PT_context_texture(TextureButtonsPanel):
38         __show_header__ = False
39
40         def poll(self, context):
41                 return (context.material or context.world or context.lamp or context.brush or context.texture)
42
43         def draw(self, context):
44                 layout = self.layout
45
46                 tex = context.texture
47                 
48                 id = context.material
49                 if not id: id = context.lamp
50                 if not id: id = context.world
51                 if not id: id = context.brush
52                 
53                 space = context.space_data
54
55                 if id:
56                         row = layout.row()
57                         row.template_list(id, "textures", id, "active_texture_index", rows=2)
58                         
59                 split = layout.split(percentage=0.65)
60
61                 if id:
62                         split.template_ID(id, "active_texture", new="texture.new")
63                 elif tex:
64                         split.template_ID(space, "pin_id")
65
66                 if (not space.pin_id) and (
67                         context.sculpt_object or
68                         context.vertex_paint_object or
69                         context.weight_paint_object or
70                         context.texture_paint_object
71                 ):
72                         split.itemR(space, "brush_texture", text="Brush", toggle=True)
73
74                 if tex:
75                         layout.itemR(tex, "use_nodes")
76                         
77                         split = layout.split(percentage=0.2)
78                         
79                         if tex.use_nodes:
80                                 slot = context.texture_slot
81                                 split.itemL(text="Output:")
82                                 split.itemR(slot, "output_node", text="")
83
84                         else:
85                                 split.itemL(text="Type:")
86                                 split.itemR(tex, "type", text="")
87                         
88 class TEXTURE_PT_colors(TextureButtonsPanel):
89         __label__ = "Colors"
90         __default_closed__ = True
91
92         def draw(self, context):
93                 layout = self.layout
94                 
95                 tex = context.texture
96
97                 layout.itemR(tex, "use_color_ramp", text="Ramp")
98                 if tex.use_color_ramp:
99                         layout.template_color_ramp(tex, "color_ramp", expand=True)
100
101                 split = layout.split()
102                 
103                 split.itemR(tex, "rgb_factor", text="Multiply RGB")
104
105                 col = split.column()
106                 col.itemL(text="Adjust:")
107                 col.itemR(tex, "brightness")
108                 col.itemR(tex, "contrast")
109                         
110 # Texture Slot Panels #
111                         
112 class TextureSlotPanel(TextureButtonsPanel):
113         def poll(self, context):
114                 return (
115                         context.texture_slot and 
116                         TextureButtonsPanel.poll(self, context)
117                 )
118                                 
119 class TEXTURE_PT_mapping(TextureSlotPanel):
120         __label__ = "Mapping"
121         
122         def draw(self, context):
123                 layout = self.layout
124                 
125                 ma = context.material
126                 la = context.lamp
127                 wo = context.world
128                 br = context.brush
129                 tex = context.texture_slot
130                 textype = context.texture
131
132                 if not br:
133                         split = layout.split(percentage=0.3)
134                         col = split.column()
135                         col.itemL(text="Coordinates:")
136                         col = split.column()
137                         col.itemR(tex, "texture_coordinates", text="")
138
139                         if tex.texture_coordinates == 'ORCO':
140                                 """
141                                 ob = context.object
142                                 if ob and ob.type == 'MESH':
143                                         split = layout.split(percentage=0.3)
144                                         split.itemL(text="Mesh:")
145                                         split.itemR(ob.data, "texco_mesh", text="")
146                                 """
147                         elif tex.texture_coordinates == 'UV':
148                                 split = layout.split(percentage=0.3)
149                                 split.itemL(text="Layer:")
150                                 split.itemR(tex, "uv_layer", text="")
151                         elif tex.texture_coordinates == 'OBJECT':
152                                 split = layout.split(percentage=0.3)
153                                 split.itemL(text="Object:")
154                                 split.itemR(tex, "object", text="")
155                         
156                 if ma:
157                         split = layout.split(percentage=0.3)
158                         split.itemL(text="Projection:")
159                         split.itemR(tex, "mapping", text="")
160
161                         split = layout.split()
162                         
163                         col = split.column()
164                         if tex.texture_coordinates in ('ORCO', 'UV'):
165                                 col.itemR(tex, "from_dupli")
166                         elif tex.texture_coordinates == 'OBJECT':
167                                 col.itemR(tex, "from_original")
168                         else:
169                                 col.itemL()
170                         
171                         col = split.column()
172                         row = col.row()
173                         row.itemR(tex, "x_mapping", text="")
174                         row.itemR(tex, "y_mapping", text="")
175                         row.itemR(tex, "z_mapping", text="")
176
177                 if br:
178                         layout.itemR(tex, "brush_map_mode", expand=True)
179                         
180                         row = layout.row()
181                         row.active = tex.brush_map_mode in ('FIXED', 'TILED')
182                         row.itemR(tex, "angle")
183
184                         row = layout.row()
185                         row.active = tex.brush_map_mode in ('TILED', '3D')
186                         row.column().itemR(tex, "size")
187                 else:
188                         row = layout.row()
189                         row.column().itemR(tex, "offset")
190                         row.column().itemR(tex, "size")
191
192 class TEXTURE_PT_influence(TextureSlotPanel):
193         __label__ = "Influence"
194         
195         def draw(self, context):
196                 layout = self.layout
197                 
198                 ma = context.material
199                 la = context.lamp
200                 wo = context.world
201                 br = context.brush
202                 textype = context.texture
203                 tex = context.texture_slot
204
205                 def factor_but(layout, active, toggle, factor, name):
206                         row = layout.row(align=True)
207                         row.itemR(tex, toggle, text="")
208                         sub = row.row()
209                         sub.active = active
210                         sub.itemR(tex, factor, text=name, slider=True)
211                 
212                 if ma:
213                         if ma.type in ['SURFACE', 'HALO', 'WIRE']:
214                                 split = layout.split()
215                                 
216                                 col = split.column()
217                                 col.itemL(text="Diffuse:")
218                                 factor_but(col, tex.map_diffuse, "map_diffuse", "diffuse_factor", "Intensity")
219                                 factor_but(col, tex.map_colordiff, "map_colordiff", "colordiff_factor", "Color")
220                                 factor_but(col, tex.map_alpha, "map_alpha", "alpha_factor", "Alpha")
221                                 factor_but(col, tex.map_translucency, "map_translucency", "translucency_factor", "Translucency")
222
223                                 col.itemL(text="Specular:")
224                                 factor_but(col, tex.map_specular, "map_specular", "specular_factor", "Intensity")
225                                 factor_but(col, tex.map_colorspec, "map_colorspec", "colorspec_factor", "Color")
226                                 factor_but(col, tex.map_hardness, "map_hardness", "hardness_factor", "Hardness")
227
228                                 col = split.column()
229                                 col.itemL(text="Shading:")
230                                 factor_but(col, tex.map_ambient, "map_ambient", "ambient_factor", "Ambient")
231                                 factor_but(col, tex.map_emit, "map_emit", "emit_factor", "Emit")
232                                 factor_but(col, tex.map_mirror, "map_mirror", "mirror_factor", "Mirror")
233                                 factor_but(col, tex.map_raymir, "map_raymir", "raymir_factor", "Ray Mirror")
234
235                                 col.itemL(text="Geometry:")
236                                 factor_but(col, tex.map_normal, "map_normal", "normal_factor", "Normal")
237                                 factor_but(col, tex.map_warp, "map_warp", "warp_factor", "Warp")
238                                 factor_but(col, tex.map_displacement, "map_displacement", "displacement_factor", "Displace")
239
240                                 #sub = col.column()
241                                 #sub.active = tex.map_translucency or tex.map_emit or tex.map_alpha or tex.map_raymir or tex.map_hardness or tex.map_ambient or tex.map_specularity or tex.map_reflection or tex.map_mirror
242                                 #sub.itemR(tex, "default_value", text="Amount", slider=True)
243                         elif ma.type == 'VOLUME':
244                                 split = layout.split()
245                                 
246                                 col = split.column()
247                                 factor_but(col, tex.map_density, "map_density", "density_factor", "Density")
248                                 factor_but(col, tex.map_emission, "map_emission", "emission_factor", "Emission")
249                                 factor_but(col, tex.map_scattering, "map_scattering", "scattering_factor", "Scattering")
250                                 factor_but(col, tex.map_reflection, "map_reflection", "reflection_factor", "Reflection")
251                                 
252                                 col = split.column()
253                                 col.itemL(text=" ")
254                                 factor_but(col, tex.map_alpha, "map_coloremission", "coloremission_factor", "Emission Color")
255                                 factor_but(col, tex.map_colortransmission, "map_colortransmission", "colortransmission_factor", "Transmission Color")
256                                 factor_but(col, tex.map_colorreflection, "map_colorreflection", "colorreflection_factor", "Reflection Color")
257
258                 elif la:
259                         row = layout.row()
260                         factor_but(row, tex.map_color, "map_color", "color_factor", "Color")
261                         factor_but(row, tex.map_shadow, "map_shadow", "shadow_factor", "Shadow")
262                 elif wo:
263                         split = layout.split()
264                         
265                         col = split.column()
266                         factor_but(col, tex.map_blend, "map_blend", "blend_factor", "Blend")
267                         factor_but(col, tex.map_horizon, "map_horizon", "horizon_factor", "Horizon")
268
269                         col = split.column()
270                         factor_but(col, tex.map_zenith_up, "map_zenith_up", "zenith_up_factor", "Zenith Up")
271                         factor_but(col, tex.map_zenith_down, "map_zenith_down", "zenith_down_factor", "Zenith Down")
272
273                 layout.itemS()
274                 
275                 split = layout.split()
276
277                 col = split.column()
278                 col.itemR(tex, "blend_type", text="Blend")
279                 col.itemR(tex, "rgb_to_intensity")
280                 sub = col.column()
281                 sub.active = tex.rgb_to_intensity
282                 sub.itemR(tex, "color", text="")
283
284                 col = split.column()
285                 col.itemR(tex, "negate", text="Negative")
286                 col.itemR(tex, "stencil")
287                 if ma or wo:
288                         col.itemR(tex, "default_value", text="DVar", slider=True)
289
290 # Texture Type Panels #
291
292 class TextureTypePanel(TextureButtonsPanel):
293         def poll(self, context):
294                 tex = context.texture
295                 return (tex and tex.type == self.tex_type and not tex.use_nodes)
296
297 class TEXTURE_PT_clouds(TextureTypePanel):
298         __label__ = "Clouds"
299         tex_type = 'CLOUDS'
300
301         def draw(self, context):
302                 layout = self.layout
303                 
304                 tex = context.texture
305                 
306                 layout.itemR(tex, "stype", expand=True)
307                 layout.itemL(text="Noise:")
308                 layout.itemR(tex, "noise_type", text="Type", expand=True)
309                 layout.itemR(tex, "noise_basis", text="Basis")
310                 
311                 flow = layout.column_flow()
312                 flow.itemR(tex, "noise_size", text="Size")
313                 flow.itemR(tex, "noise_depth", text="Depth")
314                 flow.itemR(tex, "nabla", text="Nabla")
315
316 class TEXTURE_PT_wood(TextureTypePanel):
317         __label__ = "Wood"
318         tex_type = 'WOOD'
319
320         def draw(self, context):
321                 layout = self.layout
322                 
323                 tex = context.texture
324                 
325                 layout.itemR(tex, "noisebasis2", expand=True)
326                 layout.itemR(tex, "stype", expand=True)
327                 
328                 col = layout.column()
329                 col.active = tex.stype in ('RINGNOISE', 'BANDNOISE')
330                 col.itemL(text="Noise:")
331                 col.row().itemR(tex, "noise_type", text="Type", expand=True)
332                 col.itemR(tex, "noise_basis", text="Basis")
333                 
334                 flow = layout.column_flow()
335                 flow.active = tex.stype in ('RINGNOISE', 'BANDNOISE')
336                 flow.itemR(tex, "noise_size", text="Size")
337                 flow.itemR(tex, "turbulence")
338                 flow.itemR(tex, "nabla")
339                 
340 class TEXTURE_PT_marble(TextureTypePanel):
341         __label__ = "Marble"
342         tex_type = 'MARBLE'
343         
344         def draw(self, context):
345                 layout = self.layout
346                 
347                 tex = context.texture
348                 
349                 layout.itemR(tex, "stype", expand=True)
350                 layout.itemR(tex, "noisebasis2", expand=True)
351                 layout.itemL(text="Noise:")
352                 layout.itemR(tex, "noise_type", text="Type", expand=True)
353                 layout.itemR(tex, "noise_basis", text="Basis")
354                 
355                 flow = layout.column_flow()     
356                 flow.itemR(tex, "noise_size", text="Size")
357                 flow.itemR(tex, "noise_depth", text="Depth")
358                 flow.itemR(tex, "turbulence")
359                 flow.itemR(tex, "nabla")
360
361 class TEXTURE_PT_magic(TextureTypePanel):
362         __label__ = "Magic"
363         tex_type = 'MAGIC'
364         
365         def draw(self, context):
366                 layout = self.layout
367                 
368                 tex = context.texture
369                         
370                 row = layout.row()
371                 row.itemR(tex, "noise_depth", text="Depth")
372                 row.itemR(tex, "turbulence")
373
374 class TEXTURE_PT_blend(TextureTypePanel):
375         __label__ = "Blend"
376         tex_type = 'BLEND'
377         
378         def draw(self, context):
379                 layout = self.layout
380                 
381                 tex = context.texture
382
383                 layout.itemR(tex, "progression")
384                 sub = layout.row()
385
386                 sub.active = (tex.progression in ('LINEAR', 'QUADRATIC', 'EASING', 'RADIAL'))
387                 sub.itemR(tex, "flip_axis", expand=True)
388                         
389 class TEXTURE_PT_stucci(TextureTypePanel):
390         __label__ = "Stucci"
391         tex_type = 'STUCCI'
392         
393         def draw(self, context):
394                 layout = self.layout
395                 
396                 tex = context.texture
397                 
398                 layout.itemR(tex, "stype", expand=True)
399                 layout.itemL(text="Noise:")
400                 layout.itemR(tex, "noise_type", text="Type", expand=True)
401                 layout.itemR(tex, "noise_basis", text="Basis")
402                 
403                 row = layout.row()
404                 row.itemR(tex, "noise_size", text="Size")
405                 row.itemR(tex, "turbulence")
406                 
407 class TEXTURE_PT_image(TextureTypePanel):
408         __label__ = "Image"
409         tex_type = 'IMAGE'
410         
411         def draw(self, context):
412                 layout = self.layout
413
414                 tex = context.texture
415
416                 layout.template_image(tex, "image", tex.image_user)
417
418 class TEXTURE_PT_image_sampling(TextureTypePanel):
419         __label__ = "Image Sampling"
420         __default_closed__ = True
421         tex_type = 'IMAGE'
422         
423         def draw(self, context):
424                 layout = self.layout
425                 
426                 tex = context.texture
427                 slot = context.texture_slot
428                 
429                 split = layout.split()
430                 
431                 """
432                 col = split.column()            
433                 col.itemR(tex, "flip_axis")
434                 col.itemR(tex, "normal_map")
435                 if slot:
436                         row = col.row()
437                         row.active = tex.normal_map
438                         row.itemR(slot, "normal_map_space", text="")
439                 """
440
441                 col = split.column()
442                 col.itemL(text="Alpha:")
443                 col.itemR(tex, "use_alpha", text="Use")
444                 col.itemR(tex, "calculate_alpha", text="Calculate")
445                 col.itemR(tex, "invert_alpha", text="Invert")
446
447                 col.itemL(text="Flip:")
448                 col.itemR(tex, "flip_axis", text="X/Y Axis")
449
450                 col = split.column() 
451                 col.itemL(text="Filter:")
452                 col.itemR(tex, "filter", text="")
453                 col.itemR(tex, "mipmap")
454                 
455                 row = col.row()
456                 row.active = tex.mipmap
457                 row.itemR(tex, "mipmap_gauss", text="Gauss")
458                 
459                 col.itemR(tex, "interpolation")
460                 if tex.mipmap and tex.filter != 'DEFAULT':
461                         if tex.filter == 'FELINE':
462                                 col.itemR(tex, "filter_probes", text="Probes")
463                         else:
464                                 col.itemR(tex, "filter_eccentricity", text="Eccentricity")
465
466 class TEXTURE_PT_image_mapping(TextureTypePanel):
467         __label__ = "Image Mapping"
468         __default_closed__ = True
469         tex_type = 'IMAGE'
470         
471         def draw(self, context):
472                 layout = self.layout
473                 
474                 tex = context.texture
475                 
476                 layout.itemR(tex, "extension")
477                 
478                 split = layout.split()
479                 
480                 if tex.extension == 'REPEAT': 
481                         col = split.column(align=True)
482                         col.itemL(text="Repeat:")
483                         col.itemR(tex, "repeat_x", text="X")
484                         col.itemR(tex, "repeat_y", text="Y")
485                         
486                         col = split.column(align=True)
487                         col.itemL(text="Mirror:")
488                         col.itemR(tex, "mirror_x", text="X")
489                         col.itemR(tex, "mirror_y", text="Y")
490                 elif tex.extension == 'CHECKER': 
491                         col = split.column(align=True)
492                         row = col.row()
493                         row.itemR(tex, "checker_even", text="Even")
494                         row.itemR(tex, "checker_odd", text="Odd")
495
496                         split.itemR(tex, "checker_distance", text="Distance")
497
498                 layout.itemS()
499
500                 split = layout.split()
501                 
502                 col = split.column(align=True)
503                 #col.itemR(tex, "crop_rectangle")
504                 col.itemL(text="Crop Minimum:")
505                 col.itemR(tex, "crop_min_x", text="X")
506                 col.itemR(tex, "crop_min_y", text="Y")
507                 
508                 col = split.column(align=True)
509                 col.itemL(text="Crop Maximum:")
510                 col.itemR(tex, "crop_max_x", text="X")
511                 col.itemR(tex, "crop_max_y", text="Y")
512         
513 class TEXTURE_PT_plugin(TextureTypePanel):
514         __label__ = "Plugin"
515         tex_type = 'PLUGIN'
516         
517         def draw(self, context):
518                 layout = self.layout
519                 
520                 tex = context.texture
521                 
522                 layout.itemL(text="Nothing yet")
523                 
524 class TEXTURE_PT_envmap(TextureTypePanel):
525         __label__ = "Environment Map"
526         tex_type = 'ENVIRONMENT_MAP'
527         
528         def draw(self, context):
529                 layout = self.layout
530                 
531                 tex = context.texture
532                 
533                 layout.itemL(text="Nothing yet")
534                 
535 class TEXTURE_PT_musgrave(TextureTypePanel):
536         __label__ = "Musgrave"
537         tex_type = 'MUSGRAVE'
538         
539         def draw(self, context):
540                 layout = self.layout
541                 
542                 tex = context.texture
543                 
544                 layout.itemR(tex, "musgrave_type")      
545                 
546                 split = layout.split()
547                 
548                 col = split.column()
549                 col.itemR(tex, "highest_dimension", text="Dimension")
550                 col.itemR(tex, "lacunarity")
551                 col.itemR(tex, "octaves")
552                 
553                 col = split.column() 
554                 if (tex.musgrave_type in ('HETERO_TERRAIN', 'RIDGED_MULTIFRACTAL', 'HYBRID_MULTIFRACTAL')):
555                         col.itemR(tex, "offset")
556                 if (tex.musgrave_type in ('RIDGED_MULTIFRACTAL', 'HYBRID_MULTIFRACTAL')):
557                         col.itemR(tex, "gain")
558                         col.itemR(tex, "noise_intensity", text="Intensity")
559                 
560                 layout.itemL(text="Noise:")
561                 
562                 layout.itemR(tex, "noise_basis", text="Basis")
563                 
564                 row = layout.row()
565                 row.itemR(tex, "noise_size", text="Size")
566                 row.itemR(tex, "nabla")
567
568 class TEXTURE_PT_voronoi(TextureTypePanel):
569         __label__ = "Voronoi"
570         tex_type = 'VORONOI'
571
572         def draw(self, context):
573                 layout = self.layout
574                 
575                 tex = context.texture
576                 
577                 split = layout.split()
578                 
579                 col = split.column()   
580                 col.itemL(text="Distance Metric:")
581                 col.itemR(tex, "distance_metric", text="")
582                 sub = col.column()
583                 sub.active = tex.distance_metric == 'MINKOVSKY'
584                 sub.itemR(tex, "minkovsky_exponent", text="Exponent")
585                 col.itemL(text="Coloring:")
586                 col.itemR(tex, "coloring", text="")
587                 col.itemR(tex, "noise_intensity", text="Intensity")
588                 
589                 col = split.column(align=True) 
590                 col.itemL(text="Feature Weights:")
591                 col.itemR(tex, "weight_1", text="1", slider=True)
592                 col.itemR(tex, "weight_2", text="2", slider=True)
593                 col.itemR(tex, "weight_3", text="3", slider=True)
594                 col.itemR(tex, "weight_4", text="4", slider=True)
595                 
596                 layout.itemL(text="Noise:")
597                 
598                 row = layout.row()
599                 row.itemR(tex, "noise_size", text="Size")
600                 row.itemR(tex, "nabla")
601                         
602 class TEXTURE_PT_distortednoise(TextureTypePanel):
603         __label__ = "Distorted Noise"
604         tex_type = 'DISTORTED_NOISE'
605         
606         def draw(self, context):
607                 layout = self.layout
608                 
609                 tex = context.texture
610
611                 layout.itemR(tex, "noise_distortion")
612                 layout.itemR(tex, "noise_basis", text="Basis")
613                 
614                 flow = layout.column_flow()
615                 flow.itemR(tex, "distortion", text="Distortion")
616                 flow.itemR(tex, "noise_size", text="Size")
617                 flow.itemR(tex, "nabla")        
618                 
619 class TEXTURE_PT_voxeldata(TextureButtonsPanel):
620         __label__ = "Voxel Data"
621
622         def poll(self, context):
623                 tex = context.texture
624                 return (tex and tex.type == 'VOXEL_DATA')
625
626         def draw(self, context):
627                 layout = self.layout
628                 
629                 tex = context.texture
630                 vd = tex.voxeldata
631
632                 layout.itemR(vd, "file_format")
633                 if vd.file_format in ['BLENDER_VOXEL', 'RAW_8BIT']:
634                         layout.itemR(vd, "source_path")
635                 if vd.file_format == 'RAW_8BIT':
636                         layout.itemR(vd, "resolution")
637                 elif vd.file_format == 'SMOKE':
638                         layout.itemR(vd, "domain_object")
639                 
640                 layout.itemR(vd, "still")
641                 row = layout.row()
642                 row.active = vd.still
643                 row.itemR(vd, "still_frame_number")
644                 
645                 layout.itemR(vd, "interpolation")
646                 layout.itemR(vd, "extension")
647                 layout.itemR(vd, "intensity")
648                 
649 class TEXTURE_PT_pointdensity(TextureButtonsPanel):
650         __label__ = "Point Density"
651
652         def poll(self, context):
653                 tex = context.texture
654                 return (tex and tex.type == 'POINT_DENSITY')
655
656         def draw(self, context):
657                 layout = self.layout
658                 
659                 tex = context.texture
660                 pd = tex.pointdensity
661                 
662                 layout.itemR(pd, "point_source", expand=True)
663
664                 split = layout.split()
665                 
666                 col = split.column()
667                 if pd.point_source == 'PARTICLE_SYSTEM':
668                         col.itemL(text="Object:")
669                         col.itemR(pd, "object", text="")
670                         
671                         sub = col.column()
672                         sub.enabled = pd.object
673                         if pd.object:
674                                 sub.itemL(text="System:")
675                                 sub.item_pointerR(pd, "particle_system", pd.object, "particle_systems", text="")
676                         sub.itemL(text="Cache:")
677                         sub.itemR(pd, "particle_cache", text="")
678                 else:
679                         col.itemL(text="Object:")
680                         col.itemR(pd, "object", text="")
681                         col.itemL(text="Cache:")
682                         col.itemR(pd, "vertices_cache", text="")
683                 
684                 col.itemS()
685                 
686                 col.itemL(text="Color Source:") 
687                 col.itemR(pd, "color_source", text="")
688                 if pd.color_source in ('PARTICLE_SPEED', 'PARTICLE_VELOCITY'):
689                         col.itemR(pd, "speed_scale")
690                 if pd.color_source in ('PARTICLE_SPEED', 'PARTICLE_AGE'):
691                         layout.template_color_ramp(pd, "color_ramp", expand=True)
692
693                 col = split.column()
694                 col.itemL()
695                 col.itemR(pd, "radius")
696                 col.itemL(text="Falloff:")
697                 col.itemR(pd, "falloff", text="")
698                 if pd.falloff == 'SOFT':
699                         col.itemR(pd, "falloff_softness")
700
701 class TEXTURE_PT_pointdensity_turbulence(TextureButtonsPanel):
702         __label__ = "Turbulence"
703         
704         def poll(self, context):
705                 tex = context.texture
706                 return (tex and tex.type == 'POINT_DENSITY')
707                 
708         def draw_header(self, context):
709                 layout = self.layout
710                 
711                 tex = context.texture
712                 pd = tex.pointdensity
713                 
714                 layout.itemR(pd, "turbulence", text="")
715                 
716         def draw(self, context):
717                 layout = self.layout
718                 
719                 tex = context.texture
720                 pd = tex.pointdensity
721                 layout.active = pd.turbulence
722
723                 split = layout.split()
724                 
725                 col = split.column()
726                 col.itemL(text="Influence:")
727                 col.itemR(pd, "turbulence_influence", text="")
728                 col.itemL(text="Noise Basis:")
729                 col.itemR(pd, "noise_basis", text="")
730                 
731                 col = split.column()
732                 col.itemL()             
733                 col.itemR(pd, "turbulence_size")
734                 col.itemR(pd, "turbulence_depth")
735                 col.itemR(pd, "turbulence_strength")
736
737 bpy.types.register(TEXTURE_PT_context_texture)
738 bpy.types.register(TEXTURE_PT_preview)
739
740 bpy.types.register(TEXTURE_PT_clouds) # Texture Type Panels
741 bpy.types.register(TEXTURE_PT_wood)
742 bpy.types.register(TEXTURE_PT_marble)
743 bpy.types.register(TEXTURE_PT_magic)
744 bpy.types.register(TEXTURE_PT_blend)
745 bpy.types.register(TEXTURE_PT_stucci)
746 bpy.types.register(TEXTURE_PT_image)
747 bpy.types.register(TEXTURE_PT_image_sampling)
748 bpy.types.register(TEXTURE_PT_image_mapping)
749 bpy.types.register(TEXTURE_PT_plugin)
750 bpy.types.register(TEXTURE_PT_envmap)
751 bpy.types.register(TEXTURE_PT_musgrave)
752 bpy.types.register(TEXTURE_PT_voronoi)
753 bpy.types.register(TEXTURE_PT_distortednoise)
754 bpy.types.register(TEXTURE_PT_voxeldata)
755 bpy.types.register(TEXTURE_PT_pointdensity)
756 bpy.types.register(TEXTURE_PT_pointdensity_turbulence)
757
758 bpy.types.register(TEXTURE_PT_colors)
759 bpy.types.register(TEXTURE_PT_mapping)
760 bpy.types.register(TEXTURE_PT_influence)