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

Noob Question: Move a layer in the opposite direction of a different animated layer

$
0
0

So say that I have an icon that I animate on the Y-axis +40px, but instead of trying to hand key the other layer each time, is there an expression I can write to have the other layer move in the opposite Y direction the same amount of units (ex: -40px)?

 

Thanks!


Fill Color Controller to change between colors overtime

$
0
0

Hi All,

 

I'm using CS6 AE..

 

I have created a clapometer style animation that uses a colour controller and value/numbers controller to animate the hand from left to right of a semi circle. As the hand moves (by a value slider) the layer underneath fills and I would like the color to go from yellow to red via multiple colors.

 

So far I have this code on my fill layer

 

l=thisComp.layer("Fill color controllers");

i=1;

colors=[];

try {

while(l.effect(i)) {

if (l.effect(i)(1).name=="Color") {

colors.push(l.effect(i)(1).value);

}

i++;

}

} catch (e) {}

if (colors.length) {

r=Math.floor(random(colors.length));

colors[r];

} else {

}

 

And a fill color controller layer with 5 different color expression controls. At the moment the code cycles through them randomly, but I would like cycle through the list. I know there are other ways I could do this but I am trying to improve my expression knowledge and hope someone can help me!

 

Cheers!

Analog Clock

$
0
0

Hi,

Im making an analog clock with a minute, second and hour handle.

hey shall rotate properly relative to each other. Its my first time using expressions and Im a bit lost. I want the time to speed really fast, for so slowing down and stopping completely.

Right now Im using this on z rotation:

time*5 on the hour handle

time*60 on the minute handle and

time*720 on the seconds.

 

Please, If someone could help me with accomplishing this I would be so grateful.

Varying Speed Of Fractal Noise Ocean Waves With Expressions

$
0
0

Hi,

 

Possible Noob question:

 

I've been following:

  http://allbetsareoff.com/2009/06/ocean-water-effect/

 

The video results are here: http://vimeo.com/5384704

 

He uses the Fractal Noise plug-in to make the water and the sky. Starting at 9:45 or so he talks about using an Expression in the 'Offset Turbulence' to create a certain 'speed' of the water.

 

Programming variables I understand, but I am a total noob when it comes to AE expression variables. The expression he uses is:

 

X = effect("Fractal Noise")("Offset Turbulence")[0];

[X, time*190]

 

So it seems like varying the number 190 increases or decreases the speed of the waves.

 

What I would like to do is have the speed -accelerate- over time. The entire video is going to be prox. 3:25. I was hoping there was something akin to keyframes I could use to make it -very- slow in the beginning, then at a certain point, quicken, then at another point -really- speed up and then finally, slow down again... independent of the sky.

 

If this is not easily done, I suppose I can render the sky and water separately and use keyframes in Premiere to speed up/slow down, but I figured I'd use this as a learning opportunity.

 

SO: Is there a way to assign a variable to that 'constant' value (190) which is based on the time position? Pseudo Code:

 

X = effect("Fractal Noise")("Offset Turbulence")[0];

[X, time* if(CurrentPositionInSeconds<200) ? 190 : 60]

 

Ideas?

 

TIA,

 

---JC

toComp is not working correctly for Particular and Element 3d (pics included to demonstrate problem)

$
0
0

So, Im using AE CS6. The two plugins concerned are Element 3d and Trapcode Particular.

Im going to include alot of information since I'm not sure what would come in handy to know to solve this.

 

The final goal is to have the particle emitter follow the left wing of the object when the object is moved using the null named 'Scythe'. (See first photo)

'Scythe' is the brownish null at the center of the object.

 

I have used the follwing expression line on the Particles X,Y emitter:

thisComp.layer("Element Position 2").toComp([0,0,0]);

 

'Element Position 2' is the green Null you see in this picture, and is also the proper position for the particle emitter.

 

http://i.imgur.com/qtucKAx.png

http://imgur.com/qtucKAx

 

However, when this expression is applied it moves the emitter location. As shown in the following picture.

 

http://i.imgur.com/uSezbYY.png

http://imgur.com/uSezbYY

 

