Code Monkey home page Code Monkey logo

fnf-spritesheet-and-xml-maker's Introduction

FnF-Spritesheet-and-XML-Maker

A Friday Night Funkin' mod making helper tool that allows you to generate XML files and spritesheets from individual pngs. This is a free and open-source mini-replacement tool to the "Generate Spritesheet" functionality in Adobe Animate/Flash
To download the application for windows instead of running it from source click on this link.

Big Update: There is a web version of this tool available here. If the desktop app does not work for you, then you can try this out instead. Instructions and source code of the web version

Disclaimer: The execuatable on gamebanana only works on windows. Other operating system users should run this from source (or try out the experimental build from the releases here). Instructions to run from source at the bottom of this page.

How to generate spritesheet and XML files for your character:

Update: The instructions below may be a bit outdated, so consider using this video tutorial instead:

Youtube Video tutorial

The name of your character goes into the textbox at the top. This is necessary as the final xml and png files will be named accordingly. Eg: If you name you character Pixel-GF the files generated will be named Pixel-GF.png and Pixel-GF.xml Leaving this box blank will cause an error to show up.

Adding sprite frames

Click the button named "Add Frame Image" to add each pose as frame in the spritesheet, as shown below: Alternatively, go to File > Import Images... to do the same. You can also import frames from existing spritesheets using File > Import Existing Spritesheet and XML

Each "frame" of your spritesheet has a button (to delete that frame) and a checkbox (to change it's animation name):

Use the "Set Animation (Pose) Name" button to name each pose that has been selected (has its checkbox checked). Animation names refer to names like: 'sing down' or 'idle'. To delete any individual frame click the "Delete Frame" button. Pose names can repeat if needed (Eg: You can name 2 or more frames 'sing left' and it'll be taken care of in the xml).

To find out current animation (pose) name of any frame, simply hover the mouse over it and it'll display information about that particular frame.


Clip to bounding box

If your individual frames have extra whitespace in them and you want them all cropped to just their bounding box, click this checkbox before generating the files. This checkbox will show up on clicking the "Spritesheet Generation Settings" button

On left is how the image will be considered if this checkbox is left unchecked. On the right is how it'll be considered if it is checked. (Side note: Most of the time you won't really have to use this feature, but it is provided just in case)

Generating the final XML and PNG files

When you're done adding all the frames and giving them animation names, it's time to generate the final PNG and XML files! To do so, just click the "Generate XML" button. Select the location you want the files saved and the xml and png files will be generated.



Note: Although the main functionality of this application is complete, there are still minor crashing issues and bugs that may need fixing. Updates will be on the way soon. Stay tuned!

UPDATE: The instructions you see in this section below are only to be followed if you are modding the base game, not if you are using kade engine/psych engine.

However, the Spritesheets and XMLs generated by this tool should work for those engines too as they all follow a similar format. If you are using Kade Engine or Psych Engine, follow the specific instructions for that engine.

How to use these files in the source code

Now that you have the .xml and the .png files you can follow the instructions as per this guide by Tuxsuper on gamebanana to add your character into the game. This particular application, as of now, is to help with section 1.3 of the guide in particular (without the use of adobe animate), excluding the parts that have to do with the icon grid. Basically, inside of Character.hx, inside the switch statement shown below:


Add another case like so:

Keep in mind:


How to add your character's icon into the icon-grid PNG using this tool:

The latest version of this tool now comes with icon-grid support, so now you can add your character's icon(s) into the icon grid provided in the game files of FNF. Here's how to add your icons into the icon-grid ( Funkin\assets\preload\images\iconGrid.png )

Click on the tab named "Add Icons to Icon-grid"

Upload your iconGrid.png file into the application

Click on the "Upload Icon-grid" button to upload your "iconGrid.png" file (Note the this application will OVERWRITE this iconGrid image, so keep some backups of the iconGrid.png file at hand, just in case).

Add your icon(s):

Friday Night Funkin' healthbar icons MUST be 150x150 pixels in size (according to it's source code). So make sure your icon(s) are all 150x150 pixels. If it's smaller, the application will just center the image into the next available 150x150 square so it can still work sometimes. However, the app will give you an error if your icon is any bigger than 150x150 pixels. Once you have added your icon(s), the number of icons that will be added will be shown at the bottom of the window as shown here:

