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:
authorSybren A. Stüvel <sybren@stuvel.eu>2018-07-05 17:23:35 +0300
committerSybren A. Stüvel <sybren@stuvel.eu>2018-07-10 13:00:58 +0300
commitde55ae56ae5d871b5bc7fa6383c90ef89d66fcd1 (patch)
tree212fc7b15f9523bcc7a1a54906f1ba6bb6006a4f /source/blender/makesrna/intern/rna_modifier.c
parentb9bef10d1953bda4e1eb882bdc525815c2e32e01 (diff)
Ocean Modifier: refactored the delayed-refresh approach
The approach of setting 'refresh' flags on the modifier, and performing the associated actions when the modifier is being evaluated, is a bad one. Instead, we use the separation of the original and the evaluated copy to 'refresh' certain things (because they simply aren't set at all on the original). Other actions are now done directly with BKE_ocean_xxx functions on the original data, intead of during evaluation.
Diffstat (limited to 'source/blender/makesrna/intern/rna_modifier.c')
-rw-r--r--source/blender/makesrna/intern/rna_modifier.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index 50246c3f9ac..57b12d6a3fd 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -50,6 +50,7 @@
#include "BKE_mesh_mapping.h"
#include "BKE_mesh_remap.h"
#include "BKE_multires.h"
+#include "BKE_ocean.h"
#include "BKE_smoke.h" /* For smokeModifier_free & smokeModifier_createType */
#include "RNA_access.h"
@@ -739,8 +740,7 @@ static void rna_OceanModifier_init_update(Main *bmain, Scene *scene, PointerRNA
{
OceanModifierData *omd = (OceanModifierData *)ptr->data;
- omd->refresh |= MOD_OCEAN_REFRESH_RESET | MOD_OCEAN_REFRESH_CLEAR_CACHE;
-
+ BKE_ocean_free_modifier_cache(omd);
rna_Modifier_update(bmain, scene, ptr);
}
@@ -754,8 +754,7 @@ static void rna_OceanModifier_ocean_chop_set(PointerRNA *ptr, float value)
if ((old_value == 0.0f && value > 0.0f) ||
(old_value > 0.0f && value == 0.0f))
{
- omd->refresh |= MOD_OCEAN_REFRESH_RESET;
- omd->refresh |= MOD_OCEAN_REFRESH_CLEAR_CACHE;
+ BKE_ocean_free_modifier_cache(omd);
}
}