Creative Communities of the World Forums

The peer to peer support community for media production professionals.

  • Posted by Jakob Wagner on December 12, 2018 at 3:42 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

    Jakob Wagner replied 7 years, 5 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    December 12, 2018 at 5:37 pm

    Try it this way:

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

    Dan

  • Jakob Wagner

    December 13, 2018 at 9:12 pm

    COOL! That works. Thanks.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy