diff options
author | Sebastián Barschkis <sebbas@sebbas.org> | 2020-11-03 15:21:07 +0300 |
---|---|---|
committer | Sebastián Barschkis <sebbas@sebbas.org> | 2020-11-03 15:21:07 +0300 |
commit | df2a0cd6f419c5b359c29d2aa149f864629c304e (patch) | |
tree | 8210d0820decee40ba3b8cf0d0e8375a0fa2597e /source/blender/draw/engines/overlay | |
parent | fc9f1b1754bbafa262f875969f7e1bb2554802a3 (diff) |
Fluid: Fix crash with viewport display options
Overlay extras should not be drawn outside of the fluid domain cache range.
Diffstat (limited to 'source/blender/draw/engines/overlay')
-rw-r--r-- | source/blender/draw/engines/overlay/overlay_extra.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/draw/engines/overlay/overlay_extra.c b/source/blender/draw/engines/overlay/overlay_extra.c index 09061450a1a..adb0dc22e16 100644 --- a/source/blender/draw/engines/overlay/overlay_extra.c +++ b/source/blender/draw/engines/overlay/overlay_extra.c @@ -1586,10 +1586,13 @@ void OVERLAY_extra_cache_populate(OVERLAY_Data *vedata, Object *ob) const bool draw_xform = draw_ctx->object_mode == OB_MODE_OBJECT && (scene->toolsettings->transform_flag & SCE_XFORM_DATA_ORIGIN) && (ob->base_flag & BASE_SELECTED) && !is_select_mode; + /* Don't show fluid domain overlay extras outside of cache range. */ const bool draw_volume = !from_dupli && (md = BKE_modifiers_findby_type(ob, eModifierType_Fluid)) && (BKE_modifier_is_enabled(scene, md, eModifierMode_Realtime)) && - (((FluidModifierData *)md)->domain != NULL); + (((FluidModifierData *)md)->domain != NULL) && + (CFRA >= (((FluidModifierData *)md)->domain->cache_frame_start)) && + (CFRA <= (((FluidModifierData *)md)->domain->cache_frame_end)); float *color; int theme_id = DRW_object_wire_theme_get(ob, view_layer, &color); |