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:
authorSebastián Barschkis <sebbas@sebbas.org>2020-05-08 14:11:23 +0300
committerSebastián Barschkis <sebbas@sebbas.org>2020-05-08 14:11:39 +0300
commit18f833be2986c3432b28802a783c4ff5a10abafa (patch)
tree8103233dd3e28fb84594bd4d1e68972bf504ee9f /intern/mantaflow
parentd9a9e64e8cb0b7c15fc310dc0f286f593f7c5801 (diff)
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.
Diffstat (limited to 'intern/mantaflow')
-rw-r--r--intern/mantaflow/intern/strings/fluid_script.h12
1 files changed, 9 insertions, 3 deletions
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\