Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity › Forums › Adobe After Effects Expressions › Colour and Position Values changing on a chart

  • Colour and Position Values changing on a chart

    Posted by Rob Chan on June 27, 2014 at 10:22 am

    Hi,

    Could anyone help me with a 2 folded expression please?

    I have a chart that requires animating with values between -.017 to 1

    The colours are set from a palatte as part of their brand.

    What I’d like to do is animate the chart – so that the values begin at Zero and pale grey in colour.

    Then the squares change colour depending on their value as the text increase/decrease in value

    Secondly as this happens the chart flips in perspective to this and we see that the value also make the squares go up or down in position

    Can this be done?
    Any help would be gratefully received

    Thanks
    Rob

    Rob Chan replied 12 years, 3 months ago 2 Members · 5 Replies
  • 5 Replies
  • Dan Ebberts

    June 27, 2014 at 4:32 pm

    I’m sure the numbers are all wrong and you’ll have to adjust these if they’re not for the text layer itself, but maybe something like this for color:


    v1 = -.017;
    v2 = .44;
    v3 = 1.0;

    c1 = [93,132,198,255]/255;
    c2 = [248,249,253,255]/255;
    c3 = [187,71,74,255]/255;

    val = parseFloat(text.sourceText);

    if (val > v2)
    linear(val,v2,v3,c2,c3)
    else
    linear(val,v1,v2,c1,c2)

    and something like this for position:

    v1 = -.017;
    v2 = .44;
    v3 = 1.0;

    zOffset = 100;

    val = parseFloat(text.sourceText);

    if (val > v2)
    z = linear(val,v2,v3,0,-zOffset)
    else
    z = linear(val,v1,v2,zOffset,0);

    value + [0,0,z]

    Dan

  • Rob Chan

    June 27, 2014 at 4:44 pm

    wow thanks Dan, our week is about to end here in the UK so I’ll give this a go on Monday if you don’t mind I’ll get back to you via this thread if I get stuck.

    Have a great weekend!

  • Rob Chan

    June 30, 2014 at 2:22 pm

    Hi Dan

    I’ve just pasted your expressions into the Colour Control Expression effect and Position and I get this warning message (apologies for my rudimentary level of expressions knowledge)

    property or method named ‘text’ in Class ‘global’ is missing

    I guess this is something to do with the fact the colour control is in a Layer not Text?

    Thanks
    Rob

  • Dan Ebberts

    June 30, 2014 at 4:23 pm

    Try replacing “text.sourceText” with a pick-whipped link to the text layer’s Source Text property.

    Dan

  • Rob Chan

    June 30, 2014 at 4:45 pm

    ..Thank you Dan!

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