Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions calendar using expressions

  • calendar using expressions

    Posted by Olly Bea on July 19, 2005 at 12:02 pm

    Hey y’all

    OK, i’ve got a problem you can get your teeth into…

    I am trying to make a year-long calendar count up the days and the months… this part is fairly simple (I have made it using a solid layer and the numbers effect, which counts up the days over a period of about 18 seconds)… however and here is where it gets complicated; I need a day counter which runs alongside the calendar (i.e. counts up the days incrementally) which counts from day one up to a maximum of 180 days, but it could appear anywhere throughout the year.

    I am not sure how to do it, it think it may be expressions but I am fairly new to this ‘game’ so could you take me through it nice and slow, or do you have any other ideas?

    Cheers

    Olly

    Filip Vandueren replied 20 years, 10 months ago 2 Members · 4 Replies
  • 4 Replies
  • Filip Vandueren

    July 19, 2005 at 1:22 pm

    Hi,

    Your date is controlled by a slider in the Numbers Effect.
    We can use that value to calculate the days passed since a given day:

    Make a new text-layer and give it’s “Source Text” property this expression:

    dateValue=thisComp.layer("Layer with Numbers effect").effect("Numbers")(4); // change the layerName
    startValue=3675; // the Slider-value at which you want the day counter to be 1
    days=180; // number of days you want to count
    
    dayCounter=linear(dateValue, startValue-1, startValue+days,0, days)
    

    if you don’t want the value 0 to be visible untill the counter actually starts running through he days,
    add these next lines:

    if (dayCounter>0) {
    	dayCounter;
    } else {
    	""
    }
  • Olly Bea

    July 19, 2005 at 4:06 pm

    A highly complicated expression, although I am having a problem.

    AE is saying;

    After Effects warning: Expected: ;.
    Error occurred at line 1.
    Expression disabled.

    Can you shine any light on this?

    Cheers

    Olly

  • Filip Vandueren

    July 19, 2005 at 8:11 pm

    Did you rename the Layer-name in the first line ?

    Probably something went wrong there, maybe the quotes around the name were not closed correctly.

    Oh,

    and there’s another error in my script (the yellow is the missing bit):

    it should be:

    dayCounter=linear(dateValue, startValue-1, startValue+days-1,0, days)

  • Filip Vandueren

    July 19, 2005 at 9:14 pm

    Oh,

    and don’t copy-paste it from your e-mail,
    go to the website and you’ll see that it looks different: I put some HTML tags in there (all the >code< -stuff )
    to layout it a bit, but in the e-mail they show up in the text, and they’re not supposed to be in the expression

    that’s prob. what went wrong.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy