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

ease() vs eased keyframes

$
0
0

Trying to figure out the difference in values between the standard ease() and eased keyframes with default values of 33% influence. They're very close to being exactly similar, but aren't!

 

ease(time, 0, 4, 0, 1000) -- this seems to be a perfect cubic bezier curve, with handles of (0.33, 0, 0.66, 1) as defined by cubic-bezier.com. Have adapted existing cubic bezier functions to work as expressions, and the match is perfect. However, two keyframes, bezier interpolation, 33% influence out & in (on first and second, respectively) doesn't match above.

 

Exaggerating & displaying the difference between the values gives this:

ease-vs-keys-24fps.png

 

However! I have no idea what to do with this information. As you can see, the difference is miniscule, but it's certainly present. Can any light be shed on this?         


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.

inertial bounce expression

$
0
0

hello everyone i have after effects cc and windows 8.

 

when i was on ae cs6 i used this expression and it worked perfectly

 

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);

amp = 5;

freq = 1.0;

decay = 5.0;

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

}else{

value;

}

 

now on ae cc it works for 1 minute and then this error pops up:    (in this case i applied the expression on the position of a null object with linear velocity)

 

 

After Effects warning: an expression was disabled as a result of an error.

 

Error at line 19 'Position' of layer 2 ('Null 7') in comp 'Comp 4'.

invalid numeric result (divide by zero?)

 

 

how can i fix this error? that expression was very very helpful!

 

thx!

After Effects Expression deactivate layer if in comp

$
0
0

Hi guys,

I am currently working on a huge animation with lots of comps. I have certain animations, that are used several times, but I don't want to duplicate all the comps and I am trying to figure out a more elegant way to use those comps.

 

Is there an expression, something like (" if layer in pre-comp1 is nested in comp2, then opacity=0", or something like that),  to deactivate certain layers if they are nested in a certain comp?

 

Thanks in advance!

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!

Linking position to mask path?

$
0
0

I know I can copy and paste a Mask Path to a layer's Position and vice versa.

 

But is there a way to link them live with an expression?  I think I'm running into a problem with too many dimensions in an array -- I'm trying to link a Light's 3D position into a 2D Mask Shape (for Particular).   I can copy and paste the motion path & mask shape between them just fine, but pickwhipping gives me an error.

 

Picture 11.png

lengthen or shorten vector

$
0
0

this may seem trivial, but vector mathematics is not my strong suit.

 

if I have a vector between point A and point B, how do I shorten it (or lengthen it), but maintian a center point between A and B, like this

 

  A------------B  old vector

  A  --------  B new vector or

--A------------B-- another new vector

How to rotate a point around another one

$
0
0

I need to rotate a point reference in a effect

around another point (that is another effect point reference)

keep the second one fixed and make a perfect cicle path.

 

In other words:

i have an effect applied to a layer

this effect has an reference point

how to rotate around another reference point?

 

thanks for help


Integral Calculus in AE

$
0
0

I'm wondering if there is a way to add the values of a property for every frame before the current time indicator?

 

the relevance to calculus:

 

I'm wondering if there is a procedural way in after effects to calculate the area under a curve for a property (integrating the function from "time a" to "time b"). for instance, if you had a slider that you keyframed to have a value of 1 for 3 seconds, a value of 10 for 1 second, and again a value of 1 for 3 seconds (with Hold Keyframe on in this example, but not necessarily so in all other instances). after the 7 seconds in the example, the area under the curve (finite integral from "time 0" to "time 7") should have a value of 16 (if i did my math correctly)

if there is a way to do this, will it work on, for instance, a slider with key frames like the one above, with NO Hold Keyframes, and with easy ease applied to the keyframes? essentially, could it work on any property with any shaped curve?

thanks, i hope i didnt confuse people too much with my question

3D WARP/3DBEND: geometry expression no show?

$
0
0

"3D warp" as seen on tv.adobe "What's New", does not seem to be available on my version of CS6 AE (from disk). I'm not getting the geometry option even though,I have the 3D box checked and it is a pixel based layer. I do get the other expression options such as transform and material options. Can anyone help me bend stuff?

Expression with delay

$
0
0

Hi,

 

I'm a nooby when it comes to expression, so can anyone please help me with how I can create a certain expression?

 

