diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-04-06 13:07:27 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-04-16 20:55:33 +0300 |
commit | 34ab90f546f097cada951b2c9ca22bf271996980 (patch) | |
tree | ebcdb3d37120ac1d8fb16462b9104badd1800329 /source/blender/modifiers/intern/MOD_wave.c | |
parent | 0c495005dd83913864acb510c1d4194a2275dbb0 (diff) |
Depsgraph: remove EvaluationContext, pass Depsgraph instead.
The depsgraph was always created within a fixed evaluation context. Passing
both risks the depsgraph and evaluation context not matching, and it
complicates the Python API where we'd have to expose both which is not so
easy to understand.
This also removes the global evaluation context in main, which assumed there
to be a single active scene and view layer.
Differential Revision: https://developer.blender.org/D3152
Diffstat (limited to 'source/blender/modifiers/intern/MOD_wave.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_wave.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/source/blender/modifiers/intern/MOD_wave.c b/source/blender/modifiers/intern/MOD_wave.c index 7921ea662a7..3126ea0139e 100644 --- a/source/blender/modifiers/intern/MOD_wave.c +++ b/source/blender/modifiers/intern/MOD_wave.c @@ -56,6 +56,7 @@ #include "MOD_util.h" #include "DEG_depsgraph.h" +#include "DEG_depsgraph_query.h" static void initData(ModifierData *md) { @@ -148,7 +149,7 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md) } static void waveModifier_do(WaveModifierData *md, - const EvaluationContext *eval_ctx, + Depsgraph *depsgraph, Object *ob, DerivedMesh *dm, float (*vertexCos)[3], int numVerts) { @@ -156,7 +157,7 @@ static void waveModifier_do(WaveModifierData *md, MVert *mvert = NULL; MDeformVert *dvert; int defgrp_index; - float ctime = eval_ctx->ctime; + float ctime = DEG_get_ctime(depsgraph); float minfac = (float)(1.0 / exp(wmd->width * wmd->narrow * wmd->width * wmd->narrow)); float lifefac = wmd->height; float (*tex_co)[3] = NULL; @@ -301,7 +302,7 @@ static void waveModifier_do(WaveModifierData *md, if (wmd->texture) MEM_freeN(tex_co); } -static void deformVerts(ModifierData *md, const struct EvaluationContext *eval_ctx, +static void deformVerts(ModifierData *md, struct Depsgraph *depsgraph, Object *ob, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts, @@ -315,14 +316,14 @@ static void deformVerts(ModifierData *md, const struct EvaluationContext *eval_c else if (wmd->texture || wmd->defgrp_name[0]) dm = get_dm(ob, NULL, dm, NULL, false, false); - waveModifier_do(wmd, eval_ctx, ob, dm, vertexCos, numVerts); + waveModifier_do(wmd, depsgraph, ob, dm, vertexCos, numVerts); if (dm != derivedData) dm->release(dm); } static void deformVertsEM( - ModifierData *md, const struct EvaluationContext *eval_ctx, + ModifierData *md, struct Depsgraph *depsgraph, Object *ob, struct BMEditMesh *editData, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts) { @@ -334,7 +335,7 @@ static void deformVertsEM( else if (wmd->texture || wmd->defgrp_name[0]) dm = get_dm(ob, editData, dm, NULL, false, false); - waveModifier_do(wmd, eval_ctx, ob, dm, vertexCos, numVerts); + waveModifier_do(wmd, depsgraph, ob, dm, vertexCos, numVerts); if (dm != derivedData) dm->release(dm); |