<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>motion resources</title>
	<atom:link href="http://motioneffects.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://motioneffects.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Thu, 29 Nov 2007 01:23:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='motioneffects.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>motion resources</title>
		<link>http://motioneffects.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://motioneffects.wordpress.com/osd.xml" title="motion resources" />
	<atom:link rel='hub' href='http://motioneffects.wordpress.com/?pushpress=hub'/>
		<item>
		<title>After effects expressions</title>
		<link>http://motioneffects.wordpress.com/2007/11/29/after-effects-expressions/</link>
		<comments>http://motioneffects.wordpress.com/2007/11/29/after-effects-expressions/#comments</comments>
		<pubDate>Thu, 29 Nov 2007 01:23:06 +0000</pubDate>
		<dc:creator>svanelst</dc:creator>
				<category><![CDATA[after effects]]></category>
		<category><![CDATA[expressions]]></category>

		<guid isPermaLink="false">http://motioneffects.wordpress.com/2007/11/29/after-effects-expressions/</guid>
		<description><![CDATA[ Great after effects expressions. Circle Fun This generates perfect circular motion centered around the original position of the layer. I recommend that you map the radius and cycle inputs to Expresso sliders, and the phase input to an Expresso angle. Apply this expression to the position of the layer radius = 75; // the radius [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=motioneffects.wordpress.com&amp;blog=2223703&amp;post=4&amp;subd=motioneffects&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p> Great after effects expressions.</p>
<p><span style="font-weight:bold;">Circle Fun</span></p>
<p>This generates perfect circular motion centered around the original position of the layer. I recommend that you map the radius and<br />
cycle inputs to Expresso sliders, and the phase input to an Expresso angle.</p>
<p>Apply this expression to the position of the layer</p>
<p>radius = 75; // the radius of the circle<br />
cycle = 1; // number of seconds to complete a circle; higher value = slower<br />
if(cycle ==0){cycle = 0.001;} //avoids a “divide by zero” error<br />
phase = 27; // initial angle in degrees from bottom<br />
reverse = 1; // 1 for ccw, -1 for cw<br />
x = Math.sin( reverse * degrees_to_radians(time * 360 / cycle + phase));<br />
y = Math.cos(degrees_to_radians(time * 360 / cycle + phase));<br />
add(mul(radius, [x, y]), position)</p>
<p><span id="more-4"></span>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p><span style="font-weight:bold;">Track a Child</span></p>
<p>This expression is designed to track the position of a layer that has been parented to one or more layers.<br />
Use the expression below on the position property that you wish to animate, changing the name “Child” to match the neame of the<br />
layer you wish to track. For instance, if you wat to use write-on to track the position of a layer called “moon”,</p>
<p>apply this expression<br />
to the “brush position” property of the write-on filter, and change “child” to “moon”.</p>
<p>c = this_comp.layer(“child”);<br />
c.to_comp(c.anchor_point)</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p><span style="font-weight:bold;">Adjustable Position Wiggle</span></p>
<p>Use this expression as an interactive, keyframeable Wiggler.</p>
<p>Apply it to the position of the layer you wish to wiggle.</p>
<p>wigfreq = 3; //wiggle frequency<br />
wigamt = 30; //wiggle amount<br />
wigdetail = 3; //detail of noise<br />
position.wiggle(wigfreq, wigamt, wigdetail)</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p><span style="font-weight:bold;">Adjustable Rotation Wiggle</span></p>
<p>Use this expression as an interactive, keyframeable Wiggler.</p>
<p>Apply it to the rotation of the layer you wish to wiggle.</p>
<p>wigfreq = 5; //wiggle frequency<br />
wigangle = 45; //wiggle amplitude<br />
wignoise = 3; //octaves of noise<br />
rotation.wiggle(wigfreq, wigangle, wignoise)</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p><span style="font-weight:bold;">Oscillate Position</span></p>
<p>Creates an oscillating motion between two specified 2-dimensional positions over a specified period of time (in seconds).<br />
Use an adjustment layer with Expresso position controls for “from”, “to”, and an Expresso slider assigned to “period”.</p>
<p>Change “linear” to “ease” for smoother interpolation.</p>
<p>from = [50, 90]; //one end of your oscillation<br />
to = [190, 30]; //the other end of your oscillation<br />
period = 1.5; //time between oscillation points (multiply by 2 for a round trip)<br />
t = time % (period * 2);<br />
if (t &gt; period) t = 2 * period &#8211; t;<br />
linear(t, 0, period, from, to)</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>Oscillate Rotation (or any single value)</p>
<p>Creates an oscillating motion between two specified values over a specified period of time (in seconds).<br />
Use Expresso angles or sliders for “from”, “to”, and an Expresso slider assigned to “period” for fine control. You can apply these to<br />
any layer.</p>
<p>Change “linear” to “ease” for smoother interpolation.</p>
<p>from = -45; //one end of your oscillation<br />
to = 45; //the other end of your oscillation<br />
period = 1.5; //time between oscillation points (multiply by 2 for a round trip)<br />
t = time % (period * 2);<br />
if (t &gt; period) t = 2 * period &#8211; t;<br />
linear(t, 0, period, from, to)</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p><span style="font-weight:bold;">Bounce</span></p>
<p>Creates a bouncing (sine wave) motion between two specified 2-dimensional positions over a specified period of time (in seconds).<br />
Useful for creating bouncing balls.<br />
Use Expresso position controls for “from”, “to”, and an Expresso slider assigned to “period” for fine control.</p>
<p>You can apply these to any layer.</p>
<p>surface = [320, 480]; //the position of the “bounce” surface<br />
apogee = [320, 50]; //the “apogee” of the bounce<br />
period = 1.5; //the length of time from surface to apogee<br />
t = time % (period * 2);<br />
if (t &gt; period) t = 2 * period &#8211; t;<br />
linear(Math.sin(t * Math.PI / period), 0, 1, surface, apogee)</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>Wiggle from Leader</p>
<p>These two expressions create a “follow the leader” effect. One works from the top down, the other from the bottom up. Only use one.<br />
A follower will tag along after the leader, deviating from the path according to the wiggle properties that are specified in the<br />
inputs.Once applied to a single follower, you can duplicate the layer as many times as you like and each subsequent copy will follow<br />
along, offset in time from the last and wiggling uniquely. In this expression, the wiggle is based on the position of the leader.<br />
Link Expresso sliders to lag (to interactively control how bunched togeher the layers are), winfreq (to control the frequency of the<br />
wiggle) and wigamp (to control the amplitude of the wiggle). Apply Expresso effects to the leader only.</p>
<p>Change the word “Leader” to match the name of the leading layer.</p>
<p>//USE THIS ONE IF THE LAYERS STACK UP FROM BOTTOM LEADER</p>
<p>lagtime = .1;<br />
wigfreq = 3; //wiggle frequency<br />
wigamt = 30; //wiggle amount<br />
adj = (this_comp.num_layers &#8211; index) * lagtime;<br />
this_comp.layer(&#8220;Leader&amp;quot&#8230;.position.wiggle(wigfreq, wigamt, 2, .5,time &#8211; adj)</p>
<p>//OR&#8230;</p>
<p>//USE THIS ONE IF THE LAYERS STACK DOWN FROM TOP LEADER</p>
<p>lagtime = .1;<br />
wigfreq = 3; //wiggle frequency<br />
wigamt = 30; //wiggle amount<br />
adj = (index &#8211; 1) * lagtime;<br />
this_comp.layer(&#8220;Leader&amp;quot&#8230;.position.wiggle(wigfreq, wigamt, 2, .5,time &#8211; adj)</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p><span style="font-weight:bold;">Wiggle from Previous</span></p>
<p>This creates a “follow the leader” effect that works from the bottom up. A follower will tag along after the previous layer, deviating<br />
from the previous path according to the wiggle properties that are specified in the inputs. Once applied to a single follower, you can<br />
duplicate the layer as many times as you like and each subsequent copy will follow along, offset from the last in time and wiggling<br />
uniquely. In this expression, the wiggle is based on the position of the previous layer.<br />
Link Expresso sliders to lag (to interactively control how bunched togeher the layers are), winfreq (to control the frequency of the<br />
wiggle) and wigamp (to control the amplitude of the wiggle). Apply Expresso effects to the leader only.</p>
<p>Change the word “Leader” to match the name of the leading layer.</p>
<p>//USE THIS ONE IF THE LAYERS STACK UP FROM BOTTOM LEADER</p>
<p>lagtime = .1;<br />
wigfreq = 3; //wiggle frequency<br />
wigamt = 30; //wiggle amount<br />
adj = (this_comp.num_layers &#8211; index) * lagtime;<br />
this_comp.layer(this_layer, 1).position.wiggle(wigfreq, wigamt, 2, .5,time &#8211; adj)</p>
<p>//OR&#8230;</p>
<p>//USE THIS ONE IF THE LAYERS STACK DOWN FROM TOP LEADER</p>
<p>lagtime = .1;<br />
wigfreq = 3; //wiggle frequency<br />
wigamt = 30; //wiggle amount<br />
adj = (index &#8211; 1) * lagtime;<br />
this_comp.layer(this_layer, -1).position.wiggle(wigfreq, wigamt, 2, .5,time &#8211; adj)</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p><span style="font-weight:bold;">2D Look At</span></p>
<p>Apply this Expression to the Rotation channel of any layer you wish to control,<br />
Set LookAt, below, to the name of the layer you wish the layer to look at.<br />
If the controlled layer is not initially pointing straight up, enter an offset amount in degrees, below, to adjust the direction it is<br />
looking.</p>
<p>LookAt = &#8220;ball&#8221;<br />
offset = 0<br />
diffx = position[0] &#8211; this_comp.layer(LookAt).position[0];<br />
diffy = position[1] &#8211; this_comp.layer(LookAt).position[1];<br />
if (diffx == 0) {<br />
diffx = 1 }<br />
sign = 1 + (-1 * (diffx / Math.abs(diffx))) * 90;<br />
radians_to_degrees(Math.atan(diffy/diffx)) + sign + offset</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>3D Look At</p>
<p>Apply this expression to the orientation channel of the layer you wish to have look at another layer (the layer being controlled).<br />
Enter the name of the layer to look at in LookAt below. If the layer being controlled does not correctly look at other layer, adjust the<br />
layer offset by changing the X, Y and Z rotation values (not the orientation values) for the layer being controled.</p>
<p>LookAt = &#8220;ball&#8221;<br />
look = look_at(position, this_comp.layer(LookAt).position);<br />
[look[0], look[1], look[2]]</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p><span style="font-weight:bold;">Angle of View Zoomer</span></p>
<p>This allows you to control the angle of view of acamera interactively, by scaling a null object on screen.</p>
<p>To use: Create a null called &#8220;angle_zoomer&#8221;.<br />
Animate the null&#8217;s scale to control viewing angle in degrees.</p>
<p>substitute = this_comp.layer(&#8220;angle_zoomer&amp;quot&#8230;.scale[1];<br />
this_comp.width / (2 * Math.tan(degrees_to_radians(substitute/2)))</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p><span style="font-weight:bold;">Focal Length Zoomer</span></p>
<p>This expression will allow you to zoom a camera in After Effects using real-world focal length values.</p>
<p>To use this expression:<br />
1. create a camera in after effects<br />
2. create a null layer called &#8220;focal_zoomer&#8221; and turn off its visibility switch in the timeline<br />
3. apply the expression below to the Zoom parameter of the camera<br />
4. set the value of hFilmPlane in the expression to the size of your film, in milimeters<br />
5. animate the null&#8217;s scale to control the focal length of the camera, in milimeters</p>
<p>hFilmPlane = 35;<br />
FocalLength = this_comp.layer(&#8220;focal_zoomer&amp;quot&#8230;.scale[1];<br />
this_comp.width * (FocalLength/hFilmPlane)</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p><span style="font-weight:bold;">Camera Autofocus</span></p>
<p>Apply this expression to the Focus Distance of your camera, then change the name &#8220;Focus Layer&#8221; below, to the namer of the layer<br />
you wish to keep in focus</p>
<p>focuser = &#8220;Focus Layer&#8221;;<br />
cam_to_layer = sub(this_comp.layer(focuser).position, position);<br />
length(cam_to_layer)</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/motioneffects.wordpress.com/4/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/motioneffects.wordpress.com/4/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/motioneffects.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/motioneffects.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/motioneffects.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/motioneffects.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/motioneffects.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/motioneffects.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/motioneffects.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/motioneffects.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/motioneffects.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/motioneffects.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/motioneffects.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/motioneffects.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/motioneffects.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/motioneffects.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=motioneffects.wordpress.com&amp;blog=2223703&amp;post=4&amp;subd=motioneffects&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://motioneffects.wordpress.com/2007/11/29/after-effects-expressions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ac176fb2534984f1f23523d139af068e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">svanelst</media:title>
		</media:content>
	</item>
	</channel>
</rss>