I think it's quite simple. I've got 2 layers. One layer has an animation (leader) and the other one needs to follow. Only with a delay of 1 frame. The animations happens on "position", "scale" and "rotation".

 

Thanks you very much in advance!

 

Best regards,

 

John

List of all expression keyword not included in official documentation

$
0
0

Hi everyone,

 

I came accross a tutorial by Harry Frank of Gray Machine. In this old post he give a tutorial on having dynamic text with an external text file... He is using a keyword wich is often use un C like programming to import classes, which is #include... What surprises me is that the official documentation does not state that keyword. So I was wondering, where could we find a complete reference on the keyword available in the expression engine of After Effect. And is it possible to combine AE Script with Expression? One example would be to find the OS and changing the file system path depending on MAC or PC...

 

Thanks all for your help!

Track nested child layer's position

$
0
0

Hi,

 

I have a Main Comp with a layer named 'Controller'.I have several 2d layers parented to this controller.

Now,i need to precompose two of them.let's say this precomposition of these two layers is named 'precomp 1'.

How can i parent these two layers in the 'precomp1' to the 'Controller' in the Main Comp again via Expression?

 

Dan,any ideas?

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

Animate a Blur Letter-by-Letter

$
0
0

So I've just learned about creating an expression selector, but I know absolutely nothing about writing code for expressions. What I want to achieve is this: I have a paragraph of text filling the screen; it begins all blurred and then unblurs one letter at a time until it reaches the end of the text.

 

I have the text layer, then I have the blur animation keyframed from (50, 50) to (0, 0) 5 seconds later. By just putting on an expression selector, I seem darned near what I need but the animation doesn't start with letter 1 blurred, it has already set the blur on character 1 to 0, progressing to blur of 50 on the last character. I need all of the characters to start at blur 50 and then start the animation from character 1.

 

The default expression for expression selector is "selectorValue * textIndex/textTotal." I believe I need some kind of offset so that it doesn't start the animation at the beginning of my composition. I'm not sure how to code that or even how to look up the code, though I'm pretty sure it's something ridiculously simple.

 

The next issue is I'd like the letters to go from 50 blur to 0 blur one at a time in the span of a fraction of a second. Is this asking for a lot of code? I looked at a tutorial covering this and it seems like a lot of code may be involved in that and maybe I'm out of my depth. I don't even know how to go about learning what code is needed for this.

 

Thanks for any help. I hope this is clear.


(Simple?) expression request

$
0
0

I think this is "simple" but I'm very new to expressions, and any help appreciated.

 

I have a group of subcomps that have an adjustment layer with an effect applied (DigiEffect's Damage, but the specifics I don't think matter). I want to control the adjustment layer effect with a "control layer" Adjustment Layer found in the Main Composition. So it looks like this: Main Comp w/ Adjustment Layer w/ DE_Interference, and I want to link all of the tweaks I make to that Adjustment Layer to an Adjustment Layer I created in each sub comp with the same DE_Interference effect on it. I see I can't pickwhip the whole effect to another whole effect, JUST the individual subgroup of parameters, like "Source_Blend" or "Random Seed", etc. Is it possible to parent those sub comp adjustment layer effects with the control adjustment layer effect? Thanks.

trapezoidal wave in AE

$
0
0

trying to figure out an expression for a trapezoidal wave function in AE.  I have not found any forms that discussed this wave formation.  I am pretty new to AE's expressions.

How can I load external file .txt in After Effects CC 2014.0 Release / Mavericks OS X 10.9.4 (13E28)?

$
0
0

ello everybody.

 

Someone can help me to load a external file .txt in After Effects CC 2014.0 Release / Mavericks OS X 10.9.4 (13E28)?

 

I tried the code bellow, but doesn't work.

 

try{

myPath = "~/Desktop/source.txt";

$.evalFile(myPath);

eval(thisComp.name)[0];

}catch(err){

"MISSING";

}

 

The source.txt file have the texts bellow:

 

var comp1 = ["Title”, “Subtitle”, “Description”];

var comp2 = ["Text 0", "Text 1", "Text 2"];

var comp3 = ["Text 0", "Text 1", "Text 2"];

 

Thanks.

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.

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!

Viewing all 47983 articles
Browse latest View live


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