Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Controlling an animation/expression with markers

  • Controlling an animation/expression with markers

    Posted by Nick Kennedy on July 3, 2017 at 5:25 pm

    This is my first deep dive into expressions. I’m trying to create a Rig for an election Graphic bar Graph (for the upandcoming German election, thats why some of my expresion controllers are in German). So far so good, in Comp 6 the percentage result can be entered in the first expression slider Erg.CDU/CSU, this controls the size of the 1st bar(“balken 1-1”). The key frames on the scale go from o to 100%. The expression on the scale

    x= transform.scale[0]+thisComp.layer("Graph Controler").effect("Balken Breite")("Slider");
    y = transform.scale[1]*thisComp.layer("Graph Controler").effect("1. Balken")("Layer").transform.scale[1]/50;
    z = transform.scale[2]+thisComp.layer("Graph Controler").effect("Balken Tiefe")("Slider");
    [x,y,z];

    gets the value correctly but now I would like to trigger the keyframes on “balken 1-1” with a marker in Comp 7
    and I’m really stuck I need to keep the original expression which controls the y scale of the bar. At first I thought I could use an if expression but thats about as far as I got. Hope I’ve made myself undersandable! Any help would be much appreciated. And when I get it sorted out I’ll share the project with anyone needing election graphics. Many thanks in advance,

    nick

    x= transform.scale[0]+thisComp.layer("Graph Controler").effect("Balken Breite")("Slider");
    y = transform.scale[1]*thisComp.layer("Graph Controler").effect("1. Balken")("Layer").transform.scale[1]/50;
    z = transform.scale[2]+thisComp.layer("Graph Controler").effect("Balken Tiefe")("Slider");
    [x,y,z];

    Nick Kennedy replied 8 years, 10 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    July 3, 2017 at 6:35 pm

    I haven’t test this (so watch for typos), but I think it would be something like this:

    m = comp(“Comp 7”).layer(thisComp.name).marker;
    t = Math.max(0,time – m.key(1).time);
    val = valueAtTime(key(1).time+t);

    x= val[0]+thisComp.layer(“Graph Controler”).effect(“Balken Breite”)(“Slider”);
    y = val[1]*thisComp.layer(“Graph Controler”).effect(“1. Balken”)(“Layer”).transform.scale[1]/50;
    z = val[2].scale[2]+thisComp.layer(“Graph Controler”).effect(“Balken Tiefe”)(“Slider”);
    [x,y,z];

    Dan

  • Nick Kennedy

    July 4, 2017 at 12:19 pm

    Wow!
    Dan, many many thanks for your quick answer. This does the job just fine! And after staring at this expression for some time I think i understand whats going on. Thank you for your help. I’ve still got a few things to polish off in this project but if anyone out there would like to have a copy of the project, just let me know.
    Cheers,

    nick

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