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

Ticking Clock

$
0
0

We have all seen the old clock rotation expression where you create a rotation for the second hand and then tie the minute hand to the rotation with an expression so that it moves at 1/60th the speed to simulate minutes and seconds right?

 

I am trying to create something similar but with a 'ticking' clock like a timex watch on the second hand so that it ticks along. tick, tick, tick, tick instead of the smooth rotation. I have worked that out using this expression tied to rotation:

 

var tick = time*6;

Math.floor(tick)

 

 

But what I want to happen is now to have the minute hand ( separate layer ) tick over 6 degrees every minute. In other words, it holds for 59 seconds and then jumps 6 degrees in 1 second.

 

I can't figure that part out. Any ideas?

 

Thanks

 

Jim


AE: Expressions - Animate position change of each layer from top to bottom?

$
0
0

So I just started using AE this week. I'm a super newbie. Any assistance you give me is appreciated, but should also be dumbed down so I can follow it.

 

I'm making these dungeon tutorial videos for Final Fantasy XV and I started working on the first project.
I spent about an hour making 1 table and animating it, and I will obviously be using this same table for every dungeon tutorial, but rather than copying and pasting every layer and making new compositions and yadda yadda, I started looking into expressions today to achieve this (I'm assuming simple) effect that I'm going for.

 

So essentially, picture this in your brain.
The dungeon tutorial is something you'd see in a strategy guide. The first 30 seconds of the video feature: The Treasure you will find in the Dungeon, the Monsters you will fight in the Dungeon, the name of the Dungeon, the Dungeon Level, etc. And each of these things I will need to be able to customize for future dungeon tutorials, so naturally I don't want to spend 8 years editing these things keyframe by keyframe, that's just madness. I'd rather play the game.


I have 1 Composition named "Treasure Overview"
And this Composition is made up of 14 Pre-Comps.
Each Pre-Comp is basically a row in a table.

 

So picture the table as such:

(Pre-Comp 1) TREASURESALE VALUE
(PC2) Earth Gemstone1500
(PC3) Beautiful Bottle120
(PC4) Strong Bone200
(PC5) Rough Scales250


etc...

Each Pre-Comp is comprised of 4 layers:
- text: TREASURE
- text: SALE VALUE
- background for Treasure
- background for Sale Value

 

Super easy, nothing fancy

 

For simplicity sake, let's say that the first row of the table is at position (0,0)
That would put row 2 at (0,1)
row 3 at (0,2)
row 4 at (0,3) etc

 

I want to animate the rows in the table using expressions. So that the rows basically unfold vertically.
They all start at (0,0) and end up in their final position (0,1) (0,2) (0,3), etc

 

SO FAR, the only thing I've managed to do is create an expression on each layer so that the Y position is offset by 38 (the height of each pre-comp)

 

y = thisComp.layer(index-1).transform.position[1];

[0, y+38];

 

this sets the y value for each row in the final position that it's supposed to be in, but I can't get it to animate in succession.
I've tried looking up tutorials using valueAtTime()

 

and that works... but not really. I'm clearly missing something, because I can't seem to specify both the POSITION AND THE "DELAY in animation"
every time i follow these tutorials I get errors upon errors when I try to adjust the tutorials to fit what im trying to do

 


I need something like (pseduo-code incoming)

 

thisLayer.transform.position[0, y+38].valueAtTime(time + 5);

 

Something that will let me specify the start and end position and the delay in animation
using an expression

opacity of an image 0 or 100 tied to voice volume keyframes?

$
0
0

This is probably going to be stupidly easy, but I'm relatively new to AE, and I'm stumped.

 

So what I'm trying to do is make a little speaker symbol (similar to what you see in your taskbar) that reacts to audio.
For the quieter stuff, only one bar becomes visible, and for the louder/max stuff two/all three become visible.

 

And I mostly have it. But the different bars have a range of opacity. I just want them on/off within that range.

 

For example, the opacity of this .png is pick-whipped to a slider on the audio track. The slider has this expression on it: linear(value,2.6,4.9,0,100)

 

Works pretty good, but the opacity needs to be an on/off kind of thing, and not a 0-100% kind of thing.

 

Here's a screenshot:

Imgur: The most awesome images on the Internet

 

I've been trying to learn some if/then expressions, some checkbox stuff, and some 0 else 100 stuff... but correctly implementing any of them for this specific task has, so far, been unsuccessful.

 

Thank you for your help.

 

Message was edited by: derick white, typos

offset corner pin with different x y offset values

$
0
0

Hello!

 

Suppose you have a keyframed corner pin effect. Is there a way to extend a pin point (example: top left corner point) with different offset values for X and Y using expressions?

I tried everything, but I can't get it to work: the extended point doesn't stick with the right proportion over the animation.

This expression is one of the many i applied without any success. It works only if offset X and Y values are equal (ex.

Any suggestion? Thanks.

 

 

// CALCULATE CENTER COORDINATES

TL = effect("Pin")(1);

TR = effect("Pin")(2);

DL= effect("Pin")(3);

DR = effect("Pin")(4);

var vertices_x = [];

var vertices_y = [];

var min_x = Math.min(TL[0],TR[0],DL[0],DR[0]);

var max_x = Math.max(TL[0],TR[0],DL[0],DR[0]);

var min_y = Math.min(TL[1],TR[1],DL[1],DR[1]);

var max_y = Math.max(TL[1],TR[1],DL[1],DR[1]);

var mid_x = (min_x + max_x) / 2;

var mid_y = (min_y + max_y) / 2;

center = [mid_x,mid_y];

 

// OFFSET

offset = [20,50];

 

// TOP LEFT VECTOR

vector = normalize(TL - center);

 

// CALCULATE NEW TOP LEFT

x = TL[0] + * vector[0] * offset[0];

y = TL[1] + * vector[1] * offset[1];

[x,y]

keyframes control with layer markers

$
0
0

Hello,

 

I have an animation of a line that has two sets of keyframes of two different properties in CS4.

Basically a line gets generated in the first phase then it gets cleared out in the second phase.

This is done using two slider controls that act on the horizontal size of two rectangles and using merge paths (using the second rectangle as a matte for the first to clear it out)

 

I've put two layer markers on my layer hoping to link the keyframes to each of them.

 

Then I have found this script on the web and I put it on the first property :

 

L= thisComp.layer("ShapeLayer");

n = 0;

if (L.marker.numKeys > 0){

n = L.marker.nearestKey(time).index;

if (L.marker.key(n).time > time){

n--;

}

}if (n == 0){

valueAtTime(0);

}else{

t = time - L.marker.key(n).time;

valueAtTime(t)

}

 

This indeed lets me move the whole animation with the layermarker (which is very good) but I can't find a way to link the second set of keyframes to do the output.

I will add a link with the project file: WeTransfer

 

Please help!

Thanks

Multiple Expressions -- how to?

$
0
0
I have both keyframes and a wiggle expression on the position property of a layer.

Can I stack expressions like wiggle(n1,n2) and loop_out("cycle",0) on the same property?

Can I Animate Individual Characters in a Text Block Using the Wiggle Expression?

$
0
0

I'm new to After Express and just diving in to expressions. I was trying to figure out if there was a simple way to use the wiggle expression in a way that it would wiggle individual characters in a text block independently of each other.

 

Definitely appreciate any help.

Delaying Expression

$
0
0

Hi,

I wanted to delay the scaling that is driven by an expression over a control slider. As in a tutorial video i put -10 at the end of the expression, but i don’t yet get the wanted timing delay of 10 frames.

How is it done right to delay the layer by 10 frames ?

 

I tried these and some more :

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

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

 

Tutorial:

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

 

Regards,

Frank


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?

Expressions depending on program language? WTF??

$
0
0

How insanely stupid is this? I am working on After Effects in English. Now i got an AEP from a collegue who uses AE in german. The particular project uses a lot of expressions connecting to "Controls for Expressions". An when i open that project in my AE, i get dozens of error messages because all the controls and properties are beeing translated into english while the handlers of the expressions aren't.

 

Is there any possibility for me to fix this without changing almost 50 expressions in 15 comps and without changing my AE to german (because this would mean to reinstall the complete Creative Suite -- another fact that makes no sense)

 

thany you very much

u

Can you set wiggle at specific points in timeline?

$
0
0

Hi folks,

I did this cool tutorial on creating light streaks:

https://www.youtube.com/watch?v=w-JG1n_Yeo8

 

In it, he used the wiggle expression to create the random movements.  I am trying to get a light streak to follow a specific path and then wiggle within the confines of a boundry, and then travel on a specific path and wiggle within the confines of another boundry.  Imagine the light having to travel through a small tube that opens into a box where there is room for it to move and then going through a tube again to the next box, etc.

 

Can anyone give me tips on how to achieve that sort of effect, or feel free to tell me the name of what I'm trying to achieve so that I can google it.  Thanks!

Possible to set Source Text from another comp?

$
0
0

Let's say there is a Comp1 with a pretty complicated animation that involves a text layer. CompMain is the main comp with 10 instances of Comp1. Each instance has different text, position and timing. Can I set the Comp1 text layer Source Text from an expression in CompMain? If this is not possible, is there any workaround? Otherwise, the alternative would be to have 10 versions of Comp1 with different text and that would be too messy.

Move in x every [10] frames?

$
0
0

Hi!

 

Trying to figure out how out how to script this:

• Move an object forward in x every [45] frames the whole time of the comp. And no movement at all.


I tried doing this setup:

----------

length = Math.floor(thisComp.duration);

lengthFrames= timeToFrames(length);

cycle = lengthFrames/thisComp.layer("Null 2").effect("Value")("Slider");

tid = Math.floor(timeToFrames(time));

 

 

if (tid % cycle == 0) {

transform.xPosition +10;

}

----------

(I used a null layer with a slider for easier debugging and so I can change the value on the fly later.)
The equation results in 0 every 45th frame – which is good but the movement happens every frame. I can't figure out how to trigger a certain movement just on that occasion and nothing else!

 

Somebody in here that has a suggestion how to solve this?

 

 

 

 

Best

Slider control for shape layer fill colour

$
0
0

Hello, I'm trying to make a motion graphics template with colour as one of the options. Instead of the colour picker, I'd like to make it so it's on a slider and each number value is associated with a different colour. As of right now, I have a shape layer that is "parented" to a null object with the slider control effect on it.

 

Right now my expression code is:

slider = thisComp.layer("CONTROLS").effect("Slider Control")("Slider").value;

if (slider == 0)

  [48,26,23,0]

else if (slider == 1)

  [30,157,139,1]

else if (slider == 2)

  [0,122,135,1]

else if (slider == 3)

  [149,82,20,1]

 

But when I change the slider to each of the values (0-3). the shape layer isn't changing to the colour I want. It's changing between white and a bright blue and yellow, which aren't the values I've put in. I am using RGBA values.

 

Not sure what I'm doing wrong, can anybody help?

Slider control price countdown

$
0
0

Hi, i'm stuck in this problem and maybe it's just a simple trick.

 

I need a way to make a countdown of a price with baseline shift on the two last numbers. The price should go from 22,25 to 19,95.

 

If i use slider control with the expression: Math.round(effect("Slider Control")("Slider"))  - i can't format the text to baseline shift.

 


Scale over time expression

$
0
0

I'm trying to have an element scale up and do so through an expression:

 

startScale = 100;

endScale = 300;

scaleUpTime = 5;

 

s = ease(time, inPoint, inPoint + scaleUpTime, startScale, endScale);

[s,s]

 

 

This works but I'd like to modify this is that the endScale is actually a random number between 100 and 300.

I'd also like the whole thing to trigger at a specific time (or frame).

 

I tried random(100,300) but it gives a jittery result not a constant scale up to a random value

Comp name to TEXT?

$
0
0

Hi Guys, any way to extract the name of a comp and put it in a text layer?

After Effects: Startup Script

$
0
0

I have declared some variables in startup script but actually they are not visible in after effects scope.
But they are visible in after effects toolkit.

 

Is there a way to make it visible in After Effects scope as well ?

Help with write on text with curser using an expression

$
0
0

Hi There,

 

I have text writing on with a cursor using this TUT: AE Tut'z - How to Create a Type-Text Effect with a Blinking Cursor - YouTube

 

L = text.sourceText.length;
T = time*effect("Speed")("Slider") -effect("Start At")("Slider")* effect("Speed")("Slider");
F = Math.round(time % 1);

if(F == 1 | (T<L & T>0)){Fl = "▇";}else{Fl=" ";}

substr(0,T) + Fl

 

 

Questions:

 

1.

How would I double the speed of the cursor blink?

Have tried 0.5 under time and the if statement (and tried 2) but then the cursor doesn't show at all.

 

2.

How can I make the cursor start on, then blink?

Currently it starts off but it should be on to start. I tried swapping the cursor "▇"in the if/else statement but then the cursor doesn't show while the text types on (as expected).

 

 

Pretty green when it comes to this stuff so any help or pointers in the right direction would be juch appreciated.

 

Cheers

 

Ben

Expression that changes y-position continuously?

$
0
0

How do I write an expression that moves my layer continuously in the y-axis 10 pixels each frame?

Viewing all 47983 articles
Browse latest View live


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