Git Product home page Git Product logo

godot-aseprite-wizard's Introduction

Godot Aseprite Wizard (Godot 4)

Aseprite Wizard Logo

Godot plugin to help import Aseprite animations to AnimationPlayers, AnimatedSprites 2D/3D and SpriteFrames.

This branch supports Godot 4. For Godot 3 docs and code check the godot_3 branch. You can find more details about the differences between Godot 3 and Godot 4 on issue #70.

Check the screenshots folder for more examples.

Index

Features

  • Godot importer and inspector docks for easy import and re-import.
  • Adds automatic importers:
    • Aseprite SpriteFrames: Use aseprite files as SpriteFrames resources.
    • Aseprite Texture: Use aseprite files as static images (only first frame is imported)
    • Aseprite Tileset Texture: Use aseprite files with tilemap layers as AtlasTexture which can be added directly to Godot's tileset creator.
  • Inspector docks to manually import animations to:
    • AnimationPlayer (Sprite2D, Sprite3D and TextureRect).
    • AnimatedSprite2D/3D.
    • As standalone SpritesFrames resource.
  • Supports Aseprite animation directions (forward, reverse, ping-pong, ping-pong reverse).
  • Supports loopable and non-loopable animations via Aseprite repeat or tags.
  • Separates each Aseprite Tag into animations. In case no tags are defined, imports everything as default animation.
  • Filters out layers you don't want in the final animation using regex.
  • Supports slices. Import only a region from your file.
  • For AnimatedSprite
    • Creates SpriteFrames with Atlas Texture to be used in AnimatedSprites.
    • Converts Aseprite frame duration (defined in milliseconds) to Godot's animation FPS. This way you can create your animation with the right timing in Aseprite and it should work the same way in Godot.
    • Choose to export the Aseprite file as a single SpriteFrames resource or separate each layer in different resources.
    • Adds Aseprite file importer to Godot.
  • AnimationPlayer
    • Adds and removes animation tracks without removing other existing tracks.
    • You are free to import multiple files to the same AnimationPlayer or import each layer to their own Sprite/TextureRect and AnimationPlayer.
    • Supports animation libraries.

Aseprite Wizard is only required during development. If you decide to not use it anymore, you can remove the plugin and all animations previously imported should keep working as expected.

Installation and Configuration

Follow Godot installing plugins guide .

If you are using Windows, a portable version or if the aseprite command is not in your PATH, you need to set the right path on Editor -> Editor Settings -> Aseprite.

Configuration Description
General > Command Path Path to the aseprite executable. Default: aseprite

For project specific configurations check Project -> Project Settings -> General > Aseprite.

Configuration Description
Animation > Layer > Exclusion Pattern Exclude layers with names matching this pattern (regex). This is the default value for new nodes. It can be changed or removed during the import. Default: not set
Animation > Layer > Only Include Visible Layers By Default Default configuration for "only visible" in the docks. Default: false
Animation > Loop > Enabled Enables animation loop by default. Default: true
Animation > Loop > Exception Prefix Animations with this prefix are imported with opposite loop configuration. For example, if your default configuration is Loop = true, animations starting with _ would have Loop = false. The prefix is removed from the animation name on import (i.e _death > death). Default: _
Animation > Storage > Use Metadata (deprecated) Persist dock info in the scene metadata instead of editor description. Default: true
Animation > Storage > Enable Metadata Removal on Export Removes dock metadata from scene when exporting the project. Ensures no local info is shipped with the app. Default: true
Import > Cleanup > Remove Json File Remove temporary *.json files generated during import. Default: true
Import > Cleanup > Automatically Hide Sprites Not In Animation Default configuration for AnimationPlayer option to hide Sprites when not in animation. Default: false
Import > Import Plugin > Default Automatic Importer Which importer to use by default for aseprite files. Options: No Import, SpriteFrames, Static Texture, Tileset Texture. Default: No Import
Wizard > History > Cache File Path Path to file where history data is stored. Default: res://.aseprite_wizard_history
Wizard > History > Keep One Entry Per Source File When true, history does not show duplicates. Default: false

How to use

Check this video for usage examples: https://youtu.be/1W-CCbrzG_0

After activating the plugin, there are three different ways you can use it:

  1. Using the automatic importers: Any file saved in the project will be automatically converted to the chosen resource. By default, the importer does not import anything. You can change the behaviour per file or choose the default importer via Project Settings.
  2. Using the inspector docks: There will be a section called Aseprite in the inspector dock when selecting Sprite, TextureRect and AnimatedSprite nodes.
  3. Using the wizard dock: You can open the wizard dock via Project -> Tools -> Aseprite Wizard -> Spritesheet Wizard Dock... menu. In this dock you can generate standalone SpriteFrames files from anywhere in your system.

Importers

If you use the importer flow, any *.ase or *.aseprite file saved in the project folder will be automatically imported as a resource. The plugin enables 3 importers: SpriteFrames, Static Image and Tileset Texture.

You can choose which importer to use via the Import Dock. By default, aseprite files will use the "No import" option, which will show them in the filesytem dock, but won´t generate any resource. You can change the default importer behaviour via Project Settings.

Importer screenshot

The downside of using the importer flow is that you will need Aseprite available on every machine where you intend to run the project, even if you won't be working on the game art. If this is a problem to you, you should consider using the Import dock flow instead.

