diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-05-16 18:19:05 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-05-16 18:24:16 +0300 |
commit | 2ee762344f8742618804e869536e3efee6ab0bd0 (patch) | |
tree | 391546a4401f76c93e3a232dbf80a115fe7d371f /source/blender/makesrna | |
parent | aac95aa1e9727f145e258561816baac80b915f20 (diff) |
Cycles: Fix missing viewport updates after recent changes
We can not access ensured-to-be-evaluated dependency graph from the
render API: some of it is running from within evaluation which makes
it possible for engines to access list of evaluated IDs.
Solved by passing dependency graph to viewport functions, similar to
the final render functions.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_render.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_render.c b/source/blender/makesrna/intern/rna_render.c index 81ec7857487..2dc873ca17d 100644 --- a/source/blender/makesrna/intern/rna_render.c +++ b/source/blender/makesrna/intern/rna_render.c @@ -206,7 +206,9 @@ static void engine_bake(RenderEngine *engine, RNA_parameter_list_free(&list); } -static void engine_view_update(RenderEngine *engine, const struct bContext *context) +static void engine_view_update(RenderEngine *engine, + const struct bContext *context, + Depsgraph *depsgraph) { extern FunctionRNA rna_RenderEngine_view_update_func; PointerRNA ptr; @@ -218,12 +220,15 @@ static void engine_view_update(RenderEngine *engine, const struct bContext *cont RNA_parameter_list_create(&list, &ptr, func); RNA_parameter_set_lookup(&list, "context", &context); + RNA_parameter_set_lookup(&list, "depsgraph", &depsgraph); engine->type->ext.call(NULL, &ptr, func, &list); RNA_parameter_list_free(&list); } -static void engine_view_draw(RenderEngine *engine, const struct bContext *context) +static void engine_view_draw(RenderEngine *engine, + const struct bContext *context, + Depsgraph *depsgraph) { extern FunctionRNA rna_RenderEngine_view_draw_func; PointerRNA ptr; @@ -235,6 +240,7 @@ static void engine_view_draw(RenderEngine *engine, const struct bContext *contex RNA_parameter_list_create(&list, &ptr, func); RNA_parameter_set_lookup(&list, "context", &context); + RNA_parameter_set_lookup(&list, "depsgraph", &depsgraph); engine->type->ext.call(NULL, &ptr, func, &list); RNA_parameter_list_free(&list); @@ -554,12 +560,18 @@ static void rna_def_render_engine(BlenderRNA *brna) func = RNA_def_function(srna, "view_update", NULL); RNA_def_function_ui_description(func, "Update on data changes for viewport render"); RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL | FUNC_ALLOW_WRITE); - RNA_def_pointer(func, "context", "Context", "", ""); + parm = RNA_def_pointer(func, "context", "Context", "", ""); + RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); + parm = RNA_def_pointer(func, "depsgraph", "Depsgraph", "", ""); + RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); func = RNA_def_function(srna, "view_draw", NULL); RNA_def_function_ui_description(func, "Draw viewport render"); RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL); - RNA_def_pointer(func, "context", "Context", "", ""); + parm = RNA_def_pointer(func, "context", "Context", "", ""); + RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); + parm = RNA_def_pointer(func, "depsgraph", "Depsgraph", "", ""); + RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); /* shader script callbacks */ func = RNA_def_function(srna, "update_script_node", NULL); |