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

Why do I need an expression to Scale X/Y independently?

$
0
0

Scale is what... the 2nd or 3rd most used form of motion?

 

So why do I need an expression (and a **** tonne of googling) to find out how to link the X or Y scale of an object independently to a slider?

 

Why doesn't each of the two scales (X/Y) have the ability to simply be pickWhipped to a Slider or any other form of controller?

 

Would make sense, surely. And save newcomers a world of time.

 

UPDATE: Part 2 of this question:

 

If this works:

[temp, temp]

 

then why can't this work?

[temp, value]

 

Would this also make too much sense?


Surely it would be far more logical than this nonsense:

[temp[0], value[1]]



Property links vs Relative property links

$
0
0

Now that "copy with relative property links" is available, in what case would you find using just "copy with property links" beneficial. Wouldn't the relative copy work just the same in all cases?

After Effects Universal Expressions

$
0
0

1. What are universal expressions?

  • I want examples of applications of universal expressions and how to identify non-universal expressions.


  • When my project use non-universal expressions, I can use a plugin called "ExpressionUniversalizer 2" to support all languages.

2. But there's another way to get the result of transforming the non-universal expressions in universal without use the plugin?

 

Please provide me all possible details.

 

I need to create a template that uses expressions and need that the template supports all languages.

 

Thanks!

Is Possible Apply Expression in a Composition?

$
0
0

I want to make a expression related to time duration of "MainComp".

To the "MainComp" follow time duration of other Composition.

Using previous and upcoming x position keyframes to set a semi-circular path

$
0
0

I've got a little circle travelling along at a constant velocity in the x access but I want it to hit certain points as though it's bouncing from one to the other. These points are at varying distances between them.

 

What I was thinking was to set up an expression that calculates the time taken to travel between the previous keyframe in time and the next one, as well as the distance between them, to give me the bounce path between them.

 

I was thinking of a formula a bit like this:

 

