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

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

Exponential Scale and Linear Move

$
0
0

Hello i'm trying to scale 2d layers exponentially. My problem — when I add 2 linear keys to move the layer — scale looks like bouncing. The expo scale code I found on adobe is <a href="https://forums.adobe.com/message/1899077">here</a>. My result comapred here: Project <a href="https://www.dropbox.com/s/41typw3o2zgsugw/Expo%20Scale.aep?dl=0">(CC)</a> or <a href="https://www.dropbox.com/s/gp0edzq00for54l/Expo%20Scale%20copy%20%28CS6%29.aep?dl=0">(CS6)</a> Please anyone help!<br> <img src="http://i1331.photobucket.com/albums/w586/amberija/Exponential-Scale-Half_zpsu5qfc4sd.gif" />

dynamic text

$
0
0

hello!

i want to link the y values of a shape layer to a source text.

so i tried to pick whip the source text to the y position of a shape layer.

 

exp text.jpg

the problem is that when i animate the shape layer the text becomes very messy because it shows lots of numbers after the comma. as you can see in the video.

 

exp text 2 - YouTube

 

is there an expression to limit numbers after the comma or have integer numbers? thx!!!!

Is Possible Apply Expression in a Composition?

$
0
0

I want to make a expression related to time duration of "MainComp".

To the "MainComp" follow time duration of other Composition.

Can anyone help me with this error?

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!

eval expression trouble

$
0
0

Found this cool expression trick reading input from a .txt file.

try{

myPath = "c:/path/to/my/file/testfile.txt";

myTime = Math.round(timeToFrames(time));

$.evalFile(myPath);

eval(thisComp.name)[myTime];

}catch(err){

"MISSING";

}

I would like the expression: eval(thisComp.name)[myTime] to be incremented on each frame.

Works like a charm when i manually enter a array index, but i cannot seem to get timeToFrames(time) to work in this case.

I have tried alot of variations but i can't seem to get it right. Anyone have any tips?

Multiple expression controllers for a single object

$
0
0

I am creating an animation in After Effects of multiple items moving along a conveyor.

 

The elements of the scene are:

  • The main comp - comp("Comp 1")
  • A comp of the conveyor in Comp 1 consisting of two static rectangles for the belts and several wheels that need to turn as items move along the conveyor - comp("conveyor")
  • A comp of the wheel that is duplicated several times in the conveyor comp - comp("wheel")
  • A rectangle in Comp 1 that moves along the conveyor - layer("rectangle")
  • A circle in Comp 1 that moves along the conveyor -  layer("circle")
  • A triangle in Comp 1 that moves along the conveyor - layer("triangle")


The conveyor extends off both sides of the scene. The rectangle, circle and triangle animate from offscreen right to offscreen left.

 

Here is the expression that I currently have attached to the rotation of layer("wheel.ai") in comp("wheel"):

  • comp("Comp 1").layer("rectangle").transform.position[0]

 

This expression will rotate the wheels in the conveyor comp when layer("rectangle") is moving. The problem I am having is that I want to move layer("circle") and layer("triangle") along the conveyor and have them control the wheel rotation also.

 

Now for the question- how can I write the expression to allow multiple items to control the wheel rotation with their positions? There will be many more potential controllers than the ones mentioned here.

 

Thank you so much for checking out this post!

 

Steve


Placing Solid From Nulls

$
0
0

Hey folks!  I'm trying to use 3 nulls to define a plane, and place a solid on that plane.  I found Dan Ebberts's expression for deriving the orientation of the solid (see below).

 

