|
|
||||
|
|
Ultrashock Tutorials > After Effects > Parent-Child Animations | |||
|
||||
|
|
Parent-Child Animations |
|
||
|
After Effects 5 features powerful tools for animating parent-child animations. When you assign a parent to a layer, the child layer's properties become relative to the parent layer instead of to the composition. Parenting is useful for creating complex animations such as linking the movements of a marionette or depicting the orbits of planets in the solar system. In this example I'll establish parenting relationships between the layers of an Illustrator file (courtesy of Ian Byers), then animate the layers and export a SWF to tweak in Flash.
I set up the After Effects project file (parenting.aep) with comps that show an Illustrator file at various stages of development (clearly you can create something more interesting if you'd like). You can grab the source files, including the optimized FLA, here (parenting.zip, Mac/Win). If you're already familiar with parenting in After Effects, you can jump to the final section on importing and optimizing in Flash. Creating and importing
the artwork
In After Effects, create a new project with a comp
choose Setting anchor points
& using solo
Since you're dealing with 12 layers that have the same bounding box and initial anchor point, it's easy to click and adjust the wrong layer. Rather than clicking on and off eyeballs or lock icons, you may find it easier to use the solo key to isolate individual layers. (The comp "Centered" shows this task completed.)
Establishing parenting
relationships
Use either method to establish the hierarchies you'd expect in a human body (right foot connected to right shin, right shin connected to right thigh, right thigh connected to pelvis, etc.). I find it easiest to begin with the outermost point and work my way inward until the torso is the parent of everything. (The comp "Parented" shows this task completed.) Animating the layers Now set the stopwatches for the values you want to animate, then adjust the values at various times. I animated rotation only, but all values except opacity respond to parenting. If there are layers which you know you're not going to animate, or which you want to hide temporarily in the timeline, you can set the shy switch (by clicking each layer's little face icon) on the layers you want to hide, then clicking the Hide Shy Layers button above them.
I isolated the moving elements by selecting all and hitting "U". After Effects now shows me only attributes for which animation stopwatches have been set. If a layer doesn't have any animated attributes, I set it to shy and enable the Hide Shy Layers button. (The comp "Animated" shows this the artwork animated and ready for export.) € Exporting and optimizing in Flash The final step is to export the After Effects SWF and import it into Flash. You could simply choose File->Export->Macromedia Flash , but it's usually more efficient to isolate chunks of movement and export them separately. That way it¹ll be easier to eliminate unnecessary keyframes after importing the SWF. In my file, the arms/head/torso section can be separated from the leg (see screenshot below), and the left leg can be separated from the right leg.
So, I set solo keys for just the layers I want to export in each group. I export torso.swf, leg_l.swf, and leg_r.swf using the default export settings. In the Flash import dialog box, choose all three SWFs and import them. Flash will stack the SWFs as series of keyframes. Label each layer appropriately. You don't need more than one keyframe for the non-moving content, so on the right leg layer select all keyframes after #1 and hit Clear Keyframe (Shift-F6). Then look for areas in which the other portions aren¹t animating and eliminate duplicate keyframes. Notice in the library that After Effects has created a large number of symbols. Because it allows you to use a fixed or morphing mask on each layer, After Effects creates a new mask shape for each vector object on every frame and wraps the mask and layer together in a movie clip. If you aren't using After Effects masking, these symbols are extraneous and can be safely removed to reduce file size. To remove the extra masks, select each frame in
the moving layer and hit
Fortunately it's easy to select the red rectangles (which had functioned as masks) and delete them. I generally step through each frame, select all, and break apart, then go back through to select and delete the masks. Be sure not to break apart each frame more than once, or you'll reduce the symbols to paths and increase the size of your SWF. It may take a couple minutes of work, but you can cut considerable size off the After Effects SWF (in this case, I cut the SWF from 60kb to 18kb).
|
||||
|
|
©2001 Ultrashock.com Inc. - All rights reserved
|
|