From 452b896f2d88779260778543fc3951e70a4a0eae Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Mon, 3 Aug 2020 15:33:32 -0400 Subject: Ocean Modifier: Fix render resolution only used for baking The modifier needs to check that the cached ocean has the correct resolution. --- source/blender/blenkernel/intern/ocean.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (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 0e811769f79..198ff5a0540 100644 --- a/source/blender/blenkernel/intern/ocean.c +++ b/source/blender/blenkernel/intern/ocean.c @@ -756,7 +756,13 @@ struct Ocean *BKE_ocean_add(void) bool BKE_ocean_ensure(struct OceanModifierData *omd, const int resolution) { if (omd->ocean) { - return false; + /* Check that the ocean has the same resolution than we want now. */ + if (omd->ocean->_M == resolution * resolution) { + return false; + } + else { + BKE_ocean_free(omd->ocean); + } } omd->ocean = BKE_ocean_add(); -- cgit v1.2.3