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

I have to fix some expressions in After Effects.

$
0
0

스크린샷 2016-01-11 오후 1.23.34.png

When I turn on some file at first, it suddenly appear that comment, which said 'In this project, it has expression error 1/1 error'

 

Actually, I'm a learner of After Effect so I do not know fluently what's what.

 

Here is the expression having error.

 

 

transComplete = effect("Slide Master Control")("Transition Completion");

if (effect("Slide Master Control")("reverse direction") == true)

    {xPos = linear(transComplete, 0, 100, thisLayer.width, 0)}

else

    {xPos = linear(transComplete, 0, 100, -thisLayer.width, 0)};

[xPos, 0]



Thank you.

 

If you want to email me, please send me into 'triumphalboy@gmail.com'.

 

I can send you this aep file for you in order to fix the problem.


Expression on checkbox to control opacity of other layers

$
0
0

I'm making a template with multiple color schemes, and I'd like to work backwards a little:

 

Typically when I make a template, I'll have a pre-comp with multiple background layers in it and I'll use a Null in my main comp with an appropriate amount of Expression Control checkboxes to control the respective BG layers' opacities – pretty normal stuff.

 

The downside is that if I want to reuse this background layer in different comps I have to duplicate it and change the expression to match the location of the null each time it moves.

 

I'd like to work backwards (if possible) and instead apply an expression to the checkbox itself that references a single BG precomp. This way I can copy the null to my 20 different template comps, while the expressions always reference a single pre-comp, thus enabling me to simply copy the null from one comp to another without ever having to change the expressions.

 

Is that possible?

control the individual rotation of multiple objects that also have individual wiggles

$
0
0

Hello,

 

I am attempting to 2D animate the leaves on a tree to create the illusion of a wind blowing the leaves. To achieve the effect I want to have each leave slowly and uniquely wiggling on the rotation parameter, but also if a big wind gust is imagined, to then create an overall rotation with a controller that adds a unified conforming rotation to every leaf on top of each individual wiggle. So in effect each leaf is slowly randomly rotating (like with a wiggle(1,5) applied to rotation), but then I can push every leaf simultaneously with an expression such as thisComp.layer("Adjustment Layer 1").transform.rotation

 

The problem is I want both of these happening at the same time, and right now one cancels out the other.

 

I'm a newbie to using expressions

change color according to value

$
0
0

Hey.

 

I want to make an expression for a randomly changing number, (so far so good), but each time it will change a value, I want it to change color relatively to the previous value it had. MEANING... if it will goes up, then it will change to blue and if down then to orange (for example).

 

one more thing. I want it to change value every few seconds and do it with a "hold interpolation" so it will jump to the next value instead of working it's way toward it...

 

 

now.. so far I got this: (for the first part anyway)

------------------------------------------------------------------------------------------ -----------------------------------

 

upColor = thisComp.layer("Ctrl").effect("Up Color")("Color");

downColor = thisComp.layer("Ctrl").effect("Down Color")("Color");

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

prevframe = thisComp.layer("Ctrl").effect("Slider Control")("Slider").valueAtTime(time - thisComp.frameDuration);

 

if(prevframe.valueAtTime < ((time * 25) % 2 == 0).valueAtTime))downColor else upColor;

 

value;

 

------------------------------------------------------------------------------------------ -----------------------------------

Capture.JPG

any ideas?

 

thanks!

Ido.

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

Cancelling parent scaling in child

$
0
0

Any tips on getting a child to cancel out the scaling of its parent?  The parent in this case scales X and Y differently, And I can't figure out how to anti-scale the child so it doesn't stretch.

 

On the child, I'm trying to do an inverse proportion. (But this obviously applies it to both X and Y the same). Not sure sure how to call specific X or Y scale.

 

 

s = thisComp.layer("Parent").transform.scale;

[(1/s)]

 

 

Is giving me a scalar error (?)

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

Subtitle Expression

$
0
0

Hi

 

First post!

 

I have created subtitles on a corporate video using the Metadata created from premiere.

 

Its working well with the expression:

 

 

L = thisComp.layer("Thatcham_Corporate_Video WITH SCRIPT.wmv");

 

max = 7;

 

gap = 2;

 

n = 0;

 

if (L.marker.numKeys > 0) {

 

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

 

if (L.marker.key(n).time > time) n--;

 

}

 

s = " ";

 

if (n> 0){

 

if (time - L.marker.key(n).time < gap){

 

curT = L.marker.key(n).time;

 

i = n-1;

 

while(i > 0){

 

newT = L.marker.key(i).time;

 

if (curT - newT > gap) break;

 

curT = newT;

 

i--;

 

}

 

i++;

 

base = n - (n-i)%max;

 

curT = L.marker.key(base).time;

 

for (j = base; j < base+max; j++){

 

if (j <= L.marker.numKeys){

 

if (L.marker.key(j).time - curT > gap)break;

 

s += L.marker.key(j).comment + " ";

 

curT = L.marker.key(j).time;

 

}

 

}

 

}

 

}

 

s

 

 

