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

AE CC 2014 - Wiggle Expression not assigning similar values on scale

$
0
0

So I've just noticed that the wiggle expression no longer works how it used to. I found a released article explaining changes in the Noise Algorithm used for the wiggle expression what’s new and changed in the 2014 update to After Effects CC  |  After Effects region of interest and am referring to the "fixed bug in implementation of Perlin noise algorithm" section.

 

I'm not sure if this is what's causing the issue but let me explain.

 

I'm just adding a wiggle expression on to an object's scale.

wiggle(5,50);

 

This would normally scale the object's parameters with the same value. so it would be (100,100) to (125,125) and so on.

Now however with CC2014 the expression is assigning different values to each value so getting (125, 115) or something even if the 'constrain proportions' button is enabled.

 

So I tried to trick it:

 

temp=wiggle(5,50);

[temp[0],temp[1]];

 

Still got different values even though i'm telling it to insert the same variable?

 

temp=wiggle(5,50);

temp;

 

Still got different values... I don't get it can anyone help?


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?

Need an expression to scale one object relative to a 2nd object!

$
0
0

I have two objects--a man, and a hat. 

 

I want to have an expression for the hat, so that it will not only scale with the man relative to the size of his head, but will also retain it's position on top of his head as it scales. 

 

Here's a video of what I mean: 

 

After Effects Question - YouTube

 

The expressions that I'm currently using for the hat's position and scale respectively are:

 

Position

[thisComp.layer("old man thumbs up").transform.position[0]+62,

thisComp.layer("old man thumbs up").transform.position[1]-430,

thisComp.layer("old man thumbs up").transform.position[2]]

 

Scale:

x=thisComp.layer("old man thumbs up").transform.scale;

s = linear(x[0],0, 100, 0, 17);

[s,s]

Could someone help me with this expression please

$
0
0

Hey folks see below is an expression I have for a counter, However I would like to replace the commas with a space if possible can someone point me in the direction of how to do this, would it be in the commas not requested section.....

Thank you so much.

 

Regards Chossy.

 

 

 

num = thisComp.layer("Controls").effect("number")("Slider")*100000;

amtOfDec = thisComp.layer("Controls").effect("amt_of_decimals")("Slider");

commas = thisComp.layer("Controls").effect("use_commas")("Checkbox");

//--

num = num + 0;

amtOfDec = amtOfDec + 0;

commas = commas == 1;

 

//--

if(!  commas){

 

//commas not requested

  num.toFixed( amtOfDec );

 

}else{

 

//commas requested

 

//This function takes a positive whole number as a string

//and adds commas to it

 

   function addCommas( str ){

      finalResult = "";

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

        finalResult = str.charAt( i ) + finalResult;

        if( (str.length - i) % 3 == 0  && i != 0 )

            finalResult = "," + finalResult;

      }

  return finalResult; 

  }

 

//--

 

   intPart = Math.floor( Math.abs( num ) );

   decPart = Math.abs(num) - intPart;

   wasNeg = num < 0;

   result = "";

   if( wasNeg )

      result = "–" + result;

   intPartString = intPart + "";

   decPartString = decPart.toFixed( amtOfDec ) + "";

   decPartString = decPartString.substring( 1 );

   result = result + addCommas( intPartString ) + decPartString;

   result

}

keyframes control with layer markers

$
0
0

Hello,

 

I have an animation of a line that has two sets of keyframes of two different properties in CS4.

Basically a line gets generated in the first phase then it gets cleared out in the second phase.

This is done using two slider controls that act on the horizontal size of two rectangles and using merge paths (using the second rectangle as a matte for the first to clear it out)

 

I've put two layer markers on my layer hoping to link the keyframes to each of them.

 

Then I have found this script on the web and I put it on the first property :

 

L= thisComp.layer("ShapeLayer");

n = 0;

if (L.marker.numKeys > 0){

n = L.marker.nearestKey(time).index;

if (L.marker.key(n).time > time){

n--;

}

}if (n == 0){

valueAtTime(0);

}else{

t = time - L.marker.key(n).time;

valueAtTime(t)

}

 

This indeed lets me move the whole animation with the layermarker (which is very good) but I can't find a way to link the second set of keyframes to do the output.

I will add a link with the project file: WeTransfer

 

Please help!

Thanks

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!

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

After Effects Universal Expressions

$
0
0

1. What are universal expressions?

  • I want examples of applications of universal expressions and how to identify non-universal expressions.


  • When my project use non-universal expressions, I can use a plugin called "ExpressionUniversalizer 2" to support all languages.

2. But there's another way to get the result of transforming the non-universal expressions in universal without use the plugin?

 

