Data driven expression
Hi, any help much appreciated! I'm a novice when it comes to scripting in AE, and was wondering if someone knew how to write an expression that would either control the opacity of a layer (to make it visible or not) or toggle the visibility of the layer (if that's possible).
I have an AE template with a set of 12 presenter images in it. What I want to do is automate which presenter is made visible.
This would need to be controlled by an external JSON script, so for instance in my JSON script, I have :
[
{
"Reporter": "presenter_john_smith"
}
]
What I want to do, is if "presenter_john_smith" is present in the JSON, then this presenter image shows up at 100% opacity in the comp, all the other presenters will have the same expression, but are looking for a different name in the JSON, so will be opacity 0. This is what i've put in the opacity as an expression, which doesn't work:
myData = footage("presenters.json").sourceData[0];
data = myData.Reporter("presenter_john_smith") = active;100
Does that make sense? Hope someone can help!
