Copy link to clipboard
Copied
I am attempting to use a JSON script to change the color of a solid. I have the solid hooked up to a color controller that uses the "Color Control" effect.
I got a text layer to hook up to my JSON using this expression:
eval("var practiceText=" + footage("bogus.json").sourceText);
practiceText[0].PracticeText;
I am trying to use a similar expression to change the color of that solid:
eval("var mainColor=" + footage("bogus.json").color);
mainColor[0].MainColor
However I keep getting the error "Error: TypeError: cannot read property of '0' of undefined"
Does anyone know what I would need to change to get it to read the color value in the JSON?
This is what my JSON script looks like.
This is a full picture of the expression on the color control
1 Correct answer
My free mamoworldJSON script can generate expressions that link to colors in JSON files.
https://aescripts.com/mamoworldjson/
See this tutorial for details:
Copy link to clipboard
Copied
My free mamoworldJSON script can generate expressions that link to colors in JSON files.
https://aescripts.com/mamoworldjson/
See this tutorial for details:
Copy link to clipboard
Copied
Thank you, that works great! I also see that it has the ability to show or hide images. Is it possible to swap out an image completely using mamoworld? Possibly by entering a new file path in the JSON script?
Copy link to clipboard
Copied
Expressions and the data-driven animation features of After Effects cannot replace footage, hence showing/hiding is the best you can do with mamoworldJSON or any other approach that uses only expressions.
If you want to replace footage, you need a script instead of expressions. An automated (not free) solution that supports this is, for example, Templater
https://aescripts.com/templater/