SpriteFrames importer

Aseprite files are imported as SpriteFrames resources and can be loaded to AnimatedSprite nodes directly.

Options:

Field Description
Output filename / prefix Defines output filename. In case layers are split into multiple files, this is used as file prefix (e.g prefix_layer_name.res). If not set, the source filename is used.
Exclude layers matching pattern: Do not export layers that match the pattern defined. i.e _draft$ excludes all layers ending with _draft. Uses Godot's Regex implementation
Split layers in multiple resources: If selected, each layer will be exported as a separated resource (e.g my_layer_1.res, layer_name_2.res, ...). If not selected, all layers will be merged and exported as a single resource file with the same base name as the source.
Only include visible layers If selected it only includes in the image file the layers visible in Aseprite. If not selected, all layers are exported, regardless of visibility.

Static image importer

Aseprite files are imported as AtlasTexture resources. Only the first frame will be visibile. A PNG file will be created alongside the AtlasTexture. You can choose to use either the aseprite and png file directly, as both will be kept updated.

Texture importer options:

Field Description
Exclude layers pattern: Do not export layers that match the pattern defined. i.e _draft$ excludes all layers ending with _draft. Uses Godot's Regex implementation
Only include visible layers If selected it only includes in the image file the layers visible in Aseprite. If not selected, all layers are exported, regardless of visibility.

Tileset texture importer

Aseprite 1.3 added Tilemap support. You can create special layers which can then be exported as tilesets. The tileset importer will generate an image with the tiles from the aseprite file, which can be added to the Tileset editor in Godot.

Tileset importer options:

Field Description
Exclude layers pattern: Do not export layers that match the pattern defined. i.e _draft$ excludes all layers ending with _draft. Uses Godot's Regex implementation
Only include visible layers If selected it only includes in the image file the layers visible in Aseprite. If not selected, all layers are exported, regardless of visibility.

Note: Like in the static image importer, a png file is generated alongside the resource. I noticed that sometimes when updating the aseprite file, Godot is keeping a cached version of the resource and not showing the update in the tileset editor. The same doesn't happen to the png file, so you might want to use it instead of the main .aseprite file.

Inspector Docks

You can import animations directly to AnimatedSprite nodes and AnimationPlayers using the Inspector Dock. You can find the Aseprite section at the bottom of the Inspector Dock when selecting AnimatedSprite2D/AnimatedSprite3D/Sprite2D/Sprite3D/TextureRect nodes.

Animations imported via docks are only updated once you manually re-import them, giving more control on when imports happen and allowing others to run the project without having Aseprite installed.

AnimatedSprites

To import animations via the Import Dock:

  1. Create an AnimatedSprite2D or AnimatedSprite3Dnode and select it in your scene.
  2. With the node selected, look for the "Aseprite" section in the bottom part of the Inspector.
  3. Fill up the fields and click import.

AnimatedSprite inspector dock screenshot

Field Description
Aseprite File: (*.aseprite or *.ase) source file.
Layer: Aseprite layer to be used in the animation. By default, all layers are included.
Exclude pattern: Do not export layers that match the pattern defined. i.e _draft$ excludes all layers ending with _draft. Uses Godot's Regex implementation
Only visible layers If selected, it only includes in the image file the layers visible in Aseprite. If not selected, all layers are exported, regardless of visibility.
Slice Aseprite Slice to be used in the animation. By default, the whole file is used.
Output folder: Folder to save the sprite sheet (png) file. Default: same as scene
Output file name Output file name for the sprite sheet. In case the Layer option is used, this is used as the file prefix (e.g prefix_layer_name.res). If not set, the source file basename is used.

Notes:

  • A SpriteFrames resource will be generated and assigned to the AnimatedSprite. This resource is embedded in the scene and the spritesheet file will be created in the output folder.
  • As opposed to the AnimationPlayer flow, a new SpriteFrames resource is generated on every import. This means any manual change will be lost after re-import.

Sprites and TextureRect

When working with Sprite2D, Sprite3D and TextureRect nodes, you have the option to import the file as a static image or load its animations to an AnimationPlayer node.

  1. Create your node (Sprite2D, Sprite3D, TextureRect).
  2. With the node selected, look for the "Aseprite" section in the bottom part of the Inspector dock.
  3. Fill up the fields and click import.
Animation mode:

Sprite inspector dock screenshot

Field Description
Aseprite File (*.aseprite or *.ase) source file.
Animation Player AnimationPlayer node where animations should be added to.
Layer Aseprite layer to be used in the animation. By default, all layers are included.
Exclude pattern Do not export layers that match the pattern defined. i.e _draft$ excludes all layers ending with _draft. Uses Godot's Regex implementation
Only visible layers If selected, it only includes in the image file the layers visible in Aseprite. If not selected, all layers are exported, regardless of visibility.
Slice Aseprite Slice to be used in the animation. By default, the whole file is used.
Keep manual animation length When this is active the animation length won't be adjusted if other properties were added and the resulting imported animation is shorter. Default: false.
Hide unused sprites If selected, sprites that are present in the AnimationPlayer will be set as visible=false in any animation they are not part of.
Output folder Folder to save the sprite sheet (png) file. Default: same as scene
Output file name Output file name for the sprite sheet. In case the Layer option is used, this is used as file prefix (e.g prefix_layer_name.res). If not set, the source file basename is used.

