1) Create 3 nulls: Null_PointAt, Null_Base, Null_Target
2) Set the following transform expressions on Null_PointAt:
Position:
thisComp.layer("Null_Base").transform.position
Scale:
point1 = thisComp.layer("Null_Base").transform.position;
point2 = thisComp.layer("Null_Target").transform.position;
scl=length(point1, point2);
[scl, scl]
Rotation:
fromPoint = thisComp.layer("Null_Base").transform.position;
atPoint = thisComp.layer("Null_Target").transform.position;
Pointer3=lookAt(fromPoint, atPoint);
if(atPoint[1]<fromPoint[1]) [Pointer3[1]]-180; else [-Pointer3[1]];
Wednesday, May 2, 2018
Tuesday, November 28, 2017
Adding commas into Text layers
//Create a new Slider Expression effect. I named it 'Score'
var num = effect("Score")("Slider");
num = Comma(num);
[num]
function Comma(number)
{
number = '' + Math.round(number);
if (number.length > 3)
{
var mod = number.length % 3;
var output = (mod > 0 ? (number.substring(0,mod)) : '');
for (i=0 ; i < Math.floor(number.length / 3); i++)
{
if ((mod == 0) && (i == 0))
output += number.substring(mod+ 3 * i, mod + 3 * i + 3);
else
output+= ',' + number.substring(mod + 3 * i, mod + 3 * i + 3);
}
return (output);
}
else return number;
}
var num = effect("Score")("Slider");
num = Comma(num);
[num]
function Comma(number)
{
number = '' + Math.round(number);
if (number.length > 3)
{
var mod = number.length % 3;
var output = (mod > 0 ? (number.substring(0,mod)) : '');
for (i=0 ; i < Math.floor(number.length / 3); i++)
{
if ((mod == 0) && (i == 0))
output += number.substring(mod+ 3 * i, mod + 3 * i + 3);
else
output+= ',' + number.substring(mod + 3 * i, mod + 3 * i + 3);
}
return (output);
}
else return number;
}
Thursday, November 16, 2017
Limiting Decimal Places In Text Layers
Adding .toFixed(4) after the variable limits the decimal places to 4. ie 26.7835
Adding .toFixed(2) would limit the decimal places to 2. ie 26.78
.toFixed(3) would limit the decimal places to 3. ie 26.784 (note it rounds value)
ex: avgEQ = (thisComp.layer("1").transform.scale[1] + thisComp.layer("2").transform.scale[1])/2;
avgEQ.toFixed(4)
Adding .toFixed(2) would limit the decimal places to 2. ie 26.78
.toFixed(3) would limit the decimal places to 3. ie 26.784 (note it rounds value)
ex: avgEQ = (thisComp.layer("1").transform.scale[1] + thisComp.layer("2").transform.scale[1])/2;
avgEQ.toFixed(4)
Aligning Lens Flare To Target
In order to align the streak of the lens flare to a target, first create 2 nulls (LightTarget, LightSource)
Light Factory Location =
lSource = thisComp.layer("LightSource").transform.position;
lTarget = thisComp.layer("LightTarget").transform.position;
Anchor = transform.anchorPoint;
lSource-lTarget+Anchor
Light Factory's layer position =
thisComp.layer("LightTarget").transform.position
Make sure the solid layer that the lens flare is applied to is large enough for the comp.
Light Factory Location =
lSource = thisComp.layer("LightSource").transform.position;
lTarget = thisComp.layer("LightTarget").transform.position;
Anchor = transform.anchorPoint;
lSource-lTarget+Anchor
Light Factory's layer position =
thisComp.layer("LightTarget").transform.position
Make sure the solid layer that the lens flare is applied to is large enough for the comp.
Friday, February 6, 2015
Speed offset expression for AE
Being able to control the speed of another layer based on speed control.
Position =
Start = 0;
y = 540;
x = thisComp.layer("Null 1").transform.position[0];
Speed = effect("Speed")("Slider");
x1 = ((x-Start)*Speed)+Start;
[x1, y]
Position =
Start = 0;
y = 540;
x = thisComp.layer("Null 1").transform.position[0];
Speed = effect("Speed")("Slider");
x1 = ((x-Start)*Speed)+Start;
[x1, y]
Sunday, October 12, 2014
Nickelodeon: Days Of Future Past
Updated for Unreal Engine 4. Some of the old, some of the new. Everything is separated out into different fbx files, so it's easily be improved and updated. Next thing I want to learn and incorporate is Substance Designer and Substance Painter. Those will really take it to the next level!
Monday, October 6, 2014
Stabilizing footage after tracked
After you have tracked footage (scale and position), you can stabilize it with the following expression:
Anchor Point: (Paste in the tracked position keyframes)
Position: (Paste in the first tracked position keyframe (Single keyframe))
Scale:
start = 300.1255; //(first scale keyframe of track)
temp = (100*start)/(thisComp.layer("BG_Tracker").transform.scale[0]);
[temp, temp]
Rotation:
StartRot = -7.7137; //(first rotation keyframe of track)
r = thisComp.layer("BG_Tracker").transform.rotation;
StartRot - r;
Anchor Point: (Paste in the tracked position keyframes)
Position: (Paste in the first tracked position keyframe (Single keyframe))
Scale:
start = 300.1255; //(first scale keyframe of track)
temp = (100*start)/(thisComp.layer("BG_Tracker").transform.scale[0]);
[temp, temp]
Rotation:
StartRot = -7.7137; //(first rotation keyframe of track)
r = thisComp.layer("BG_Tracker").transform.rotation;
StartRot - r;
Subscribe to:
Posts (Atom)





