GithubHelp home page GithubHelp logo

rampantdespair / aseprite-extension Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 0.0 4.72 MB

An Aseprite extension that lets you import, export and manipulate layers

License: GNU General Public License v2.0

Lua 100.00%

aseprite-extension's Introduction

Logo

Aseprite-Extension

An Aseprite extension that lets you mass-import images, export importable Spine data and manipulate layers

Report Bug Request Feature
License

Aseprite Spine
Lua

About The Project

This project was made to remove a few hassles I had when working with Asperite:

  • Exporting a sprite to Spine
  • Mass importing images into a Sprite
  • Renaming sprite layers
  • Sorting sprite layers

With that in mind, this Aseprite extension lets you do all of the above with ease.

Features

  • Automatically save your settings to global/local config

Installation

  1. Download the latest-release
  2. Go to your downloads folder
  3. Execute the asperite-extension file
  4. Go to Edit > Preferences > Extensions
  5. Make sure that Despair Extension is present under the Scripts category

Usage

  1. Click File > Despair Extension

Settings

Config Settings

Option Description Default Value
Current Config The current config file that's being used. global

Buttons Information

Button Description
Confirm Confirms the settings for export.
Cancel Cancels the export altogether.
Reset Resets the settings to their default values.

Scripts

Exporter
Showcase

Example

Transform this:

aseprite-example

Into that:

spine-example

Features

Generic

  • Configurable output path
  • Configurable images & sound paths
  • Ability to export Sprite sheet
  • Ability to trim a Sprite's file name
  • Ability to format the Sprite's file name
  • Configurable export file format
  • Ability to trim the Sprite sheet

Spine

  • Ability to convert SpriteSheet into importable Spine data
  • Configurable root positioning
  • Ability to convert Aseprite groups into Spine skins
  • Ability to format slot and attachment names

Important

  • You cannot name your skins "default" as this is reserved by Spine itself

Settings

Output Settings

Option Description Default Value
Output File The parent directory of the selected file will be used for export. the file itself
Output Subdirectory The subdirectory used for export. images
Groups As Directories If each group will be exported to it's own directory. true

Sprite Settings

Option Description Default Value
Export SpriteSheet If the sprite sheet will be exported. true
Sprite Name Trim If the sprite name will be trimmed.
Trims the first instance "_" and everything preceding it.
true
File Name Format The file name's format with modifiable placeholders. {spritename}-{layergroup}-{layername}
File Format The files' export format. png
SpriteSheet Trim If the exported files' will have their excess space trimmed. true

Spine Settings

Option Description Default Value
Export SpineSheet If the spine sheet will be exported. true
Set Static Slot If the same slot will be used for everything that's exported. true
Static Slot Name The name of that static slot. slot
Set Root Position If the root position will be set in the export file. true
Root Position Method The method which will be used for setting the position.
Automatic: To use this method, create a layer called "root" and place a single pixel where you want the root to be.
Center: The center of the canvas will be used as root.
Manual: Input the coordinates manually in the subsequent fields.
center
Root Position X The X coordinate of the root. 0
Root Position Y The Y coordinate of the root. 0
Set Images Paths If the images path whithin the exported spine file will be set. true
Images Path The images path. images
Groups As Skins If you want to convert aseprite groups to spine skins. true
Skin Name Format The skins' format with modifiable placeholders. weapon-{layergroup}
Seperate Slot/Skin If you want to seperate the slots and skins. true
Slot Name Format The slots' name format with modifiable placeholders. {layernameprefix}
Skin Attachement Format The skins' attachement format with modifiable placeholders. {layernameprefix}-{layernamesuffix}
Layer Name Separator The layers' name seperator. -

Importer
Showcase

Features

  • Configurable input path
  • Ability to convert directories into layer groups
  • Ability to decide how the images should be positioned
  • Ability to manage how duplicates should be handled

Settings

Input Settings

Option Description Default Value
Input File The parent directory of the selected file will be used for import. the file itself
Input Subdirectory The subdirectory used for import. sprite
Directories As Groups If each directory will be imported to it's own group. true
Duplicates Mode The method which will be used for handling duplicate layers.
Ignore: The duplicates will be ignored and a new copy will be created.
Override: The duplicates will be updated with the newly imported cels.
Skips: The duplicates will be skipped (nothing will happen).
override
Sprite Position Method The method which will be used for positioning cels.
Center: The cels will be centered to canvas.
Inherit: The cels will keep their position from the imported file.
Manual: The cels will have the position specified.
center
Sprite Position X The X coordinate of the sprite. 0
Sprite Position Y The Y coordinate of the sprite. 0

