mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Merge pull request #107887 from DexterFstone/add-copy-paste-animation-sprite-frames
Add ability to copy and paste animations in SpriteFrames
This commit is contained in:
commit
95977711ed
4 changed files with 200 additions and 52 deletions
|
|
@ -1431,8 +1431,7 @@ void AnimatedSprite3D::set_animation(const StringName &p_name) {
|
|||
ERR_FAIL_MSG(vformat("There is no animation with name '%s'.", p_name));
|
||||
}
|
||||
|
||||
int frame_count = frames->get_frame_count(animation);
|
||||
if (animation == StringName() || frame_count == 0) {
|
||||
if (animation == StringName() || frames->get_frame_count(animation) == 0) {
|
||||
stop();
|
||||
return;
|
||||
} else if (!frames->get_animation_names().has(animation)) {
|
||||
|
|
@ -1442,7 +1441,7 @@ void AnimatedSprite3D::set_animation(const StringName &p_name) {
|
|||
}
|
||||
|
||||
if (std::signbit(get_playing_speed())) {
|
||||
set_frame_and_progress(frame_count - 1, 1.0);
|
||||
set_frame_and_progress(frames->get_frame_count(animation) - 1, 1.0);
|
||||
} else {
|
||||
set_frame_and_progress(0, 0.0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue