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

AE Expression for extending mechanical arm?

$
0
0

Hello

 

I am pretty sure you can do this but I cant make it work....

Basically I want to make a mechanical extension arm kind of like this

http://cache1.asset-cache.net/xc/86437837.jpg?v=1&c=IWSAsset&k=2&d=2AC75F6FAA20674CB5E47545F000B36A2CDFD24D7B7E4E94C7BBCF18EB30ABE8

 

But without the boxing glove....

 

I have been messing around with Pickwicking the rotation to various other elements rotations and parenting all the seperate elements together

but cant seem to make it work, any help would be much appreciated.

 

Thanks

 

Matt


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.

3D WARP/3DBEND: geometry expression no show?

$
0
0

"3D warp" as seen on tv.adobe "What's New", does not seem to be available on my version of CS6 AE (from disk). I'm not getting the geometry option even though,I have the 3D box checked and it is a pixel based layer. I do get the other expression options such as transform and material options. Can anyone help me bend stuff?

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

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

after effect IK controlers

$
0
0

Hi every body

Sorry for my english.

 

how to controle easly alls IK controlers or null controlers of puppet in the final comp. To animate every characters in the final comp (every characters are in its comp)

 

Comment manipuler les controleurs (nulls) d'une marionnette situées dans la composition du personnage à l'extérieur de cette composition, c'est à dire, dans la compostition final.

Les copies de valeurs via expression nécessitent d'avoir des comps de la même taille. Les liens de parentages ne sont pas possible d'une comp à l'autre.

Existe t'il un script pour gérer les offsets de position de 2 nulls dont l'un est situé dans une comp et l'autre dans la comp supérieur ?

 

merci de votre aide.

 

2J.

How to make a rubber effect like when you swipe between apps using 4 fingers on iPad ?

$
0
0

Hey guys,

 

So how to make a rubber effect like when you swipe between apps (first or last app) using 4 fingers on iPad iOS7 ? Any examples ?

 

Thanks!

Ivan


Numbers expression - add letter "B" for billions

$
0
0

I have a question for Dan Ebberts.   Dan, the expression you have for a text layer for  numbers (see below)  I wanted to see if it's possible to add a letter at the end of the expression such as the letter B to represent Billions so that the final number count would be $1.7B.  I appreciate any help you can provide

 

Best Regards

 

Ira

 

numDecimals = 1;

commas = true;

dollarSign = true;

beginCount = 0;

endCount = 1.7;

dur = .5;

 

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 + 0));

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

  }

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

  }

  prefix + outStr + decimals;

}else{

  prefix + s;

}

Using sourcetext from another layer as an array - blowing up expression

$
0
0

Hey all, I am doing something that I assumed would be a quick and easy, and it is turning into quite a headache.

Here is what I am trying... (The following works btw)

 

stuff = thisComp.layer("textSource").text.sourceText;

stuff[2]

 

The problem is that if I try an index higher than 3, the expression blows up. The error is somewhat odd too...

property or method named '4' in Class 'TextProperty' is missing or does not exist. It may have been renamed, moved, deleted...

The source layer has not gone anywhere. The only thing that changes was the index.

 

I want to break down the sourceText into individual letters to feed something else and this was how I was going to go about it as I don't think the you can 'split' into letters. I figured I could get the length of the string and then scoop out each letter. Not so much eh'?

 

Update...

Tried it with split, and this also breaks it. What's odd is it seems to work for just a moment, so the script takes the index, displays the letter, waits a second, then freaks out. It does the work/breaking thing as long as the string has contains enough characters, as where a request for something that is not there immediately breaks it (which we would expect)

 

stuff = thisComp.layer("This").text.sourceText.split("");

stuff[15]

Offsetting time and position of several layers relative to preceding layer

$
0
0

Hello -

 

Pardon the newbie questions, but I've keyframed 'Black Solid' moving along the x axis and basically would like to duplicate the layer (perhaps with a new color) several times so that each 'new layer' follows the previous layer and offsets itself a certain amount of pixels...say 20px for example.

 

I found a simple expression that I applied to the first dup'd layer and it works fine but I can't figure out where to tell it to offset 20px to the left of the main layer.

 

thisComp.layer("Black Solid 1").transform.position.valueAtTime(time -.1);

 

I suppose I'm trying for a cascading effect + offset.

 

Thanks!

gj

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
}

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 to overwrite position value with variable

$
0
0

Is it possible to overwrite a specific value with a value of a variable from my expression?


My expression (I thought I could use):

"z = transform.position[2]-thisComp.layer("Audioamplitude").effect("Beide Kanäle")("Schieberegler");

transform.position[2] = z;"

 

But AE claims that the Z-Position Value of my layer (camera) is read-only...

I want to have jumps in my camera synced to musik so the amplitude value should be substracted from my Z-position value but if I dont overwrite the "old" value then the camera obviously jumps back to the original position.

 

Thanks in advance for any answer

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

How to study expressions.

$
0
0

Hi, everyone..

 

I want to study the expression.

Have to study what?

Thanks..

Randomly rotate layer in specific increments

$
0
0

The random(x) expression is simple enough to randomly rotate a layer to any angle, but what if I want that angle to be to the nearest 45 degrees? So my layer would randomly rotate to any of the following angles: 0, 45, 90, 135, 180, 225, 270, 315, or 360 degrees.  Thanks, Jim

lengthen or shorten vector

$
0
0

this may seem trivial, but vector mathematics is not my strong suit.

 

if I have a vector between point A and point B, how do I shorten it (or lengthen it), but maintian a center point between A and B, like this

 

  A------------B  old vector

  A  --------  B new vector or

--A------------B-- another new vector

Dan's Universal Counting Clock

$
0
0

Hey Dan!

 

I was trying to get your Universal Counting Clock to stop when it hits 00:00:00, but this part threw me:

 

 

if (clockTime < 0){

  sign = "-";

  clockTime = -clockTime;

}else{

  sign = "";

}

 

I tried

 

if (clockTime < 0) {

  clockTime = 0;

 

but it kept counting. How would you get it to stop counting (either up or down)?

Opacity random motion, ok! and loops?

$
0
0

Hi there!

I'm using an expression by Dan Ebberts, thanks Dan!

This expression works great, but the problem is that It's not a loop.

I need to do a loop to 4500 f. I try to use time % loopTime, but it doesn't work.

Does anyone have any idea how to do this?

Thanks!


Expressionbelow:
segMin = .3; //minimum segment duration
segMax = .7; //maximum segment duration
minVal = 10;
maxVal = 100;

end = 0;
j = 0;
while ( time >= end){
  j += 1;
  seedRandom(j,true);
  start = end;
  end += random(segMin,segMax);
}
endVal =  random(minVal,maxVal);
seedRandom(j-1,true);
dummy=random(); //this is a throw-away value
startVal =  random(minVal,maxVal);
ease(time,start,end,startVal,endVal)

Viewing all 47983 articles
Browse latest View live