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

seperate XYZ error / ae_force_english.txt

$
0
0

Hi together, would be nice if anybody can help out.

 

I'm using AE CC with ae_force_english.txt and I'm recieving the error trying so seperate XYZ from an emitter.

 

"Error at line 1 in property 'Position' of layer 8 ('EmitterRadioSFX') in comp 'Main'. Function effect is undefined."

 

This is really confusing me cause normaly/in past I did'nt had trouble with seperate XYZ ...

 

Error_XYZ_trennen.jpg

 

Would be aprecicated if anobody can help me out there! Thanks in advance.


Using valueAtTime syntax problem?

$
0
0

Hi guys

 

I want to follow position of current layer "cardio.ai" but with a delay.

 

This code currently works:

 

tempX = transform.position[0];

tempY = thisComp.layer("cardio.ai").transform.position[1];

[tempX, tempY]

 

But if I do this:

tempX = transform.position[0];

tempY = thisComp.layer("cardio.ai").transform.position[1].valueAtTime(time -1);

[tempX, tempY]

 

it will not work.

 

I may be having problems with the API or syntax but I am just learning this and can't figure out what's going on.

 

Thanks

Add a delay to an expression

$
0
0

So I have an expression that controls the opacity something along the lines of

 

if(other layer >50) opacity(100) else opacity(0)

 

is there a way I could stick a delay in the else part of my expression. Logically I want the opacity to go to 0 but i want it to wait a second before it does. Would it be something like

 

else opacity(0) delay(.1)

 

i don't want to delay the whole expression just the part that makes the opacity go to 0

 

any help would be great

Time Remap expression not working when targeting parent.parent comp.

$
0
0

I created a character rig and I'm trying to set it up so most of the keyframing is done on the main comp instead of the sub comps. Most of the body is set up in the main comp except the head which is in its own sub comp. In this Head_Comp, i have two more sub comps, SideHead_Comp, and FrontHead_Comp. In both of these comp i have the head base, eyes, eyebrows, mouth, etc.   The mouth is in its own comp set to time remap from the head comps.

 

Quick Breakdown:

Body_Comp

          > Head Comp

                         >FrontHead_Comp

                         >SideHead_Comp

                                        >Mouth_Comp

 

What I'm trying to do is be able to animate the mouth comp from the main body comp. I've done this with the eyes and eyebrows using dummy objects on the main comp, but when I try to "parent" the time remap of the mouth comp from each of the head comps to a slider in the body comp, nothing happens. The mouth comp will take the current position of the of the slider value and that's it, it won't change if I move the slider around. I'm doing it this way to avoid having a bunch of different copies of the head comps when I'm animating different scenes. I'm not exactly sure what I'm doing wrong.

 

Here is the expression I used.

a=comp("Diane - AE Rig").layer("Body_CTL").effect("Mouth_Control")("Slider")

framesToTime(a)

 

I've tried different expressions, but all it does is change to the current value and thats it. It won't move when I move the slider.

 

Thanks for any help.

After Effects Expressions

$
0
0

Hey. I'm looking for a solution to an issue I have... And I don't know any javascript, so I can't find it. Can you help me, please?   So tell me if this is possible. Variable "a" equals "time", while variable "b" reaches value 100. And "time" is a constant number. In other words, simply find value of "time" when "b=100" and then assign this value to "a".

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?

Dynamic layer width based on width of text layer

$
0
0

Hello,

 

I'm making a lower third in After Effects. I am planning to use them as templates in Premiere.

What I am trying to reach is: when the text on the bar is longer then the bar itself, the bar should get longer on the right.

 

Does someone know how to do this? First I was thinking to do something with Expressions. But I'm not sure.

 

Any help would be appreciated

 

If you need more info, or if you want to let me explain this in more detail, let me know.

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.


AE CS6: Render glitches with timeremap expressions

$
0
0

Version:

11.0

 

OS:

Mac 10.7.4

 

Source Footage:

.ai files

 

Problem:

 

First of all, we've been using this method for character animation since AE 7.0.  We have had minor glitches here and there, but nothing consistent enough to a real problem.  We're currently using CS5.5, and considering the CS6 upgrade.

 

I am filing an official bug report for this, but am curious if anyone else is experiencing this.  I don't want to share my project here as it's for a TV show in production.

 

Starting with CS6, we're experiencing random, arbitary render glitches all over the place.  Our character comps are generally two comps deep.  Meaning in the character comp, we have timeremapped comps for sequences of eyes, eyebrows, mouths, etc.  Inside those comps, there is a lot more going on than just an image sequence.  We have mesh warp keyframes and other stuff.

 

All of this is controlled by various expressions that link everything to some simple master controls.  I'm sure this sounds familiar -- it's very similar to the method used in these tutorials, but not even as complex.

 

As for the glitches, they are hard to pin down.  There are different glitches depending on whether the character is continually reasterized in the scene or not, which comp we're in, etc.  Really random.  The problem is resolved by proxying those precomps (the eyes, mouths, etc) with prerendered sequences.  This is an OK workaround for most cases, but we can't depend on it.

 

