Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Using JSON to change color.

New Here ,
Apr 25, 2019 Apr 25, 2019

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.

Screen Shot 2019-04-25 at 1.43.21 PM.png

This is a full picture of the expression on the color control

Screen Shot 2019-04-25 at 1.44.35 PM.png

TOPICS
Scripting
4.6K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Apr 25, 2019 Apr 25, 2019

My free mamoworldJSON script can generate expressions that link to colors in JSON files.

https://aescripts.com/mamoworldjson/

See this tutorial for details:

Translate
Community Expert ,
Apr 25, 2019 Apr 25, 2019

My free mamoworldJSON script can generate expressions that link to colors in JSON files.

https://aescripts.com/mamoworldjson/

See this tutorial for details:

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 25, 2019 Apr 25, 2019

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 26, 2019 Apr 26, 2019
LATEST

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/

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines