3 people found this helpful
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
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!!
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.