6 Replies Latest reply on Apr 24, 2011 3:36 PM by joe bloe premiere

    Align layers in 3D space?

    joe bloe premiere Level 5


      Is there a method for aligning a newly created 3D layer
      to the 3D coordinates of an existing 3D layer?

       

      align.png

       

      I know I can use the "Center In View" [ctrl+home] command to
      align multiple 3D layers to a current 3D view, link them to a null
      to retain their relative alignment in 3D space and then
      individually manipulate each linked layer.

       

      Is this the only option for aligning 3D layers?

      If so, is there a method for aligning the current view to a 3D layer?

        • 1. Re: Align layers in 3D space?
          joe bloe premiere Level 5

          Belay my last.  I have found this is a fairly simple thing to do by
          copying and pasting the complete "Transform" branch from one
          layer to another to duplicate all position, scale, euler & quarternion
          rotation values and work from there.

           

          This method obvoiusly copies all existing keyframes as well,
          and does not seem an ideal solution for matching 3D position
          of one layer to another at a given frame.

           

          I was looking for a 3D alignment function that likely doesn't exist.
          Please correct me if I am wrong.

          • 2. Re: Align layers in 3D space?
            joe bloe premiere Level 5

            Ok.
            I can match the 3D position of a new layer to an animated layer
            at a given frame by parking on that frame, and manually
            copying and pasting one by one, all of the position/scale/
            orientation/rotation values to the new layer.

             

            If this is not an available function, is there a script?

            • 3. Re: Align layers in 3D space?
              Mylenium Most Valuable Participant

              I'm not aware that someoen ever bothered to create such a script, but it would be relatively simple. Still, I think you're going about this the wrong way. If the layers are supposed to line up at specific frames, one would animate those frames first for all layers and then create the deviations where they move separately. I suppose that's the whole point of what "non-linear animation" is about. Otherwise I would probably rig my stuff with a set of simple linear() expressions tied to sliders to "blend" between different keyframe values, but that would also depend on the kind of motion involved as keyframing the belnding may cause oddly shaped motion paths inbetween....

               

              Mylenium

              1 person found this helpful
              • 4. Re: Align layers in 3D space?
                joe bloe premiere Level 5
                ...animate those frames first for all layers and then create the deviations where they move separately.

                 

                I suppose it is my own fault for burying my original

                intent in a lengthy conversation with myself.

                 

                The question was:
                Is there a method for aligning a newly created 3D layer
                to the 3D coordinates of an existing 3D layer?

                 

                I have already created the animation, occasionally employing
                the method you suggest.  Now I am adding a new layer to the
                comp, and want to be able to align it in 3D space at a given frame
                to an already existing layer.

                 

                Parking on that frame and manually copying and pasting all of the
                position/scale/orientation/rotation values to the new layer is the
                best method I have come up with.

                 

                I realize that Ae is not 3ds Max, but I was hoping for a similar
                3D alignment function.

                 

                from 3ds Max:

                align3D.png

                • 5. Re: Align layers in 3D space?
                  Rick Gerard Adobe Community Professional & MVP

                  For scripts try here.

                  You may also want to look here.

                   

                  Both scripts have demo videos. These were the top two links from a Google search for "Align Layers After Effects Script."

                   

                  You could also create an expression control to your key layer then add this expression to the other layers you wish to align:

                   

                  ofstVal = thisComp.layer("keyLayer").effect("Slider Control")("Slider") * index; // offset value
                  sPosition = thisComp.layer("keyLayer").position; // key layer position
                  
                  x = sPosition [0];
                  y = sPosition [1];
                  z = sPosition [2] + ofstVal;
                  
                  [x, y, z]
                  
                  

                   

                  All we're doing is using the position of the KeyLayer (make sure that's the layer's name) to control the position of the other layers. By adding the value of the slider times the index or layer number of the other layers we get an offset. If you want the offset in y then just add the + ofstVal to the y variable. This will distribute the layers easily in a straight line. By adding a slider for X, Y, and Z values you can move the layers any way you want. By using some simple math like y = sPosition [1]  + Math.cos(ofstVal) * index * 3; and animating the value of the slider over time you'll get some very interesting effects.

                   

                  Reading your original question again maybe all you wanted was to match the position of the keyLayer. In that case the expression would be as simple as thisComp.layer("keyLayer").position.

                   

                  Hope this helps.

                  1 person found this helpful
                  • 6. Re: Align layers in 3D space?
                    joe bloe premiere Level 5

                    Rick,

                     

                    Thanks a lot for the links, scripts and info.