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

Counting up in Multiples

$
0
0

How do i set an expression to my slider to count in Multiples of 10s, 20s.... to my very last key@@frame?

Thanks


Wiggle expression - slider control

$
0
0

Hi all

 

I had a solve for this from Dan Ebberts but I seem to have lost that content in the Jive update. I want to use a slider control for a wiggle, but when I have my basic wiggle expression applied to position, then pick whip from that to the slider, I get the below expression.

 

temp = effect("Wiggle Control Sliders")("Slider");

[temp, temp]

 

What is the fix for this/ way to do it right?

 

At the minute I'm using the expression below instead, but I hate not knowing the right way to do something! Using sliders/ creating decay in expressions has always been an issue for me...

 

wiggle(15,effect("Slider control")("Slider"))

 

Any help would be appreciated

 

Thanks!

Text Anchor Point / Alignment

$
0
0

I Have a Shape and a Text;

 

  • Put "sourceRectAtTime()" expression in Shape size, to be equal Real Text size in pixels. That is, not the size in pixels shown in Chacterer box (nominal size in pixles).
  • Need keep Text, always, on top of Shape aligned.
  • I assured that Text and Shape properties were:
  • Comp = 1280x720
  • Text and Shape:
  1. Achor Point [0,0]
  2. Position [640,360] (middle Comp size)

 

  • I expected to see the text on the shape, perfectly aligned.

forum.PNG

But the value of Anchor Point to Shape is not equal to Text.

"0" for text is = middle in width and low in height.

"0" for shape is  = middle in width and middle in height.

 

Yes, i can drag text to the alignment of Shape.

In reality, the problem is not Height. Not even in Anchor Point. But in Width Position. Why, when I change the text, there variations in the position. Look:

forum2.PNG

When I change text, with Anchor Point is okay, always in center, but the position becomes misaligned.The text leaves the Shape position, going to the right.

This should happen because of variations in the width of the letters, the "sourceRectAtTime()" expression is extremely sensitive to the letters.

 

When I drag to the correct location looks like this:

forum 3.PNG

Except that I can not be dragging, I need everything lines up forever, automatically. Even though I change the text.

 

How to solve this problem?

 

Update: Please, note that if I put some "symbol", larger in height It is also impaired:

forum 5.PNG

Master Expression for Multiple Layers

$
0
0

Working on a project that may have many hundreds of layers, and while many will have the same animations with time offsets etc I need to build it as an adjustable template.

 

Effectively I'm looking for a way to have many layers using the same expression from a single control layer so that if I want to make modifications to the expression I don't have to go through 100+ layers and re-paste the expression.

 

Ideal scenario would be to have an "Master Expressions" layer which has many properties with the applied expressions and then on all my other layers have them pull the expression code from the appropriate "Master Expressions" property. This way when I update the code in the "Master Expressions" it is applied globally across all linked layers.

 

I've attempted to use a Text Layer and input my expression in the "Source Text" parameter, but I have not found a way to pull the full text as applied expression for another layer.

 

Any ideas?

Comp name as source text?

$
0
0

Hi guys,

 

is it possible to get the name I chose for a comp as source text for a text field inside this comp?

 

I do not mean this "thisComp.name" expression, because it takes the comp name from its origin. I want to use the name I entered for the instances I put into my timeline. Any chance?

 


Cheers,

 


Stefan

AE expression for "length of text layer" for lower thirds nameplate

$
0
0
Hello everyone,

Is there a way to measure the total width (and height) of a text layer, to automatically update the length (and height) of a shape layer? I produce web news segments with 7-15 lower thirds displays for each video. I'm looking for a more efficient way to re-size each nameplate. Currently I manually re-size each shape layer to fit the name. Is there an expression that will update the shape layer, based on the length (in pixels) of the text layer?

See an example video of what I'm talking about:
http://dallasvoice.com/dvtv_track.php?s=345
(look for the nameplates that animate in at the beginning of each interview)

I've read everything I can get my hands on, but nothing has helped. Any help would be appreciated!
-RY

How to control only the WIDTH of a rectangle with slider control using expression

$
0
0

I have a simple rectangle shape layer that I want to control (only the width) with slider control using expression. How do I do that?

 

Thanks in advance.

How to get relative position of layer in larger precomp.

$
0
0

The Setup:

 

Comp 1 is 2000x3000 pixels. Comp 1 contains Layer X that is positioned at 1750,1250. (or whatever)

 

I pull Comp 1 into Comp 2 which is 800x600. I scale and move Comp 1 inside Comp 2 by an arbitrary amount.

 

How can I determine Layer X's position using Comp 2's coordinate space?


Time Remap Expression

$
0
0

