Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Adding Time offset to Marker expression

Community Beginner ,
May 24, 2021 May 24, 2021

Hello guys,

I have below expression on time-remap property which triggers transition based on the markers set on Action layer.

Is it possible to add certain frames of pre-roll to this expression?

so if the maker is set at 1 sec the transition start at 0.5 sec.

I have added n=1 so that it skips first marker as it does not require transition.

I have already tried replacing 

 

 

 

 t = m.key(n).time-0.5; or t = m.nearestkey(time+0.5).index 

 

 

 

 which for some reason does not work.

Ae file attached if that help to understand my problem.

AE File 

 

 

m = thisComp.layer("Action").marker;
n = 1;
if (m.numKeys > 1){
n = m.nearestKey(time).index;
if (m.key(n).time > time) n--;
}
if (n > 1){
t = m.key(n).time;
time - t ;
}else
0 

 

 

 

  

TOPICS
Expressions
854
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , May 24, 2021 May 24, 2021

Chances are your add/ subtract messes with the nearestKey() logic in that some keys may "flip over" to the other side and then you get wrong results if they are less than a certain time apart.

 

Mylenium

Translate
LEGEND ,
May 24, 2021 May 24, 2021

Chances are your add/ subtract messes with the nearestKey() logic in that some keys may "flip over" to the other side and then you get wrong results if they are less than a certain time apart.

 

Mylenium

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 25, 2021 May 25, 2021
LATEST

Thank a lot man !!! that works ...removing 

if (m.key(n).time > time) n--;

get the job done for me.

Final expression here 

m = thisComp.layer("Action").marker;
n = 1;
if (m.numKeys > 1){
n = m.nearestKey(time).index;
}
if (n > 1){
t = m.key(n).time-.5;
time - t ;
}else
0

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines