Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Expression to label work area

  • Expression to label work area

    Posted by Antony Dupsta on September 15, 2022 at 1:50 am

    I have a generic 500 frame comp. However I have a specific frame range or “work area” for specific shots. I want to do a text overlay that labels the frame range based on the work area of that specific comp. The text layer that will say frame 10-200 lives in comp A and the frame range ‘work area” which is set to 10-200 actually will be based off of comp B.

    I should simply be able to parent an expression across comps.

    Let me know if you can help me with this frame range expression. Thanks so much

    Antony Dupsta replied 1 year, 2 months ago 2 Members · 9 Replies
  • 9 Replies
  • Dan Ebberts

    September 15, 2022 at 6:34 am

    Expressions don’t have access to work area info. Scripting does, but with a script you’d have to run it every time you need it to update. There may not be a good solution.

  • Antony Dupsta

    September 16, 2022 at 8:26 pm

    What if I set a marker for in and a marker for out. Could and expression determine the frame range between two points?

    Or a solid that is a duration, I can drag the solid or Null and the frame range will update to how long this guide layer is and update the window burn. This may be easier than clicking into the text later and manually changing it.

  • Dan Ebberts

    September 16, 2022 at 9:17 pm

    If you had comp markers in Comp B marking the start and end times, a text expression like this in Comp A would display the current frame (within the range – blank if not in the range). I’m not sure that’s what you’re asking, but it might get you close:

    m = comp("Comp B").marker;
    txt = "";
    if (m.numKeys > 1){
    t1 = m.key(1).time;
    t2 = m.key(2).time;
    if (time >= t1 && time <= t2){
    txt = timeToFrames(time);
    }
    }
    txt
  • Dan Ebberts

    September 16, 2022 at 10:45 pm

    Or, maybe you always want to display the range defined by the Comp B markers with something like this:

    m = comp("Comp B").marker;
    t1txt = m.numKeys > 0 ? timeToFrames(m.key(1).time) : "??";
    t2txt = m.numKeys > 1 ? timeToFrames(m.key(2).time) : "??";
    t1txt + "-" + t2txt
  • Antony Dupsta

    September 18, 2022 at 9:45 pm

    Hi Dan, thanks for your help.

    So this second one is soo close, it is able to display the frame range marker 01 – marker 02 as a window burn as hopped. Yea.

    However, it overrides what the composition’s start frame is. For example if Comp B start frame is 900 -1200. The frame range that is displayed with this expression is 0-300. It sees the markers display is based on AE’s default 0 frame start rather than what comp B’s frame is set to.

    so close.

    To take a step back, I am needing an automated way to display a window burn that displays the range of the markers, or maybe a guide layer. So you can read the frame range of the seq as an overlay, not the current frame, the frame range. For example 900-1200. This will hopefully be automated with an expression so we are not typing in the frame range for each seq. We are not able to use the frame range of the comp though, as that stays as a large fixed duration and the work area is set inside the fixed comp length to create the sub duration. 900-1200

    If you have any other insight to help that would be much appreciated.

    Thanks so much.

  • Dan Ebberts

    September 19, 2022 at 1:22 am

    See if this helps:

    c = comp("Comp B");
    m = c.marker;
    d = c.displayStartTime;
    t1txt = m.numKeys > 0 ? timeToFrames(d + m.key(1).time) : "??";
    t2txt = m.numKeys > 1 ? timeToFrames(d + m.key(2).time) : "??";
    t1txt + "-" + t2txt
  • Antony Dupsta

    September 19, 2022 at 3:58 am

    Dan, this worked perfect,

    You are so amazing, thanks you so much.

    I feel terrible to ask you to help modify this wonderful expression to be even more specific. If Possible?

    In your expression you identify marker 01 and marker 02.

    This is perfect I can make this work. But I was going to get greedy here?

    Instead of d + m.key (2) .time Is there anyway to instead of saying (2)

    You are able to code it to say “last marker” so if we have markers for the handle in edit in, edit out handle out, I was curious if there are 3 markers or 2 or 4 or 5, I can simply know that the last marker will alway be the end of the duration regardless of the other markers in-between?

    Man I feel like I should just be quite as I wear out my welcome here, but if you are able to help identify the “last marker” as the end of the duration, we are golden. If not, I can make sure there is only ever two for sake of uniformity. Thanks again.

  • Dan Ebberts

    September 19, 2022 at 4:50 am

    Like this:

    c = comp("Comp B");
    m = c.marker;
    d = c.displayStartTime;
    t1txt = m.numKeys > 0 ? timeToFrames(d + m.key(1).time) : "??";
    t2txt = m.numKeys > 1 ? timeToFrames(d + m.key(m.numKeys).time) : "??";
    t1txt + "-" + t2txt
  • Antony Dupsta

    September 19, 2022 at 5:21 pm

    Dan, you are a wizard.

    Can I say how much I appreciate your time helping me and I know others who have inquired about this, helping them too as they read this thread.

    Can I pay you or buy something from you?

    A Monetary Expression for AE expressions!

    Thank you so much. You are brilliant.

    Have a great week!

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