Quantcast
Channel: Adobe Community : Popular Discussions - After Effects Expressions
Viewing all 47983 articles
Browse latest View live

"No active camera" error

$
0
0

Ran into this problem tonight with a couple expressions I've used in the past in CS3+. My scene has 1 camera. It it's set to active and the eyeball is on and its in/out is the length of my comp. Is 'activeCamera' broken in CS6?

 

These expressions are turning off:

 

delta = toWorld(anchorPoint) - thisComp.activeCamera.toWorld([0,0,0]);

radiansToDegrees(Math.atan2(delta[0],delta[2]))

 

and

 

C = thisComp.activeCamera;

V = C.toWorldVec([0,0,1]);

P = toWorld(anchorPoint);

lookAt(P, P + V)[0];



Track nested child layer's position

$
0
0

Hi,

 

I have a Main Comp with a layer named 'Controller'.I have several 2d layers parented to this controller.

Now,i need to precompose two of them.let's say this precomposition of these two layers is named 'precomp 1'.

How can i parent these two layers in the 'precomp1' to the 'Controller' in the Main Comp again via Expression?

 

Dan,any ideas?

Need help with an expression for unit conversion

$
0
0

Hello, I'm using an expression to have different counters for a display, and two of those numbers are a length measurement, one in feet and another in meters. I want to make it so that when I move the slider to add numbers to the one in meters, it converts automatically to feet.

 

This is the expression I'm using, which I found at CreativeCow.net:

 

numDecimals = 0;

commas = true;

dollarSign = false;

beginCount = effect ("Slider Control") ("Slider");

endCount = effect ("Slider Control") ("Slider");

dur = 0;

 

t = time - inPoint;

s = linear (t, 0, dur, beginCount, endCount).toFixed(numDecimals);

 

prefix = "";

if (s[0] == "-"){

prefix = "-";

s = s.substr(1);

}

if(dollarSign) prefix += "$";

 

if (commas){

decimals = "";

if (numDecimals > 0){

decimals = s.substr(-(numDecimals + 1));

s = s.substr(0,s.length - (numDecimals + 1));

}

outStr = s.substr(-s.length, (s.length-1)%3 +1);

for (i = Math.floor((s.length-1)/3); i > 0; i--){

outStr += "," + s.substr(-i*3,3);

}

prefix + outStr + decimals;

}else{

prefix + s;

}

 

So on the text layer that has the feet value, I tried doing a whip to the Source Text field of the one that has the meters value, and add /3.28084 at the end, but it gave me an error. I added a = at the beginning, but it still gave me an error.

 

What would be the correct syntax here?

 

Thanks

Start to Play Composition at Position Y

$
0
0

Hey guys,

 

i started to try a build that the compositions start at the position of 400 in my main-composition.

I build this with a null-object that controls the compositions.

I tryed with markers, but i dont know and i dont have any idea how to do.

what is the command for play a composition?

 

Her my after effects file

 

http://sebastian-hielscher.com/-download/MARKER2.aep

 

Hope anyone can help me.

Sorry for my bad english.

 

Kind Regards

Sebastian

Expression to create even distances

$
0
0

Hi,

i want to add a control value (220) to the x-pos of my layer.

i want to define the x-positions of my layers automatically.

My master layer, containing the initioal x-pos, has its x-pos at 320.

Now for the next layers, with an expression, i each want to use the x-pos of the preceeding layer + add a control value of 220. So they distribute in x-pos by 220 distance between each other.

How is this to be done ?

 

http://files.2he.com/uploads2/2014_02_14_12_56_08.jpg

 

Regards,

Frank

expressions - best practice for duplicating layers

$
0
0

Hello,

 

