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_meshcache.c')
-rw-r--r--source/blender/modifiers/intern/MOD_meshcache.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/source/blender/modifiers/intern/MOD_meshcache.c b/source/blender/modifiers/intern/MOD_meshcache.c
index 50765079785..9d6dfc0e1eb 100644
--- a/source/blender/modifiers/intern/MOD_meshcache.c
+++ b/source/blender/modifiers/intern/MOD_meshcache.c
@@ -42,6 +42,8 @@
#include "BKE_mesh.h"
#include "BKE_main.h"
+#include "DEG_depsgraph_query.h"
+
#include "MEM_guardedalloc.h"
#include "MOD_meshcache_util.h" /* utility functions */
@@ -70,7 +72,7 @@ static bool dependsOnTime(ModifierData *md)
return (mcmd->play_mode == MOD_MESHCACHE_PLAY_CFEA);
}
-static bool isDisabled(ModifierData *md, int UNUSED(useRenderParams))
+static bool isDisabled(const struct Scene *UNUSED(scene), ModifierData *md, int UNUSED(useRenderParams))
{
MeshCacheModifierData *mcmd = (MeshCacheModifierData *) md;
@@ -80,7 +82,7 @@ static bool isDisabled(ModifierData *md, int UNUSED(useRenderParams))
static void meshcache_do(
- MeshCacheModifierData *mcmd, Object *ob, DerivedMesh *UNUSED(dm),
+ MeshCacheModifierData *mcmd, Scene *scene, Object *ob, DerivedMesh *UNUSED(dm),
float (*vertexCos_Real)[3], int numVerts)
{
const bool use_factor = mcmd->factor < 1.0f;
@@ -88,7 +90,6 @@ static void meshcache_do(
MEM_malloc_arrayN(numVerts, sizeof(*vertexCos_Store), __func__) : NULL;
float (*vertexCos)[3] = vertexCos_Store ? vertexCos_Store : vertexCos_Real;
- Scene *scene = mcmd->modifier.scene;
const float fps = FPS;
char filepath[FILE_MAX];
@@ -270,8 +271,9 @@ static void deformVerts(
int numVerts)
{
MeshCacheModifierData *mcmd = (MeshCacheModifierData *)md;
+ Scene *scene = DEG_get_evaluated_scene(ctx->depsgraph);
- meshcache_do(mcmd, ctx->object, derivedData, vertexCos, numVerts);
+ meshcache_do(mcmd, scene, ctx->object, derivedData, vertexCos, numVerts);
}
static void deformVertsEM(
@@ -279,8 +281,9 @@ static void deformVertsEM(
DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts)
{
MeshCacheModifierData *mcmd = (MeshCacheModifierData *)md;
+ Scene *scene = DEG_get_evaluated_scene(ctx->depsgraph);
- meshcache_do(mcmd, ctx->object, derivedData, vertexCos, numVerts);
+ meshcache_do(mcmd, scene, ctx->object, derivedData, vertexCos, numVerts);
}