FORUMS: list search recent posts

marker name in the expression

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
daniele zacchi
marker name in the expression
on Feb 15, 2018 at 1:38:39 pm

Hi guys,

I am trying to make an automatic animation data driven (from layers called "val ++").

and then i want to animate this property with the markers time and a simple ease() operator, but it looks that I cant name my markers with a variable...

what am I doing wrong in this?

Many Thanks

Daniele

n= 0;
if (marker.numKeys > 0){
n = marker.nearestKey(time).index;
if (marker.key(n).time > time){
n--;
}
};

prev = n+1;

next = n+2;
K1 = String.valueOf(prev);
K2 = String.valueOf(next);

Val1 = thisComp.layer("val "+prev).text.sourceText;
Val2 = thisComp.layer("val "+next).text.sourceText;

T1 = parseInt(Val1.split(' '));

T2 = parseInt(Val2.split(' '));

U = marker.key(K1).time;

B = marker.key(K2).time;

TT = ease(time, U, B, T1, T2);


[TT, TT]


Return to posts index

Andrei Popa
Re: marker name in the expression
on Feb 15, 2018 at 5:50:51 pm

I tried your expression and found 2 flaws to it. It said that K1 is a function and it needed a number on line 22, and got out of reach for either markers or layers. So i modified it a bit. Tell me if it works, or what does'nt work, in case something is wrong. This is what i got
n= 0;
if (marker.numKeys > 0){
n = marker.nearestKey(time).index;
if (marker.key(n).time > time){
n--;
}
};

prev = n;

next = (n>=marker.numKeys) ? marker.numKeys : (n+1);
K1 = prev;
K2 =next;

Val1 = thisComp.layer("val "+prev.toString()).text.sourceText;
Val2 = thisComp.layer("val "+next.toString()).text.sourceText;

T1 = parseInt(Val1.split(' '));

T2 = parseInt(Val2.split(' '));

U = marker.key(K1).time;

B = marker.key(K2).time;

TT = ease(time, U, B, T1, T2);


[TT, TT]


Andrei
My Envato portfolio.


Return to posts index

daniele zacchi
Re: marker name in the expression
on Feb 16, 2018 at 10:36:09 am

Wow!
It works very well.

Thanks a lot Andrei!

Daniele


Return to posts index

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