Generate your new icongrid

Click the "Generate New Icon-grid" button and it will modify the iconGrid.png that was uploaded, adding your character icons to the grid, wherever it finds free space. In case the grid is full, it will show an error. But if it's successful, it will tell you the indices at which the icons were added (which is needed in order to add the icons into the game). Now you have successfully generated your new iconGrid.png file.
Update: There is now a checkbox called "Psych Engine mode", which when checked will allow you to make Psych-engine compatible icons. Just upload the 2 images and click "Generate New Icon-grid".

Dialog box when icons are added successfully


Dialog box when one of the icons are smaller than 150 x 150


Dialog box when one of the icons is bigger than 150 x 150


Running from source:

In order to run this from source, you will need python and pip installed on your device (pip should come pre-installed with python). Clone/download this repository by clicking the green button labelled "Code" and downloading the zip, then extract the contents of the zip file. Install the dependencies by opening the command line, navigating to this directory and typing pip install -r requirements.txt. Once that is done type cd src
python xmlpngUI.py to run the application (Sometimes you need to type python3 instead of just python). This is a required step for non-windows users!

Side note: Feel free to make ports of this tool (for andriod, iOS, web etc.) if you can, just remember to open source it and credit this repository

fnf-spritesheet-and-xml-maker's People

Contributors

uncertainprod avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fnf-spritesheet-and-xml-maker's Issues

daddy xml

so I am making a new xml for daddy derest but when ever I enter week 1 it chrashis plz help

Spritesheet and XML Generator wont run on linux!!!

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:
The exact steps that were followed to cause the issue

Expected behavior
A clear and concise description of what was expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Which version was it on?
The version number of the tool this bug was found on.

Application ran from exe or from source?

  • OS:
  • Was the application run from source or was it the executable from gamebanana?

ModuleNotFoundError: No module named 'PyQt5.QtCore'

JonnyboyTheboy src %python3 xmlpngUI.py
Traceback (most recent call last):
File "/Users/jonathangomez/Downloads/FnF-Spritesheet-and-XML-Maker-master/src/xmlpngUI.py", line 2, in
from PyQt5.QtCore import QSize, Qt
ModuleNotFoundError: No module named 'PyQt5.QtCore'

and I am running macOS

Character bouncing around

Whenever I generate my spritesheet, my character bounces up and down when doing any animation. Changing offsets don't help, my character just keeps bouncing.

Character crashes the game.

I tried to make an XML over Daddy Dearest, and now every time I try and open Week 1, the game crashes. and I exported multiple times with different naming methods, and yet it still crashes. When I went into another week and used the debug menu to make the opponent Daddy Dearest there, it crashed again so it is an error with the character. Help?

Release zips contain too many files

The zips containing releases have too many different pyd and DLLs, making it a pain to find the EXE. I do have a proposed solution; add --onefile as a parameter when building with pyinstaller.

For anyone having the pyqt5 error. make sure you do then pip3 not pip

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:
The exact steps that were followed to cause the issue

Expected behavior
A clear and concise description of what was expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Application ran from exe or from source?

  • OS:
  • Was the application run from source or was it the executable from gamebanana?

Instructions for running from source incorrect/not supported

There seems to be an issue preventing the program opening whenever running from source, not to mention that the exe file is missing from the gamebanana upload.

Here is the error messages from the terminal:

