From bf044ca1276159a1ffaadcb7134de934ab0ccde8 Mon Sep 17 00:00:00 2001 From: Daniel Wolf Date: Sat, 1 Sep 2018 20:48:13 +0200 Subject: [PATCH] Update After Effects plugin to support non-WAVE audio files --- extras/AdobeAfterEffects/README.md | 2 +- extras/AdobeAfterEffects/Rhubarb Lip Sync.jsx | 15 ++++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/extras/AdobeAfterEffects/README.md b/extras/AdobeAfterEffects/README.md index 5e32572..dd300b9 100644 --- a/extras/AdobeAfterEffects/README.md +++ b/extras/AdobeAfterEffects/README.md @@ -26,5 +26,5 @@ On **OS X**, that directory is usually `Applications/Adobe After Effects Scripts > Rhubarb Lip Sync.jsx*. That will open a dialog window where you can specify the WAVE file with the dialog recording and a number of other options. To get information about any input field, just hover above it with your mouse and you'll see a tooltip. +In After Effects, select *File > Scripts > Rhubarb Lip Sync.jsx*. That will open a dialog window where you can specify the audio file with the dialog recording and a number of other options. To get information about any input field, just hover above it with your mouse and you'll see a tooltip. \ No newline at end of file diff --git a/extras/AdobeAfterEffects/Rhubarb Lip Sync.jsx b/extras/AdobeAfterEffects/Rhubarb Lip Sync.jsx index d04d40b..d8dbfcd 100644 --- a/extras/AdobeAfterEffects/Rhubarb Lip Sync.jsx +++ b/extras/AdobeAfterEffects/Rhubarb Lip Sync.jsx @@ -266,13 +266,10 @@ function selectByTextOrFirst(itemControl, text) { } } -function getWaveFileProjectItems() { +function getAudioFileProjectItems() { var result = toArrayBase1(app.project.items).filter(function(item) { var isAudioFootage = item instanceof FootageItem && item.hasAudio && !item.hasVideo; - if (!isAudioFootage) return false; - - var isWaveFile = item.file && item.file.exists && item.file.name.match(/\.wav$/i); - return isWaveFile; + return isAudioFootage; }); return result; } @@ -322,7 +319,7 @@ function createDialogWindow() { }), value: DropDownList({ helpTip: 'An audio file containing recorded dialog.\n' - + 'This field shows all audio files of type .wav that exist in ' + + 'This field shows all audio files that exist in ' + 'your After Effects project.' }) }), @@ -400,7 +397,7 @@ function createDialogWindow() { }); // Add audio file options - getWaveFileProjectItems().forEach(function(projectItem) { + getAudioFileProjectItems().forEach(function(projectItem) { var listItem = controls.audioFile.add('item', getItemPath(projectItem)); listItem.projectItem = projectItem; }); @@ -618,8 +615,8 @@ function createDialogWindow() { frameRate) { // Find an unconflicting comp name - // ... strip extension .wav, if present - var baseName = audioFileFootage.name.match(/^(.*?)(\.wav)?$/i)[1]; + // ... strip extension, if present + var baseName = audioFileFootage.name.match(/^(.*?)(\..*)?$/i)[1]; var compName = baseName; // ... add numeric suffix, if needed var existingItems = toArrayBase1(targetProjectFolder.items);