[Bf-blender-cvs] [76910401663] master: Ocean Modifier: removed the MOD_OCEAN_REFRESH_ADD flag

Sybren A. Stüvel noreply at git.blender.org
Fri Jul 6 12:58:02 CEST 2018


Commit: 769104016636b26be1b01726a1ea45c95b184a2e
Author: Sybren A. Stüvel
Date:   Fri Jul 6 12:40:09 2018 +0200
Branches: master
https://developer.blender.org/rB769104016636b26be1b01726a1ea45c95b184a2e

Ocean Modifier: removed the MOD_OCEAN_REFRESH_ADD flag

The flag was only used in readfile.c, and resulted in a delayed call to
BKE_ocean_add(); this call is now immediately made instead as it's not
very expensive.

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

M	source/blender/blenloader/intern/readfile.c
M	source/blender/makesdna/DNA_modifier_types.h
M	source/blender/modifiers/intern/MOD_ocean.c

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

diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index c57817c275a..a03016c2536 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -138,6 +138,7 @@
 #include "BKE_multires.h"
 #include "BKE_node.h" // for tree type defines
 #include "BKE_object.h"
+#include "BKE_ocean.h"
 #include "BKE_paint.h"
 #include "BKE_particle.h"
 #include "BKE_pointcache.h"
@@ -5362,8 +5363,8 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb)
 		else if (md->type == eModifierType_Ocean) {
 			OceanModifierData *omd = (OceanModifierData *)md;
 			omd->oceancache = NULL;
-			omd->ocean = NULL;
-			omd->refresh = (MOD_OCEAN_REFRESH_ADD|MOD_OCEAN_REFRESH_RESET|MOD_OCEAN_REFRESH_SIM);
+			omd->ocean = BKE_ocean_add();
+			omd->refresh = MOD_OCEAN_REFRESH_RESET | MOD_OCEAN_REFRESH_SIM;
 		}
 		else if (md->type == eModifierType_Warp) {
 			WarpModifierData *tmd = (WarpModifierData *)md;
diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h
index a023237d847..f7fb3e0e376 100644
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@ -1010,7 +1010,7 @@ enum {
 enum {
 	MOD_OCEAN_REFRESH_RESET        = (1 << 0),
 	MOD_OCEAN_REFRESH_SIM          = (1 << 1),
-	MOD_OCEAN_REFRESH_ADD          = (1 << 2),
+	/* MOD_OCEAN_REFRESH_ADD          = (1 << 2), */
 	MOD_OCEAN_REFRESH_CLEAR_CACHE  = (1 << 3),
 	MOD_OCEAN_REFRESH_TOPOLOGY     = (1 << 4),
 };
diff --git a/source/blender/modifiers/intern/MOD_ocean.c b/source/blender/modifiers/intern/MOD_ocean.c
index c29e835797b..b845e62c530 100644
--- a/source/blender/modifiers/intern/MOD_ocean.c
+++ b/source/blender/modifiers/intern/MOD_ocean.c
@@ -435,9 +435,6 @@ static DerivedMesh *doOcean(
 	}
 
 	/* update modifier */
-	if (omd->refresh & MOD_OCEAN_REFRESH_ADD) {
-		omd->ocean = BKE_ocean_add();
-	}
 	if (omd->refresh & MOD_OCEAN_REFRESH_RESET) {
 		init_ocean_modifier(omd);
 	}



More information about the Bf-blender-cvs mailing list