Snipt.net is closing on December 31st, 2016

For more information, please visit this blog post.

snipt

Ctrl+h for KB shortcuts

JavaScript

Use layer name as index

i = thisLayer.name.substr(thisLayer.name.length - 1);
https://snipt.net/embed/5508844775c46c037e9f0cf8146a834b/
https://snipt.net/raw/5508844775c46c037e9f0cf8146a834b/
5508844775c46c037e9f0cf8146a834b
js
JavaScript
3
2016-12-09T11:36:32
True
False
False
/api/public/snipt/147362/
use-layer-name-as-index
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="nx">i</span> <span class="o">=</span> <span class="nx">thisLayer</span><span class="p">.</span><span class="nx">name</span><span class="p">.</span><span class="nx">substr</span><span class="p">(</span><span class="nx">thisLayer</span><span class="p">.</span><span class="nx">name</span><span class="p">.</span><span class="nx">length</span> <span class="o">-</span> <span class="mi">1</span><span class="p">);</span> </span></pre></div> </td></tr></table>
ae, expressions

JavaScript

Trailing a leader with relative index

1
2
3
4
5
delay = 5 // frames
leader = thisComp.layer("Leader");
id = index-leader.index; //relative index
delayStagger = delay*thisComp.frameDuration*(id);
leader.position.valueAtTime(time-delayStagger);
https://snipt.net/embed/f4994be090b3c41241048b9a8bd5ee51/
https://snipt.net/raw/f4994be090b3c41241048b9a8bd5ee51/
f4994be090b3c41241048b9a8bd5ee51
js
JavaScript
5
2016-12-06T17:58:06
True
False
False
/api/public/snipt/143060/
trailing-a-leader-with-relative-index
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="nx">delay</span> <span class="o">=</span> <span class="mi">5</span> <span class="c1">// frames</span> </span><span id="L-2"><a name="L-2"></a><span class="nx">leader</span> <span class="o">=</span> <span class="nx">thisComp</span><span class="p">.</span><span class="nx">layer</span><span class="p">(</span><span class="s2">&quot;Leader&quot;</span><span class="p">);</span> </span><span id="L-3"><a name="L-3"></a><span class="nx">id</span> <span class="o">=</span> <span class="nx">index</span><span class="o">-</span><span class="nx">leader</span><span class="p">.</span><span class="nx">index</span><span class="p">;</span> <span class="c1">//relative index</span> </span><span id="L-4"><a name="L-4"></a><span class="nx">delayStagger</span> <span class="o">=</span> <span class="nx">delay</span><span class="o">*</span><span class="nx">thisComp</span><span class="p">.</span><span class="nx">frameDuration</span><span class="o">*</span><span class="p">(</span><span class="nx">id</span><span class="p">);</span> </span><span id="L-5"><a name="L-5"></a><span class="nx">leader</span><span class="p">.</span><span class="nx">position</span><span class="p">.</span><span class="nx">valueAtTime</span><span class="p">(</span><span class="nx">time</span><span class="o">-</span><span class="nx">delayStagger</span><span class="p">);</span> </span></pre></div> </td></tr></table>
ae, expressions

JavaScript

Controlling timeRemap with Position

valueAtTime(linear(position[0],0,thisComp.width,key(1).time,key(numKeys).time));
https://snipt.net/embed/0f723908444acbe67a7bbcce67d99946/
https://snipt.net/raw/0f723908444acbe67a7bbcce67d99946/
0f723908444acbe67a7bbcce67d99946
js
JavaScript
2
2016-12-07T14:37:01
True
False
False
Dec 09, 2015 at 06:03 PM
/api/public/snipt/142943/
controlling-timeremap-with-position
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="nx">valueAtTime</span><span class="p">(</span><span class="nx">linear</span><span class="p">(</span><span class="nx">position</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span><span class="mi">0</span><span class="p">,</span><span class="nx">thisComp</span><span class="p">.</span><span class="nx">width</span><span class="p">,</span><span class="nx">key</span><span class="p">(</span><span class="mi">1</span><span class="p">).</span><span class="nx">time</span><span class="p">,</span><span class="nx">key</span><span class="p">(</span><span class="nx">numKeys</span><span class="p">).</span><span class="nx">time</span><span class="p">));</span> </span></pre></div> </td></tr></table>
ae, expressions

JavaScript

Color from Position

1
2
3
4
// sampleImage takes two arguments... an x,y and then a sample range
// this will use the layers own x,y and then get a range of 2 by 2 to sample from
//this is applied to the tint effect in this case
thisComp.layer("HexMap").sampleImage([transform.position[0], transform.position[1]], [2,2]);
https://snipt.net/embed/58a5e8c42ab04556ef55ed748464af78/
https://snipt.net/raw/58a5e8c42ab04556ef55ed748464af78/
58a5e8c42ab04556ef55ed748464af78
js
JavaScript
6
2016-12-06T17:58:47
True
False
False
Nov 11, 2015 at 01:18 PM
/api/public/snipt/142374/
color-from-position
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="c1">// sampleImage takes two arguments... an x,y and then a sample range</span> </span><span id="L-2"><a name="L-2"></a><span class="c1">// this will use the layers own x,y and then get a range of 2 by 2 to sample from</span> </span><span id="L-3"><a name="L-3"></a><span class="c1">//this is applied to the tint effect in this case</span> </span><span id="L-4"><a name="L-4"></a><span class="nx">thisComp</span><span class="p">.</span><span class="nx">layer</span><span class="p">(</span><span class="s2">&quot;HexMap&quot;</span><span class="p">).</span><span class="nx">sampleImage</span><span class="p">([</span><span class="nx">transform</span><span class="p">.</span><span class="nx">position</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="nx">transform</span><span class="p">.</span><span class="nx">position</span><span class="p">[</span><span class="mi">1</span><span class="p">]],</span> <span class="p">[</span><span class="mi">2</span><span class="p">,</span><span class="mi">2</span><span class="p">]);</span> </span></pre></div> </td></tr></table>
ae, expressions

Text only

Write on graph drawing start

1
2
3
4
x = time*300;
y = (thisComp.height/2)+Math.sin(time*20)*100;
// + wiggle(5, 10, 3, .5)[1]
[x,y];
https://snipt.net/embed/eecc8198b96071261f554fff4b0327db/
https://snipt.net/raw/eecc8198b96071261f554fff4b0327db/
eecc8198b96071261f554fff4b0327db
text
Text only
4
2016-12-06T17:59:28
True
False
False
Sep 18, 2015 at 07:11 PM
/api/public/snipt/141114/
write-on-graph-drawing-start
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>x = time*300; </span><span id="L-2"><a name="L-2"></a>y = (thisComp.height/2)+Math.sin(time*20)*100; </span><span id="L-3"><a name="L-3"></a>// + wiggle(5, 10, 3, .5)[1] </span><span id="L-4"><a name="L-4"></a>[x,y]; </span></pre></div> </td></tr></table>
ae, expressions

Text only

Basic Property Group Index

thisProperty.propertyGroup(1).propertyIndex
https://snipt.net/embed/4ce5fdbb2c0f831e9359ac1b1ff30fde/
https://snipt.net/raw/4ce5fdbb2c0f831e9359ac1b1ff30fde/
4ce5fdbb2c0f831e9359ac1b1ff30fde
text
Text only
1
2016-12-08T13:37:20
True
False
False
/api/public/snipt/141094/
basic-property-group-index
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>thisProperty.propertyGroup(1).propertyIndex </span></pre></div> </td></tr></table>
ae, expressions
Copyrighted, illegal, or inappropriate content? Email [email protected].