Notes:

  • The generated sprite sheet texture is set to the Sprite node and every tag in the Aseprite file will be inserted as an Animation into the selected AnimationPlayer.
  • If the animation already exists in the AnimationPlayer, all existing tracks are kept. Only the required tracks for the Sprite animation will be changed.
  • Loop configuration and animation length will be changed according to the Aseprite file. If you wish to keep a manually configured animation length, set the Keep manual animation length option.
  • The plugin will never delete an Animation containing other tracks than the ones used by itself. In case the animation is removed from Aseprite, it will delete the track from the AnimationPlayer and only delete the animation in case there are no other tracks left.
  • Animations are added to the global animation library by default. To define a library name, use the library_name/animation_name pattern on your Aseprite tags.
Image mode:

Static image inspector dock screenshot

Field Description
Aseprite File (*.aseprite or *.ase) source file.
Layer Aseprite layer to be used in the animation. By default, all layers are included.
Exclude pattern Do not export layers that match the pattern defined. i.e _draft$ excludes all layers ending with _draft. Uses Godot's Regex implementation
Only visible layers If selected, it only includes in the image file the layers visible in Aseprite. If not selected, all layers are exported, regardless of visibility.
Slice Aseprite Slice to be used in the animation. By default, the whole file is used.
Output folder Folder to save the sprite sheet (png) file. Default: same as scene
Output file name Output file name for the sprite sheet. In case the Layer option is used, this is used as file prefix (e.g prefix_layer_name.res). If not set, the source file basename is used.

Imports Manager

Importing animations via the Inspector Docks is handy, but it makes it harder to re-import multiple animations at same time. For that you can use the Imports Manager.

You can find the manager under Project -> Tools -> Aseprite Wizard -> Imports Manager....

Imports

In this screen you can see all the nodes in your project imported using the Inspector Dock. From here, you can re-import any file, as well as selecting multiple files to import in one go.

Due to some limitations and bugs in Godot, when importing a node its scene will be open in the editor.

Wizard Dock

The wizard screen allows you to import SpriteFrames resources without attaching them to a scene or node. This can be used in cases where you would like to generate SpriteFrames independently and include them in different nodes manually or programmatically.

This dock also allows you to create the raw aseprite export files (png, json) without creating any resource at all.

To open the dock go to Project -> Tools -> Aseprite Wizard -> SpriteFrames Wizard....

Field Description
Aseprite File Location: *.aseprite or *.ase source file containing animations.
Output folder: Folder to save the output SpriteFrames resource(s).
Output filename / prefix Defines output filename. In case layers are split into multiple files, this is used as the file prefix (e.g prefix_layer_name.res). If not set, the source file basename is used.
Exclude layers matching pattern: Do not export layers that match the pattern defined. i.e _draft$ excludes all layers ending with _draft. Uses Godot's Regex implementation
Split layers in multiple resources: If selected, each layer will be exported as a separated resource (e.g my_layer_1.res, layer_name_2.res, ...). If not selected, all layers will be merged and exported as a single resource file with the same base name as the source.
Only include visible layers If selected, it only includes in the image file the layers visible in Aseprite. If not selected, all layers are exported, regardless of visibility.
Do not create resource file Does not create SpriteFrames resource. Useful if you are only interested in the .json and .png output from Aseprite.

Notes:

  • Overwrites any manual change done to previously imported resources.

In this dock you also find tabs to list all SpriteFrames imported through it and a local history of previous imports.

F.A.Q. and limitations

What is the correct command to use in Aseprite Command Path

The plugin uses aseprite as the default command. In case your system uses a different location you can either add it to the PATH variable or provide the full path to the executable. Here are some common locations:

  • Steam on Windows: C:\\Steam\steamapps\common\Aseprite\aseprite.exe. (This will vary depending on your Steam Library location).
  • MacOS: /Applications/Aseprite.app/Contents/MacOS/aseprite.
  • Ubuntu: /usr/bin/aseprite. (Note: usually your PATH already includes binaries from /usr/bin)

Note: Adding Aseprite to the PATH on Windows does not always work, as reported by some users. In this case, it's better to stick to the full path.

Non-looping animations

From Aseprite 1.3 you can control loops by setting the repeat property under Tag properties in Aseprite. There's no extra steps required in the plugin.

Older versions have no option for loops so this plugin handles that via a configured convention.

By default, all animations are imported with loop = true. Any animation starting with _ (the exception prefix), will be imported with loop = false.

Both the default configuration and the exception prefix can be changed in the configuration window.

Import overwrite previous files

Currently, import overwrites previously imported files. Any manual modification in the previous resource file will be lost.

Metadata cleanup on export

