Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Expression control for Source Text Value?

  • Expression control for Source Text Value?

    Posted by Willie Frazier on February 24, 2015 at 9:07 pm

    Hello,

    I am setting up an AE toolkit for pre-render elements for a fighting promotion’s venue graphics package. Presently I am working on a Tale of the Tape graphic. To make things easier for the crew to whom I am handing this off, I have set up a control null wherein value can all be entered and adjusted in one central location.

    The values for the various categories, Age, Weight, etc, are easy enough to control via a slider control, but 2 of the stats (Height and Reach) are expressed in feet and inches, thereby needing the ‘ and ” characters, which cannot be entered via slider control… there are times when there will be partial values, like 5’6.5″ vs say 5’8″ where the spacing of the ” character needs to dynamically adjust.

    So, I put it to you, is there a way I can add some manner of expression control to my Control null that will allow the technician to easily enter this data?

    Thanks,
    – Will

    Willie Frazier replied 11 years, 2 months ago 2 Members · 5 Replies
  • 5 Replies
  • Kevin Camp

    February 24, 2015 at 10:24 pm

    you could have separate sliders for feet and inches and then use an expression like this in the source text property of the text layer to put them together:

    feet = thisComp.layer("Control Layer").effect("Feet Slider")("Slider").value;
    inches = thisComp.layer("Control Layer").effect("Inches Slider")("Slider").value;
    feet + "'" + inches + '"'

    Kevin Camp
    Art Director
    KCPQ, KZJO & KRCW

  • Willie Frazier

    February 24, 2015 at 10:48 pm

    Yeah. I could.. and I will try it. My only concern here would be maintaining consistent spacing between values. Feet will always be a single number, but inches could be as many as 4 with decimal (10.5″ for example).

  • Willie Frazier

    February 25, 2015 at 12:22 am

    Ok, I tried it exactly as written on a single source. It worked a treat! Thanks.

  • Kevin Camp

    February 25, 2015 at 12:28 am

    [Willie Frazier] “My only concern here would be maintaining consistent spacing between values.”

    i’m not entirely sure what you mean, but if you are talking about space between values as space between feet and inches, the expression isn’t adding any space it is just taking the two values, adding ‘ and ” where appropriate, then putting it into a single text layer. different values could look like this if the text is left justified:

    6’1″
    5’10.5″

    let me know if you are looking for something different.

    —— edit —–

    never mind, we were both typing at the same time….

    glad it worked

    Kevin Camp
    Art Director
    KCPQ, KZJO & KRCW

  • Willie Frazier

    February 25, 2015 at 1:00 am

    Right, yeah I originally read your first reply as needing to have separate text layers for feet and inches, each linked to its own slider control. On closer examination, I realized that was not the case.

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