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:
authorDalai Felinto <dfelinto@gmail.com>2018-08-14 21:58:16 +0300
committerDalai Felinto <dfelinto@gmail.com>2018-08-14 22:07:52 +0300
commitb2966b70fe9f3cf76af52800e88fbb9395b44077 (patch)
tree309443b49718f660179a4e056b168fc10018fc00 /source/blender/draw/engines/eevee/eevee_volumes.c
parent37f6a26e742d54e3d366289397f0598e1ef1f770 (diff)
EEVEE: Volumes - get current frame from depsgraph
The value from scene is not up to date at all times.
Diffstat (limited to 'source/blender/draw/engines/eevee/eevee_volumes.c')
-rw-r--r--source/blender/draw/engines/eevee/eevee_volumes.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_volumes.c b/source/blender/draw/engines/eevee/eevee_volumes.c
index f8bb8c6f1cf..b729c53628f 100644
--- a/source/blender/draw/engines/eevee/eevee_volumes.c
+++ b/source/blender/draw/engines/eevee/eevee_volumes.c
@@ -458,6 +458,8 @@ void EEVEE_volumes_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
void EEVEE_volumes_cache_object_add(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, Scene *scene, Object *ob)
{
+ const DRWContextState *draw_ctx = DRW_context_state_get();
+
float *texcoloc = NULL;
float *texcosize = NULL;
struct ModifierData *md = NULL;
@@ -501,7 +503,7 @@ void EEVEE_volumes_cache_object_add(EEVEE_ViewLayerData *sldata, EEVEE_Data *ved
SmokeModifierData *smd = (SmokeModifierData *)md;
SmokeDomainSettings *sds = smd->domain;
/* Don't show smoke before simulation starts, this could be made an option in the future. */
- const bool show_smoke = (CFRA >= sds->point_cache[0]->startframe);
+ const bool show_smoke = ((int)DEG_get_ctime(draw_ctx->depsgraph) >= sds->point_cache[0]->startframe);
if (sds->fluid && show_smoke) {
if (!sds->wt || !(sds->viewsettings & MOD_SMOKE_VIEW_SHOWBIG)) {