Skip to content

Instantly share code, notes, and snippets.

@iancullinane
Created May 29, 2018 21:16
Show Gist options
  • Select an option

  • Save iancullinane/d3d0b2e38252473e12ab6f076fe1c961 to your computer and use it in GitHub Desktop.

Select an option

Save iancullinane/d3d0b2e38252473e12ab6f076fe1c961 to your computer and use it in GitHub Desktop.
Script to call from `entr` when an aseprite file change is detected
#!/bin/bash
# find . -name '*.ase' | sudo entr -d ./ase-file-change.sh /_
aseprite=/Users/icullinane/dev/aseprite/build/bin/aseprite
path=($1)
BASE=${1##*/} #trim to basepath
NAME=${BASE%.ase}
ASE_FILES=${ASE_FILES:-"${ASSETS}/raw"}
ASSETS=${ASSETS:-"/Users/icullinane/dev/assets"}
ASSETS_OUT=${ASSETS_OUT:-"${ASSETS}/2d/dist/exported"}
$aseprite -bv --split-layers $path \
--sheet-pack --list-tags \
--sheet $ASSETS_OUT/${NAME}.png \
--data $ASSETS_OUT/${NAME}.json
# Usage:
# aseprite.exe [OPTIONS] [FILES]...
# Options:
# --shell Start an interactive console to execute scripts
# -b, --batch Do not start the UI
# -p, --preview Do not execute actions, just print what will be
# done
# --save-as <filename> Save the last given sprite with other format
# --palette <filename> Change the palette of the last given sprite
# --scale <factor> Resize all previously opened sprites
# --data <filename.json> File to store the sprite sheet metadata
# --format <format> Format to export the data file (json-hash, json-array)
# --sheet <filename.png> Image file to save the texture
# --sheet-width <pixels> Sprite sheet width
# --sheet-height <pixels> Sprite sheet height
# --sheet-pack Use a packing algorithm to avoid waste of space
# in the texture
# --split-layers Import each layer of the next given sprite as
# a separated image in the sheet
# --split-tags Save each tag as a separated file
# --split-slices Save each slice as a separated file
# --layer <name> or
# --import-layer <name> Include just the given layer in the sheet
# --frame-tag <name> Include tagged frames in the sheet
# --ignore-empty Do not export empty frames/cels
# --border-padding <value> Add padding on the texture borders
# --shape-padding <value> Add padding between frames
# --inner-padding <value> Add padding inside each frame
# --trim Trim all images before exporting
# --crop x,y,width,height Crop all the images to the given rectangle
# --slice <name> Crop the sprite to the given slice area
# --filename-format <fmt> Special format to generate filenames
# --list-layers List layers of the next given sprite
# or include layers in JSON data
# --list-tags List tags of the next given sprite sprite
# or include frame tags in JSON data
# --list-slices List slices of the next given sprite sprite
# or include slices in JSON data
# --oneframe Load just the first frame
# -v, --verbose Explain what is being done
# --debug Extreme verbose mode and copy log to desktop
# -?, --help Display this help and exits
# --version Output version information and exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment