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

Control Layer in point of expression % Number Count

$
0
0

I have an expression that Dan  Ebberts created for number counting with a percentage sign

 

beginCount = 0;
stopCount = 100;

 

beginTime = 0; // start counting at time = 0
countDur = 4; // count for 4 seconds

 

"" + Math.round(linear(time,beginTime,beginTime + countDur,beginCount,stopCount)) + "%"

 

For my animation the layer starts around 16 seconds into my timeline and the expression has already finished before then.  Is there a way to control the
in point for a layer for this expression?

 

Thanks very much

 

Ira


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

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.

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

Limit value range with expression?

$
0
0

Hi there,

 

Is there a way to put a limit on value range when linking it to key-framed audio?

 

My situation is that I want to link the Glow Intensity of one of my objects to the key-framed audio. The issue I'm having is that everything north of 0.4 looks horrific.

 

So was wondering if there was anything I could add to the expression that will only allow the value of the Glow Intensity to vary between 0.0 and 0.4?

 

 

Cheers

Simon

Varying Speed Of Fractal Noise Ocean Waves With Expressions

$
0
0

Hi,

 

Possible Noob question:

 

I've been following:

  http://allbetsareoff.com/2009/06/ocean-water-effect/

 

The video results are here: http://vimeo.com/5384704

 

He uses the Fractal Noise plug-in to make the water and the sky. Starting at 9:45 or so he talks about using an Expression in the 'Offset Turbulence' to create a certain 'speed' of the water.

 

Programming variables I understand, but I am a total noob when it comes to AE expression variables. The expression he uses is:

 

X = effect("Fractal Noise")("Offset Turbulence")[0];

[X, time*190]

 

So it seems like varying the number 190 increases or decreases the speed of the waves.

 

What I would like to do is have the speed -accelerate- over time. The entire video is going to be prox. 3:25. I was hoping there was something akin to keyframes I could use to make it -very- slow in the beginning, then at a certain point, quicken, then at another point -really- speed up and then finally, slow down again... independent of the sky.

 

If this is not easily done, I suppose I can render the sky and water separately and use keyframes in Premiere to speed up/slow down, but I figured I'd use this as a learning opportunity.

 

SO: Is there a way to assign a variable to that 'constant' value (190) which is based on the time position? Pseudo Code:

 

X = effect("Fractal Noise")("Offset Turbulence")[0];

[X, time* if(CurrentPositionInSeconds<200) ? 190 : 60]

 

Ideas?

 

TIA,

 

---JC

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
}

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


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!

Can I Animate Individual Characters in a Text Block Using the Wiggle Expression?

$
0
0

I'm new to After Express and just diving in to expressions. I was trying to figure out if there was a simple way to use the wiggle expression in a way that it would wiggle individual characters in a text block independently of each other.

 

Definitely appreciate any help.

Replace comma with dot in a text layer expression

$
0
0

Hi!

 

I need to do a simple counter from 0 to billions so i found this expression that works perfectly:

 

//begin code

 

startTime = 0; //seconds

endTime = 5; //seconds

beginCount = 0;

endCount = 9700698977;

hasCommas = true;

function addCommas ( s ){

if( s.length <= 3 )

return s;

else

return s.substring(0 , 3) + "," + addCommas(s.substring(3, s.length));

 

}

function reverse( s ){

newStr = "";

for(i = s.length-1; i >= 0; i--)

newStr += s.charAt(i)

return newStr;

}

 

val = Math.round (linear(time, startTime, endTime, beginCount, endCount) );

if( hasCommas )

reverse (addCommas(reverse( val + "" )))

else

val

 

 

//end code

 

The problem is that i need to change the commas with dots to look like 9.700.698.977, anyone know how to do it?

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.

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!

delay scale parameter from the shape layer repeater

$
0
0

Hi,

 

 

I want to animate the scale parameter of the repeater effect and delay it on several shapes.

 

 

I've tried with this expression using 2 expressions sliders but without success

 

 

thisIndex=thisProperty.propertyGroup(3).propertyIndex;

effet=effect("repetition echelle")("Curseur");

delai=effect("delai")("Curseur")*thisComp.frameDuration*(thisIndex - 1);

[effet.valueAtTime(time - d),effet.valueAtTime(time - d)]

 

 