The emitter is only in the proper location on the first frame (first pic), on the second frame (second pic) and every frame afterwards, it is elavated to another position.

 

Can someone help me correct the new position without manually adjusting the ([0,0,0]) value in the expression line?

Loop Out Stop expression

$
0
0

I was wondering if it's possible to create a stop/smooth ending to a LoopOut expression on Rotation and Position keyframes.   I am currently using OSX 10.9.3 After Effects CS6 and I have tried a couple of things that haven't worked for me.

 

adding a checkbox expression control to the layer and an expression for loopOut()

 

if (effect("Checkbox Control")("Checkbox")==true){

loopOut();

}else{

value;

}

 

 

loopOutDuration(“cycle”,2)

 

Unfortunately neither of these seems to work.  I was wondering if someone had a solution they have come across.

 

Thanks very much

 

Ira

After Effects Expression deactivate layer if in comp

$
0
0

Hi guys,

I am currently working on a huge animation with lots of comps. I have certain animations, that are used several times, but I don't want to duplicate all the comps and I am trying to figure out a more elegant way to use those comps.

 

Is there an expression, something like (" if layer in pre-comp1 is nested in comp2, then opacity=0", or something like that),  to deactivate certain layers if they are nested in a certain comp?

 

Thanks in advance!

Expressions Not Auto Fixing Properly

$
0
0

I have a comp with multiple layers that have expressions referencing other layers by name. Generally, when I rename a layer referenced in expressions, all of the expressions update with the new layer name.

HOWEVER, I have noticed a weird instance where it appears only some expressions are fixed -- specifically, if I rename a layer, and the layer after it (in stacking order) references the layer's name, the "after layer"'s expression is NOT fixed and breaks. But if I move the layer AFTER the "after layer" and rename it again, the original "after layer"'s expression IS fixed. Why does layer stacking order matter for automatically fixing expressions? It's a real nightmare to go through and manually update expressions.

SEE ATTACHED PICTURES FOR CLARIFICATION.

af1.png

af2_00001.png

af3_00002.png

af4_00003.png


Random Letter Color and Movement

$
0
0

Hello, I have some text and I need each letter to be of random vibrant color, but there should be no clear pattern to how it repeats (preferably). Also, each letter should move around randomly. I am thinking of something with wiggles, maybe a range selector and a rotation with a position. It is supposed to look like happy playful text, and if this helps, this is the font I am using: Arial Rounded MT Bold.

 

Last time I tried doing something like this it was only a few letters, so I just used one layer per letter, but here it would be hard to do that.

 

Thank you,

Max

Trouble with VCP tutorial 3D Light Casting

$
0
0

Working in CS5 on this, but I am not able to pick whip the position of the Orange Energy layer to the Light 1 layer.  I have tried it several times now.  I get this message:

 

After Effects warning:  Object of type Light found where a Number, Array, or Property is needed

Expression disabled.

 

Error occurred at line 0.

Comp 'Street Footage'

