๐ stewbeet.plugins.finalyze.check_unused_textures
๐ Source Code: stewbeet/plugins/finalyze/check_unused_textures/__init__.py ๐
๐ Dependencies
- โ
Required:
meta.stewbeet.textures_folderconfiguration - โ Required: Beet context with resource pack assets
- ๐ Position: Must run after all texture-generating plugins
- ๐ Related: Works with any plugins that generate textures
๐ Overview
The finalyze.check_unused_textures plugin analyzes texture usage in resource packs.
It scans all PNG files in the textures folder, compares them with texture references
in the generated resource pack, and provides warnings for unused texture files
to help optimize resource pack size and identify orphaned assets.
Feature Showcase
Warning message in terminal:

๐ฏ Purpose
- ๐ Identifies unused texture files in the resource pack
- ๐ Analyzes texture references across all generated assets
- โ ๏ธ Provides warnings for orphaned texture files
- ๐๏ธ Helps optimize resource pack size by finding unused assets
- ๐ Generates detailed reports of unused texture paths
- ๐งน Assists in resource pack cleanup and maintenance
โ๏ธ Configuration
๐ฏ Basic Example Configuration
pipeline: - ... - stewbeet.plugins.finalyze.check_unused_textures # Should run after all texture-generating plugins - ... meta: stewbeet: textures_folder: "assets/textures" # Required: path to textures folder
๐ Configuration Options
| Option | Type | Default | Description |
|---|---|---|---|
textures_folder | string | Required | Path to the folder containing PNG texture files |
| Warning Output | automatic | Enabled | Shows warnings for unused textures in console |
| File Extension | constant | .png | Only PNG files are analyzed for texture usage |
| Path Comparison | automatic | Relative | Compares relative paths from textures folder |
โจ Features
๐ Texture Discovery System
Scans the textures folder for all PNG files:
- ๐ Recursively searches the configured textures folder
- ๐ผ๏ธ Identifies all PNG files using glob pattern
*.png - ๐ Calculates relative paths from the textures folder root
- ๐ Builds comprehensive texture inventory for analysis
๐ Usage Analysis Engine
Compares texture files with resource pack references:
- ๐ Checks each texture against
ctx.assets.texturescollection - ๐ฏ Handles both Texture objects and string references
- โ๏ธ Removes file extensions for accurate path matching
- ๐ Uses
endswith()matching for flexible path comparison
โ ๏ธ Unused Texture Detection
Identifies orphaned texture files not referenced in the pack:
- ๐ซ Detects textures with no matching references in the resource pack
- ๐ Collects unused texture paths in a dedicated set
- ๐ฏ Supports both direct texture objects and string path references
- โ Ensures accurate detection through comprehensive path matching
๐ Warning Report Generation
Provides detailed warnings for unused textures:
- ๐ Sorts unused texture paths alphabetically for organized output
- ๐ Shows complete file paths relative to textures folder
- โ ๏ธ Generates multi-line warning messages with clear formatting
- ๐จ Uses structured warning format for easy identification