Skip to main content
Neil - DevMatters
Participant
September 25, 2020
Answered

Create layers/comps based on JSON

  • September 25, 2020
  • 1 reply
  • 563 views

Hi everyone!

I'm looking to make an instruction template using JSON in the style of How-To videos.

 

I have been doing this manually but it's very repetitive and got me wondering if this could be done as expressions and gathering the data from an external source file. 

For the most part this is a slideshow with some slides having various steps inside it, I would like to make the template adapt depending on how many items there are in the instructions. 

 

I've made a sample of the JSON file structure, but I foresee it containing stages slides and steps. A finally thought; I imagine at the level of the step: images and description texts could be null (interchangeable).

 

I imagine the data structure to be something like this:

 

{
	"instructionTitle":  "how to make a self-populating video",
	"mainImg": "%pathtoimg%/main.png",
	"stages": {
		"slide":{
			"step": {
			   "duration"; 100,
			   "img": "%pathtoimg%/0100.png",
			   "text": "Start with  JSON file",
			}
			"step":{
				"duration"; 400,
				"img": "%pathtoimg%/0102.png",
				"text": "Scratch your head",
			}
		  }
		"slide":{
			"step": {
			   "duration"; 800,
			   "img": "%pathtoimg%/0200.png",
			   "text": "Ask for help",
			}
		}
	}
}

 

 

What I'd like to know is, is it possible to count the stages and create comps based on the number of stages, import the images based on the image count etc?

This topic has been closed for replies.
Correct answer Mylenium

Expressions cannot create anything, so this is utterly moot in the first place. If you really have to use this so much, finsd a script on AEScripts.com or write your own.

 

Mylenium

1 reply

Mylenium
MyleniumCorrect answer
Legend
September 25, 2020

Expressions cannot create anything, so this is utterly moot in the first place. If you really have to use this so much, finsd a script on AEScripts.com or write your own.

 

Mylenium

Neil - DevMatters
Participant
September 25, 2020

Thanks, Mylenium for your quick response.   I figured that was the case, I have spent most of the morning trying to find if it was possible but never concretely finding what I wanted to know.  Thanks again for the support. 

Mathias Moehl
Community Expert
Community Expert
September 26, 2020

Yes, expressions cannot do that but scripts can.

 

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects