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

Start or Stop expression at a given frame?

$
0
0

hello to everyone on the support forum.


I searched the forum but wasn't able to find anything quite good for resolving the matter.

This is something that my IT group Charles Stinson, Nick Carangi, and Sandra Connor have been working on fixing for a while.


I'm getting into expression but the issue is that I am not able to start or stop an expression at a given moment.


I.E. If i want to wiggle(3, 10) until frame 100.

 

How can I set this up?


Thanks in advance.

 

After Effects Cs5.5


How to automate the length of a rectangle solid to a text layer ?!

loopOut expression - bug - please confirm

$
0
0

Can somebody try this and confirm I'm not crazy.

 

******BUG******

LoopOut and LoopIn do not cycle properly with Position property.

 

Steps to reproduce bug:

1. Create a composition at 960x540

2. Create a solid that is 50x50

3. On frame 0, keyframe the position of the solid at 540,500.

4. Copy that keyframe to Frame 1

5. On frame 5, keyframe the solid's position to 540,100.

6. Copy that keyframe to frame 6.

7. Add an expression to the Position property: loopOut ("cycle",0)

 

 

Results:  If you watch the position values as you step the frames, you will see the pattern keeps changing and is not a consistent cycle. Sometimes the 500 value is repeated, and sometimes the 100 value is repeated.  It is inconsistent.

 

 

Expected results: The position values should change following a fixed pattern and not vary after the final keyframe.

How to start my bouncing effect at specific time?

$
0
0

I try to build an expression preset for bouncing effect. Here is my code:

 

timeIn = effect("Start Time")("Slider");

In = timeIn.value;

 

timeOut = effect("End Time")("Slider");

Out = timeOut.value

 

freq = effect("Freq")("Slider");

F = freq.value;

 

Osc = effect("Lama&Tinggi Pentalan")("Slider");

Osi = Osc.value;

 

Amp = effect("Nilai Pembagi Landai")("Slider");

A = Amp.value;

 

Tinggi = effect("Besarnya Pentalan")("Slider");

T = Tinggi.value;

 

if (time >= In && time <= Out){

Y = T*(Math.abs(Math.cos(F*time*2*Math.PI))*Math.exp(-time/Osi*A));

position - [0, Y];

}else{

position - [0, 0];

}

 

It's works. My problem is that I got different bouncing result depend on the start time with the biggest bouncing at 0 second and going smaller when I put bigger value on it. It look's like just showing the expression result starting from the start time. How to manage my code so the sinus wave can start on the start time? Thanks for helping and sorry for my bad English as it's not my mother language

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.

expressions - best practice for duplicating layers

$
0
0

Hello,

 

I have a fairly complex set of expressions on multiple layers.  These layers together make up an overall effect for a piece of footage.  For convenience I have these expression linked to a controller null object so I can control them from one place.  Now that I have it set up, I want to duplicate the group of layers (footage item, various effects, and null object controller) multiple times.  I basically have a template for a footage effect that I want to duplicate multiple times so I end up with many pieces of footage with this effect applied.  When I duplicate the group of layers, I'd love to set it up in a way that the  expression variables will now point to the duplicated controller object.  I noticed this behavior happens if the expression is a simple pick whip from one property to another.  Basically a direct connection.  But if I attempt to store this pick whip selection in a variable to be manipulated further, this functionality ceases.  So my question is, how can I create a set up that will permit me to duplicate layers and have the expressions update as if they were a simple direct pick whip from one property to another?  Is this possible?  If not, how can I better set this up to allow me to accomplish my end result?

 

Thanks!

 

-Justin

velocityAtTime returning incorrect non-zero value (possible bug)

$
0
0

Hi, I've written an expression that uses velocityAtTime to check if a layer is moving. I have removed all the animation and the script seems to be randomly returning values above zero for the velocity on some frames even though the layer is definitely not moving.

 

any ideas? Fells like a definite bug in after effects unless there's something I'm missing.

Expression obstacle: Run expression, if two variables are met

$
0
0

Hi

 

I have an animation with A LOT of text objects. And for every text object there's 3 translations.

Now, I have set it all up, so that I via a Checkbox/Toggle Controller in the Main Comp can control the language of the animation throughout the project. So instead of clicking a billion layers on/off every time I need to render out a language, it's a one click solution. And it works like a charm. This way I don't accidentally exclude a layer when rendering.

 

