4 Replies Latest reply on Sep 8, 2012 8:39 AM by Rick Gerard

    Expression to Read Timecode of main / outer comp

    Asaf Billet

      I have a video with some User Interface animations.

      I want to include a time code (reader effect) on all the instances of that GUI,

       

      BUT... I don't want it to read its own comp's TC (beacuse this would be 00:01 and going...),

      It should read the main / outside comp. So whenever you see the time code, it's in sync

      with the real time.

       

      Is there an expression that can pull this off ?

       

      cheers

      Billet

        • 1. Re: Expression to Read Timecode of main / outer comp
          Mylenium Most Valuable Participant

          Simply add/substract the in-point of the layer and possibly the comp start time in the main comp to the normal time property:

           

          time+comp("Main").layer("XYZ").inPoint+comp("Main").displayStartTime
          

           

          Mylenium

          • 2. Re: Expression to Read Timecode of main / outer comp
            Asaf Billet Level 1

            thanks Mylenium

            as always with expressions, I'm a bit baffled..

             

            So the main comp is "main", obviously.

            XYZ is the comp that holds the TC effect.

            Does it matter how deep is the nesting ?

             

            ALSO,

            to which property in "Numbers" I assign the expression ?

             

            cheers

            • 3. Re: Expression to Read Timecode of main / outer comp
              parkerwyoung

              I really appreciate this, I had about 20 different variations of this and couldn't get any to work. Thank you!

              • 4. Re: Expression to Read Timecode of main / outer comp
                Rick Gerard Adobe Community Professional & MVP

                I'm not sure I understand what you're asking. If your main comp is called MainComp and one of the layers is a composition that contains the GUI elements and that comp is called GUI Comp, and you want to display the running time of the main comp then simply add a text layer to the Main Comp and add this expression to the Source Text property of the text layer. (to make this look good pick a monospaced font).

                 

                timeToNTSCTimecode(t = time + thisComp.displayStartTime, ntscDropFrame = true)
                

                 

                You'll find the code in the General category expression method menu avaailable in the timeline window by clicking on the little circle with an arrowhead icon next to the expressions.

                 

                To make the timecode read a different comp's timecode simply point to that composition by modifying the expression like this:

                 

                newTime = time - thisComp.layer("GUI Comp").inPoint
                timeToNTSCTimecode(t = newTime + thisComp.displayStartTime, ntscDropFrame = true)
                

                 

                If you have video that was shot with timecode then you can capture that timecode by selecting Use Media Source in the Time Display Style section of your project settings. You would then just put the name of the video layer where the GUI Comp is in the newTime = definition of the expression.

                 

                If your project isn't ntsc time code then delete the ntscDropFrame = true

                 

                That should do it.