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_DuSan_api.jsxinc, line 14350

Members

Array.<float>

# static centerOfMass

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

View Source DuAEF_DuSan_api.jsxinc, line 14380

float

# static height

The height of the character. Should always be 1!

View Source DuAEF_DuSan_api.jsxinc, line 14366

string

# static name

The name of this OCO Doc

View Source DuAEF_DuSan_api.jsxinc, line 14359

string

# static type

The type of this OCO Doc

View Source DuAEF_DuSan_api.jsxinc, line 14352

float

# static width

The width of the character.

View Source DuAEF_DuSan_api.jsxinc, line 14373

Methods

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

Gets the boundaries of the doc

View Source DuAEF_DuSan_api.jsxinc, line 14403

[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_DuSan_api.jsxinc, line 15645

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_DuSan_api.jsxinc, line 14466

The arm
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_DuSan_api.jsxinc, line 15531

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_DuSan_api.jsxinc, line 15446

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_DuSan_api.jsxinc, line 15144

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_DuSan_api.jsxinc, line 14801

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_DuSan_api.jsxinc, line 14444

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_DuSan_api.jsxinc, line 15362

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_DuSan_api.jsxinc, line 14993

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_DuSan_api.jsxinc, line 15105

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_DuSan_api.jsxinc, line 15197

The wing
DuOCOLimb

# 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_DuSan_api.jsxinc, line 15628

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_DuSan_api.jsxinc, line 14426