#!/usr/bin/env python3 """ Fast Static Asset Gallery Generator Scans assets and generates HTML - NO file copying! """ import os from pathlib import Path from collections import defaultdict # Skip these folders (backups, etc.) SKIP_FOLDERS = {'BACKUP', 'node_modules', '.git', 'out', '__pycache__'} # Categories with keywords CATEGORIES = { "š± Ground & Terrain": ["ground", "grass", "dirt", "soil", "water", "teren", "tla"], "š¾ Crops & Farming": ["crop", "wheat", "potato", "corn", "tomato", "seed", "harvest", "pridelek", "sadik"], "š³ Trees & Nature": ["tree", "apple", "cherry", "dead", "bush", "drevo", "narava", "gozd"], "šļø Props & Objects": ["fence", "chest", "barrel", "crate", "prop", "objekt", "ograja"], "š Buildings": ["house", "barn", "building", "zgradba", "hisa", "gothic"], "š¤ Characters & NPCs": ["character", "npc", "kai", "ana", "gronk", "zombie", "lik", "igralec"], "š„ Effects & VFX": ["blood", "fog", "rain", "vfx", "effect", "kri", "megla"], "šØ UI & Icons": ["icon", "ui", "button", "menu", "ikona"], "š§ Tools & Items": ["tool", "hoe", "axe", "pickaxe", "sword", "orodi", "item"], "š¦ Other": [] } def should_skip(path_str): """Check if we should skip this path.""" for skip in SKIP_FOLDERS: if skip in path_str: return True return False def categorize(filepath): """Determine category from path.""" path_lower = str(filepath).lower() for category, keywords in CATEGORIES.items(): if category == "š¦ Other": continue for kw in keywords: if kw in path_lower: return category return "š¦ Other" def scan_fast(): """Fast scan - limit depth and skip backups.""" categorized = defaultdict(list) count = 0 max_files = 500 # Limit for speed print("š Scanning assets...") for root, dirs, files in os.walk("assets"): # Remove skip folders from search dirs[:] = [d for d in dirs if not should_skip(os.path.join(root, d))] for file in files: if not file.endswith('.png'): continue if count >= max_files: break full_path = os.path.join(root, file) category = categorize(full_path) categorized[category].append({ "path": full_path, "name": file }) count += 1 if count % 50 == 0: print(f" Found {count} assets...") if count >= max_files: break print(f"ā Scanned {count} assets") return categorized def generate_html(categorized): """Generate beautiful HTML gallery.""" total = sum(len(assets) for assets in categorized.values()) html = f"""
Complete Asset Gallery - Static Offline Version