Copy link to clipboard
Copied
Testing the AE CC 2018 release. So I added some text to the stage and loaded a JSON file into my project. After I created an expression that would read a value from the JSON datasource, AE correctly showed that value in the text placeholder. So far so good, but if I render the project in AME (2018 of course) it just shows 'Text' and not the value from the JSON file. Rendering in AE itself did work as expected. Am I missing something here?
Copy link to clipboard
Copied
OK, solved it myself. You have to add the JSON file as a layer (and then hide it). Now rendering works in both AE and AME
Copy link to clipboard
Copied
Thanks for posting your solution. I was experiencing basically the same issue when trying to use aerender.exe from the command line. Adding the JSON file to the comp then hiding it solved the issue in my case as well!!
Copy link to clipboard
Copied
Yes, for certain situations (see list below) you need to add the JSON file to the composition. You don't need to hide it (turn off the layer visibility eyeball), as it doesn't have video or audio properties, and won't affect the render. But neither would it hurt anything to do that if you want.
The affected commands include: Add to Adobe Media Encoder Queue, Export Motion Graphics Template, Reduce Project, Remove Unused Footage, Collect Files with "Collect source files" set to anything but "All"
Here's what's going on behind the scenes:
The expression methods that reference JSON files, sourceData and sourceText, are footage attributes (ex, footage("sample.json").sourceData). They refer to the footage object in the project file, and therefore rely on the JSON file being imported into the project. The JSON file isn't required to be in the comp for the expressions to work, as it's not referenced there, only in the project.
The problem comes in when you use the commands listed above: After Effects walks the dependency list for the given composition to find all dependent files in the project, but it doesn't yet know how to inspect for dependencies in expressions. It therefore misses the dependency of the sourceData and sourceText attributes.
This problem isn't limited to the sourceData and sourceText attributes, either. Any expression that refers to attributes of footage that aren't added to the composition could have the same issue when you use the above commands.
The difficulty here is that inspecting expressions for dependencies can be very slow. After Effects would have to check every property in a comp for expressions, and then check every line of any expression for footage references. What is needed is a better way of scanning expressions for file dependencies that is fast; we hope to work on that in the future.
Until we can provide an automated solution, the workaround is to add the JSON file to the composition.
Copy link to clipboard
Copied
Thanks guys - unfortunately I have the same problem and adding the Json layer to the comp before adding it to the AME render queue has NOT solved it. AE renders work fine, though. Any idea how I would make it work?
Copy link to clipboard
Copied
I have this issue still after adding the JSON to the composition that I want to render in Encoder, there is still no fix or a better workaround? Thanks for any suggestions.
Copy link to clipboard
Copied
Oh! Thank you very much! I was wondering why some compositions were rendered ok and others not! This's very helpful
Copy link to clipboard
Copied
As I see now Adobe hasnt worked on it so far. Otherwise a notifications on that workaround would save hours of searching this Aftereffects JSON Mediaencoder solution. Is XML than a better option?
Copy link to clipboard
Copied
Having the same issue with CSV/TXT. Super annoying.
Copy link to clipboard
Copied
Thank you have the json file in the comp worked for me.