~ubuntu-branches/ubuntu/trusty/blender/trusty

« back to all changes in this revision

Viewing changes to release/scripts/startup/bl_ui/properties_physics_smoke.py

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-03-06 12:08:47 UTC
  • mfrom: (1.5.1) (14.1.8 experimental)
  • Revision ID: package-import@ubuntu.com-20130306120847-frjfaryb2zrotwcg
Tags: 2.66a-1ubuntu1
* Resynchronize with Debian (LP: #1076930, #1089256, #1052743, #999024,
  #1122888, #1147084)
* debian/control:
  - Lower build-depends on libavcodec-dev since we're not
    doing the libav9 transition in Ubuntu yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
import bpy
21
21
from bpy.types import Panel
22
22
 
23
 
from bl_ui.properties_physics_common import (
24
 
    point_cache_ui,
25
 
    effector_weights_ui,
26
 
    )
 
23
from bl_ui.properties_physics_common import (point_cache_ui,
 
24
                                             effector_weights_ui)
27
25
 
28
26
 
29
27
class PhysicButtonsPanel():
79
77
 
80
78
            flow = md.flow_settings
81
79
 
 
80
            layout.prop(flow, "smoke_flow_type", expand=False)
 
81
 
 
82
            if flow.smoke_flow_type != "OUTFLOW":
 
83
                split = layout.split()
 
84
                col = split.column()
 
85
                col.label(text="Flow Source:")
 
86
                col.prop(flow, "smoke_flow_source", expand=False, text="")
 
87
                if flow.smoke_flow_source == "PARTICLES":
 
88
                    col.label(text="Particle System:")
 
89
                    col.prop_search(flow, "particle_system", ob, "particle_systems", text="")
 
90
                else:
 
91
                    col.prop(flow, "surface_distance")
 
92
                    col.prop(flow, "volume_density")
 
93
 
 
94
                sub = col.column(align=True)
 
95
 
 
96
                sub.prop(flow, "initial_velocity")
 
97
                sub = sub.column()
 
98
                sub.active = flow.initial_velocity
 
99
                sub.prop(flow, "velocity_factor")
 
100
                if flow.smoke_flow_source == "MESH":
 
101
                    sub.prop(flow, "velocity_normal")
 
102
                    #sub.prop(flow, "velocity_random")
 
103
 
 
104
                sub = split.column()
 
105
                sub.label(text="Initial Values:")
 
106
                sub.prop(flow, "use_absolute")
 
107
                if flow.smoke_flow_type in {'SMOKE', 'BOTH'}:
 
108
                    sub.prop(flow, "density")
 
109
                    sub.prop(flow, "temperature")
 
110
                    sub.prop(flow, "smoke_color")
 
111
                if flow.smoke_flow_type in {'FIRE', 'BOTH'}:
 
112
                    sub.prop(flow, "fuel_amount")
 
113
 
 
114
        elif md.smoke_type == 'COLLISION':
 
115
            coll = md.coll_settings
 
116
 
82
117
            split = layout.split()
83
118
 
84
119
            col = split.column()
85
 
            col.prop(flow, "use_outflow")
86
 
            col.label(text="Particle System:")
87
 
            col.prop_search(flow, "particle_system", ob, "particle_systems", text="")
88
 
 
89
 
            sub = col.column()
90
 
            sub.active = not md.flow_settings.use_outflow
91
 
 
92
 
            sub.prop(flow, "initial_velocity", text="Initial Velocity")
93
 
            sub = sub.column()
94
 
            sub.active = flow.initial_velocity
95
 
            sub.prop(flow, "velocity_factor", text="Multiplier")
96
 
 
97
 
            sub = split.column()
98
 
            sub.active = not md.flow_settings.use_outflow
99
 
            sub.label(text="Initial Values:")
100
 
            sub.prop(flow, "use_absolute")
101
 
            sub.prop(flow, "density")
102
 
            sub.prop(flow, "temperature")
103
 
 
104
 
 
105
 
class PHYSICS_PT_smoke_groups(PhysicButtonsPanel, Panel):
106
 
    bl_label = "Smoke Groups"
107
 
    bl_options = {'DEFAULT_CLOSED'}
108
 
 
109
 
    @classmethod
110
 
    def poll(cls, context):
111
 
        md = context.smoke
112
 
        return md and (md.smoke_type == 'DOMAIN')
113
 
 
114
 
    def draw(self, context):
115
 
        layout = self.layout
116
 
 
117
 
        group = context.smoke.domain_settings
118
 
 
119
 
        split = layout.split()
120
 
 
121
 
        col = split.column()
122
 
        col.label(text="Flow Group:")
123
 
        col.prop(group, "fluid_group", text="")
124
 
 
125
 
        #col.label(text="Effector Group:")
126
 
        #col.prop(group, "effector_group", text="")
127
 
 
128
 
        col = split.column()
129
 
        col.label(text="Collision Group:")
130
 
        col.prop(group, "collision_group", text="")
 
120
            col.prop(coll, "collision_type")
 
121
 
 
122
 
 
123
class PHYSICS_PT_smoke_flow_advanced(PhysicButtonsPanel, Panel):
 
124
    bl_label = "Smoke Flow Advanced"
 
125
    bl_options = {'DEFAULT_CLOSED'}
 
126
 
 
127
    @classmethod
 
128
    def poll(cls, context):
 
129
        md = context.smoke
 
130
        return md and (md.smoke_type == 'FLOW') and (md.flow_settings.smoke_flow_source == "MESH")
 
131
 
 
132
    def draw(self, context):
 
133
        layout = self.layout
 
134
        ob = context.object
 
135
        flow = context.smoke.flow_settings
 
136
 
 
137
        split = layout.split()
 
138
        col = split.column()
 
139
 
 
140
        col.prop(flow, "use_texture")
 
141
        sub = col.column()
 
142
        sub.active = flow.use_texture
 
143
        sub.prop(flow, "noise_texture", text="")
 
144
        sub.label(text="Mapping:")
 
145
        sub.prop(flow, "texture_map_type", expand=False, text="")
 
146
        if flow.texture_map_type == "UV":
 
147
            sub.prop_search(flow, "uv_layer", ob.data, "uv_textures", text="")
 
148
        if flow.texture_map_type == "AUTO":
 
149
            sub.prop(flow, "texture_size")
 
150
        sub.prop(flow, "texture_offset")
 
151
 
 
152
        col = split.column()
 
153
        col.label(text="Vertex Group:")
 
154
        col.prop_search(flow, "density_vertex_group", ob, "vertex_groups", text="")
 
155
 
 
156
 
 
157
class PHYSICS_PT_smoke_fire(PhysicButtonsPanel, Panel):
 
158
    bl_label = "Smoke Flames"
 
159
    bl_options = {'DEFAULT_CLOSED'}
 
160
 
 
161
    @classmethod
 
162
    def poll(cls, context):
 
163
        md = context.smoke
 
164
        return md and (md.smoke_type == 'DOMAIN')
 
165
 
 
166
    def draw(self, context):
 
167
        layout = self.layout
 
168
        domain = context.smoke.domain_settings
 
169
 
 
170
        split = layout.split()
 
171
        split.enabled = not domain.point_cache.is_baked
 
172
 
 
173
        col = split.column(align=True)
 
174
        col.label(text="Reaction:")
 
175
        col.prop(domain, "burning_rate")
 
176
        col.prop(domain, "flame_smoke")
 
177
        col.prop(domain, "flame_vorticity")
 
178
 
 
179
        col = split.column(align=True)
 
180
        col.label(text="Temperatures:")
 
181
        col.prop(domain, "flame_ignition")
 
182
        col.prop(domain, "flame_max_temp")
 
183
        col.prop(domain, "flame_smoke_color")
 
184
 
 
185
 
 
186
class PHYSICS_PT_smoke_adaptive_domain(PhysicButtonsPanel, Panel):
 
187
    bl_label = "Smoke Adaptive Domain"
 
188
    bl_options = {'DEFAULT_CLOSED'}
 
189
 
 
190
    @classmethod
 
191
    def poll(cls, context):
 
192
        md = context.smoke
 
193
        return md and (md.smoke_type == 'DOMAIN')
 
194
 
 
195
    def draw_header(self, context):
 
196
        md = context.smoke.domain_settings
 
197
 
 
198
        self.layout.prop(md, "use_adaptive_domain", text="")
 
199
 
 
200
    def draw(self, context):
 
201
        layout = self.layout
 
202
 
 
203
        domain = context.smoke.domain_settings
 
204
        layout.active = domain.use_adaptive_domain
 
205
 
 
206
        split = layout.split()
 
207
        split.enabled = (not domain.point_cache.is_baked)
 
208
 
 
209
        col = split.column(align=True)
 
210
        col.label(text="Resolution:")
 
211
        col.prop(domain, "additional_res")
 
212
        col.prop(domain, "adapt_margin")
 
213
 
 
214
        col = split.column(align=True)
 
215
        col.label(text="Advanced:")
 
216
        col.prop(domain, "adapt_threshold")
131
217
 
132
218
 
133
219
class PHYSICS_PT_smoke_highres(PhysicButtonsPanel, Panel):
137
223
    @classmethod
138
224
    def poll(cls, context):
139
225
        md = context.smoke
140
 
        return md and (md.smoke_type == 'DOMAIN')
 
226
        rd = context.scene.render
 
227
        return md and (md.smoke_type == 'DOMAIN') and (not rd.use_game_engine)
141
228
 
142
229
    def draw_header(self, context):
143
230
        md = context.smoke.domain_settings
167
254
        layout.prop(md, "show_high_resolution")
168
255
 
169
256
 
 
257
class PHYSICS_PT_smoke_groups(PhysicButtonsPanel, Panel):
 
258
    bl_label = "Smoke Groups"
 
259
    bl_options = {'DEFAULT_CLOSED'}
 
260
 
 
261
    @classmethod
 
262
    def poll(cls, context):
 
263
        md = context.smoke
 
264
        rd = context.scene.render
 
265
        return md and (md.smoke_type == 'DOMAIN') and (not rd.use_game_engine)
 
266
 
 
267
    def draw(self, context):
 
268
        layout = self.layout
 
269
        domain = context.smoke.domain_settings
 
270
 
 
271
        split = layout.split()
 
272
 
 
273
        col = split.column()
 
274
        col.label(text="Flow Group:")
 
275
        col.prop(domain, "fluid_group", text="")
 
276
 
 
277
        #col.label(text="Effector Group:")
 
278
        #col.prop(domain, "effector_group", text="")
 
279
 
 
280
        col = split.column()
 
281
        col.label(text="Collision Group:")
 
282
        col.prop(domain, "collision_group", text="")
 
283
 
 
284
 
170
285
class PHYSICS_PT_smoke_cache(PhysicButtonsPanel, Panel):
171
286
    bl_label = "Smoke Cache"
172
287
    bl_options = {'DEFAULT_CLOSED'}
174
289
    @classmethod
175
290
    def poll(cls, context):
176
291
        md = context.smoke
177
 
        return md and (md.smoke_type == 'DOMAIN')
 
292
        rd = context.scene.render
 
293
        return md and (md.smoke_type == 'DOMAIN') and (not rd.use_game_engine)
178
294
 
179
295
    def draw(self, context):
180
296
        layout = self.layout
194
310
 
195
311
    @classmethod
196
312
    def poll(cls, context):
197
 
        smoke = context.smoke
198
 
        return (smoke and smoke.smoke_type == 'DOMAIN')
 
313
        md = context.smoke
 
314
        rd = context.scene.render
 
315
        return md and (md.smoke_type == 'DOMAIN') and (not rd.use_game_engine)
199
316
 
200
317
    def draw(self, context):
201
318
        domain = context.smoke.domain_settings
202
 
        effector_weights_ui(self, context, domain.effector_weights)
 
319
        effector_weights_ui(self, context, domain.effector_weights, 'SMOKE')
203
320
 
204
321
if __name__ == "__main__":  # only for live edit.
205
322
    bpy.utils.register_module(__name__)