User Guide Cancel

Work with Data-driven animation

  1. After Effects User Guide
  2. Beta releases
    1. Beta Program Overview
    2. After Effects Beta Home
  3. Getting started
    1. Get started with After Effects
    2. What's new in After Effects 
    3. Release Notes | After Effects
    4. After Effects system requirements
    5. Keyboard shortcuts in After Effects
    6. Supported File formats | After Effects
    7. Hardware recommendations
    8. After Effects for Apple silicon
    9. Planning and setup
  4. Workspaces
    1. General user interface items
    2. Get to know After Effects interface
    3. Workflows
    4. Workspaces, panels, and viewers
  5. Projects and compositions
    1. Projects
    2. Composition basics
    3. Precomposing, nesting, and pre-rendering
    4. View detailed performance information with the Composition Profiler
    5. CINEMA 4D Composition Renderer
  6. Importing footage
    1. Preparing and importing still images
    2. Importing from After Effects and Adobe Premiere Pro
    3. Importing and interpreting video and audio
    4. Preparing and importing 3D image files
    5. Importing and interpreting footage items
    6. Working with footage items
    7. Detect edit points using Scene Edit Detection
    8. XMP metadata
  7. Text and Graphics
    1. Text
      1. Formatting characters and the Character panel
      2. Text effects
      3. Creating and editing text layers
      4. Formatting paragraphs and the Paragraph panel
      5. Extruding text and shape layers
      6. Animating text
      7. Examples and resources for text animation
      8. Live Text Templates
    2. Motion Graphics
      1. Work with Motion Graphics templates in After Effects
      2. Use expressions to create drop-down lists in Motion Graphics templates
      3. Work with Essential Properties to create Motion Graphics templates
      4. Replace images and videos in Motion Graphics templates and Essential Properties
      5. Animate faster and easier using the Properties panel
  8. Drawing, Painting, and Paths
    1. Overview of shape layers, paths, and vector graphics
    2. Paint tools: Brush, Clone Stamp, and Eraser
    3. Taper shape strokes
    4. Shape attributes, paint operations, and path operations for shape layers
    5. Use Offset Paths shape effect to alter shapes
    6. Creating shapes
    7. Create masks
    8. Remove objects from your videos with the Content-Aware Fill panel
    9. Roto Brush and Refine Matte
  9. Layers, Markers, and Camera
    1. Selecting and arranging layers
    2. Blending modes and layer styles
    3. 3D layers
    4. Layer properties
    5. Creating layers
    6. Managing layers
    7. Layer markers and composition markers
    8. Cameras, lights, and points of interest
  10. Animation, Keyframes, Motion Tracking, and Keying
    1. Animation
      1. Animation basics
      2. Animating with Puppet tools
      3. Managing and animating shape paths and masks
      4. Animating Sketch and Capture shapes using After Effects
      5. Assorted animation tools
      6. Work with Data-driven animation
    2. Keyframe
      1. Keyframe interpolation
      2. Setting, selecting, and deleting keyframes
      3. Editing, moving, and copying keyframes
    3. Motion tracking
      1. Tracking and stabilizing motion
      2. Face Tracking
      3. Mask Tracking
      4. Mask Reference
      5. Speed
      6. Time-stretching and time-remapping
      7. Timecode and time display units
    4. Keying
      1. Keying
      2. Keying effects
  11. Transparency and Compositing
    1. Compositing and transparency overview and resources
    2. Alpha channels and masks
    3. Track Mattes and Traveling Mattes
  12. Adjusting color
    1. Color basics
    2. Color management
    3. Color Correction effects
    4. OpenColorIO and ACES color management
  13. Effects and Animation Presets
    1. Effects and animation presets overview
    2. Effect list
    3. Effect Manager
    4. Simulation effects
    5. Stylize effects
    6. Audio effects
    7. Distort effects
    8. Perspective effects
    9. Channel effects
    10. Generate effects
    11. Time effects
    12. Transition effects
    13. The Rolling Shutter Repair effect
    14. Blur and Sharpen effects
    15. 3D Channel effects
    16. Utility effects
    17. Matte effects
    18. Noise and Grain effects
    19. Detail-preserving Upscale effect
    20. Obsolete effects
  14. Expressions and Automation
    1. Expressions
      1. Expression basics
      2. Understanding the expression language
      3. Using expression controls
      4. Syntax differences between the JavaScript and Legacy ExtendScript expression engines
      5. Editing expressions
      6. Expression errors
      7. Using the Expressions editor
      8. Use expressions to edit and access text properties
      9. Expression language reference
      10. Expression examples
    2. Automation
      1. Automation
      2. Scripts
  15. Immersive video, VR, and 3D
    1. Construct VR environments in After Effects
    2. Apply immersive video effects
    3. Compositing tools for VR/360 videos
    4. Advanced 3D Renderer
    5. Import and add 3D models to your composition
    6. Import 3D models from Creative Cloud Libraries
    7. Image-Based Lighting
    8. Extract and animate lights and cameras from 3D models
    9. Tracking 3D camera movement
    10. Cast and accept shadows
    11. Embedded 3D model animations
    12. Shadow Catcher
    13. 3D depth data extraction
    14. Modify materials properties of a 3D layer
    15. Work in 3D Design Space
    16. 3D Transform Gizmos
    17. Do more with 3D animation
    18. Preview changes to 3D designs real time with the Mercury 3D engine
    19. Add responsive design to your graphics 
  16. Views and Previews
    1. Previewing
    2. Video preview with Mercury Transmit
    3. Modifying and using views
  17. Rendering and Exporting
    1. Basics of rendering and exporting
    2. H.264 Encoding in After Effects
    3. Export an After Effects project as an Adobe Premiere Pro project
    4. Converting movies
    5. Multi-frame rendering
    6. Automated rendering and network rendering
    7. Rendering and exporting still images and still-image sequences
    8. Using the GoPro CineForm codec in After Effects
  18. Working with other applications
    1. Dynamic Link and After Effects
    2. Working with After Effects and other applications
      1. Export After Effects project as Premiere Pro project
    3. Sync Settings in After Effects
    4. Creative Cloud Libraries in After Effects
    5. Plug-ins
    6. Cinema 4D and Cineware
  19. Collaboration: Frame.io, and Team Projects
    1. Collaboration in Premiere Pro and After Effects
    2. Frame.io
      1. Install and activate Frame.io
      2. Use Frame.io with Premiere Pro and After Effects
      3. Frequently asked questions
    3. Team Projects
      1. Get Started with Team Projects
      2. Create a Team Project
      3. Collaborate with Team Projects
  20. Memory, storage, performance
    1. Memory and storage
    2. How After Effects handles low memory issues while previewing    
    3. Improve performance
    4. Preferences
    5. GPU and GPU driver requirements for After Effects
  21. Knowledge Base
    1. Known issues
    2. Fixed issues
    3. Frequently asked questions
    4. After Effects and macOS Ventura
    5. How After Effects handles low memory issues while previewing