PS C:\Users\names\OneDrive\Desktop\spritesheet-xml-generator-fnf-windo_e8772\Spritesheet-and-XML-Generator-for-Friday-Night-Funkin> pip install -r requirements.txt
ERROR: Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt'
PS C:\Users\names\OneDrive\Desktop\spritesheet-xml-generator-fnf-windo_e8772\Spritesheet-and-XML-Generator-for-Friday-Night-Funkin> cd src
cd : Cannot find path 'C:\Users\names\OneDrive\Desktop\spritesheet-xml-gene
rator-fnf-windo_e8772\Spritesheet-and-XML-Generator-for-Friday-Night-Funkin
\src' because it does not exist.
At line:1 char:1

  • cd src
  • CategoryInfo : ObjectNotFound: (C:\Users\names...ight-Funk
    in\src:String) [Set-Location], ItemNotFoundException
  • FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.S
    etLocationCommand

PS C:\Users\names\OneDrive\Desktop\spritesheet-xml-generator-fnf-windo_e8772\Spritesheet-and-XML-Generator-for-Friday-Night-Funkin> python3 xmlpngUI.py
C:\Users\names\AppData\Local\Microsoft\WindowsApps\python3.exe: can't open file 'C:\Users\names\OneDrive\Desktop\spritesheet-xml-generator-fnf-windo_e8772\Spritesheet-and-XML-Generator-for-Friday-Night-Funkin\xmlpngUI.py': [Errno 2] No such file or directory
PS C:\Users\names\OneDrive\Desktop\spritesheet-xml-generator-fnf-windo_e8772\Spritesheet-and-XML-Generator-for-Friday-Night-Funkin>

Or as a screencap for legibility:
image

Thanks, syringgoogleplex

Existing spritsheet and xml crash

Describe the bug
Importing the existing spritsheet and their xml causes the program to crash.

To Reproduce
Open the program, go to FIle > Import esisting Spritsheet and XML, then import the existing spritsheet and their xml (like Daddy Dearest).

Expected behavior
The spritsheet was supposed to split into individual images,

Screenshots
None

Application ran from exe or from source?

  • OS: Windows
  • Executable from Gamebanana

Sprites are scambled in the png when generating an xml

Bug
When generating an xml, the sprites are scrambled in the png and dosent work on psych engine

To Reproduce
I just opened the app/exe, loaded an existing sprite and xml, added new sprites without touching existing, saw everything in the preview and xml structure looked as intended and generated a new xml

Expected behavior
I expected to have a working sprite sheet and xml

Screenshots
image
image

Which version was it on?
Latest Gamebanana build to this day

Application ran from exe or from source?

  • OS: Windows 64bit
  • Was the application run from source or was it the executable from gamebanana?
    -Gamebanana

How to run source?

The description is not very clear and I do not understand how to run the source code. Please help because I really want to use this app.

  • OS: Mac

grammar issue :/

Describe the bug

Not a bug, just a grammar issue (:/). In FILE > Export I believe that there are two options:

Export spritesheet
Export induvidial images
it's supposed to be individual, not induvidial.

To Reproduce

not a bug :/

Expected Behavior

expected to have the grammar correct, but I don't mind.

Screenshots

no I dont have it

Application ran from .EXE or from source code?

  • OS: windows 10

Was the application run from source or was it the executable from gamebanana?

GameBanana.

Error.

theres an error saying permission denied when it didnt even ask me permission to anything

Suggestion

can you guys do it for your cell phone? (Sorry for the bad English)

The specified Module could not be found

So I went into the application, but all it said that the specified module could not be found and I clicked okay. When I clicked, it just got me out of the application. It also said that there was an 'error' loading in?

I ran from Windows 10 Pro Laptop

Edited "Frame Properties" on Linux do not persist

Describe the bug
FrameX changes are not saved.

To Reproduce
I click on an image, open "Edit Frame Properties", change frameX from 0 to 2, then TAB out of there. Then "Set FrameX and FrameY" (why not width and height too?). When I reopen the dialog, it's still 0. Also 0 gets saved.

