## OCOLimb(limbopt, sideopt, locationopt, typeopt)

A limb contained in an OCO Doc.
Constructor

#### # new OCOLimb(limbopt, sideopt, locationopt, typeopt)

Creates a new OCO Limb.

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`limb` | `OCO.Limb` | <optional> | OCO.Limb.CUSTOM | A Predefined limb
`side` | `OCO.Side` | <optional> | OCO.Side.NONE | The side of the limb
`location` | `OCO.Location` | <optional> | OCO.Location.NONE | The location of the limb
`type` | `OCO.LimbType` | <optional> | OCO.LimbType.CUSTOM | The type of the limb

View Source Duik_api_fordoc.jsxinc, line 18069

# Members

Type: `OCO.Limb`

#### # static limb

The predefined limb

View Source Duik_api_fordoc.jsxinc, line 18071

Type: `Array.<OCOLimb>`

#### # static limbs

The limbs/ Armatures

View Source Duik_api_fordoc.jsxinc, line 16495

Type: `OCO.Location`

#### # static location

The location of the limb

View Source Duik_api_fordoc.jsxinc, line 18092

Type: `Array.<OCOBone>`

#### # static location

The bones of the limb

View Source Duik_api_fordoc.jsxinc, line 18099

Type: `OCO.Side`

#### # static side

The sided of the limb

View Source Duik_api_fordoc.jsxinc, line 18085

Type: `OCO.LimbType`

#### # static type

The type of the limb

View Source Duik_api_fordoc.jsxinc, line 18078

# Methods

#### # static fromObject(data) → {OCOLimb}

Creates a limb from a js object.

##### Parameters:

Name | Type | Description
--- | --- | ---
`data` | `Object` | The js object representing the limb

View Source Duik_api_fordoc.jsxinc, line 18285

Returns:
The new limb
Type: `OCOLimb`

#### # armatureFromLayers(doc, name, layers) → {OCOBone}

Creates a new chain of bones located on the layer anchor points.

##### Parameters:

Name | Type | Description
--- | --- | ---
`doc` | `OCODoc` | The doc containing the limb.
`name` | `string` | The name of the bones (will increment if needed)
`layers` | `Array.<Layer>` | `LayerCollection` | The layers

View Source Duik_api_fordoc.jsxinc, line 38580

Returns:
The root bone of the new chain
Type: `OCOBone`

#### # armatureFromPath(doc, name, pathProp) → {OCOBone}

Creates a new chain of bones located on the vertices of the path.

##### Parameters:

Name | Type | Description
--- | --- | ---
`doc` | `OCODoc` | The doc containing the limb.
`name` | `string` | The name of the bones (will increment if needed)
`pathProp` | `PropertyGroup` | `DuAEProperty` | The path property (either an "ADBE Vector Shape - Group" or an "ADBE Mask Atom")

View Source Duik_api_fordoc.jsxinc, line 38373

Returns:
The root bone of the new chain
Type: `OCOBone`

#### # armatureFromPuppetPins(doc, name, pins) → {OCOBone}

Creates a new chain of bones located on the puppet pins.

##### Parameters:

Name | Type | Description
--- | --- | ---
`doc` | `OCODoc` | The doc containing the limb.
`name` | `string` | The name of the bones (will increment if needed)
`pins` | `Array.<Property>` | `Array.<DuAEProperty>` | The puppet pins

View Source Duik_api_fordoc.jsxinc, line 38485

Returns:
The root bone of the new chain
Type: `OCOBone`

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

Gets the boundaries of the limb

View Source Duik_api_fordoc.jsxinc, line 18154

Returns:
[left, top, right, bottom]
Type: `Array.<float>`

#### # getBones() → {Array.<OCOBone>}

Gets all the bones sorted by z index

View Source Duik_api_fordoc.jsxinc, line 18250

Returns:
The list of bones
Type: `Array.<OCOBone>`

#### # getLayers() → {Array.<Layer>}

Gets the After Effects layers representing this limb

View Source Duik_api_fordoc.jsxinc, line 38654

Returns:
May be an empty array if this limb has not been created in After Effects yet
Type: `Array.<Layer>`

#### # getLimbs() → {Array.<OCOLimb>}

Recursively gets all the children limbs of this limb

View Source Duik_api_fordoc.jsxinc, line 18140

Returns:
The array of all limbs
Type: `Array.<OCOLimb>`

#### # moveArmatureToLayers(doc, layers)

Moves the armature of the limb to the layers.

##### Parameters:

Name | Type | Description
--- | --- | ---
`doc` | `OCODoc` | The doc containing the limb.
`layers` | `Array.<Layer>` | `LayerCollection` | The layers

View Source Duik_api_fordoc.jsxinc, line 38534

#### # moveArmatureToPath(doc, pathProp)

Moves the armature of the limb to the vertices of the path.

##### Parameters:

Name | Type | Description
--- | --- | ---
`doc` | `OCODoc` | The doc containing the limb.
`pathProp` | `PropertyGroup` | `DuAEProperty` | The path property (either an "ADBE Vector Shape - Group" or an "ADBE Mask Atom")

View Source Duik_api_fordoc.jsxinc, line 38414

#### # moveArmatureToPuppetPins(doc, pins)

Moves the armature of the limb to the puppet pins.

##### Parameters:

Name | Type | Description
--- | --- | ---
`doc` | `OCODoc` | The doc containing the limb.
`pins` | `Array.<Property>` | `Array.<DuAEProperty>` | The puppet pins

View Source Duik_api_fordoc.jsxinc, line 38446

#### # newArmature(name, numopt, lengthopt) → {OCOBone}

Creates a new chain of bones and adds it to the limb.

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`name` | `string` |  |  | The name of the bones (will increment if needed)
`num` | `int` | <optional> | 2 | The number of bones in the chain
`length` | `float` | <optional> | 100.0 | The length in centimeters

View Source Duik_api_fordoc.jsxinc, line 18166

Returns:
The root bone.
Type: `OCOBone`

#### # normalizeZIndices(offsetopt) → {int}

Normalizes the Z indices of all bones so they're positive (including 0) and continuous integers

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`offset` | `int` | <optional> | 0 | An offset/start number

View Source Duik_api_fordoc.jsxinc, line 18233

Returns:
The highest index
Type: `int`

#### # numBones() → {int}

Counts the total number of bones in this limb

View Source Duik_api_fordoc.jsxinc, line 18112

Returns:
Type: `int`

#### # numLimbs() → {int}

Counts the total number of limbs in this limb

View Source Duik_api_fordoc.jsxinc, line 18126

Returns:
Type: `int`

#### # toComp(doc, compopt, parentLayeropt, limbIdopt) → {Array.<Layer>}

Creates the limb and armatures in the comp

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`doc` | `OCODoc` |  |  | The doc containing the limb.
`comp` | `CompItem` | <optional> | DuAEProject.getActiveComp() | The composition to use.
`parentLayer` | `Layer` | <optional> | null | The parent layer of the bone.
`limbId` | `int` | <optional> |  | A Unique identifier for this armature. If omitted, a new one will be assigned.

View Source Duik_api_fordoc.jsxinc, line 38347

Returns:
The new layers
Type: `Array.<Layer>`

#### # toObject() → {Object}

Creates a js object containing this limb data.
This object could then be exported to JSON for example.

View Source Duik_api_fordoc.jsxinc, line 18209

Returns:
The JS Object
Type: `Object`

#### # zBounds() → {Array.<int>}

Finds the maximum and minimum Z index from all bones

View Source Duik_api_fordoc.jsxinc, line 18267

Returns:
The [min, max] Z indices
Type: `Array.<int>`