Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects Expressions – variables

  • Expressions – variables

  • DeathWolf

    May 24, 2005 at 4:13 pm

    Hello all,

    I was wondering if anyone would see a decent way to do global variables for expressions,
    as in expressions that can be used in multiple compositions, essentially strings/values

    Also, is there any way to make the content of a text layer dependant on a text var?
    i’ve always wanted to do dynamic text via expressions but i yet have to find how to do it.

    Thanks for any help,

    Paul-Kenji Cahier

  • DeathWolf

    May 24, 2005 at 4:15 pm

    arg, real sorry for the double post, stupid thing said “could not connect to db” so i assumed it had not posted

  • Filip Vandueren

    May 24, 2005 at 6:18 pm

    You can always assign an expression to an expression-controller like a slider on a null,
    then other expression reference that slider, and they will get the calulated value.
    There is no way to set the value of the slider from outside of that slider’s expression, so you can have the expression for opacity store a value in a slider.
    So you have to think the other way around, and do all calculations in the sliders’ expression.

    As per the text-expressions, you can assign an expression to the source-text value of a text-layer, if the outcome of that expression is a number or more importantly a string, it will be displayed.
    You can do this for an invisible text-layer and have another layer reference that value. Also, you can store different texts in different keyframes and then retrieve the values of those keys.

    What exactly do you want to achieve, because this is just theoretical and very general, there may be other ways around your problem.

  • DeathWolf

    May 24, 2005 at 7:13 pm

    well all of this was pretty general
    and about sliders, i dont think they can be used cross comp(which was my question)
    but i might be wrong

    about text, what is the name of the variable that controls the text?

  • Filip Vandueren

    May 24, 2005 at 7:39 pm

    You can reference them no problem, it gives a syntax like this:

    comp("Comp 2").layer("Null 1").effect("Slider Control")("Slider")

    the parameter you want for text is called “Source Text” or “text.sourceText” in Javascript

    Twirl open the Text layer, then Text and it’s the first param you see right befor path options.

Viewing 1 - 5 of 5 posts

Log in to reply.

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