{"id":1629,"date":"2016-10-26T01:17:52","date_gmt":"2016-10-26T01:17:52","guid":{"rendered":"http:\/\/bobbyciraldo.com\/uwm-vfx\/?page_id=1629"},"modified":"2018-05-08T21:42:58","modified_gmt":"2018-05-08T21:42:58","slug":"looping-keyframes","status":"publish","type":"page","link":"https:\/\/ciraldo.stream\/uwm-vfx1\/topics\/looping-keyframes\/","title":{"rendered":"Looping keyframes with expressions"},"content":{"rendered":"<h2><strong>Looping Keyframes with Expressions<\/strong><\/h2>\n<p>&nbsp;<\/p>\n<ol style=\"list-style-type: upper-roman;\">\n<li><strong><span style=\"color: #ff0000;\">loopIn and loopOut family of expressions<\/span><\/strong>\n<ol style=\"list-style-type: upper-alpha;\">\n<li>Sometimes you want to loop the <strong>keyframes<\/strong> on a layer&#8217;s property<\/li>\n<li>Make sure you have some keyframes on your property. <strong>The loopOut and loopIn expressions don&#8217;t work without keyframes to loop!<\/strong><\/li>\n<li><strong>Turn on expressions<\/strong> for the keyframed property by <strong>Option\/Alt-clicking<\/strong>\u00a0the stopwatch. Now you should see something like:<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1619\" src=\"http:\/\/bobbyciraldo.com\/uwm-vfx\/wp-content\/uploads\/2016\/03\/Screen-Shot-2016-10-25-at-4.14.03-PM.png\" alt=\"screen-shot-2016-10-25-at-4-14-03-pm\" width=\"303\" height=\"60\" \/><br \/>\nAt the bottom-right of the image above is a <strong>little black triangle button inside a light gray circle<\/strong>. Click <em>that<\/em>, it&#8217;s a shortcut menu for accessing commonly used expression snippets. It looks like this:<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1620\" src=\"https:\/\/ciraldo.stream\/uwm-vfx1\/wp-content\/uploads\/2016\/03\/Screen-Shot-2016-10-25-at-4.14.28-PM.png\" alt=\"screen-shot-2016-10-25-at-4-14-28-pm\" width=\"1043\" height=\"436\" srcset=\"https:\/\/ciraldo.stream\/uwm-vfx1\/wp-content\/uploads\/2016\/03\/Screen-Shot-2016-10-25-at-4.14.28-PM.png 1043w, https:\/\/ciraldo.stream\/uwm-vfx1\/wp-content\/uploads\/2016\/03\/Screen-Shot-2016-10-25-at-4.14.28-PM-300x125.png 300w, https:\/\/ciraldo.stream\/uwm-vfx1\/wp-content\/uploads\/2016\/03\/Screen-Shot-2016-10-25-at-4.14.28-PM-768x321.png 768w, https:\/\/ciraldo.stream\/uwm-vfx1\/wp-content\/uploads\/2016\/03\/Screen-Shot-2016-10-25-at-4.14.28-PM-1024x428.png 1024w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/li>\n<li>Choose <span style=\"color: #ff0000;\"><strong>loopOut(type=&#8221;cycle&#8221;, numKeyframes=0)<\/strong><\/span><\/li>\n<li>It should now show up in the expression text area:<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1621\" src=\"http:\/\/bobbyciraldo.com\/uwm-vfx\/wp-content\/uploads\/2016\/03\/Screen-Shot-2016-10-25-at-4.18.39-PM.png\" alt=\"screen-shot-2016-10-25-at-4-18-39-pm\" width=\"524\" height=\"75\" \/><\/li>\n<li>The word <span style=\"color: #ff0000;\"><strong>cycle<\/strong><\/span> means the loop should <em>start over at the beginning<\/em> when it gets to the end of the loop. It can be replaced with certain other words. Replace it with the word <span style=\"color: #ff0000;\"><strong>pingPong<\/strong><\/span>\u00a0so that the loop plays back-and-forth:<br \/>\n<strong>loopOut(type=&#8221;pingPong&#8221;, numKeyframes=0)<\/strong><\/li>\n<li>The value for <strong>numKeyframes<\/strong> is used to indicate how many keyframes should be included in the loop, and is <em>a little weird<\/em>. The value <span style=\"color: #ff0000;\"><strong>0 (zero)<\/strong><\/span> is special. <span style=\"color: #ff0000;\"><b>0<\/b><\/span>\u00a0means &#8220;include all of this property&#8217;s keyframes in the loop.&#8221; \u00a0But a value of <span style=\"color: #ff0000;\"><strong>1 or more<\/strong><\/span> means &#8220;include the last keyframe <em><strong>plus\u00a0this many additional keyframes.<\/strong>&#8220;<\/em>\u00a0So a value of <span style=\"color: #ff0000;\"><strong>1<\/strong><\/span> means loop the last &#8220;two keyframes.&#8221;<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1622\" src=\"http:\/\/bobbyciraldo.com\/uwm-vfx\/wp-content\/uploads\/2016\/03\/aeTipsLoopOut.gif\" alt=\"aetipsloopout\" width=\"550\" height=\"290\" \/><\/li>\n<li>The stuff inside the parentheses are called parameters. Some parameters have default values for when you don&#8217;t type them out. For example, the default value of <strong>loopOut<\/strong>&#8216;s <strong>type<\/strong>\u00a0parameter is <span style=\"color: #ff0000;\"><strong>&#8220;cycle&#8221;<\/strong><\/span> and the default value for the\u00a0<strong>numKeyframes<\/strong>\u00a0parameter is <span style=\"color: #ff0000;\"><strong>0<\/strong><\/span>. So if you just type this in an expression area:\n<pre>loopOut()<\/pre>\n<p>..it&#8217;s the same as typing this:<\/p>\n<pre>loopOut(type=\"cycle\", numKeyframes=0)<\/pre>\n<\/li>\n<li><span style=\"color: #ff0000;\"><strong>loopIn<\/strong><\/span> is very similar to <strong>loopOut<\/strong>, but used for looping keyframes <span style=\"color: #ff0000;\"><strong><em>earlier in time<\/em><\/strong><\/span>\u00a0as opposed to later in time.\n<pre>loopIn(type=\"pingPong\")<\/pre>\n<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Looping Keyframes with Expressions &nbsp; loopIn and loopOut family of expressions Sometimes you want to loop the keyframes on a layer&#8217;s property Make sure you have some keyframes on your property. The loopOut and loopIn expressions don&#8217;t work without keyframes to loop! Turn on expressions for the keyframed property by Option\/Alt-clicking\u00a0the stopwatch. Now you should &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/ciraldo.stream\/uwm-vfx1\/topics\/looping-keyframes\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Looping keyframes with expressions&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1278,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1629","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/ciraldo.stream\/uwm-vfx1\/wp-json\/wp\/v2\/pages\/1629","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ciraldo.stream\/uwm-vfx1\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/ciraldo.stream\/uwm-vfx1\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/ciraldo.stream\/uwm-vfx1\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ciraldo.stream\/uwm-vfx1\/wp-json\/wp\/v2\/comments?post=1629"}],"version-history":[{"count":5,"href":"https:\/\/ciraldo.stream\/uwm-vfx1\/wp-json\/wp\/v2\/pages\/1629\/revisions"}],"predecessor-version":[{"id":2701,"href":"https:\/\/ciraldo.stream\/uwm-vfx1\/wp-json\/wp\/v2\/pages\/1629\/revisions\/2701"}],"up":[{"embeddable":true,"href":"https:\/\/ciraldo.stream\/uwm-vfx1\/wp-json\/wp\/v2\/pages\/1278"}],"wp:attachment":[{"href":"https:\/\/ciraldo.stream\/uwm-vfx1\/wp-json\/wp\/v2\/media?parent=1629"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}