From 4608204f1dce19abe7459a2e8872bd3fd023ea86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Wed, 18 Jan 2017 16:45:54 +0100 Subject: [PATCH] Prevent error when current file is outside Flamenco project path --- blender_cloud/flamenco/__init__.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/blender_cloud/flamenco/__init__.py b/blender_cloud/flamenco/__init__.py index 3023776..fed7c92 100644 --- a/blender_cloud/flamenco/__init__.py +++ b/blender_cloud/flamenco/__init__.py @@ -445,14 +445,17 @@ class FLAMENCO_PT_render(bpy.types.Panel): labeled_row.label('Output:') prop_btn_row = labeled_row.row(align=True) render_output = render_output_path(context) - prop_btn_row.label(str(render_output)) - props = prop_btn_row.operator(FLAMENCO_OT_explore_file_path.bl_idname, - text='', icon='DISK_DRIVE') - props.path = str(render_output.parent) + if render_output is None: + prop_btn_row.label('Unable to render with Flamenco, outside of project directory.') + else: + prop_btn_row.label(str(render_output)) + props = prop_btn_row.operator(FLAMENCO_OT_explore_file_path.bl_idname, + text='', icon='DISK_DRIVE') + props.path = str(render_output.parent) - layout.operator(FLAMENCO_OT_render.bl_idname, - text='Render on Flamenco', - icon='RENDER_ANIMATION') + layout.operator(FLAMENCO_OT_render.bl_idname, + text='Render on Flamenco', + icon='RENDER_ANIMATION') def register():