Show marker lines/sections in the animation bezier editor

This commit is contained in:
Michael Alexsander
2025-09-18 21:50:04 -03:00
parent 4fcd85551c
commit 0f614cd63f
2 changed files with 63 additions and 8 deletions

View File

@ -7778,6 +7778,14 @@ AnimationTrackEditor::AnimationTrackEditor() {
box_selection_container->set_clip_contents(true);
timeline_vbox->add_child(box_selection_container);
bezier_edit = memnew(AnimationBezierTrackEdit);
timeline_vbox->add_child(bezier_edit);
bezier_edit->set_editor(this);
bezier_edit->set_timeline(timeline);
bezier_edit->hide();
bezier_edit->set_v_size_flags(SIZE_EXPAND_FILL);
bezier_edit->connect("timeline_changed", callable_mp(this, &AnimationTrackEditor::_timeline_changed));
marker_edit = memnew(AnimationMarkerEdit);
timeline->get_child(0)->add_child(marker_edit);
marker_edit->set_editor(this);
@ -7786,6 +7794,7 @@ AnimationTrackEditor::AnimationTrackEditor() {
marker_edit->set_anchors_and_offsets_preset(Control::LayoutPreset::PRESET_FULL_RECT);
marker_edit->connect(SceneStringName(draw), callable_mp(this, &AnimationTrackEditor::_redraw_groups));
marker_edit->connect(SceneStringName(draw), callable_mp(this, &AnimationTrackEditor::_redraw_tracks));
marker_edit->connect(SceneStringName(draw), callable_mp((CanvasItem *)bezier_edit, &CanvasItem::queue_redraw));
scroll = memnew(ScrollContainer);
box_selection_container->add_child(scroll);
@ -7801,14 +7810,6 @@ AnimationTrackEditor::AnimationTrackEditor() {
scroll->get_v_scroll_bar()->connect(SceneStringName(value_changed), callable_mp(this, &AnimationTrackEditor::_v_scroll_changed));
scroll->get_h_scroll_bar()->connect(SceneStringName(value_changed), callable_mp(this, &AnimationTrackEditor::_h_scroll_changed));
bezier_edit = memnew(AnimationBezierTrackEdit);
timeline_vbox->add_child(bezier_edit);
bezier_edit->set_editor(this);
bezier_edit->set_timeline(timeline);
bezier_edit->hide();
bezier_edit->set_v_size_flags(SIZE_EXPAND_FILL);
bezier_edit->connect("timeline_changed", callable_mp(this, &AnimationTrackEditor::_timeline_changed));
timeline_vbox->set_custom_minimum_size(Size2(0, 150) * EDSCALE);
hscroll = memnew(HScrollBar);