Layer: 1 (Orange Energy.mov

Property: 'Position'

 

Anyone know what they mean by "Number, Array, or Property"?  There was an earlier instance of pick-whipping the layer position in this same tut and I had no problems.  But this time I am stuck. I have checked the comments out on the site and noticed others had similar problems but no one seems to have ventured a solution.

Any ideas out there?

Reading thisComp FPS?

$
0
0

In this global expression:

 

timeToTimecode(t = time + thisComp.displayStartTime, timecodeBase = 30, isDuration = false)

 

 

Instead of being coded to 30, is it possible for timecodebase to read the current comp's FPS automatically?

Offsetting time and position of several layers relative to preceding layer

$
0
0

Hello -

 

Pardon the newbie questions, but I've keyframed 'Black Solid' moving along the x axis and basically would like to duplicate the layer (perhaps with a new color) several times so that each 'new layer' follows the previous layer and offsets itself a certain amount of pixels...say 20px for example.

 

I found a simple expression that I applied to the first dup'd layer and it works fine but I can't figure out where to tell it to offset 20px to the left of the main layer.

 

thisComp.layer("Black Solid 1").transform.position.valueAtTime(time -.1);

 

I suppose I'm trying for a cascading effect + offset.

 

Thanks!

gj

Syntax Error on Mac

$
0
0

I am trying to use the following expression:

 

Math.sin(time * effect(“Speed”)(“Slider”)) * 45

I got the expression from this tutorial:  AFTER EFFECTS TUTORIAL - Animate Butterfly / Bird - YouTube

I've not worked with expressions before... but some Googling showed several folks running into the issue of this not working on a Mac.


Can anyone offer any advice?  Thanks!

AE template design Help!

$
0
0

How do I create a template composition where the "white solid" line stays the same width (but not height) and in the same place no matter how much I zoom into the "Red Solid" circle while at the same time being linked to the Red Solid? Is there any expression for this? Note: The red circle will change size and position continuously for over 200 different videos so I do not want to have to use keyframes. Screen Shot 2015-10-30 at 1.05.01 AM.png

How to use multiple expression in single layer

$
0
0

I need using loop expression: loopOut(type = "cycle", numKeyframes = 0);

and remove digits behind coma: .value.toFixed(0);

I Tried to use ";" but only works for first expression


How do I add a 3D wiggle expression to a seamless loop expression in After Effects?

$
0
0

I am using this xyz wiggle expression for several layer (each layer having slightly different integers to have different movement.

 

 

a =wiggle(0.2,150);

b =wiggle(0.15,160);

c = wiggle(0.2,500);

[a[0],b[1],c[2]]

 

But I want to make it a seamless loop. I found another expression that does this, but it is not in 3d space.

 

freq = 1;
amp = 110;
loopTime = 3;
//this will be changed to 6 seconds
t = time % loopTime;
wiggle1 = wiggle(freq, amp, 1, 0.5, t);
wiggle2 = wiggle(freq, amp, 1, 0.5, t - loopTime);
linear(t, 0, loopTime, wiggle1, wiggle2)

 

How can I merge the expression?

How do I add dimensional values to expressions?

$
0
0

expression.png

This might seem like a simple question however I have been attempting this for a while now with limited success. Basically, I have an expression where the flare 2 position is parented by a separate null layer (flare 2 null). However I would like to offset the x and y position from the null. I added "-550" at the end which moves the x cordinate down -550. However, when I do -550,-200 (or any other value) after effects gives me an error. I have tried putting the numbers in brackets like this [-550,-200] etc. If I could get some help it would be much appreciated!

Control slider in subcomp using expressions

$
0
0

Hey guys,

 

So i'm trying to control a few slider controls that a located in a subcomp from my main comp.

 

My Main comp has a null named 'Controls' which has a slider control named 'Rotation'

Let say I want to let that control a slider named "Rotate Horizontal" which is nested in a comp called "Comp 2"

How would I go about doing that?

 

If anyone has an idea on how to set this up it would be greatly appreciated!

ease() vs eased keyframes

$
0
0

Trying to figure out the difference in values between the standard ease() and eased keyframes with default values of 33% influence. They're very close to being exactly similar, but aren't!

 

ease(time, 0, 4, 0, 1000) -- this seems to be a perfect cubic bezier curve, with handles of (0.33, 0, 0.66, 1) as defined by cubic-bezier.com. Have adapted existing cubic bezier functions to work as expressions, and the match is perfect. However, two keyframes, bezier interpolation, 33% influence out & in (on first and second, respectively) doesn't match above.

 

Exaggerating & displaying the difference between the values gives this:

ease-vs-keys-24fps.png

 

However! I have no idea what to do with this information. As you can see, the difference is miniscule, but it's certainly present. Can any light be shed on this?         

Integers and decimals / Slider Control

$
0
0

I am trying to count up from 00.0 to 27.3, using where each number is made up of 2 digits and 1 decimal place - so for the single digit numbers, there will still be a 0 ahead of it (ex: 3 would be listed at 03.0 when counting up). I found the expression to keep 1 decimal point at all time, even for integers:

 

effect("Slider Control")("Slider").value.toFixed(1);

 

But can't figure out how to have the single digit numbers have a zero in front of them. Does anyone know how to do this?

Viewing all 47983 articles
Browse latest View live


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