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

Scripting /Expressions in AE: Similar to Flash/ActionScript?

$
0
0
I think about learning AE, but I would like to get an overview about the Software, so that I can decide if it's suitable for what I am planning to do.

I have little experience in Flash/ActionScript, but I can't get a picture what Scripting means in AE. Can this be compared to Script-Languages like ActionScript and Lingo?
And what is the difference between "Scripting" and "Expressions" in AE.

Thank's!

Roland

loopOut() script won't loop keyframes. Why?

$
0
0

Hello. I am using AE cs6 win version.

Right now I am trying to loop key frames using loopOut() expression, but it won't loop.

Please see this video.

 

 

Moving of The pale blue square is what I want, but if I use loopOut() expression to make such moving, it makes this green square movement. This green square has only 2 hold interpolation keyf rames on x position, and I just use default loopOut() expression. Seems green square's key frame 2 is ignored after first loop by loop expression.

Do you know why? Thank you in advance.

Linking x and y position to null sliders separately

$
0
0

Hello,

 

I have a Null Object called "Position Null" with 2 sliders on it called: "Left/Right" and "Up/Down". I would like to link the x position of a text layer below it to the "Left/Right" slider, and the y position with the "Up/Down" slider. How would I go about doing that?

 

Thanks!

using ActionScript to specify settings in the Hue/Saturation Effect

$
0
0

Hi there,

 

 

I have been trying to write a little action script that sets up a bunch of defaults in the Hue Saturation plug-in but can only get so far.

 

The syntax either falls over or I am missing something here because the same code will work when in After Affects but if I try to run a script from the script UI directory. I get a "property undefined" returned. Uusally you just call the property by name and all is well. In this particularl case though. The only way to access say the "Red channel Saturation" is to have the plug-in in the Red channel pop-up. Ok so it works but not when running an external script.

 

The following does work from within AE but not from the UI scripts directory via the Window menu.

 

currProj = app.project(index).layer(index):

currEffect = currProj.Effects.addProperty("Hue/Saturation");

currEffectProp = currProj.effect("Hue/Saturation");

currEffectProp.masterSaturation.setValue(20);//this call works

currEffectProp.channelControl.setValue(2);//this call works changing the plug-in pane to the Red Channel

 

currEffectProp.redSaturation.setValue(-5); //this returns: "TypeError: undefined is not an object" – yet when run within AE as an expression it works fine???

 

 

Any help would be great – thank you

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

Reading thisComp FPS?

$
0
0

In this global expression:

 

timeToTimecode(t = time + thisComp.displayStartTime, timecodeBase = 30, isDuration = false)

 

 

Instead of being coded to 30, is it possible for timecodebase to read the current comp's FPS automatically?

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.

wiggle expression with stepped (not smooth) interpolation?

$
0
0

hi

 

not sure if it's even a wiggle expression I'm after,

 

but I'm wondering how to go about getting a series of random values that an object or parameter will jump to (rather than smoothly transition to, as in the basic wiggle expression).

 

thanks

 

ML


Triggering an opacity pulse from a marker on another layer

$
0
0

Layer 1 has several markers labeled "hit" as the marker comment. The name is important because I might add more markers to do other stuff.

 

Layer 2 is at 0% opacity by default.

 

Whenever the time indicator hits a "hit" marker on Layer 1, I want Layer 2 to go instantly to 100% (no fade-in) and fade back out to 0% over 2 seconds.

 

 

Does anyone have any idea how I would go about doing something like this?

 

 

So far I have something like this, but it only triggers on the first "hit" marker and ignores the rest:

 

 

if (thisComp.layer(1).marker.numKeys > 0 && time > thisComp.layer(1).marker.key("hit").time){
linear(time,0,2,100,0);
}else{
value
}

Property links vs Relative property links

$
0
0

Now that "copy with relative property links" is available, in what case would you find using just "copy with property links" beneficial. Wouldn't the relative copy work just the same in all cases?

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!

