Upload files to 'studio'

This commit is contained in:
Jeison Yehuda Amihud (Blender Dumbass) 2020-12-25 14:20:53 +00:00
parent 6f309f0784
commit 67c1505908
2 changed files with 95 additions and 12 deletions

View file

@ -60,9 +60,9 @@ def record(win, filename, task, checklist=[] ):
################### CHECKLIST OF IMPEMENTED DATATYPES ###################### ################### CHECKLIST OF IMPEMENTED DATATYPES ######################
# [V] [Openned] # WHEN BLEND FILE IS OPENNED [ settings/oscalls.py ] # [V] [Openned] # WHEN BLEND FILE IS OPENNED [ settings/oscalls.py ]
# [ ] [Linked] # AS LINKED ASSET INTO BLEND [] # [V] [Linked] # AS LINKED ASSET INTO BLEND [ studio/studio_shot_linkLayer.py ]
# [ ] [Edited] # WHEN EDITED STORY [] # [V] [Edited] # WHEN EDITED STORY [ studio/studio_scriptLayer.py ]
# [ ] [Updated] # WHEN CONFIGURED STUFF [] # [V] [Updated] # WHEN CONFIGURED STUFF [ studio/studio_asset_configureLayer.py ]
# [V] [Added] # WHEN ADDING A BLEND FILE [ settings/oscalls.py ] # [V] [Added] # WHEN ADDING A BLEND FILE [ settings/oscalls.py ]
# [V] [Added Asset] # WHEN ADDING AN ASSET [ studio/studio_asset_selectLayer.py ] # [V] [Added Asset] # WHEN ADDING AN ASSET [ studio/studio_asset_selectLayer.py ]
# [V] [Checked] # WHEN [V] IN CHECKLIST [ studio/checklist.py ] # [V] [Checked] # WHEN [V] IN CHECKLIST [ studio/checklist.py ]
@ -102,6 +102,11 @@ def record(win, filename, task, checklist=[] ):
item = item.replace("//", "/") item = item.replace("//", "/")
filename = filename.replace("//", "/") filename = filename.replace("//", "/")
# Somebody please look at this. Maybe there is more clever way to record
# editing of scenes. I don't know.
if task == "[Edited]":
item = filename
print("HISTORY: ", t, item, filename, task, checklist) print("HISTORY: ", t, item, filename, task, checklist)
@ -305,9 +310,17 @@ def draw(outlayer, win):
# ICON # ICON
if i == "scenes" and not win.cur: if i == "scenes" and not win.cur:
UI_elements.image(layer, win,
"settings/themes/"+win.settings["Theme"]+"/icons/scene.png", if item.count("/") > 1:
5, win.scroll["history"] + current_Y+5, 40, 40)
UI_elements.image(layer, win,
"settings/themes/"+win.settings["Theme"]+"/icons/shot.png",
5, win.scroll["history"] + current_Y+5, 40, 40)
else:
UI_elements.image(layer, win,
"settings/themes/"+win.settings["Theme"]+"/icons/scene.png",
5, win.scroll["history"] + current_Y+5, 40, 40)
elif i == "assets" and not win.cur: elif i == "assets" and not win.cur:
if os.path.exists(os.getcwd()+"/settings/themes/"+win.settings["Theme"]+"/icons/"+acur+".png"): if os.path.exists(os.getcwd()+"/settings/themes/"+win.settings["Theme"]+"/icons/"+acur+".png"):
@ -335,7 +348,10 @@ def draw(outlayer, win):
win.scroll["history"] + current_Y+30, win.scroll["history"] + current_Y+30,
) )
if not win.cur: if not win.cur:
layer.show_text(name) if "chr" not in item and "veh" not in item and "loc" not in item and "obj" not in item and "set" not in item:
layer.show_text(item.replace("/","",1).replace("/", " | "))
else:
layer.show_text(name.replace("project.progress", win.analytics["name"]))
else: else:
layer.show_text(theday) layer.show_text(theday)
# Selection button # Selection button
@ -450,7 +466,7 @@ def draw(outlayer, win):
operation_icons = { operation_icons = {
"[Openned]":"blender", "[Openned]":"blender",
"[Linked]":"file_link", "[Linked]":"file_link",
"[Edited]":"copy_file", "[Edited]":"scene",
"[Updated]":"update", "[Updated]":"update",
"[Added]":"new", "[Added]":"new",
"[Added Asset]":"asset_new", "[Added Asset]":"asset_new",

View file

@ -707,10 +707,7 @@ def load(project):
except: except:
data["scenes"][scenename]["fraction"] = 0.0 data["scenes"][scenename]["fraction"] = 0.0
print(shotsfractions)
print(data["scenes"][scenename]["fraction"])
print(scenename)
print()
fractions = [] fractions = []
@ -739,3 +736,73 @@ def load(project):
return data return data
def undo_record(win):
# This function will record undo of the story. The undo will be basically
# copies of the script JSON file as a whole. The /pln/story.vcss
# This function will not read the files. It's not nessesary. But it will
# make a copy of the whole thing. So I guess we need to implement some kind
# of limiter.
limit = int(win.settings["Undo_Limit"])
# Now let's advance the undo history 1 forward.
win.undo_index = min(len(win.undo_history)+1, limit)
# Let's read our file
f = open(win.project+'/pln/story.vcss')
win.undo_history.append(f.read())
# And now let's limit our selves
win.undo_history = win.undo_history[0-limit:]
# Following 2 functions are a big buggy at the moment. I will aprecieate if
# someone going to look at them. Maybe it's to do with studio/studio_storyLayer.py
# where I was testing them. But they work. Just not every time.
def undo(win):
# This function will do the undo. Tho this function will not nessesarily
# sens the Ctrl - Z by it self. It should be activated from any place
# in the UI.
# Let's move our index back 1 way.
win.undo_index = max(0, win.undo_index-1)
# Now let's read our data
d = win.undo_history[win.undo_index]
# And let's save the data back to the file
f = open(win.project+'/pln/story.vcss', "w")
f.write(d)
f.close()
# And let's refresh story
win.story = load(win.project)
def redo(win):
# This function will do the redo. Tho this function will not nessesarily
# sens the Ctrl - Y by it self. It should be activated from any place
# in the UI.
# Let's move our index back 1 way.
win.undo_index = min(len(win.undo_history)-1, win.undo_index+1)
# Now let's read our data
d = win.undo_history[win.undo_index]
# And let's save the data back to the file
f = open(win.project+'/pln/story.vcss', "w")
f.write(d)
f.close()
# And let's refresh story
win.story = load(win.project)