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

How do text layer expression selectors operate on character value?

$
0
0

I'm banging my head against my desk here.  Every other attribute I try to animate using expressions selectors works by multiplying the value returned by the selector by the value of the property in question.  But I can't make heads or tails of what an expression selector does to either Character Value or Character Offset properties.

 

Has anyone had any luck with these?

 

I'm just trying to transcribe the characters from one text layer into another using the expression:

 

 

MT = thisComp.layer("Master Text").text.sourceText;
if(textIndex < MT.length) MT.charCodeAt(textIndex) else 32

 

 

I set my character value to 1, and left the Amount property set to [100,100,100] thinking the value coming out of my expression would be multiplied by 1.  Instead, the results I get are nonsensical.  Is there something obvious that I'm missing?


Link checkboxes.

$
0
0

Hi,

 

In the project I am currently working on, there are some trouble with the flickering of lights on the footage. Now, there is a plugin that helps to reduce that. In order to get the max result we had to devide the footage in different segments, with each his own independent effect applied to it. On top of that we have to keyframe a certain value every 20 frames.

 

This value is generated when clicking on a check box. the thing here is, that this ceckbox is static (no alt+click option to parent it. Also there is no option to set it on/off. Its permanently set to off). So it is basiclly just a button.

 

My question is; Is there any way to link all the "static" checkboxes from the different effects to one checkbox control, so that by editing just 1 control all the other checkboxes will be affected?

 

Thanks in advance,

 

Almar.

mask follows track point

$
0
0

I am trying to have an elliptical mask path follow a point that was motion tracked. how can i attach the center point of that mask (not the layer) to follow the tracked point?   I've tried Nulls but the path alone doesn't follow..instead the whole layer follows instead.  i need this to follow a highlighted subject around.

The value of this expression

$
0
0

I was looking through some old tutorial projects and came across this expression

 

[thisLayer.width/2, thisLayer.height/2]

 

which was applied to the Wipe Center property of the Radial Wipe Effect.

 

Basically it places the wipe center in exact center point of a layer.   I thought that it had some special power like if the layer were scaled in un-equal amounts, it would prevent something funny from happening, but it works just as if the wipe center were place by hand in the center of the layer. 

 

Then I changed it to

 

