• Global community
• Language:
• Deutsch
• English
• EspaÃ±ol
• FranÃ§ais
• PortuguÃªs
• æ—¥æœ¬èªžã‚³ãƒŸãƒ¥ãƒ‹ãƒ†ã‚£
Dedicated community for Japanese speakers
• í•œêµ­ ì»¤ë®¤ë‹ˆí‹°
Dedicated community for Korean speakers
Exit

New Here ,
Aug 01, 2024 Aug 01, 2024

Copied

Theres a simple way to link a slider to a markers?

Where the slider decimals numbers keep couting between markers numbers?

Thanks

TOPICS
Expressions , How to , Scripting

Views

135

Report

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

Community Expert , Aug 01, 2024 Aug 01, 2024

Like this, I guess:

``````m = marker;
n = 0;
if (m.numKeys > 0){
n = m.nearestKey(time).index;
if (time < m.key(n).time) n--;
}
if (n > 0 && n <m.numKeys){
linear(time,m.key(n).time,m.key(n+1).time,n,n+1);
}else{
n;
}``````

7 Replies 7
Community Expert ,
Aug 01, 2024 Aug 01, 2024

Copied

It's not clear to me what you're asking exactly, but maybe something like this:

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

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
New Here ,
Aug 01, 2024 Aug 01, 2024

Copied

Thank you for your reply Dan, and yes, i wasnt clear with my question.

The expression, is ok.

The counter started at the first marker, but they count comp seconds between markers and restarted at the second marker.

I wish the slider count first marker as 1 and second as 2 and subsequently.

Report

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

Copied

Ah, OK. That's simpler:

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

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
New Here ,
Aug 01, 2024 Aug 01, 2024

Copied

Almost there!

The numbers between 1 and 2?

Report

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

Copied

Like this, I guess:

``````m = marker;
n = 0;
if (m.numKeys > 0){
n = m.nearestKey(time).index;
if (time < m.key(n).time) n--;
}
if (n > 0 && n <m.numKeys){
linear(time,m.key(n).time,m.key(n+1).time,n,n+1);
}else{
n;
}``````

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
New Here ,
Aug 02, 2024 Aug 02, 2024

Copied

LATEST

God bless you, Dan.

Report

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

Copied

I would go with something like this:

``````m1 = thisComp.layer("Shape Layer 1").marker.key(1).time;
m2 = thisComp.layer("Shape Layer 1").marker.key(2).time;

linear(time, m1, m2, m1, m2 - m1);``````

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Resources
Troubleshooting FAQs
After Effects Community Recap
Getting started with After Effects