Thanks for any help.  In the meantime we'll be sticking with 5.5.

 

Bryan

Parsing number text string to numeric value

$
0
0

If I have the number "5" as a text layer, how can I get another text layer to read that number, and then add another number to it?

 

This gives me "56". I want "11".

 

temp = thisComp.layer("5").text.sourceText.value;

(temp + 6)

Expression Get Project Path or Name

$
0
0

Hi,

 

I am new to After Effects as in I have just seen it for the first time today!

 

What I'd like to know is, is it possible to write an expression to return either the current project name or file path?

 

I'm assuming no as I cannot find any reference to this in the language reference. How would I go about integrating a script with the project to return the project name?

 

I have tried something basic like:

 

Expression code:

 

var currpath = $.evalFile(filepath);

 

filepath is the path to my script file, the script is like the below:

 

GetPath()

 

function GetPath() {

 

return app.project.name;

}

 

With this I get an error similar to method name 'Global' not found - not at my work computer so can't remember the exact message.

 

Any help would be appreciated.

 

Thanks,

 

Mark

Tracking puppet pin tool with null object track(HELP)

$
0
0

I'm trying to track my puppet pin tool to a null object.

 

I am using the code

 

n=thisComp.layer("NullObject_Name");
nullpos=n.toComp(anchorPoint);
fromComp(nullpos);

 

But ever time I assign the name of the null obect tp the puppet pin (eg. hair_bottom_left0)

 

n=thisComp.layer("hair_bottom_left0");
nullpos=n.toComp(anchorPoint);
fromComp(nullpos);

 

The pin tracks a different position and not the null object.

 

How do I get the pin to track to the null object I assigned it too?

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?

aftereffects expression BUG. cannot compare the values of 2 sliders???????

$
0
0

so do this:

make a new comp with a new solid.

add 2 slider effects to the layer.

add an expression to the Opacity of the solid, add this tot he expression:

 

// begin expression

if(effect("slider_01")("Slider") == effect("slider_02")("Slider")){

100

}else{

0

}

// end expression

 

then try setting the values of the sliders to be exactly the same. IF they are exactly the same, the solid should be visible.

they NEVER evaluate as true. Which means this is a bug, no?

Storing and Calling Array Values

$
0
0

Hey folks, I've got a complex expressions project whose ultimate purpose is to position a large number of layers in a grid, and then move each layer to a unique point on the grid depending on a number of animating factors.

 

In the course of creating this project, I find myself wanting to take advantage of a kind of array function I'm used to from some programming languages, but I'm not sure if it's available in AE or javascript.  In short, I'm used to an array where you could do the following (please ignore the syntax, as I realize that AE uses brackets for a different purpose, which we'll get to in a moment):

 

CREATE array(100)

 

array(1) = 4.5

array(2) = 6.2

array(3) = 1.2

 

...etc.  These values could be inserted into the "array" (which is really more like a spreadsheet than an AE array as far as I can tell) arbitrarily, and then called.  As in, you could add array(1) + array(2) and get 10.7.

 

So in a sense, the difference between this function and an AE array is it has one "dependent" variable, whereas the AE array behaves like a matrix, where all the values are independent.

 

Please note that this is not a question about creating values in an expression which persist across time.  This whole array is created and called within one frame.  I'm merely wondering if it's possible to essentially create a "list" type variable.

 

Cheers,

Ari


how to parent a layer on a negative x,y position value ?

$
0
0

Hey there i have a composition with 2 text layers on it one is scaled -100 on the y  axis to get a reflection effect

and i added a wiggle expression to the the upper layer and i want the reflection layer to have the same moment as the upper layer  but on a negative x,y direction.

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

Set inPoint with expression?

$
0
0

Hi,

 

Is there some way to set the in and out points of a layer in an expression?

 

thisLayer.inPoint seems to be read-only...

 

Thanks,

 

S

Syntax Error on Mac

$
0
0

I am trying to use the following expression:

 

Math.sin(time * effect(“Speed”)(“Slider”)) * 45

I got the expression from this tutorial:  AFTER EFFECTS TUTORIAL - Animate Butterfly / Bird - YouTube

I've not worked with expressions before... but some Googling showed several folks running into the issue of this not working on a Mac.


Can anyone offer any advice?  Thanks!

Expression for determining number of effects on a layer?

$
0
0

Hi,

 

I'm trying to write an expression that takes into account the number of effects a targeted layer has.  In a perfect world, it would be nice to get a count of only certain effects (ex: how many Slider Controls are applied)... but I'd rather start basic and work my way up to that (if it can be done at all).


So... has anyone done anything like this before / can this be done?

 

~pemling

 

Oh, and I'm using (as of today, at least) the most current version of AE: 13.2.0.49

Viewing all 47983 articles
Browse latest View live


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