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.
Differential D14244
Cycles: Un-pause render when switching to rendered viewport Authored by Sergey Sharybin (sergey) on Mar 4 2022, 10:51 AM.
Details Consider switching to rendered shading type as a request to start This minimizes amount of clicks needed to start rendering after
Diff Detail
Event TimelineComment Actions We call free_session() + create_session() when session or scene parameters change in BlenderSession::synchronize, and should not unpause in that case. Also I think this is modifying the CoW scene now, so the change will not be permanent. Perhaps something like this works: diff --git a/intern/cycles/blender/addon/__init__.py b/intern/cycles/blender/addon/__init__.py index 5578e83..2b7c79d 100644 --- a/intern/cycles/blender/addon/__init__.py +++ b/intern/cycles/blender/addon/__init__.py @@ -83,6 +83,12 @@ class CyclesRender(bpy.types.RenderEngine): # viewport render def view_update(self, context, depsgraph): if not self.session: + 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) Comment Actions @Brecht Van Lommel (brecht), Good point about Copy-on-Write! And reset it seemed it doesn't happen in paused state. Oh well. Here is an updated patch which follows your suggestion. The remaining issue is that it doesnt refresh the interface immediately: changing property from Python doesn't geenrate a notifier for this. Comment Actions Wow! Thank you @Sergey Sharybin (sergey) and @Brecht Van Lommel (brecht), that was fast, and genus solving the issue during render commencement, rather than post. When you mention the interface not refreshing immediately; does that mean, just the icon remains in a paused state, while the viewport is rendering? Comment Actions
Yeah, that. Icon stays "old" until you mouse-hover. |