3 Replies Latest reply on Feb 5, 2012 11:59 AM by Mylenium

    getting current time from the main comp timeline

    ronin71

      Please excuse the crude diagram below - it's late and I can't think of a better method to explain my question:

       

       

      COMP_A made from multiple copies of COMP_B staggered in time:

       

      ---------------------------------------------------------------------------

      COMP_A ||||||||||||||||||||||||||||||||||||||||||||||||||||||

       

      COMP_B

                  COMP_B

                               COMP_B

                                            COMP_B

      ---------------------------------------------------------------------------

       

       

      Inside COMP_B is a text layer that needs to show the current time of COMP_A as the animation plays

       

      The (old school) Flash equivalent would be a movieclip instance reading the _root._currentframe or _parent._currentframe

       

      thanks and greatly appreciated!

        • 1. Re: getting current time from the main comp timeline
          Mylenium Most Valuable Participant

          Won't work. Comp B will always be Comp B. There's no way to decouple/ convert instances like you would in Flash or adress individual items inside symbols. You'd have to inflate your expression code to dynamically figure out which instance of Comp B is currently visible and even when you do, this would change the text in all other instances as well. That may ultimately not be relevant for final rendering, but it sure will be confusing while working. That is to say you need to rethink the whole structure of your project. Possibly the simple solution would be to put your text in a Comp C, then compine it with your staggered comps B in a Comp D and only use comp D inside Comp A. Otherwise consider using effects like Numbers to get the time and render it onto the layer immediately rather composing it from a text layer.

           

          Mylenium

          1 person found this helpful
          • 2. Re: getting current time from the main comp timeline
            ronin71 Level 1

            Mylenium,

             

            Thanks for the clarification ..as dissapointing as it is...

             

            Is there some technical reason why such a behaviour is not avaliable in Ae?

             

            Thanks Again, R

            • 3. Re: getting current time from the main comp timeline
              Mylenium Most Valuable Participant

              Simply put, all expressions are sandboxed inside their property stream. There is no global evaluation. Each expression is only aware of its own little universe and the things you tell it outside of that by referencing other property streams, but can read them only, not modify them. Expressions are always subordinates of the properties they are applied to, the properties are tied to the layers, and those layers are children of the comes. It's a fixed hierarchy which you cannot bypass and it mostly goes with how AE's rendering pipeline works and thus requires specific structures...

               

              Mylenium