<p>I would look at Templater Rig to see whether this does a fair amount of what you need.
<a href="https://aescripts.com/templater/" rel="nofollow noreferrer">https://aescripts.com/templater/</a></p>
<p>You can also import JSON files directly into AE without conversion to CSV first:
<a href="https://helpx.adobe.com/after-effects/using/data-driven-animations.html" rel="nofollow noreferrer">https://helpx.adobe.com/after-effects/using/data-driven-animations.html</a></p>

CC BY-SA 4.0
2020-07-22T12:33:11.487Z
2020-07-22T12:33:11.487Z
tomh
<p><strong>Background</strong></p>
<p>I'm trying to make an AE animation to visualize some data. Since the raw data I'm using comes in json files and needs to be parsed and analyzed to find useful statistics, I'm using a java program to import all the json and export .csv files for After Effects. I've managed to run through this workflow once already, importing json, exporting csv, and writing AE scripts to read the data from the CSV and calculate object movements on the timeline.</p>
<p>However, when I went to make some changes to how the animation worked, I decided to create a <code>config.properties</code> file that the Java program reads to adjust some settings when creating the CSVs. My intention was that After Effects could read the same file, figure out what settings Java had been using, and parse the CSV accordingly. I figured it wasn't going to be as easy to read the file in AE as it had been in Java, but I hadn't anticipated not being able to import it. I've gotten either errors saying I need Adobe Animate CC to import a .fla file (it's not .fla and I can't imagine why I should need to download that, although I can if necessary) and just plain crashing.</p>
<p><strong>I tried Googling and</strong></p>
<p>At this point I thought that maybe the best course of action would be to write a short Java script that parses the config.properties file and rewrites it as a csv in the form <code>&quot;string&quot;,value</code> on each line while removing all of the comments, but having to parse my own config file kinda defeats the point of writing my own config file for both programs... I also like the .properties format, allowing me to use <code>#</code> for comments and define constants in the form <code>variable: 0</code> or <code>variable: &quot;abc&quot;</code>. I didn't actually ever parse it out of the .properties file because I realized that is probably a terrible solution, and instead I came here.</p>
<p><strong>TL;DR</strong></p>
<p>What is the best way to create a configuration file, composed of user-readable comments, variable names, and string/numerical declarations for those variables, which can be read by my Java program and After Effects, such that I will only need to make a change to one config setting, rerun Java, and then reexport my animation to have something completely new?</p>
<p>Since Java is obviously more flexible here, I'm mostly interested in a good non-laggy AE solution that will ideally require minimal modification to my Java setup.</p>
<p><strong>Some random notes</strong></p>
<ul>
<li>I found from another Stack Exchange question that it's possible to import a file from an after effects expression, but they named two major problems for me: the inability to reference that file <em>relative</em> to my project (the project directory will move and I'd prefer to not have to make many changes in that case) and it re-imports the file every frame, which would simply destroy my already painstakingly slow animation.</li>
<li>I need to be able to modify everything in the config file. While it can be assumed that once I reference a variable in the AE script that variable will always be present with the same name, its line number may shift as I add new comments and variables.</li>
<li>I tried changing the file to .txt, which allowed After Effects to read it (and Java has no problem with any random file extension), but I just get a list of the contents of line that I can reference individually and doesn't respond to the creation of new lines in the config file. In other words, useless.</li>
</ul>
<p>Here's an example screenshot from my existing config.properties file. Obviously these aren't real values. I'm not that stupid. They're just examples of all the data types I'm using at the moment. Notably Java just reads all of these as strings and then I have to go tell it if it's an integer or whatnot. Since this is all a personal project I'm putting 0 effort into stopping it from breaking if I replace stuff with random unexpected data types.</p>
<p><a href="https://i.sstatic.net/hsB8g.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/hsB8g.png" alt="config.properties screenshot" /></a></p>

CC BY-SA 4.0
2020-07-20T12:52:05.660Z
I'd look into the extendscript API, After Effects' internal automation language. You could probably do the whole thing with that. http://docs.aenhancers.com/
stib
<after-effects><after-effects-expressions>
Best way to create external alterable configuration file to be read by After Effects and Java
kviLL
# Best way to create external alterable configuration file to be read by After Effects and Java

(Asked by: username_0 on 2020-07-20)

**Background**

I'm trying to make an AE animation to visualize some data. Since the raw data I'm using comes in json files and needs to be parsed and analyzed to find useful statistics, I'm using a java program to import all the json and export .csv files for After Effects. I've managed to run through this workflow once already, importing json, exporting csv, and writing AE scripts to read the data from the CSV and calculate object movements on the timeline.

However, when I went to make some changes to how the animation worked, I decided to create a `config.properties` file that the Java program reads to adjust some settings when creating the CSVs. My intention was that After Effects could read the same file, figure out what settings Java had been using, and parse the CSV accordingly. I figured it wasn't going to be as easy to read the file in AE as it had been in Java, but I hadn't anticipated not being able to import it. I've gotten either errors saying I need Adobe Animate CC to import a .fla file (it's not .fla and I can't imagine why I should need to download that, although I can if necessary) and just plain crashing.

**I tried Googling and**

At this point I thought that maybe the best course of action would be to write a short Java script that parses the config.properties file and rewrites it as a csv in the form `"string",value` on each line while removing all of the comments, but having to parse my own config file kinda defeats the point of writing my own config file for both programs... I also like the .properties format, allowing me to use `#` for comments and define constants in the form `variable: 0` or `variable: "abc"`. I didn't actually ever parse it out of the .properties file because I realized that is probably a terrible solution, and instead I came here.

**TL;DR**

What is the best way to create a configuration file, composed of user-readable comments, variable names, and string/numerical declarations for those variables, which can be read by my Java program and After Effects, such that I will only need to make a change to one config setting, rerun Java, and then reexport my animation to have something completely new?

Since Java is obviously more flexible here, I'm mostly interested in a good non-laggy AE solution that will ideally require minimal modification to my Java setup.

**Some random notes**

* I found from another Stack Exchange question that it's possible to import a file from an after effects expression, but they named two major problems for me: the inability to reference that file *relative* to my project (the project directory will move and I'd prefer to not have to make many changes in that case) and it re-imports the file every frame, which would simply destroy my already painstakingly slow animation.
* I need to be able to modify everything in the config file. While it can be assumed that once I reference a variable in the AE script that variable will always be present with the same name, its line number may shift as I add new comments and variables.
* I tried changing the file to .txt, which allowed After Effects to read it (and Java has no problem with any random file extension), but I just get a list of the contents of line that I can reference individually and doesn't respond to the creation of new lines in the config file. In other words, useless.

Here's an example screenshot from my existing config.properties file. Obviously these aren't real values. I'm not that stupid. They're just examples of all the data types I'm using at the moment. Notably Java just reads all of these as strings and then I have to go tell it if it's an integer or whatnot. Since this is all a personal project I'm putting 0 effort into stopping it from breaking if I replace stuff with random unexpected data types.

[![config.properties screenshot](https://i.sstatic.net/hsB8g.png)](https://i.sstatic.net/hsB8g.png)

**Tags:** after-effects, after-effects-expressions

> **Comments:**
> **username_1**: I'd look into the extendscript API, After Effects' internal automation language. You could probably do the whole thing with that. http://docs.aenhancers.com/  

---

## 1 answers

### Answer by username_2 on 2020-07-22. Score: 0

I would look at Templater Rig to see whether this does a fair amount of what you need.
<https://aescripts.com/templater/>

You can also import JSON files directly into AE without conversion to CSV first:
<https://helpx.adobe.com/after-effects/using/data-driven-animations.html>


---

