Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Have multiple values output in source text

  • Have multiple values output in source text

    Posted by Søren Nowakowski on November 24, 2016 at 11:44 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).

    Søren Nowakowski replied 9 years, 8 months ago 2 Members · 4 Replies
  • 4 Replies
  • Yahor Hayeuski

    November 24, 2016 at 1:26 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.

  • Søren Nowakowski

    November 25, 2016 at 1:57 pm

    Wonderful, worked like a charm ?

    Now, why does this work? 🙂

  • Yahor Hayeuski

    November 25, 2016 at 3:05 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).

  • Søren Nowakowski

    November 25, 2016 at 3:10 pm

    Hmmm, I see…

    Thanks for the explanation 🙂

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy