fixed crash when enabling/disabling tracks in animation editor
@@ -790,6 +790,16 @@ impl TrackList {
} else if let Some(TrackViewMessage::TrackEnabled(enabled)) = message.data() {
if message.direction() == MessageDirection::FromWidget {
if let Selection::Animation(ref selection) = editor_scene.selection {
+ if let Some(animation_player) = scene
+ .graph
+ .try_get(selection.animation_player)
+ .and_then(|n| n.query_component_ref::<AnimationPlayer>())
+ {
+ if animation_player
+ .animations()
+ .try_get(selection.animation)
+ .is_some()
+ {
if let Some(track_view_ref) = ui
.node(message.destination())
.query_component::<TrackView>()
@@ -807,6 +817,8 @@ impl TrackList {
}
}
}
+ }
+ }
pub fn clear(&mut self, ui: &UserInterface) {
ui.send_message(TreeRootMessage::items(
