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:
-rw-r--r--source/blender/blenkernel/intern/ocean.c8
1 files changed, 7 insertions, 1 deletions
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();