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:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2014-03-29 16:03:48 +0400
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2014-03-29 16:03:48 +0400
commit691c4c17ad2f4b4e043f0961211ac90ca1656a8f (patch)
tree1e0ab0f0a2987748b1838af18182539eba970656 /intern/cycles/blender/blender_util.h
parent27043b8e40f74c8b0917850d1aefbd6315fa46a5 (diff)
Cycles: add "density", "flame" and "color" attributes for smoke domains.
These can currently be accessed by adding an Attribute node and specifying one of those three names. A Smoke/Fire node should be added at some point to make this more convenient. These values might change still before the release, in particular for flame the meaning seems unclear, it's just values in the 0..1 range. This is useful for color ramps, but it might be good if this was also available as temperature in kelvin so it can be plugged into the blackbody node. But I couldn't figure out from the smoke code if or how this corresponds to a physical unit. Here's a (quite poor) example file for a fire + smoke setup: http://www.pasteall.org/blend/27990
Diffstat (limited to 'intern/cycles/blender/blender_util.h')
-rw-r--r--intern/cycles/blender/blender_util.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/intern/cycles/blender/blender_util.h b/intern/cycles/blender/blender_util.h
index bea5ee49bf4..45ca0e17550 100644
--- a/intern/cycles/blender/blender_util.h
+++ b/intern/cycles/blender/blender_util.h
@@ -168,6 +168,11 @@ static inline float4 get_float4(BL::Array<float, 4> array)
return make_float4(array[0], array[1], array[2], array[3]);
}
+static inline int3 get_int3(BL::Array<int, 3> array)
+{
+ return make_int3(array[0], array[1], array[2]);
+}
+
static inline int4 get_int4(BL::Array<int, 4> array)
{
return make_int4(array[0], array[1], array[2], array[3]);
@@ -371,6 +376,22 @@ static inline bool object_use_deform_motion(BL::Object b_ob)
return use_deform_motion;
}
+static inline BL::SmokeDomainSettings object_smoke_domain_find(BL::Object b_ob)
+{
+ BL::Object::modifiers_iterator b_mod;
+
+ for(b_ob.modifiers.begin(b_mod); b_mod != b_ob.modifiers.end(); ++b_mod) {
+ if (b_mod->is_a(&RNA_SmokeModifier)) {
+ BL::SmokeModifier b_smd(*b_mod);
+
+ if(b_smd.smoke_type() == BL::SmokeModifier::smoke_type_DOMAIN)
+ return b_smd.domain_settings();
+ }
+ }
+
+ return BL::SmokeDomainSettings(PointerRNA_NULL);
+}
+
/* ID Map
*
* Utility class to keep in sync with blender data.