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
|
||||
|
||||
the_render = win.renders[list(win.renders.keys())[0]]
|
||||
amount_of_frames = the_render["end_frame"] - the_render["start_frame"]
|
||||
try:
|
||||
the_render = win.renders[list(win.renders.keys())[0]]
|
||||
amount_of_frames = the_render["end_frame"] - the_render["start_frame"] + 1
|
||||
|
||||
|
||||
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)
|
||||
passed = passed*1000000
|
||||
if win.render_runtime.get("to_render"):
|
||||
longest = passed
|
||||
else:
|
||||
longest = 0
|
||||
|
||||
|
||||
|
||||
save_folder = the_render["save_folder"]
|
||||
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"])):
|
||||
save_folder = the_render["save_folder"]
|
||||
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_w = (win.current["w"]-630)/amount_of_frames
|
||||
frame_h = (win.current["h"]-200)/3
|
||||
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
|
||||
try:
|
||||
frac = the_render["analytics"][save_folder][str(frame)] / longest
|
||||
|
||||
frame_h = frame_h * frac
|
||||
except Exception as e:
|
||||
frame_h = 0
|
||||
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"):
|
||||
frame_h = (win.current["h"]-200)/3 * (passed / longest)
|
||||
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)
|
||||
frame_h = max(frame_h, frame_w)
|
||||
|
||||
minus_w = 2
|
||||
round_r = int((frame_w-2)/2)
|
||||
if frame_w < 5:
|
||||
minus_w = -1
|
||||
round_r = 0
|
||||
minus_w = 2
|
||||
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))
|
||||
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"]))
|
||||
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")
|
||||
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
|
||||
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", ""))
|
||||
|
||||
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