25 Replies Latest reply on Apr 20, 2009 2:31 PM by ptelian

    Motion Tracking an Animation

    ptelian Level 1

      I have an animated PSD in AE that I wish to track. Is there a way to do this? Or will it only track movie files?

       

      Thanks!

        • 1. Re: Motion Tracking an Animation
          TimeRemapper Level 4

          Can you go into more detail?

          If you've animated the file in After Effects, "parenting" might be a better solution.

          • 2. Re: Motion Tracking an Animation
            ptelian Level 1

            I have an animated object on a transparent background, and I wish to "attach" a video clip to it (using only the position state). That's what my issue looks like.

            • 3. Re: Motion Tracking an Animation
              TimeRemapper Level 4

              Have you tried bringing your video layer into the timeline that your animated object lives in, and "parenting" it to your animated object?


              Click here to see what the Online Help Files have to say about Parenting...

              • 4. Re: Motion Tracking an Animation
                ptelian Level 1

                Yes, but that brings over the "Rotation" element too, which I don't want. Other than that, it works.

                • 5. Re: Motion Tracking an Animation
                  TimeRemapper Level 4

                  There are a couple of ways to do that.

                   

                  -You can tie the two together using an expression on the movie's position property

                   

                  -You can duplicate your animated layer, deleting all keyframes for it's rotation, turn it's visibility off, and then parent the movie to the invisible layer

                  • 6. Re: Motion Tracking an Animation
                    ptelian Level 1

                    Thank you for the replies.

                     

                    Now when I only attach the position attribute to the movie, it goes of track because of the rotation of the animated object (which is an oblong shape).

                     

                    What I need is for the movie to attach to the tip of the object. Does this make sense?

                    • 7. Re: Motion Tracking an Animation
                      TimeRemapper Level 4

                      Can you post an example project or at least screenshot?

                      If you're going about it by way of enabling expressions on the position property of your Movie layer, you could try something like this:

                       

                      thisComp.layer("NameOfYourLayer").transform.position - [-50,-50]

                       

                      You need to replace what's in between the quotes (NameOfYourLayer) with the name of the layer in the timeline that's being animated (not the movie).

                      You can adjust the values in the brackets for an appropriate offset.

                      • 8. Re: Motion Tracking an Animation
                        ptelian Level 1

                        Here's what I've got (attached is a swf of the animation too). I left the visibility on for the duplicated layer so you can see.

                         

                         

                        Fullscreen capture 4142009 10755 PM.bmp

                        • 9. Re: Motion Tracking an Animation
                          TimeRemapper Level 4

                          I think the forum is putting a temporary hold on the .swf file, so I can't see the animation.

                          Are you trying to attach something to the tip of one of the smaller candles?

                          • 10. Re: Motion Tracking an Animation
                            Adolfo Rozenfeld Adobe Employee

                            Yes, the SWF file appears as "queued".

                            I think that, just to keep things simple (we don't want to scare people with expressions as the first solution!) the key is surely in doing exactly as Steve suggests, but offseting the video layer's anchor point before pasting keyframes. Or relocate the video layer's in space (ie, position) before defining the parent relationship. It will be more clear once we get to see the SWF file.

                            A wild gues, just with your description, would be: it seems like the video layer's anchor point should be set to the center of the oval object layer (before, pasting keyframes, select the Pan Behind tool by pressing the Y key, then move the video layer's anchor point with that tool so that it's roughly at the center of the other layer).

                            • 11. Re: Motion Tracking an Animation
                              ptelian Level 1

                              Yes, I should have mentioned that...I'm trying to attach a flickering flame onto the candle .

                              • 12. Re: Motion Tracking an Animation
                                Adolfo Rozenfeld Adobe Employee

                                In that case, you should be able to set the flickering flame so that it's located right where you want it, and only then parent the flame layer to the candle layer.

                                • 13. Re: Motion Tracking an Animation
                                  ptelian Level 1

                                  That doesn't work because the candle has rotation. As you can see, I animated the candles with their anchor point in the middle of the composition. It would work if I reanimate them with their anchor point on the wick.

                                   

                                  Fullscreen capture 4142009 33414 PM.bmp

                                  • 14. Re: Motion Tracking an Animation
                                    Adolfo Rozenfeld Adobe Employee

                                    You don't have to re-animate anything.

                                    This is a very good example of why After Effects offers two distinct methods for adjusting the anchor point.

                                    If you use Pan Behind it alters the relationship between position and anchor point. In this case, it would break your motion path. Not good.

                                    If you reveal the anchor point property in the timeline, and drag the values, you'll see the layer will be offset according to its' anchor point. Many people think this is "bad", because the layer seems to jump on screen. In reality, the only thing you're doing is change the "threading point", sort of spreak. Think of it as passing a string (motion path) through a needle's eye (the anchor point). Set it so that the anchor point is in the middle of the candle, not the middle of the Comp. Then, parent the flame to the candle.

                                    • 15. Re: Motion Tracking an Animation
                                      Adolfo Rozenfeld Adobe Employee

                                      ptelian: I especially recommend the very clear explanation in After Effects Help about Layer Anchor Points, including this great tip: If you press alt (win) or option (Mac) as you use the Pan Behind tool, you get the "threading" behavior I explained above, while keeping the convenience of on-screen adjustment.

                                      • 16. Re: Motion Tracking an Animation
                                        Mylenium Most Valuable Participant

                                        To clarify: If you select a property's keyframes while the current timel indicator is parked over a valid keyframe, scrubbing the value inputs with the mouse will increment/ decrement all other keyframe values by the same amount. So if you modify the anchor point placment, you can compensate your position values by changing their values in the opposite direction with the same amount. This should sufficiently solve your problem and allow you to parent the flames without any adjustments to them.

                                         

                                        Mylenium

                                        • 17. Re: Motion Tracking an Animation
                                          ptelian Level 1

                                          Hm. I don't seem to be able to move the anchor point independabtly of the postion. Is there a trick to this?

                                           

                                          Why is my swf file still "queued"?

                                          • 18. Re: Motion Tracking an Animation
                                            Adolfo Rozenfeld Adobe Employee

                                            ptelian: yes, you can hold alt (win) or option (mac) while you drag the anchor point with the Pan Behind tool. This will make the layer "re thread" in the motion path. Fear not, it's not changing position when doing this (if it was, the motion path itself would be altered. Note that when you alt-drag with Pan Behind, the position property's value doesn't change).

                                            And yes, sample files being queued is a frustrating aspect of the new forums. Those things will surely work better over time.

                                            • 19. Re: Motion Tracking an Animation
                                              Mylenium Most Valuable Participant

                                              ptelian wrote:

                                               

                                              Hm. I don't seem to be able to move the anchor point independabtly of the postion. Is there a trick to this?

                                               

                                              Yes, as explained, you can do so by using the pan behind tool with modifier keys. It just may create a bigger mess than numerically setting the values, if you do not place the anchor precisely enough. ;-)

                                               

                                              Mylenium

                                              • 20. Re: Motion Tracking an Animation
                                                yenaphe Level 4

                                                If you want to move your anchor point, without moving your layer at all, there is a great script from Nab. it's called RepositionAnchorPoint, and it just does that.

                                                 

                                                To run a script inside After Effects, just go to the file menu > script > run script and open the jsx file that you extracted from the zip file.

                                                 

                                                This script runs in AE7, CS3 & CS4.

                                                 

                                                Hope that helps.

                                                • 21. Re: Motion Tracking an Animation
                                                  Adolfo Rozenfeld Adobe Employee

                                                  Just to avoid confusion (hoping that I don't introoduce more in the process! ):

                                                   

                                                  You don't need a script to offset anchor point while the layer stays at the same location. That's the regular behavior for the Pan Behind tool, when you use it without modifiers. However, Pan Behind works by balancing the relationship between anchor point and postion, so the layer is actually "moving to stay still". Because of this it creates or edits position keyframes if position is already animated and will thus modify an existing motion path, which doesn't seem to be the behavior ptelian needs in this case (it would be a good idea if he did it before creating the motion path).

                                                   

                                                  The script from Nab offers a nice UI to snap anchor points to layer center, corners or edges (it also does that for mask area, which is really cool. But the script only works with square pixels!). But it behaves just like Pan Behind: the layer moves to stay still. You can get the same snapping behavior by pressing Ctrl + Shift (Win) or Cmd + Shift (Mac) while dragging with Pan Behind. This will make the anchor point snap to the edges and vertical/horizontal centers. But again, it's still Pan Behind, so it will modify an existing motion path when editing position values to neutralize the anchor point offset. Again, probably not what you want when you already have a motion path.

                                                   

                                                  When you already have a motion path, and you just want to redefine how the layer "threads" (as if one changed where the eye of the needle is, sort of speak) you want to only offset anchor point with affecting the position values. You get this by Alt (Win) or Option (Mac) dragging with Pan Behind, or by editing/dragging the anchor point values in the timeline. I suspect this is what ptelian wants to do, if he already has a motion path but the anchor point is not at the layer's center.

                                                  • 22. Re: Motion Tracking an Animation
                                                    ptelian Level 1

                                                    Sorry this is dragging out...but I don't think moving the anchor point is helping me. The anchor point actually is at the cetner of the image, as you can see by this screen grab...(I also attached the swf again to see if it will have an easier time getting ready).


                                                    The right candle is selected...

                                                    Fullscreen capture 4162009 63340 PM.bmp.jpg

                                                    • 23. Re: Motion Tracking an Animation
                                                      Rick Gerard Adobe Community Professional & MVP

                                                      I think you're thinking about this way too much and making it way too hard.

                                                       

                                                      1. Here's what I'd do. I'd move the anchor point of the flame movie to the bottom of the frame
                                                      2. I'd move the anchor point of the candle to almost the bottom of the candle
                                                      3. I'd parent the flame movie to the candle
                                                      4. I'd position the flame exactly where I want it to be on the candle
                                                      5. (here's the trick) I'd open up the rotation property of the flame movie and add an expression by
                                                        1. holding down the alt/option key and clicking on the rotation property
                                                        2. pressing the - key
                                                        3. then using the pickwhip to point to the rotation property of the candle
                                                      6. Then I'd animate the candle.

                                                       

                                                      The expression looks like this:

                                                      -thisComp.layer("Candle").transform.rotation
                                                      
                                                      

                                                      The minus sign means the flame rotates the opposite direction that the candle does keeping the flame upright. If you need to animate or preset a rotation value for the flame then just add the word value before the minus sign.

                                                       

                                                      You're animation will look something like this.

                                                      You'll find a project file here

                                                       

                                                      I'll also try and attach a sample movie

                                                      • 24. Re: Motion Tracking an Animation
                                                        Rick Gerard Adobe Community Professional & MVP

                                                        Did my solution work for you?

                                                        I may not have understood the problem.

                                                        • 25. Re: Motion Tracking an Animation
                                                          ptelian Level 1

                                                          Thing is Rick, I've already animated it.

                                                           

                                                          I finally just uploaded the sample. I think it will help you all to see what I've got. You'll see a third candle...that's the one (with only the position attribute) that the flame is parented to.