Use the document to learn how to work with Data-driven animation.

Data-driven animations are created using live data collected from various data sources that drive animations in your composition. You can use data from multiple data sources. The data can be static or time-varying. Import the data into your After Effects project and use it as input that can animate graphs, characters, control visual effects and movie titles, and other motion graphics.

Data-driven animation example
Data-driven animation example

Data Sources

You can use data from almost every possible source such as:

  • Device-Generated Data Files – Data from devices such as fitness trackers that record activity through sensors and store them in different file formats. This time-varying data includes - speed, altitude, distance, heart rate, and various other parameters of user activity.
  • User-Generated Static Data – Global static data such as survey results that can be changed to drive graphics. A user created data file could provide a workflow for global data.
  • URL – Live data from websites such as entry and exit path of a user navigating through a web page.
  • Metadata - Data embedded in Video File Metadata.

Input Formats

You can import data files in the following formats:

  • JSON
  • MGJSON
  • CSV
  • TSV
  • BVH

If you have data files in other formats, convert them to any of the supported import file formats and import into After Effects project. There are various conversion tools available to convert data files into After-Effects-supported formats.

Support for standard JSON (.json)

You can import a standard JSON file into After Effects as footage and the data files work in the background. After Effects directly references the data in these data files to drive animations within projects. JSON footage is not represented as data streams in the Timeline panel. You can reference the data using expressions as an evaluated JSON object.

You can modify the expressions to change how data is referenced. You can write the data in a text editor, referenced by After Effects to drive animations. JSON support is based on the JSON schema, which specifies and defines how an application uses and modifies JSON data.

