Workaround: Expression to mute audio for layers that have been switched off by Templater
-
Currently, there is a bug in Templater where layers (footage or compositions) that are being targeted within your data source to be switched off with an {{off}} flag won’t disable the layer’s audio switch. We have plans to correct this in a future version of Templater, but in the meantime, you can correct this behavior by applying an expression to the Audio Levels of the layer/layers you wish to mute.
mute = -192; aud = audio.audioLevels; if(thisLayer.enabled == false) [mute,mute] else [aud[0],aud[1]];
EDIT:
As of After Effects 2019, changes to AE’s Javascript/expression engine have made it so that the if/else statements need to be strict, standardized JS syntax. To reflect that, you would just need to tweak the above expression. This expression is also backwards compatible.mute = -192; aud = audio.audioLevels; if(thisLayer.enabled == false) {[mute,mute];} else {aud;};
That’s it!