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/mask_evaluate.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'source/blender/blenkernel/intern/mask_evaluate.c') diff --git a/source/blender/blenkernel/intern/mask_evaluate.c b/source/blender/blenkernel/intern/mask_evaluate.c index 61c136d2c4f..651bcddc84a 100644 --- a/source/blender/blenkernel/intern/mask_evaluate.c +++ b/source/blender/blenkernel/intern/mask_evaluate.c @@ -40,11 +40,13 @@ #include "BLI_math.h" #include "DNA_mask_types.h" +#include "DNA_object_types.h" #include "BKE_curve.h" #include "BKE_mask.h" #include "DEG_depsgraph.h" +#include "DEG_depsgraph_query.h" unsigned int BKE_mask_spline_resolution(MaskSpline *spline, int width, int height) { @@ -896,24 +898,26 @@ void BKE_mask_layer_evaluate_deform(MaskLayer *masklay, const float ctime) } } -void BKE_mask_eval_animation(struct EvaluationContext *eval_ctx, Mask *mask) +void BKE_mask_eval_animation(struct Depsgraph *depsgraph, Mask *mask) { + float ctime = DEG_get_ctime(depsgraph); DEG_debug_print_eval(__func__, mask->id.name, mask); for (MaskLayer *mask_layer = mask->masklayers.first; mask_layer != NULL; mask_layer = mask_layer->next) { - BKE_mask_layer_evaluate_animation(mask_layer, eval_ctx->ctime); + BKE_mask_layer_evaluate_animation(mask_layer, ctime); } } -void BKE_mask_eval_update(struct EvaluationContext *eval_ctx, Mask *mask) +void BKE_mask_eval_update(struct Depsgraph *depsgraph, Mask *mask) { + float ctime = DEG_get_ctime(depsgraph); DEG_debug_print_eval(__func__, mask->id.name, mask); for (MaskLayer *mask_layer = mask->masklayers.first; mask_layer != NULL; mask_layer = mask_layer->next) { - BKE_mask_layer_evaluate_deform(mask_layer, eval_ctx->ctime); + BKE_mask_layer_evaluate_deform(mask_layer, ctime); } } -- cgit v1.2.3