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:
authorHans Goudey <h.goudey@me.com>2020-08-03 22:33:32 +0300
committerHans Goudey <h.goudey@me.com>2020-08-03 22:33:32 +0300
commit452b896f2d88779260778543fc3951e70a4a0eae (patch)
tree05dabcbf25a83d85d5fc897a97209de85c46827a /source/blender/blenkernel/intern/ocean.c
parentb5c737469d5544030c0b53271e24a32535d64ddc (diff)
Ocean Modifier: Fix render resolution only used for baking
The modifier needs to check that the cached ocean has the correct resolution.
Diffstat (limited to 'source/blender/blenkernel/intern/ocean.c')
-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();