The options you select in the inspector dock are stored in the scene as metadata. As you can select files from anywhere in your system, there is an export plugin to prevent your local path metadata to be shipped with the game. In case you suspect this is conflicting with other plugins (or if you think you don't need it) you can disable it at Project > Project Settings > General > Animation > Storage > Enable Metadata Removal On Export.

Known Issues

Big files issue (Image width cannot be greater than 16384px)

As per Godot's docs:

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

This plugin exports all animations as a single sprite sheet. If you are using a big canvas size in Aseprite with lots of frames, you may reach this limit.

Sprite sheets are generated using a packing algorithm, which should mitigate this issue, however, it won't solve it entirely.

You can workaround the issue by using an AnimationPlayer and splitting your animations in multiple Aseprite files. By enabling the Hide unused sprites option, you can import multiple files to different sprites in the same animation player and only the active one will be visible.

Error message in the output console when automatically re-importing files

Can't find file 'uid://...'.

You will likely see the error above (with the proper uid and path) when a re-import is triggered on file change. Even though this is an annoying message, it does not impact anything during import.

During the import process the spritesheet file is generated by Aseprite outside Godot. The plugin needs to trigger a file system scan so Godot is aware of the new files, but such scan throws this error message. At the moment, I don't have any workaround for that and other plugins are likely facing the same issue.

Contact

Thanks for the constant feedback and suggestions. If you are facing problems with the plugin or have suggestions/questions, please open an issue in this repo.

If you like game dev related content and want to support me, consider subscribing to my Youtube channel.

Check my website for more contact options.

godot-aseprite-wizard's People

Contributors

aaaaaaaaargh avatar aaronfranke avatar dfkeenan avatar gumaciel avatar imsamuka avatar justuspan avatar mickeon avatar mpewsey avatar patoui avatar poohcom1 avatar sandord avatar theorioli avatar viniciusgerevini 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  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

godot-aseprite-wizard's Issues

It stopped working all of a sudden

I have used this in the past and it worked perfectly fine. However, recently, in all my projects it doesn't do anything when I click import.

I'm not sure if it's becuase of an update to asesprite? But nothing has changed (to my knowledge).

I can load animation player fine, I can load the .ase sprite fine, but the layers drop down does not represent what I see in asesprite.
When I click Import - nothing happens.

Invalid character in file names when selecting a layer.

Hi,

When retrieving the layer names from an aseprite file the names end up having a carriage return character \r on the end. This is not valid in file names. Well it is erroring for me at least. I am not sure if it is because I am on Windows, I am using the Aseprite 1.3 beta, or some other issue. Changing the below line to remove the character solved the issue for me.

i.e.

	return output[0].replace("\r","").split('\n')

Really cool plugin by the way. 😄

Could not import aseprite file: output location does not exist

Hello! I'm trying to use this plugin, and when I manually import my .aseprite files through the SpriteSheet, it works fine by transforming them into resource files. But when the editor is trying to automatically import these .aseprite files, it shows following errors:

ERROR - Could not import aseprite file: output location does not exist
editor/editor_file_system.cpp:1801 - Error importing 'res://characters/player/placeholder_toucan.aseprite'.
ERROR - Could not import aseprite file: output location does not exist
editor/editor_file_system.cpp:1801 - Error importing 'res://characters/player/placeholder_toucan_flight.aseprite'.
ERROR - Could not import aseprite file: output location does not exist
editor/editor_file_system.cpp:1801 - Error importing 'res://characters/player/placeholder_toucan_nonflight.aseprite'.

image
This is a screenshot from the files imported. As you can see, I was able to transform the .aseprite files into .res files, but the error message still shows. How can I fix that? Or maybe, how can I disable the automatic import of .aseprite files? Thank you

Aseprite is required to run the app on a programmers machine

When working with a friend I came across these errors while running the game. Aseprite is not installed on her machine.

ERROR - Could not import aseprite file: Aseprite command failed. Please, check if the right command is in your PATH or configured through the "configuration" button.
 editor/editor_file_system.cpp:1755 - Error importing 'res://player/animations/SantaFrames.aseprite'.
ERROR - Could not import aseprite file: Aseprite command failed. Please, check if the right command is in your PATH or configured through the "configuration" button.
 editor/editor_file_system.cpp:1755 - Error importing 'res://worlds/city/lights/lantern.aseprite'.
ERROR - Could not import aseprite file: Aseprite command failed. Please, check if the right command is in your PATH or configured through the "configuration" button.
 editor/editor_file_system.cpp:1755 - Error importing 'res://worlds/city/lights/light01.aseprite'.
ERROR - Could not import aseprite file: Aseprite command failed. Please, check if the right command is in your PATH or configured through the "configuration" button.
 editor/editor_file_system.cpp:1755 - Error importing 'res://worlds/city/smoke/smoke.aseprite'.

Does this mean that Aseprite should be installed on all machines which intend to run this?

How does this work for exported games?

Sprite is black

Hello!
I have been using aseprite wizard for a while now, but I have never seen anything like this.
When I run my game on Godot, the player looks great, as it should be:
image
But when I export the game, it looks like this:
image
Im still trying to see what I did wrong this time with the addon, because this is the first time that this has happened to me.

Animation length is overwritten

First of all - Your aseprite wizard is a gamechanger. I love your Plugin!!! Thanks for your hard work ♥
And now my (small) issue.

My enemy has a death animation. This lasts 0.1 second in Aseprite.
image

But now I add effects like flashing red etc. in the animation player. Then the animation lasts maybe 0.3 seconds.
image

If I want to import the death animation with your tool again because I have changed something in the sprite, fortunately all my special effects remain.
However, the animation length is overwritten again and lasts again 0.1 second.
image
Then I have to manually restore the animation length.
Maybe a checkbox for "Do not overwrite already created animations values" is a good idea?

Use the EditorFileDialog instead of FileDialog

Godot has an enhanced version of FileDialog called EditorFileDialog, which offers a lot more features. This would make file navigation when choosing Aseprite files or output directories much more pleasant. I'm wondering if there were limitations that required FileDialog to be used, or was EditorFileDialog just never considered?

Possibility to import sprites without an AnimationPlayer in the inspector

Hello!
I was wondering if it would be possible to import Aseprite files without having to add an AnimationPlayer when importing through the inspector? I have a lot of sprites that contain a single frame, and the possibility to skip creating AnimationPlayers for them would be neat.

Thanks!

Weird Editor Description

I don't think this is a bug, but whenever I import an aseprite file in godot it gives my sprite a node description. An example one I got after importing a file is:

YXNlcHJpdGVfd2l6YXJkX2NvbmZpZwpzb3VyY2V8PXJlczovL0FydC9Ub3JjaC5hc2Vwcml0ZQpsYXllcnw9Cm9wX2V4cHw9RmFsc2UKb19mb2xkZXJ8PQpvX25hbWV8PQpvbmx5X3Zpc2libGV8PUZhbHNlCm9fZXhfcHw9Cg==

Is there a reason this happens? If not, how could I prevent this?

Invalid get index 'pressed'

Hello I just installed the plugin to try it out but when I click on the Import button in the wizard tabnothing happens and I get this error:
image

Import animations unrelated properties

I attached a screenshot of what I mean. In the screenshot, texture, hframes, vframes, visible are all properties that were all set in the beginning of the frame and totally unrelated to the animation? Perhaps this is a feature? Could someone clarify? My settings are also attached in the second screenshot.

Screenshot 2024-01-21 at 8 19 29 PM

Screenshot 2024-01-21 at 8 21 21 PM

Drag-n-Drop aseprite files?

Hey there! Thanks a ton for this plugin, it rules!

I got annoyed at having to go through the whole file tree when selecting a source aseprite file, so I managed to make drag-and-drop from the FileSystem Dock work in my own project.

It's all in a commit here: russmatney/dino@e7ab71e

Note that you'll also need to add ase and/or aseprite to TextFile Extensions in Editor Settings > Dock/FileSystem to see Aseprite files in the FileSystem Dock itself.

There's a bit more potential related work:

  • validating the extensions in _can_drop_data seems useful
  • supporting more than just the AnimatedSprite2D type
  • I have a feeling the aseprite file godot import plugin can opt-in to showing those files in the editor, rather than having everyone update their editor settings

I can take a shot at a PR at some point if you're interested in a feature like this! I'm not sure when I'll get to it (maybe in the next month or so?), so wanted to share the commit and thoughts... and feel free to impl it yourself if you have the time and interest!

Wrong Tooltip

In the "Aseprite Wizard" window, the Do not create resource file checkbox, have the following tooltip: Removes borders from sprites/layers before saving them. which is the same as the checkbox above.

Also, in the same window, both Configuration and Close buttons are both uncapitalized.

I thought about doing a pull request solving both problems, but actually I don't know exactly the function of that checkbox. The name leads me to think it's a pointless feature, so I guess it's not so obvious what it really does.

Import without filtering

Hi guys, thanks for the tool, really helps me out :)