But I need it to end the line on a full stop as it looks strange starting with 'difference. now we can...'

 

anyone done this before?

 

 

Luke


Using a relative path to .txt in expressions

$
0
0

Hi there,

 

I am using an AE Expressions script to read in text from an external .txt-file. The script is working great, except for the fact that I need the path to the external .txt file to be relative to After Effects project folder in stead of absolute. The path can't be absolute since I will be using this project 'blindly' on different computers with different file structures/configurations. This is the script I'm using:

 

myPath = "absolute_path/vars/vars.txt";

try

{

$.evalFile (myPath);

eval(thisLayer.name);

}

catch (err){ "" }

 

I have already tried putting in a relative path in the variable myPath e.g. "myPath = "./vars/vars.txt". Unfortunately this does not work. I'm wondering if using a relative path in AE Expressions is possible at all and if not, what would be another solution to this problem? (Maybe there are some plugins out there that might solve this?) Any advice or help would be greatly appreciated as I am in kind of a pinch to figure this one out.

 

Greetings,

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!

Using valueAtTime syntax problem?

$
0
0

Hi guys

 

I want to follow position of current layer "cardio.ai" but with a delay.

 

This code currently works:

 

tempX = transform.position[0];

tempY = thisComp.layer("cardio.ai").transform.position[1];

[tempX, tempY]

 

But if I do this:

tempX = transform.position[0];

tempY = thisComp.layer("cardio.ai").transform.position[1].valueAtTime(time -1);

[tempX, tempY]

 

it will not work.

 

I may be having problems with the API or syntax but I am just learning this and can't figure out what's going on.

 

Thanks

stroke width with expression

$
0
0

Hi, iam trying to set stroke width based on shape scale, (to maintain fixed stroke size) so ive used "(1/transform.scale[0])*500;" for stroke width expression, but this only works for either stroke width, or stroke height. What am i doing wrong? Or how can i apply ths to both stroke width and stroke height at the same time?

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


Slow text zoom Expression

$
0
0

Hi there!

 

I'm looking for an expression or plugin/preset to slowzoom text in our out. Like the camera is slowly rolling towards or backwards.

 

Something like "zoom in/out XX % in XX seconds"

 

Usually I would simply set scale keyframes or 3d position  by hand - but isn't there an easier and faster way?

object position controlled by time

$
0
0

So, i want to control the position of a white box by using expressions because i can't use keyframes as i want (or i'm just stupid).

 

I already have

 

a = thisComp.layer("White box").effect("Sound Keys")("Output 1")*1;

b = thisComp.layer("White box").effect("Sound Keys")("Output 2")*1;

c = thisComp.layer("White box").effect("Sound Keys")("Output 3")*1;

y = a,b,c;

value - [0,y];

 

in the white box's expressions, so what i can do now to control the box's position with time?


Scripting /Expressions in AE: Similar to Flash/ActionScript?

$
0
0
I think about learning AE, but I would like to get an overview about the Software, so that I can decide if it's suitable for what I am planning to do.

I have little experience in Flash/ActionScript, but I can't get a picture what Scripting means in AE. Can this be compared to Script-Languages like ActionScript and Lingo?
And what is the difference between "Scripting" and "Expressions" in AE.

Thank's!

Roland

Randomly rotate layer in specific increments

$
0
0

The random(x) expression is simple enough to randomly rotate a layer to any angle, but what if I want that angle to be to the nearest 45 degrees? So my layer would randomly rotate to any of the following angles: 0, 45, 90, 135, 180, 225, 270, 315, or 360 degrees.  Thanks, Jim

Control Layer in point of expression % Number Count

$
0
0

I have an expression that Dan  Ebberts created for number counting with a percentage sign

 

beginCount = 0;
stopCount = 100;

 

beginTime = 0; // start counting at time = 0
countDur = 4; // count for 4 seconds

 

"" + Math.round(linear(time,beginTime,beginTime + countDur,beginCount,stopCount)) + "%"

 

For my animation the layer starts around 16 seconds into my timeline and the expression has already finished before then.  Is there a way to control the
in point for a layer for this expression?

 

Thanks very much

 

Ira

need expresion to change opacity

$
0
0

Help,

 

I'm creating a radar for a class project and I'd like the opacity of my "plane" layer to change whenever the radar "sweep" makes contact.  I guess that would be a collision detection?  Basically, I'd like to have the opacity of the "plane" layer dark, around 50%, but then jump to 100% whenever the radar "sweep" makes contact and then fade back to the original value.  Any suggestions?

 

Thanks,

Get Frame number of pre-composition

$
0
0

Hello.  I want to get frame number of pre compositions.

For example there is "composition A" and it has "pre compositon A".

When I play composition A, pre composition A also starts playing, but pre composition A start's at frame no 3.

It means if composition A is on frame 1, pre composition A is on frame 3.

I want to get this frame number of pre composition A. What should I do?

 

In Action script 3 I can easily get frame number of layer's like "mcA.currentFrame "

I want to do something like this in AE. like "thisComp.mcA,currentFrame" .

Viewing all 47983 articles
Browse latest View live


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