Git Product home page Git Product logo

Comments (11)

dploeger avatar dploeger commented on June 14, 2024

Hm. Can neither attach the aseprite nor the zip of it. If you need an example, give me a hint and I'd share it on my gdrive.

from godot-aseprite-wizard.

viniciusgerevini avatar viniciusgerevini commented on June 14, 2024

Hello @dploeger. Thanks for finding this issue. I guess you found a limitation with using spritesheets in Godot.

I did a quick search and I found this limitation in the docs.

Note: The maximum image size is 16384×16384 pixels due to graphics hardware limitations. Larger images may fail to import.

You are right. I'm using the --spritesheet option from Aseprite, and as the sum of your frames width reaches Godot limits, it mess everything up. To make the plugin work in such cases, I'll have to automatically break the sprite sheet in multiple images. Externally it wouldn't change anything. I'll spike different approaches and check if there are any drawbacks.

By the way, are you using the manual flow, through the dock, or the automatic importer?

from godot-aseprite-wizard.

dploeger avatar dploeger commented on June 14, 2024

Thanks a lot. I'm using the automatic importer.

from godot-aseprite-wizard.

dploeger avatar dploeger commented on June 14, 2024

btw: I used multiple layers and tags to organize the file like this:

image

I'd want the result to be in one SpriteFrames resource with the animations named like - (e.g. right-idle).

Aseprite seems to allow exporting layers and tags into separate files when exporting a sprite sheet. Maybe that will help.

(does the addon support the result the way I described currently or should I open a feature request for that?)

from godot-aseprite-wizard.

dploeger avatar dploeger commented on June 14, 2024

Maybe you could rewrite the export to use the --save-as command using templates like --save-as sprite-{layer}-{tag}-{frame}.png. This would circumvent exporting it to a sprite sheet with too big dimensions.

from godot-aseprite-wizard.

dploeger avatar dploeger commented on June 14, 2024

Although... that would result in a very large amount of files...

from godot-aseprite-wizard.

dploeger avatar dploeger commented on June 14, 2024

Using --split-layers with --sheet doesn't seem to work properly. See aseprite/aseprite#2889

from godot-aseprite-wizard.

viniciusgerevini avatar viniciusgerevini commented on June 14, 2024

I'd want the result to be in one SpriteFrames resource with the animations named like - (e.g. right-idle).

Currently in this plugin you are able to split by layers (right.res, left.res, etc) but not by tags. I wonder what would be the benefit of having right-idle? (besides mitigating the problem). In this case you would have multiple SpriteFrames resources with only one animation.

Although... that would result in a very large amount of files...

Yeah, but I don't think there is any way around it. To support big files, multiple small files would have to be created. However, I could split the images by tag, but maintaining one resource file. That might work and it wouldn't create too many files. It doesn't solve the problem entirely, but it does make it less likely.

There is one immediate thing that can help with this issue. Currently I use the spritesheet default behaviour, which is creating a row. If I change the command to use the packed algorithm, the spritesheet will distribute height/width better. Does not solve for all cases, but it's a good start.

from godot-aseprite-wizard.

dploeger avatar dploeger commented on June 14, 2024

Currently in this plugin you are able to split by layers (right.res, left.res, etc) but not by tags. I wonder what would be the benefit of having right-idle? (besides mitigating the problem). In this case you would have multiple SpriteFrames resources with only one animation.

Like you see in the screenshot, one tag spans around multiple frames. So "right-idle" would include all frames of the "idle" tag that are on the "right" layer. The same way I created my animations manually now:

image

There is one immediate thing that can help with this issue. Currently I use the spritesheet default behaviour, which is creating a row. If I change the command to use the packed algorithm, the spritesheet will distribute height/width better. Does not solve for all cases, but it's a good start.

Thanks, but I tried changing that, but it didn't work, because even switching to packed or columns, the image is too big for my sprites. 😢

from godot-aseprite-wizard.

zextillion avatar zextillion commented on June 14, 2024

I ran into this same issue with my Aseprite file. For various reasons, I can't use the trim functionality to reduce the image width, so I modified the code inside my project to fit for my use case. My use case involves exporting each layer AND tag individually, but this can be generalized for the case where you don't split up layers too.

I added an option to export each tag individually. This creates one folder for each tag inside the base output folder, and the exported layers now go inside this folder. Once all the tag folders are made and sprite sheets are exported, it gets a reference to that layer's SpriteFrames resource. If it's not under the base folder (it hasn't been created yet), it will create it. Otherwise, it will load that pre-existing SpriteFrames resource and add that tag's animation/layer to it.

If this sounds like a good idea to add, I might try to clean up my code and open a pull request.

Note: If the sprites are too big, and there are too many frames in the tag, then it still might end up over the image width limit. This can then be mitigated by using the trim options, but then you'll end up in the situation I was in. To go one step further, you can then add multiple rows to the exported spritesheet to keep the height and width somewhat square-y. Eventually, you'll hit the point where even that's not enough, but if you end up going past that image height/width limit using aseprite animations, I think you have a completely different problem altogether lol

from godot-aseprite-wizard.

viniciusgerevini avatar viniciusgerevini commented on June 14, 2024

Thanks @zxtion . That will certainly going to conflict with the major refactoring I've been working on. I feel I understand the solution, but I can't really visualise it. Feel free to send it if you feel like it.

I had put some thought on this issue. I guess the best approach is to have an option like "Big file mode" or "Big file support", which would export each frame as a separate png. That would be seamless for the SpriteFrames as it embeds the files, but not really that straight forward for the new AnimationPlayer support.

Also, I'm certain the file generated would be bigger than the normal one, but I think it's an acceptable trade off for supporting this case, and also we are talking about pixel art, so it would certainly be smaller than a high resolution equivalent.

from godot-aseprite-wizard.

Related Issues (20)

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.