Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Triggering precomp animation via property (rotation, opacity, etc.)

  • Triggering precomp animation via property (rotation, opacity, etc.)

    Posted by Emil Stefanow on July 31, 2019 at 4:43 pm

    Hi folks,

    Dan Ebberts’ expression about triggering animations in precomps using markers is awesome and quite useful.
    I’d like to ask though is it possible to trigger the animation in the precomp by “asking” for a property of the precomp in the main comp.

    Let’s say I have animated the precomp: it rotates by 90 degrees from Frame 30 to frame 60.
    In the precomp itself I have a square which changes shape/color/size from frame 30 to 50. Marker “myAnim” is at frame 30 in the precomp. From frame 51 to 61 some minor scaling animation happens. The marker at frame 51 is “myAnim2”.

    I would like to tweak the expression by saying:

    If the precomp reaches 10° rotation the precomp should play from marker “myAnim”.
    If the precomp reaches 80° rotation the precomp should play from marker “myAnim2”

    So it’s basically the Dan Ebberts expression but instead of using same-name triggers in the main comp I use the data from the precomp properties.

    Is it possible?
    Thanks so much!

    Best regards
    Emil

    Emil Stefanow replied 6 years, 9 months ago 1 Member · 1 Reply
  • 1 Reply
  • Emil Stefanow

    August 19, 2019 at 1:56 pm

    Hey folks…

    Okay, a bit weird answering my own question but I found a solution by Dan Ebberts! it is not 100% as a wished but rather 99% ????

    Since I use sampleImage and a precomp/mask for the scaling animation, the idea with the sampleimage came in great and handy! Thank you Dan!!!

    The solution is from this topic:
    https://forums.creativecow.net/docs/forums/post.php?forumid=227&postid=22329&univpostid=22329&pview=t

    Cheers
    Emil

    L = thisComp.layer("sampleLayer_A");
    threshold = 0.00001;
    trig = false;
    ss = [width,height]/2;
    for (f = timeToFrames(); f >= 0; f--){
    t = framesToTime(f);
    v = L.sampleImage(L.fromComp(toComp(anchorPoint,t),t),ss,true,t)[3];
    if (trig && (v < threshold)) break;
    if (v >= threshold) trig = true;
    }
    t = trig ? time - framesToTime(f+1) : 0;

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