mamoworldJSON
  • Brilliant product! Thanks a million for that. Couple of questions - can font/font size be linked to JSON doc? Definitely text layer scale be added to JSON but can font selection be driven the same way? Render queue parameters? Can external scripts be stored or triggered via JSON doc?
    Thanks a lot again,
    Kirill
  • Brilliant product! Thanks a million for that. Couple of questions - can font/font size be linked to JSON doc? Definitely text layer scale be added to JSON but can font selection be driven the same way? Render queue parameters? Can external scripts be stored or triggered via JSON doc?
    Thanks a lot again,
    Kirill
    You can only link a property to JSON, if you can apply an expression to the property. Hence, you cannot link fonts, font size or render queue parameters. Also, you cannot trigger external scripts in the JSON to simulate that. You can store JavaScript functions in JSON-like files, as I show in this tutorial https://mamoworld.com/tutorials/after-effects-expressions-nerd-tip-1-building-your-own-expressions-library-1-minute
    You can access and execute this code inside JSON files inside expressions, but you cannot use this to trigger general Ae scripting code that should modify your project.
  • Trying this out ... it keeps giving me "Error at line 497 of ~/Downloads/mamoworldjson_1_0_000/mamoworldJSON.jsx: After Effects error: File “mamoworld.json” is not a valid file type for import."
  • Which version of After Effects are you using? Note that the JSON features are only supported by CC2017 and newer.

    Trying this out ... it keeps giving me "Error at line 497 of ~/Downloads/mamoworldjson_1_0_000/mamoworldJSON.jsx: After Effects error: File “mamoworld.json” is not a valid file type for import."

  • Trying this out ... it keeps giving me "Error at line 497 of ~/Downloads/mamoworldjson_1_0_000/mamoworldJSON.jsx: After Effects error: File “mamoworld.json” is not a valid file type for import."
    Seems to work in 2018 but not 2017 ... is that the issue? (Cuz "compatibility" tab above says "CC 2018, CC 2017")
  • Oh, yes, you are right. I just did some tests and in deed 2017 does not yet support json data import. I updated the compatibility information for mamoworldJSON now.

    Seems to work in 2018 but not 2017 ... is that the issue? (Cuz "compatibility" tab above says "CC 2018, CC 2017")

  • So im following along the tutorial and I keep getting "Error at line 4 in property 'Source Text' of layer 1 ('2000') in comp '04-Info-Box'. Unterminated string constant." whenever I try to connect Source text to json. So I'm assuming that theres a quotation missing but I haven't touched the code. Thank You! 
  • Hi Bob,

    does this error only happen after you changed the json file? If so, does the json file data consist of valid json data (does  it validate here: https://jsonlint.com/ ?).
    Does this only happen if the text contains special symbols (like Japanese or Arabic text)?

    If you still have the issue, could you open a support ticket here
    and attach your project file and describe which texts you tried to connect?

    Cheers,
    Mathias
  • image
    The script actually works but everytime after I save the .json this happens.
  • Hi Farhan,
    do you have any special unicode characters in your json? Does it help if you edit the file with a different text editor? I noticed some strange behavior when doing it with ExtendScript Toolkit, sometimes.

    Also sounds like you should report this as a bug to Adobe:

    Cheers,
    Mathias
  • Hi there ... Bit of FYI

    I wanted to created a template that had the text layers named "record 01" "record 02" etc. Running the script created a Json file ok but straight away AE throws up a parsing error/ invalid JSON file and crashes.  Running CS2018 btw.

    The script produces the line as follows.

    {
      "generatedBy": "mamoworldJSON",
      "Temp Record": {
        "01": "Record 01",
        "Line01": "Record 01\r"
      }
    }

     The line01  part produces a name as Record 01\r even though the text laxyer is only labeled Record 01, Record 02 etc

    the /r causes the crash. removing it manually allows AE to import. However as the error occurs during the script the expression part is lost and nothing is written.
  • Hi Matthew,

    thank you for reporting this. I just did a few tests and can confirm that I see the same error on CC2018, but on CC2019 it is working fine. So it seems that Adobe has fixed this json parsing issue already. Also in CC2018 the error occurs ONLY if the text of the text layer contains a newline at the end of the text.

    If you need to work with CC2018 I recommend that you make sure that the text you enter does not end with a newline. If you enter "return" at the end of the text of a Ae layer, the newline is not visibile - i.e. the bounding box of the text does not show the new line you started unless you start adding any nonempty characters to this line - but it is still there and hence will end up in the json.

    Cheers,
    Mathias

    Hi there ... Bit of FYI

    I wanted to created a template that had the text layers named "record 01" "record 02" etc. Running the script created a Json file ok but straight away AE throws up a parsing error/ invalid JSON file and crashes.  Running CS2018 btw.

    The script produces the line as follows.

    {
      "generatedBy": "mamoworldJSON",
      "Temp Record": {
        "01": "Record 01",
        "Line01": "Record 01\r"
      }
    }

     The line01  part produces a name as Record 01\r even though the text laxyer is only labeled Record 01, Record 02 etc

    the /r causes the crash. removing it manually allows AE to import. However as the error occurs during the script the expression part is lost and nothing is written.

  •  Also in CC2018 the error occurs ONLY if the text of the text layer contains a newline at the end of the text.

    If you need to work with CC2018 I recommend that you make sure that the text you enter does not end with a newline. If you enter "return" at the end of the text of a Ae layer, the newline is not visibile - i.e. the bounding box of the text does not show the new line you started unless you start adding any nonempty characters to this line - but it is still there and hence will end up in the json.

    Cheers,
    Mathias

    Can't upgrade to 2019 ATM as Work's custom program and plugins is only supported on Capitan OS, 2019 wont install on that. So stuck with 2018 for now.  Thanks for the info about the return line and to avoid it with 2018.
  • Hi

    i'm pretty new at this. Should the mamoworld json file be imported into the project before would open the panel. I get a message "please select at least one
    property"

    I think the 1st tutorial is missing a step on how to setup the comp to make the panel work.
  • Hi Tim,

    there is no need to create or import the mamoworldjson file - the script does all of that for you.

    Your error sounds like you didn't select the property that you want to connect to the json document. If you want to connect a text, please make sure to do not only select the text layer, but select the actual source text property of the text layer (watch closely at 1:24 in the first tutorial).

    Cheers,
    Mathias

    tim holly said:
    Hi

    i'm pretty new at this. Should the mamoworld json file be imported into the project before would open the panel. I get a message "please select at least one
    property"

    I think the 1st tutorial is missing a step on how to setup the comp to make the panel work.

  • 不能支持中文件吗,使用汉字都是乱码,不知道为什么。
  • Hi Jin,

    Are you using an old version of mamoworldJSON? I just did a quick test and using the symbols from your comment worked without issues for me.
    Make sure to use the most recent version mamoworldJSON 1.0.002 which fixes some issues with special symbols like Chinese characters.

    Cheers,
    Mathias

    jin wang said:
    不能支持中文件吗,使用汉字都是乱码,不知道为什么。

  • Hi Mickael,
    this sounds like you have a typo in your JSON document. Like you forgot a , or a : or you have forgotten to put a text in quotes.

    You can check the JSON file with a validator like this one:
    It will show you, where exactly in your JSON file the typo is.

    Bonjour, 

    Je rencontre actuellement un problème après avoir bien paramétrer mon projet et testé qu'il fonctionne after me renvoie "mamoworld.json" n'est pas un fichier json valide. S'il contient une synthaxe JavaScript, changer son extension en .jsx, puis réimportez ou remplacez le métrage.

    Ai-je fais une erreur ?

    Merci 

  • Hi Mickael,
    this sounds like you have a typo in your JSON document. Like you forgot a , or a : or you have forgotten to put a text in quotes.

    You can check the JSON file with a validator like this one:
    It will show you, where exactly in your JSON file the typo is.

    Bonjour, 

    Je rencontre actuellement un problème après avoir bien paramétrer mon projet et testé qu'il fonctionne after me renvoie "mamoworld.json" n'est pas un fichier json valide. S'il contient une synthaxe JavaScript, changer son extension en .jsx, puis réimportez ou remplacez le métrage.

    Ai-je fais une erreur ?

    Merci 

    Super ! merci beaucoup
  • Hello,
    This is a very good script!

    I wonder if there's a way to use those letters « à; é; ê; è; ç; ù; ï; ë; commonly use in french? The actual font support those when typing.
    For now, it shows like: ~A©

    Best regards

  • Hi Melany,
    did you make sure to use the most recent version 1.0.002 of mamoworldJSON? It fixes some issues with such special symbols that previous versions had.

    Hello,
    This is a very good script!

    I wonder if there's a way to use those letters « à; é; ê; è; ç; ù; ï; ë; commonly use in french? The actual font support those when typing.
    For now, it shows like: ~A©

    Best regards


  • Bonjour, 

    Je rencontre actuellement un problème, lors de l'export il ne prend pas en compte mon changement de texte du fichier Json ? Manque t'il quelque chose de mon côté ?

    Merci,
  • Hi Mickael,

    this sounds like a bug in the After Effects JSON feature. Does it help if you right click on the json file in your Ae project panel and choose "Reload Footage"? It might also help to purche the memory and disk cache.


    Bonjour, 

    Je rencontre actuellement un problème, lors de l'export il ne prend pas en compte mon changement de texte du fichier Json ? Manque t'il quelque chose de mon côté ?

    Merci,

  • Hi Mickael,

    this sounds like a bug in the After Effects JSON feature. Does it help if you right click on the json file in your Ae project panel and choose "Reload Footage"? It might also help to purche the memory and disk cache.


    Bonjour, 

    Je rencontre actuellement un problème, lors de l'export il ne prend pas en compte mon changement de texte du fichier Json ? Manque t'il quelque chose de mon côté ?

    Merci,

    Non je me retrouve toujours avec le même problème, j'ai vidé le cache ainsi que recharger le métrage

    Sur mon visualiseur le texte est quand même le bon, seulement au rendu qu'il ne change pas 
  • That's really strange! Please contact Adobe support, since if it shows up in the viewer but not in rendered files, it is definitely an issue at Adobe's end. Are you using the most recent version of Ae? I think there have been some JSON related bug fixes during the last updates.

    Non je me retrouve toujours avec le même problème, j'ai vidé le cache ainsi que recharger le métrage

    Sur mon visualiseur le texte est quand même le bon, seulement au rendu qu'il ne change pas 

  • I've got the exact same problem. My JSON is valid! Mickael - did you find a solution?

    PS: I am rendering in CC19 using "Add to Media Encoder" if this matters.
    Hi Mickael,

    this sounds like a bug in the After Effects JSON feature. Does it help if you right click on the json file in your Ae project panel and choose "Reload Footage"? It might also help to purche the memory and disk cache.


    Bonjour, 

    Je rencontre actuellement un problème, lors de l'export il ne prend pas en compte mon changement de texte du fichier Json ? Manque t'il quelque chose de mon côté ?

    Merci,

    Non je me retrouve toujours avec le même problème, j'ai vidé le cache ainsi que recharger le métrage

    Sur mon visualiseur le texte est quand même le bon, seulement au rendu qu'il ne change pas 

  • Hi Nicolas,
    in this tread, I just found a hint that Media Encoder works better, if the json file is also a layer in the comp and not just a footage item in the project:
    Does it work better, if you drag the mamoworld.json file from the project panel into your timeline? When the json file is a layer in your comp, you get a warning each time the structure of the file changes (but not if only the content changes) and maybe Media Encoder deals more properly with it.

    I've got the exact same problem. My JSON is valid! Mickael - did you find a solution?

    PS: I am rendering in CC19 using "Add to Media Encoder" if this matters.
    Hi Mickael,

    this sounds like a bug in the After Effects JSON feature. Does it help if you right click on the json file in your Ae project panel and choose "Reload Footage"? It might also help to purche the memory and disk cache.


    Bonjour, 

    Je rencontre actuellement un problème, lors de l'export il ne prend pas en compte mon changement de texte du fichier Json ? Manque t'il quelque chose de mon côté ?

    Merci,

    Non je me retrouve toujours avec le même problème, j'ai vidé le cache ainsi que recharger le métrage

    Sur mon visualiseur le texte est quand même le bon, seulement au rendu qu'il ne change pas 


  • Hi. Is here a way to change also the images and not only the text?
  • Hi Möhl - unfortunately, no. 
    I included Mamoworld.json in there, at the top of all layers, then at the bottom - no luck.

    I really wonder what's wrong. Same as the person commenting: it works if I only render with AE (but really not my workflow unfortunately). 
    Are you guys able to make it work within AME? 

    Hi Nicolas,
    in this tread, I just found a hint that Media Encoder works better, if the json file is also a layer in the comp and not just a footage item in the project:
    Does it work better, if you drag the mamoworld.json file from the project panel into your timeline? When the json file is a layer in your comp, you get a warning each time the structure of the file changes (but not if only the content changes) and maybe Media Encoder deals more properly with it.

    I've got the exact same problem. My JSON is valid! Mickael - did you find a solution?

    PS: I am rendering in CC19 using "Add to Media Encoder" if this matters.
    Hi Mickael,

    this sounds like a bug in the After Effects JSON feature. Does it help if you right click on the json file in your Ae project panel and choose "Reload Footage"? It might also help to purche the memory and disk cache.


    Bonjour, 

    Je rencontre actuellement un problème, lors de l'export il ne prend pas en compte mon changement de texte du fichier Json ? Manque t'il quelque chose de mon côté ?

    Merci,

    Non je me retrouve toujours avec le même problème, j'ai vidé le cache ainsi que recharger le métrage

    Sur mon visualiseur le texte est quand même le bon, seulement au rendu qu'il ne change pas 



  • Hi Nicolas,

    if it works when rendering inside Ae but not when rendering with AME, then only the After Effects team can fix this. mamoworldJSON just automates the process for you to create the json file and the expressions, but if the json feature of Ae itself has bugs, then only Adobe can change that. Please file a bug report at https://www.adobe.com/products/wishform.html
    the more people complain, the quicker Adobe will address this issue.

    Hi Möhl - unfortunately, no. 
    I included Mamoworld.json in there, at the top of all layers, then at the bottom - no luck.

    I really wonder what's wrong. Same as the person commenting: it works if I only render with AE (but really not my workflow unfortunately). 
    Are you guys able to make it work within AME?


  • Hi Matteo,

    the json feature of After Effects does not support to replace images, since images cannot be controlled with expressions. You can turn the visibility of layers on and off to show/hide images, but not change the source file. See this tutorial for details: https://mamoworld.com/tutorials/data-driven-animation-json-after-effects-part-3-showhide-layers

    If you want to replace images, you need to write your own custom Ae scripts or use script-based solutions like Templater or CompsFromSpreadsheets.

    Hi. Is here a way to change also the images and not only the text?

  • i cannot use the linear function. When i connect the y position with the json data it automatically gives that variable below. var result = mamoworldJSONValue("temperature line.0") In the tutorial 'var result =' doesn't exist. I used 'result' as the variable and apply the linear function but it didn't work. I tried in many other ways but i couldn't apply the linear function. Is there something that i'm missing or is it because of the update?
  • Thank you for pointing me to this, Dogus.

    We had to add the "var result = " in newer versions of mamoworldJSON, in order to stay compatible with the new Ae expressions engine. The code for the linear expression must be a little bit different: You need to add the "var result =" before the linear, so the expression looks like this:

    var temperature = mamoworldJSONValue("temperature line.0");
    var result = linear(temperature,-10,40,250,50);

    If anybody else is reading this, Dogus is talking about modifying the expression as described here:

    i cannot use the linear function. When i connect the y position with the json data it automatically gives that variable below. var result = mamoworldJSONValue("temperature line.0") In the tutorial 'var result =' doesn't exist. I used 'result' as the variable and apply the linear function but it didn't work. I tried in many other ways but i couldn't apply the linear function. Is there something that i'm missing or is it because of the update?

  • Hi Nick,

    this sounds like you changed something in the JSON file that turned it into an invalid json file.

    Please check your JSON file with a JSON validator like this one:
    Just copy and paste the entire content of the file and it will show you any error in your JSON syntax.
  • Everything works fine in the AE, but it breaks using aerender command line render. Is that a limitation with mamoworld?
  • Hi Wing,

    all that mamoworldJSON does is using the native JSON support of After Effects. So if it does not work with command line render, it is a bug or limitation of After Effects itself. I am not aware of such a limitation, but please file a bug report to the Adobe team here


    Wing Luo said:
    Everything works fine in the AE, but it breaks using aerender command line render. Is that a limitation with mamoworld?

  • Hi Wing,

    all that mamoworldJSON does is using the native JSON support of After Effects. So if it does not work with command line render, it is a bug or limitation of After Effects itself. I am not aware of such a limitation, but please file a bug report to the Adobe team here


    Wing Luo said:
    Everything works fine in the AE, but it breaks using aerender command line render. Is that a limitation with mamoworld?

    after digging deeper on it, i realized the json file has to be added to the comp in order for it to work under aerender's commandline render. mamoworld is working perfectly after all. your script is awesome.

  • Interesting! Thanks for sharing the solution, Wing.

    Wing Luo said:
    after digging deeper on it, i realized the json file has to be added to the comp in order for it to work under aerender's commandline render. mamoworld is working perfectly after all. your script is awesome.


  • Great job.
    Is it possible to contribute in order to add functionalities? Do you have a git repo?
    Yours truly
  • Thank you, but no, it is not open source. What additional functionality do you have in mind?
    Great job.
    Is it possible to contribute in order to add functionalities? Do you have a git repo?
    Yours truly

  • Hi! Love what this is helping me achieve. Wondering if it can let me connect to an array - example being weather data - can we connect to [3] in an array called "daily"? Looks like below - array has 7 items, all with repeating info. 

    "daily": [
        {
          "dt": 1653076800,
          "sunrise": 1653049406,
          "sunset": 1653105354,
          "moonrise": 1653035880,
          "moonset": 1653064440,
          "moon_phase": 0.68,
          "temp": {
            "day": 11.94,
            "min": 6.97,
            "max": 13.5,
            "night": 10.63,
            "eve": 11.2,
            "morn": 8.62
  • Hi Mark,

    mamoworldJSON has no build-in support for arrays. Alternatively you can write such an expression manually.

    You can access array values like this with an expression:
    footage("mamoworld.json").sourceData.daily[3].temp.max

    Cheers,
    Mathias


    Hi! Love what this is helping me achieve. Wondering if it can let me connect to an array - example being weather data - can we connect to [3] in an array called "daily"? Looks like below - array has 7 items, all with repeating info. 

    "daily": [
        {
          "dt": 1653076800,
          "sunrise": 1653049406,
          "sunset": 1653105354,
          "moonrise": 1653035880,
          "moonset": 1653064440,
          "moon_phase": 0.68,
          "temp": {
            "day": 11.94,
            "min": 6.97,
            "max": 13.5,
            "night": 10.63,
            "eve": 11.2,
            "morn": 8.62

  • Mathias,
    Thank you so much!