From 2ee762344f8742618804e869536e3efee6ab0bd0 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 16 May 2019 17:19:05 +0200 Subject: 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. --- doc/python_api/examples/bpy.types.RenderEngine.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'doc') diff --git a/doc/python_api/examples/bpy.types.RenderEngine.py b/doc/python_api/examples/bpy.types.RenderEngine.py index 6014b4f1d53..cfb32433248 100644 --- a/doc/python_api/examples/bpy.types.RenderEngine.py +++ b/doc/python_api/examples/bpy.types.RenderEngine.py @@ -55,10 +55,9 @@ class CustomRenderEngine(bpy.types.RenderEngine): # whenever the scene or 3D viewport changes. This method is where data # should be read from Blender in the same thread. Typically a render # thread will be started to do the work while keeping Blender responsive. - def view_update(self, context): + def view_update(self, context, depsgraph): region = context.region view3d = context.space_data - depsgraph = context.depsgraph scene = depsgraph.scene # Get viewport dimensions @@ -93,9 +92,8 @@ class CustomRenderEngine(bpy.types.RenderEngine): # with OpenGL, and not perform other expensive work. # Blender will draw overlays for selection and editing on top of the # rendered image automatically. - def view_draw(self, context): + def view_draw(self, context, depsgraph): region = context.region - depsgraph = context.depsgraph scene = depsgraph.scene # Get viewport dimensions -- cgit v1.2.3