unity-aseprite-importer icon indicating copy to clipboard operation
unity-aseprite-importer copied to clipboard

Image embedded data

Open ArkuniGIT opened this issue 4 years ago • 8 comments

It would be nice I was able to embed data into the image itself, similar to how MetaSprite does it: https://github.com/WeAthFoLD/MetaSprite/wiki/Metadata

Specifically...

  • [ ] Add a layer in aseprite with a special name (ie. #pivot) where you can draw the pivot point for each sprite.
  • [ ] Add a layer in aseprite with a special name (ie. //whatever) where you can draw whatever without it getting imported.
  • [ ] Add a special tag attribute to each tag to indicate a looping animation (ie. TagNameExample #loop)

MetaSprite has a few more, but for now, these would be great timesavers and painkillers.

ArkuniGIT avatar May 19 '20 17:05 ArkuniGIT

Hey @ArkuniGIT could you elaborate what the other features are? Im currently working on implementing the first and last of your request. I had a private branch on this but need to fix some bugs.

advra avatar May 23 '20 07:05 advra

Hey @ArkuniGIT could you elaborate what the other features are? Im currently working on implementing the first and last of your request. I had a private branch on this but need to fix some bugs.

You are the best! <3

I didn't really use the other features, so this is my interpretation of the documentation that I could see being very useful in other situtations.

  • [ ] Ad a layer in aseprite with a special name (ie. #childName1.position) where you can draw the local position for each child element.
  • [ ] Ad a layer in aseprite with a special name (ie. #boxCollider or #childName1.boxCollider) where you can draw the local position and size for box colliders.
  • [ ] Add a layer in aseprite with a special name (ie. #event("FunctionName")) that will generate the a native animation event for every frame where there is at least one drawn pixel.

ArkuniGIT avatar May 23 '20 07:05 ArkuniGIT

A little update:

Add a layer in aseprite with a special name (ie. #pivot) where you can draw the pivot point for each sprite.

I need this as well as even frames to reszie colliders and trigger events. For now I have a similar feature to Metasprite where you define the pivot point for the entire file in the first animation tag that follows the format "Pivot:x,y".

Add a layer in aseprite with a special name (ie. //whatever) where you can draw whatever without it getting imported.

I have this implemented in one of my branches. Stlll need to do further testing.

Add a special tag attribute to each tag to indicate a looping animation (ie. TagNameExample #loop) By default our asepriteimporter will set animation loop to true. My version markes "Play Once" by appending a "-" to the front but I like then # a bit more now I think about it. Anyways I put them as variables so you can customize these. (I will make these serializable so you dont ever have to go into the code)

Add a layer in aseprite with a special name (ie. #event("FunctionName")) that will generate the a native animation event for every frame where there is at least one drawn pixel.

This is on the way. Kind of spent most of my day working on something similar. The animations are no longer read-only in unity so you can directly edit the events in unity rather than going into aseprite. But being able to edit it in aseprite is is an option. But I am not sure which way is would be the better route in the long run.

advra avatar May 26 '20 07:05 advra

I need this as well as even frames to reszie colliders and trigger events. For now I have a similar feature to Metasprite where you define the pivot point for the entire file in the first animation tag that follows the format "Pivot:x,y".

I think it will be quicker to change/view and less prone to errors if you are drawing the pivot, rather than writing it.

I have this implemented in one of my branches. Stlll need to do further testing.

Add a special tag attribute to each tag to indicate a looping animation (ie. TagNameExample #loop) By default our asepriteimporter will set animation loop to true. My version markes "Play Once" by appending a "-" to the front but I like then # a bit more now I think about it. Anyways I put them as variables so you can customize these. (I will make these serializable so you dont ever have to go into the code)

Great idea!

This is on the way. Kind of spent most of my day working on something similar. The animations are no longer read-only in unity so you can directly edit the events in unity rather than going into aseprite. But being able to edit it in aseprite is is an option. But I am not sure which way is would be the better route in the long run.

I think this varies from developer to developer, but I like the idea of not having to touch the asprite importer settings and being able to define it all in the file itself.

ArkuniGIT avatar May 26 '20 16:05 ArkuniGIT

I think this varies from developer to developer, but I like the idea of not having to touch the asprite importer settings and being able to define it all in the file itself.

Sorry, not the importer itself. I meant using the unity curve editor where Animation Events are defined. image

advra avatar May 26 '20 17:05 advra

What if you change the animation? Like adding a couple of extra frames/seconds to the beginning of the animation, then upon reimport, your events will need to be readjusted. I think it is easier to control if defined alongside the animation in the aseprite file.

ArkuniGIT avatar May 26 '20 17:05 ArkuniGIT

The events are index based so they likely will get shifted. But I am in love with the idea of creating a bounding box for the collider in aseprite rather than unity. Im really considering the long term and steering clear of anything "breaking" when there is a major unity update.

advra avatar May 26 '20 18:05 advra

Could be resolved with https://github.com/martinhodler/unity-aseprite-importer/issues/36

advra avatar Dec 07 '20 20:12 advra