ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Reference and pauze to Comps frame or marker in other comp

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Bas v Breugel
Reference and pauze to Comps frame or marker in other comp
on Apr 5, 2018 at 9:27:54 am
Last Edited By Bas v Breugel on Apr 5, 2018 at 9:31:46 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?


Return to posts index

Neil Hammers
Re: Reference and pauze to Comps frame or marker in other comp
on Apr 5, 2018 at 10:14:49 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


Return to posts index

Bas v Breugel
Re: Reference and pauze to Comps frame or marker in other comp
on Apr 5, 2018 at 11:23:00 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)


Return to posts index


Neil Hammers
Re: Reference and pauze to Comps frame or marker in other comp
on Apr 5, 2018 at 11:38:47 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


Return to posts index

Bas v Breugel
Re: Reference and pauze to Comps frame or marker in other comp
on Apr 6, 2018 at 7:22:00 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.


Return to posts index

Neil Hammers
Re: Reference and pauze to Comps frame or marker in other comp
on Apr 6, 2018 at 12:39:16 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


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]