diff options
author | Sergey Sharybin <sergey> | 2022-03-21 12:58:37 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey@blender.org> | 2022-03-21 12:59:08 +0300 |
commit | ae2172955785e22565e6893054d5659bac834470 (patch) | |
tree | 96ae93dc46b875be3cef4a85aef4ded052aa1075 /intern/cycles | |
parent | e4278b72bb1a658d2187040bd5c71c598b6c16d4 (diff) |
Cycles: Un-pause render when switching to rendered viewport
Consider switching to rendered shading type as a request to start
rendering, without requiring to un-pause.
This minimizes amount of clicks needed to start rendering after
viewport was paused once, and then shading mode got changed.
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D14244
Diffstat (limited to 'intern/cycles')
-rw-r--r-- | intern/cycles/blender/addon/__init__.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/intern/cycles/blender/addon/__init__.py b/intern/cycles/blender/addon/__init__.py index 5578e83b19a..74b28b8ea21 100644 --- a/intern/cycles/blender/addon/__init__.py +++ b/intern/cycles/blender/addon/__init__.py @@ -83,6 +83,17 @@ class CyclesRender(bpy.types.RenderEngine): # viewport render def view_update(self, context, depsgraph): if not self.session: + # When starting a new render session in viewport (by switching + # viewport to Rendered shading) unpause the render. The way to think + # of it is: artist requests render, so we start to render. + # Do it for both original and evaluated scene so that Cycles + # immediately reacts to un-paused render. + cscene = context.scene.cycles + cscene_eval = depsgraph.scene_eval.cycles + if cscene.preview_pause or cscene_eval.preview_pause: + cscene.preview_pause = False + cscene_eval.preview_pause = False + engine.create(self, context.blend_data, context.region, context.space_data, context.region_data) |