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
path: root/source
diff options
context:
space:
mode:
authorSebastián Barschkis <sebbas@sebbas.org>2020-08-03 13:37:54 +0300
committerSebastián Barschkis <sebbas@sebbas.org>2020-08-03 13:38:07 +0300
commit33e6562a8a1ab84b0de92857dcd7decbffe3f263 (patch)
tree820027682f2264336ba1d924c454fa7ec66cfd9f /source
parentb5e345154057385100f40a31a513ece7ff3e244a (diff)
Fix T78266: Mantaflow: changing flow type (fire -> fire + smoke) resets Surface Emission
Changing the surface distance through the flow type is inappropriate here. It had been added to ensure that liquids / smoke use a different emission value. Now the value will only be changed when changing from a gas to a liquid emitter or, vice-versa, when changing from a liquid to a gas emitter.
Diffstat (limited to 'source')
-rw-r--r--source/blender/makesrna/intern/rna_fluid.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_fluid.c b/source/blender/makesrna/intern/rna_fluid.c
index ab8f97ae3c2..15169bc0088 100644
--- a/source/blender/makesrna/intern/rna_fluid.c
+++ b/source/blender/makesrna/intern/rna_fluid.c
@@ -1024,14 +1024,18 @@ static void rna_Fluid_flowtype_set(struct PointerRNA *ptr, int value)
FluidFlowSettings *settings = (FluidFlowSettings *)ptr->data;
if (value != settings->type) {
+ short prev_value = settings->type;
settings->type = value;
- /* Force flow source to mesh */
+ /* Force flow source to mesh for liquids.
+ * Also use different surface emission. Liquids should by default not emit around surface. */
if (value == FLUID_FLOW_TYPE_LIQUID) {
rna_Fluid_flowsource_set(ptr, FLUID_FLOW_SOURCE_MESH);
settings->surface_distance = 0.0f;
}
- else {
+ /* Use some surface emission when switching to a gas emitter. Gases should by default emit a
+ * bit around surface. */
+ if (prev_value == FLUID_FLOW_TYPE_LIQUID) {
settings->surface_distance = 1.5f;
}
}