[value[0], KDist*Math.abs(Math.cos(KTime)]

 

My only problem is I don't know the java script to calculate KDist (Distance between previous and upcoming keyframes) and KTime(a formula to calculate the values from the time so that Math.cos(Ktime) = 0 at the first keyframe and 0 at the end and 1 in the middle.

 

I hope that makes sense.

 

Thanks a lot.

 

John

Is there an AE expression I can use to randomly exchange the positions of several equally sized layers?

$
0
0

Hi, I am a beginner in expressions in After Effects, I am working on an animation in which I have a small grid of images (each one on a separate layer) and I would like to have them randomly and quickly exchange positions while staying within the structure of the grid. I was able to use an expression to randomly turn them on and off but I would like to additionally have them exchange positions. This is beyond my capabilities. Does anyone have any suggestions on how to do this with an expression?

seedRandom( index, true) generates each frame a new number. Why?

$
0
0

Hi, I would like to understand why this code here:

 

j = 0;

accum = 0;

seedRandom(index,true);

 

while ( j < time ) {

accum += random(10);

j += thisComp.frameDuration;

}

 

random(100)

 

generates a different number each frame. But this one:

 

seedRandom(index,true);

random(100)

 

doesn't. Can anybody explain me this please?

heart beat

$
0
0

hi

im looking for a simple expression to create heart beat effect,scale up and down but with a realistic look

thank you so much

yotam monk


Parent to layer but offset time (expression wanted). Thanks!

$
0
0

Hi,

 

I've looked around online for this but can't find anything that seems to work!

 

So, I have several layers scaling up from zero. I want them all to do this one after the other, and I want to do it by parenting each layer to a single null so that I can modify the speed to all of them at once if I want to change it later on. But if I parent all the layers to the null, then they all scale up at the same time. I want to offset each layer from the one before it by about half a second.

 

Does anyone know an expression for this?

Thanks in advance.

 

-- Tim

Utilizing fun Array Methods in After Effects like "every,""some," "filter," "reduce," and "map."

$
0
0

These array methods cause errors in AE that, I believe, state that they're not recognized by the system. Is there a way to still use them? Also, do you know if Adobe plans to add their recognition into forthcoming iterations of their software?

 

Danke, friends!

Tomi

Opacity random motion, ok! and loops?

$
0
0

Hi there!

I'm using an expression by Dan Ebberts, thanks Dan!

This expression works great, but the problem is that It's not a loop.

I need to do a loop to 4500 f. I try to use time % loopTime, but it doesn't work.

Does anyone have any idea how to do this?

Thanks!


Expressionbelow:
segMin = .3; //minimum segment duration
segMax = .7; //maximum segment duration
minVal = 10;
maxVal = 100;

end = 0;
j = 0;
while ( time >= end){
  j += 1;
  seedRandom(j,true);
  start = end;
  end += random(segMin,segMax);
}
endVal =  random(minVal,maxVal);
seedRandom(j-1,true);
dummy=random(); //this is a throw-away value
startVal =  random(minVal,maxVal);
ease(time,start,end,startVal,endVal)

Full auto-orient via expression

$
0
0

Hi!

 

I'd like a 3D Null to get the orientation of 3D a layer. (without parenting, it would be too easy )

 

I've tried a lot of solutions, through orientation, rotations, both combined... some results are close, but never perfect.

 

If I'm right, orientation is computed before rotations...

I think the simplest way would be with auto-orientation, or the lookAt() expression on orientation, wich gives me correct X and Y orientations, and then get an expression on zRotation to get a "full" orientation.

 

But what would it be?

How can I get the Z orientation in layer space?

 

Any idea will be appreciated!

 

François

Expression for image replacement depending on text layer text.

$
0
0

Hello, i wanted to ask is it possible to replace image in composition depending on text layer text. I.E. text layer contains code ##34 and expression tells what kind of image should be placed depending on if conditions in image expression.

Sincerely, Deimantas

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

Can anyone help me with this error?


Help with an expression (checkbox effect)

$
0
0

So I have a song with soundkeys applied to the bars, but I want the soundkeys to turn off at a certain point so I can make the bar go to 1% Y gradually over one second when I want to. I searched around and the best solution I could find was with checkbox. I have an expression that goes like this

 

X = 100

Y = thisComp.layer("Soundkeys 37").effect("Sound Keys")("Output 1")*1.33333;

[X, Y]


but the problem is I can't add two keyframes that will do anything to make the bars gradually go down when I want them to. I could make the expression into keyframes, but with what I'm doing that would take a very long time to do with every layer. So I just need an easy way to turn off the expression at a certain time. Is this possible?

Automatically scale layer based on proximity of other layer

$
0
0

Hi there!

 

I'm trying to write an expression that will scale a layer up/down as another layer gets closer (simulating a UI element jumping off the page as a mouse cursor hovers over it). This is what I've got so far (expression applied to the scale property of the target layer):

 

x = Math.abs((effect("Mouse Layer")(1)).transform.position[0] - transform.position[0]);           // distance between target layer and mouse on x-axis

y = Math.abs((effect("Mouse Layer")(1)).transform.position[1] - transform.position[1]);           // distance between target layer and mouse on y-axis

t = Math.sqrt((Math.pow(x,2)) + (Math.pow(y,2)));                                                                   // actual distance from mouse layer to center of target layer  

fadeDist = effect("Fade Dist")(1);                                                                                             // distance at which layer begins scaling

sMin = effect("sMin")(1);                                                                                                           // scale minimum      

sMax = effect("sMax")(1);                                                                                                        // scale maximum

s = ease(t, 0, fadeDist, sMax, sMin);

[s,s];

 

 

It works fairly well, but it's based on the distance between the center of the target layer and the mouse, not the boundaries/edges of it. Because of this, the target layer's scale changes while the mouse is moving around within the area of the layer itself.

 

Is there a way for me to write this expression that will 1) allow me to reference the distance between the mouse and the edges of the target layer (a rectangle) as the factor affecting the layer's scale, and 2) maintain the scale of the rectangle while the mouse moves around within it?

 

Thanks!!

Rotation in a looped composition

$
0
0

Hello,

I'm having trouble and am hoping someone can help me.  How can I have an object that moves about in a looped composition and also continuously rotates?

I've used the expression for rotation value=time*90

Currently, in the main composition, the object rotates but at the end of the loop, it goes back to its original position.

Is there a way to take the time value of the main composition instead of the looped one?

Thanks for any help

Linking position to mask path?

$
0
0

I know I can copy and paste a Mask Path to a layer's Position and vice versa.

 

But is there a way to link them live with an expression?  I think I'm running into a problem with too many dimensions in an array -- I'm trying to link a Light's 3D position into a 2D Mask Shape (for Particular).   I can copy and paste the motion path & mask shape between them just fine, but pickwhipping gives me an error.

 

Picture 11.png

Multiple Expressions

$
0
0

Is there any way that I can patch the same expression in the same property layer multiple times? What if I would like my camera to execute the same expression at different points in the composition?

Viewing all 47983 articles
Browse latest View live


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