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/makesrna/intern/rna_nodetree.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/makesrna/intern/rna_nodetree.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_nodetree.c | 25 |
1 files changed, 3 insertions, 22 deletions
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 |