[Bf-blender-cvs] [1cbac79] fluid-mantaflow: added liquid flags / adapted settings to handle smoke
SebastiaÌn Barschkis
noreply at git.blender.org
Thu Jun 2 23:03:51 CEST 2016
Commit: 1cbac79a1ead1ef7bb128079cd4dfcd076e6708f
Author: Sebastián Barschkis
Date: Thu Jun 2 22:16:33 2016 +0200
Branches: fluid-mantaflow
https://developer.blender.org/rB1cbac79a1ead1ef7bb128079cd4dfcd076e6708f
added liquid flags / adapted settings to handle smoke
===================================================================
M source/blender/blenkernel/intern/smoke.c
M source/blender/makesdna/DNA_smoke_types.h
M source/blender/makesrna/intern/rna_smoke.c
===================================================================
diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c
index 8888b5e..d89b40a 100644
--- a/source/blender/blenkernel/intern/smoke.c
+++ b/source/blender/blenkernel/intern/smoke.c
@@ -2355,16 +2355,20 @@ static void update_flowsfluids(Scene *scene, Object *ob, SmokeDomainSettings *sd
/* update required data fields */
if (em->total_cells && sfs->type != MOD_SMOKE_FLOW_TYPE_OUTFLOW) {
+ /* activate liquid field. cannot be combined with anything else */
+ if (sfs->type == MOD_SMOKE_FLOW_TYPE_LIQUID) {
+ active_fields |= SM_ACTIVE_LIQUID;
+ }
/* activate heat field if flow produces any heat */
- if (sfs->temp) {
+ if (sfs->temp && sfs->type != MOD_SMOKE_FLOW_TYPE_LIQUID) {
active_fields |= SM_ACTIVE_HEAT;
}
/* activate fuel field if flow adds any fuel */
- if (sfs->type != MOD_SMOKE_FLOW_TYPE_SMOKE && sfs->fuel_amount) {
+ if (sfs->type != MOD_SMOKE_FLOW_TYPE_SMOKE && sfs->type != MOD_SMOKE_FLOW_TYPE_LIQUID && sfs->fuel_amount) {
active_fields |= SM_ACTIVE_FIRE;
}
/* activate color field if flows add smoke with varying colors */
- if (sfs->type != MOD_SMOKE_FLOW_TYPE_FIRE && sfs->density) {
+ if (sfs->type != MOD_SMOKE_FLOW_TYPE_FIRE && sfs->type != MOD_SMOKE_FLOW_TYPE_LIQUID && sfs->density) {
if (!(active_fields & SM_ACTIVE_COLOR_SET)) {
copy_v3_v3(sds->active_color, sfs->color);
active_fields |= SM_ACTIVE_COLOR_SET;
diff --git a/source/blender/makesdna/DNA_smoke_types.h b/source/blender/makesdna/DNA_smoke_types.h
index 01114fb..ec0a8bc 100644
--- a/source/blender/makesdna/DNA_smoke_types.h
+++ b/source/blender/makesdna/DNA_smoke_types.h
@@ -77,6 +77,7 @@ enum {
#define SM_ACTIVE_FIRE (1<<1)
#define SM_ACTIVE_COLORS (1<<2)
#define SM_ACTIVE_COLOR_SET (1<<3)
+#define SM_ACTIVE_LIQUID (1<<4)
enum {
VDB_COMPRESSION_BLOSC = 0,
@@ -180,6 +181,7 @@ typedef struct SmokeDomainSettings {
#define MOD_SMOKE_FLOW_TYPE_FIRE 1
#define MOD_SMOKE_FLOW_TYPE_OUTFLOW 2
#define MOD_SMOKE_FLOW_TYPE_SMOKEFIRE 3
+#define MOD_SMOKE_FLOW_TYPE_LIQUID 4
/* flow source */
#define MOD_SMOKE_FLOW_SOURCE_PARTICLES 0
@@ -223,7 +225,7 @@ typedef struct SmokeFlowSettings {
char uvlayer_name[64]; /* MAX_CUSTOMDATA_LAYER_NAME */
short vgroup_density;
- short type; /* smoke, flames, both, outflow */
+ short type; /* smoke, flames, both, outflow, liquid */
short source;
short texture_type;
int flags; /* absolute emission etc*/
diff --git a/source/blender/makesrna/intern/rna_smoke.c b/source/blender/makesrna/intern/rna_smoke.c
index c7332f3..aa3e712 100644
--- a/source/blender/makesrna/intern/rna_smoke.c
+++ b/source/blender/makesrna/intern/rna_smoke.c
@@ -765,6 +765,7 @@ static void rna_def_smoke_flow_settings(BlenderRNA *brna)
{MOD_SMOKE_FLOW_TYPE_SMOKE, "SMOKE", 0, "Smoke", "Add smoke"},
{MOD_SMOKE_FLOW_TYPE_SMOKEFIRE, "BOTH", 0, "Fire + Smoke", "Add fire and smoke"},
{MOD_SMOKE_FLOW_TYPE_FIRE, "FIRE", 0, "Fire", "Add fire"},
+ {MOD_SMOKE_FLOW_TYPE_LIQUID, "LIQUID", 0, "Liquid", "Add liquid"},
{0, NULL, 0, NULL, NULL}
};
More information about the Bf-blender-cvs
mailing list