I have a fairly complex set of expressions on multiple layers.  These layers together make up an overall effect for a piece of footage.  For convenience I have these expression linked to a controller null object so I can control them from one place.  Now that I have it set up, I want to duplicate the group of layers (footage item, various effects, and null object controller) multiple times.  I basically have a template for a footage effect that I want to duplicate multiple times so I end up with many pieces of footage with this effect applied.  When I duplicate the group of layers, I'd love to set it up in a way that the  expression variables will now point to the duplicated controller object.  I noticed this behavior happens if the expression is a simple pick whip from one property to another.  Basically a direct connection.  But if I attempt to store this pick whip selection in a variable to be manipulated further, this functionality ceases.  So my question is, how can I create a set up that will permit me to duplicate layers and have the expressions update as if they were a simple direct pick whip from one property to another?  Is this possible?  If not, how can I better set this up to allow me to accomplish my end result?

 

Thanks!

 

-Justin

Linking expressions to central Controller

$
0
0

I'm trying to link up my expressions to one central Controller layer so that that one expression is shared across all objects in my project which require it.

I have "// Controller" composition with "Expression_Source (tK-logo_anim)" text layer. Its source text expression is set to my desired expression:

 

sourceLayer = comp("Killers logo (test)").layer("tK-logo_anim_mask");

sampleSize = [1,1];

samplePoint = transform.position;

color = sourceLayer.sampleImage(samplePoint,sampleSize);

x=color[0]*100;

[x,x]

 

Now, another composition includes a shape layer with its Transform Expression: Scale set to:

 

eval(comp("// Controller").layer("Expression_Source (tK-logo_anim)").text.sourceText.toString())

 

But when I try to hit enter on this line of code I get error: expression result must be of dimension 2, not 1


What am I doing incorrectly? The expression works when inserted manually into the Scale property but not when I try to link to it...

Thanks

Set inPoint with expression?

$
0
0

Hi,

 

Is there some way to set the in and out points of a layer in an expression?

 

thisLayer.inPoint seems to be read-only...

 

Thanks,

 

S


after effect IK controlers

$
0
0

Hi every body

Sorry for my english.

 

how to controle easly alls IK controlers or null controlers of puppet in the final comp. To animate every characters in the final comp (every characters are in its comp)

 

Comment manipuler les controleurs (nulls) d'une marionnette situées dans la composition du personnage à l'extérieur de cette composition, c'est à dire, dans la compostition final.

Les copies de valeurs via expression nécessitent d'avoir des comps de la même taille. Les liens de parentages ne sont pas possible d'une comp à l'autre.

Existe t'il un script pour gérer les offsets de position de 2 nulls dont l'un est situé dans une comp et l'autre dans la comp supérieur ?

 

merci de votre aide.

 

2J.

How to make my expression to a preset?

$
0
0

Hi there,

I have a question. Is it possible to make my expression to be a preset so I can use it again and again. If it's possible, how to build a control for he variable value inside the expression in the preset? Thanks

Audio triggering footage based on values

$
0
0

Hello,

 

I've come across a video that I've come interested in understanding how it works...

 

I'm pretty sure it has been done manually, and not with a template that you can drag a song and it would output something like that.

 

However the idea of "triggering" footage (stock fire, logotype rotation on x-axis, etc) is bugging my mind.

 

Given values based on (a certain freq that we want to trigger the reaction) of the song, whether using some third party plugins like Trapcode Sound Keys, or by simple Convert Audio to Keyframes, I can't think of any idea on how a high value could trigger an animation on any given frame (since we have no idea when those values would be, imagine it should work for any given song). I imagine it's a possibility to have the animation of a few frame shorts, constantly looping, and easily playing with opacity could make a decent effect, but still I'm sure there must be a way to do something similar to what they've done.

 

Take for example the fire, except you have a plug-in generating it that you can control with a slider (if this would be the case, if would be really simple to do the song reaction), you can't really properly switch from footage A (fire being really low) to footage B (fire being way more crazy) without it flickering or producing some undesired effect, can you? Same question applies for footage C (3d logotype facing front) to footage D (3d logotype rotating horizontally), and even for certain freq making some stock fire appear and play just once.

 

