From 34ab90f546f097cada951b2c9ca22bf271996980 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 6 Apr 2018 12:07:27 +0200 Subject: 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 --- source/blender/blenkernel/intern/modifier.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'source/blender/blenkernel/intern/modifier.c') diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index 5eb5272f3e5..c15ae9e4a7c 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -786,7 +786,7 @@ void modifier_path_init(char *path, int path_maxlen, const char *name) /* wrapper around ModifierTypeInfo.applyModifier that ensures valid normals */ struct DerivedMesh *modwrap_applyModifier( - ModifierData *md, const struct EvaluationContext *eval_ctx, + ModifierData *md, struct Depsgraph *depsgraph, Object *ob, struct DerivedMesh *dm, ModifierApplyFlag flag) { @@ -796,11 +796,11 @@ struct DerivedMesh *modwrap_applyModifier( if (mti->dependsOnNormals && mti->dependsOnNormals(md)) { DM_ensure_normals(dm); } - return mti->applyModifier(md, eval_ctx, ob, dm, flag); + return mti->applyModifier(md, depsgraph, ob, dm, flag); } struct DerivedMesh *modwrap_applyModifierEM( - ModifierData *md, const struct EvaluationContext *eval_ctx, + ModifierData *md, struct Depsgraph *depsgraph, Object *ob, struct BMEditMesh *em, DerivedMesh *dm, ModifierApplyFlag flag) @@ -811,11 +811,11 @@ struct DerivedMesh *modwrap_applyModifierEM( if (mti->dependsOnNormals && mti->dependsOnNormals(md)) { DM_ensure_normals(dm); } - return mti->applyModifierEM(md, eval_ctx, ob, em, dm, flag); + return mti->applyModifierEM(md, depsgraph, ob, em, dm, flag); } void modwrap_deformVerts( - ModifierData *md, const struct EvaluationContext *eval_ctx, + ModifierData *md, struct Depsgraph *depsgraph, Object *ob, DerivedMesh *dm, float (*vertexCos)[3], int numVerts, ModifierApplyFlag flag) @@ -826,11 +826,11 @@ void modwrap_deformVerts( if (dm && mti->dependsOnNormals && mti->dependsOnNormals(md)) { DM_ensure_normals(dm); } - mti->deformVerts(md, eval_ctx, ob, dm, vertexCos, numVerts, flag); + mti->deformVerts(md, depsgraph, ob, dm, vertexCos, numVerts, flag); } void modwrap_deformVertsEM( - ModifierData *md, const struct EvaluationContext *eval_ctx, Object *ob, + ModifierData *md, struct Depsgraph *depsgraph, Object *ob, struct BMEditMesh *em, DerivedMesh *dm, float (*vertexCos)[3], int numVerts) { @@ -840,6 +840,6 @@ void modwrap_deformVertsEM( if (dm && mti->dependsOnNormals && mti->dependsOnNormals(md)) { DM_ensure_normals(dm); } - mti->deformVertsEM(md, eval_ctx, ob, em, dm, vertexCos, numVerts); + mti->deformVertsEM(md, depsgraph, ob, em, dm, vertexCos, numVerts); } /* end modifier callback wrappers */ -- cgit v1.2.3