From 61e56c2d8eb406d12b75e8d2066df04265dec8b1 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 10 Aug 2018 14:14:14 +0200 Subject: [PATCH] Allow sharing only once --- benchmark/space/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/benchmark/space/__init__.py b/benchmark/space/__init__.py index 1a87e55..cba5f62 100644 --- a/benchmark/space/__init__.py +++ b/benchmark/space/__init__.py @@ -41,6 +41,7 @@ global_scene_status = {} global_cancel = False global_cached_system_info = None global_cached_compute_devices = None +global_results_submitted = False images = {} current_progress = 0.0 progress_lock = Lock() @@ -59,12 +60,14 @@ def reset_global_state(): global global_result_dict global global_background_image_path global global_scene_status + global global_results_submitted global_result_platform = None global_progress_status = None global_result_stats = None global_result_dict = None global_background_image_path = "" global_scene_status = {} + global_results_submitted = False ################################################################################ # Draw Utilities. @@ -568,6 +571,7 @@ class BENCHMARK_PT_main(Panel): sub.separator() sub = col.row() + sub.enabled = not global_results_submitted sub.scale_y = 2.25 sub.operator("benchmark.share", text="SHARE ONLINE") @@ -854,6 +858,7 @@ class BENCHMARK_OT_share(bpy.types.Operator): def execute(self, context): from benchmark import submission + global global_results_submitted make_buttons_default() print('Submitting benchmark') @@ -864,6 +869,7 @@ class BENCHMARK_OT_share(bpy.types.Operator): return {'CANCELLED'} print('Submission done') make_buttons_green() + global_results_submitted = True return {'FINISHED'} class BENCHMARK_OT_opendata_link(bpy.types.Operator):