From e773ef480f1e1884d6e05226f9722b66c3b6e60b Mon Sep 17 00:00:00 2001 From: oitsjustjose Date: Wed, 1 Jun 2022 23:03:10 -0500 Subject: [PATCH] Update codebase, readme --- README.md | 17 +++++++++++++++++ generate.py | 14 +++++++++----- 2 files changed, 26 insertions(+), 5 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..e43c4b9 --- /dev/null +++ b/README.md @@ -0,0 +1,17 @@ +# MinecraftOreTextureGenerator + +A batch method of overlaying a set of textures onto a set of base layers + +## Usage + +Just download the latest `.zip` file from the [Releases](https://github.com/oitsjustjose/MinecraftOreTextureGenerator/releases/latest) page and unzip it. Once you're done, open the unzipped archive and run `generate.exe` once to generate the folders. You should now see two folders: + +### `base_layers` + +In here, place your background layers - these need to be in `.png` format, but the name doesn't matter and as long as they are the same dimensions as all your other sprites (presumably 16x16 but I'm not your mom), you are good to go. + +### `overlay_layers` + +Likewise to `base_layers`, place the layers you want overlaid onto your base layers in here - once again these need to be the same resolution as your other sprites and they need to be in `.png` format. + +Once you've gotten all this set up done, run `generate.exe` again - this time you should see an `out` folder be generated, and within it should be all permutations of the files you wanted overlaid! diff --git a/generate.py b/generate.py index c4797c0..aeeca10 100644 --- a/generate.py +++ b/generate.py @@ -16,27 +16,31 @@ def main() -> None: python[3] generate.py .png """ - if not os.path.exists("./out"): - os.mkdir("./out") + err = False if not os.path.exists("./base_layers"): os.mkdir("./base_layers") + err = True print("Base Layers folder not found!") print( "Please place your Base Layer Textures in a new folder adjacent to this file named `base_layers`" ) - input("Press Enter to Exit") - sys.exit(0) - + if not os.path.exists("./overlay_layers"): os.mkdir("./overlay_layers") + err = True print("Overlay Layers folder not found!") print( "Please place your Overlay Textures in a new folder adjacent to this file named `overlay_layers`" ) + + if err: input("Press Enter to Exit") sys.exit(0) + if not os.path.exists("./out"): + os.mkdir("./out") + for base_fn in os.listdir("./base_layers"): if not base_fn.endswith(".png"): continue