Please provide me all possible details.

 

I need to create a template that uses expressions and need that the template supports all languages.

 

Thanks!


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

Trigger sound from Expression

$
0
0

Hi, is it possible to trigger a sound in the project folder using expressions?

 

eg:

 

PlaySound('ding.wav');

 

Thanks

I can't change color of layers.

$
0
0

I downloaded a After Effects template once I open it says

 

Expression for this project has an error.
In the '03 light' putting together a second layer of ('shapes') 'color' (line 1),
named in the class 'effect' 'color' not exist or is missing from a property or method.

 

and i can't change color of layers.

I have a windows 8 pc 64bit and I'm using the latest version of Ae.
Please help me!

Avoid typing the same string into several expressions

$
0
0

Let's say have some camera parameters in Comp01 linked to other parameters in Comp01Main.

 

For example:

Point of interest of Comp01 camera has this expression:

comp('Comp01Main').layer("Camera01").transform.pointOfInterest

and the Y Rotation:

comp("Comp01Main").layer("Camera01").transform.yRotation

and so on...

 

What should I do to avoid typing the phrase "Comp01Main" for each of these expressions? How can I set up a controller to easily change the text "Comp01Main" into "Comp02Main" (for example) without going into each one and make the change?

 

I tried to insert the text "Comp01Main" into the Source Text parameter of a TextLayer and then change these expressions to:

 

var a = thisComp.layer("TextLayer").text.sourceText;

comp(a).layer("Camera01").transform.pointOfInterest

 

var a = thisComp.layer("TextLayer").text.sourceText;

comp(a).layer("Camera01").transform.yRotation

 

and so on...

But it doesn't work.

 

Any ideas?

If X happens during certain time period, do Y

$
0
0

Hi!

 

I'm trying to create an expression that would have the following logic:

-Check if layer myLayer is positioned over a certain area in the composition when playhead is at frame 50

-If true, permanently set opacity of layer revealedLayer to 100%

 

Is that kind of logic possible in AE? My trouble is that I can't figure out how to se the opacity change to be permanent. In the code I have the opacity stays at 100 only as long as myLayer is still positioned over the trigger area:

 

if(thisComp.layer("myLayer").transform.position[0]>910 && thisComp.layer("myLayer").transform.position[0]<940 && thisComp.layer("myLayer").transform.position[1]>460 && thisComp.layer("myLayer").transform.position[1]<490) 100 else 0

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

Track nested child layer's position

$
0
0

Hi,

 

I have a Main Comp with a layer named 'Controller'.I have several 2d layers parented to this controller.

Now,i need to precompose two of them.let's say this precomposition of these two layers is named 'precomp 1'.

How can i parent these two layers in the 'precomp1' to the 'Controller' in the Main Comp again via Expression?

 

Dan,any ideas?


Access property of a subcomp through expressions.

$
0
0

I got a main composition. It got a subcomposition and a null-object(with a control checkbox).

How can I access a layers opacity in the subcomposition throught an expression in the main composition?

The goal would be to reuse the subcomp. Once with a layer visible and another time without.

 

So far I wrote this in the control checkbox:

if(value == 1)

{

comp("subcomp").layer("xy").opacity =100 ;

 

}

else

{

comp("subcomp").layer("xy").opacity =0 ;

}

 

 

I tried also to write an expression directly in the going to be hidden layers opacity:

 

var control  = comp("maincomp").layer("control");

100*control.effect(1).param("SliderControl").valueAtTime(control.time);

 

This actually worked when I toggled the control checkbox manually, but as soon I keyed it, it didnt work anymore.

It was kind of a time conversion problem: It takes the time of the parent but applies it to the subcomp……

 

Thanks for help

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

Replace text from external source expression from AE CS6 not working in AE CC

$
0
0

We have used some expressions in an AE CS6 project to fill text from an external file. Here's an example:

 

try{

/* "mypath" must be absolute to data file */

myPath = "file:////nynfile1/Production/Egg/Marque/data.txt";

$.evalFile(myPath);

/* Use [0,1,2] for array offset value(Name, Date, Time)*/

eval(thisComp.name)[0];

}catch(err){

/* Display if data error found*/

"text not found";

}

 

 

It works fine in CS6. When we open the file in AE CC, the expressions can't find the data.txt file to pull text from. All we get is the "text not found" error. We stepped through debug and the data.txt file doesn't open/isn't found.

 

What up with that?

Creating a number counter that counts in increments of .05 in After Effects.

$
0
0

I need to create a number counter that counts in increments of .05 in After Effects.  Any advice on how to do this?

 

Many thanks!

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

Viewing all 47983 articles
Browse latest View live


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