Commit: 452b896f2d88779260778543fc3951e70a4a0eae
Author: Hans Goudey
Date:   Mon Aug 3 15:33:32 2020 -0400
Branches: master
https://developer.blender.org/rB452b896f2d88779260778543fc3951e70a4a0eae

Ocean Modifier: Fix render resolution only used for baking

The modifier needs to check that the cached ocean has the correct
resolution.

===================================================================

M       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();

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to