Just wanted to show you in case someone had an idea or perhaps shared my enthusiasm on finding out how it works.

 

Thank you for taking the time to read this post.

 

Kind regards,

 

- Juan

How to start my bouncing effect at specific time?

$
0
0

I try to build an expression preset for bouncing effect. Here is my code:

 

timeIn = effect("Start Time")("Slider");

In = timeIn.value;

 

timeOut = effect("End Time")("Slider");

Out = timeOut.value

 

freq = effect("Freq")("Slider");

F = freq.value;

 

Osc = effect("Lama&Tinggi Pentalan")("Slider");

Osi = Osc.value;

 

Amp = effect("Nilai Pembagi Landai")("Slider");

A = Amp.value;

 

Tinggi = effect("Besarnya Pentalan")("Slider");

T = Tinggi.value;

 

if (time >= In && time <= Out){

Y = T*(Math.abs(Math.cos(F*time*2*Math.PI))*Math.exp(-time/Osi*A));

position - [0, Y];

}else{

position - [0, 0];

}

 

It's works. My problem is that I got different bouncing result depend on the start time with the biggest bouncing at 0 second and going smaller when I put bigger value on it. It look's like just showing the expression result starting from the start time. How to manage my code so the sinus wave can start on the start time? Thanks for helping and sorry for my bad English as it's not my mother language

How to delay opacity following another layer

$
0
0

Hello All.

 

I have 100+ layers that I would like to fade on in a delayed fashion following the manual opacity key frames set in a 'master' layer. Thus, each of the 100+ layers will incrementally fade on by half a second — after the 'master' layer has faded in.

 

My research has led me to this expression:

 

thisComp.layer("leader").transform.opacity.valueAtTime(time-thisComp.frameDuration)

 

however the above fades in all 100+ layers simultaneously. I'd like the layers to fade in one after the other.

 

 

Can anyone suggest the script to make this happen please?

Is it possible to use an effects 'Reset' or 'Clear' mode in an expression?

$
0
0

Hi all, hopefully someone can help me with this.

 

I'm using 'CC Time Blend FX' in a project I'm working on. Am using it in multiple pre comps, and before rendering I need to go into each pre comp and push the 'Clear' button at 00:00 to clear any images that have been cached in the timeline.

 

Screen Shot 2014-07-16 at 11.05.11 AM.png

 

Have been trying to figure out a way to have a controller/null in the master comp with the 'Clear' button in it, so I just need to push it once before rendering (instead of going into each pre comp).

 

Is this possible?

trapezoidal wave in AE

$
0
0

trying to figure out an expression for a trapezoidal wave function in AE.  I have not found any forms that discussed this wave formation.  I am pretty new to AE's expressions.


AE CC 2014 - Wiggle Expression not assigning similar values on scale

$
0
0

So I've just noticed that the wiggle expression no longer works how it used to. I found a released article explaining changes in the Noise Algorithm used for the wiggle expression what’s new and changed in the 2014 update to After Effects CC  |  After Effects region of interest and am referring to the "fixed bug in implementation of Perlin noise algorithm" section.

 

I'm not sure if this is what's causing the issue but let me explain.

 

I'm just adding a wiggle expression on to an object's scale.

wiggle(5,50);

 

This would normally scale the object's parameters with the same value. so it would be (100,100) to (125,125) and so on.

Now however with CC2014 the expression is assigning different values to each value so getting (125, 115) or something even if the 'constrain proportions' button is enabled.

 

So I tried to trick it:

 

temp=wiggle(5,50);

[temp[0],temp[1]];

 

Still got different values even though i'm telling it to insert the same variable?

 

temp=wiggle(5,50);

temp;

 

Still got different values... I don't get it can anyone help?

how to parent a layer on a negative x,y position value ?

$
0
0

Hey there i have a composition with 2 text layers on it one is scaled -100 on the y  axis to get a reflection effect

