DuAEF.Duik.Structure

Structures

Members

static color :Array.<float>

The default color for new structures
Default Value:
  • DuAEF.DuJS.Color.Colors.RANDOM

static linkLayers :bool

Whether to auto link layers to structure elements on creation
Default Value:
  • true

static linkPaths :bool

Whether to auto link bezier paths to structure elements on creation
Default Value:
  • true

static linkPins :bool

Whether to auto link puppet pins to structure elements on creation
Default Value:
  • true

static, readonly SelectionModes :int

How to get structures depending on selection
All structure, only children elements, or only selected element
Properties:
Name Type Description
STRUCTURE int
CHILDREN int
ELEMENT int
ALL int

static size :int

The default size for new structures if structureSizeHint is DuAEF.Duik.Sizes.CUSTOM
Default Value:
  • 100

static sizeHint :int

Size hint of structure elements
Default Value:
  • DuAEF.Duik.Sizes.SMALL

static, readonly Strings :string

Translatable strings used to name layers and effects
These strings are translated at init time using the tr function from DuAEF.Dutranslator.
Properties:
Name Type Description
STRUCTURE string
SHOULDER string
ARM string
FOREARM string
HAND string
CLAWS string
HOOF string
HEEL string
ARM_TIP string
THIGH string
CALF string
FOOT string
TOES string
TIPTOE string
HIPS string
SPINE string
NECK string
HEAD string
SPINE_TIP string
TAIL string
TAIL_TIP string

Methods

static addStructure(numopt, compopt, nameopt, idopt) → {Structure}

Creates a structure in a composition. If path properties are selected, will create the structures on the vertices, if puppet pins, on the pins, else if layers, on the layers if they are not aligned.
Parameters:
Name Type Attributes Default Description
num int <optional>
2 The number of elements of the structure.
comp CompItem <optional>
The composition where to create the Structure. Default is the active item, if it's a comp.
name string <optional>
"Name" The name of the structure (used as layer names)
id int <optional>
An identifier for this structure
Returns:
Structure - The Structure

static addStructureElement(comp, coloropt, sizeopt) → {ShapeLayer}

Creates an element for a structure in a composition
Parameters:
Name Type Attributes Default Description
comp CompItem The composition where to create the Structure
color Array.<float> <optional>
[1,0.764,0.764,1] The color of the element, [R,G,B,A] Array from 0.0 to 1.0
size float <optional>
The element size, a percentage. By default, it will adjust automatically depending on comp size and DuikLib.structureSizeHint
Returns:
ShapeLayer - The element

static addStructures(numopt, compopt, nameopt, forceNumopt, reverseAutoLinkopt) → {Array.<Structure>}

Creates structures in a composition. If path properties are selected, will create the structures on the vertices, if puppet pins, on the pins, else if layers, on the layers if they are not aligned.
Parameters:
Name Type Attributes Default Description
num int <optional>
2 The number of elements of the structure.
comp CompItem <optional>
The composition where to create the Structure. Default is the active item, if it's a comp.
name string <optional>
"Name" The name of the structure (used as layer names)
forceNum bool <optional>
false When true, the strucutre will have num elements even if there is less items in the selection (but will respect the selection if it is bigger)
reverseAutoLink bool <optional>
false When true, the preference to force auto linking is reversed (!DuAEF.Duik.Structure.linkPaths)
Returns:
Array.<Structure> - The Structures

static addStructureToLayers(layers, numopt, forceNumopt, reverseAutoLinkopt) → {Structure}

Adds a Structure to the layers. Will return an empty structure if all the layers are at the same place.
Parameters:
Name Type Attributes Default Description
layers Array.<Layer> The layers
num int <optional>
The number of elements of the structure.
forceNum bool <optional>
false When true, the strucutre will have num elements even if there is less items in the selection (but will respect the selection if it is bigger)
reverseAutoLink bool <optional>
false When true, the preference to force auto linking is reversed (!DuAEF.Duik.Structure.linkPaths)
Returns:
Structure - The new Structure

static addStructureToPath(pathProperty, numopt, forceNumopt, reverseAutoLinkopt, idopt) → {Structure}

Adds a Structure to the Bezier Path
Parameters:
Name Type Attributes Default Description
pathProperty Property | PropertyInfo The path
num int <optional>
The number of elements of the structure.
forceNum bool <optional>
false When true, the strucutre will have num elements even if there is less items in the selection (but will respect the selection if it is bigger)
reverseAutoLink bool <optional>
false When true, the preference to force auto linking is reversed (!DuAEF.Duik.Structure.linkPaths)
id int <optional>
An identifier for this structure
Returns:
Structure - The new Structure

static addStructureToPuppetEffect(puppetEffect, numopt, forceNumopt, reverseAutoLinkopt) → {Structure}

Adds a Structure to the Puppet Effect. Elements will be parented in the order of the pins in the stack
Parameters:
Name Type Attributes Default Description
puppetEffect PropertyGroup | PropertyInfo The puppet effect
num int <optional>
The number of elements of the structure.
forceNum bool <optional>
false When true, the strucutre will have num elements even if there is less items in the selection (but will respect the selection if it is bigger)
reverseAutoLink bool <optional>
false When true, the preference to force auto linking is reversed (!DuAEF.Duik.Structure.linkPaths)
Returns:
Structure - The new Structure

static addStructureToPuppetPins(puppetPins, numopt, forceNumopt, reverseAutoLinkopt) → {Structure}

