viniciusgerevini / godot-aseprite-wizard

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

Invalid character in file names when selecting a layer. #59

Closed dfkeenan closed 1 year ago

dfkeenan commented 2 years ago

Hi,

When retrieving the layer names from an aseprite file the names end up having a carriage return character \r on the end. This is not valid in file names. Well it is erroring for me at least. I am not sure if it is because I am on Windows, I am using the Aseprite 1.3 beta, or some other issue. Changing the below line to remove the character solved the issue for me.

https://github.com/viniciusgerevini/godot-aseprite-wizard/blob/feaa8fe71e00a0b1584d0b69e06b1df89dc3f7e3/addons/AsepriteWizard/aseprite/aseprite.gd#L133

i.e.

    return output[0].replace("\r","").split('\n')

Really cool plugin by the way. 😄

viniciusgerevini commented 2 years ago

Thanks @dfkeenan. I'm glad you found a solution for now. I'll take a look on it. Can you give me an example of layer name you used in case I can´t reproduce the issue?

dfkeenan commented 2 years ago

I have a Player.aseprite file it has 2 layers. Player and Background. I was trying to select the one called Player and import it to Sprite/AnimationPlayer. I have attached the file if you want to try that.

Player.zip

viniciusgerevini commented 2 years ago

Thank you. That's useful.