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

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?


Change text colour with an existing slider control

$
0
0

Hi guys, I am making a 9:16 (vertical) graphics template themed with the logo and colours of the 20 teams of the English Premier League.  My expressions knowledge only goes so far as wiggle and a bit of pick whipping!

 

I am trying to make an essential graphics template so that the editors can use the slider to pick the team that they want to have as their on screen graphic in Premiere (rather than having to go into AE).

 

So far I have in my essential graphics tab the four lines of text, the slider, and a comment which tells the user which team is which number. The slider goes from 1 to 23 (20 teams plus three others).

 

 

Here is what that looks like:

Screen Shot 2018-02-05 at 10.27.04 PM.jpg

I have so far been able to use the slider to change the logo (by making all other logos 0% opacity), to change the name of the team (by making all other team names 0% opacity) and to change the background colours of the boxes.

This is the expression I used to do all of this. It is in the opacity setting for each object:

 

 

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

 

 

if (slider == 6) 100 else 0;

 

 

My problem is that I also want to be able to change the colour of the text when the slider is changed. Does anybody have any idea of how I can do this?

 

 

Below is the project file:

 

https://www.dropbox.com/sh/0yrknu66b8fjvcg/AADNJFMAoNLRlT7INQ1yh9rla?dl=0

 

Thank you!

 

David.

Center Anchor Point at a Layer

$
0
0

How can i center Anchor Point to a Layer center? Are there commands to align a center point?

Is it possible to confine expressions to specific keyframes?

$
0
0

I am definitely a beginner when it comes to expressions.

I am currently using a "bounce" expression on the position parameter of some objects as they come on screen. However, the next time they change positions, I don't want them to bounce. Every time a motion tween ends in a static position, the position expression gets applied and the stuff is moving around.

I'd like to be able to keyframe the expression so that it worked only when on the keyframes that it makes sense to affect.

 

amp = .05;

freq = 1;

decay = 7;


n = 0;

if (numKeys > 0)

{

     n = nearestKey(time).index;

     if (key(n).time > time)

     {

          n--;

     }

}



if (n == 0)

{

     t = 0;

}

else

{

     t = time - key(n).time;

}



if (n > 0)

{

     v = velocityAtTime(key(n).time - thisComp.frameDuration/10);

     value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);

}

else

{

value

}

 

I got this script from somewhere online. The only thing I know how to manipulate are the initial values of amp, freq, and decay.

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

Newb here please help (saber plugin + sound keys)

$
0
0

Hi everybody, i have a question, i added the saber plugin to a simple solid, after that i added masks to the solid and trace them with saber, all looks perfect, but i want that they don't appear but only when there is bass, kind of a stroke.

On the "customize core" of the saber plugin i linked "End Offset" to sound keys, they do react but the problem is that the lines don't reach the final destination, when the bass holds longer they do but i want that they reach the end even if there is bass for 1 second, i was thinking that an expression to make the end offset going from 0 straight to 100 would solve the trick but i don't know how to create that expression...

Make 2nd keyframe of a property the value of a different property

$
0
0

Hey hey,

 

Was wondering if there is a way you can tie a specific keyframe to the value of another layers property?

 

I have this flat map of earth, with 3D position on, and I want make a simple camera move going from total world view and zoom in on a specific city. This city gets it's location from a 3D null (where other precomps, text and info is attached). And this map is something I need to version 50+ times. So i figured, if I know I want the cam position to end (= the 2nd keyframe) on the city's 3D position, is there an expression to tie that second keyframe to the city's 3D position (which does not have any keyframes).

 

Of course I could just copy paste it in manually, but I have finally reached a poitn where it's almost fully automated, based on expressions and a few expression controls. So my requests is also just out of general curiosity and further learning.

 

Any ideas?     

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!


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

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,

 

How do text layer expression selectors operate on character value?

$
0
0

I'm banging my head against my desk here.  Every other attribute I try to animate using expressions selectors works by multiplying the value returned by the selector by the value of the property in question.  But I can't make heads or tails of what an expression selector does to either Character Value or Character Offset properties.

 

Has anyone had any luck with these?

 

I'm just trying to transcribe the characters from one text layer into another using the expression:

 

 

MT = thisComp.layer("Master Text").text.sourceText;
if(textIndex < MT.length) MT.charCodeAt(textIndex) else 32

 

 

I set my character value to 1, and left the Amount property set to [100,100,100] thinking the value coming out of my expression would be multiplied by 1.  Instead, the results I get are nonsensical.  Is there something obvious that I'm missing?

Can I link a path vertex to a position property via an expression?

$
0
0

I want to have curves and lines draw across or between points in a video clip that has hand held camera moves in it.

 

I've motion tracked the points I want to use and assigned the tracking data to a null at each point. Ideally I'd like to then link a vertex in a shape path to a null so I can have a stroke animate in and join up the tracked points and then the vertices can "stick" with the video as it draws on.

 

It's not possible to stabilise the shot animate then "de-stabilise" the shape layer as there's some parallax as the camera turns through a small angle.

 

There's a couple of Tuts that suggest work arounds, such as using the Beam or Path Text (dots and dashes) effects on a solid layer as they have vertexes that can be pickwhipped to position properties. I then have to use multiple layers and timings to create the illusion of a single line moving through the space.

 

There's also a RotAE script that I've come across:

http://www.fxfx.org/index.php/2011/03/27/how-to-attach-a-mask-point-to-a-layer-in-after-ef fects/

 

However I wanted to check if it's actually impossible and these workarounds are the only options?

Storing a position value from the previous frame

$
0
0

Hey guys,

 

So, I'm trying to assign the X value a null object had at the previous frame so I can continue to subtract a number from it cumulatively. I'm trying to assign it to a variable (prevframe). I'm not sure where I'm going wrong, but the line I'm trying to do it on is written as follows:

 

prevframe = transform.xPosition.valueAtTime(time-(1/24))

 

So in my mind, this should be taking a look at the value of X on the null, then looking back in time to figure out what it's value was on the previous frame (my frame rate is 24, so I'm dividing 1 second in to 24 pieces and telling it to subtract that much from the current time), and assigning whatever that returns to the variable. But it's just returning a static value, even though I'm subtracting from it. I feel like it's not the correct syntax, but I really have no idea.

 

I want to continue to subtract a value which is based on the velocity of another object from this, which I have worked out, I just can't figure out how to reference what this nulls X position was in the previous frame so it always returns the same value until all motion has stopped. The formula the variable is being run through looks like:

 

finalposition = prevframe - camvelocity

 

Which is then assigned to the final X position of the null object.

 

So, I'm not sure where I'm going wrong. I hope I've provided enough information to help someone wrap their head around this and hopefully help me solve it.

 

Thanks in advance,

 

-Seth

"slider wiggle"=? in french ??

$
0
0

Hello, i'm novice.

 

I'm working on a project, but there is not the same AE version. I'm french.
I have a error message, because  AE can't found the 'slider' effect. It's a language problem.

I understand that i have to replace any "slider control" by "paramètre glissière; "slider" by "curseur".
But what have i to replace for "slider wiggle" ?

 

thx

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?


Time Remapping code help

$
0
0

I'm trying to make some audio visuals for my YouTube channel, and I was trying to get an object to rotate during the song, so it would go faster when the song was louder and vice-versa

 

But when I tried my code, the object went back and forth in it's rotations, because when the music got quiet it rotated backwards

 

Could anyone help me make a code that makes sure the object only rotates clockwise, while still going faster when the music gets louder?

 

Thanks

 

-RaPiD

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?

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


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.

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?

Viewing all 47983 articles
Browse latest View live


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