ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Controlling an animation/expression with markers

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Nick Kennedy
Controlling an animation/expression with markers
on Jul 3, 2017 at 5:25:35 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];


Return to posts index

Dan Ebberts
Re: Controlling an animation/expression with markers
on Jul 3, 2017 at 6:35:00 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



Return to posts index

Nick Kennedy
Re: Controlling an animation/expression with markers
on Jul 4, 2017 at 12:19:21 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


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]