Renamed to "Rhubarb Lip Sync" within After Effects script

This commit is contained in:
Daniel Wolf 2017-07-10 20:19:36 +02:00
parent 2f1586624a
commit 2b44268d60
1 changed files with 12 additions and 10 deletions

View File

@ -106,6 +106,8 @@ function isFrameVisible(compItem, frameNumber) {
return Boolean(result); return Boolean(result);
} }
var appName = 'Rhubarb Lip Sync';
var settingsFilePath = Folder.userData.fullName + '/rhubarb-ae-settings.json'; var settingsFilePath = Folder.userData.fullName + '/rhubarb-ae-settings.json';
function readTextFile(fileOrPath) { function readTextFile(fileOrPath) {
@ -307,7 +309,7 @@ function createDialogWindow() {
with (controlFunctions) { with (controlFunctions) {
resourceString = createResourceString( resourceString = createResourceString(
Dialog({ Dialog({
text: 'Rhubarb Lip-Sync', text: appName,
settings: Group({ settings: Group({
orientation: 'column', orientation: 'column',
alignChildren: ['left', 'top'], alignChildren: ['left', 'top'],
@ -534,7 +536,7 @@ function createDialogWindow() {
false, false,
'Fix composition setting?'); 'Fix composition setting?');
if (fix) { if (fix) {
app.beginUndoGroup('Rhubarb Lip-Sync: Mouth composition setting'); app.beginUndoGroup(appName + ': Mouth composition setting');
comp.preserveNestedFrameRate = true; comp.preserveNestedFrameRate = true;
app.endUndoGroup(); app.endUndoGroup();
} else { } else {
@ -547,9 +549,9 @@ function createDialogWindow() {
var match = version.match(/Rhubarb Lip Sync version ((\d+)\.(\d+).(\d+))/); var match = version.match(/Rhubarb Lip Sync version ((\d+)\.(\d+).(\d+))/);
if (!match) { if (!match) {
var instructions = osIsWindows var instructions = osIsWindows
? 'Make sure your PATH environment variable contains the Rhubarb Lip-Sync ' ? 'Make sure your PATH environment variable contains the ' + appName + ' '
+ 'application directory.' + 'application directory.'
: 'Make sure you have created this file as a symbolic link to the Rhubarb Lip-Sync ' : 'Make sure you have created this file as a symbolic link to the ' + appName + ' '
+ 'executable (rhubarb).'; + 'executable (rhubarb).';
return 'Cannot find executable file "' + rhubarbPath + '". \n' + instructions; return 'Cannot find executable file "' + rhubarbPath + '". \n' + instructions;
} }
@ -557,7 +559,7 @@ function createDialogWindow() {
var major = Number(match[2]); var major = Number(match[2]);
var minor = Number(match[3]); var minor = Number(match[3]);
if (major != 1 || minor < 6) { if (major != 1 || minor < 6) {
return 'This script requires Rhubarb Lip-Sync 1.6.0 or a later 1.x version. ' return 'This script requires ' + appName + ' 1.6.0 or a later 1.x version. '
+ 'Your installed version is ' + versionString + ', which is not compatible.'; + 'Your installed version is ' + versionString + ', which is not compatible.';
} }
} }
@ -593,7 +595,7 @@ function createDialogWindow() {
// Try to extract only the actual error message // Try to extract only the actual error message
var match = fatalLog.match(/\[Fatal\] ([\s\S]*)/); var match = fatalLog.match(/\[Fatal\] ([\s\S]*)/);
var message = match ? match[1] : fatalLog; var message = match ? match[1] : fatalLog;
throw new Error('Error running Rhubarb Lip-Sync.\n' + message); throw new Error('Error running ' + appName + '.\n' + message);
} }
} }
@ -668,12 +670,12 @@ function createDialogWindow() {
var mouthCues = generateMouthCues(audioFileFootage, dialogText, mouthComp, var mouthCues = generateMouthCues(audioFileFootage, dialogText, mouthComp,
extendedMouthShapeNames, targetProjectFolder, frameRate); extendedMouthShapeNames, targetProjectFolder, frameRate);
app.beginUndoGroup('Rhubarb Lip-Sync: Animation'); app.beginUndoGroup(appName + ': Animation');
animateMouthCues(mouthCues, audioFileFootage, mouthComp, targetProjectFolder, animateMouthCues(mouthCues, audioFileFootage, mouthComp, targetProjectFolder,
frameRate); frameRate);
app.endUndoGroup(); app.endUndoGroup();
} catch (e) { } catch (e) {
Window.alert(e.message, 'Rhubarb Lip-Sync', true); Window.alert(e.message, appName, true);
return; return;
} }
} }
@ -695,7 +697,7 @@ function createDialogWindow() {
var validationError = validate(); var validationError = validate();
if (typeof validationError === 'string') { if (typeof validationError === 'string') {
if (validationError) { if (validationError) {
Window.alert(validationError, 'Rhubarb Lip-Sync', true); Window.alert(validationError, appName, true);
} }
} else { } else {
window.close(); window.close();
@ -724,7 +726,7 @@ function checkPreconditions() {
if (!canWriteFiles()) { if (!canWriteFiles()) {
Window.alert('This script requires file system access.\n\n' Window.alert('This script requires file system access.\n\n'
+ 'Please enable Preferences > General > Allow Scripts to Write Files and Access Network.', + 'Please enable Preferences > General > Allow Scripts to Write Files and Access Network.',
'Rhubarb Lip-Sync', true); appName, true);
return false; return false;
} }
return true; return true;