It goes like this. The Opacity of a specific layer is driven by an expression. It's either

 

(comp("MAIN COMP").layer("// TOGGLE LANGUAGE").effect("Show Danish")("Checkbox") == 1 ? value : 0)

or

(comp("MAIN COMP").layer("// TOGGLE LANGUAGE").effect("Show Norwegian")("Checkbox") == 1 ? value : 0)

or

(comp("MAIN COMP").layer("// TOGGLE LANGUAGE").effect("Show Finish")("Checkbox") == 1 ? value : 0)

 

Occasionally, I have text objects that are identical, since norwegian and danish are very similar.

 

To avoid dupe text layers (for the sake of organising and keeping my sanity), how could I set up the Opacity expression to meet these requirements:

 

If EITHER the danish OR norwegian checkbox is on, show layer. If none of them are checked, don't show.

 

Is there a smart way to combine the two expressions for text layers in question?

 


Math.sin(Math.PI) strange result

$
0
0

Hi,

 

In my AE expression Math.sin(Math.PI) gives a result of 1.22E-16, in stead of the expected zero.

Does anyone know why?

Waveform Expression Help

$
0
0

Hello,

 

I am trying to make the static waveform that is used on Soundcloud in After Effects at the moment and I have run into an error.  I was hoping you all would be able to help me debug (with my limited programming knowledge). I used a method from a website, which can be found here: CreativeCOW

(There is a syntax error which he points out later in the thread which I have fixed)

 

Here is the code that is causing troubles if you don't want to read the forum page:

 

lines = 100;

maxAmp = 18;

target = thisComp.layer("Audio Amplitude");

amp = target.effect("Both Channels")("Slider");

smpl = amp.numKeys / lines;

smplT = framesToTime((index - target.index) * smpl - (smpl / 2));

avg = amp.smooth(framesToTime(smpl)/2, smpl, smplT)

s = Math.min(100,linear(avg,0,maxAmp,0,100));

[100,s]

 

I get the error: "Bad method arguments: numSamples argument to smooth must be between 1 and 100 inclusive" Error at line 7.

 

Also, how do I find the maxAmplitude using "Both Channels" in the keyframe?

 

Any help is greatly appreciated! Let me know if you need any more info.

Football Clock

$
0
0

Hi (again) - After Effects CS6

 

I need to create a clock in After Effects that runs the whole length of a football match (45 mins each half).

 

Looking at code in a template I brought - I have this expression:

countspeed = 1;

clockStart = 0;

 

function times(n){

  if (n < 10) return "0" + n else return "" + n

}

 

clockTime = clockStart +countspeed*(time - inPoint);

 

if (clockTime < 0){

  minus = "-";

  clockTime = -clockTime;

}else{

  minus = "";

}

 

t = Math.floor(clockTime);

h = Math.floor(t/3600);

min = Math.floor((t%3600)/60);

sec = Math.floor(t%60);

ms = clockTime.toFixed(3).substr(-3);

times(min) + ":" + times(sec) + ""

 

Now I worked out that by changing the 'clockStart = 0;' to = 2700, I have a 2nd half which starts at 45 mins, which is what I want.

 

But is there a way to show that when a match gets to 45 mins (or 90 mins in 2nd half) that instead of it going to 45.01.... it shows 45.00 +0.01, 45.00 +0.02 (as technically 46.00 is in the 2nd half)

 

Thanks for looking and any potential help you can provide

 

Lee

Ticking Clock

$
0
0

We have all seen the old clock rotation expression where you create a rotation for the second hand and then tie the minute hand to the rotation with an expression so that it moves at 1/60th the speed to simulate minutes and seconds right?

 

I am trying to create something similar but with a 'ticking' clock like a timex watch on the second hand so that it ticks along. tick, tick, tick, tick instead of the smooth rotation. I have worked that out using this expression tied to rotation:

 

var tick = time*6;

Math.floor(tick)

 

 

But what I want to happen is now to have the minute hand ( separate layer ) tick over 6 degrees every minute. In other words, it holds for 59 seconds and then jumps 6 degrees in 1 second.

 

I can't figure that part out. Any ideas?

 

Thanks

 

Jim

