summaryrefslogtreecommitdiffstats
path: root/editor/animation_track_editor.cpp
diff options
context:
space:
mode:
authorThaddeus Crews <repiteo@outlook.com>2024-11-10 12:13:10 -0600
committerThaddeus Crews <repiteo@outlook.com>2024-11-10 12:13:10 -0600
commit0f5f3bc9546b46b2029fc8896dc859697f1eab97 (patch)
tree5b7a396094e1ea003de2b350205585651ce80918 /editor/animation_track_editor.cpp
parente7867a7c8e4cf4f90d7e29c5622728a9f48e44fd (diff)
parentd5176757c0bfca35f6040b825f6a3201edbdf136 (diff)
downloadredot-engine-0f5f3bc9546b46b2029fc8896dc859697f1eab97.tar.gz
Merge pull request #98558 from jasonmorgado/add-track-filter
Add type filters to AnimationPlayer's "Add Track"
Diffstat (limited to 'editor/animation_track_editor.cpp')
-rw-r--r--editor/animation_track_editor.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp
index c210ad0761..bc79b14d4a 100644
--- a/editor/animation_track_editor.cpp
+++ b/editor/animation_track_editor.cpp
@@ -5297,6 +5297,28 @@ void AnimationTrackEditor::_add_track(int p_type) {
return;
}
adding_track_type = p_type;
+ Vector<StringName> valid_types;
+ switch (adding_track_type) {
+ case Animation::TYPE_BLEND_SHAPE: {
+ // Blend Shape is a property of MeshInstance3D.
+ valid_types.push_back(SNAME("MeshInstance3D"));
+ } break;
+ case Animation::TYPE_POSITION_3D:
+ case Animation::TYPE_ROTATION_3D:
+ case Animation::TYPE_SCALE_3D: {
+ // 3D Properties come from nodes inheriting Node3D.
+ valid_types.push_back(SNAME("Node3D"));
+ } break;
+ case Animation::TYPE_AUDIO: {
+ valid_types.push_back(SNAME("AudioStreamPlayer"));
+ valid_types.push_back(SNAME("AudioStreamPlayer2D"));
+ valid_types.push_back(SNAME("AudioStreamPlayer3D"));
+ } break;
+ case Animation::TYPE_ANIMATION: {
+ valid_types.push_back(SNAME("AnimationPlayer"));
+ } break;
+ }
+ pick_track->set_valid_types(valid_types);
pick_track->popup_scenetree_dialog(nullptr, root_node);
pick_track->get_filter_line_edit()->clear();
pick_track->get_filter_line_edit()->grab_focus();