[Bf-blender-cvs] [f1498967617] fluid-mantaflow: changes for quick smoke cycles node setup and minor bug fixes
Sebastián Barschkis
noreply at git.blender.org
Tue Oct 24 19:46:38 CEST 2017
Commit: f14989676175dd3573f99794b6baf7af1daee594
Author: Sebastián Barschkis
Date: Tue Oct 24 19:46:25 2017 +0200
Branches: fluid-mantaflow
https://developer.blender.org/rBf14989676175dd3573f99794b6baf7af1daee594
changes for quick smoke cycles node setup and minor bug fixes
with quick smoke, the cycles setup for fire was unreachable (why?) -> removed the if-clause. also fixed minor bugs (UI Quick Liquid, copy settings for effector object)
===================================================================
M intern/mantaflow/intern/strings/liquid_script.h
M intern/mantaflow/intern/strings/smoke_script.h
M release/scripts/startup/bl_operators/object_quick_effects.py
M source/blender/blenkernel/intern/smoke.c
===================================================================
diff --git a/intern/mantaflow/intern/strings/liquid_script.h b/intern/mantaflow/intern/strings/liquid_script.h
index b59416247ff..f6f6a5cbce3 100644
--- a/intern/mantaflow/intern/strings/liquid_script.h
+++ b/intern/mantaflow/intern/strings/liquid_script.h
@@ -281,7 +281,7 @@ def liquid_step_$ID$():\n\
mantaMsg('Extrapolating guiding velocity')\n\
# ensure velocities inside of guiding object, slightly add guiding vels outside of object too\n\
extrapolateVec3Simple(vel=guidevelC_s$ID$, phi=phiGuideIn_s$ID$, distance=int(res_s$ID$/2), inside=True)\n\
- extrapolateVec3Simple(vel=guidevelC_s$ID$, phi=phiGuideIn_s$ID$, distance=1, inside=False)\n\
+ extrapolateVec3Simple(vel=guidevelC_s$ID$, phi=phiGuideIn_s$ID$, distance=4, inside=False)\n\
resampleVec3ToMac(source=guidevelC_s$ID$, target=guidevel_s$ID$)\n\
\n\
extrapolateMACSimple(flags=flags_s$ID$, vel=vel_s$ID$, distance=2, phiObs=phiObs_s$ID$, intoObs=True)\n\
diff --git a/intern/mantaflow/intern/strings/smoke_script.h b/intern/mantaflow/intern/strings/smoke_script.h
index cce26e718f8..1362e617f23 100644
--- a/intern/mantaflow/intern/strings/smoke_script.h
+++ b/intern/mantaflow/intern/strings/smoke_script.h
@@ -337,7 +337,7 @@ def step_low_$ID$():\n\
mantaMsg('Extrapolating guiding velocity')\n\
# ensure velocities inside of guiding object, slightly add guiding vels outside of object too\n\
extrapolateVec3Simple(vel=guidevelC_s$ID$, phi=phiGuideIn_s$ID$, distance=int(res_s$ID$/2), inside=True)\n\
- extrapolateVec3Simple(vel=guidevelC_s$ID$, phi=phiGuideIn_s$ID$, distance=1, inside=False)\n\
+ extrapolateVec3Simple(vel=guidevelC_s$ID$, phi=phiGuideIn_s$ID$, distance=4, inside=False)\n\
resampleVec3ToMac(source=guidevelC_s$ID$, target=guidevel_s$ID$)\n\
\n\
# add initial velocity\n\
diff --git a/release/scripts/startup/bl_operators/object_quick_effects.py b/release/scripts/startup/bl_operators/object_quick_effects.py
index 6d05822b044..8bceae9559f 100644
--- a/release/scripts/startup/bl_operators/object_quick_effects.py
+++ b/release/scripts/startup/bl_operators/object_quick_effects.py
@@ -307,7 +307,6 @@ class QuickSmoke(Operator):
items=(('SMOKE', "Smoke", ""),
('FIRE', "Fire", ""),
('BOTH', "Smoke + Fire", ""),
- ('LIQUID', "Liquid", ""),
),
default='SMOKE',
)
@@ -360,8 +359,6 @@ class QuickSmoke(Operator):
# setup smoke domain
bpy.ops.object.modifier_add(type='SMOKE')
obj.modifiers[-1].smoke_type = 'DOMAIN'
- if self.style == 'FIRE' or self.style == 'BOTH':
- obj.modifiers[-1].domain_settings.use_high_resolution = True
# set correct cache file format for smoke
obj.modifiers[-1].domain_settings.use_surface_cache = False
@@ -399,96 +396,92 @@ class QuickSmoke(Operator):
links.new(node_add_shader_1.outputs["Shader"],
node_out.inputs["Volume"])
- if self.style in {'SMOKE', 'FIRE', 'BOTH'}:
- # Smoke
-
- # Add shader 2
- node_add_shader_2 = nodes.new(type='ShaderNodeAddShader')
- node_add_shader_2.location = grid_location(4, 2)
- links.new(node_add_shader_2.outputs["Shader"],
- node_add_shader_1.inputs[0])
-
- # Volume scatter
- node_scatter = nodes.new(type='ShaderNodeVolumeScatter')
- node_scatter.location = grid_location(3, 3)
- links.new(node_scatter.outputs["Volume"],
- node_add_shader_2.inputs[0])
-
- # Volume absorption
- node_absorption = nodes.new(type='ShaderNodeVolumeAbsorption')
- node_absorption.location = grid_location(3, 2)
- links.new(node_absorption.outputs["Volume"],
- node_add_shader_2.inputs[1])
-
- # Density Multiplier
- node_densmult = nodes.new(type='ShaderNodeMath')
- node_densmult.location = grid_location(2, 2)
- node_densmult.operation = 'MULTIPLY'
- node_densmult.inputs[1].default_value = 5.0
- links.new(node_densmult.outputs["Value"],
- node_scatter.inputs["Density"])
- links.new(node_densmult.outputs["Value"],
- node_absorption.inputs["Density"])
-
- # Attribute "density"
- node_attrib_density = nodes.new(type='ShaderNodeAttribute')
- node_attrib_density.attribute_name = "density"
- node_attrib_density.location = grid_location(1, 2)
- links.new(node_attrib_density.outputs["Fac"],
- node_densmult.inputs[0])
-
- # Attribute "color"
- node_attrib_color = nodes.new(type='ShaderNodeAttribute')
- node_attrib_color.attribute_name = "color"
- node_attrib_color.location = grid_location(2, 3)
- links.new(node_attrib_color.outputs["Color"],
- node_scatter.inputs["Color"])
- links.new(node_attrib_color.outputs["Color"],
- node_absorption.inputs["Color"])
-
- if self.style in {'FIRE', 'BOTH'}:
- # Fire
-
- # Emission
- node_emission = nodes.new(type='ShaderNodeEmission')
- node_emission.inputs["Color"].default_value = (0.8, 0.1, 0.01, 1.0)
- node_emission.location = grid_location(4, 1)
- links.new(node_emission.outputs["Emission"],
- node_add_shader_1.inputs[1])
-
- # Flame strength multiplier
- node_flame_strength_mult = nodes.new(type='ShaderNodeMath')
- node_flame_strength_mult.location = grid_location(3, 1)
- node_flame_strength_mult.operation = 'MULTIPLY'
- node_flame_strength_mult.inputs[1].default_value = 2.5
- links.new(node_flame_strength_mult.outputs["Value"],
- node_emission.inputs["Strength"])
-
- # Color ramp Flame
- node_flame_ramp = nodes.new(type='ShaderNodeValToRGB')
- node_flame_ramp.location = grid_location(1, 1)
- ramp = node_flame_ramp.color_ramp
- ramp.interpolation = 'EASE'
-
- # orange
- elem = ramp.elements.new(0.5)
- elem.color = (1.0, 0.128, 0.0, 1.0)
-
- # yellow
- elem = ramp.elements.new(0.9)
- elem.color = (0.9, 0.6, 0.1, 1.0)
-
- links.new(node_flame_ramp.outputs["Color"],
- node_emission.inputs["Color"])
-
- # Attribute "flame"
- node_attrib_flame = nodes.new(type='ShaderNodeAttribute')
- node_attrib_flame.attribute_name = "flame"
- node_attrib_flame.location = grid_location(0, 1)
- links.new(node_attrib_flame.outputs["Fac"],
- node_flame_ramp.inputs["Fac"])
- links.new(node_attrib_flame.outputs["Fac"],
- node_flame_strength_mult.inputs[0])
+ # Smoke
+ # Add shader 2
+ node_add_shader_2 = nodes.new(type='ShaderNodeAddShader')
+ node_add_shader_2.location = grid_location(4, 2)
+ links.new(node_add_shader_2.outputs["Shader"],
+ node_add_shader_1.inputs[0])
+
+ # Volume scatter
+ node_scatter = nodes.new(type='ShaderNodeVolumeScatter')
+ node_scatter.location = grid_location(3, 3)
+ links.new(node_scatter.outputs["Volume"],
+ node_add_shader_2.inputs[0])
+
+ # Volume absorption
+ node_absorption = nodes.new(type='ShaderNodeVolumeAbsorption')
+ node_absorption.location = grid_location(3, 2)
+ links.new(node_absorption.outputs["Volume"],
+ node_add_shader_2.inputs[1])
+
+ # Density Multiplier
+ node_densmult = nodes.new(type='ShaderNodeMath')
+ node_densmult.location = grid_location(2, 2)
+ node_densmult.operation = 'MULTIPLY'
+ node_densmult.inputs[1].default_value = 5.0
+ links.new(node_densmult.outputs["Value"],
+ node_scatter.inputs["Density"])
+ links.new(node_densmult.outputs["Value"],
+ node_absorption.inputs["Density"])
+
+ # Attribute "density"
+ node_attrib_density = nodes.new(type='ShaderNodeAttribute')
+ node_attrib_density.attribute_name = "density"
+ node_attrib_density.location = grid_location(1, 2)
+ links.new(node_attrib_density.outputs["Fac"],
+ node_densmult.inputs[0])
+
+ # Attribute "color"
+ node_attrib_color = nodes.new(type='ShaderNodeAttribute')
+ node_attrib_color.attribute_name = "color"
+ node_attrib_color.location = grid_location(2, 3)
+ links.new(node_attrib_color.outputs["Color"],
+ node_scatter.inputs["Color"])
+ links.new(node_attrib_color.outputs["Color"],
+ node_absorption.inputs["Color"])
+
+ # Fire
+ # Emission
+ node_emission = nodes.new(type='ShaderNodeEmission')
+ node_emission.inputs["Color"].default_value = (0.8, 0.1, 0.01, 1.0)
+ node_emission.location = grid_location(4, 1)
+ links.new(node_emission.outputs["Emission"],
+ node_add_shader_1.inputs[1])
+
+ # Flame strength multiplier
+ node_flame_strength_mult = nodes.new(type='ShaderNodeMath')
+ node_flame_strength_mult.location = grid_location(3, 1)
+ node_flame_strength_mult.operation = 'MULTIPLY'
+ node_flame_strength_mult.inputs[1].default_value = 2.5
+ links.new(node_flame_strength_
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list