Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'release/scripts/startup/bl_operators/object_quick_effects.py')
-rw-r--r--release/scripts/startup/bl_operators/object_quick_effects.py67
1 files changed, 30 insertions, 37 deletions
diff --git a/release/scripts/startup/bl_operators/object_quick_effects.py b/release/scripts/startup/bl_operators/object_quick_effects.py
index 35b496b6dd0..cd0b63a6b78 100644
--- a/release/scripts/startup/bl_operators/object_quick_effects.py
+++ b/release/scripts/startup/bl_operators/object_quick_effects.py
@@ -299,7 +299,6 @@ class QuickSmoke(Operator):
style = EnumProperty(
name="Smoke Style",
items=(('STREAM', "Stream", ""),
- ('PUFF', "Puff", ""),
('FIRE', "Fire", ""),
),
default='STREAM',
@@ -328,20 +327,9 @@ class QuickSmoke(Operator):
bpy.ops.object.modifier_add(fake_context, type='SMOKE')
obj.modifiers[-1].smoke_type = 'FLOW'
- psys = obj.particle_systems[-1]
- if self.style == 'PUFF':
- psys.settings.frame_end = psys.settings.frame_start
- psys.settings.emit_from = 'VOLUME'
- psys.settings.distribution = 'RAND'
- elif self.style == 'FIRE':
- psys.settings.effector_weights.gravity = -1
- psys.settings.lifetime = 5
- psys.settings.count = 100000
-
- obj.modifiers[-2].flow_settings.initial_velocity = True
- obj.modifiers[-2].flow_settings.temperature = 2
-
- psys.settings.use_render_emitter = self.show_flows
+ if self.style == 'FIRE':
+ obj.modifiers[-1].flow_settings.smoke_flow_type = 'FIRE'
+
if not self.show_flows:
obj.draw_type = 'WIRE'
@@ -361,8 +349,6 @@ class QuickSmoke(Operator):
bpy.ops.object.modifier_add(type='SMOKE')
obj.modifiers[-1].smoke_type = 'DOMAIN'
if self.style == 'FIRE':
- obj.modifiers[-1].domain_settings.use_dissolve_smoke = True
- obj.modifiers[-1].domain_settings.dissolve_speed = 20
obj.modifiers[-1].domain_settings.use_high_resolution = True
# create a volume material with a voxel data texture for the domain
@@ -373,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
@@ -381,29 +368,35 @@ class QuickSmoke(Operator):
tex_slot.texture = tex
tex_slot.use_map_color_emission = False
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 = 5
- tex = bpy.data.textures.new("Smoke Heat", 'VOXEL_DATA')
- tex.voxel_data.domain_object = obj
- 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_emission = True
- mat.texture_slots[1].blend_type = 'MULTIPLY'
+ # 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'}