Renamer
Showcase

Features

  • Ability to mass rename all layers present in Sprite

Settings

Input Settings

Option Description Default Value
Match Matches the specified string for replacement. this
Replace Replaces the matched string with the one specified here. that
Prefix Adds the specified string at the start of the layer name. prefix
Suffix Adds the specified string at the end of the layer name. suffix

Sorter
Showcase

Features

  • Ability to sort all layers present in Sprite

Settings

Input Settings

Option Description Default Value
Sort Method The method which will be used for sorting layers.
Ascending: The layers will be sorted ascendingly.
Descending: The layers will be sorted descendingly.
ascending

Contributing

If you have a suggestion that would make this better, please fork the repo and create a pull request.
You can also simply open an issue with the tag "enhancement".
Any contributions you make are greatly appreciated.

Links

Acknowledgments

aseprite-extension's People

Contributors

rampantdespair avatar

Stargazers

cam avatar Cameron Krebbers avatar  avatar  avatar etowner avatar Luke Ingram avatar

Watchers

 avatar

aseprite-extension's Issues

Error: Stack traceback on export

Hello, I tried using your script to export to Spine, but ran into an issue. Console log can be found below:

Console [string "internal"11: stack traceback: [string "internal:: in function generic_mt_index" /Users/lonk/Library/Application Support/Aseprite/scripts/Aseprite-Exporter.lua:65: in function exportSpriteLayers' /Users/lonk/Library/Application Support/Aseprite/scripts/Aseprite-Exporter.lua:40: in function 'export" /Users/lonk/Library/Application Support/Aseprite/Scripts/Aseprite-Exporter.lua:437: in main chunk: Field name does not exist

aseprite-export-script-error

Export to Spine Issue

Hello!

I have been trying to use your Despair Extension. When I export the layers from Aseprite it exports them all, but once imported to Spine it seems like it knows the positioning, but it does not show up. I haven't touched this software in quite a while, so it's probably user error here, but I cannot figure out what is wrong.

Here is a screenshot from in Spine:
1714291316-515115-image

Here is the json output:
{ "skeleton": { "images": "./images/" }, "bones": [ { "name": "root" } ], "slots": [ { "name": "slot", "bone": "root", "attachment": "slot" } ], "skins": { "default": { "slot": { "Mage-001-default-Torso": { "x": -3.00, "y": -5.00, "width": 34, "height": 18 } }, "slot": { "Mage-001-default-Right_leg": { "x": -9.00, "y": -15.00, "width": 14, "height": 14 } }, "slot": { "Mage-001-default-Right_foot": { "x": -7.00, "y": -24.00, "width": 10, "height": 8 } }, "slot": { "Mage-001-default-Right_arm": { "x": -14.00, "y": -7.00, "width": 4, "height": 10 } }, "slot": { "Mage-001-default-Left_leg": { "x": 6.00, "y": -15.00, "width": 16, "height": 14 } }, "slot": { "Mage-001-default-Left_foot": { "x": 5.00, "y": -24.00, "width": 10, "height": 8 } }, "slot": { "Mage-001-default-Left_arm": { "x": 12.00, "y": -7.00, "width": 4, "height": 10 } }, "slot": { "Mage-001-default-Cloak": { "x": 18.00, "y": -8.00, "width": 28, "height": 32 } }, "slot": { "Mage-001-default-Head": { "x": 3.00, "y": 14.00, "width": 50, "height": 36 } }} }, "animations": { "animation": {} }}

JSON Data:
1714291519-572507-image}

Thank you.

Edit:

Aseprite Project Hierarchy:
image

Local Config:

configSelect=local
outputSubdirectory=images
outputGroupsAsDirectories=true
spriteSheetExport=true
spriteSheetNameTrim=true
spriteSheetFileNameFormat={spritename}-{layergroup}-{layername}
spriteSheetFileFormat=png
spriteSheetTrim=true
spineExport=true
spineSetStaticSlot=true
spineStaticSlotName=slot
spineSetRootPostion=true
spineRootPostionMethod=center
spineRootPostionX=0
spineRootPostionY=0
spineSetImagesPath=true
spineImagesPath=images
spineGroupsAsSkins=true
spineSkinNameFormat=weapon-{layergroup}
spineSeparateSlotSkin=true
spineSlotNameFormat={layernameprefix}
spineSkinAttachmentFormat={layernameprefix}-{layernamesuffix}
spineLayerNameSeparator=-

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.