/BrushUp-Mod-Support-Generator

Generates mod support textures for Brush-Up!'s fences, buttons and more

Primary LanguagePython

BrushUp! Mod Support Texture Generator

Made for I_Am_Merp's Brush Up! Resource Pack

Creates support for Fences, Fence Gates, Pressure Plates and Buttons (and more soon, like signs) for other mods' wood variants using just that mod's plank texture (or whatever you so desire).

Assumptions

This generator works on a couple of mechanics and assumptions:

  • The generator assumes that the texture is 16x16. I don't feel like adding support for animated / larger textures, that sounds exhausting

  • The generator assumes that the mod you're adding support for uses logical naming for wood variants, i.e. minecraft uses minecraft:oak_fence_gate, so it expects the mod uses form modid:material_fence_gate, etc.. If a mod does something else then some manual renaming will be required for the output. For windows users I strongly suggest using PowerToys' PowerRename and a scoche of Regular Expression

  • The generator assumes that the mod you're adding support for uses the same block model for the inventory model. You'll see that some mods like Ecologics override the inventory model so you may have to do this as well using the block model generated as an output in this project. I may soon add support for this myself so you don't have to 😉

  • The generator scans the (included, but empty) textures directory, which is expected to be laid out like so:

    PROJECT ROOT
    └── textures
        ├── MODID_1 # some mod you want to add support for, filled with the png textures for each plank
        │   ├── material_1_planks.png
        │   ├── material_2_planks.png
        │   └── material_3_planks.png
        └── MODID_2 # some other mod you want to add support for
            ├── material_4_planks.png
            ├── material_5_planks.png
            └── material_6_planks.png
    
  • The texture is generated by overlaying (yes, I know, ack - but also within all my testing it worked the best) a color, which is derived from an average of four different metrics:

    1. The color in the very center of the texture
    2. The average color, generated by taking the average of every pixel's Red, Green & Blue value
    3. The most dominant color in the texture, generated using K-Means clustering
    4. The least dominant color in the texture, generated using K-Means clustering
  • As you can imagine, dynamically generated textures based off of color won't always be perfect - namely, some textures like Ecologic's Flowering Azalea Planks are too complex to generate programmatically. As such, the overrides folder at the top-level of the project is used to override any resulting generated textures with hand made ones that I've included, and you can add on to. It uses the exact same directory structure that the textures directory uses (see above). Sample Aseprite .ase files have been included, as well as hand-made overrides for the Ecologics Mod and Regions Unexplored.

Setup

Requires Python 3.10 or Greater

Set up using the included requirements.txt and your method of choice. For the easiest setup, install Python 3.10 and then run pip install -r requirements.txt

Usage

Run with python generate.py. Generated textures, models and blockstates will be placed in the out/assets directory. You can take the assets folder and pull it directly into your own resource pack entirely.