Dataclay — Automating Digital Production
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Register
    • Login

    Workaround: Expression to mute audio for layers that have been switched off by Templater

    Scheduled Pinned Locked Moved
    Templates
    1
    1
    731
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Jonundefined
      Jon
      last edited by Jon

      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!

      1 Reply Last reply Reply Quote 1
      • First post
        Last post