[Bf-blender-cvs] [18f833be298] master: Additional fix for T76426: Mantaflow Liquid - Gravity not respecting Time Scale from domain.

Sebastián Barschkis noreply at git.blender.org
Fri May 8 13:11:47 CEST 2020


Commit: 18f833be2986c3432b28802a783c4ff5a10abafa
Author: Sebastián Barschkis
Date:   Fri May 8 13:11:23 2020 +0200
Branches: master
https://developer.blender.org/rB18f833be2986c3432b28802a783c4ff5a10abafa

Additional fix for T76426: Mantaflow Liquid - Gravity not respecting Time Scale from domain.

Removed time scale from another conversion factor. See also changes from 6400f54b4cc6.

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

M	intern/mantaflow/intern/strings/fluid_script.h

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

diff --git a/intern/mantaflow/intern/strings/fluid_script.h b/intern/mantaflow/intern/strings/fluid_script.h
index b237d782f09..922e591c001 100644
--- a/intern/mantaflow/intern/strings/fluid_script.h
+++ b/intern/mantaflow/intern/strings/fluid_script.h
@@ -118,7 +118,13 @@ using_diffusion_s$ID$    = $USING_DIFFUSION$\n\
 timeScale_s$ID$    = $TIME_SCALE$\n\
 timeTotal_s$ID$    = $TIME_TOTAL$\n\
 timePerFrame_s$ID$ = $TIME_PER_FRAME$\n\
-frameLength_s$ID$  = $FRAME_LENGTH$\n\
+\n\
+# In Blender fluid.c: frame_length = DT_DEFAULT * (25.0 / fps) * time_scale\n\
+# with DT_DEFAULT = 0.1\n\
+frameLength_s$ID$ = $FRAME_LENGTH$\n\
+frameLengthUnscaled_s$ID$  = frameLength_s$ID$ / timeScale_s$ID$\n\
+frameLengthRaw_s$ID$ = 0.1 * 25 # dt = 0.1 at 25 fps\n\
+\n\
 dt0_s$ID$          = $DT$\n\
 cflCond_s$ID$      = $CFL$\n\
 timestepsMin_s$ID$ = $TIMESTEPS_MIN$\n\
@@ -140,10 +146,10 @@ mantaMsg('1 Mantaflow cell is ' + str(ratioMetersToRes_s$ID$) + ' Blender length
 ratioResToBLength_s$ID$ = float(res_s$ID$) / float(domainSize_s$ID$) # [cells / blength] (blength: cm, m, or km, ... )\n\
 mantaMsg('1 Blender length unit is ' + str(ratioResToBLength_s$ID$) + ' Mantaflow cells long.')\n\
 \n\
-ratioBTimeToTimstep_s$ID$ = float(1) / float(0.1 * 25) # the time within 1 blender time unit, see also fluid.c\n\
+ratioBTimeToTimstep_s$ID$ = float(1) / float(frameLengthRaw_s$ID$) # the time within 1 blender time unit, see also fluid.c\n\
 mantaMsg('1 Blender time unit is ' + str(ratioBTimeToTimstep_s$ID$) + ' Mantaflow time units long.')\n\
 \n\
-ratioFrameToFramelength_s$ID$ = float(1) / float(frameLength_s$ID$) # the time within 1 frame\n\
+ratioFrameToFramelength_s$ID$ = float(1) / float(frameLengthUnscaled_s$ID$ ) # the time within 1 frame\n\
 mantaMsg('frame / frameLength is ' + str(ratioFrameToFramelength_s$ID$) + ' Mantaflow time units long.')\n\
 \n\
 scaleAcceleration_s$ID$ = ratioResToBLength_s$ID$ * (ratioBTimeToTimstep_s$ID$**2)# [meters/btime^2] to [cells/timestep^2] (btime: sec, min, or h, ...)\n\



More information about the Bf-blender-cvs mailing list