That seems to be working fine (hard to tell so far), but what I still need to do is set the position of the solid so that it intersects the 3 nulls (assuming it's large enough).  Otherwise, I've got a properly oriented solid, but it could be anywhere in space!

 

Please help if you can!

 

Cheers,

Ari

 

***

 

Dan's orientation expression:

 

UL = thisComp.layer("Corner 1").toWorld([0,0,0]);

LL = thisComp.layer("Corner 2").toWorld([0,0,0]);

LR = thisComp.layer("Corner 3").toWorld([0,0,0]);

u = normalize(LR-LL);

v = normalize(LL-UL);

w = cross(u,v);

sinb = clamp(w[0],-1,1);

b = Math.asin(sinb);

cosb = Math.cos(b);

if (Math.abs(cosb) > .0005){

c = -Math.atan2(v[0],u[0]);

a = -Math.atan2(w[1],w[2]);

}else{

a = Math.atan2(u[1],v[1]);

c = 0;

}

[radiansToDegrees(a),radiansToDegrees(b),radiansToDegrees(c)]

Linking a layers start frame to a keyframe or marker

$
0
0

Hi guys!

 

I have a PNG sequence in my timeline, depicting a robot walking in from the right side of the screen, "pushing" the current footage away with his hand as he enters. The animation setup for this was no hazzle. But I need to make a few duplicate comps of this with different robot-entry timing.

 

The "slide" of the footage is set up with 2 position keyframes, from a simple expression linked to a point controller.

 

x = value[0]; // It's a simple slide, so I just need this one value to be editable.

y = 1080;

[ x , y ]

 

I have several alpha mattes and adjustment layers that needs the same slide timing, so I figured a controller would make everything easier. The robot sequence is synced to the footage slide by hand.


Now, is there a way to link the timing of my PNG sequence to the first position keyframe of the footage slide controller? OR perhaps a marker?


Dream scenario: If I choose to time the robo entry differently (e.g. delay it 1 second), I just move the two keyframes from my controller 1 second to the right, and the robo layer will move in my timeline accordingly, so that the "push vs slide" still matches up perfectly. I know I could just select the two keyframes, and all the layers, alpha mattes, adjustments accordingly by hand to match it all up. But for the sake of simplicity and fast versioning, I would prefer the expression route, if doable



looking for an expression to mimic baseball pitches please

$
0
0

Hello,

 

AE CS6:

 

i'm creating a logo with a baseball and am hoping to get leads on 'expressions/scripts' to mimic different baseball pitches please

 

any help/advice is greatly appreciated

 

(i use mostly PPRO)

 

cheers, j

Using keyframes for motion path but use expression to set velocity

$
0
0

A graphics type job I'm doing at the moment involves simple animations of boxes across the screen. For example, layer one might move x pixels, layer 2 y pixels, layer 3 z pixels, etc etc. So far, I've been keyframing these movements, but, as the distances the various start and end points varies a lot, I'm finding that the velocities of the moves vary and I want them all to be the same speed. I can judge it by eye or look at the keyframe graph, but I'd rather find an expression that looks at my start and end keyframes and makes the entire move at a standard velocity.

 

I came up with this expression to create a move between two points at 400 pixels per second in the horizontal plane but it isn't working:

 

K1=key(1).time;

K2=key(2).time;

A=valueAtTime(K1);

B=valueAtTime(K2);

T=time-K1;

 

if (time<K1) [value[0], value[1]];

else [A[0]+(T*400), value[1]];

clamp(position, A, B)

 

 

If I remove the final clamp line, then the animation starts and proceeds as desired, but doesn't stop. I put in the clamp line, thinking it would stop the animation at the at the position desired, but it seems to nullify the previous lines of code and the animation follows the timing of the original keyframes.

 

Thanks for any help.

 

John

expressions problem

$
0
0

i write two expressions in a layer,(loopOut(type = "cycle", numKeyframes = 0);  [z,y,x]),only one expression can work,([z,y,x]for exchange x and z value),i want those expressions can work,what should i do?

Baking Parented Motion into Keyframes

$
0
0

Hey guys!  I'm trying to stabilize a piece of extremely tricky footage.   The stabilization needs to be reversible.  Ordinarily this is easy... you just apply the tracking and rotation data inverted to a layer, and then you precomp the stabilized comp, and apply the non-inverted data to the precomp.  Voila!

 

However in this case, due to the trickiness of the stabilization, I've ended up with a chain of parented nulls, each with a combination of position, anchor point, and rotation data (some added manually, some imported from Mocha).  The result works, but reversing it in the traditional way is no longer possible.

 

I've thought of a dumb solution to this problem (more on that below), but what I'm wondering is whether anyone has a smarter solution.  Is there a way of using an expression to read the footage layer's objective position and rotation (taking into account the whole chain of parents)?   If so, then I could simply convert that expression to keyframes, and invert the resulting keyframes to get my "unstabilize" data out of my big mess.

 

I think this is what the toWorld expression is for in a 3D context, but using it is a little beyond me.    Does anyone have a good idea for how to fix this?

 

For the record, here's my dumb solution.  I'm hoping to avoid this:

Replace the footage layer with a grid. 

Render.

Import the rendered file into mocha.

Track the grid.

Accepts Lights+Shadows via expression or Script

$
0
0

Hi

 

does anybody know an expression/script to turn on/off the above mentioned properties.That would be quite useful.

 

cheers


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

Blinking DOS Cursor with expression & text animator?

$
0
0

Trying to think of a way to having a leading blinking cursor with text animators (a la old school DOS computers)

 

Got pretty close by using Character Value and Opacity and animating the Range Selector>Start to get a typewriter effect.

 

But the problem is that the leading character shuffles through all the intermediate character values from "_" to the final letter. And it doesn't blink.

 

 

I was thinking maybe there's a way to use expressions using two text layers and animators. Layer 1 contains the normal text with the Typewriter preset applied. Layer 2 reads Layer 1's Source Text property, advances one space and adds a blinking  "_", "|" or "█".  Any pointers? Or is there an easier way?

Snappier Wiggle?

$
0
0

How would you make a wiggle expression that radically reduced the time between values?  Like Wiggle that uses Exponential interpolation as inbetween values? So even though the pace would be something like wiggle(1,50), it would take much less than the 1 second wiggle interval to change between values.

 

Kind of like how a hummingbird feeds? It hovers, hovers, hovers... then snap into a new position.... hover, hover, hover... snap into new position.

 

Any ideas about this?

 

(Also, is the Jagged/Smooth option of the ancient Wiggler available in expression form?)

Full auto-orient via expression

$
0
0

Hi!

 

I'd like a 3D Null to get the orientation of 3D a layer. (without parenting, it would be too easy )

 

I've tried a lot of solutions, through orientation, rotations, both combined... some results are close, but never perfect.

 

If I'm right, orientation is computed before rotations...

I think the simplest way would be with auto-orientation, or the lookAt() expression on orientation, wich gives me correct X and Y orientations, and then get an expression on zRotation to get a "full" orientation.

 

But what would it be?

How can I get the Z orientation in layer space?

 

Any idea will be appreciated!

 

François

Viewing all 47983 articles
Browse latest View live


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