mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
Add type filters to AnimationPlayer's "Add Track"
Co-Authored-By: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> Co-Authored-By: Tomek <kobewi4e@gmail.com>
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user