I'm not sure how to import from Aseprite while disabling filtering. All of my sprites have that 'fuzzy' look to them now. I'm sure there's a way to do it, as your sample images seem to have filtering disabled and everything looks crisp.

Can you clue me in on where to look?
Actually, is there a way to set the import settings like you would on a texture (like repeat, filtering, and so on) while using the importer?
Some other folks might have a problem with this too, it might be good to add this question to the FAQ?
Or, maybe it is somewhere there and I just missed it...

Anyhow, let me know when you get a moment,
Thanks.

Groups imported as layers

version:
aseprite: v1.3-beta21-x64
godot: v3.6.beta.custom_build [0803b4168]

problem:
Hello, looks like group in .ase imported as another layer which is unnecessary texture dublication.

steps to reproduce:

  1. create ase file with following structure
- group
 - layer1
 - layer2
  1. setup aseprite wizard settings input/output
  2. check Split layers in multiple resources option
  3. press import button

output will be:

group.png (dublicate of layer1)
layer1.png
layer2.png

possible solutions:

  1. follow aseprite folders as folders in project
  2. ignore folders
  3. use folder name as prefix to each file

Output texture should be packed to save on memory

Right now there's a lot of unused space between individual sprites because they aren't cropped, and this could cause issues with overly large texture sizes. It would be nice if Aseprite Wizard had an option to let you import as a packed texture with sprite animation done over texture region rather than using row/column/index grid style animation (I say option because some people might prefer the simpler grid-based export).

Ideally such an export would use --trim and --inner-padding 1 so that there's exactly one pixel worth of transparent space along the edges of each frame.

Option for don't create SpriteFrames Resource (.res) file

Hi, Vini..

First your plugin is great for me to manager spritesheet. I really like the option Split Layer to Multiple Resource. Currently I only want it to import the png(and .json) but not create extra SpriteFrames(.res). Because I use Animation PLayer with another Plugin that take the .json file of layer.

