Add placeholder texts

Will make it easier to tweak once final text is ready.
This commit is contained in:
2018-08-07 11:36:39 +02:00
parent f391aafb27
commit ef03f62053

View File

@@ -45,6 +45,14 @@ images = {}
current_progress = 0.0
progress_lock = Lock()
WELCOME_TEXT = "Run the Quick Benchmark to get a fast measurement of\n" \
"your hardware's performance. Requires approximately 10\n" \
"minutes"
BLURB_TEXT = "Blurb on sharing the data on the opendata.blender.org\n" \
"you can manage your privacy and everything will be\n" \
"safe and open source"
def reset_global_state():
global global_result_platform
global global_progress_status
@@ -141,14 +149,20 @@ def benchmark_draw_post_pixel(arg1, arg2):
else:
score = -1
blf.size(font_id, int(32 * ui_scale), 72)
if score >= 0:
draw_text_center("Render time is: {}" . format(
blf.size(font_id, int(32 * ui_scale), 72)
draw_text_center("Your time {}" . format(
util.humanReadableTimeDifference(score)), x, y)
else:
# TODO(sergey): What is the score?
draw_text_center("CRASH :(", x, y)
blf.size(font_id, int(18 * ui_scale), 72)
draw_text_center("Unfortunately, crash happened :(", x, y)
blf.size(font_id, int(24 * ui_scale), 72)
draw_text_center("You can still share data of succeeded scenes!", x, y - 26 * ui_scale)
x = 50.0 * ui_scale
y = image_y - (image_y - 52 * ui_scale - 18 * 3 * ui_scale) * 0.5
blf.size(font_id, int(12 * ui_scale), 72)
draw_text_multiline(BLURB_TEXT, x, y)
elif result_stats or result_platform or progress_status:
blf.size(font_id, int(12 * ui_scale), 72)
@@ -176,7 +190,6 @@ def benchmark_draw_post_pixel(arg1, arg2):
draw_text_multiline(global_progress_status,
progress_x + 8.0 * ui_scale,
progress_y + progress_h + int(22 * ui_scale))
else:
# Title
x = 0.5 * window_width
@@ -190,6 +203,11 @@ def benchmark_draw_post_pixel(arg1, arg2):
blf.size(font_id, int(12 * ui_scale), 72)
draw_text_center("Explore the results on opendata.blender.org", x, y)
x = 50.0 * ui_scale
y = image_y - (image_y - 52 * ui_scale - 18 * 3 * ui_scale) * 0.5
blf.size(font_id, int(12 * ui_scale), 72)
draw_text_multiline(WELCOME_TEXT, x, y)
# Bottom bar
bottom_x = 0
bottom_y = 0
@@ -374,7 +392,7 @@ def benchmark_thread(ctx):
global global_cancel
progress_lock.acquire()
global_progress_status = "Collecting system information..."
global_progress_status = "Collecting system information."
if global_cancel:
progress_lock.release()
return
@@ -394,7 +412,7 @@ def benchmark_thread(ctx):
if global_cancel:
progress_lock.release()
return
global_progress_status = "Prepating render..."
global_progress_status = "Prepating render."
progress_lock.release()
all_stats = benchrunner.benchmarkAll(ctx)
@@ -549,13 +567,13 @@ class BENCHMARK_OT_run_base(bpy.types.Operator):
progress_lock.acquire()
step = self.progress_provider.current_step
if global_cancel:
global_progress_status = "Cancelling..."
global_progress_status = "Cancelling."
elif step == 'WARM_UP':
global_progress_status = "Rendering warm-up pass..."
global_progress_status = "Rendering warm-up pass."
elif step == 'RUN':
global current_progress
current_progress = self.progress_provider.current_progress
global_progress_status = "Rendering..."
global_progress_status = "Rendering. Press Esc to stop."
context.area.tag_redraw()
# Path to currently displayed background image.
current_scene = self.progress_provider.current_scene