I'm trying to do trigger a keyframe for a timeremap using an expression as follows, but after I put in the expression the output goes black:

 

 

  • Did a timeremap on the precomp.
  • Put in two keyframes. One where I need the comp to start, second where it ends.
  • Then I used the following expression:

        clockStart = parseInt(comp("main").layer(5).text.sourceText.value); 

 

        t = linear(time,0,clockStart+1,0,key(1).value+time);
        valueAtTime(t);

 

clockStart here is basically where I want the composition to trigger In. So my first keyframe.value is 14, Second keyframe.value is 20. If my clockStart is 10. At the start of the play the value of the timeRemap for this layer/comp is set to 14 (first keyframe value). Then when it plays, and clockStart reaches 10 then the timeremap start's counting in from 14 onwards until the second key frame (value is 20). This seems to work as I want but the issue is the output goes black I don't have any output while the expression is enabled on the time Remap. I tried looking for other properties like opacity but all are set properly and opacity is 100per. THe moment I remove the expression I have output on it. What can be wrong with this expression ?

How to get the footage's current frame number in expression?

$
0
0

There are 2 layers.One is text layer,one is sequence layer.

Footage has begun from the 20th frame.

Therefore, the number of composition's current frame number and footage's frame number has shifted.

 

I want to show footage's frame number in text layer . not composition's frame number.

How to get the footage's current frame number in expression?

 

 

Tatsuya

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

After Effects, Expression : Time + Slider Control (Time*effect("Slider Control")("Slider")

$
0
0

Hello,

 

First post here.

 

I'm having big troubles understanding what's wrong with my simple expression.

 

What i'm trying to achieve : I want to make a layer rotate with the time. Like this : Rotation = (Time*100)

So like this, at 1 second, the value of rotation will be 100°.

So far so good.

 

Then, I want to make this rotation stop, and control when it stops.

 

So i add a slider control.

I put the value on my slider control to 100, and change the expression on my rotation to : Time*effect("Slider Control")("Slider")

So right now, nothing changed.

But then i animate the value of my slider control. One value to 100, move forward in time, add another value to 0.

 

And now everything goes strange. My rotation goes in positive values and then, in the middle of it, change rotation and goes into negatives values...

 

I don't understand why it does this, specialy since taken separatly, both function are linear.

 

If you guys have an idea about this, this would be awesome!

Thanks a lot.

 

Loick

Control two (X-)position keyframes while keeping the (temporal) interpolation

$
0
0

Hi, I'm a little bit new to expressions. After hours of googling trying and coding I gave up and try to get some help here.

 

 

I just want to keep my simple animation with the temporal interpolation. I only want to change with two sliders two keyframes. Is that somehow possible?? I found much codes for scale, opacity, and also some for position but none of these work for me

 

 

image_20180510150504_1.png

 

 

Thank you very much!!! I'd very happy if anyone could also explain the expressions to me!

 

 

Here are some of my tries:

 

{

  slider = key(1);

t2 = key(2);

t3 = key(3);

t4 = key(4);

 

 

 

 

  slider = comp("Comp 1").layer("txtlayer").effect("Keyframe Slider 1")("Slider");

slider2 = comp("Comp 1").layer("txtlayer").effect("Keyframe Slider 2")("Slider");

  t1 = [slider];

t2 = 960 = t3;

t4 = [slieder2];

 

 

}

 

 

 

 

// other expression now

 

 

 

 

if (numKeys > 1){

  t1 = key(1).time;

  t2 = key(2).time;

t3 = key(3);

t4 = key(4);

 

 

slider = comp("Comp 1").layer("txtlayer").effect("Keyframe Slider 1")("Slider");

  linear(time,slider,t2,t3,t4);

}else

 

 

valueAtTime(t);

I want Expression to follow Layer time NOT comp time

$
0
0

Hi! I have a simple Expression on the rotation value of a layer. How do I write it so it's triggerd by the layer itself and not the comp it is in.

 

veloc = 5;

amplitude = 20;

decay = 3;

 

amplitude*Math.sin(veloc*time)/Math.exp(decay*time)  

 

Thanx!

Finn, Sweden

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?

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

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]]


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

How to use Expression to Mask Path vertices

$
0
0

Hi guys,

In Expression Language Reference(https://helpx.adobe.com/after-effects/using/expression-language-reference.html), I find an method called "points()";

 

and there is an example like:

  • Example 2

The example reads the coordinates of the first vertex of Mask 1 on Dark Gray Solid 1 and converts them to composition coordinates. Apply this to a 2D point control of an effect, such as Write-on or CC Particle Systems II, to make the effect trace or track the first point of an animated mask. Duplicate the effect and change the path points index value ([0]) to trace or track the other points of the mask.

myLayer = thisComp.layer(2);
myLayer.toComp(myLayer.mask("Mask 1").maskPath.points()[0]);

emm...

but when I try this, I get en error message saied:

points() method is undefined.....

So I confused about points() method,

 

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?

Viewing all 47983 articles
Browse latest View live


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