7 Replies Latest reply on Jul 1, 2009 2:12 PM by Philnolan_3d

    Repeating a keyframe

    Philnolan_3d Level 1

      I need to make a layer's opacity flicker on and off.  If I were doing this in LightWave 3D I would set a frame to 100%, then the next frame to 0% and set the 2nd frames post behavior to "repeat".  Is there a way to do this in AfterFX?  Thanks.

        • 1. Re: Repeating a keyframe
          Mylenium Most Valuable Participant

          You do it with expressions applied to the property:





          1 person found this helpful
          • 2. Re: Repeating a keyframe
            Philnolan_3d Level 1

            Hmm great, I got into art to avoid code.  So I've figured out where to enter that and I pasted it in after transform.opacity but it gave me an error about expecting a semi-colon.  So I put one in at the end and it still gave the error.  Any ideas?

            • 3. Re: Repeating a keyframe
              Adolfo Rozenfeld Adobe Employee

              It will work if you just add the needed colon after transform.opacity., ie transform.opacity.loopOut("cycle")


              But in this kind of case, it will also work if you just overwrite transform.opacity and just type in loopOut("cycle")


              I got into art to avoid code

              Just learning a few snippets which you don't even need to understand fully, would be very convenient. Better to type a short line than repeating dozens of keyframes, right? There are many other examples of this.

              Understanding them fully would raise your creative possibilities by a factor of 10, IMO, and can be really fun. Even the least math-oriented guy (for example, myself) can become an expression junkie when seeing what they can do for your projects.


              There's a book out on After Effects Expressions, which I feel does a good job in introducing them to all kind of users.

              • 4. Re: Repeating a keyframe
                Philnolan_3d Level 1

                Well I tried it with and without the transform.opacity part and get no more error, but it also doesn't flicker.  Here's a screenshot, I don't know if it tells you anything (I did want 0-56%, that's not a mistake):




                As for reading a book on expressions, no offense but it sounds like it would be great for the aspirin industry.


                Edit: OK I've got the flicker now.  Somehow the key that was supposed to be 0% was also set to 56% so obviously a loop between 56% and 56% wouldn't show anything.  Thanks.

                • 5. Re: Repeating a keyframe
                  Adolfo Rozenfeld Adobe Employee

                  If you want to get a more realistic flicker, you may want to turn both keyframes into hold keyframes (select both keyframes, right click > Toggle Hold). Normally, flickering is about something turning on and off, rather than fading in and out.

                  • 6. Re: Repeating a keyframe
                    Rick Gerard Adobe Community Professional & MVP

                    If you want to go from 0% to 56% then 0% then 56% and so on smoothly you'll need 3 keyframes.


                    If you're ok with a gradual change from 0% to 56% then a jump to 0% you can go with 2.


                    Three keyframes create a wave, two create a zig zag with sharp corners.

                    1 person found this helpful
                    • 7. Re: Repeating a keyframe
                      Philnolan_3d Level 1

                      It looks like this works fine for me.  You can see the propeller on my plane flickering here:



                      You're right though, thanks.