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

Scale audio amplitude to have highest value at 100

$
0
0

I have an audio amplitude that I want to scale so the highest value is always at 100 - Even when amplitude values are changed.

 

Solution I think should work:

So I have the variable highestValue, which I need to multiply with x to get 100.

aAmp = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider").smooth(2,17);

highestValue = ???;

x = 100/highestValue

aAmp*x

If nothing above is wrong, then all I need to know is how to find the highest value in my audio amplitude.


Start/Stop Time Expression

$
0
0

Hi,

 

I'm new to expressions and I need to start and stop the expression at specific frames.

 

My expression as follows:

 

f = effect("Frequency")(1);

p = effect("Period")(1);

Math.cos(p * textIndex/textTotal + time*f)*50

 

Thanks in advance for all your help!

expresiones para opacidad sin variaciones

$
0
0

buenos días a todos. espero puedan ayudarme con esta duda.

no se mucho de after effects, así que tratare de ser específico.

lo que intento hacer es trabajar con la opacidad del espectro de audio.

usando la amplitud de audio(la que se genera convirtiendo el audio en fotogramas clave), lo que quiero hacer es que de acuerdo a la variación de la amplitud de audio quiero que la opacidad vaya desde 0 a 100, pero lo que hace es variar entre 0 y 100. yo quiero que solo se mueva de esos dos puntos 0 y 100. para que cuando el audio suene la opacidad vaya al 100 y cuando no haya nada o casi nada desaparezca.

espero me puedan comprender. lo e intentado con wiggle pero solo hace variaciones.

saludos y gracias por responder.

 

[Moved from After Effects to After Effects Expresssions - MOD]

How to link a marker and keyFrame

$
0
0

Hi everyone, I have a layer with several markers,my purpose is that each marker link to the keyframe(such as position keyframe), when I move one of the keyframe, the marker also follow(or move one of the marker, the keyframe will follow).

 

11.png

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

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.

Syntax Error on Mac

$
0
0

I am trying to use the following expression:

 

Math.sin(time * effect(“Speed”)(“Slider”)) * 45

I got the expression from this tutorial:  AFTER EFFECTS TUTORIAL - Animate Butterfly / Bird - YouTube

I've not worked with expressions before... but some Googling showed several folks running into the issue of this not working on a Mac.


Can anyone offer any advice?  Thanks!

Serious crashes with expression controling the letter-spacing based on layer z-position

$
0
0

I have massive crashes when using this expression script below. I just have a text layer where I control the letter-spacing depandend from the current z-position. Beginning from z=0 up to -500 (directly in front of the camera) the values are transformed by easyOut() to 0-10. That's all so far.

When now I duplicate this text line several times and start to tweak it's position then the crash happens. The more text layers I have the sooner the crash. This happens during editing so no rendering involved. In the preview is the standard renderer applied.

 

Unfortunately there is no specific error message - it tells just that AFX isn't working any more and is closing now.

 

My system specs:

I have 8 GB RAM and 10 GB disk cache. This should be enough for some text flying around.

I use the latest AFX CC Version 2015.1 13.6.1.6 running on Windows 8.1 Ultrabook (Lenovo Yoga 1). No CUDA detected so the preview is rendered by the CPU.

 

Have someone an idea why this happens? Help is highly appreciated.

 

max_spacing = 10;
z_position = transform.position[2];
var new_spacing = easeOut(z_position, -500, 0, max_spacing, 0);
text.animator("Animator 1").property.trackingAmount = new_spacing;

 

This is my test scene:

http://augenpulver-design.de/exchange/tmp/AFX_Expression_Crash_Scene.zip


Difference between speedAtTime() and velocityAtTime()

$
0
0

Just wondering what is the difference between the speedAtTime() and velocityAtTime() functions?

Generating null object control with animation preset?

$
0
0

I've recently started playing around with expressions and animation presets in After Effects.  I set up some expression controls on a camera's z position and zoom and connected them to a slider in order to recreate the "Hitchcock Pull" effect with a single slider.  My problem is, I can't seem to apply the slider control effect directly onto the camera and instead have to apply the effect to a null object on a new layer.  My question is, is there a way I can save the expression to automatically generate that controlling null object along with the expressions so I can set up this effect in one step without having to manually rebuild the control layer?

 

