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/makesrna/intern/rna_nodetree.c | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) (limited to 'source/blender/makesrna/intern/rna_nodetree.c') diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 012545cb5d2..0caffb4867c 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -3144,11 +3144,6 @@ void rna_ShaderNodePointDensity_density_cache(bNode *self, return; } - EvaluationContext eval_ctx; - DEG_evaluation_context_init_from_depsgraph(&eval_ctx, - depsgraph, - DEG_get_mode(depsgraph)); - /* Make sure there's no cached data. */ BKE_texture_pointdensity_free_data(pd); RE_point_density_free(pd); @@ -3177,8 +3172,7 @@ void rna_ShaderNodePointDensity_density_cache(bNode *self, shader_point_density->cached_resolution = shader_point_density->resolution; /* Single-threaded sampling of the voxel domain. */ - RE_point_density_cache(&eval_ctx, - pd); + RE_point_density_cache(depsgraph, pd); } void rna_ShaderNodePointDensity_density_calc(bNode *self, @@ -3195,11 +3189,6 @@ void rna_ShaderNodePointDensity_density_calc(bNode *self, return; } - EvaluationContext eval_ctx; - DEG_evaluation_context_init_from_depsgraph(&eval_ctx, - depsgraph, - DEG_get_mode(depsgraph)); - /* TODO(sergey): Will likely overflow, but how to pass size_t via RNA? */ *length = 4 * resolution * resolution * resolution; @@ -3208,10 +3197,7 @@ void rna_ShaderNodePointDensity_density_calc(bNode *self, } /* Single-threaded sampling of the voxel domain. */ - RE_point_density_sample(&eval_ctx, - pd, - resolution, - *values); + RE_point_density_sample(depsgraph, pd, resolution, *values); /* We're done, time to clean up. */ BKE_texture_pointdensity_free_data(pd); @@ -3233,12 +3219,7 @@ void rna_ShaderNodePointDensity_density_minmax(bNode *self, return; } - EvaluationContext eval_ctx; - DEG_evaluation_context_init_from_depsgraph(&eval_ctx, - depsgraph, - DEG_get_mode(depsgraph)); - - RE_point_density_minmax(&eval_ctx, pd, r_min, r_max); + RE_point_density_minmax(depsgraph, pd, r_min, r_max); } #else -- cgit v1.2.3