<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to assign layers to keyframes in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-assign-layers-to-keyframes/m-p/1119039#M7372</link>
    <description>&lt;P&gt;Hello everyone! Im trying to automate the animation creation process using ArcGIS Pro SDK. I have a few raster layers&amp;nbsp;each of which&amp;nbsp;is tied to a specific time. So i need to create&amp;nbsp;several keyframes in each of which the corresponding raster layer will be visible. Can i to access layers properties in keyframes properties like in standart animation creation toolbar using SDK or there are another solutions?&lt;/P&gt;&lt;P&gt;I will be glad to recieve every answer!&lt;/P&gt;</description>
    <pubDate>Sun, 21 Nov 2021 13:01:05 GMT</pubDate>
    <dc:creator>DonKihout</dc:creator>
    <dc:date>2021-11-21T13:01:05Z</dc:date>
    <item>
      <title>How to assign layers to keyframes</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-assign-layers-to-keyframes/m-p/1119039#M7372</link>
      <description>&lt;P&gt;Hello everyone! Im trying to automate the animation creation process using ArcGIS Pro SDK. I have a few raster layers&amp;nbsp;each of which&amp;nbsp;is tied to a specific time. So i need to create&amp;nbsp;several keyframes in each of which the corresponding raster layer will be visible. Can i to access layers properties in keyframes properties like in standart animation creation toolbar using SDK or there are another solutions?&lt;/P&gt;&lt;P&gt;I will be glad to recieve every answer!&lt;/P&gt;</description>
      <pubDate>Sun, 21 Nov 2021 13:01:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-assign-layers-to-keyframes/m-p/1119039#M7372</guid>
      <dc:creator>DonKihout</dc:creator>
      <dc:date>2021-11-21T13:01:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign layers to keyframes</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-assign-layers-to-keyframes/m-p/1119364#M7374</link>
      <description>&lt;P&gt;For an animation sample, see&amp;nbsp;&lt;A href="https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Map-Exploration/CustomAnimation" target="_self"&gt;https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Map-Exploration/CustomAnimation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The example below will remove any existing layer keyframes and add new keyframes for four layers - layersA, B, C, and D - so that each is visible for three seconds.&amp;nbsp; If the timing needs to line up with the CameraTrack, the TrackTime can be pulled from each keyframe for that track. &amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, for a layer track the keyframes added to the beginning (zero seconds) &lt;U&gt;should duplicate the second keyframe&lt;/U&gt;.&amp;nbsp; Otherwise it would only show for an instant before transitioning to the second keyframe.&lt;/P&gt;&lt;P&gt;layerTrack.CreateKeyFrame:&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/#topic11829.html" target="_self"&gt;https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/#topic11829.html&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var map = ....
//has four layers - eg raster layers - layersA, layersB, layersC, layersD
//
if (map != null)
      {
        LayerTrack layerTrack = null;
        foreach (var track in map.Animation.Tracks)
        {
          if (!(track is LayerTrack))
            continue;

          layerTrack = track as LayerTrack;
          break;
        }

        if (layerTrack.Keyframes.Count &amp;gt; 0)
          layerTrack.DeleteKeyframe(0, layerTrack.Keyframes.Count - 1);
        //Layer, time on the track, Visibility, Transparency, Animation type
        layerTrack.CreateKeyframe(layersA, new TimeSpan(0, 0, 0), true, 1.0, AnimationTransition.Linear);
        layerTrack.CreateKeyframe(layersB, new TimeSpan(0, 0, 0), false, 1.0, AnimationTransition.Linear);
        layerTrack.CreateKeyframe(layersC, new TimeSpan(0, 0, 0), false, 1.0, AnimationTransition.Linear);
        layerTrack.CreateKeyframe(layersD, new TimeSpan(0, 0, 0), false, 1.0, AnimationTransition.Linear);

        layerTrack.CreateKeyframe(layersA, new TimeSpan(0, 0, 3), true, 1.0, AnimationTransition.Linear);
        layerTrack.CreateKeyframe(layersB, new TimeSpan(0, 0, 3), false, 1.0, AnimationTransition.Linear);
        layerTrack.CreateKeyframe(layersC, new TimeSpan(0, 0, 3), false, 1.0, AnimationTransition.Linear);
        layerTrack.CreateKeyframe(layersD, new TimeSpan(0, 0, 3), false, 1.0, AnimationTransition.Linear);

        layerTrack.CreateKeyframe(layersA, new TimeSpan(0, 0, 6), false, 1.0, AnimationTransition.Linear);
        layerTrack.CreateKeyframe(layersB, new TimeSpan(0, 0, 6), true, 1.0, AnimationTransition.Linear);
        layerTrack.CreateKeyframe(layersC, new TimeSpan(0, 0, 6), false, 1.0, AnimationTransition.Linear);
        layerTrack.CreateKeyframe(layersD, new TimeSpan(0, 0, 6), false, 1.0, AnimationTransition.Linear);

        layerTrack.CreateKeyframe(layersA, new TimeSpan(0, 0, 9), false, 1.0, AnimationTransition.Linear);
        layerTrack.CreateKeyframe(layersB, new TimeSpan(0, 0, 9), false, 1.0, AnimationTransition.Linear);
        layerTrack.CreateKeyframe(layersC, new TimeSpan(0, 0, 9), true, 1.0, AnimationTransition.Linear);
        layerTrack.CreateKeyframe(layersD, new TimeSpan(0, 0, 9), false, 1.0, AnimationTransition.Linear);

        layerTrack.CreateKeyframe(layersA, new TimeSpan(0, 0, 12), false, 1.0, AnimationTransition.Linear);
        layerTrack.CreateKeyframe(layersB, new TimeSpan(0, 0, 12), false, 1.0, AnimationTransition.Linear);
        layerTrack.CreateKeyframe(layersC, new TimeSpan(0, 0, 12), false, 1.0, AnimationTransition.Linear);
        layerTrack.CreateKeyframe(layersD, new TimeSpan(0, 0, 12), true, 1.0, AnimationTransition.Linear);
      }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Nov 2021 21:33:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-assign-layers-to-keyframes/m-p/1119364#M7374</guid>
      <dc:creator>CharlesMacleod</dc:creator>
      <dc:date>2021-11-22T21:33:40Z</dc:date>
    </item>
  </channel>
</rss>

