diff --git a/studio/studio_renderLayer.py b/studio/studio_renderLayer.py index deff000..314ca0e 100644 --- a/studio/studio_renderLayer.py +++ b/studio/studio_renderLayer.py @@ -145,7 +145,29 @@ def layer(win, call): for i in the_render["analytics"][save_folder].values(): if i > longest: longest = i + shortest = longest + for i in the_render["analytics"][save_folder].values(): + if i < shortest: + shortest = i rn_files = [] + + preview_image = "horse" + + render = list(win.renders.keys())[0] + folder = render[:render.rfind("/")] + + + + if "render_preview_hovering" not in win.current: + win.current["render_preview_hovering"] = False + write_hovering = False + + for n, frame in enumerate(range(the_render["start_frame"], the_render["end_frame"]+1)): + f = getfileoutput(frame, the_render["image_format"]) + rn_image = win.project+folder+"/"+save_folder+"/"+f + if os.path.exists(rn_image): + rn_files.append(f) + for n, frame in enumerate(range(the_render["start_frame"], the_render["end_frame"]+1)): frame_w = (win.current["w"]-630)/amount_of_frames @@ -170,9 +192,30 @@ def layer(win, call): minus_w = -1 round_r = 0 + f = getfileoutput(frame, the_render["image_format"]) + + + UI_color.set(layer, win, "node_background") + if f not in rn_files: + UI_color.set(layer, win, "dark_overdrop") + if the_render["analytics"][save_folder].get(str(frame)) == shortest: + UI_color.set(layer, win, "node_blendfile") if win.render_runtime.get("current_frame", 0) == frame and win.render_runtime.get("to_render"): UI_color.set(layer, win, "progress_active") + if the_render["analytics"][save_folder].get(str(frame)) == longest: + UI_color.set(layer, win, "node_badfile") + if int(win.current["frame"]/2) % (len(rn_files)) == frame\ + and not win.current["render_preview_hovering"]: + UI_color.set(layer, win, "progress_active") + if 580+(n*frame_w) < win.current["mx"] < 580+(n*frame_w)+frame_w: + UI_color.set(layer, win, "progress_active") + preview_image = getfileoutput(frame, the_render["image_format"]) + if str(frame) in the_render["analytics"][save_folder]: + write_hovering = True + UI_elements.tooltip(win, "Fra:"+str(frame)+"\n"+f+"\n"+UI_math.timestring(the_render["analytics"][save_folder].get(str(frame))/1000000)) + elif not write_hovering: + write_hovering = False UI_elements.roundrect(layer, win, 580+(n*frame_w), 100+(win.current["h"]-200-frame_h), @@ -180,21 +223,35 @@ def layer(win, call): frame_h, int((frame_w-2)/2)) - rn_files.append(getfileoutput(frame, the_render["image_format"])) + - render = list(win.renders.keys())[0] - folder = render[:render.rfind("/")] - for f in reversed(rn_files): + + + win.current["render_preview_hovering"] = write_hovering + + + + rn_image = win.project+folder+"/"+save_folder+"/"+preview_image + if os.path.exists(rn_image): + UI_elements.image(layer, win, rn_image, + 580, + 100, + win.current["w"] - 630, + int((win.current["h"]-200)/3*1.9), + cell="render_preview") + else: + + n = int(win.current["frame"]/2) % (len(rn_files)) + f = rn_files[n] rn_image = win.project+folder+"/"+save_folder+"/"+f - if os.path.exists(rn_image): - UI_elements.image(layer, win, rn_image, - 580, - 100, - win.current["w"] - 630, - int((win.current["h"]-200)/3*1.9), - cell="render_preview") - break + UI_elements.image(layer, win, rn_image, + 580, + 100, + win.current["w"] - 630, + int((win.current["h"]-200)/3*1.9), + cell="render_preview") + if win.render_runtime.get("to_render"): @@ -203,8 +260,8 @@ def layer(win, call): layer.move_to(50, win.current["h"]-30) layer.show_text(win.render_runtime.get("current_progress", "")) - except: - pass + except Exception as e: + print(e) ######################################################################### #