diff options
author | Miika Hamalainen <blender@miikah.org> | 2012-08-10 20:44:39 +0400 |
---|---|---|
committer | Miika Hamalainen <blender@miikah.org> | 2012-08-10 20:44:39 +0400 |
commit | d9a60226b67de2fdf17b20b65cd619613a0a3607 (patch) | |
tree | c51e2eceea5597c6baca112584336764a3e7daf6 /release | |
parent | 35de87d10be269a76c1bfce2e685bc43544a6a04 (diff) |
* Some improvements to fire simulation code.
* It's now possible to set "flame rate" higher than 1.0. Higher rate basically means taller flame.
* More tweaking to "Quick Smoke" operator settings. Fire material is now also added by default even for smoke preset. -> You can now use quick smoke to easily setup a basic render settings that cover colored smoke and fire.
* Added settings to use a texture to define smoke flow "strength" for mesh emission. You can use automatically generated coordinates or UV layer.
* Fix: Adaptive domain bounds weren't drawn at all if smoke was uninitialized.
* Code cleanup.
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_operators/object_quick_effects.py | 48 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/properties_physics_smoke.py | 36 |
2 files changed, 60 insertions, 24 deletions
diff --git a/release/scripts/startup/bl_operators/object_quick_effects.py b/release/scripts/startup/bl_operators/object_quick_effects.py index 59ad0310f6d..7c4ad7f0dbe 100644 --- a/release/scripts/startup/bl_operators/object_quick_effects.py +++ b/release/scripts/startup/bl_operators/object_quick_effects.py @@ -359,6 +359,7 @@ class QuickSmoke(Operator): mat.type = 'VOLUME' mat.volume.density = 0 mat.volume.density_scale = 5 + mat.volume.step_size = 0.1 tex = bpy.data.textures.new("Smoke Density", 'VOXEL_DATA') tex.voxel_data.domain_object = obj @@ -369,30 +370,33 @@ class QuickSmoke(Operator): tex_slot.use_map_density = True tex_slot.use_map_color_reflection = True - # for fire add a second texture for emission and emission color - if self.style == 'FIRE': - mat.volume.emission_color = Vector((0.0, 0.0, 0.0)) - tex = bpy.data.textures.new("Flame", 'VOXEL_DATA') - tex.voxel_data.domain_object = obj - tex.voxel_data.smoke_data_type = 'SMOKEFLAME' - tex.use_color_ramp = True - - tex_slot = mat.texture_slots.add() - tex_slot.texture = tex - - ramp = tex.color_ramp - - elem = ramp.elements.new(0.333) - elem.color[0] = elem.color[3] = 1 - elem.color[1] = elem.color[2] = 0 + # for fire add a second texture for flame emission + mat.volume.emission_color = Vector((0.0, 0.0, 0.0)) + tex = bpy.data.textures.new("Flame", 'VOXEL_DATA') + tex.voxel_data.domain_object = obj + tex.voxel_data.smoke_data_type = 'SMOKEFLAME' + tex.use_color_ramp = True - elem = ramp.elements.new(0.666) - elem.color[0] = elem.color[1] = elem.color[3] = 1 - elem.color[2] = 0 + tex_slot = mat.texture_slots.add() + tex_slot.texture = tex - mat.texture_slots[1].use_map_density = True - mat.texture_slots[1].use_map_emission = True - mat.texture_slots[1].emission_factor = 5 + # add color ramp for flame color + ramp = tex.color_ramp + # dark orange + elem = ramp.elements.new(0.333) + elem.color[0] = 0.2 + elem.color[1] = 0.03 + elem.color[2] = 0 + elem.color[3] = 1 + # yellow glow + elem = ramp.elements.new(0.666) + elem.color[0] = elem.color[3] = 1 + elem.color[1] = 0.65 + elem.color[2] = 0.25 + + mat.texture_slots[1].use_map_density = True + mat.texture_slots[1].use_map_emission = True + mat.texture_slots[1].emission_factor = 5 return {'FINISHED'} diff --git a/release/scripts/startup/bl_ui/properties_physics_smoke.py b/release/scripts/startup/bl_ui/properties_physics_smoke.py index 408b1018b0b..8721d9e9465 100644 --- a/release/scripts/startup/bl_ui/properties_physics_smoke.py +++ b/release/scripts/startup/bl_ui/properties_physics_smoke.py @@ -91,7 +91,6 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel, Panel): col.prop_search(flow, "particle_system", ob, "particle_systems", text="") else: col.prop(flow, "surface_distance") - col.prop_search(flow, "density_vertex_group", ob, "vertex_groups", text="") col.prop(flow, "volume_density") sub = col.column(align=True) @@ -109,8 +108,8 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel, Panel): sub.prop(flow, "use_absolute") if flow.smoke_flow_type in {'SMOKE', 'BOTH'}: sub.prop(flow, "density") - sub.prop(flow, "smoke_color") sub.prop(flow, "temperature") + sub.prop(flow, "smoke_color") if flow.smoke_flow_type in {'FIRE', 'BOTH'}: sub.prop(flow, "fuel_amount") @@ -121,6 +120,39 @@ 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") + + 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" |