and i added a wiggle expression to the the upper layer and i want the reflection layer to have the same moment as the upper layer  but on a negative x,y direction.

Font Size Expression

$
0
0

I need an expression that would automatically change the font size based on how many characters are typed in.

 

The goal is to fit multi-line text into a bounding box as it's read from the external text file.

 

Does anyone know whether it's possible through an expression, or SDK by writing a plugin?  So far I was unable to find any info on this topic.

 

Thanks for any ideas.

linking precomped wheel rotation to position in another comp

$
0
0

Hey guys,

 

I suck at expressions, but I think one would really help me here.  I have a car driving, part of a complicated precomp, and i want the wheel rotaion in the precomp to rotate according to the position of the car in the master composition.  I've seen a few link-rotation-to-position scripts but can't find one that i can figure out how to alter in order to make it work. 

 

Hope someone can help, and apologize in advance if this is well worn territory.  I tried a search but could have easily not used the right key words.


Thanks in advance,

Mike

Weird Behavior with Countdown Expression

$
0
0

I'm relatively new to aftereffects and have built this after adapting things I've learned from Google searchs.  I'm having very weird behavior in the last ten seconds of a one minute composition with my expression that generates hundreths of a second.

 

I have to use Countdowns for quite a lot of things.  but I only need them exported in small chunks, a minute, or ten seconds.  So my countdowns are rather unique.  Typically the first set of numbers is larger, the second and third set of numbers are smaller, but the same size, and the third set of numbers is a different color (typically a medium gray if the other numbers are white).

 

So because I have all these font parameters, I don't use a TimetoTimecode type of expression, because I need to be able to change the font size and color of a countdown so that 45:32:98 might look approximately like that, for example.  (and for whatever reason, the client wants hundreths of a seconds with a colon separating the seconds and hundreths, even though that is incorrect).

 

So because I only need small chunks, I have just text boxes for the first number and one of the colons and then use this expression for the seconds:

 

 

rate = - 1;

 

clockStart = 60

 

 

 

function padZero(n){if (n < 10) return "0" + n else return "" + n};

 

 

 

clockTime = Math.max(clockStart + rate*(time - inPoint),0);

 

 

 

t = Math.floor(clockTime);

 

min = Math.floor((t%3600)/60);

 

sec = Math.floor(t%60);

":" + padZero(sec)

 

Which seems to work beautifully.

 

Then for the Hundreths of a second, I use this expression:

 

 

st = 60

 

t = st - time;

 

t1 = Math.floor(t,timecodeBase = 99.9);

 

t2 = t.toFixed(2).substr(3)

 

 

 

t2

 

The composition is 720x1280 29.97 frame rate. with a 59;28 duration

 

The problem arises Exactly at the 50 second mark.  The hundreths expression suddenly reverts to a single 'tenths' column, but those numbers scroll randomly, they don't countdown as tenths, and they change every frame, at approximately like what the hundreths column changes at.


I'd really like to know why the countdown does that during the final 10 seconds and how do I fix it?

 

on the other hand if there is a better way to generate hundreths of a second, I'd like a better hundreths math expression, this countdown creates a persistence of vision problem by repeating the same hundreths numbers for about ten seconds before switching to a different pair of hundreths numbers.  Ideally Ilike a hundreths expression that did something like 97, 94, 91, 88, 83, 80, 76, 72, 69, 65, 62, 57, 54, 51 (repeating the pattern), rather than what I get, which is 97, 94, 91, 87, 84, 81, 77, 74, 71 (repeating the pattern of the same three numbers in the hundreths column for ten seconds when it then changes to 8, 5, 2 in the hundreths columns and repeats those same three numbers for the next ten seconds).  This is a persistence of vision problem if you see only those three numbers cycling on the hundreths column, your eye clearly percieves the 7,4,1 all superimposed on top of each other, and that's really annoying to me, because it interferes with the perception of the countdown.  But I can't seem to find a better hundreths expression to adapt or work with.

 

 


Viewing all 47983 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>