A bit more, better and nicer goods.
This commit is contained in:
parent
09c4e7c046
commit
7f1d70da03
1 changed files with 68 additions and 67 deletions
|
@ -127,83 +127,84 @@ def layer(win, call):
|
||||||
#########################################################################
|
#########################################################################
|
||||||
|
|
||||||
# Here I want to do a preview that's going to be rendered on the right side
|
# Here I want to do a preview that's going to be rendered on the right side
|
||||||
|
try:
|
||||||
|
the_render = win.renders[list(win.renders.keys())[0]]
|
||||||
|
amount_of_frames = the_render["end_frame"] - the_render["start_frame"] + 1
|
||||||
|
|
||||||
the_render = win.renders[list(win.renders.keys())[0]]
|
|
||||||
amount_of_frames = the_render["end_frame"] - the_render["start_frame"]
|
|
||||||
|
|
||||||
|
|
||||||
passed = time.time() - win.render_runtime.get("started_rendering", 0)
|
|
||||||
passed = passed*1000000
|
|
||||||
if win.render_runtime.get("to_render"):
|
|
||||||
longest = passed
|
|
||||||
else:
|
|
||||||
longest = 0
|
|
||||||
|
|
||||||
|
|
||||||
|
passed = time.time() - win.render_runtime.get("started_rendering", 0)
|
||||||
save_folder = the_render["save_folder"]
|
passed = passed*1000000
|
||||||
for i in the_render["analytics"][save_folder].values():
|
if win.render_runtime.get("to_render"):
|
||||||
if i > longest:
|
longest = passed
|
||||||
longest = i
|
else:
|
||||||
rn_files = []
|
longest = 0
|
||||||
for n, frame in enumerate(range(the_render["start_frame"], the_render["end_frame"])):
|
|
||||||
|
|
||||||
frame_w = (win.current["w"]-630)/amount_of_frames
|
|
||||||
frame_h = (win.current["h"]-200)/3
|
|
||||||
|
|
||||||
try:
|
|
||||||
frac = the_render["analytics"][save_folder][str(frame)] / longest
|
|
||||||
|
|
||||||
frame_h = frame_h * frac
|
|
||||||
except Exception as e:
|
|
||||||
frame_h = 0
|
|
||||||
|
|
||||||
|
|
||||||
if win.render_runtime.get("current_frame", 0) == frame and win.render_runtime.get("to_render"):
|
save_folder = the_render["save_folder"]
|
||||||
frame_h = (win.current["h"]-200)/3 * (passed / longest)
|
for i in the_render["analytics"][save_folder].values():
|
||||||
|
if i > longest:
|
||||||
|
longest = i
|
||||||
|
rn_files = []
|
||||||
|
for n, frame in enumerate(range(the_render["start_frame"], the_render["end_frame"]+1)):
|
||||||
|
|
||||||
frame_h = max(frame_h, frame_w)
|
frame_w = (win.current["w"]-630)/amount_of_frames
|
||||||
|
frame_h = (win.current["h"]-200)/3
|
||||||
|
|
||||||
minus_w = 2
|
try:
|
||||||
round_r = int((frame_w-2)/2)
|
frac = the_render["analytics"][save_folder][str(frame)] / longest
|
||||||
if frame_w < 5:
|
|
||||||
minus_w = -1
|
|
||||||
round_r = 0
|
|
||||||
|
|
||||||
UI_color.set(layer, win, "node_background")
|
|
||||||
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),
|
|
||||||
100+(win.current["h"]-200-frame_h),
|
|
||||||
frame_w-minus_w,
|
|
||||||
frame_h,
|
|
||||||
int((frame_w-2)/2))
|
|
||||||
|
|
||||||
rn_files.append(getfileoutput(frame, the_render["image_format"]))
|
frame_h = frame_h * frac
|
||||||
|
except Exception as e:
|
||||||
|
frame_h = 0
|
||||||
|
|
||||||
render = list(win.renders.keys())[0]
|
|
||||||
folder = render[:render.rfind("/")]
|
|
||||||
for f in reversed(rn_files):
|
|
||||||
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
|
|
||||||
|
|
||||||
|
if win.render_runtime.get("current_frame", 0) == frame and win.render_runtime.get("to_render"):
|
||||||
if win.render_runtime.get("to_render"):
|
frame_h = (win.current["h"]-200)/3 * (passed / longest)
|
||||||
UI_color.set(layer, win, "text_normal")
|
|
||||||
layer.set_font_size(20)
|
frame_h = max(frame_h, frame_w)
|
||||||
layer.move_to(50,
|
|
||||||
win.current["h"]-30)
|
minus_w = 2
|
||||||
layer.show_text(win.render_runtime.get("current_progress", ""))
|
round_r = int((frame_w-2)/2)
|
||||||
|
if frame_w < 5:
|
||||||
|
minus_w = -1
|
||||||
|
round_r = 0
|
||||||
|
|
||||||
|
UI_color.set(layer, win, "node_background")
|
||||||
|
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),
|
||||||
|
100+(win.current["h"]-200-frame_h),
|
||||||
|
frame_w-minus_w,
|
||||||
|
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):
|
||||||
|
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
|
||||||
|
|
||||||
|
|
||||||
|
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", ""))
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
#########################################################################
|
#########################################################################
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in a new issue