Class

DuOCODoc

DuOCODoc(name)

An Open Cut-Out character or meta-rig document.
Constructor

# new DuOCODoc(name)

Creates a new OCO Document.
Parameters:
Name Type Description
name string The name of the character or the meta rig

View Source DuAEF_Duik_api.jsxinc, line 14390

Members

Array.<float>

# static centerOfMass

The coordinates of the center of mass of the character. [X, Y].

View Source DuAEF_Duik_api.jsxinc, line 14420

float

# static height

The height of the character. Should always be 1!

View Source DuAEF_Duik_api.jsxinc, line 14406

string

# static name

The name of this OCO Doc

View Source DuAEF_Duik_api.jsxinc, line 14399

string

# static type

The type of this OCO Doc

View Source DuAEF_Duik_api.jsxinc, line 14392

float

# static width

The width of the character.

View Source DuAEF_Duik_api.jsxinc, line 14413

Methods

# static fromComp(nameopt, compopt, emptyopt, selectedLayersopt) → {DoOCODoc}

Creates an OCO doc from the given composition.
Parameters:
Name Type Attributes Default Description
name string <optional>
The name of the character. If omitted, will use the comp name.
comp CompItem <optional>
DuAEProject.getActiveComp() The composition
empty Boolean <optional>
false Set to true to create an empty doc.
selectedLayers Boolean <optional>
false If empty is true, will use only the selected layers

View Source DuAEF_Duik_api.jsxinc, line 34199

The new doc
DoOCODoc

# bounds() → {Array.<float>}

Gets the boundaries of the doc

View Source DuAEF_Duik_api.jsxinc, line 14443

[left, top, right, bottom]
Array.<float>

# fromPixels(point) → {Array.<float>}

Converts a pixel coordinate in pixels to centimeters doc coordinates
Parameters:
Name Type Description
point Array.<int> The coordinate to convert

View Source DuAEF_Duik_api.jsxinc, line 15671

The coordinates in centimeters relative to the doc
Array.<float>

# newArm(typeopt, sideopt, shoulderopt, armopt, forearmopt, handopt, clawsopt, positionopt, locationopt, viewopt) → {DuOCOLimb}

Creates a new arm.
Parameters:
Name Type Attributes Default Description
type DuOCO.LimbType <optional>
DuOCO.LimbType.HOMINOID The type of limb
side DuOCO.Side <optional>
DuOCO.Side.LEFT The side
shoulder Boolean <optional>
false Whether to create a shoulder
arm Boolean <optional>
true Whether to create an arm / humerus
forearm Boolean <optional>
true Whether to create a forearm
hand Boolean <optional>
true Whether to create a hand
claws Boolean <optional>
false Whether to add claws
position Array.<float> <optional>
The position of the first bone of the arm.
If omitted, computed automatically according to the current character in the doc.
location DuOCO.Location <optional>
DuOCO.Location.FRONT The location of the limb
view DuOCO.View <optional>
The view

View Source DuAEF_Duik_api.jsxinc, line 14506

The arm
DuOCOLimb

# newFin(fishbonesopt, positionopt, viewopt) → {DuOCOLimb}

Creates a new fin.
Parameters:
Name Type Attributes Default Description
fishbones int <optional>
5 Number of feathers
position Array.<float> <optional>
The position of the first bone of the arm.
If omitted, computed automatically according to the current character in the doc.
view DuOCO.View <optional>
DuOCO.View.RIGHT The view

View Source DuAEF_Duik_api.jsxinc, line 15559

The fin
DuOCOLimb

# newFishSpine(headopt, spineopt, positionopt) → {DuOCOLimb}

Creates a new fish spine.
Parameters:
Name Type Attributes Default Description
head Boolean <optional>
true Whether to create a head
spine int <optional>
3 Number of spine bones
position Array.<float> <optional>
The position of the first bone of the spine.
If omitted, computed automatically according to the current character in the doc.

View Source DuAEF_Duik_api.jsxinc, line 15477

The fish spine
DuOCOLimb

# newHairStrand(numBonesopt) → {DuOCOLimb}

Creates a new hair strand.
Parameters:
Name Type Attributes Default Description
numBones int <optional>
3 Number of hair bones

View Source DuAEF_Duik_api.jsxinc, line 15180

The hair
DuOCOLimb

# newLeg(typeopt, sideopt, thighopt, calfopt, footopt, clawsopt, positionopt, locationopt, viewopt) → {DuOCOLimb}

