Skip to main content
Inspiring
March 11, 2019
Answered

Procedurally generated paths using expressions

  • March 11, 2019
  • 2 replies
  • 731 views

Hi! Using expressions, I would like to procedurally create multiple paths without knowing ahead of time how many will be created (these are tic-marks on a graph that I want to scale with animation, and have the tics smoothly appear / vanish as the scaling changes). I can use createPath() to make single paths, which isn't a problem for the axes, but I cannot figure out how to add / remove paths (or shapes) to a shape layer to make the tic marks.

Any thoughts? Thanks!

This topic has been closed for replies.
Correct answer derrickt85858897

Hm. Thank you both for the feedback. I ended up just using a mask that used the same values to clip off the parts of the graph that clipped the edges.

Someday I'm going to have to write scripts for this though.

Thanks again!

2 replies

Community Expert
March 11, 2019

A script can add paths, an expression cannot. An animation preset can create layers with paths.

There are two approaches to animating graphs that I commonly use. The first uses scripts from AE Scripts. There are several available. The script I choose depends on the type of graph. I think I own most of them.

The second method is to use the new Create Nulls from Paths script that comes with AE. The position of nulls can be manipulated using JSON files. Combine that script with the techniques in this tutorial that shows up at the top of the list when you type data-driven animation in the search help field and you have a very powerful combination. Look here: Create animated charts and graphs | Adobe After Effects CC tutorials

You could work out something from scratch but a few bucks at AE Scripts.com or an hour with the User Guide will probably get you to where you need to be.

derrickt85858897AuthorCorrect answer
Inspiring
March 11, 2019

Hm. Thank you both for the feedback. I ended up just using a mask that used the same values to clip off the parts of the graph that clipped the edges.

Someday I'm going to have to write scripts for this though.

Thanks again!

Inspiring
March 11, 2019

Ok, not to answer my own question, but I could just use a repeater effect to achieve effect of having multiple paths for the tic marks, so I think that might be okay.

However, I still need to work out how to do this, because the other use case is handling it when the graph being plotted goes beyond the top or bottom of the graph and needs to be broken up into two or more pieces.

Sorry for thinking out loud in public.

Mylenium
Legend
March 11, 2019

None of that has anything to do with expressions. Expressions cannot create/ add anything, they can only modify the already existing property streams they are applied to and control their output value. So in your case that would mean that everything would have to pre-exist in some form and you only control the positioning, path points and opacity. Nothing that can be done with two lines of code or whatever you imagine. Therefore I would strongly suggest you browse through the varous diagram/ data graphics scripts and tools at AEScripts.com rather than trying to reinvent the wheel.

Mylenium