[Bf-blender-cvs] [7b12c56] master: Some updates for Quick Smoke / Cycles.

Thomas Dinges noreply at git.blender.org
Sun Sep 7 15:27:43 CEST 2014


Commit: 7b12c569d4964e523c28a508625b8f62f63f7f26
Author: Thomas Dinges
Date:   Sun Sep 7 15:26:12 2014 +0200
Branches: master
https://developer.blender.org/rB7b12c569d4964e523c28a508625b8f62f63f7f26

Some updates for Quick Smoke / Cycles.

* Add Density multiplier.
* Use Smoke color attribute.

Patch by Gottfried Hofmann, with some small tweaks by myself.
Differential revision: https://developer.blender.org/D776

===================================================================

M	release/scripts/startup/bl_operators/object_quick_effects.py

===================================================================

diff --git a/release/scripts/startup/bl_operators/object_quick_effects.py b/release/scripts/startup/bl_operators/object_quick_effects.py
index 79e6811..86cab3b 100644
--- a/release/scripts/startup/bl_operators/object_quick_effects.py
+++ b/release/scripts/startup/bl_operators/object_quick_effects.py
@@ -405,15 +405,32 @@ class QuickSmoke(Operator):
             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(2, 2)
+            node_attrib_density.location = grid_location(1, 2)
             links.new(node_attrib_density.outputs["Fac"],
-                    node_scatter.inputs["Density"])
-            links.new(node_attrib_density.outputs["Fac"],
-                    node_absorption.inputs["Density"])
+                    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




More information about the Bf-blender-cvs mailing list