I've searched through the web but didn't find anything about it and I'm wondering if it's even possible

 

 

Any clue ?

Wiggle expression - slider control

$
0
0

Hi all

 

I had a solve for this from Dan Ebberts but I seem to have lost that content in the Jive update. I want to use a slider control for a wiggle, but when I have my basic wiggle expression applied to position, then pick whip from that to the slider, I get the below expression.

 

temp = effect("Wiggle Control Sliders")("Slider");

[temp, temp]

 

What is the fix for this/ way to do it right?

 

At the minute I'm using the expression below instead, but I hate not knowing the right way to do something! Using sliders/ creating decay in expressions has always been an issue for me...

 

wiggle(15,effect("Slider control")("Slider"))

 

Any help would be appreciated

 

Thanks!


Layer Source Text linking to external text. (no code in doc!)

$
0
0

I've seen linking to text documents with code snippets in it.

So that means the external text document must contain bits of scripting.

 

I would like to link to txt documents (or csv) that do not contain code.

Total noob users must be able to link a text to a After Effects project.

 

I have a website data catcher which exports CSV values.

It would be ideal if After Effects can hoover up the text and put certain pieces into certain source texts.

 

We're talking automated sports cards here.

 

Is this possible without adding code to a text dump?

Or is this just impossible?

Appending a "%" to numbers from a string

$
0
0

I have an expression that is working in animating a percentage based on a slider control.

 

n=thisComp.layer("Null 1").effect("Pie Slice 2")("Slider")

 

nRound=Math.round(n*10)/10;

 

check = nRound % 1

 

if (check == 0){

""  + nRound  + ".0" + "%"

}else{

nRound

}

 

What I can't figure out is why the "%" only appears when the number is whole and not there constantly? After reading through Dan Ebbert page, he indicates that you can in fact add it (which I thought I did correctly) but only on the whole numbers. When it's animating through the "tenths" the % does not appear.

 

I'm sure it's something simple, but I can't figure it out.

 

Thanks for your help.

Number Counting Expression with $ - Understanding how to set stop points

$
0
0

Hello, I'm using an expression I found on: Dan Ebberts's Expressioneering Design Guide which has saved me quiet a bit of frustration since I needed to have a comma and a custom character at the end of my counting numbers. But I have a simple question that I can't quite get out of the page's instructions and I'm hoping someone here could direct me.


Issue: The numbers are counting for the first 4 seconds - or whatever I change it too, but I don't understand how to set my number stop points. ie, I want to go from 0 to 1,800 pause at a specific point for several seconds and then count up to 6,500 pause again and count up and so on. So the part I'm not understanding is, how to start the count and stop on a number and then start the count again. I've set key frames for where I want those numbers to be on the timeline in the 'Source Text' which Dan's page references but this isn't working. Thoughts? Direction??? Expression is below and I've attached a reference image of my timeline. Many thanks for any direction you can provide!


Expression:

numDecimals = 0;

commas = true;

dollarSign = true;

beginCount = 0;

endCount = 17000;

dur = 4;

 

 

t = time - inPoint;

s = linear (t, 0, dur, beginCount, endCount).toFixed(numDecimals);

 

prefix = "";

if (s[0] == "-"){

  prefix = "-";

  s = s.substr(1);

}

if(dollarSign) prefix += "±";

 

if (commas){

  decimals = "";

  if (numDecimals > 0){

    decimals = s.substr(-(numDecimals + 1));

    s = s.substr(0,s.length - (numDecimals + 1));

  }

  outStr = s.substr(-s.length, (s.length-1)%3 +1);

  for (i = Math.floor((s.length-1)/3); i > 0; i--){

    outStr += "," + s.substr(-i*3,3);

  }

  outStr + decimals + prefix;

}else{

  prefix + s;

}

ref.jpg

How do I find where a Pick Whip Link goes

$
0
0

I've long ago created a bunch of pick whip relationships in a project, and can no longer find where the links go.

 

If I look at the code it says

 

content("Ellipse 1").transform.scale

 

But I have about 100 Ellipses in this project.  And have no idea which one it is.

 

Is there anyway to back track through the connection?

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

Viewing all 47983 articles
Browse latest View live


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