Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Reference and pauze to Comps frame or marker in other comp

  • Reference and pauze to Comps frame or marker in other comp

    Posted by Bas V breugel on April 5, 2018 at 9:27 am

    Hi guys,

    I find this diffecult to explain, so I recorded my screen to get what I’m trying to solve.

    So, if you would enter ‘ARG’ for position 1 in the “1_RACING_INPUT” comp, it would show the Argentinian flag, freezed on that frame.

    textLayer = comp("1_RACING_INPUT").layer("01_country");

    str1 = thisLayer.name.split("flag")[1];
    str2 = textLayer.text.sourceText;
    str1 = str1.toUpperCase();
    str2 = str2.toUpperCase();

    if (str1 == str2) { goto marker in comp("flag") and pauze

    Is that doable?

    Hammers Nail replied 8 years, 1 month ago 2 Members · 5 Replies
  • 5 Replies
  • Hammers Nail

    April 5, 2018 at 10:14 am

    Why would you use markers? You have a timecode already. Make all the flags one second long and precomp in one sequence, then in main comp select that flag precomp and go to Time->Freeze Frame, and add your expression to the Time Remap channel (you should see a square key there now). Basically your expression should generate static second/frame number based on text you enter.

    if (str1 == str2) a = 1; // this will display flag that is visible at 00:01:00 .. if your flags are frame long, then divide a with framerate, like a/25
    a;

    Nh

  • Bas V breugel

    April 5, 2018 at 11:23 am

    Hi Neil, thanks for your time! You are right that the flag comp now links to the time where is the flag.

    But its not driven by the text input. I guess somewhere AE needs to know that ARG equals 7 (00:07:00)

  • Hammers Nail

    April 5, 2018 at 11:38 pm

    you are right – my code is just replacement of the last line in your code.. blend those, add more values for other flags.

    Nh

  • Bas V breugel

    April 6, 2018 at 7:22 am

    Aah something more like this I guess?

    textLayer = comp("1_RACING_INPUT").layer("01_country");

    str1 = textLayer.text.sourceText;
    str1 = str1.toUpperCase();

    if (str1 == 'ARG') stopFrame = 90;
    if (str1 == 'BRA') stopFrame = 100;
    if (str1 == 'USA') stopFrame = 112;
    t = Math.min(time,framesToTime(stopFrame));

    Only it gives AE the expression error, orange bar.

  • Hammers Nail

    April 6, 2018 at 12:39 pm

    This works for me.

    textLayer = thisComp.layer("01_country");
    str1 = textLayer.text.sourceText; str1 = str1.toUpperCase();
    if (str1 == 'ARG') ss = 90;
    if (str1 == 'BRA') ss = 100;
    if (str1 == 'USA') ss = 112;
    else ss = 0; // or else you will get warning message and expression gets disabled. I'd leave this frame empty in the flags precomp.
    framesToTime(ss); // you are after a static frame, right? if animation, like flag wave, is needed, then approach will be different.

    Nh

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