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

How to delay opacity following another layer

$
0
0

Hello All.

 

I have 100+ layers that I would like to fade on in a delayed fashion following the manual opacity key frames set in a 'master' layer. Thus, each of the 100+ layers will incrementally fade on by half a second — after the 'master' layer has faded in.

 

My research has led me to this expression:

 

thisComp.layer("leader").transform.opacity.valueAtTime(time-thisComp.frameDuration)

 

however the above fades in all 100+ layers simultaneously. I'd like the layers to fade in one after the other.

 

 

Can anyone suggest the script to make this happen please?


How do I add a 3D wiggle expression to a seamless loop expression in After Effects?

$
0
0

I am using this xyz wiggle expression for several layer (each layer having slightly different integers to have different movement.

 

 

a =wiggle(0.2,150);

b =wiggle(0.15,160);

c = wiggle(0.2,500);

[a[0],b[1],c[2]]

 

But I want to make it a seamless loop. I found another expression that does this, but it is not in 3d space.

 

freq = 1;
amp = 110;
loopTime = 3;
//this will be changed to 6 seconds
t = time % loopTime;
wiggle1 = wiggle(freq, amp, 1, 0.5, t);
wiggle2 = wiggle(freq, amp, 1, 0.5, t - loopTime);
linear(t, 0, loopTime, wiggle1, wiggle2)

 

How can I merge the expression?

I use a common expression and get an error. Why?

$
0
0

Hey!

Hope someone can help a little or a lot!?!?

I am not into expressions at all and that might explain why i dont see the "misstake(?)" myself here but maybe you do.

 

I copy an expression code from several tutorials and get an error.When i change it a bit the function i want mainly works. But i still can´t use all of the trick because i get a 2nd problem (which might be because of the 1st??).

  • ok so here is the tutorial i watched, for example:

e.d.Films Tutorial: Rigging Multi-Layered Characters - Lesson 01 - YouTube

 

  • this is the code from the tutorial which does not work with me. ("kopf" is the name of my null obejct layer)

n=thizsComp.layer("kopf") nullpos=n.toComp(n.anchorPoint¬); fromComp(nullpos);

 

  • this is a little different code form a similar tutorial:

L =thisComp.layer("kopf"); value+L.toComp(L.anchorPoint);

 

Insteadt I use a different expression which is made by after effects automaticly when i do the following: pressing alt and clicking the clock, pulling the spiral thing to the position of the null object. if i pull the spiral to the entire null object i get an other error too.

  • my code which seems to work till now:

thisComp.layer("kopf").transform.position

So i dont understand why everyone has these n= and l= things everywhere to begin with. after effects seems to have a problem with that or writes it different it self...?? i dont know. this confused me.

 

  • this is the error (german):

After effects warnung: expression wurde augrund eines fehlers deaktiviert.

Fehler in Zeile 1 in Eigenschaft „position“ von ebene 10 (´kopfhals´) in komposition ´kopfhalsnase´. erwartet: ;.

 

 

the 2nd problem i get in the following is :

after i pined the subject, created null objects and connected them to the pins i connect the nullobjects with eachother via the spirals. it kind of works but every point of the subject gets now totaly distored and jumps somewhere randmomly...

This does not happen in any of the tutorials... why, how???

 

hope you understand me, know exactly what to do and tell me...   I could get screenshots in case i was very ununderstandable...

thanks

Expression to randomly change position of layer on grid.

$
0
0

Hello,


I would like an expression to randomly affect the position of a layer on a grid, like the example on Dan Ebberts website (Mastering Expressions, Pushing The Limits: Random Motion). However, instead of moving along a path from point A to point B, I would like the layer to jump from point A to point B (with no path in between) over 1 frame. The layer would then hold on that grid space for 5-10 frames before jumping to another grid space, and so on.

 

Having the ability to control the number of layers on the grid by way of a slider would also be very useful.

 

Please help, very stressed!

Fade audio with expressions

$
0
0

Ok, I've taken an epxression for automactically fading opacity (which worked wonderfully) and tried to modify it to fade audio the same way.  Now, I get an error that says "After Effects warning: Expression Disabled. Error at line 0 in property....  expression result must be of dimension 2 not 1."

 

Here is the tweaked expression:

 

fadeTime = 30;

audio.audioLevelsMin = -50;

audio.audioLevelsMax = 0;

layerDuration = outPoint - inPoint;

singleFrame = thisComp.frameDuration;

 

animateIn = linear(time, inPoint, (inPoint + framesToTime(fadeTime)), audio.audioLevelsMin, audio.audioLevelsMax);

animateOut = linear(time, (outPoint - framesToTime(fadeTime+1)), (outPoint-singleFrame), audio.audioLevelsMax, audio.audioLevelsMin);

 

if(time < (layerDuration/2+inPoint)){

animateIn;

}else{

animateOut;

}

 

Now, opacity is a linear, 1 dimensional characteristic.  Why did that work and the updated expression for audio cause an error?

Expression-Link two check-box controls but inverted, so on/off off/on...

$
0
0

Hi, I have a checkbox control on a layer and linked the opacity to it so off = 0% and on = 100%, I've done the same on different layer, however I now want to link that checkbox to the original layers' checkbox and invert it so if one layer is switched on, the other is off, and vice-versa. What expression do I need to apply to the second layers' checkbox control?

Expression that links layer A position to layer B time remap frame number

$
0
0

Hey all,

 

I am wondering if anyone can help with an expression that will move the position of one layer( character's arm) to a SPECIFIC spot when the time remap position of another layer (the body) is at a particular frame.

 

So the body of the character is a pre-comp that has been time remapped. When the time remap is at 0000 the body is straight ahead. When the time remap is at 0001, the body has turned 45 degrees to the left. At 00002, the body has turned 90 degrees to the left and so on. All up the body has 8 different positions.

 

I am trying to find an expression that will move the anchor point position of the two ARM layers (i.e. the shoulder) automatically to a predetermined position. So for example, when time remap of BODY layer is 0001, the X,Y position of the LEFT ARM layer is, say, 400.0, 612.0 and the RIGHT ARM layer is, say, 200.0, 300.0

 

I hope this makes sense.

 

Thanks!

Rob

expresiones para opacidad sin variaciones

$
0
0

buenos días a todos. espero puedan ayudarme con esta duda.

no se mucho de after effects, así que tratare de ser específico.

lo que intento hacer es trabajar con la opacidad del espectro de audio.

usando la amplitud de audio(la que se genera convirtiendo el audio en fotogramas clave), lo que quiero hacer es que de acuerdo a la variación de la amplitud de audio quiero que la opacidad vaya desde 0 a 100, pero lo que hace es variar entre 0 y 100. yo quiero que solo se mueva de esos dos puntos 0 y 100. para que cuando el audio suene la opacidad vaya al 100 y cuando no haya nada o casi nada desaparezca.

espero me puedan comprender. lo e intentado con wiggle pero solo hace variaciones.

saludos y gracias por responder.

 

[Moved from After Effects to After Effects Expresssions - MOD]


Adapting this Cursor Expression

$
0
0

Calling for help!!

 

I have this great cursor expression that simulates a type on effect with blinking cursor:

 

     L = text.sourceText.length;

     It = time - thisLayer.inPoint;

     T = It*effect("Speed")("Slider")  -   effect("Start After")("Slider")*effect("Speed")("Slider");

     F = Math.round( It % 1 );

 

 

     if(F==1 | (T<L & T>0) ){Fl="|";}else{Fl="";}

 

 

substr(0,T) + Fl

 

However, I need the cursor colour to be not grey like the text but colour value #2196F3, and also made bolder if possible. Is anyone able to help me adjust the code to make this happen?

 

Many Thanks!

Mike Brookes

mikebrookes.tv

Can't get expression to work on shape layer when text box right aligned

$
0
0

Hi,

I have created a text box AE Text template (aecap) where the text layer is right aligned, like this:

nedehoyreanimert-ae.PNG

 

 

 

In addition, a transparent box (shape layer) is scripted to update itself based on the length of the text box, by the use of this expression in a BG shape layer

 

BG1 > Contents > Rectangle 1 > Rectangle Path 1 > Size:

 

ymargin = 36;

xmargin = 18;

anchorX = 28;

 

text_width = thisComp.layer("Text on tw    ").sourceRectAtTime().width;

text_height = thisComp.layer("Text on tw    ").sourceRectAtTime().height;

 

box_width = text_width + anchorX + xmargin;///2;

box_height = text_height + ymargin;

 

[box_width, box_height]

 

 

BG1 > Contents > Rectangle 1 > Rectangle Path 1 > Position:

 

x = content("Rectangle 1").content("Rectangle Path 1").size/2;

 

 

 

BG1 Tranform > anchor point:

 

anchorX = 18;

x = Math.abs(thisComp.layer("Tekstinnhold").sourceRectAtTime().left) + anchorX;

y  = 18;

[x, y]

 

The problem is when I use less than 10 characters, the box is displaced:

nedehoyreanimert-ae-5letter-notworking.PNG

 

I would also like to ask if it is possible to have the text box start at the botton right and expand upwards if I increase the text box and allow more than two lines?

opacity of an image 0 or 100 tied to voice volume keyframes?

$
0
0

This is probably going to be stupidly easy, but I'm relatively new to AE, and I'm stumped.

 

So what I'm trying to do is make a little speaker symbol (similar to what you see in your taskbar) that reacts to audio.
For the quieter stuff, only one bar becomes visible, and for the louder/max stuff two/all three become visible.

 

And I mostly have it. But the different bars have a range of opacity. I just want them on/off within that range.

 

For example, the opacity of this .png is pick-whipped to a slider on the audio track. The slider has this expression on it: linear(value,2.6,4.9,0,100)

 

Works pretty good, but the opacity needs to be an on/off kind of thing, and not a 0-100% kind of thing.

 

Here's a screenshot:

Imgur: The most awesome images on the Internet

 

I've been trying to learn some if/then expressions, some checkbox stuff, and some 0 else 100 stuff... but correctly implementing any of them for this specific task has, so far, been unsuccessful.

 

Thank you for your help.

 

Message was edited by: derick white, typos

Limit value scale value using expression.

$
0
0

I'm using wiggle to scale a layer and I really only want it to wiggle  the scale in the positive direction (>100)
I looked into using an "if/else" statement, but AE always error-ed out.

 

This is what I'm using to wiggle the scale.

 

 

 

x=wiggle(effect("XTIME")("Slider"),effect("XDistance")("Slider"));

y=wiggle(effect("XTIME")("Slider"),effect("XDistance")("Slider"));

 

[x[0],y[0]]

 

I tried inserting this line of code, but it always error-ed

 

if (transform.scale[0] < 100) 100.2 else transform.scale[0]

 

Is it a syntax issue or am I just way off track. ANd I'm sure it's probably a really easy answer......

 

thanx in advance for your help

 

best,

 

Fred

Text Source Link (FONT?)

$
0
0

Good day!

 

Starting to make a client friendly project, I wanted it to make it easy for him to change text with a control comp.

When trying to change the source text the actual texts changes, that's good! But when changing the source text font the actual text layer changes the text but not the font. Any way there is a solution to this problem so I can make easier templates for clients? This can be by scrips or any other way. I really want to fix this problem.

 

Thanks in advance.

David

 

See printscreen. jpeg example.png

How to use Expression to Mask Path vertices

$
0
0

Hi guys,

In Expression Language Reference(https://helpx.adobe.com/after-effects/using/expression-language-reference.html), I find an method called "points()";

 

and there is an example like:

  • Example 2

The example reads the coordinates of the first vertex of Mask 1 on Dark Gray Solid 1 and converts them to composition coordinates. Apply this to a 2D point control of an effect, such as Write-on or CC Particle Systems II, to make the effect trace or track the first point of an animated mask. Duplicate the effect and change the path points index value ([0]) to trace or track the other points of the mask.

myLayer = thisComp.layer(2);
myLayer.toComp(myLayer.mask("Mask 1").maskPath.points()[0]);

emm...

but when I try this, I get en error message saied:

points() method is undefined.....

So I confused about points() method,

 

Help with write on text with curser using an expression

$
0
0

Hi There,

 

I have text writing on with a cursor using this TUT: AE Tut'z - How to Create a Type-Text Effect with a Blinking Cursor - YouTube

 

L = text.sourceText.length;
T = time*effect("Speed")("Slider") -effect("Start At")("Slider")* effect("Speed")("Slider");
F = Math.round(time % 1);

if(F == 1 | (T<L & T>0)){Fl = "▇";}else{Fl=" ";}

substr(0,T) + Fl

 

 

Questions:

 

1.

How would I double the speed of the cursor blink?

Have tried 0.5 under time and the if statement (and tried 2) but then the cursor doesn't show at all.

 

2.

How can I make the cursor start on, then blink?

Currently it starts off but it should be on to start. I tried swapping the cursor "▇"in the if/else statement but then the cursor doesn't show while the text types on (as expected).

 

 

Pretty green when it comes to this stuff so any help or pointers in the right direction would be juch appreciated.

 

Cheers

 

Ben


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

counting numbers expression with commas

$
0
0

I am using the following expression to create a number countdown but I need it to recognize or insert commas in eight digit numbers. Can anyone tell me how to alter it:

 

 

startT = 0;

endT = .5;

beginVal = 12400000;

endVal = 10700000;

t = linear(time,startT,endT,beginVal,endVal);

Math.floor(t) + ''

 

 

P.S. there are also times that I'd like to add dollar signs or percent signs.

Possible to set Source Text from another comp?

$
0
0

Let's say there is a Comp1 with a pretty complicated animation that involves a text layer. CompMain is the main comp with 10 instances of Comp1. Each instance has different text, position and timing. Can I set the Comp1 text layer Source Text from an expression in CompMain? If this is not possible, is there any workaround? Otherwise, the alternative would be to have 10 versions of Comp1 with different text and that would be too messy.

keyframe overshoot at the start of animation

$
0
0

I am using a keyframe overshoot expression. Starts normally and wiggles at the end. This is the code for it:

 

freq = 3;

decay = 5;

 

n = 0;

if (numKeys > 0){

  n = nearestKey(time).index;

  if (key(n).time > time) n--;

}

if (n > 0){

  t = time - key(n).time;

  amp = velocityAtTime(key(n).time - .001);

  w = freq*Math.PI*2;

  value + amp*(Math.sin(t*w)/Math.exp(decay*t)/w);

}else

  value

 

How can I reverse this expression, so that the wiggle is at the start of the animation (instead of at the end), creating sort of an expectation. Would look really cool I think. Thanks for help. I think that this already has a solution posted somewhere, but I am unsure of what to google. Thanks for help.

Multiple Expression To One Property

$
0
0

Hi everyone,

 

I have wiggle expression on rotation property of the layer with keyframes. I also want to add master Dan Ebberts' pendulum expression on the same property. Is this possible? I tried if else statement with checkbox (if checkbox =true do wiggle thing else do pendulum) but gave me error message "cannot assign value because it is read only". By the way this layer is Duik's controller and parented to zero object. Is there a way to do it?

 

Thanks.

Viewing all 47983 articles
Browse latest View live


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