From de55ae56ae5d871b5bc7fa6383c90ef89d66fcd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Thu, 5 Jul 2018 16:23:35 +0200 Subject: Ocean Modifier: refactored the delayed-refresh approach The approach of setting 'refresh' flags on the modifier, and performing the associated actions when the modifier is being evaluated, is a bad one. Instead, we use the separation of the original and the evaluated copy to 'refresh' certain things (because they simply aren't set at all on the original). Other actions are now done directly with BKE_ocean_xxx functions on the original data, intead of during evaluation. --- source/blender/blenkernel/intern/ocean.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/blender/blenkernel/intern/ocean.c') diff --git a/source/blender/blenkernel/intern/ocean.c b/source/blender/blenkernel/intern/ocean.c index 7f3f916964a..98dd59aca61 100644 --- a/source/blender/blenkernel/intern/ocean.c +++ b/source/blender/blenkernel/intern/ocean.c @@ -36,6 +36,7 @@ #include "MEM_guardedalloc.h" +#include "DNA_modifier_types.h" #include "DNA_scene_types.h" #include "BLI_math.h" @@ -1512,3 +1513,10 @@ void BKE_ocean_bake(struct Ocean *UNUSED(o), struct OceanCache *UNUSED(och), (void)update_cb; } #endif /* WITH_OCEANSIM */ + +void BKE_ocean_free_modifier_cache(struct OceanModifierData *omd) +{ + BKE_ocean_free_cache(omd->oceancache); + omd->oceancache = NULL; + omd->cached = false; +} -- cgit v1.2.3