The effect:

 

vertigoControl.gif

 

The setup:

 

Capture.PNG

 

I'm using After Effects CC 2015

 

I appreciate any help

Linking a 2D layer to a 3D layer

$
0
0

Ok, i've come to my limitation of expression skills.

 

I've setuped a 3D composition, with various elements at various depths. One of this element is a Sun. I setuped a camera to do a pan inside my 3D world.

 

So far, so good. None of my elements are animated.

 

Now i'd like to link a lens flare on my sun, which is a 2D layer. I've tried with the "toWorld" and "toComp" expression, but i don't get any results as my 3D layer "Sun" is not moving. Only my camera (and for some reasons i mustn't turn my Lense flare into a 3D layer).

 

But i can't figure out how to calculate the position of my "Sun" layer inside my comp with an offset from the camera position.

 

I'm sure it's possible, but i'm so bad when it comes to heavy math.

GPS data in Position Expressions?

$
0
0

I have GPS tracks of ocean drifters that I would like to animate with georegistered satellite images at specific time intervals. The objective is to show people how NOAA combines satellite observations and data collected in the ocean using drifters.

 

I can easily convert lon, lat, and time data into image coordinates and frame numbers, but I would like to know how to use these values to set position and frame number properties. I see how to set  position properties using expressions, but I don't see how to tie those properties to specific key frames or frame numbers.

 

This would be my first time implementing a project using expressions, so I would appreciate as thorough of a response as possible.

 

Thank you

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?

Sawtooth / asymmetrical oscillation expression

$
0
0

How can I make a value translate (linear) from X to Y over Z time, then instantly jump back to X and repeat infinitely?

Parenting Layer Positions - Can Variations Be Added?

$
0
0

If I parent one layer to a child layer, then the child layer will move exactly the same as the parent layer. If the parent layer moves 200 pixels to the right, then the child layer will move 200 pixels to the right.

 

Is there a way to vary the way the child layer moves? Say, a lesser percentage of pixels?

 

See below. The parent layer is the right pupil, and the child layer is the left pupil. Both pupils are centered, and look like they're in the right place.

Screen Shot 2015-01-05 at 10.45.10 PM.png

The right pupil parent layer moves to the right, and the child layer left pupil moves the same distance. It's starting to look wrong.

Screen Shot 2015-01-05 at 10.45.37 PM.png

The right pupil parent layer moves all the way to the edge of the eyeball. Now the child layer pupil has left the eye socket, and seems kind of other-worldly.

Screen Shot 2015-01-05 at 10.46.06 PM.png

 

Is there a way to tell the child layer to somehow move less than the parent layer? Say, 70% or 80% of the distance of the parent?


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)

Expression to randomly change position of layer on grid.

$
0
0

Hello,


I would like an expression to randomly affect the position of a layer on a grid, like the example on Dan Ebberts website (Mastering Expressions, Pushing The Limits: Random Motion). However, instead of moving along a path from point A to point B, I would like the layer to jump from point A to point B (with no path in between) over 1 frame. The layer would then hold on that grid space for 5-10 frames before jumping to another grid space, and so on.

 

Having the ability to control the number of layers on the grid by way of a slider would also be very useful.

 

Please help, very stressed!

Expression Get Project Path or Name

$
0
0

Hi,

 

I am new to After Effects as in I have just seen it for the first time today!

 

What I'd like to know is, is it possible to write an expression to return either the current project name or file path?

 

I'm assuming no as I cannot find any reference to this in the language reference. How would I go about integrating a script with the project to return the project name?

 

I have tried something basic like:

 

Expression code:

 

var currpath = $.evalFile(filepath);

 

filepath is the path to my script file, the script is like the below:

 

GetPath()

 

function GetPath() {

 

return app.project.name;

}

 

With this I get an error similar to method name 'Global' not found - not at my work computer so can't remember the exact message.

 

Any help would be appreciated.

 

Thanks,

 

Mark

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

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

Viewing all 47983 articles
Browse latest View live


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