Creates a new leg.
Parameters:
Name Type Attributes Default Description
type DuOCO.LimbType <optional>
DuOCO.LimbType.HOMINOID The type of limb
side DuOCO.Side <optional>
DuOCO.Side.LEFT The side
thigh Boolean <optional>
true Whether to create a thigh
calf Boolean <optional>
true Whether to create a calf
foot Boolean <optional>
true Whether to create a foot
claws Boolean <optional>
false Whether to add claws
position Array.<float> <optional>
The position of the first bone of the arm.
If omitted, computed automatically according to the current character in the doc.
location DuOCO.Location <optional>
DuOCO.Location.BACK The location of the limb
view DuOCO.View <optional>
The view

View Source DuAEF_Duik_api.jsxinc, line 14840

The leg
DuOCOLimb

# newLimb(limbopt, sideopt, locationopt, typeopt) → {DuOCOLimb}

Creates a new limb and adds it to the doc
Parameters:
Name Type Attributes Default Description
limb DuOCO.Limb <optional>
DuOCO.Limb.CUSTOM A Predefined limb
side DuOCO.Side <optional>
DuOCO.Side.NONE The side of the limb
location DuOCO.Location <optional>
DuOCO.Location.NONE The location of the limb
type DuOCO.LimbType <optional>
DuOCO.LimbType.CUSTOM The type of the limb

View Source DuAEF_Duik_api.jsxinc, line 14484

The new limb
DuOCOLimb

# newSnakeSpine(headopt, spineopt, positionopt) → {DuOCOLimb}

Creates a new snake spine.
Parameters:
Name Type Attributes Default Description
head Boolean <optional>
true Whether to create a head
spine int <optional>
5 Number of spine bones
position Array.<float> <optional>
The position of the first bone of the arm.
If omitted, computed automatically according to the current character in the doc.

View Source DuAEF_Duik_api.jsxinc, line 15395

The snake spine
DuOCOLimb

# newSpine(headopt, neckopt, spineopt, hipsopt, positionopt, viewopt) → {DuOCOLimb}

Creates a new spine.
Parameters:
Name Type Attributes Default Description
head Boolean <optional>
true Whether to create a head
neck int <optional>
1 Number of neck bones
spine int <optional>
2 Number of spine bones
hips Boolean <optional>
true Whether to create hips
position Array.<float> <optional>
The position of the first bone of the arm.
If omitted, computed automatically according to the current character in the doc.
view DuOCO.View <optional>
The view

View Source DuAEF_Duik_api.jsxinc, line 15031

The spine
DuOCOLimb

# newTail(numBonesopt) → {DuOCOLimb}

Creates a new tail.
Parameters:
Name Type Attributes Default Description
numBones int <optional>
3 Number of tail bones

View Source DuAEF_Duik_api.jsxinc, line 15142

The spine
DuOCOLimb

# newWing(sideopt, armopt, forearmopt, handopt, feathersopt, positionopt, viewopt) → {DuOCOLimb}

Creates a new wing.
Parameters:
Name Type Attributes Default Description
side DuOCO.Side <optional>
DuOCO.Side.LEFT The side
arm Boolean <optional>
true Whether to create an arm / humerus
forearm Boolean <optional>
true Whether to create a forearm
hand Boolean <optional>
true Whether to create a hand
feathers int <optional>
5 Number of feathers
position Array.<float> <optional>
The position of the first bone of the arm.
If omitted, computed automatically according to the current character in the doc.
view DuOCO.View <optional>
DuOCO.View.TOP The view

View Source DuAEF_Duik_api.jsxinc, line 15232

The wing
DuOCOLimb

# toComp(compopt, durationopt, floatopt) → {Array.<Layer>}

Creates the limbs and armatures in the comp
Parameters:
Name Type Attributes Default Description
comp CompItem <optional>
The composition to use. If omitted, creates a new composition.
duration float <optional>
60.0 The duration of the new comp, in seconds.
float frameRate <optional>
24.0 The frame rate of the new comp.

View Source DuAEF_Duik_api.jsxinc, line 34238

The new layers
Array.<Layer>

# toPixels(point) → {Array.<int>}

Converts a doc coordinate in centimeters to pixel coordinates
Parameters:
Name Type Description
point Array.<float> The coordinate to convert

View Source DuAEF_Duik_api.jsxinc, line 15654

The coordinates in pixels relative to the comp
Array.<int>

# updateSize()

Updates the width and height of the character, according to the content.
This method should be called each time a limb/bone is added/removed/edited and the bounds may change.

View Source DuAEF_Duik_api.jsxinc, line 14466