1 Reply Latest reply on Nov 19, 2015 6:03 AM by Rick Gerard

    Place images side by side + change layer source ?

    gpolaroid

      i'm trying to do the following with a large amount of chronologically named images:

      - duplicate a layer

      - shift it to the right by the amount of its width

      - change its layer source so the image is the next in the sequence:

      [1] [2] [3] [4]


      So the first image is called "IMG_1.jpg", the next "IMG_2.jpg" etc.


      So far, I found a way to shift the duplicated layer to the right using this expression:


      thisComp.layer(index+1).transform.position+width


      Now I only need a way to also set the layer source to count +1, in a way like this:

      source.name=IMG_'+1'.jpg


      Is there any way to do this? Thanks for your help.


        • 1. Re: Place images side by side + change layer source ?
          Rick Gerard Adobe Community Professional & MVP

          To replace a layer with another source you Select the layer in the timeline, then Select the new source in the Project Panel, then hold down the Alt/Option key and drag the replacement layer from the Project Panel to the timeline and release the mouse button. All you have to do is get the replacement layer anywhere in the timeline and it will replace the selected layer and take on all of the layer's properties.

           

          There is no way to automatically do this with an expression, but you could write a script that would replace all of your layers at once.

           

          This info in available and more explanation is offered if you type "replace footage in timeline" in the Search Help field at the top right corner of AE

           

          I would probably approach this problem by selecting all of the images in the Project panel then select New Composition from Selected, then select Single composition, then use the Align Panel to line up the images, then animate the first image and parent the rest of the images to that one.

           

          An even better option may be to create a layered Photoshop or Illustrator file with all of the elements lined up, import as a comp and then use the parenting trick.

           

          If you need to offset the animations so things move one layer at a time then I would animate the first layer, create an animation preset, then move the CTI to the start time of the next layer and apply the animation preset.

           

          Hope this helps.