## 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 14363

# Members

Type: `Array.<float>`

#### # static centerOfMass

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

View Source DuAEF_Duik_api.jsxinc, line 14393

Type: `float`

#### # static height

The height of the character. Should always be 1!

View Source DuAEF_Duik_api.jsxinc, line 14379

Type: `string`

#### # static name

The name of this OCO Doc

View Source DuAEF_Duik_api.jsxinc, line 14372

Type: `string`

#### # static type

The type of this OCO Doc

View Source DuAEF_Duik_api.jsxinc, line 14365

Type: `float`

#### # static width

The width of the character.

View Source DuAEF_Duik_api.jsxinc, line 14386

# 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 33741

Returns:
The new doc
Type: `DoOCODoc`

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

Gets the boundaries of the doc

View Source DuAEF_Duik_api.jsxinc, line 14416

Returns:
[left, top, right, bottom]
Type: `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 15658

Returns:
The coordinates in centimeters relative to the doc
Type: `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 14479

Returns:
The arm
Type: `DuOCOLimb`

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

Creates a new fin.

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`side` | `DuOCO.Side` | <optional> | DuOCO.Side.LEFT | The side
`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 15544

Returns:
The fin
Type: `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 15459

Returns:
The fish spine
Type: `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 15157

Returns:
The hair
Type: `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 14814

Returns:
The leg
Type: `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 14457

Returns:
The new limb
Type: `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 15375

Returns:
The snake spine
Type: `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 15006

Returns:
The spine
Type: `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 15118

Returns:
The spine
Type: `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 15210

Returns:
The wing
Type: `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 33780

Returns:
The new layers
Type: `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 15641

Returns:
The coordinates in pixels relative to the comp
Type: `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 14439