From da9dcb7d55e9e9abbdf54d422fff5265cbb81b36 Mon Sep 17 00:00:00 2001 From: "Jeison Yehuda Amihud (Blender Dumbass)" Date: Mon, 19 Sep 2022 16:12:22 +0000 Subject: [PATCH] Upload files to 'studio' --- studio/studio_dialogs.py | 8 ++++++ studio/studio_scriptLayer.py | 52 +++++++++++++++++++++++++++++++++++- 2 files changed, 59 insertions(+), 1 deletion(-) diff --git a/studio/studio_dialogs.py b/studio/studio_dialogs.py index f95622d..f478a9b 100644 --- a/studio/studio_dialogs.py +++ b/studio/studio_dialogs.py @@ -88,6 +88,14 @@ from UI import UI_helpDialog # # the top. # def file_select(win, name, call, force=False, IMAGE=True, BLEND=False, VIDEO=True, FILE=False, CHR=True, VEH=True, LOC=True, OBJ=True, RND=False, FOLDER=False, SEARCH=""): + + + # Forcing reload of the fileswin.current["AllFiles"] = [] + + try: + del win.current["AllFiles"] + except: + pass # This function will select files for any kind of stuff. It will search # through the files of the project. Similar to image searcher in the old diff --git a/studio/studio_scriptLayer.py b/studio/studio_scriptLayer.py index 66de164..d8ee665 100644 --- a/studio/studio_scriptLayer.py +++ b/studio/studio_scriptLayer.py @@ -1060,6 +1060,16 @@ def layer(win): win.story["shot_colors"] = {} surl = "/"+scene+"/"+shotis + + # Making it scroll to the selected shot in the story itself. + # Thankyou very much... + + if "scroll_shot_to_in_script" not in win.current: + win.current["scroll_shot_to_in_script"] = True + + if surl == win.cur and win.current["scroll_shot_to_in_script"]: + win.scroll["script"] = (0 - current_Y) + (win.current["h"]/2) + win.current["scroll_shot_to_in_script"] = False if surl not in win.story["shot_colors"]: @@ -2391,6 +2401,42 @@ def layer(win): 10) current_Y_shots = current_Y_shots + 50 + + # The user might want to add the subfolders if they do not + # exist already. + + at_least_one_missing = False + list_of_folders_to_generate = ["storyboard", "opengl", "test_rnd", "rendered", "extra"] + for i in list_of_folders_to_generate: + if i not in os.listdir(win.project+"/rnd"+win.cur): + at_least_one_missing = True + + if at_least_one_missing: + + def do(): + for i in list_of_folders_to_generate: + try: + os.mkdir(win.project+"/rnd"+win.cur+"/"+i) + except: + pass + UI_elements.roundrect(layer, win, + 10, + y+win.scroll["script_shots"]+current_Y_shots-10, + width-30, + 40, + 10, + button=do, + icon="folder", + tip=talk.text("GenerateSubfoldersTip")) + + UI_color.set(layer, win, "text_normal") + layer.move_to(60, y+win.scroll["script_shots"]+current_Y_shots+15) + layer.show_text(talk.text("GenerateSubfolders")) + + current_Y_shots = current_Y_shots + 50 + + + # Now after we have the progress bar / selection type thingy. # let's do a preview of the render. Usually. When rendering @@ -2921,7 +2967,9 @@ def layer(win): win.text["shot_search"]["text"] = "" win.images = {} - + + # Running the dialog starter + studio_dialogs.file_select(win, shotis+"_blends", after, force=True, IMAGE=False, BLEND=True, VIDEO=False, FILE=False, CHR=False, VEH=False, LOC=False, OBJ=False, RND=True, FOLDER=False, SEARCH=scene) @@ -2973,6 +3021,8 @@ def layer(win): def do(): win.cur = surl + win.current["scroll_shot_to_in_script"] = True + UI_elements.roundrect(layer, win, x,