Creative COW SIGN IN :: SPONSORS :: ADVERTISING :: ABOUT US :: CONTACT US :: FAQ
Creative COW's LinkedIn GroupCreative COW's Facebook PageCreative COW on TwitterCreative COW's Google+ PageCreative COW on YouTube
ADOBE AFTER EFFECTS:HomeForumBasicsExpressionsTutorialsPodcastsAE TechniquesCreative Cloud DebateFAQ

expression counting from 0% to 100% and start at 0 again.

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Share on Facebook
Sarah Schelaexpression counting from 0% to 100% and start at 0 again.
by on May 17, 2012 at 3:50:03 pm

Hello,

I looked through the forum for an answer to this question, but haven't found one.
So as it is written in the title I am looking for an expression which counts from 0% to 100% and starts at 0% all over to 100% again in a loop.

I just found this expression saying that the counter runs from 0% to 100% but then decreases to 0% and starts counting upwards to 100% again.

freq = 1;
50*(1 - Math.cos(freq*time*Math.PI*2))

so I believe there must be some kind of "if" like "if the number reaches 100 start at 0 again" or something. but I have not much experience so I hope for some advices!


Return to posts index
Reply   Like  

Kevin CampRe: expression counting from 0% to 100% and start at 0 again.
by on May 17, 2012 at 4:02:40 pm

this should do it. just set the freq value to the loop point.

freq = 1; // value in seconds
timeToFrames(time % freq) + "%"


i also added the % sign in there... if you don' need that delete the + "%".

Kevin Camp
Senior Designer
KCPQ, KMYQ & KRCW


Return to posts index
Reply   Like  

Kevin CampRe: expression counting from 0% to 100% and start at 0 again.
by on May 17, 2012 at 4:09:18 pm

i'm sorry, that really doesn't work quite right... i should test before i post.

this should do it though:

freq = 2; // value in seconds
Math.round(linear(time % freq, 0, freq, 0, 100)) + "%"


Kevin Camp
Senior Designer
KCPQ, KMYQ & KRCW


Return to posts index
Reply   Like  


Dan EbbertsRe: expression counting from 0% to 100% and start at 0 again.
by on May 17, 2012 at 4:27:22 pm

If you're just looking for something that counts from 0 to 100 and then starts over, this might work for you:

rate = 30;
Math.round((time-inPoint)*rate%101)

Set the rate to whatever makes sense for your application.

Dan



Return to posts index
Reply   Like  
+1

Sarah SchelaRe: expression counting from 0% to 100% and start at 0 again.
by on Jun 21, 2012 at 1:51:53 pm

Thanks so much! really great!


Return to posts index
Reply   Like  

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Share on Facebook


FORUMSTUTORIALSFEATURESVIDEOSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

Creative COW LinkedIn Group Creative COW Facebook Page Creative COW on Twitter
© 2014 CreativeCOW.net All rights are reserved. - Privacy Policy

[Top]