diff --git a/blender_cloud/blender.py b/blender_cloud/blender.py index 4bd67a1..8082d53 100644 --- a/blender_cloud/blender.py +++ b/blender_cloud/blender.py @@ -200,6 +200,11 @@ class BlenderCloudPreferences(AddonPreferences): default=0, soft_max=4, ) + flamenco_open_browser_after_submit = BoolProperty( + name='Open Browser after Submitting Job', + description='When enabled, Blender will open a webbrowser', + default=True + ) def draw(self, context): import textwrap @@ -389,6 +394,8 @@ class BlenderCloudPreferences(AddonPreferences): props = path_box.operator('flamenco.explore_file_path', text='', icon='DISK_DRIVE') props.path = str(output_path.parent) + flamenco_box.prop(self, 'flamenco_open_browser_after_submit') + # TODO: make a reusable way to select projects, and use that for Attract and Flamenco. note_box = flamenco_box.column(align=True) note_box.label('NOTE: For now, Flamenco uses the same project as Attract.') diff --git a/blender_cloud/flamenco/__init__.py b/blender_cloud/flamenco/__init__.py index b3abbe9..1c458d1 100644 --- a/blender_cloud/flamenco/__init__.py +++ b/blender_cloud/flamenco/__init__.py @@ -201,6 +201,14 @@ class FLAMENCO_OT_render(async_loop.AsyncModalOperatorMixin, self.quit() return + if prefs.flamenco_open_browser_after_submit: + import webbrowser + from urllib.parse import urljoin + from ..blender import PILLAR_WEB_SERVER_URL + + url = urljoin(PILLAR_WEB_SERVER_URL, '/flamenco/jobs/%s/redir' % job_info['_id']) + webbrowser.open_new_tab(url) + # Do a final report. if missing_sources: names = (ms.name for ms in missing_sources)