Duik.tools

Duik Tools
Read the Duik User Guide > Tools for more information about each method.
#include 'Duik16_tools_functions.jsxinc'

Members

static copiedExpression

The expression which has been copied by Duik.tools.copyExpression and which can be pasted by Duik.tools.pasteExpression.

static functions

All the tools methods stored as objects which can be parsed easily, for example to automatically build a ui with a button for each method.
Properties:
Name Type Description
name string A display name for the method
fn string The source script to eval

Methods

static align(positionopt, rotationopt, scaleopt, opacityopt)

Align selected Layers to the last selected one
Parameters:
Name Type Attributes Default Description
position boolean <optional>
true Wether to align the position.
rotation boolean <optional>
true Wether to align the rotation.
scale boolean <optional>
true Wether to align the scale.
opacity boolean <optional>
true Wether to align the opacity.

static copyExpression() → {string}

Copies the expression from the selected property. You can paste it with Duik.tools.pasteExpression.
Returns:
string - The expression

static editMode()

Toggle Edit Mode on selected layers.

static pasteExpression(expressionopt)

Pastes the expression previously copied with Duik.tools.copyExpression to the selected properties
Parameters:
Name Type Attributes Description
expression string <optional>
The expression to set. If not provided, will automatically use the expression copied by Duik.tools.copyExpression.

static removeComp(currentCompopt, selectedCompsopt, selectedLayersopt)

Replace all comp("name") occurences by thisComp.
Parameters:
Name Type Attributes Default Description
currentComp bool <optional>
true 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

static removeExpressions(keepPostExpressionValueopt)

Remove expressions from selected properties.
Parameters:
Name Type Attributes Default Description
keepPostExpressionValue bool <optional>
true Set to false to just remove the expressions and get back the pre expression value

static removeThisComp(currentCompopt, selectedCompsopt, selectedLayersopt)

Replace all thisComp occurences by comp("name").
Parameters:
Name Type Attributes Default Description
currentComp bool <optional>
true 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