Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity › Forums › Adobe After Effects Expressions › [Problem] Access multiple JSON files with RegEx and dynamically calculate y-Axis

  • [Problem] Access multiple JSON files with RegEx and dynamically calculate y-Axis

    Posted by Tom Jonas Cupperton on December 25, 2020 at 10:56 pm

    Dear all,

    I am stuck with a problem using Adobe After Effects and RegEx.

    I have a multitude of single JSON datasets that I need to load and render. The problem is that the range of values for the y-axis differs from JSON file to JSON file.
    E.g. one JSON has a value range from 0 – 500 units; another JSON has a value range from 8000 – 250000 units.

    Meanwhile, in my template, the y axis is always standardized to 1000 px in height.
    Thus, the 0-500 range should fit into it as well as the 8.000-250.000 range.

    I was thinking about a RegEX that

    checks the JSON file

    Looks for the MAX value

    and distributes the range with 3 axis points (Min, Mid, Max)

    so that for the first range it would generate a y-axis with 0, 250, 500
    and for the second one a y axis with 0, 125.000,250.000

    Can anyone help on this?

    Thx in advance and happy holidays
    Tom

    Filip Vandueren replied 5 years, 9 months ago 2 Members · 1 Reply
  • 1 Reply
  • Filip Vandueren

    December 28, 2020 at 7:26 pm

    I don’t think that’s the kind of thing I would use a regexp for.

    Maybe a python script to change/normalize the JSON files ?

    Or just write the max value to a separate data point in the JSON.

    Or can the expression be written in a way that averages out the JSONs ?

    Do the JSON files always have the same amount of data (keyframes) in them ?

    If you give a bit more info on how exactly the data is formatted, and how it is used, it shouldn’t be too hard to figure something out.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy