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.
This commit is contained in:
Sergey Sharybin
2019-05-16 17:19:05 +02:00
parent aac95aa1e9
commit 2ee762344f
6 changed files with 32 additions and 17 deletions

View File

@@ -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