Hi! I'm resuming my work on a resource pack, and was wondering if there's a program out there that can convert a spritesheet into a resourcepack folder, I can technically do it in aseprite manually, but it will have to change with every version and it will take many hours to accomplish, is there already a .aseprite file out there with the necessary sprite slices? Sorry if this isn't Blockbench related, but I'm sure someone here might know.
#Resource Pack Spritesheet
48 messages Β· Page 1 of 1 (latest)
Welcome to the help forum! Once your question has been resolved, please mark the post as closed by typing !close.
I've once made a small tool for that, but you have to declare the slices and textures in json.
(I made it for personal use) but I could send you a copy if you want.
i made a program that will take an input resource pack (vanilla pack for example), combine it all into a single spritesheet, and then there is a second program that splits the spritesheet back into its individual textures again in the correct folder structure
if you want that let me know
This is exactly what I'm looking for! If you're willing to share it would be incredibly appreciated
This too, I'm not exactly sure what json means / does, but Id still be willing to try it out
how to use:
run buildImage, select a folder. an image preview will appear, close that, then you get textures.png and textures.json
leave textures.json alone, and run splitImage to split the texture sheet up
Thank you!! Do you know where I can find a vanilla resoruce pack for the latest version of MC?
!faq default pack
Disclaimer: Use these packs as REFERENCE, don't put your models inside them, it just increases your pack needlessly. Also don't put any of the unedited files from it into your own pack. The distributions of default assets in your pack is illegal.
For Java Edition:
(This works the same for all versions, 1.17 is just used as an example here)
Go to .minecraft/versions/1.17 and open the 1.17.jar in there with a zip program. Alternativley you can copy the .jar file and change the file extension to .zip and double click it.
Extract/copy the "assets" folder inside the jar somewhere. It contains all the default models/textures.
For Bedrock Edition:
Go to https://docs.microsoft.com/en-us/minecraft/creator/documents/resourcepack and scroll to "Building the Resource Pack". The download for the vanilla resource pack can be found right above that title.
Alternatively here is the direct download link: https://aka.ms/resourcepacktemplate
Does this also work with custom stuff Ewan?
Your tool seems more sophisticated then mine π
works with any folder
you might need to tweak the filters
builtimage has an ignored regular expression
it will ignore files that match that
i should remake this in node.js
Anyways, here's my tool, simply create the atlas texture in the size you want.
And a json file that is called "<your_atlas>.png.json"
The JSON looks like follows:
{
"x:y" : "texture_name",
"0:0:4:1": "kelp",
"x:y:dx:dy": "kelp"
}
x and y are pixel coordinates, multiplied by your resolution.
dx and dy are used for animated textures, just specify how many tiles your texture is high/wide.
The kelp in the example would have 4 frames.
You can then run it using this command:
AtlasSplitter.exe --input "./atlas.png" --output "../output/assets/minecraft/textures/block/" --w 16 --h 16
--w and --h are the width and height of each tile in pixels.
The atlas texture and json need to be in the same folder.
Output folder can be relative or a fixed path.
I made this so that you can freely setup the atlas as you want it.
Written with Deno btw
I'd like to look at this code, but python is like french to me π
its really simple:
load all textures and get their widths and heights
use rectpack module to calculate optimal spritesheet layout
draw textures to spritesheet
save image location to json file so splitImage can split them apart later
https://www.npmjs.com/package/rectpack looks like a js version, although there may be a better one
Tbh, I am not sure whether I'd like automated spridesheets.
For me the charm of a sprite sheed is that I can place everything where I want it, and see stuff that'll be used together, close to each other.
Though I can see the use for that.
I am simply loading the json & image then cut it up.
I planned to also implement image optimization, but didn't bother as I can just run that as a seperate step.
mine can also be used manually i guess if you just make the textures.json file yourself
it uses this format: js { "C:/Users/ewanh/AppData/Roaming/.minecraft/resourcepacks/1.19.4/assets/icons/icon_16x16.png": { "width": 16, "height": 16, "x": 0, "y": 0 }, "C:/Users/ewanh/AppData/Roaming/.minecraft/resourcepacks/1.19.4/assets/icons/icon_32x32.png": { "width": 32, "height": 32, "x": 16, "y": 0 } }
where the file path is split at assets and used to create the output directories
Is it normal for the program to have the sprites misaligned with the base 16x16 grid?
yes
Okay, thank you again!! This is an incredibly huge help
@sonic ember
@brittle matrix
I'm here
@lavish scroll sorry for the ping but I looked through your GitHub profile and couldn't find any repository for it. Is it not on GitHub?
Thanks for showing me this π
its not
Aw, alright
I kinda wanna make a fork from it (if that's the right word, I'm still not very used to GitHub haha)
i may rewrite it in javascript at some point and then put it on github
i dont use python anymore
Ah
Wait but is js really used for applications like that? I know how to use node a little bit but I've never really gotten a good overview of how different languages are used
From my perspective js is mostly for websites
the entire point of node.js is that it has nothing to do with websites
fair