JSON's basic data types are:

  • Number: A signed decimal number.
  • String: A sequence of zero or more Unicode characters.
  • Boolean: Either of the values true or false.
  • Array: An ordered list of zero or more values.
  • Object: an unordered collection of name or value pairs where the names (keys) are strings.
  • Null: An empty value, using the word ‘null’.
Note:

If you intend to use Adobe Media Encoder or link the compositions to Premiere Pro, add the data source file to the Timeline rather than using expressions to refer to data entries residing in the Project panel. Adding the data file as a composition layer will also ensure it will be copied when choosing Collect Files.

Work with JSON file in After Effects

To work with a standard JSON file, use the following steps:

  1. Select File > Import > File.

  2. Select a .JSON file and select Open.

  3. The file is added to your project window. Create a composition with the footage.

  4. Add a solid to the composition. To add a solid, select Layer > New > Solid.

  5. In the Timeline panel, twirl open the properties of the solid layer and open the Opacity parameter using Alt + Click for Windows and  + Click for macOS.

  6. Change the data in the expression to modify your animation. You can control the JSON data and the data file where all the information is stored.

  7. You can also replace the JSON file with another JSON file to change the data being referenced. To replace, select Replace Footage > File, and open the new file from your computer.

To use the data, you can apply an expression on the property you want the data to drive, then:

  1. Use the sourceData attribute to read the data in a .JSON file. For example:

    var sampleData = footage("sample.json").sourceData;
  2. To return its value, reference the specific property inside the JSON data. For example,

    myData.engineData.RPM or myData.latitude.value.

Support for Motion Graphics JSON (.mgJSON)

You can import an MGJSON data file as footage in your project. When you add data footage to a composition, data property streams are grouped into a top-level group "Data". The Data group displays footage data as Properties. Each property in the data group is expression linked back to the footage file that access the data file value using the expression footage("foo.mgjson").dataValue(N). Here N is the path to the data stream in the file. MGJSON works based on a schema, which is designed to simplify referencing and importing data streams in After Effects.

Each individual data property has an expression applied which links that property to the data in the MGJSON file. If the source MGJSON file is changed, the data property values are automatically updated.

In the Timeline panel, you can twirl open the Data layers and use the pick-whip to link parameters to other parameters. The changes are automatically populated.

Work with MGJSON footage in After Effects

To work with an MGJSON file, use the following steps:

  1. Select File > Import > File.

  2. To import, select an MGJSON file and select Open.

  3. The file is added to your project window. Create a composition with the footage.

  4. Import an asset into the project and add it to the composition.

  5. In the Timeline panel, twirl open the properties of the footage.

  6. Pick whip one of the properties of the asset, for example – Rotation to one of the data streams in the data layer. The asset property is now referencing the data from the data layer. Each reflected data stream has an expression that pulls its value from the footage file.

  7. When you preview the footage, the asset animates based on the data stream of the data layer.

You can also convert the data samples from the data file into keyframes. To convert into keyframes, follow these steps:

  1. Import MGJSON file into your project and drag into Timeline panel.

  2. Right-click the data layer and select Keyframes Assistant > Create Keyframes from Data from the menu.

  3. To view the keyframes, twirl open the data layer.

Note:

After keyframe conversion, the data is no longer live and is not referenced from the data file.

You can also view live data as a graph in the Graph Editor. To view, select the Graph Editor icon in the Timeline panel.

Data-driven animation uses expression reference. For more information, see Data-driven animation (expression reference).

Align video in time to mgJSON data

The Layer > Time > Align Video to Data command offsets video layers by various frames, as specified in an mgJSON file. You can use this command to align the video in time to data samples stored in a matching mgJSON file. For example, if you captured data during a race, but the start time of the video does not match the start time of the captured data, you can specify the offset so that the data is automatically aligned.

To align video in time to mgJSON data, use the following steps:

  1. Add the .mgJSON file to a composition that also contains the target layers.
  2. Select both the .mgJSON layer and the target layers.
  3. Select Layer > Time > Align Video to Data.

For this to work, the mgJSON file must contain a videoSyncTimeList group that contains:

  • The name of one or more target layers (fileName)
  • The number of frames to offset (frameNumber) those layers from the start of the data layer.

For example:

