Closed hsandt closed 1 year ago
Ah, thanks for the notice. I haven't been using AnimatedSprite recently, so I didn't know about the frame duration setting. I'm a bit busy at the moment so I'll have to take a look into it later, a PR would be welcomed in the meantime.
I also like the idea for the hybrid "don't replace existing tracks". The main reason I removed the option was that initially it was meant to prevent none sprite-related tracks from being replaced. I hadn't thought about the use case where we wouldn't want the sprite tracks themselves from being replaced, so an option might be needed.
OK, I need this today so I'll try some PR.
Context
I need to add some lag at the beginning of my attack animation for telegraphing, but since I'm using a spritesheet made by someone else, I cannot just draw my own extra sprites, so I'm just extending the duration of the first frames.
To do this, there are three ways: a. on the SpriteFrames, increase the Frame Duration setting of individual sprites (what we are interested in here) b. on the SpriteFrames, add copies of the same sprites after itself c. on the resulting AnimationPlayer animation, move the sprite keys after the sprite to extend later in the timeline
Issue
With method a., I noticed that the resulting animation still gives the same duration to every sprite frame, ignoring the Frame Duration setting.
Sprite Frames setup:
Resulting animation:
Request
When pressing Import, we should multiply the duration of a sprite frame in the resulting animation by Frame Duration.
Workaround
As a fallback, I tried method b., which works, but has two disadvantages:
As a second fallback, I tried method c., which works, but next time I press the Import button, it will replace my adjusted animation and all sprites will revert to having the same duration. Plus, the old "don't replace" mode from Godot 3 version has been removed, so I don't have a way to prevent overwriting my custom changes while still adding new animations (it would be useful to combine the old and new behavior with a hybrid mode "don't replace existing tracks" for these situations; but that would be the topic of another issue for proposal).