Skip to content

Commit a5e157d

Browse files
committedAug 26, 2024
Merge pull request #91854 from ImpishOaths/PullReady
Don't lose in/out handles when bezier keyframe inserted on top of existing keyframe
2 parents 2c14f3e + 0f7c4d8 commit a5e157d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed
 

‎editor/animation_track_editor.cpp

+8-1
Original file line numberDiff line numberDiff line change
@@ -4500,7 +4500,14 @@ AnimationTrackEditor::TrackIndices AnimationTrackEditor::_confirm_insert(InsertD
45004500

45014501
} break;
45024502
case Animation::TYPE_BEZIER: {
4503-
value = animation->make_default_bezier_key(p_id.value);
4503+
int existing = animation->track_find_key(p_id.track_idx, time, Animation::FIND_MODE_APPROX);
4504+
if (existing != -1) {
4505+
Array arr = animation->track_get_key_value(p_id.track_idx, existing);
4506+
arr[0] = p_id.value;
4507+
value = arr;
4508+
} else {
4509+
value = animation->make_default_bezier_key(p_id.value);
4510+
}
45044511
bezier_edit_icon->set_disabled(false);
45054512
} break;
45064513
default: {

0 commit comments

Comments
 (0)