Nested JSON??
-
Hi there,
I was wondering whether or not I could get Templater to parse my JSON. The issue is my data structure is nested as I am intending to make a clips with scenes and stages. So far in Ae the script says “changing footage layers…” I am not sure if I’ve misused the code or made my Ae file wrong. Would love to know. Here’s an example of my Data.
[ { "instructionTitle" : "how to make a self-populating video", "mainImg" : "img/geting-json-make-a-video.jpg", "stages" : [ { "slide": 1, "name": "Intro", "steps": [ { "duration": 100, "img" : "img/intro-01.jpg", "text" : "Start with JSON file" }, { "duration": 600, "img" : "img/intro-02.jpg", "text" : "Start Ae File" }, { "duration" : 200, "img" : "img/intro-03.jpg", "text" : "Try and pair the documents" } ] }, { "slide" : 2, "name" : "Main", "steps" : [ { "duration" : 8000, "img" : "vid/main-01.mov", "text" : "Ask for help" }, { "duration" : 200, "img" : "img/main-02.png", "text" : "Sulk and cry" }, { "duration" : 400, "img" : "img/main-03.png", "text" : "Search for memes online" } ] }, { "slide" : 3, "name" : "End", "steps" : [ { "duration" : 450, "img" : "vid/end-01.jpg", "text" : "solve all the problems" } ] } ] } ]
-
Unfortunately, Templater can’t interpret nested JSON files. In order to use the data, it’ll need to be ‘flattened’ into a more basic configuration. You can find more data about setting up a JSON array for use with Templater here and if you have any other questions, please just let us know.
-
Thank you @Jeff, I guess I need to make my data a spreadsheet with worksheets that represent the nesting format. Then run Templater iterative for each worksheet to complete the process. Is that what you would do?
I’m still on trial, trying to figure out how this would help my work-flow. I have been struggling to make my decision as I have already wasted quite a bit of time getting this to work with a dataset, and I am still unclear what product I would need for my use case.
I am guessing for the replicate option to make the iterative instances as comps I would need the Pro version.
-
It’s definitely going to depend on how the data is collected and what you’re trying to achieve. You could certainly render each worksheet individually and then combine them into a final master project, but you could also merge all of the data into one large sheet to create a ‘flat’ JSON file. That may allow you to combine the scenes without having to render or replicate the project multiple times. Instead, you could theoretically create sub-comps and then use the Time Sculpting features of Templater to resize the individual sections as necessary.
After looking at the data in your JSON example, you might consider a setup where you create a series of blank videos or comps of variable durations and then load them with the ‘duration’ data point. You could then use Time Sculpting to trim the image and text to that blank placeholder’s duration as needed. Again, a lot of this will depend on your setup, so if you have any specific questions, please just let us know.
As for your question about what version you need, it sounds like your setup will be best served by either the Pro or Bot version of Templater. If your final goal is full automation, Bot will probably be the way to go, but if you’re mainly looking to replicate and iterate large numbers of videos, Pro should be fine.