How to read metadata out of EXRs or other file-formats?

$
0
0

My EXRs out of my 3d animation package contains the camera postion/rotation/focal length in the meta data. Is there a possibility to read it out and create a AE 3D camera out of it?

I'm don't know how to access meta data in AE in the first place. I know and use other external ways for exporting and importing 3D cameras or nodes transform but would like to have a simpler solution based on the EXRs alone.

In Nuke there are easy ways to read the meta data and a relatively simple Python script can create a 3D camera out it.

Possible to set Source Text from another comp?

$
0
0

Let's say there is a Comp1 with a pretty complicated animation that involves a text layer. CompMain is the main comp with 10 instances of Comp1. Each instance has different text, position and timing. Can I set the Comp1 text layer Source Text from an expression in CompMain? If this is not possible, is there any workaround? Otherwise, the alternative would be to have 10 versions of Comp1 with different text and that would be too messy.

Counting up in Multiples

$
0
0

How do i set an expression to my slider to count in Multiples of 10s, 20s.... to my very last key@@frame?

Thanks

heart beat

$
0
0

hi

im looking for a simple expression to create heart beat effect,scale up and down but with a realistic look

thank you so much

yotam monk


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.

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)

counting numbers expression with commas

$
0
0

I am using the following expression to create a number countdown but I need it to recognize or insert commas in eight digit numbers. Can anyone tell me how to alter it:

 

 

startT = 0;

endT = .5;

beginVal = 12400000;

endVal = 10700000;

t = linear(time,startT,endT,beginVal,endVal);

Math.floor(t) + ''

 

 

P.S. there are also times that I'd like to add dollar signs or percent signs.

Sat Nav//GPS style animation trouble - linking properties on multiple layers to control null

$
0
0

Hey,

 

I've got a car (.ai file - could be png or whatever) and a shape layer producing a dotted line along a path. This same path has been copied into the position data of the car and both move over the map seamlessly with the dotted line following where the car has just been.

 

My problem comes from trying to sync this journey with VO - currently ive pre composed the the animation and used time-remapping to to ramp up and down the speed of the animation so that it syncs with the VO of the journey. This is no good as its taking too long too turn around each route and the interpolation between the ramps isnt the most aesthetically pleasing.

 

So what i want is to have a Null with a slider control - id want the trim path of the shape layers dotted line and the position data of the car to both be controlled by the slider (so at 0 on the slider we are at the beginning of the route and 100 the end)

 

Ive been playing around with -

 

ctrl = thisComp.layer("ControlNull");

slider = ctrl.effect("Slider Control")("Slider");

n = Math.max(1,Math.min(slider,numKeys));

valueAtTime(key(Math.floor(n)).time)

 

This is close - at 2 on the slider the dotted line jumps from 0-100. The car gradually completes the run between around 0 - 18 (out of 100) i would like to be able to use the slider to make both properties complete the route at the same time & speed

 

Relatively new to expressions so excuse any blatant ignorance - im using the most recent version of AE CC15

 

Thank you in advance

 

T

Linking multiple puppet pins to one null object

$
0
0

Hi there,

 

right now I'm dabbling in character animation and I'm looking for a setup of an furry/wobbly character. (No native speaker, so sorry in advance.)

I want to set up the body like this: outside puppet pins (1-13) for the 'fur', linked to Null1, puppet pins (14-18, on the same layer) linked to Null2.
My goal is to animate the Nulls separately to achieve some kind of delayed movement of the outside part of the body.
puppet_null.png

My question: how do I link multiple puppet pins to one Null; what expression could I use?
Because pick-whipping the position of the puppet pins to the position of the Null results of course in a changed position of the pins.
I guess it has something to do with offsetting every pin, but is there a way to do this without entering offset-values into every puppet pin-expression?

 

Thanks in advance and sorry for the slightly confusing questions,

Hannes

Viewing all 47983 articles
Browse latest View live


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