Second, yep I could just delete the .res file after import but could take time to select .res file and delete it. Can you make a quick option for it. I tried to run into plugin but seem like could not fully understand it( Sorry I don't good at plugin)

Thanks for your great work.

image

wizard screen size issues

I've noticed this issue in the wizard screen on MacOS in an external monitor.
Screen Shot 2021-01-08 at 11 49 00 am

I believe the way this layout is handling the modal size can be improved.

Config file lives outside version control

The config file is currently stored in the user:// folder, which means that it cannot be version controlled. This becomes an issue when using the AsepriteWizard in cloud builds in case of any setting changes that need to be persisted.

For example, if the game requires the Aseprite Importer, the exported build will fail "successfully" because it simply will not perform an import of the .aseprite files. This will then cause a silent crash of the exported build on startup.

My suggestion is to move the settings from the user:// folder into the godot project settings and the editor settings.

The only setting that is machine specific among all the ones I see here is the Aseprite Command Path, all the other ones are project specific.
image

This would work in a similar way to the import preset storage in #55

Aseprite command path invalid

command path is right then also it's showing command not found. my aesprite version is v1.2.39. is the addon not compatible with this version of aseprite.

image

image

Solved: Issue getting it to work on windows when Path does not work

Hello.
I added Aseprite to my local path. The normal installation and after this did not work, the steam version path.
I tested it with the folder and the path

'G:\SteamLibrary\steamapps\common\Aseprite'
'G:\SteamLibrary\steamapps\common\Aseprite\Aseprite.exe'

What did the trick at the end was to place the full path to the Aseprite Command Path

image

I leave this here for others that have issues with windows.

"Command not found." on Pop!_OS 22.04

Hey,
first thanks for the great tool !
I have a problem, as I get the error message above, when testing the command path with the Aseprite Wizard Config.

I can start Aseprite from my terminal with either aseprite or /usr/bin/aseprite.
And I have tried both versions for the command path in godot... without success though.

Do you have any ideas what could be wrong? (As described in your nice README /usr/bin/ is in my path.)

Best regards
Glenn

Installing

I am using Godot on Steam and i do not know how to install Aseprite Spritesheet Wizard ;-;

Needs finer grained auto-import option

I have many aseprite files in my project, but sometimes they need to be exported in a special way. So either I enable the auto-import option and it breaks those files, or I leave it disabled and inevitably forget to re-import some files.

It would be super useful if there was some mechanism by which you could tell it which files to auto import and/or which to skip. Maybe by putting them in subfolders called "auto import" or "skip import" or any scheme really where I can set it up one time and not have to fuss with it after that.

The plugin adds some unwanted Sprite tracks

Thank you so much for this amazing plugin! However, I see a curious error... When importing the aseprite file, in the animationplayer, the plugin adds tracks from other sprites (which are in the same parent as the animation sprite) and it is set with visible = false

This becomes a problem because it hides the sprites of other objects (such as weapons) that have no relation to the aseprite file.

Captura de pantalla 2022-10-30 140929

I have tried to delete these tracks, but they always reappear when importing animations. Tested in Godot 3.5.1

Proposal: Use character as a looping toggle in tag name for the Importer flow

This addon is pretty professionally-written and seems more recently updated than its alternatives.

However, one drawback that I personally find major is the way it imports looped animations.
I'm aware that Aseprite has no concept of one-time animations, I won't blame the program for it.
However, the project I'm currently developing necessitates several of the sprite's animations to not to be looping.

Although I have read the section about it in the readme, I would love a solution for the much simpler importer flow.

I currently use an addon with a similar scope to this one that allows it.
https://github.com/nklbdev/godot-aseprite-animation-importer

Their solution was to mark every tag name beginning with ""_ as looping, thus removing the underscore and displaying the animation name as normal. (example: "_Running" becomes "Running" in the SpriteFrames editor)
I would love if a similar feature is implemented in this addon, as well. Perhaps with some form of customization, such as which character to use, as well the default state of the animation before the check is applied, too.
Cheers!

Copyright Question

Excuse me, but i'm just starting with open source contribution, so i'm not used to how Issues, Pull Requests and discussions should behave. I don't know if I should create a issue to discuss this with you, but i created one on the doubt.

I created a fork of another Godot plugin, and I copied over the aseprite_cmd.gd from this repository, to implement a option to import .aseprite files directly (Without needing to manually generate .json files).

I should copy the license here over too?
And credit you in the README.md?
There's another thing I should take note about?

I'm Sorry if i seem rude.

spritesheets with alternate layouts

so far the importer seems to work great IF you laid it out with animations the way this tool is expecting them. i have some assets where someone made the layers be the anims, and i can't figure out how to import them and maintain my sanity. if i use the "split layers" they do come in, but then i have dozens of res files that need to be combined. any ideas? example

Did not find aseprite executable

Hi, we tried the version from the Godot Asset store and on the two Windows 10 machines we've tested, we go the error message that says, that it couldn't find the aseprite executable.
We were using

  • Godot 3.3.2 stable
  • Aseprite v1.2.27-x64
  • Aseprite Wizard 1.4.0
    We had both configured our PATH, so that Aseprite can be launched from any directory by typing in aseprite and double-checked the configure button in the Wizard, which was also set to only aseprite (the default).

Possibility to choose multiple specific layers for import.

Hi there! Wonderful plugin, super helpful in every way so far

I was wondering if we could see an option to choose multiple layers instead of a single one in the layer setting in a future update.

Right now what I do is open the ase file and hide/show the layers I want to import but it'd be handy to have the option to select multiple specific layers straight inside godot.

Thanks again!

Support to Godot 4

I've just migrated the plugin to Godot 4. You can find the new implementation in the godot_4 branch. Everything should be working accordingly. I'm opening this feature for visibility.

Until Godot 4 passes 3 in popularity, I'm keeping the main branch supporting version 3. This means that any change related to Godot 4 should be aimed to the godot_4 branch.

godot_4 is the default branch now. For Godot 3 changes use the godot_3 branch as target.

I'm not expecting contributors to send changes to both branches, but I'll try to keep them in sync as much as possible.

Here are a few highlights:

Automatic importer works properly

Thanks to the async/await implementation, I was able to make the automatic importer work properly. This is a Godot importer that allows people to use .ase and .aseprite files directly as SpriteFrames, and every update in these files triggers a re-import in Godot.

I personally don't like to work like this, but some people seems to enjoy it. Some warnings around the png import might still appear in the output console, but all my tests were successful. Files are not bloated as before and cache problems seem to be less common.

This required a major refactor on sprite_frames_creator.gd, which I intend to port back to Godot 3. If you are working on a feature in this file keep in mind some conflicts might be on the way.

I also removed the extra texture options from the importer for the sake of simplicity. I'll just re-introduce them if someone request these features.

Texture filter moved to the node

In Godot 4, Texture filters moved from the importer to the node itself. This makes the Custom preset feature less relevant, but I'm still keeping it. At least for now.

Animation Player libraries

Animation Players now store animations inside animation libraries. When using the editor any animation set directly in the player is added to a Global library (global to the player). The plugin is currently also importing animations to the Global library. If you name your Aseprite tags following the pattern library_name/animation_name, the animation will be set to the correct library.

Versions

Versions will still follow semantic versioning, with the godot major version appended to the end. (i.e for godot 4, v5.1.0-4). This is only relevant in case you download the plugin from the Releases tab on Github.

Godot 4 plugin.

Godot 3 plugin

Does not seem to work with Steam

I have Godot and Aseprite installed with my Steam.

Installed the plugin, restarted it, it didn't work. So I thought "It's probably about the path issue.". So I actually added aseprite binary path to my PATH variable. It doesn't work again, saying:

In-Godot Logs
ERROR - Could not import aseprite file: Aseprite command failed. Please, check if the right command is in your PATH or configured through the "configuration" button.
 editor/editor_file_system.cpp:1817 - Error importing 'res://protagonist.aseprite'
Environment
  • Ubuntu 20.04
  • Steam 162...086
  • Godot Engine v3.3.2.stable.official
  • Aseprite v1.2.27-x64

Aseprite is in PATH variable. I checked that. I also tried restarting Godot and Steam as well. It didn't work.

about Aseprite 1.3-rc4 new features: repeat in tag

Snipaste_2023-07-01_17-44-58.jpg

Sorry to bother you.

Recently, there has been a new beta version of Aseprite (it doesn't seem to be available on the official website yet, but I purchased Aseprite on Steam, and there is an option for this beta version). This new version includes a feature for animating repetitions, allowing a specific number of repetitions for animations within a tag.
I would like to know if there are any subsequent plugin update for this new feature.
If not currently available, how can I temporarily modify the plugin so that I can obtain the value of 'Repeat'

About this in Aseprite API:

Tag.repeats

local n = tag.repeats
tag.repeats = n
Gets or sets the number of times the tag is repeated/looped.

0 = Doesn't specify, plays infinite in UI, once on export, for ping-pong it plays once in each direction
1 = Plays once, for ping-pong it plays just in one direction
2 = Plays twice, for ping-pong it plays once in each direction, and once in reverse
n = Plays N times

Sprite3D

Is it possible to get this to work with Sprite3D?

Command not found on Mac

I tried multiple options for the Aseprite command path on MacOS but it always says "Command not found"
The same project works perfectly fine on Windows.

I tried using the path provided by Steam and the one in the Applications folder:
"/Users/username/Library/Application Support/Steam/steamapps/common/Aseprite/Aseprite.app"
"/Users/username/Applications/Aseprite.app"

I am using Godot 4.1.2.stable and MacOS Sonoma 14.0

Imported .res is too big

Hello! First of all, I'd like to thank you for developing this amazing tool!

I installed the plugin and everything works fine. I had no issues so far.
But when I went to check my resources folder, I saw that each ".res" files weights about 180 mb. It is weird, since my .aseprite file are all less than 160kb.

I tested this on the last Godot release on WIndows and Linux. It works the same.

Is this the expected behaviour or is it an issue?
If it is an issue, I'd like to help solve this. Thank you!

Output texture is not power-of-two

Currently, exported textures are non-power-of-two. With today's GPUs this isn't a compatibility concern per se, but having NPOT sizes can cause floating point accuracy issues when slicing the texture, and there might also be a slight performance impact as well. It would be nice if there were an option to automatically pad the output texture to be the nearest POT size.

Store config in metadata instead of editor_description property

Hi,

One of the few things I dislike about this great plugin is that it is currently storing config as a base64 encoded string in the editor_description property. There is a better option. you can store the config dictionary in the object metadata using methods set_meta, get_meta, has_meta. i.e.

func _ready():
	var cfg = null
	
	if sprite.has_meta(wizard_config.META_NAME):
		cfg = sprite.get_meta(wizard_config.META_NAME)

and

func _save_config():
	var cfg = {
		"player": _animation_player_path,
		"source": _source,
		"layer": _layer,
		"op_exp": _options_title.pressed,
		"o_folder": _output_folder,
		"o_name": _out_filename_field.text,
		"only_visible": _visible_layers_field.pressed,
		"o_ex_p": _ex_pattern_field.text
	}
	
	sprite.set_meta(wizard_config.META_NAME, cfg)

There was only a few minor things I had to change. Seems to work quite well. I might be able to do PR later. I haven't actually forked the repo, I am just playing in a project I installed the plugin into. Not sure how to test the plugin without adding things to the repo.

Godot 4: Wrong Enum used for Sprite3D and AnimatedSprite3D texture filters

Hi everyone,

I tried out the current Godot 4 branch of AsepriteImporter in my project and I really enjoy it.
The only problem I faced was that the filter for my Sprite3D was always resetted to Linear from my wanted Nearest after importing the texture again.
After looking at the sprite_frames_creator and animation_creator i found that the wrong Enum was used for the 3D sprite nodes.

(Animated)Sprite2D is a subclass of CanvasItem while (Animated)Sprite3D is a subclass of SpriteBase3D. Both have a property texture_filter but use different enums.
CanvasItem.TEXTURE_FILTER_NEAREST has an internal value of 1 while BaseMaterial3D.TEXTURE_FILTER_NEAREST has a value of 0.
By using CanvasItem.TEXTURE_FILTER_NEAREST for (Animated)Sprite3D you actually get BaseMaterial3D.TEXTURE_FILTER_LINEAR as this has an internal value of 1 as well.

Therefore I propose to check whether the node in question is a CanvasItem and use CanvasItems enum in that case. BaseMaterial3D will be used in every other case.

I have tried that out locally and it worked fine for my use case.
I will provide a branch after finalizing this issue.

If there are any questions or misunderstandings on my part feel free to comment below this issue. Maybe I just used the tool wrongly :D

EDIT:
Unfortunately I am not allowed to create a branch and I don't think that a fork for this minimal change would be the correct way. Therefore I will just post the changes I did here instead:

animation_creator.gd line 75ff:

	if target_node is CanvasItem:
		target_node.texture_filter = CanvasItem.TEXTURE_FILTER_NEAREST
	else:
		target_node.texture_filter = BaseMaterial3D.TEXTURE_FILTER_NEAREST

sprite_frames_creator.gd line 66ff:

	if animated_sprite is CanvasItem:
		animated_sprite.texture_filter = CanvasItem.TEXTURE_FILTER_NEAREST
	else:
		animated_sprite.texture_filter = BaseMaterial3D.TEXTURE_FILTER_NEAREST

Doesn't work with Animation Player

This plugin works great if you are using an AnimatedSprite, you can just drop the generated .res file right into it. But if you have a normal Sprite and use an AnimationPlayer/AnimationTree, to control it, there's no way I could find to get the frame animations loaded into the player.

I don't expect this to be fixed, but there is a different Aseprite Importer that does do this in case anyone else is stuck with this issue like I was: https://github.com/hectorid/aseprite_importer

Inconsistent AtlasTexture displaying when Trim Mode is active(?)

Hello again! Thank you so much for implementing my proposal and its configurations for every user to enjoy!

I was in the process of importing my work to utilise this plugin.
Now, the Trim Mode option is pretty useful for saving space. When enabled however, and I don't know if this is intentional, animations are offset unexpectedly. At least, not in the same way as they're shown in Aseprite.
For example, here's a simple ball animation. In Aseprite, and when exported with Trim Mode, the ball moves up and squishes down.
https://user-images.githubusercontent.com/66727710/142782410-9d672d4a-3a5f-4f70-acd6-eb656cbd7c67.mp4

However, in Godot, the ball squishes while stationary.
https://user-images.githubusercontent.com/66727710/142782519-26b106a4-7261-4585-ad30-3b098b9d3098.mp4

I didn't give up on trimming, since I would've loved that bit extra memory squeezing.
I ended up "fixing" this by changing the _create_atlastexture_from_frame() function to take in account how much the sprite was trimmed and applying it to the atlas' margin:

func _create_atlastexture_from_frame(image, frame_data):
	var atlas = AtlasTexture.new()
	var frame = frame_data.frame
	var sprite_source_size = frame_data.spriteSourceSize
	var source_size = frame_data.sourceSize

	atlas.atlas = image
	atlas.region = Rect2(frame.x, frame.y, frame.w, frame.h)
	if (frame_data.trimmed):
		atlas.margin = Rect2(
				sprite_source_size.x, sprite_source_size.y, 
				source_size.w - frame.w, source_size.h - frame.h
		)
	return atlas

Once again, I do not know if this is intentional. Could it be that messing with the AtlasTexture's margin has negative effects on textures not used in SpriteFrames? Or, likely, the original behavior is completely fine, since the sprite is being trimmed in memory, and is something to be expected. I'm not sure, I just wanted to document what I believed to be an inconsistency.

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.