viniciusgerevini / godot-aseprite-wizard

Godot Editor plugin to help import Aseprite animations to AnimationPlayers, AnimatedSprites and SpriteFrames.
MIT License
821 stars 42 forks source link

Possibility to choose multiple specific layers for import. #117

Open cachi01 opened 7 months ago

cachi01 commented 7 months ago

Hi there! Wonderful plugin, super helpful in every way so far

I was wondering if we could see an option to choose multiple layers instead of a single one in the layer setting in a future update.

Right now what I do is open the ase file and hide/show the layers I want to import but it'd be handy to have the option to select multiple specific layers straight inside godot.

Thanks again!

viniciusgerevini commented 7 months ago

Hello @cachi01 . Thank you. Selecting multiple layers will require some thinking. I don't think godot has any nice multi-select node to be used in the inspector and I need to check which command is being used. It might be possible

Yeah, having to manually hide the layers is annoying. I have a couple alternatives that might be easier if you haven't thought about them yet.

The simplest way is by using Groups in Aseprite. You put all layers you want exported in a group and select it instead of the individual layers. The downside is that if your intention is to export more than one sprite from the same source file and they have shared layers, those shared layers won't be included if not in the group.

The second method I can think of is by using the exclusion pattern. It requires a little bit of knowledge of Regex, but you can use a negated pattern to select only the layers you want.

Let's say in the same file you have layers for a green character, a blue character and some shared layers. To export the green char you could do something like this: (?!green|shared). This regex would exclude any layer that doesn't contain green or shared in the name.

You could also use a prefix instead. Like this: ^(?!char_1_|shared_). For this one, all layers starting with char_1_ or shared_ will be included in the final animation and the others ones be ignored.

I don't think any of these methods are ideal, but they might make your life easier in the meantime. Cheers.

MaxRabbit commented 6 months ago

One note I'll add in here for any future readers. If you have your layers grouped together in Aseprite then your regex has to include those parent groups if you want them to import.

e.g.

Clothes
    Shirts
        RedShirt
        BlueShirt
    Jackets
        LeatherJacket

You have the Clothes group and inside that are the Shirts and Jackets groups and inside those are your layers. If you want to import only the RedShirt then your regex should be (?!Clothes|Shirts|RedShirt) rather than just (?!RedShirt).