DuAEF.DuAE.Project

After Effects project methods

Namespaces

XMP

Members

static settings

The Settings of the project, an object similar to DuSettings except that it saves in the Project XMP

Methods

static checkCompNames() → {Object}

Checks if all comps have a different name.
Returns:
Object - The list of names used several times. Check the length attribute to know how many duplicates were found, loop through the keys to get the names. Eech key is an array containing the list of comps with that name.
Example
var dupes = DuAEF.DuAE.Project.checkCompNames();
if (dupes.length != 0) {
for (name in dupes)
{
    if (dupes.hasOwnProperty(name)) alert(dupes[name]); //dupes[name] is an array of Layer
}
}

static collectFiles(destinationopt, overwriteopt, zipopt, createProjectFolderopt)

Collects all dependencies in a folder
Parameters:
Name Type Attributes Default Description
destination Folder <optional>
The folder where to save the files. The project files will be collected in a subfolder called "project name.aep.archive" or "project name.aep.zip". If not provided, will use the current folder.
overwrite boolean <optional>
false Wether to overwrite existing footage in the destination.
zip boolean <optional>
false Set to true to automatically zip the archive.
createProjectFolder boolean <optional>
true Wether to create a folder for this project or use the destination as is.

static expressionEngine() → {string}

The Expressions Engine setting in the Project Settings dialog box, as a string.
Returns:
string - One of: "extendscript", "javascript-1.0"

static getActiveComp() → {CompItem|null}

Gets the After Effects current composition
Returns:
CompItem | null - The current composition or null if there's no current comp

static getComps(rootOnlyopt) → {Array.<CompItem>}

Gets all compositions in the project (or only the root of the project, ignoring subfolders)
Parameters:
Name Type Attributes Default Description
rootOnly boolean <optional>
false Set to true to get only comps from the root of the project
Returns:
Array.<CompItem> - The compositions

static getItemById() → {Item|null}

Retrieves an item by its Item ID
Returns:
Item | null - The item

static getItemByName() → {Item|null}

Retrieves the first item with the given name
Returns:
Item | null - The item

static getSize() → {int}

Gets the size of the current project file
Returns:
int - the size in Bytes. -1 if it has not been saved yet.

static newUniqueCompName(newName, comp, incrementopt) → {string}

Generates a new unique name for a composition
Parameters:
Name Type Attributes Default Description
newName string The wanted new name
comp CompItem The comp
increment boolean <optional>
true true to automatically increment the new name if it already ends with a digit
Returns:
string - The unique name, with a new number at the end if needed.

static reduce(compsopt, keepExpressionOnlyopt)

Reduces the project, the same way the native command does it, but being able to keep comps used only by expressions.
Parameters:
Name Type Attributes Default Description
comps CompItem | Array.<CompItem> <optional>
The name or the id of the comp(s) to keep. If omitted, it will use all comps at the root of the project (the ones not in a subfolder).
keepExpressionOnly boolean <optional>
true Set to false to ignore comps used only by expressions (same as the native command)

static reduceSelected(keepExpressionOnlyopt)

Reduces the project using the selected compositions, the same way the native command does it, but being able to keep comps used only by expressions. If there's no comp selected, will use all comps at the root of the project.
Parameters:
Name Type Attributes Default Description
keepExpressionOnly boolean <optional>
true Set to false to ignore comps used only by expressions (same as the native command)

static removeCompInExpressions(selectedCompsopt)

Replace all comp("name") occurences by thisComp.
Parameters:
Name Type Attributes Default Description
selectedComps bool <optional>
false true to replace only in selected compositions

static removeThisCompInExpressions(selectedCompsopt)

Replace all thisComp occurences by comp("name").
Parameters:
Name Type Attributes Default Description
selectedComps bool <optional>
false true to replace only in selected compositions

static replaceInExpressions(oldString, newString, caseSensitiveopt)

Replaces text in Expressions
Parameters:
Name Type Attributes Default Description
oldString string The string to replace
newString string The new string
caseSensitive boolean <optional>
true Wether the search has to be case sensitive

static setProgressMode(inProgressopt)

Sets the project in "waiting mode" to speed up things.
Parameters:
Name Type Attributes Default Description
inProgress bool <optional>
true True to set progress mode, false to stop it.

static setUniqueCompNames(compsopt)

Makes sure all compositions in the project have unique names, renaming them if needed.
Parameters:
Name Type Attributes Description
comps Array | ItemCollection <optional>
A list of comps, all of them by default

static updateExpressionCache(currentCompopt, selectedCompsopt, selectedLayersopt)

Updates the cache of the expressions used by Duik to speed up batch process of expressions in the whole project.
It's automatically run when needed if it's not been updated in a long time (1 mn) or if it's empty
Parameters:
Name Type Attributes Default Description
currentComp bool <optional>
false true: in current compositions, false: in all compositions of the project
selectedComps bool <optional>
false When currentComp is false, true to replace only in selected compositions
selectedLayers bool <optional>
false When currentComp is true, wether to replace only on selected layers
Deprecated: