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

KeyFramed Rectangles Flashing, How To Fix?

$
0
0

So I recently have been making videos with adobe after effects where I am showcasing copyright free songs in the Monstercat layout, but I keep having problems and I thank the adobe community for being so helpful every time I ask, but I have one last problem. In this video at about 2:50 the rectangles I use with sound keys (to keyframe their scale) are flashing Vena Cava - Get Wrecked [DUBSTEP] - YouTube like I said it starts at about 2:50. I don't know if certain parts aren't getting keyframed or something.... but I need help knowing how to fix this This is the code I am using:

 

 

myVal=thisComp.layer("Sound Keys 21").effect("Sound Keys")("Output 3");

X = 100
Y =clamp(1,100,myVal);

[X,Y]

(Took me a long time to figure out how to insert that, xD)

  I am so thankful that this community is so open and helpful! Thank you so much!

OH!  I am using comp FPS which is 30. I read something about using a different keyframes per second than the comps fps. But Idk. Thanks!


Accessing currently selected keyframes

$
0
0

Is there a way to access the currently selected keyframes through javascript?  I'm trying to write a gui that will paste the currently selected keyframes (or the copied keyframes could work too) onto a user specified layer when you press a button.  And secondly, is it possible to retain all of the extra attributes such as ease in and ease out for example?

 

Thanks in advance!

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

velocityAtTime returning incorrect non-zero value (possible bug)

$
0
0

Hi, I've written an expression that uses velocityAtTime to check if a layer is moving. I have removed all the animation and the script seems to be randomly returning values above zero for the velocity on some frames even though the layer is definitely not moving.

 

any ideas? Fells like a definite bug in after effects unless there's something I'm missing.

Expression obstacle: Run expression, if two variables are met

$
0
0

Hi

 

I have an animation with A LOT of text objects. And for every text object there's 3 translations.

Now, I have set it all up, so that I via a Checkbox/Toggle Controller in the Main Comp can control the language of the animation throughout the project. So instead of clicking a billion layers on/off every time I need to render out a language, it's a one click solution. And it works like a charm. This way I don't accidentally exclude a layer when rendering.

 

It goes like this. The Opacity of a specific layer is driven by an expression. It's either

 

(comp("MAIN COMP").layer("// TOGGLE LANGUAGE").effect("Show Danish")("Checkbox") == 1 ? value : 0)

or

(comp("MAIN COMP").layer("// TOGGLE LANGUAGE").effect("Show Norwegian")("Checkbox") == 1 ? value : 0)

or

(comp("MAIN COMP").layer("// TOGGLE LANGUAGE").effect("Show Finish")("Checkbox") == 1 ? value : 0)

 

Occasionally, I have text objects that are identical, since norwegian and danish are very similar.

 

To avoid dupe text layers (for the sake of organising and keeping my sanity), how could I set up the Opacity expression to meet these requirements:

 

If EITHER the danish OR norwegian checkbox is on, show layer. If none of them are checked, don't show.

 

Is there a smart way to combine the two expressions for text layers in question?

 

Add a delay to an expression

$
0
0

So I have an expression that controls the opacity something along the lines of

 

if(other layer >50) opacity(100) else opacity(0)

 

is there a way I could stick a delay in the else part of my expression. Logically I want the opacity to go to 0 but i want it to wait a second before it does. Would it be something like

 

else opacity(0) delay(.1)

 

i don't want to delay the whole expression just the part that makes the opacity go to 0

 

any help would be great

How to automatically "fit to comp" any imported file?

$
0
0

Hello everybody

 

i'm using a plugin to dynamically import video files into some comps i previously configured.

All these comps are 1280x720 and this plugin, when triggered, basically takes hundreds of video files i have in a specific folder on my PC and imports them in AE and puts each one of them in each comp.

For my job i sell hundreds of videos per year during sport events (all videos have the same structure). That's why i use this script, which automates my work and automatically edits each video.

 

THE PROBLEM

The video files are not the same resolution. Some are 1280x720, some others are 1920x1080.

The plugin simply imports them and puts them into the comp, which means the 1920x1080 files will not be properly scaled.

As you can imagine, i can't open each comp and right click on the video and click "fit to comp" because, having hundreds of comps each time, it would be a huge waste of time, and it would be useless to use a script.

 

THE SOLUTIONS I THOUGHT

1) Is it possible to tell AE to automatically fit to comp any video imported into a comp? (something like "default scale to frame size" of PPRO)

2) If 1 is not possible, i came up with a weird but possibly working solution. In each comp i put a null object with an expression that changes the scale of the imported video. Hence, when the video is imported, the expression on the NULL object takes care of resizing the imported video. The question is: how can i tell that expression to change the scale of a video not yet imported (i already have the code of the expression, found somewhere ont the web...i just need to tell the null object to apply the expression to a video file that is not yet imported)?

 

 

Thanks for support!

keyframes control with layer markers

$
0
0

Hello,

 

I have an animation of a line that has two sets of keyframes of two different properties in CS4.

Basically a line gets generated in the first phase then it gets cleared out in the second phase.

This is done using two slider controls that act on the horizontal size of two rectangles and using merge paths (using the second rectangle as a matte for the first to clear it out)

 

I've put two layer markers on my layer hoping to link the keyframes to each of them.

 

Then I have found this script on the web and I put it on the first property :

 

L= thisComp.layer("ShapeLayer");

n = 0;

