Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects valueAtTime with other expressions

  • valueAtTime with other expressions

    Posted by Hannes Reisinger on April 26, 2012 at 11:32 am

    Hello there!

    I’m trying to accomplish the following:
    Several text layers are linked with an expression on their position to a Null with several Sliders. The expression looks like this:
    seedRandom(thisComp.layer("random-controller").effect("RandomSeed")("Slider"),true);
    posX = random(thisComp.layer("random-controller").effect("MinOffsetX")("Slider"),thisComp.layer("random-controller").effect("MaxOffsetX")("Slider"));
    posY = random(thisComp.layer("random-controller").effect("MinOffsetY")("Slider"),thisComp.layer("random-controller").effect("MaxOffsetY")("Slider"));
    animation = thisComp.layer("random-controller").effect("PositionAnimation")("Slider");
    value = [posX,posY] + [0,animation];

    So, they are randomly positioned in X and Y and animated in Y. That works pretty well for now.

    What I now want to do is randomly place my layers in time. The valueAtTime expression seems to do this, only not with an already “expressioned” parameter. The problem seems to be that the animation itself, therefor the changing valueAtTime is not on the layer itself but on an Expression Slider.
    Anyone can help me here?
    Thanks in advance!

    Chris Mellor replied 14 years, 3 months ago 2 Members · 1 Reply
  • 1 Reply
  • Chris Mellor

    April 26, 2012 at 2:50 pm

    Sounds like you’re looking to randomly reference the “animation” variable throughout its time?

    if so, define what you want your “timeOffset” to be, using another random() and re-write your last line as:
    value = [posX,posY] + [0,animation.valueAtTime(time-timeOffset)];
    I have been doing this in a project I am working on now, and it works for me. Hope it helps.

    -Chris

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