From f64384ee925dcc55e23399e940000cc8e0721363 Mon Sep 17 00:00:00 2001 From: "Jeison Yehuda Amihud (Blender Dumbass)" Date: Tue, 7 Mar 2023 04:24:14 +0000 Subject: [PATCH] Removed empty progress-bars. --- studio/studio_renderLayer.py | 56 +++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/studio/studio_renderLayer.py b/studio/studio_renderLayer.py index d67c966..e180d43 100644 --- a/studio/studio_renderLayer.py +++ b/studio/studio_renderLayer.py @@ -134,8 +134,11 @@ def layer(win, call): passed = time.time() - win.render_runtime.get("started_rendering", 0) passed = passed*1000000 - longest = passed - + if win.render_runtime.get("to_render"): + longest = passed + else: + longest = 0 + save_folder = the_render["save_folder"] @@ -156,13 +159,13 @@ def layer(win, call): frame_h = 0 - if win.render_runtime.get("current_frame", 0) == frame: + if win.render_runtime.get("current_frame", 0) == frame and win.render_runtime.get("to_render"): frame_h = (win.current["h"]-200)/3 * (passed / longest) frame_h = max(frame_h, frame_w) UI_color.set(layer, win, "node_background") - if win.render_runtime.get("current_frame", 0) == frame: + if win.render_runtime.get("current_frame", 0) == frame and win.render_runtime.get("to_render"): UI_color.set(layer, win, "progress_active") UI_elements.roundrect(layer, win, 580+(n*frame_w), @@ -188,12 +191,12 @@ def layer(win, call): break - - UI_color.set(layer, win, "text_normal") - layer.set_font_size(20) - layer.move_to(50, - win.current["h"]-30) - layer.show_text(win.render_runtime.get("current_progress", "")) + if win.render_runtime.get("to_render"): + UI_color.set(layer, win, "text_normal") + layer.set_font_size(20) + layer.move_to(50, + win.current["h"]-30) + layer.show_text(win.render_runtime.get("current_progress", "")) ######################################################################### @@ -495,23 +498,24 @@ def layer(win, call): fraction = (win.renders[render]["current_frame"] - win.renders[render]["start_frame"])\ / (win.renders[render]["end_frame"] - win.renders[render]["start_frame"]) - fraction = min(1, fraction) - - UI_color.set(layer, win, "progress_background") - UI_elements.roundrect(layer, win, - x+20, - y+current_Y + win.scroll["render"]+55, - width-40, - 0, - 5) + fraction = max(0,min(1, fraction)) - UI_color.set(layer, win, "progress_active") - UI_elements.roundrect(layer, win, - x+20, - y+current_Y + win.scroll["render"]+55, - (width-40)*fraction, - 0, - 5) + if fraction: + UI_color.set(layer, win, "progress_background") + UI_elements.roundrect(layer, win, + x+20, + y+current_Y + win.scroll["render"]+55, + width-40, + 0, + 5) + + UI_color.set(layer, win, "progress_active") + UI_elements.roundrect(layer, win, + x+20, + y+current_Y + win.scroll["render"]+55, + (width-40)*fraction, + 0, + 5) # Now selection. When you click on one you expend it. And you can see # what settings are inside.