diff options
author | Daniel Genrich <daniel.genrich@gmx.net> | 2012-10-10 17:18:07 +0400 |
---|---|---|
committer | Daniel Genrich <daniel.genrich@gmx.net> | 2012-10-10 17:18:07 +0400 |
commit | cb634b910010c04543cb3361f7a16a261e5b9f89 (patch) | |
tree | 348403dcbd33baf2e6e9a7a5ef0bb57dd2e1b09d /release/scripts/startup/bl_ui/properties_physics_smoke.py | |
parent | f0a9b664694dacb0388a8e078d46753dc6a36352 (diff) |
Google Summer of Code project: "Smoke Simulator Improvements & Fire".
Documentation & Test blend files:
------------------
http://wiki.blender.org/index.php/User:MiikaH/GSoC-2012-Smoke-Simulator-Improvements
Credits:
------------------
Miika Hamalainen (MiikaH): Student / Main programmer
Daniel Genrich (Genscher): Mentor / Programmer of merged patches from Smoke2 branch
Google: For Google Summer of Code 2012
Diffstat (limited to 'release/scripts/startup/bl_ui/properties_physics_smoke.py')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_physics_smoke.py | 175 |
1 files changed, 138 insertions, 37 deletions
diff --git a/release/scripts/startup/bl_ui/properties_physics_smoke.py b/release/scripts/startup/bl_ui/properties_physics_smoke.py index acbaad4f961..ce5053f0ecf 100644 --- a/release/scripts/startup/bl_ui/properties_physics_smoke.py +++ b/release/scripts/startup/bl_ui/properties_physics_smoke.py @@ -76,28 +76,40 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel, Panel): elif md.smoke_type == 'FLOW': flow = md.flow_settings - - split = layout.split() - - col = split.column() - col.prop(flow, "use_outflow") - col.label(text="Particle System:") - col.prop_search(flow, "particle_system", ob, "particle_systems", text="") - - sub = col.column() - sub.active = not md.flow_settings.use_outflow - - sub.prop(flow, "initial_velocity", text="Initial Velocity") - sub = sub.column() - sub.active = flow.initial_velocity - sub.prop(flow, "velocity_factor", text="Multiplier") - - sub = split.column() - sub.active = not md.flow_settings.use_outflow - sub.label(text="Initial Values:") - sub.prop(flow, "use_absolute") - sub.prop(flow, "density") - sub.prop(flow, "temperature") + + layout.prop(flow, "smoke_flow_type", expand=False) + + if flow.smoke_flow_type != "OUTFLOW": + split = layout.split() + col = split.column() + col.label(text="Flow Source:") + col.prop(flow, "smoke_flow_source", expand=False, text="") + if flow.smoke_flow_source == "PARTICLES": + col.label(text="Particle System:") + col.prop_search(flow, "particle_system", ob, "particle_systems", text="") + else: + col.prop(flow, "surface_distance") + col.prop(flow, "volume_density") + + sub = col.column(align=True) + + sub.prop(flow, "initial_velocity") + sub = sub.column() + sub.active = flow.initial_velocity + sub.prop(flow, "velocity_factor") + if flow.smoke_flow_source == "MESH": + sub.prop(flow, "velocity_normal") + #sub.prop(flow, "velocity_random") + + sub = split.column() + sub.label(text="Initial Values:") + sub.prop(flow, "use_absolute") + if flow.smoke_flow_type in {'SMOKE', 'BOTH'}: + sub.prop(flow, "density") + sub.prop(flow, "temperature") + sub.prop(flow, "smoke_color") + if flow.smoke_flow_type in {'FIRE', 'BOTH'}: + sub.prop(flow, "fuel_amount") elif md.smoke_type == 'COLLISION': coll = md.coll_settings @@ -106,36 +118,99 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel, Panel): col = split.column() col.prop(coll, "collision_type") + +class PHYSICS_PT_smoke_flow_advanced(PhysicButtonsPanel, Panel): + bl_label = "Smoke Flow Advanced" + bl_options = {'DEFAULT_CLOSED'} + @classmethod + def poll(cls, context): + md = context.smoke + return md and (md.smoke_type == 'FLOW') and (md.flow_settings.smoke_flow_source == "MESH") -class PHYSICS_PT_smoke_groups(PhysicButtonsPanel, Panel): - bl_label = "Smoke Groups" + def draw(self, context): + layout = self.layout + ob = context.object + flow = context.smoke.flow_settings + + split = layout.split() + col = split.column() + + col.prop(flow, "use_texture") + sub = col.column() + sub.active = flow.use_texture + sub.prop(flow, "noise_texture", text="") + sub.label(text="Mapping:") + sub.prop(flow, "texture_map_type", expand=False, text="") + if flow.texture_map_type == "UV": + sub.prop_search(flow, "uv_layer", ob.data, "uv_textures", text="") + if flow.texture_map_type == "AUTO": + sub.prop(flow, "texture_size") + sub.prop(flow, "texture_offset") + + col = split.column() + col.label(text="Vertex Group:") + col.prop_search(flow, "density_vertex_group", ob, "vertex_groups", text="") + +class PHYSICS_PT_smoke_fire(PhysicButtonsPanel, Panel): + bl_label = "Smoke Flames" bl_options = {'DEFAULT_CLOSED'} @classmethod def poll(cls, context): md = context.smoke - rd = context.scene.render - return md and (md.smoke_type == 'DOMAIN') and (not rd.use_game_engine) + return md and (md.smoke_type == 'DOMAIN') def draw(self, context): layout = self.layout - - group = context.smoke.domain_settings + domain = context.smoke.domain_settings split = layout.split() + split.enabled = not domain.point_cache.is_baked + + col = split.column(align=True) + col.label(text="Reaction:") + col.prop(domain, "burning_rate") + col.prop(domain, "flame_smoke") + col.prop(domain, "flame_vorticity") + + col = split.column(align=True) + col.label(text="Temperatures:") + col.prop(domain, "flame_ignition") + col.prop(domain, "flame_max_temp") + col.prop(domain, "flame_smoke_color") + +class PHYSICS_PT_smoke_adaptive_domain(PhysicButtonsPanel, Panel): + bl_label = "Smoke Adaptive Domain" + bl_options = {'DEFAULT_CLOSED'} - col = split.column() - col.label(text="Flow Group:") - col.prop(group, "fluid_group", text="") + @classmethod + def poll(cls, context): + md = context.smoke + return md and (md.smoke_type == 'DOMAIN') - #col.label(text="Effector Group:") - #col.prop(group, "effector_group", text="") + def draw_header(self, context): + md = context.smoke.domain_settings - col = split.column() - col.label(text="Collision Group:") - col.prop(group, "collision_group", text="") + self.layout.prop(md, "use_adaptive_domain", text="") + def draw(self, context): + layout = self.layout + + domain = context.smoke.domain_settings + layout.active = domain.use_adaptive_domain + + split = layout.split() + split.enabled = not domain.point_cache.is_baked + + col = split.column(align=True) + col.label(text="Resolution:") + col.prop(domain, "additional_res") + col.prop(domain, "adapt_margin") + + col = split.column(align=True) + col.label(text="Advanced:") + col.prop(domain, "adapt_threshold") class PHYSICS_PT_smoke_highres(PhysicButtonsPanel, Panel): bl_label = "Smoke High Resolution" @@ -174,6 +249,32 @@ class PHYSICS_PT_smoke_highres(PhysicButtonsPanel, Panel): layout.prop(md, "show_high_resolution") +class PHYSICS_PT_smoke_groups(PhysicButtonsPanel, Panel): + bl_label = "Smoke Groups" + bl_options = {'DEFAULT_CLOSED'} + + @classmethod + def poll(cls, context): + md = context.smoke + rd = context.scene.render + return md and (md.smoke_type == 'DOMAIN') and (not rd.use_game_engine) + + def draw(self, context): + layout = self.layout + domain = context.smoke.domain_settings + + split = layout.split() + + col = split.column() + col.label(text="Flow Group:") + col.prop(domain, "fluid_group", text="") + + #col.label(text="Effector Group:") + #col.prop(domain, "effector_group", text="") + + col = split.column() + col.label(text="Collision Group:") + col.prop(domain, "collision_group", text="") class PHYSICS_PT_smoke_cache(PhysicButtonsPanel, Panel): bl_label = "Smoke Cache" @@ -209,7 +310,7 @@ class PHYSICS_PT_smoke_field_weights(PhysicButtonsPanel, Panel): def draw(self, context): domain = context.smoke.domain_settings - effector_weights_ui(self, context, domain.effector_weights) + effector_weights_ui(self, context, domain.effector_weights, 'SMOKE') if __name__ == "__main__": # only for live edit. bpy.utils.register_module(__name__) |