No More Shots tag + updated analytics of scenes.
This commit is contained in:
parent
7d8a433d97
commit
618c72e22e
|
@ -19,6 +19,7 @@ from settings import talk
|
||||||
|
|
||||||
#studio
|
#studio
|
||||||
from studio import analytics
|
from studio import analytics
|
||||||
|
from studio import story
|
||||||
from studio import history
|
from studio import history
|
||||||
|
|
||||||
def get_list(filepath):
|
def get_list(filepath):
|
||||||
|
@ -523,6 +524,7 @@ def draw(outlayer, win, path, back="story_editor"):
|
||||||
|
|
||||||
# Saving
|
# Saving
|
||||||
save(path, win.checklists[path])
|
save(path, win.checklists[path])
|
||||||
|
win.story = story.load(win.project)
|
||||||
win.checklists = {}
|
win.checklists = {}
|
||||||
win.assets = {}
|
win.assets = {}
|
||||||
win.analytics = analytics.load(win.project)
|
win.analytics = analytics.load(win.project)
|
||||||
|
@ -665,6 +667,7 @@ def draw(outlayer, win, path, back="story_editor"):
|
||||||
|
|
||||||
# Saving
|
# Saving
|
||||||
save(path, win.checklists[path])
|
save(path, win.checklists[path])
|
||||||
|
win.story = story.load(win.project)
|
||||||
win.checklists = {}
|
win.checklists = {}
|
||||||
win.assets = {}
|
win.assets = {}
|
||||||
win.analytics = analytics.load(win.project)
|
win.analytics = analytics.load(win.project)
|
||||||
|
@ -699,6 +702,7 @@ def draw(outlayer, win, path, back="story_editor"):
|
||||||
|
|
||||||
# Saving
|
# Saving
|
||||||
save(path, win.checklists[path])
|
save(path, win.checklists[path])
|
||||||
|
win.story = story.load(win.project)
|
||||||
win.checklists = {}
|
win.checklists = {}
|
||||||
win.assets = {}
|
win.assets = {}
|
||||||
win.analytics = analytics.load(win.project)
|
win.analytics = analytics.load(win.project)
|
||||||
|
@ -795,6 +799,7 @@ def draw(outlayer, win, path, back="story_editor"):
|
||||||
|
|
||||||
# Saving
|
# Saving
|
||||||
save(path, win.checklists[path])
|
save(path, win.checklists[path])
|
||||||
|
win.story = story.load(win.project)
|
||||||
win.checklists = {}
|
win.checklists = {}
|
||||||
win.assets = {}
|
win.assets = {}
|
||||||
win.multiuser["last_request"] = ""
|
win.multiuser["last_request"] = ""
|
||||||
|
@ -915,6 +920,7 @@ def draw(outlayer, win, path, back="story_editor"):
|
||||||
|
|
||||||
# Saving
|
# Saving
|
||||||
save(path, win.checklists[path])
|
save(path, win.checklists[path])
|
||||||
|
win.story = story.load(win.project)
|
||||||
win.checklists = {}
|
win.checklists = {}
|
||||||
win.assets = {}
|
win.assets = {}
|
||||||
win.analytics = analytics.load(win.project)
|
win.analytics = analytics.load(win.project)
|
||||||
|
@ -1096,6 +1102,7 @@ def draw(outlayer, win, path, back="story_editor"):
|
||||||
|
|
||||||
# Saving
|
# Saving
|
||||||
save(path, win.checklists[path])
|
save(path, win.checklists[path])
|
||||||
|
win.story = story.load(win.project)
|
||||||
win.checklists = {}
|
win.checklists = {}
|
||||||
win.assets = {}
|
win.assets = {}
|
||||||
win.analytics = analytics.load(win.project)
|
win.analytics = analytics.load(win.project)
|
||||||
|
|
|
@ -675,7 +675,10 @@ def load(project):
|
||||||
for scenename in data["scenes"]:
|
for scenename in data["scenes"]:
|
||||||
|
|
||||||
shotsfractions = []
|
shotsfractions = []
|
||||||
|
textlength = 0
|
||||||
for shot in data["scenes"][scenename]["shots"]:
|
for shot in data["scenes"][scenename]["shots"]:
|
||||||
|
for t in shot[-1]:
|
||||||
|
textlength = textlength + len(t[-1])
|
||||||
if shot[0] == "shot_block":
|
if shot[0] == "shot_block":
|
||||||
|
|
||||||
# Let's see if it has a checklist.
|
# Let's see if it has a checklist.
|
||||||
|
@ -709,10 +712,26 @@ def load(project):
|
||||||
shotsfractions.append(0.2)
|
shotsfractions.append(0.2)
|
||||||
except:
|
except:
|
||||||
shotsfractions.append(0.0)
|
shotsfractions.append(0.0)
|
||||||
|
|
||||||
|
|
||||||
|
# If the last block isn't shot_block. It's safe to assume that
|
||||||
|
# not all of the shots are yet marked in the text. Therefor we
|
||||||
|
# want to estimate how much is marked.
|
||||||
|
|
||||||
|
multiply_by = 1
|
||||||
|
if not data["scenes"][scenename].get("no_more_shots") and data["scenes"][scenename]["shots"][-1][0] == "text_block":
|
||||||
|
lastlen = 0
|
||||||
|
for t in data["scenes"][scenename]["shots"][-1][-1]:
|
||||||
|
lastlen = lastlen + len(t[-1])
|
||||||
|
try:
|
||||||
|
multiply_by = (textlength - lastlen) / textlength
|
||||||
|
except:
|
||||||
|
multiply_by = 1
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
data["scenes"][scenename]["fraction"] = \
|
data["scenes"][scenename]["fraction"] = \
|
||||||
sum(shotsfractions) / len(shotsfractions)
|
( sum(shotsfractions) / len(shotsfractions) ) * multiply_by
|
||||||
except:
|
except:
|
||||||
data["scenes"][scenename]["fraction"] = 0.0
|
data["scenes"][scenename]["fraction"] = 0.0
|
||||||
|
|
||||||
|
|
|
@ -2094,7 +2094,33 @@ def layer(win):
|
||||||
# or rendering.
|
# or rendering.
|
||||||
|
|
||||||
# Since it's the last thing I'm drawing to this layer. I guess we can clip it.
|
# Since it's the last thing I'm drawing to this layer. I guess we can clip it.
|
||||||
|
|
||||||
|
# Small progress bar of the scene:
|
||||||
|
# # Progressbar
|
||||||
|
|
||||||
|
scenedone = win.story["scenes"][scene]["fraction"]
|
||||||
|
UI_color.set(layer, win, "progress_background")
|
||||||
|
UI_elements.roundrect(layer, win,
|
||||||
|
150,
|
||||||
|
25,
|
||||||
|
win.current["w"]/4-180,
|
||||||
|
20,
|
||||||
|
10,
|
||||||
|
tip="Entire scene: "+str(round(scenedone*100, 1))+"%")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Project Done
|
||||||
|
UI_color.set(layer, win, "progress_active")
|
||||||
|
UI_elements.roundrect(layer, win,
|
||||||
|
150,
|
||||||
|
25,
|
||||||
|
(win.current["w"]/4-180)*scenedone,
|
||||||
|
20,
|
||||||
|
10)
|
||||||
|
|
||||||
|
|
||||||
x = 10
|
x = 10
|
||||||
y = 70
|
y = 70
|
||||||
width = win.current["w"] / 4 - 20
|
width = win.current["w"] / 4 - 20
|
||||||
|
@ -2781,7 +2807,7 @@ def layer(win):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
for blend in os.listdir(win.project+"/rnd"+win.cur):
|
for blend in os.listdir(win.project+"/rnd"+win.cur):
|
||||||
if blend.endswith(".blend"):
|
if blend.endswith(".blend") and "_backup" not in blend:
|
||||||
blendfiles.append(blend)
|
blendfiles.append(blend)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
@ -3159,7 +3185,41 @@ def layer(win):
|
||||||
break
|
break
|
||||||
|
|
||||||
current_Y_shots = current_Y_shots + 60
|
current_Y_shots = current_Y_shots + 60
|
||||||
|
|
||||||
|
# Button for [ That's All The Shots ].
|
||||||
|
# The idea is that untill this button is pressed the program will try
|
||||||
|
# to estimate how many shots there are still in the text, by looking at
|
||||||
|
# the amount of the text. If this button is pressed. The estimation will
|
||||||
|
# be ignored.
|
||||||
|
|
||||||
|
if "no_more_shots" not in win.story["scenes"][scene]:
|
||||||
|
win.story["scenes"][scene]["no_more_shots"] = False
|
||||||
|
icon = "checked"
|
||||||
|
if not win.story["scenes"][scene]["no_more_shots"]:
|
||||||
|
icon = "unchecked"
|
||||||
|
|
||||||
|
def do():
|
||||||
|
win.story["scenes"][scene]["no_more_shots"] = not win.story["scenes"][scene]["no_more_shots"]
|
||||||
|
story.save(win.project, win.story)
|
||||||
|
win.story = story.load(win.project)
|
||||||
|
|
||||||
|
UI_elements.roundrect(layer, win,
|
||||||
|
x,
|
||||||
|
y+win.scroll["script_shots"]+current_Y_shots,
|
||||||
|
width,
|
||||||
|
40,
|
||||||
|
10,
|
||||||
|
button=do,
|
||||||
|
icon=icon)
|
||||||
|
|
||||||
|
UI_color.set(layer, win, "text_normal")
|
||||||
|
layer.set_font_size(20)
|
||||||
|
layer.move_to(x+50,
|
||||||
|
y+win.scroll["script_shots"]+current_Y_shots+27 )
|
||||||
|
layer.show_text("No More Shots")
|
||||||
|
current_Y_shots = current_Y_shots + 60
|
||||||
|
|
||||||
|
|
||||||
# Scroll
|
# Scroll
|
||||||
UI_elements.scroll_area(layer, win, "script_shots",
|
UI_elements.scroll_area(layer, win, "script_shots",
|
||||||
x+0,
|
x+0,
|
||||||
|
|
Loading…
Reference in a new issue