Constructor
# new DuOCODoc(name)
Creates a new OCO Document.
Parameters:
Name | Type | Description |
---|---|---|
name |
string
|
The name of the character or the meta rig |
Members
Methods
# bounds() → {Array.<float>}
Gets the boundaries of the doc
[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 |
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 |
The arm
# 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 |
The fin
# 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. |
The fish spine
# newHairStrand(numBonesopt) → {DuOCOLimb}
Creates a new hair strand.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
numBones |
int
|
<optional> |
3 | Number of hair bones |
The hair
# 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 |
The leg
# 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 |
The new limb
# 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. |
The snake spine
# 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 |
The spine
# newTail(numBonesopt) → {DuOCOLimb}
Creates a new tail.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
numBones |
int
|
<optional> |
3 | Number of tail bones |
The spine
# 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 |
The wing
# toPixels(point) → {Array.<int>}
Converts a doc coordinate in centimeters to pixel coordinates
Parameters:
Name | Type | Description |
---|---|---|
point |
Array.<float>
|
The coordinate to convert |
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.
This method should be called each time a limb/bone is added/removed/edited and the bounds may change.