🧹 Massive Asset Reorganization: Cleaned filenames, removed duplicates, and sorted into UI/Items/Env/Chars/Animals folders.

This commit is contained in:
2026-01-20 20:13:59 +01:00
parent ae1cf2e9bf
commit aab61aaa51
3058 changed files with 1135 additions and 19 deletions

76
scripts/ultimate_sort.py Normal file
View File

@@ -0,0 +1,76 @@
import os
import shutil
ROOT_DIR = os.path.abspath("assets/slike/glavna_referenca")
# Define target folders
FOLDERS = {
"UI": ["button", "gumb", "heart", "srce", "health", "frame", "okvir", "meter", "virus", "amnesia", "blur", "ui_", "interface", "vfx", "sparkle", "glow", "smoke", "burst", "shine", "panel", "bar", "stamina", "icon", "slot", "window", "cursor", "menu", "action_", "glint", "preference", "arrow", "scroll", "stars", "visual", "badge", "reference", "eye", "uploaded"],
"Items": ["tool", "orodje", "axe", "pickaxe", "kramp", "sekira", "seed", "seme", "longboard", "memory", "photo", "helmet", "souvenir", "item_", "bag", "crate", "barrel", "box", "chest", "plank", "wood", "log", "les", "stone", "kamen", "iron", "gold", "ore", "ingot", "ruda", "rope", "vrv", "key", "kljuc", "potion", "napoj", "sprout", "harvest", "crop", "strawberry", "corn", "wheat", "potato", "carrot", "buce", "pumpkin", "scrap", "supply", "sandbag", "trough", "shirt", "pants", "hat", "clothing", "armor", "food", "meat", "coffee", "coal", "mask", "gas", "grenade", "club", "golf", "weapon", "stick", "gear", "sapling", "marker", "crossbow", "backpack", "pack", "battery", "bread", "candy", "cake", "cloth", "crystal", "egg", "glue", "honey", "herb", "machete", "flail", "antidote", "drink", "leaf", "lettuce", "cannabis", "download", "pistol", "rifle", "shotgun", "sword", "mace", "spear", "bow", "nailbat", "bat", "whip", "scythe", "sickle", "shears", "staff", "molotov", "knife", "gauntlet", "soup", "milk", "cheese", "berries", "soda", "sulfur", "tape", "wire", "plastic", "screw", "nail", "bucket", "boots", "scarf", "vest", "hoodie", "mushroom", "pepper", "glass", "shard", "book", "bottle", "sack", "flour", "grain", "needle", "thread", "wrench", "trowel", "chain", "pitchfork", "pan", "rake", "bone", "chemistry", "skull", "banner", "resource", "collect"],
"Environment": ["grass", "trava", "dirt", "zemlja", "mine_wall", "house", "hisa", "barn", "skedenj", "building", "city", "mesto", "wall", "fence", "graveyard", "church", "shop", "ruin", "temple", "shrine", "monument", "tower", "silo", "windmill", "well", "fountain", "bench", "table", "chair", "lamp", "lantern", "torch", "sign", "path", "cesta", "road", "tree", "drevo", "bush", "grm", "flower", "roza", "rock", "skala", "decor", "arch", "plaza", "overhang", "roof", "repair", "flag", "laundry", "scarecrow", "cart", "wagon", "bicycle", "anvil", "market", "stall", "board", "post", "trash", "pile", "rubble", "ice", "winter", "snow", "soil", "pen", "ash", "wasteland", "gate", "entrance", "gargoyle", "interior", "shelf", "sink", "rack", "circle", "furniture", "cabin", "fire", "pipe", "storage", "pump", "door", "grave", "shelves", "area", "display", "sofa", "stove", "fridge", "wardrobe", "counter", "cauldron", "puddle", "blood", "slime", "void", "willow", "oak", "portal", "shack", "school", "museum", "memorial", "plaque", "straight", "tjunction", "patch", "stage", "foundation", "clinic", "hospital", "shed", "plot", "spring", "grate", "brick", "fog", "upgraded", "deluxe", "simple", "dark"],
"Characters": ["kai", "ana", "gronk", "dreads", "piercing", "ghost", "spirit", "parent", "mom", "dad", "starse", "npc", "liki", "player", "walk", "idle", "attack", "jump", "run", "death", "hit", "human", "man", "woman", "person", "trader", "doctor", "smith", "guard", "susi", "tehnik", "druid", "priest", "chief", "guide", "keeper", "king", "sage", "tamer", "hermit", "scribe", "nomad", "ranger", "townsfolk", "hunter", "fisher", "researcher", "thief", "monk", "carver", "specialist", "witch", "stalker", "police", "survivor", "raider", "diver", "engineer", "scientist", "captain", "advisor", "worker", "apprentice", "oracle", "dancer", "scholar", "mystic", "enchantress", "mechanic", "diplomat", "expert", "elf", "assassin", "warlord", "giant", "boss", "lord", "angel", "shepherd", "historian", "hazmat", "elves", "fairies", "trolls"],
"Animals": ["dog", "pes", "insect", "zuzelka", "bug", "deer", "srna", "rabbit", "zajec", "cow", "krava", "pig", "zombie_dog", "infected_animal", "mutant", "zombi", "zombie", "monster", "beast", "wolf", "vuk", "bear", "medved", "spider", "pajek", "bee", "cebela", "metulj", "butterfly", "chicken", "kokos", "bird", "frog", "snake", "moth", "cicada", "dragon", "fly", "wasp", "goat", "trex", "hydra", "yeti", "chimera", "basilisk", "kitsune", "kelpie", "roc", "medusa", "mermaid", "quetzalcoatl", "banshee", "cerberus", "gnome", "golem", "skeleton", "horse", "brachiosaurus", "carnotaurus", "parasaurolophus", "spinosaurus", "morpho", "chupacabra", "kraken"],
"Biomes": ["meadow", "travnik", "forest", "gozd", "swamp", "snow", "biome_", "desert", "puščava", "jungle", "dzungla", "volcano", "vulkan", "cave", "jama", "atlantis", "chernobyl", "egypt"]
}
def ultimate_sort():
print("🚀 Starting ULTIMATE SORT based on user rules...")
# Create folders
for folder in FOLDERS:
path = os.path.join(ROOT_DIR, folder)
if not os.path.exists(path):
os.makedirs(path)
stats = {k: 0 for k in FOLDERS}
# Iterate all files
for filename in os.listdir(ROOT_DIR):
if filename.startswith("."): continue
src_path = os.path.join(ROOT_DIR, filename)
if os.path.isdir(src_path): continue # Skip folders we just made
lower_name = filename.lower()
target_folder = None
# Priority Logic (First match wins)
# 1. UI is very specific
if any(k in lower_name for k in FOLDERS["UI"]):
target_folder = "UI"
# 2. Characters (Specific + Suffixes)
elif any(k in lower_name for k in FOLDERS["Characters"]) or \
lower_name.endswith(("er.png", "or.png", "ist.png", "ant.png")):
target_folder = "Characters"
# 3. Animals
elif any(k in lower_name for k in FOLDERS["Animals"]):
target_folder = "Animals"
# 4. Items
elif any(k in lower_name for k in FOLDERS["Items"]):
target_folder = "Items"
# 5. Environment (Buildings go here)
elif any(k in lower_name for k in FOLDERS["Environment"]):
target_folder = "Environment"
# 6. Biomes
elif any(k in lower_name for k in FOLDERS["Biomes"]):
target_folder = "Biomes"
if target_folder:
dst_path = os.path.join(ROOT_DIR, target_folder, filename)
# Handle duplicates
if os.path.exists(dst_path):
name, ext = os.path.splitext(filename)
c = 1
while os.path.exists(os.path.join(ROOT_DIR, target_folder, f"{name}_{c}{ext}")):
c += 1
dst_path = os.path.join(ROOT_DIR, target_folder, f"{name}_{c}{ext}")
shutil.move(src_path, dst_path)
stats[target_folder] += 1
print("\n✨ SORTING COMPLETE:")
for k, v in stats.items():
print(f" 📂 {k}: {v} files")
if __name__ == "__main__":
ultimate_sort()