hectorid / aseprite_importer Goto Github PK
View Code? Open in Web Editor NEWA plugin for the Godot Engine that imports animations from Aseprite
License: MIT License
A plugin for the Godot Engine that imports animations from Aseprite
License: MIT License
Could you add a toggle loop when importing animations? Or perhaps theres an option on Aseprite
How can I port this to godot 4?
I struggled for some minutes trying to find out where is the entry point to import animations. In the end i only found it by looking at the picture in the readme (yeah, sorry, i usually go straight to text). So adding a clarification saying "It adds a main screen next to AssetLib" would be very useful.
It's my understanding sprite sheet animations should be discreet. You don't want to interpolate between frames, you want to instantly jump.
So after this line:
# Set the track Interpolation Mode to Nearest
animation.track_set_interpolation_type(track.idx, Animation.INTERPOLATION_NEAREST)
I added this line:
# Set Update mode to discreet
animation.value_track_set_update_mode(track.idx, Animation.UPDATE_DISCRETE)
I followed the instructions: exported a JSON file from Aseprite, but when I try to import the json I get:
res://addons/aseprite_importer/interface/import_menu/JSONImportMenu.gd:59 - Invalid get index 'JSON_PARSE_ERROR' (on base: 'Dictionary').
This is really strange because the json is valid:
{ "frames": {
"particles 0.aseprite": {
"frame": { "x": 0, "y": 0, "w": 8, "h": 8 },
"rotated": false,
"trimmed": false,
"spriteSourceSize": { "x": 0, "y": 0, "w": 8, "h": 8 },
"sourceSize": { "w": 8, "h": 8 },
"duration": 100
},
"particles 1.aseprite": {
"frame": { "x": 8, "y": 0, "w": 8, "h": 8 },
"rotated": false,
"trimmed": false,
"spriteSourceSize": { "x": 0, "y": 0, "w": 8, "h": 8 },
"sourceSize": { "w": 8, "h": 8 },
"duration": 100
}
},
"meta": {
"app": "http://www.aseprite.org/",
"version": "1.2.24-x64",
"image": "particles.png",
"format": "I8",
"size": { "w": 16, "h": 8 },
"scale": "1",
"frameTags": [
],
"layers": [
{ "name": "Layer 1", "opacity": 255, "blendMode": "normal" }
],
"slices": [
]
}
}
Thank you for your Godot plug-in. It works very well. I like it very much. But it has another bug. When I create a new animation, I can't select animationplayer. When I click generate animation, Godot prompts me to choose animationplayer. Restart Godot to solve this problem. I use version 3.2.2 of Godot. Thank you again for your plug-in. I hope you can fix this bug.
From what I can tell if you aren't using borders, the offset x&y for every frame of every anim is 0. I put in a check so that if all offset keys are 0x0 for an anim, it calls animation.remove_track(tracks.offset.idx) at the end to delete the unneeded anim track.
Godot Engine 3.1.2-stable-official
Mac OS 10.15.4
Aesprite 1.2.18
When I go to import a JSON, nothing is rendered in the sprite view, though I can see the tags listed. In the console, there's this output:
modules/gdscript/gdscript.cpp:580 - Method/Function Failed, returning: ERR_PARSE_ERROR
res://addons/aseprite_importer/interface/spritesheet_inspector/SpritesheetInspector.gd:62 - Invalid set index 'texture' (on base: 'Container (SpritesheetView.gd)') with value of type 'Nil'.
res://addons/aseprite_importer/interface/spritesheet_inspector/SpritesheetInspector.gd:48 - Invalid call. Nonexistent function 'load_settings' in base 'Container (SpritesheetView.gd)'.
res://addons/aseprite_importer/interface/spritesheet_inspector/SpritesheetInspector.gd:62 - Invalid set index 'texture' (on base: 'Container (SpritesheetView.gd)') with value of type 'Nil'.
res://addons/aseprite_importer/interface/spritesheet_inspector/SpritesheetInspector.gd:129 - Invalid set index 'texture' (on base: 'Container (SpritesheetView.gd)') with value of type 'StreamTexture'.```
Say I have a 3 frame pingpong animation, the way it would play in aseprite is: 1 2 3 2 1 2 3 2 1
But the way the importer will play the animation, if you turn on looping, is: 1 2 3 3 2 1 1 2 3 3 2 1
When importing the pingpong animation, it seems as though you just take the animation, duplicate it, then reverse and append it. The way to fix this should just be to do that, but without duplicating the first and last frame.
My mistake
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.