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

Paus or play at current time with expression

Participant ,
Oct 16, 2022 Oct 16, 2022

Copy link to clipboard

Copied

Hi! 

I'm looking for a way to enable expression based playback that is either playing at ordinary speed using the time function OR pausing at the current time. 

This will be controlled by another layers opacity - bascially looking at if that layer has opacity 100% then pausing from current time else if layer has 0% then playback at normal speed.

 

Anyone has any ideas how to set this up?

TOPICS
Expressions

Views

97

Translate

Translate

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 guidelines

correct answers 1 Correct answer

Community Expert , Oct 16, 2022 Oct 16, 2022

Try this time remapping expression:

ctrl = thisComp.layer("Control").opacity;
f = timeToFrames(time);
accum = 0;
for (i = 0; i < f; i++){
  if (ctrl.valueAtTime(framesToTime(i)) == 0) accum++;
}
framesToTime(accum)

Votes

Translate

Translate
Community Expert ,
Oct 16, 2022 Oct 16, 2022

Copy link to clipboard

Copied

Try this time remapping expression:

ctrl = thisComp.layer("Control").opacity;
f = timeToFrames(time);
accum = 0;
for (i = 0; i < f; i++){
  if (ctrl.valueAtTime(framesToTime(i)) == 0) accum++;
}
framesToTime(accum)

Votes

Translate

Translate

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 guidelines
Participant ,
Oct 16, 2022 Oct 16, 2022

Copy link to clipboard

Copied

LATEST

Awesome Dan, as always. 

 

Wish I understood what you did, but it works, so thank you.

Votes

Translate

Translate

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 guidelines