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

loopOut is not a function

New Here ,
Feb 08, 2021 Feb 08, 2021

When I use expression loopOut() I always see error "loopOut() is not a function". I tried to use different variants of syntaxes but it didn't help.

I saw some advices here but they didn't work too.

Irina5F96_0-1612807514495.png

 

I use Mac OS Big Sur 11 and 17.6.0 After Effects

TOPICS
Error or problem , Expressions
20.1K
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

New Here , Mar 12, 2024 Mar 12, 2024

I Had the same problem today and I realised you have to use de entire expression not just "LoopOut("offset")" like some tutorials tells us to do. You Have to use like this:

loopOutDuration(type = "offset", duration = 0)

 

Translate
Community Expert ,
Feb 08, 2021 Feb 08, 2021

loopOut() doesn't work for paths. Try this workaround:

if (numKeys > 1 && time > key(numKeys).time){
  t1 = key(1).time;
  t2 = key(numKeys).time;
  span = t2 - t1;
  delta = time - t2;
  t = delta%span;
  valueAtTime(t1 + t);
}else
  value
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
Guest
Jul 28, 2021 Jul 28, 2021

It works flawlessly 😄

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
New Here ,
Feb 07, 2022 Feb 07, 2022

This works perfect. Even for eased keyframes 😄

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
New Here ,
Dec 18, 2024 Dec 18, 2024
LATEST

Prefect

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 Expert ,
Feb 08, 2021 Feb 08, 2021

The loopOut() function works on properties that have a numeric value. The values can be in an array. Vector paths require a different approach.

 

The approach is to look at the number of keyframes and then use valueAtTime()

 

For a simple seamless loop, the first and last keyframes must be identical so copy the first keyframe and paste it at the end. This is the simplest approach to that problem:

 

valueAtTime(time % key(numKeys).time)

Edit: Just saw Dan's solution. It's a lot more typing and it has the advantage of not throwing an error if there is only one keyframe.

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 ,
Aug 01, 2021 Aug 01, 2021

Any chance there's a way to trick things into working like loopOut("pingpong")? 🙂

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 Expert ,
Aug 01, 2021 Aug 01, 2021

That would be like this:

if (numKeys > 1 && time > key(numKeys).time){
  t1 = key(1).time;
  t2 = key(numKeys).time;
  span = t2 - t1;
  delta = time - t2;
  seg = Math.floor(delta/span);
  t = delta%span;
  valueAtTime((seg%2) ? (t1 + t) : (t2 - t));
}else
  value
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
New Here ,
Sep 27, 2022 Sep 27, 2022

Hi,

I am wondering how do I target this only on specific keyframe(s), like how the in and out under loop function and numKeyframes are doing? Thanks!

Really apprciate your contribution of that code

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
New Here ,
Mar 12, 2024 Mar 12, 2024

I Had the same problem today and I realised you have to use de entire expression not just "LoopOut("offset")" like some tutorials tells us to do. You Have to use like this:

loopOutDuration(type = "offset", duration = 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