if (L.marker.numKeys > 0){

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

if (L.marker.key(n).time > time){

n--;

}

}if (n == 0){

valueAtTime(0);

}else{

t = time - L.marker.key(n).time;

valueAtTime(t)

}

 

This indeed lets me move the whole animation with the layermarker (which is very good) but I can't find a way to link the second set of keyframes to do the output.

I will add a link with the project file: WeTransfer

 

Please help!

Thanks


Waveform Expression Help

$
0
0

Hello,

 

I am trying to make the static waveform that is used on Soundcloud in After Effects at the moment and I have run into an error.  I was hoping you all would be able to help me debug (with my limited programming knowledge). I used a method from a website, which can be found here: CreativeCOW

(There is a syntax error which he points out later in the thread which I have fixed)

 

Here is the code that is causing troubles if you don't want to read the forum page:

 

lines = 100;

maxAmp = 18;

target = thisComp.layer("Audio Amplitude");

amp = target.effect("Both Channels")("Slider");

smpl = amp.numKeys / lines;

smplT = framesToTime((index - target.index) * smpl - (smpl / 2));

avg = amp.smooth(framesToTime(smpl)/2, smpl, smplT)

s = Math.min(100,linear(avg,0,maxAmp,0,100));

[100,s]

 

I get the error: "Bad method arguments: numSamples argument to smooth must be between 1 and 100 inclusive" Error at line 7.

 

Also, how do I find the maxAmplitude using "Both Channels" in the keyframe?

 

Any help is greatly appreciated! Let me know if you need any more info.

walk cycle: how to avoid slipping legs?

$
0
0

hi

 

I wonder if there's an expression which would allow me to synchronize walking character's steps with its horizontal position? I animate two-legged character's legs for walk cycle, but when i animate the whole character's X axis position it's very hard to avoid its legs from skidding across the surface. any free or non-free plugin/expression for this?

loopOut() Cycling/ping pong expression driven effect

$
0
0

Hi!

I like to loop this expression so it ping pong back and fort thru the timeline.

Is it possible to combine these two expressions? If, what's the correct sythax?

effect("Radial Wipe")(1) and loopOut("pingpong")

wiggle between parameters

$
0
0

I want to wiggle between 2 values. So that my glow stays bright enough to see and still flickers.

 

why would this not work?

 

x= (50-75)

wiggle(4,x)

'Drift Over Time' but with easy-ease?

$
0
0
I'm using the nifty Adobe Drift Over Time preset. But its movement is linear. Any way to add an easy-ease to the start of it?

This is applied to the position property of the Transform plug-in:

driftDirection = degreesToRadians(effect("Drift Over Time")("Direction") - 90);
x_offset = Math.cos(driftDirection);
y_offset = Math.sin(driftDirection);
driftSpeed = effect("Drift Over Time")("Speed (pixels/second)");
[x_offset,y_offset] * driftSpeed * (time-inPoint)

How to delay an animation

$
0
0

Sorry for my bad english: i'll try to be clear.

Once a layer has some animation (position, scale etc),

how can i link another layer to this first one (or the animated property of the first one to the another equivalent one)

and make the second layer animation delay some number of frames?

 

Another situation:

same start point above, but, after duplicate that layer,

how to delay the animation time some frames?

 

Thanks for the attention

How to wiggle a layer on odd frame numbers.

$
0
0

Hello. I am using AE CS6. Now I am trying to make an cartoon animation, and now I am trying to wiggle some layers' position.

But I don't want to wiggle the layers on every frame. I want to wiggle them only on odd frame numbers.

I mean, I want to wiggle them on frame 1,3,5,7,,,,, but don't want to wiggle on frame 0,2,4,6,,,,,  .

I am not familiar with expressions, but is it possible to make such a expression? I don't know what to write in "If" clause of wiggle expression.

Please give me your advice. Thank you in advance.


Expression at a specific time

$
0
0

Hi,

 

when I apply an expression it starts from the beginning of the composition, but if I want to start it, for example, after 10 seconds, how can I?

 

Sorry for my english.

Typewriter Expression

$
0
0

Hey guys, I've got a thorny problem here.  I've got lines of text being "typed" on the screen one character at a time.  I'm currently animating the text using the "start" parameter of the "range selector" attached to the opacity of the text, but I'm open to better ideas.  I also have a typewriter keyboard where each key is an image sequence with two frames, a "pressed" and an "unpressed" state. 

 

What I'd like to do is apply an expression to each key, so that it displays the "pressed" state when that letter is being typed on.

 

Anyone have any brilliant ideas about how to execute this?  Thanks so much!

 

Cheers,

Ari

Making the wheels of a car roll right

$
0
0

I have a photo of a car with the wheels separated, and I want to find an expression or something that will help make the wheels look like they are rotating at the right speed.  Any suggestions?

 

I have used AE for a while but expressions are still pretty foreign to me.

 

Thanks for any help!

How to delay opacity following another layer

$
0
0

Hello All.

 

I have 100+ layers that I would like to fade on in a delayed fashion following the manual opacity key frames set in a 'master' layer. Thus, each of the 100+ layers will incrementally fade on by half a second — after the 'master' layer has faded in.

 

My research has led me to this expression:

 

thisComp.layer("leader").transform.opacity.valueAtTime(time-thisComp.frameDuration)

 

however the above fades in all 100+ layers simultaneously. I'd like the layers to fade in one after the other.

 

 

Can anyone suggest the script to make this happen please?

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!

Viewing all 47983 articles
Browse latest View live


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