Smoke: decoupling of wavelet #2, new noise strength option on gui, fftw3 option in...
[blender.git] / release / ui / buttons_physics_smoke.py
1
2 import bpy
3
4 class PhysicButtonsPanel(bpy.types.Panel):
5         __space_type__ = "BUTTONS_WINDOW"
6         __region_type__ = "WINDOW"
7         __context__ = "physics"
8
9         def poll(self, context):
10                 ob = context.object
11                 rd = context.scene.render_data
12                 return (ob and ob.type == 'MESH') and (not rd.use_game_engine)
13                 
14 class PHYSICS_PT_smoke(PhysicButtonsPanel):
15         __label__ = "Smoke"
16
17         def draw(self, context):
18                 layout = self.layout
19                 
20                 md = context.smoke
21                 ob = context.object
22
23                 split = layout.split()
24                 split.operator_context = 'EXEC_DEFAULT'
25
26                 if md:
27                         # remove modifier + settings
28                         split.set_context_pointer("modifier", md)
29                         split.itemO("object.modifier_remove", text="Remove")
30
31                         row = split.row(align=True)
32                         row.itemR(md, "render", text="")
33                         row.itemR(md, "realtime", text="")
34                         
35                 else:
36                         # add modifier
37                         split.item_enumO("object.modifier_add", "type", 'SMOKE', text="Add")
38                         split.itemL()
39
40                 if md:
41                         layout.itemR(md, "smoke_type")
42                 
43                         if md.smoke_type == 'TYPE_DOMAIN':
44                                 split = layout.split()
45                                 
46                                 col = split.column()
47                                 col.itemL(text="Behavior:")
48                                 col.itemR(md.domain_settings, "alpha")
49                                 col.itemR(md.domain_settings, "beta")
50                                 
51                                 col.itemL(text="Resolution:")
52                                 col.itemR(md.domain_settings, "maxres", text="Low")
53                                 sub = col.column()
54                                 sub.active = md.domain_settings.highres
55                                 sub.itemR(md.domain_settings, "amplify", text="High")
56                                 col.itemR(md.domain_settings, "highres", text="Use High Resolution")
57                                 col.itemR(md.domain_settings, "strength")
58                                 
59                                 col = split.column()
60                                 col.itemL(text="Display:")
61                                 col.itemR(md.domain_settings, "visibility")
62                                 col.itemR(md.domain_settings, "color", slider=True)
63                                 sub = col.column()
64                                 sub.active = md.domain_settings.highres
65                                 sub.itemR(md.domain_settings, "viewhighres")
66                                 
67                                 layout.itemL(text="Noise Type:")
68                                 layout.itemR(md.domain_settings, "noise_type", expand=True)
69                                 
70                                 split = layout.split()
71                                 
72                                 col = split.column()
73                                 col.itemL(text="Flow Group:")
74                                 col.itemR(md.domain_settings, "fluid_group", text="")
75                                 
76                                 #col.itemL(text="Effector Group:")
77                                 #col.itemR(md.domain_settings, "eff_group", text="")
78                                 
79                                 col = split.column()
80                                 col.itemL(text="Collision Group:")
81                                 col.itemR(md.domain_settings, "coll_group", text="")
82                                 
83                         elif md.smoke_type == 'TYPE_FLOW':
84                                 split = layout.split()
85                                 
86                                 col = split.column()
87                                 col.itemR(md.flow_settings, "outflow")
88                                 col.itemL(text="Particle System:")
89                                 col.item_pointerR(md.flow_settings, "psys", ob, "particle_systems", text="")
90                                 
91                                 if md.flow_settings.outflow:                            
92                                         col = split.column()
93                                 else:
94                                         col = split.column()
95                                         col.itemL(text="Behavior:")
96                                         col.itemR(md.flow_settings, "temperature")
97                                         col.itemR(md.flow_settings, "density")
98                                         
99                         #elif md.smoke_type == 'TYPE_COLL':
100                         #       layout.itemS()
101
102 bpy.types.register(PHYSICS_PT_smoke)