6 Replies Latest reply on Feb 20, 2008 11:11 AM by Mylenium

    creating a "grid" or  "wall" of words

    DawnTreader777 Level 1
      I am just starting to learn a lot about expressions and their uses. I have been looking for a simple way to create an effect in one comp that I will then use inside another.

      The first effect I want to create is to take a word and duplicate it many times and have it in a different position for each duplication. Basically I want to create a "wall" of text.

      I dont want to have to create multiple layers if I dont have to. I would rather use an expression which can cause multiple copies of the one layer to appear as a sheet in the comp, where the word is offset in its position for every duplication that the expression creates.

      Further I would like to have each duplication animate separately. For the 20 seconds of my comp I have it set up that the word changes on a regular interval and I would like to have that happen for each duplicate but start at a different time. In effect what would end up happening is a wall of all the words in the layer would be displayed at a different place on the "wall" and change at differing times.

      I have tried to create this effect, but after 10 layers for parenting and 10 layers for different positions it got a little unwieldy, thus my reason for posting this question.

      I wish I had an example to point people to, but unfortunately I dont. I hope this makes sense. Please let me know your thoughts and suggestions.
        • 1. Re: creating a "grid" or  "wall" of words
          Mylenium Most Valuable Participant
          See this thread for how to create grid of rectangular layers:


          Apply the expression to one instance of the text layer, then simply duplicate it to fil lthe comp.

          Varying the timing of an animation can be done with the .valueAtTime() and random() functions, but without more detailed knowledge on the exact project setup, it's a bit like the blind leading the blind. You could apply such code to the text animators directly, but if you use multiple of them, pre-composing and using time-remapping might be easier.

          • 2. Re: creating a "grid" or  "wall" of words
            DawnTreader777 Level 1
            thats really great code. is there a way to detect the edge of a text element? the text has a couple of animations on it and one is tracking. it would be nice if i could tell it to compensate for the tracking as well as scale on each element.

            I was thinking that the first bit where you state the column space would be an ideal place to link it to the elements tracking and scale.

            Is there a way to measure the object in an expression?

            I am starting to toy with the code you gave me, but i have little experience with expressions. thanks for the help. :)
            • 3. Re: creating a "grid" or  "wall" of words
              Mylenium Most Valuable Participant
              No, text layers cannot be "measured" exactly. There is an undocumented function called sourceRectAtTime(), however, that might do some good. You'd sample the dimensions for each maximum expansion in either direction and then interpolate the values across time. Example:

              t1=0.5; //time in seconds
              t2=3; //time in seconds



              You can then enter the result of mBlend in place of the fixed dimensions. Be aware, though, that this may produce odd results and break up the grid, especailly with random timing. You'd als have to find a more elegant way of feeding times to the interpolation, preferably based on the keyframing of a master layer or markers, e.g.


              and so on. If you have a lot of keys/ markers, you will have to further automate by doing all this in loops. I recomment Dan's site motionscript.com for reference. He has multiple examples that explain the use of markers for semi-automated animation, which should give you some ideas.

              • 4. Re: creating a "grid" or  "wall" of words
                DawnTreader777 Level 1

                unfortunately i am working in Production Studio CS2. the sourceRectAtTime() give me an error.

                from what i have read around the net about it, it is a CS3 function, brand new in fact.
                • 5. Re: creating a "grid" or  "wall" of words
                  Todd_Kopriva Level 8
                  > There is an undocumented function called sourceRectAtTime()...

                  The word 'undocumented' is one of my triggers. ;-)

                  The sourceRectAtTime method doesn't work for expressions, which is why it's not documented in the expressions material. It does work for scripts.

                  If you don't mind an expression being slow, here's a link to a hack that uses the sampleImage expression method to measure a text layer:
                  • 6. Re: creating a "grid" or  "wall" of words
                    Mylenium Most Valuable Participant
                    Yes Todd, you are of course right. It's CS3 and scripts-specific. Sorry for the confusion. Maybe it's already some sort of delirium of joy from finally getting my Mac tomorrow... But then again, I've been known to write nonsense even without that. *giggle*

                    Alan, if you you're on AE7, I still recommend scouring AEnhancers.com, even though the link Todd provided won't do you any good, either (sampleImage is CS3-only as well). AE's inability to deal with text layers more elegantly has been an ongoing source of "inspiration" and one way is to auto-create a mask for the text bounding box via scripts and use these values to generate keyframes. This will work in older versions like your AE7. Just do a search along the lines of "create border around text", if I recall correctly.