Expected behavior
FrameX changes are saved.

Screenshots
None

Application ran from exe or from source?

No Prefix for XML animation export option

As it currently stands, while you can leave the custom prefix blank, it sadly creates a little space.

image

(I would have made a PR since this is very easy to add but sadly I can't get the source to run despite following the instructions step by step).

Uploading Certain Images Crashes The Generator

Describe the bug
Everytime I try to upload PNG images to the generator it closes the application after saying "Importing Sprite Frames..." for a few seconds

To Reproduce
Steps to reproduce the behavior:

  1. Open the generator
  2. Try to upload PNG images
  3. The generator says "Importing Sprite Frames..." for a few seconds
  4. Watch the application close on itself

Expected behavior
Uploaded PNG's are supposed to show up on the generator and NOT crash

Which version was it on?
Most recent version

Application ran from exe or from source?
EXE, I downloaded it from gamebanana
https://gamebanana.com/tools/7136

[CRASH] NoneType object is not subscriptable

Traceback (most recent call last):
  File "D:\Programming\Game Modding\Friday Night Funkin\Spritesheets\FnF-Spritesheet-and-XML-Maker\src\xmlpngUI.py", line 306, in generate_xml
    statuscode, errmsg = xmlpngengine.make_png_xml(
  File "D:\Programming\Game Modding\Friday Night Funkin\Spritesheets\FnF-Spritesheet-and-XML-Maker\src\xmlpngengine.py", line 166, in make_png_xml
    final_img_width, final_img_height, max_heights = calculate_final_size(existing_img_dict, imlist, num_cols, clip, reuse_sprites_level)
  File "D:\Programming\Game Modding\Friday Night Funkin\Spritesheets\FnF-Spritesheet-and-XML-Maker\src\xmlpngengine.py", line 99, in calculate_final_size
    widths.append(box[2] - box[0] + 4)
TypeError: 'NoneType' object is not subscriptable

error with building

i'm on a mac and i get this error when building. i am on the latest version of python and on macos 10.13.6

Traceback (most recent call last):
File "xmlpngUI.py", line 8, in
import xmlpngengine
File "/Users/user/Downloads/FnF-Spritesheet-and-XML-Maker-master/xmlpngengine.py", line 16, in
def add_pose_numbers(pose_arr:list[str]):
TypeError: 'type' object is not subscriptable

Images Padding

Having an X and Y padding setting (how far away each sprite should be from each other) would be really useful, since having padding allows you to prevent bleeding textures (caused by antialiasing). Bleeding textures are caused whenever images are too close to each other, and so the pixels from one image bleed into the other image that's nearby.

Note: Padding is not needed to be applied if the edge of a frame of the animation is on an edge of the image since there is no bleeding from image edges, bleeding only happens from within the actual sheet.

enhancement/request

add an option for no animation prefix, leaving the space blank just adds a space infront of the animation name

error when opening

whenever i open the application this pops up.
"the program cant start because api-ms-win-core-path-l1-1-0.dll is missing fropm your computer. try reinstalling the program to fix this problem"

it gives me a error

When i try to add another icon to the icon grid it says "unable to fins a suitable location to insert your icon" but i have a lot of space left and its hard to manually put the icons into the grid

THE CHARACTERS FEET GET LIFTED INSTEAD OF HIS HEAD GOING DOWN

Instead of the characters head moving down his feet go up and i cant fix it

just make a new character using it and import it into an fnf engine

Head is supposed to go down and feet supposed to stay in place

Latest version 4.1.1

EXE on gamebanana and Windows

cannot set stuff up

C:\Users\elias\Documents\FnF-Spritesheet-and-XML-Maker-master\FnF-Spritesheet-and-XML-Maker-master>pip install -r requirements.txt
'pip' is not recognized as an internal or external command,
operable program or batch file.

How Do you run it on mac

Application ran from exe or from source?

  • OS: MacOs
  • Was the application run from source or was it the executable from gamebanana?

Errno (?) 13: Permission denied to make a .png file, the .xml file exports work fine

Describe the bug
When I try to export the spreadsheet and .xml files to my folder (or any folder), it makes the .xml file perfectly fine but it doesn't when making a .png. Apparently, it's Errno 13, where permission is denied to make a .png, but if I turn on Passive Mode on Avast One, it allows .png exports. I'd say to change the errno message to say "Have you tried disabling your antivirus?" or sumthin like that haha.

To Reproduce
Steps to reproduce the behavior:
Keep your antivirus software on normal to high alert for changes to critical folder paths.

Expected behavior
It will disallow exporting spritesheets but allows .xml files.

Screenshots
errno 13

Which version was it on?
4.1.1 i think, whatever the newest version is :/

Application ran from exe or from source?

  • OS: Windows 10
  • Was the application run from source or was it the executable from gamebanana?: EXE

sprites clip into each other

if you put sprites that are touching the edge of the frame it will clip into other sprites and its kinda annoying

XML Formatting improvement

Currently the XML exports like this:
image

The first animation line is not being put in a new line, and there is also no indentation at all.

It would be nice if it could export like this instead:
image
(has intendation and the first line is properly in a new line)

how to run it with lunix

Which version was it on?
The version number of the tool this bug was found on 4.1

Application ran from exe or from source?

  • OS: lunix
  • Was the application run from source or was it the executable from gamebanana?: gamebanana

If Image Optimization/Clipping is enabled, frame should be recalculated to create the original image.

This is the original intent of the frame attributes, and what Haxe is optimized for.

Say I have a 100x100 image, that contains 80x80 of content with 10px of empty space around it.

A subtexture with a width of 80, a height of 80, a frameX of 10, frameY of 10, a frameWidth of 100, and a frameHeight of 100 will render identically to the original image, while taking up less space in the spritesheet and thus in memory.

The current clipping implementation messes discards the frame information and sets x/y to 0 and w/h to that of the new image. This means that some frames of the animation will be offset from what is expected.

Psych Engine Grid Support

(sorry for bad english)
Psych Engine It is becoming more and more popular, so I see it convenient to add an option to be able to generate Icon Grids with the format used by that engine (150x150 per icon and only two of them on one grid)
I think it would be a good addition for people who use this engine (including me)

Example of Icon Grids used in Psych Engine:
icon-face

Can't make xml and sprites in linux

i make the xml and sprites and i make the animations names

i click on generate xml, and say it worked but when finishes the file don't appear

Other ports?

I tried installing Pillow, but it still didn't work. Is there a way you can create a standalone application for other PCs? Mac, Ubuntu, etc...

Generate Psych Engine Grid Option

Pysch engine uses a different icon grid system, where each icon set is a separate png (300x150) and looks like this:

image
Although it is already possible to use the icons generated by the program, you still have to select a classic icon grid and then cut them, which can become tedious. An option where you only have to select the 2 icons and export them in this format would be very useful to skip this process and get an accurate result

More and more mods are made with this engine, so it would be a good addition to the program.

Also, less and less mods use the icon grid format that vanilla friday night funkin uses, and this option could be used with other engines as well, or just to show the icons separately.

This post is an improved version of this other one I did in the past: #38
I did this because I explained myself in a bad way and no one was going to notice the change if I edited it

Trim export setting

As it stands, when exporting your sprite sheets, the image will export with a huge empty space. This is really bad for optimization since it causes the image to be bigger than it needs to be in file size, hence causing the game to take longer to load it.

It would be nice to have a setting to trim the sprite sheet when exporting it. This setting should be enabled by default since there are no cons coming from this feature.

how can you ope it with mac

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:
The exact steps that were followed to cause the issue

Expected behavior
A clear and concise description of what was expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Application ran from exe or from source?

  • OS:
  • Was the application run from source or was it the executable from gamebanana?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.