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 DuESF.jsxinc, line 14365

Members

Array.<float>

# static centerOfMass

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

View Source DuESF.jsxinc, line 14395

float

# static height

The height of the character. Should always be 1!

View Source DuESF.jsxinc, line 14381

string

# static name

The name of this OCO Doc

View Source DuESF.jsxinc, line 14374

string

# static type

The type of this OCO Doc

View Source DuESF.jsxinc, line 14367

float

# static width

The width of the character.

View Source DuESF.jsxinc, line 14388

Methods

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

Gets the boundaries of the doc

View Source DuESF.jsxinc, line 14418

[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 DuESF.jsxinc, line 15646

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 DuESF.jsxinc, line 14481

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 DuESF.jsxinc, line 15534

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 DuESF.jsxinc, line 15452

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 DuESF.jsxinc, line 15155

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 DuESF.jsxinc, line 14815

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 DuESF.jsxinc, line 14459

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 DuESF.jsxinc, line 15370

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 DuESF.jsxinc, line 15006

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 DuESF.jsxinc, line 15117

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 DuESF.jsxinc, line 15207

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 DuESF.jsxinc, line 15629

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 DuESF.jsxinc, line 14441