Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add post-save hooks #138

Open
aseprite-bot opened this issue Aug 20, 2014 · 2 comments
Open

Add post-save hooks #138

aseprite-bot opened this issue Aug 20, 2014 · 2 comments
Labels
feature Feature request, or something should be improved high priority imported scripting Related to scripting API ui
Milestone

Comments

@aseprite-bot
Copy link

aseprite-bot commented Aug 20, 2014

From davidcapello on July 16, 2012 00:25:07

What do you need to do? Sometimes, after saving a file (e.g. the original .ase file), we want to export it automatically to other format (.png), or export to a sprite sheet, or export it with a larger size. How would you like to do it? Specifying in a configuration dialog what are the post-save hooks for a specific file. There are some options:

  • Save a resized version (it's a very common case to publish pixel art on the web)
  • Save with other color mode (convert from RGB to Indexed with a specific palette).
  • Export sprite sheet (we should be able to configure the sheet parameters as "File > Export Sprite Sheet" command)
    See that all these actions can be combined.
    In the best case, the available/possible actions could be configured in gui.xml file.

Note: The real implementation could be done using a scripting language. Anyway this is for a future issue.

Original issue: http://code.google.com/p/aseprite/issues/detail?id=138


Some of this will be available with slices tool #721, the idea is quite simple: If we load/save a file (e.g. test.png) and there is a corresponding .aseprite-data file (e.g. test.png.aseprite-data), we will load/save data in that XML file depending on the content. For example, if we have:

<sprite>
  <slices />
</sprite>

Slices should be saved in the .aseprite-data file. The same might be true for other elements like <frames>, <layers>, <cels>, etc.

@aseprite-bot aseprite-bot added this to the v1.1 milestone Aug 20, 2014
@dacap dacap modified the milestones: v1.2, v1.1 Aug 31, 2014
@whizzter
Copy link

whizzter commented Dec 2, 2015

I was pondering about this (and with other tools also) since i often find myself iterating things in different projects with different needs usually resorting to a makefile or batch file so my flow typically becomes: editor -> run batchfile -> test (or go over if i forgot to run the batchfile!).

Maybe aseprite could look for a specially named file in the target directory and then run it on save/export if it exists.

F.ex. saving blah.ase somewhere would run "aseprite_auto_export.bat blah.ase" (or aseprite_auto_export.sh on non-windows). That way people could write their own batch export rules or tools in their own languages regardless of whatever scripting language you look into in the future?

@dacap
Copy link
Member

dacap commented Dec 2, 2015

Maybe aseprite could look for a specially named file in the target directory and then run it on save/export if it exists.

Some time ago I was thinking about the same possibility to customize save behavior/some kind of plugin for each sprite. But I think #126 (planed for v1.2) will include a better opportunity to add code snippets to create post-save hooks for a set of sprites.

@dacap dacap modified the milestones: v1.3, v1.4 Sep 12, 2017
@dacap dacap added the scripting Related to scripting API label Aug 30, 2018
@dacap dacap modified the milestones: v1.4, v1.3 Nov 13, 2018
dacap added a commit that referenced this issue Oct 7, 2021
Added a new Events object with :on() and :off() methods to start or
stop listening to a specific event respectively. This also allows to
add several callbacks for the same event.

Replaced the temporal Site.onChange & Sprite.onChange implementations.

Related to several issues (enable more possibilities for): #138, #1403, #1949, #2965, #2980
@dacap dacap self-assigned this Oct 14, 2021
@dacap dacap modified the milestones: v1.3, v1.3-beta7 Oct 14, 2021
@dacap dacap modified the milestones: v1.3-beta7, v1.3-beta8 Oct 26, 2021
@dacap dacap modified the milestones: v1.3-beta8, v1.3-beta9 Jan 12, 2022
@dacap dacap modified the milestones: v1.3-beta12, v1.3-beta13 Mar 14, 2022
@dacap dacap modified the milestones: v1.3-beta15, v1.3.1 Jun 1, 2022
@dacap dacap removed their assignment Sep 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature request, or something should be improved high priority imported scripting Related to scripting API ui
Projects
None yet
Development

No branches or pull requests

3 participants