"videoSyncTimeList": [
  {
    "fileName": "sample1.mp4",
    "frameNumber": 1000
  },

  {
    "fileName": "sample2.mp4",
    "frameNumber": -1000
  }

A fileName value must be the layer name of a selected layer, not therce name of the layer. If you change the name of a layer with a source in your composition, for example - rename the layer "sample1.mp4" to "Race Camera 1", you also need to change the fileName value in the mgJSON file to match. Layers referenced by fileName do not have to be footage items with a source file, they can also be solids, nested compositions, or other layer types.

Positive frameNumber values offset the target layer to the left (before the data layer). Negative frameNumber values offset the target layer to the right (after the data layer). A frameNumber value of 0 aligns the start of the target layer to the start of the data layer.

Support for CSV (.csv) and TSV (.tsv or .txt)

You can import Comma-separated value (.csv) and Tab-separated value (.tsv or .txt) files as footage into After Effects and use them as data sources. CSV and TSV files store tabular data in plain text format with values separated either by comma characters or tab characters. The CSV and TSV data files work similar to how the JSON files work.

To use CSV or TSV data files in After Effects, follow these steps:

  1. Import a CSV or TSV file into your project as footage, similar to how you import a video, audio, or other files. Use any of the following ways to import your files as footage:

    • Select File > Import > File.    
    • Right-click the Projects panel and select Import > File type.
    • Double-click the Projects panel.
  2. The file is added to your project window. Create a composition with the file.

  3. In the Timeline panel, twirl open the properties of the footage. Link the data properties of the layer in the composition to another layer with the expression pick whip, or the Property Link pick whip. To open the expressions text field, hold Shift and select the timer icon against the layer's name. You can also link the data properties through the Edit > Copy With Property Links command.

    To learn about layer data properties in the Timeline, see Basics of Data properties.

  4.  To reference the data footage file, use an expression on the property that you want the data to drive. Use the dataValue() footage attribute to read the data from a specified row and column. Rows and columns are zero-indexed. For example, footage("sample.tsv").dataValue([15,1])returns the value on row 16 of the second column.

Basics of Data properties

When you add a JSON, CSV, or TSV file to a composition and open their properties, they contain only a Data properties group, instead of the Transform properties group. The Data properties group contains the hierarchy of data as defined in the file.

JSON Data properties group in the Timeline panel
JSON Data properties group in the Timeline panel

CSV and TSV Data properties group in the Timeline panel
CSV and TSV Data properties group in the Timeline panel

This data group is similar to how After Effects treats Motion Graphics JSON (.mgJSON) files. The difference is that JSON, CSV, and TSV can only contain static data values, while mgJSON can contain dynamic data (data that changes over time).

Each individual data property has an expression applied that links that property to the data in the JSON, CSV, or TSV file. If you change the source data file, the data property values reflect the change.

Link properties with the Property Link pick whip

If you do not want to write complex expressions, you can use the Property Link pick whip, or the Edit > Copy with Property Links command to link the data properties to properties of other layers. As you link the layers, the Property Link picks whip automatically writes expressions for you.

Custom expression function libraries - JSX

In After Effects 15.0, it was possible to import a JSON file that defined custom JavaScript functions, which you could use as a library of custom expression functions. In After Effects 15.1, JavaScript objects are not legal syntax for JSON. After Effects 15.1 uses a different JSON parser that is strict and does not allow the import of a JSON file with illegal syntax.

If you try to import a JSON file with a defined JavaScript function in After Effects 15.1 or open a project that contains such a file, After Effects displays an error.

To avoid the issue, you can import a JavaScript syntax extension file (.jsx) into After Effects 15.1. The content of the JSX file can be the same as a JSON file imported into After Effects 15.0, you only need to change the filename extension to .jsx. If you open an existing project that contains a JSON file that does not work, use File > Replace Footage to replace the JSON file with the JSX file. The expression references to the JSON file are replaced by references to the JSX file.

Known issues with Data-driven animation

While you work with Data-driven animations in After Effects, you can run into a few issues. For a complete list, see known issues with Data-driven animations.

 Adobe

Get help faster and easier

New user?

Adobe MAX 2024

Adobe MAX
The Creativity Conference

Oct 14–16 Miami Beach and online

Adobe MAX

The Creativity Conference

Oct 14–16 Miami Beach and online

Adobe MAX 2024

Adobe MAX
The Creativity Conference

Oct 14–16 Miami Beach and online

Adobe MAX

The Creativity Conference

Oct 14–16 Miami Beach and online