ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Internal JSON

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Jakob Wagner
Internal JSON
on Dec 12, 2018 at 3:42:58 pm

Hi

I want to have a JSON object, but not in a seperate file. Instead I want to put the JSON object on a text layers sourcedata. And then have other layers get the values from that layer. I can't seem to figure out a way to do this.

In the test I have two text layers. In the first (called data) layers sourceText I have the following expression:

'{"blur":{"bluriness":0}}';

In the second text layers sourceText I have this expression:

var data = eval(thisComp.layer("data").text.sourceText);
data.blur.bluriness;

This is not working. Do you have any idea what could make it work?

Thanks,
Jakob


Return to posts index

Dan Ebberts
Re: Internal JSON
on Dec 12, 2018 at 5:37:55 pm

Try it this way:

var data = eval( "(" + thisComp.layer("data").text.sourceText + ")");
data.blur.bluriness;


Dan



Return to posts index

Jakob Wagner
Re: Internal JSON
on Dec 13, 2018 at 9:12:28 pm

COOL! That works. Thanks.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 CreativeCOW.net All Rights Reserved
[TOP]