talecrafter / AnimationImporter

Aseprite Animation Importer for Unity
613 stars 72 forks source link

Set root name of generated assets / generate a new set of assets for each layer #42

Open nathanabercrombie opened 4 years ago

nathanabercrombie commented 4 years ago

I have multiple layers in my aseprite project, and I want to control each layer with a different controller (example, characters upper body and lower body are independently controlled). There is not a good workflow to get this to import nicely with AnimationImporter. Because the name of the generated assets is based on the name of the aseprite file, I would need to have multiple asesprite files, which would make it hard to reference one layer to the other.

By having the name specifiable in the importer, I could simply toggle visibility of layers in aseprite between each layer import. Or there could be an option for each layer to be a different controller and set of animations. This could act similarly to the "non looping animation" section, where you specify the names of layers / layer groups to import.

GieziJo commented 3 years ago

I am looking to implement this with aseprite's group feature.

The one unsolvable thing for me right now is if you want asynchron animations. In this case you still need multiple aseprite files. In the animator, you then want multiple layers with the same structure, but this becomes a bit complicated.

I will go for synchronouse animations in the same animation but on different objects for now, changing the path depending on the group.

GieziJo commented 3 years ago

I've started working on this:

This seems promising, but there seems to be an issue with exporting groups as separate layers in the CLI (works from within aseprite). I've opened an issue: aseprite/aseprite#2948.

I don't think I can continue until this issue is resolved. Hope for the best 🤞

Edit: this actually doesn't work inside aseprite either, my bad. Splitting layers and only selecting groups does not let you export the groups as splitted lists. So this is probably not a bug.

I can try to write a lua file to merge groups, and then run the splitted routines. Will investigate this possibility.

GieziJo commented 2 years ago

I've been able to find a solution by implementing a lua file to merge down layers inside groups to one layer and export the file into one png. This should solve all above problems and allow me to move forward.