ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Have multiple values output in source text

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Søren Nowakowski
Have multiple values output in source text
on Nov 24, 2016 at 11:44:55 am

Hey yall.

I'm trying to create a HUD inspired by Terminator 2. There's this massive amount of random data mumbo jumbo, like random numbers constantly changing and such.
I have exactly 1 text layer, on which I would like to make 10 lines of random numbers that constantly changes. On the effects control tab of this text layer I have 10 sliders lined up, each with a random default value, and each with a wiggle expression (to generate constant changing). On the source text of my text layer, I set up variables like:

l1 = effect("Line 1")("Slider");
l2 = effect("Line 2")("Slider");
and so on.

I'm trying to achieve multiple outputs, so that every line is on its own. So I tried going:

l1 + "\r" + l2 + "\r" + l3 and so on. But it doesn't work. Gives me a syntax error.

I need a push in the right direction. Do any of you guys know how to achieve this within one text layer? (if it's even possible).


Return to posts index

Yahor Hayeuski
Re: Have multiple values output in source text
on Nov 24, 2016 at 1:26:47 pm

Hi,
l1 = effect("Line 1")("Slider").value;
l2 = effect("Line 1")("Slider").value;
l3 = effect("Line 1")("Slider").value;

l1 + "\r" + l2 + "\r" + l3;

Put .value after "slider". This works for me.


Return to posts index

Søren Nowakowski
Re: Have multiple values output in source text
on Nov 25, 2016 at 1:57:24 pm

Wonderful, worked like a charm ?

Now, why does this work? :)


Return to posts index


Yahor Hayeuski
Re: Have multiple values output in source text
on Nov 25, 2016 at 3:05:49 pm

So any property that you "link" is not just a simple number or value. It's an object, that have a lot of methods and attributes, like value, number of keyframes, property index and so on. And you can get all this info from an object (from link thisComp.layer.effect.bla-bla-bla). Basically in almost all situations it's normal to put just a link to an object and everything will work fine. But when we work with Source Text it doesn't. Don't know why, it's a hidden magic. So we need to put .value to the end of a link, it tells the program that we need to work exactly with the value of the object (not with ID, not with keyframes).


Return to posts index

Søren Nowakowski
Re: Have multiple values output in source text
on Nov 25, 2016 at 3:10:05 pm

Hmmm, I see...

Thanks for the explanation :)


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]