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:
authorBastien Montagne <montagne29@wanadoo.fr>2018-05-23 16:52:35 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-05-23 16:55:13 +0300
commit4a2213dc9a15d6fbff49cde6f919f27b7fbecf89 (patch)
treebd2f7093ad3446a454f63c85ba2a800178f6ae01 /source/blender/modifiers/intern/MOD_displace.c
parenta455e35343a46af48dc8c8b53356c09368509591 (diff)
Fix modifiers not using depsgraph time for texture evaluation.
Texture animation seems to be broken anyway currently, but at leat modifier side it should now be OK.
Diffstat (limited to 'source/blender/modifiers/intern/MOD_displace.c')
-rw-r--r--source/blender/modifiers/intern/MOD_displace.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/source/blender/modifiers/intern/MOD_displace.c b/source/blender/modifiers/intern/MOD_displace.c
index 7997ccbfedc..d6b96b34273 100644
--- a/source/blender/modifiers/intern/MOD_displace.c
+++ b/source/blender/modifiers/intern/MOD_displace.c
@@ -52,6 +52,8 @@
#include "BKE_deform.h"
#include "BKE_object.h"
+#include "DEG_depsgraph.h"
+
#include "MEM_guardedalloc.h"
#include "MOD_util.h"
@@ -271,9 +273,11 @@ static void displaceModifier_do_task(
/* dm must be a CDDerivedMesh */
static void displaceModifier_do(
- DisplaceModifierData *dmd, Object *ob,
+ DisplaceModifierData *dmd, const ModifierEvalContext *ctx,
Mesh *mesh, float (*vertexCos)[3], const int numVerts)
{
+ Object *ob = ctx->object;
+ Depsgraph *depsgraph = ctx->depsgraph;
MVert *mvert;
MDeformVert *dvert;
int direction = dmd->direction;
@@ -295,7 +299,7 @@ static void displaceModifier_do(
"displaceModifier_do tex_co");
get_texture_coords_mesh((MappingInfoModifierData *)dmd, ob, mesh, vertexCos, tex_co);
- modifier_init_texture(dmd->modifier.scene, dmd->texture);
+ modifier_init_texture(depsgraph, dmd->texture);
}
else {
tex_co = NULL;
@@ -374,8 +378,7 @@ static void deformVerts(
BLI_assert(mesh_src->totvert == numVerts);
- displaceModifier_do((DisplaceModifierData *)md, ctx->object, mesh_src,
- vertexCos, numVerts);
+ displaceModifier_do((DisplaceModifierData *)md, ctx, mesh_src, vertexCos, numVerts);
if (mesh_src != mesh) {
BKE_id_free(NULL, mesh_src);
@@ -390,7 +393,7 @@ static void deformVertsEM(
BLI_assert(mesh_src->totvert == numVerts);
- displaceModifier_do((DisplaceModifierData *)md, ctx->object, mesh_src, vertexCos, numVerts);
+ displaceModifier_do((DisplaceModifierData *)md, ctx, mesh_src, vertexCos, numVerts);
if (mesh_src != mesh) {
BKE_id_free(NULL, mesh_src);