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:
Diffstat (limited to 'source/blender/modifiers/intern/MOD_ocean.c')
-rw-r--r--source/blender/modifiers/intern/MOD_ocean.c44
1 files changed, 4 insertions, 40 deletions
diff --git a/source/blender/modifiers/intern/MOD_ocean.c b/source/blender/modifiers/intern/MOD_ocean.c
index b9f05d0cdd3..13a317a0f3c 100644
--- a/source/blender/modifiers/intern/MOD_ocean.c
+++ b/source/blender/modifiers/intern/MOD_ocean.c
@@ -30,6 +30,7 @@
#include "BLT_translation.h"
#include "DNA_customdata_types.h"
+#include "DNA_defaults.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_modifier_types.h"
@@ -87,54 +88,17 @@ static void initData(ModifierData *md)
#ifdef WITH_OCEANSIM
OceanModifierData *omd = (OceanModifierData *)md;
- /* Render resolution */
- omd->resolution = 7;
- /* Display resolution for the non-render case */
- omd->viewport_resolution = 7;
+ BLI_assert(MEMCMP_STRUCT_AFTER_IS_ZERO(omd, modifier));
- omd->spatial_size = 50;
-
- omd->wave_alignment = 0.0;
- omd->wind_velocity = 30.0;
-
- omd->damp = 0.5;
- omd->smallest_wave = 0.01;
- omd->wave_direction = 0.0;
- omd->depth = 200.0;
-
- omd->wave_scale = 1.0;
-
- omd->chop_amount = 1.0;
-
- omd->foam_coverage = 0.0;
-
- omd->seed = 0;
- omd->time = 1.0;
-
- omd->spectrum = MOD_OCEAN_SPECTRUM_PHILLIPS;
- omd->sharpen_peak_jonswap = 0.0f;
- omd->fetch_jonswap = 120.0f;
-
- omd->size = 1.0;
- omd->repeat_x = 1;
- omd->repeat_y = 1;
+ MEMCPY_STRUCT_AFTER(omd, DNA_struct_default_get(OceanModifierData), modifier);
BKE_modifier_path_init(omd->cachepath, sizeof(omd->cachepath), "cache_ocean");
- omd->cached = 0;
- omd->bakestart = 1;
- omd->bakeend = 250;
- omd->oceancache = NULL;
- omd->foam_fade = 0.98;
- omd->foamlayername[0] = '\0'; /* layer name empty by default */
- omd->spraylayername[0] = '\0'; /* layer name empty by default */
-
omd->ocean = BKE_ocean_add();
BKE_ocean_init_from_modifier(omd->ocean, omd, omd->viewport_resolution);
simulate_ocean_modifier(omd);
#else /* WITH_OCEANSIM */
- /* unused */
- (void)md;
+ UNUSED_VARS(md);
#endif /* WITH_OCEANSIM */
}