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

Creating a loop with the linear function

Participant ,
Sep 20, 2018 Sep 20, 2018

Copy link to clipboard

Copied

Hi everyone!

How can I use the linear function to create a looping motion? So I can control the length of multiple loops in multiple compositions with just one slider value?

I've tried using the modulus operator as:

linear(time, time%1, time%2, 100, 50);

But I can't get this working.

How Is this easiest achieved? 

TOPICS
Expressions

Views

1.9K

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

Mentor , Sep 21, 2018 Sep 21, 2018

This should do the trick:

linstart = effect("Einstellungen für Schieberegler")("Schieberegler");

linduration = effect("Einstellungen für Schieberegler 2")("Schieberegler");

linend = linstart + linduration;

loop = time%linend;

x = linear(loop, linstart, linend, 100, 50);

[x, value[1]];

Moves an object in x-coordinate from 100 to 50, starting at the value in seconds of the first slider, with the duration of the value in seconds of the second slider and repeating this over and over again. If you set up s

...

Votes

Translate

Translate
Community Expert ,
Sep 20, 2018 Sep 20, 2018

Copy link to clipboard

Copied

What is it you're trying to loop exactly? More what you're trying to do rather than how you're trying to do it.

Dan

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 ,
Sep 20, 2018 Sep 20, 2018

Copy link to clipboard

Copied

Hey Dan!

I'm trying to create a loop out of a Y position animation on one layer. That same movement should then be applied to other compositions.

Do you understand?

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
Community Expert ,
Sep 20, 2018 Sep 20, 2018

Copy link to clipboard

Copied

Not really. Sorry.

Dan

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
Mentor ,
Sep 21, 2018 Sep 21, 2018

Copy link to clipboard

Copied

This should do the trick:

linstart = effect("Einstellungen für Schieberegler")("Schieberegler");

linduration = effect("Einstellungen für Schieberegler 2")("Schieberegler");

linend = linstart + linduration;

loop = time%linend;

x = linear(loop, linstart, linend, 100, 50);

[x, value[1]];

Moves an object in x-coordinate from 100 to 50, starting at the value in seconds of the first slider, with the duration of the value in seconds of the second slider and repeating this over and over again. If you set up slider 1 to 0, the movement is repeated right after it ends. If you set it up to 2, there is a 2 second break between the movements.

Cheers,

Martin

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 ,
Sep 22, 2018 Sep 22, 2018

Copy link to clipboard

Copied

LATEST

Of course I can't drive the entire animation with the time value. This solves so much for me - exactly what I was looking for.

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
Community Expert ,
Sep 22, 2018 Sep 22, 2018

Copy link to clipboard

Copied

If you want a loop where you want to dynamically control which time-span of a keyframed property should be looped, you can use the loop expression from iExpressions and simply link the "custom start frame" and "custom end frame" to two sliders to control which region should be keyframed.

loop_ui.png

You have to purchase iExpressions, but the loop iExpression is in the Movement Modifier Bundle which is just $9.99.

Cheers,

Mathias

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects

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