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

Rotate Something Every 10 Seconds

New Here ,
Dec 28, 2021 Dec 28, 2021

I would like to rotate something, every 10 seconds and every Each rotate has a duration of 2 seconds. How do I add the 10 sec variable to a loop expression? I assume AE can do this, I'd prefer not to keyframe it. Thank You For Help.

TOPICS
Expressions , How to , Scripting
965
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 ,
Dec 28, 2021 Dec 28, 2021

How much are you rotating each time? Is it cumulative, or does it start over each time? Does the 10 seconds include the 2 seconds?

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 29, 2021 Dec 29, 2021

Rotate once or twice at a time, not including ten seconds. That is, after 10 seconds, the object rotates for two seconds or one second. Could I get what I mean?

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 ,
Dec 29, 2021 Dec 29, 2021
LATEST

I don't think this is exactly what you're asking for, but it might get you started. No keyframes required.

holdTime = 10;
rotateTime = 2;

period = holdTime+rotateTime;
t = (time - inPoint)%period;
startVal = Math.floor((time - inPoint)/period)*360;
linear(t,holdTime,period,startVal,startVal + 360)
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 ,
Dec 29, 2021 Dec 29, 2021

You need to animate the rotation with at least 2 keyframes. Then use this expression in the rotation parameter

 

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

 

The vale 10 will represent when the cycle will repeat (every 10 seconds). Offset will continue the rotation in an additive way. If you want the cycle to repeat form the start change "offset" for "cycle"

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