From 914f4c57485271e2d7300e9e7117bbdb698dc237 Mon Sep 17 00:00:00 2001 From: "Jeison Yehuda Amihud (Blender Dumbass)" Date: Mon, 26 Jun 2023 19:34:44 +0000 Subject: [PATCH] Updated the way it shows files - Updated the sorting to be 1,2,3,4,5,6,7,8,9,10,11 instead of 1,10,11,2,3,4,5,6,7,8,9 - Made it so it doesn't show _backup files. --- studio/studio_file_selectLayer.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/studio/studio_file_selectLayer.py b/studio/studio_file_selectLayer.py index bfdcbca..49b8019 100644 --- a/studio/studio_file_selectLayer.py +++ b/studio/studio_file_selectLayer.py @@ -22,6 +22,7 @@ from project_manager import pm_project #UI modules from UI import UI_elements from UI import UI_color +from UI import UI_math # Studio from studio import checklist @@ -82,9 +83,12 @@ def layer(win, call): if "AllFiles" not in win.current: win.current["AllFiles"] = [] - for r, d, f in sorted(os.walk(win.project)): + for r, d, f in os.walk(win.project): for item in f: win.current["AllFiles"].append(os.path.join(r, item).replace(win.project, "")) + + UI_math.sort_nicely(win.current["AllFiles"]) + # Now that we have the files. There should be some way to filter them. @@ -223,11 +227,16 @@ def layer(win, call): win.scroll["file_select"] = 0 if "AllFiles" in win.current: - for filename in win.current["AllFiles"]: + for filename in reversed(win.current["AllFiles"]): ######################## FILTERING STARTS ########################## okay = True + + # Remove all _backup files + if "_backup" in filename: + okay = False + # By search