[thisComp.layer("flower").width/2, thisComp.layer("flower).height/2]

 

thinking it would cause the placement of the Wipe Center to jump to a different position, the center point of the Flower layer which was positioned off center of the composition.  But it stayed right in the middle of "this layer".

 

So I wondering is there anything special about this expression other than figuring out the math and keeping, in this case, the property Wipe Center in the center of the layer.

 

I just trying to understand expressions better.

 

Thanks

 

on a mac  CS 5.5

expression request

$
0
0

I've been askjing around to find out how a particular effect that I seen on numerous music video was created.  No one could give me definitive answer,  I even suggested maybe it was done by editing in Premiere, which others agreed is a strong possibility.  However to hold this effect for a long period of time or to try different layer stacking  would be very tedious in an editing program.

 

The effect here  http://youtu.be/T6j4f8cHBIM   at 0:50       or        http://www.vevo.com/watch/nicki-minaj/stupid-hoe-explicit/USCMV1100087

 

I was given a wiggle expression        wiggle(1,50) < 50 ? 0 : 100         that makes a layer's opacity either 0 or 100 if the wiggle value is above or below a defined number,  but the result of this is random. 

 

I've never written my own expression and I've discovered even trying to verbalize the desired action and result takes very presice language, so here's my attempt.

 

I would like to control a layer's ocacity by having it alternate, in sequential order, through a complete cycle of assigned values x times per second.

 

ie.

Layer A opacity values = 0, 25,50,100  played in sequecial order at x frequency

 

I would like to use this expression to have layers that are stacked visable as follows:

(The start time of each layer is the same and the frequency rate in the expression the same).

 

Layer A opacity values = 100, 0, 0

Layer B opacity values = 0, 100, 0

Layer C opacity values = 0, 0, 100

 

With the expression applied to each layer, the visual result in the Comp window would be seeing Layer A,B,C in that order x times per second.   By having the expression reference a sequence of numbers I can choose to have 3 or 20 layers be totally, partially or invisible in a predictable/rhythmic way.

 

Thanks in Advance

Expression help with time remapping

$
0
0

Hi

 

I have a 25fps Precomp with an animation that changes on every frame.

 

In the master comp I want to apply an expression to its time remap property so that it holds on each consecutive frame for a given duration, eg on Frame 1-15 we see frame 1 of precomp, on frame 16-30 we see frame 2, and so on.  I can't figure this out. Tried posterizeTime and some other bits to no avail and can't find it elsewhere on the web.

 

Thanks, Steve

Loop Composition creates flicker effect

$
0
0

I try to loop a composition within an other and used "Zeitverzerrung" (Time Warp) on this Composition. I added the Expression loopOut(type="cylce"). The Loop works fine but at the time of the second keyframe of Time Warp the Composition disappears. I don't know why but it creates a flicker effect I don't want to have. Thanks, Alex

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


Off by a frame

$
0
0

Hey guys, I'm coming up empty here with a simple expression to drive the time remapping of a layer.   The bit having the problem works like this:

 

I've got a precomp with a texture layer that changes every frame (driven by an image sequence, so there's no risk of weird interpolation).  In the main comp, I am performing an animation with the precomp, but I want the texture to change only every 20 frames.

 

So, I have an expression on the time Remapping property that says simply "time/20".    This seems to work great about 90% of the time, but every once in a while, it gets off by a single frame.  It doesn't get progressively further off — after each one that's wrong, the next one is almost always back to the correct frame again.  So, for example, the texture is supposed to shift on frame 860, and the shifts on frame 800, 820, 840 all are on the correct frame, but then for some reason, the next one happens on frame 859.  After that, the next one shifts on frame 880 again, as it's supposed to.

 

The image sequence, the precomp, and the main comp are all running at 23.976 fps. 

 

Below is an image showing a grid constructed from the main comp.  The yellow planks are all off by a frame.

 

Screen Shot 2014-07-05 at 12.27.20 PM.png

Smooth my wiggle!

$
0
0
Hey all!

I am wiggling a Null position as an emitter for Particular. However, the resulting wiggle is pretty jaggy.

I found Dan's smoothing function:
temp = thisComp.layer("Null 11").transform.position.smooth(1);
[temp[0], temp[1]]

But it only make my streaks smaller, not smoother. They are just as angular as before.

Photobucket

Automated carussel gallery

$
0
0

Hey guys!

 

Because I'm not very familiar with all the possibilities of AE, i thought I'll find someone here who could give me guidelines/tips.

 

Here we go:

 

We will have approximately 80-100 pictures with a fixed size which have to be positioned in a circle around a camera, automatically, in a prepared composition. The circle has to be animated around the camera, like a carussel. The whole thing will be played as an infinite loop, that means the first and the last frame have to be identically!

 

The final workflow should look like this:

1. Opening the prepared composition

2. Importing all the prepared pictures

    - Eventually customizing the carussel speed

3. Rendering the composition

 

 

Is there any way to create such a composition with any kind of scripting?

 

 

(Due to perfomance problems, Flash is not an option!)

Keeping Exponential Scale "live" with expressions

$
0
0
Is there a way to replicate the Exponential Scale via expression?

As you know, once you run the animation assistant, the keyframes are locked down and if I need to change the start or end values, I have to delete all the intermediate KFs and re-run the animation assistant. Kind of a hassle, eh?

It would be cool if I could set a start and stop keyframe or layer markers and have the expression do its thing between a min and max value (via sliders?).

Can I link a path vertex to a position property via an expression?

$
0
0

I want to have curves and lines draw across or between points in a video clip that has hand held camera moves in it.

 

I've motion tracked the points I want to use and assigned the tracking data to a null at each point. Ideally I'd like to then link a vertex in a shape path to a null so I can have a stroke animate in and join up the tracked points and then the vertices can "stick" with the video as it draws on.

 

It's not possible to stabilise the shot animate then "de-stabilise" the shape layer as there's some parallax as the camera turns through a small angle.

 

There's a couple of Tuts that suggest work arounds, such as using the Beam or Path Text (dots and dashes) effects on a solid layer as they have vertexes that can be pickwhipped to position properties. I then have to use multiple layers and timings to create the illusion of a single line moving through the space.

 

There's also a RotAE script that I've come across:

http://www.fxfx.org/index.php/2011/03/27/how-to-attach-a-mask-point-to-a-layer-in-after-ef fects/

 

However I wanted to check if it's actually impossible and these workarounds are the only options?

How to get the footage's current frame number in expression?

$
0
0

There are 2 layers.One is text layer,one is sequence layer.

Footage has begun from the 20th frame.

Therefore, the number of composition's current frame number and footage's frame number has shifted.

 

I want to show footage's frame number in text layer . not composition's frame number.

How to get the footage's current frame number in expression?

 

 

Tatsuya

Parsing number text string to numeric value

$
0
0

If I have the number "5" as a text layer, how can I get another text layer to read that number, and then add another number to it?

 

This gives me "56". I want "11".

 

temp = thisComp.layer("5").text.sourceText.value;

(temp + 6)


Camera Zoom Expression

$
0
0

Hi All, I've been recently using a workflow I quite like to create hundreds or thousands of instances of a 3D object in AE, and I'd like to take some of the guesswork out of it with an expression for the camera.

 

Let me give you an example of the kind of shot I'm working on. 

 

Imagine you're pushing in towards the window of an office building when it opens and out of it starts pouring hundreds of paper airplanes.  My workflow is to do the following once I've got the office building and the airplanes built in AE.  Design the camera move, with one airplane which follows a typical path.  Then use the perspective changes on that airplane to create a 2D "card" which can be fed to a particle system which replicates the move hundreds of times with minor variations.

 

What I'm trying to make:  a set of expressions to use with the camera for the purposes of creating the 2D card.   What it needs to do is point the camera at the object and control zoom.  Ultimately it needs to keep the object's  orientation and apparent size constant through the shot, so that the only change in the object that you see is the change in perspective.

 

I've been eyeballing this in the past and it works relatively well, but I think if I nailed it down I could have a really useful system for creating apparently 3D particles.   Thanks in advance for any help!

Inverse Opacity

$
0
0

I have two layers. I want one to be on while the other is off. Neither one can be visible at the same time. But one of them always has to be visible.

 

I came up with a pretty simple expression to make one layer fade off while another fades on.

b = thisComp.layer("White Solid").transform.opacity;

Math.abs(b-100)

 

But it doesn't work if either layer's maximum opacity is an artibrarty value (like Layer A's max opacity should be 70% and Layer B's is 30%). Yes, I could precomp to get opacities back to 100%, but I'd rather not.

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.

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

Viewing all 47983 articles
Browse latest View live


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