-
Composition markers to trigger in and out of a TR precomp
Hi Expressionists
I am trying to make composition markers named IN and OUT in my main comp to trigger different precomps TR property. so far the most elegant way I found is through digging in a friend’s solution which is dividing the expression in two.
here it is:
say I have in my precomp animation setup that starts from 00:00:00 – 00:02:00 and animation out starts in 00:12:00-00:14:00I apply this to the TR property:
IN= thisComp.marker.key(1).time;
OUT = thisComp.marker.key(2).time;
action=thisComp.layer(“marker index”).effect(“Maker index inOut”)(“Slider”);if (action==1) { linear(time,IN,IN+2,0,2) };
if (action==2){linear(time,OUT,OUT+2,12,14) } ;
if (action>2){[0]}
if (action==0){[0]}and in another layer I add a slider and apply this expression:
try{
action=thisComp;
n = 0;
if (action.marker.numKeys > 0){
n = action.marker.nearestKey(time).index;
if ( action.marker.key(n).time > time){
n–;
}
}n
} catch (err) {
0
}and it works. but I want something easier, maybe more elegant that I could maybe understand. try-catch is beyond me. maybe this can work with only one layer?
it’s not bad. I get the first expression, it’s the other one I want to lose or to understand ☺
the basic setup looks like this so far.
but it will get more complex, I just wanted to see I figured how to do it. now I can place any animation I want in the precomp. the purpose is to create an easy to control lower third template with a simple rig.thanks
IN= thisComp.marker.key(1).time;
OUT = thisComp.marker.key(2).time;
action=thisComp.layer("marker index").effect("Maker index inOut")("Slider");if (action==1) { linear(time,IN,IN+2,0,2) };
if (action==2){linear(time,OUT,OUT+2,12,14) } ;
if (action>2){[0]}
if (action==0){[0]}---------------second expression ------------
try{
action=thisComp;
n = 0;
if (action.marker.numKeys > 0){
n = action.marker.nearestKey(time).index;
if ( action.marker.key(n).time > time){
n--;
}
}n
} catch (err) {
0
}Roei Tzoref
2D/VFX Generalist & Instructor
♫ AeBlues Tutorials ♫
http://www.tzoref.com