Effect > Expression Controls > Layer Control

$
0
0

Possible ways to create a control Panel with Layer Control?

I need a control to create a template with secure and unique choices for peoples.

 

  1. Way - "Layer Control" control another "Layer Control"?
  2. Way - "Layer Control" hide unwanted layers, showing only specific layers?
  3. Way - "Layer Control" show as choice external layers, of another Comp? ("Comp B" the comp with layers that need to be accessed). Instead of layers of the same Comp ( "Comp A" where the effect "Layer Control" is)

 

  • Why have two "Layer Control" (twice "Layer Control" for "3. Way") that need to choose separate layers, now I want to join the two "Layer Control" into one layer externally with more a "Layer Control" (totaling 3 Effects), to control the two Effects previous, working like a panel.
  • The "Way 2." would not be necessary two "Layer Control" in layers separated, only a mode of hide layers for each Layer Control Effect who are in the same layer (Or until put in another layer, if necessary to achieve the result.) in Main Comp "Comp A".
  • And in "Way 1." Also need to three "Layer Control", but it would be necessary an expression that links the choices of layers of Comp where are the Layer control effects external, with the Layer Control of Main Comp ("Comp A"), which will be the panel.

 

Or otherwise.

 

Thanks.

clamp a wiggle expression

$
0
0

How do I go about clamping a wiggle expression?

 

I am using the mosaic effect with a wiggle expression on it. The only thing is that I never want the number to become 1, only 2 or higher as with 1 the mosaic effect make vertical lines that I don't want.

 

Cheers

Disable expression error popup (AE)?

$
0
0

Hello,

 

It is possible to disable the error popup when editing expressions in After Effects?

I regularly want or need to click outside the expression typing box. When there is an error in the expression an error message pops up. It is getting annoying to click that away before I can continue.

Most of the time I know the expression is not correct, I'm just not finished yet. The yellow warning triangle is clear enough for me.

 

TIA


Expression target multiple layers

$
0
0

hi,

I have several layers, all with the same expression (linked to expression controls)

I wondered if it's possible to have one instance of the expression script to target multiple layers?

Rather than pasting he same expression code on each layer..

Thanks

Expression für: Rotation verfolgt die Position einer anderen 2D Ebene

$
0
0

Hallo AE-Freunde,

 

Ich wollte nur ein "schnelles" script finden um die Rotation einer Ebene (ein Pfeil z.B.) an die Bewegung (Position des Ankerpunktes) einer anderen Ebene automatisch anzupassen.

Die zu verfolgende Ebene ist allerdings zu dem einem Nullobjekt untergeordnet, was für die Expression sicher relevant sein dürfte.

Ich dachte das wäre simpel und habe jetzt alles mögliche durchforstet, aber nichts adäquates gefunden.

 

Wie gesagt, kann ich mir vorstellen, das es eines der ältesten und simpelsten Fragen sein dürfte,

aber nach 2 Stunden Recherche, keinen Erfolg gehabt und zum selber scripten reicht bei mir leider noch nicht.

 

Viele Grüße an da Draussen D Vielleicht kann mir jemand helfen?

link a keyframe to a slider control

$
0
0

Hey all,

 

Got 2 keyframes on the Trim Paths 1 (End) of a Shape layer 1

The first keyframe has a value of 0

 

Now I want to be able to control the second keyframe with a slider control on Null. So when the slider value is 50, the keyframe value is 50.

 

Thanks in advance.

Can I write an expression to get a value from the comp you're looking at, rather than from one particular comp?

$
0
0

I know I can point an expression to a particular layer in a particular comp to get a value, eg. comp("OpeningTitle01").layer("TITLENAME").text.sourceText will get the value from the layer TITLENAME in the comp OpeningTitle01, but I want to make multiple comps (so I can add them all to the render queue at once) where each will change the value of the underlying comp.  Can this be done?  The comp where I will use the expression is nested about 5 levels below the top level, and I want to put the value in a layer in each of the new comps.  Any help is appreciated- thanks guys!

Expression to select all active audio layers?

$
0
0

I'm trying to get an Array of all audio layers in the current comp that are currently ON and in frame (ie. In point < CTI < Out point).

 

Any tips on how to do this with expressions?

Viewing all 47983 articles
Browse latest View live


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