Update: 3/19/2017 Added code fix download
Welcome to episode 15 of the After Effects ExtendScript Training series. This week, it’s keyframes, keyframes, keyframes. Back in episodes 4, 5, and 6, we went over reading values and setting values on various project items and layer properties, but we never took that step down into the next level of the hierarchy and talk about keyframes. The fact of the matter was that keyframes are and are not as straight forward as you may think. Because of this, it was necessary to give keyframes their own episode. Which quickly became a two part episode as well. We will go through and manually create standard keyframes on a property, read keyframe values from a property, as well as transfer keyframes from one layer property to another layer property. This will also involve building some handy functions which will allow us to deal with standard, hold, ease and roving keyframes. We have lots to go over, so let’s get started.
If you missed any of the previous episodes in this series, follow the links below.
Episode 1 (Intro)
Episode 4 (After Effects Object Model structure overview / Script Preparation and development tips / Single Item Access of various project items, comps and layers)
Episode 5 (Access Renderqueue items, output modules and file paths / Multiple item access of project items, comps and layers / Batch change all renderqueue items file paths)
Episode 6 (Collecting data into an Array() / Changing values / Various tips)
Episode 7 (Create new comps and folders / Create Null, Solid, and Text layers)
Episode 8 (Create multiple comps of various sizes / Use Undo group / Add solids to match each comp / Various tips)
Episode 9 (Globally change blue solids to red / Replace solid name blue with red)
Episode 10 (Build a custom function to collect all CompItem objects / Modify function to dynamically allow for choice of CompItem, FolderItem or FootageItem)
Episode 11 (Build floating GUI)
Episode 12 Part 1 & 2 (Build dockable/floating combo GUI)
Episode 13 (ExtendScript Developer Utility script / Retrieve list of project item footage file paths)
Episode 14 (Processing text strings)
In this episode:
– Create keyframes
– Read keyframe values
– Set keyframe values
– Create function to collect all keyframes on a property (Key types: Hold, Easy Ease, Ease In, Ease Out, Roving)
– Create function to transfer keyframes to another layer (Key types: Hold, Easy Ease, Ease In, Ease Out, Roving)
****This particular episode appears to have a few code mistakes on my part and needed some updating as it has been confusing some users when trying to learn it. I appologize for the headaches it may have caused.
Still watch the video for most of the explanation on doing this, but please read through the JSX for notes that will explain what each part is doing.