Better naviation through shots

This commit is contained in:
Jeison Yehuda Amihud (Blender Dumbass) 2022-10-15 16:42:08 +00:00
parent 7a81c17415
commit cab90e03ee

View file

@ -1690,6 +1690,10 @@ def layer(win):
# Selecting the shot
if win.current["script_shot_higlight"] and win.previous["LMB"] and not win.current["LMB"]:
win.cur = "/"+scene+"/"+win.current["script_shot_higlight"]
win.current["shot_left_side_scroll_please_work_omg_wtf"] = True
# Going to that asset
if win.current["script_asset_higlight"] and win.previous["LMB"] and not win.current["LMB"]:
@ -2076,10 +2080,15 @@ def layer(win):
"shot_5"
]
# So let's itterate over a lit of shots we've got from the textview.
# So let's itterate over a list of shots we've got from the textview.
for shotis in shot_list:
# Getting the color. It's not always works.
if "shot_colors" not in win.story:
@ -2087,6 +2096,13 @@ def layer(win):
surl = "/"+scene+"/"+shotis
if "shot_left_side_scroll_please_work_omg_wtf" not in win.current:
win.current["shot_left_side_scroll_please_work_omg_wtf"] = False
if win.current["shot_left_side_scroll_please_work_omg_wtf"] and win.cur == surl:
win.scroll["script_shots"] = 0-current_Y_shots+60
win.current["shot_left_side_scroll_please_work_omg_wtf"] = False
if surl not in win.story["shot_colors"]:
win.story["shot_colors"][surl] = rcolors[len(win.story["shot_colors"]) % len(rcolors)]
@ -2421,7 +2437,7 @@ def layer(win):
def do():
for i in list_of_folders_to_generate:
try:
os.mkdir(win.project+"/rnd"+win.cur+"/"+i)
os.makedirs(win.project+"/rnd"+win.cur+"/"+i)
except:
pass
UI_elements.roundrect(layer, win,
@ -3023,11 +3039,12 @@ def layer(win):
# If the shot is not selected I want to be able to select it
# even if I can't find it in the text of the script.
def do():
win.cur = surl
win.current["scroll_shot_to_in_script"] = True
win.current["shot_left_side_scroll_please_work_omg_wtf"] = True
UI_elements.roundrect(layer, win,
x,
@ -3040,6 +3057,29 @@ def layer(win):
layer.stroke()
# Then I want to show the user which state is the shot at the
# moment. By putting one of it's icons in the end of the of the
# shot choosing button.
fouricons = [
"storyboard",
"opengl",
"test_rnd",
"rendered"
]
for icon in reversed(fouricons):
try:
files = sorted(os.listdir(win.project+"/rnd"+surl+"/"+icon))
except:
files = []
if files:
UI_elements.image(layer, win,
"settings/themes/"+win.settings["Theme"]+"/icons/"+icon+".png",
width-50, y+win.scroll["script_shots"] + current_Y_shots+5, 40, 40)
break
current_Y_shots = current_Y_shots + 60