Adds a Structure to the Puppet Pins. Elements will be parented in the order of the Array.
Parameters:
Name Type Attributes Default Description
puppetPins Array.<Property> | Array.<PropertyInfo> The pins
num int <optional>
The number of elements of the structure.
forceNum bool <optional>
false When true, the strucutre will have num elements even if there is less items in the selection (but will respect the selection if it is bigger)
reverseAutoLink bool <optional>
false When true, the preference to force auto linking is reversed (!DuAEF.Duik.Structure.linkPaths)
Returns:
Structure - The new Structure

static bakeAppearence(layer)

"Bakes" the appearance of the Structure,
in order to improve performance and simplify the use of the rig when animating.
Parameters:
Name Type Description
layer Layer the element

static createArm(shoulderopt, humerusopt, radiusopt, handopt, clawsopt, leftopt, typeopt, compopt, originPositionopt, symetryopt) → {Structure|null}

Creates a predefined structure for an arm.
Parameters:
Name Type Attributes Default Description
shoulder boolean <optional>
false true if the arm has a shoulder.
humerus boolean <optional>
true true if the arm has a humerus.
radius boolean <optional>
true true if the arm has a radius.
hand boolean <optional>
true true if the arm has a hand.
claws boolean <optional>
false true if the arm has claws.
left boolean <optional>
false true if this is a Left arm, false for a Right arm
type DuAEF.Duik.Autorig.AnimalTypes <optional>
DuAEF.Duik.Autorig.AnimalTypes.PLANTIGRADE the type of animal
comp CompItem <optional>
The composition where to create the structure. By default, will try with the active item, if any.
originPosition Array.<Number> <optional>
The coordinates in the comp of the first element of the structure.
symetry boolean <optional>
false changes the coordinates of the humerus, applying a symetry on the shoulder (if any).
Returns:
Structure | null - The structure.

static createLeg(femuropt, tibiaopt, footopt, toesopt, leftopt, typeopt, compopt, originPositionopt) → {Structure|null}

Creates a predefined structure for an leg.
Parameters:
Name Type Attributes Default Description
femur boolean <optional>
true true if the leg has a shoulder.
tibia boolean <optional>
true true if the leg has a humerus.
foot boolean <optional>
true true if the leg has a radius.
toes boolean <optional>
true true if the leg has a hand.
left boolean <optional>
false true if this is a Left leg, false for a Right leg
type DuAEF.Duik.Autorig.AnimalTypes <optional>
DuAEF.Duik.Autorig.AnimalTypes.PLANTIGRADE the type of animal
comp CompItem <optional>
The composition where to create the structure. By default, will try with the active item, if any.
originPosition Array.<Number> <optional>
The coordinates in the comp of the first element of the structure.
Returns:
Structure | null - The structure.

static createSpine(hipsopt, spineCountopt, neckCountopt, headopt, compopt, originPositionopt) → {Structure|null}

Creates a predefined structure for an spine / neck / head.
Parameters:
Name Type Attributes Default Description
hips boolean <optional>
true true if the spine has a hips.
spineCount int <optional>
2 the number of elements for the spine
neckCount int <optional>
1 the number of elements for the neck
head boolean <optional>
true true if the spine has a hand.
comp CompItem <optional>
The composition where to create the structure. By default, will try with the active item, if any.
originPosition Array.<Number> <optional>
The coordinates in the comp of the first element of the structure.
Returns:
Structure | null - The structure.

static createTail(elementCountopt, compopt) → {Structure|null}

Creates a predefined structure for a tail.
Parameters:
Name Type Attributes Default Description
elementCount int <optional>
2 the number of elements for the tail
comp CompItem <optional>
The composition where to create the structure. By default, will try with the active item, if any.
Returns:
Structure | null - The structure.

static getStructureLayers(compopt, selectedOnlyopt) → {Array.<ShapeLayer>}

Gets structures in the comp or the selection.
Parameters:
Name Type Attributes Default Description
comp CompItem <optional>
The composition where to get the structure layers
selectedOnly boolean <optional>
false Selected layers only
Returns:
Array.<ShapeLayer> - The structure layers.

static getStructures(compopt, structureSelectionModeopt) → {Array.<Structure>}

Gets structures in the comp. If some layers are selected, uses selectionMode, else returns all structure elements found.
Parameters:
Name Type Attributes Default Description
comp CompItem <optional>
app.project.activeItem The composition where to get the structures
structureSelectionMode int <optional>
DuAEF.Duik.Structure.SelectionModes.STRUCTURE The selection mode. One of DuAEF.Duik.Structure.SelectionModes
Returns:
Array.<Structure> - The structures. If selectionMode is DuAEF.Duik.Structure.SelectionModes.ELEMENT, will be one structure with all elements found

static resetTransform(layer)

Resets the transformations (rotation and scale) of the element to 0 and 100%
Parameters:
Name Type Description
layer Layer the element

static selectStructures(compopt, structureSelectionModeopt) → {Array.<Structure>}

Selects structures in the comp. If some layers are selected, uses selectionMode, else returns selects all structure elements found.
Parameters:
Name Type Attributes Default Description
comp CompItem <optional>
app.project.activeItem The composition where to select the structures
structureSelectionMode int <optional>
DuAEF.Duik.Structure.SelectionModes.STRUCTURE The selection mode. One of DuAEF.Duik.Structure.SelectionModes
Returns:
Array.<Structure> - The structures. If selectionMode is DuAEF.Duik.Structure.SelectionModes.ELEMENT, will be one structure with all elements found