Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions graph style color change and position change

  • graph style color change and position change

    Posted by Andy Engelkemier on June 20, 2011 at 6:25 pm

    I’ve got 9 bars where I want a few lines to travel up and down and change to red at the top and green at the bottom.

    I created a null object [index 1] for all of my controls.

    each indicator bar has a ColorBalance HLS, so I could script on the Hue section. It ended up being simple calculations, so I got lucky there.

    I create these expressions, but was hoping there might be a better way, like being able to do it by making the slider name equal to the layer name or something so I could just duplicate the layer?

    For now I have to rename each expression.
    Notice in the example, “height 9” is the slider which goes from 0-100

    Is there a way to do this so I don’t have to go through and change the expression on each layer manually?

    Note: I’m asking this for Learning purposes only. I’m just trying to learn new things so in the future I can create things in more efficient ways, and maybe help a few other people with similar issues. I know this might be dumb for only 9 layers, so give me a break just this once forum troll.
    Thanks

    example for height bar #9 of 9
    ________________________________
    Expression: Hue
    control = thisComp.layer("controls").effect("height 9")("Slider");
    -1 * control;

    Expression: Position
    X = transform.position[0];
    timesMe = 2.9 ;
    control = thisComp.layer("controls").effect("height 9")("Slider");
    Y = transform.position[1] + 1*-( control *timesMe );
    [X,Y];

    Andy Engelkemier replied 15 years, 2 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    June 20, 2011 at 7:40 pm

    If you make the bar layer names the same as the control names, you should be able to just do this:

    control = thisComp.layer(“controls”).effect(name)(“Slider”);

    Dan

  • Andy Engelkemier

    June 20, 2011 at 7:50 pm

    Thanks Dan.

    I knew it was something simple like that which I just didn’t know.

    That would have saved me some time had I known that sooner.
    I’m going to go back and edit that portion tomorrow just to ensure it sinks in for next time.

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