ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / Animation Class / Tracks Property
Example

In This Topic
    Tracks Property
    In This Topic
    Gets and sets the list of tracks in the animation.
    Syntax
    Public Property Tracks As List(Of Track)
    public List<Track> Tracks {get; set;}
    Remarks
    A track stores the collection of keyframes whose values and transitions define the interpolated values for each frame of the animation. This property will always return 4 tracks and specifically it will contain one CameraTrack, LayerTrack, TimeTrack and RangeTrack. Each track type stores a corresponding keyframe for that type and is used to animate either the camera position, map time, map range, or layer visibility and transparency. The duration of the animation is equal to the time of the last keyframe in all tracks. The animation is removed from the map by deleting all keyframes in all tracks.
    Example
    Camera Keyframes
    {
      var animation = mapView.Map.Animation;
      var cameraTrack = animation.Tracks.OfType<CameraTrack>().First(); //There will always be only 1 CameraTrack in the animation.
      var result = cameraTrack.Keyframes.OfType<CameraKeyframe>().ToList();
      //Use the camera keyframes (if any)
    }
    Create Camera Keyframe
    {
      var animation = mapView.Map.Animation;
      var cameraTrack = animation.Tracks.OfType<CameraTrack>().First(); //There will always be only 1 CameraTrack in the animation.
      cameraTrack.CreateKeyframe(mapView.Camera, atTime, AnimationTransition.FixedArc);
    }
    Create Time Keyframe
    {
      var animation = mapView.Map.Animation;
      var timeTrack = animation.Tracks.OfType<TimeTrack>().First(); //There will always be only 1 TimeTrack in the animation.
      timeTrack.CreateKeyframe(mapView.Time, atTime, AnimationTransition.Linear);
    }
    Create Range Keyframe
    {
      var animation = mapView.Map.Animation;
      var rangeTrack = animation.Tracks.OfType<RangeTrack>().First(); //There will always be only 1 RangeTrack in the animation.
      rangeTrack.CreateKeyframe(range, atTime, AnimationTransition.Linear);
    }
    Create Layer Keyframe
    {
      var animation = mapView.Map.Animation;
      var layerTrack = animation.Tracks.OfType<LayerTrack>().First(); //There will always be only 1 LayerTrack in the animation.
      layerTrack.CreateKeyframe(layer, atTime, true, transparency, AnimationTransition.Linear);
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also