@ikijs/editor 0.20.0 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -57,7 +57,7 @@ leaves the document untouched.
57
57
  ## Auto-rig
58
58
 
59
59
  `generateIkiFromLayerSet` turns role-named layers (`face`, `eye_L`, `eye_R`,
60
- `mouth`, plus optional `iris_*`, `brow_*`, `lash_*`, `lash_lower_*`, `hair_front`, `hair_back`,
60
+ and `mouth` — or the lip set `mouth_inner`, `lip_lower`, `lip_upper`, which folds open instead of crossfading — plus optional `iris_*`, `brow_*`, `lash_*`, `lash_lower_*`, `hair_front`, `hair_back`,
61
61
  `body`, `arm_*`, …) into a rigged model that blinks, gazes, opens its mouth, turns its head over
62
62
  a body warp that breathes, follows the head a little and turns on
63
63
  `ParamBodyAngleX/Y/Z`, and emotes with its brows — including a
package/dist/index.d.mts CHANGED
@@ -714,14 +714,17 @@ interface LayerInput {
714
714
  /** Face only: half the opaque span of each crop row, canvas px (0 = none). */
715
715
  rowHalfWidths?: number[];
716
716
  /** `face` / `hair_front` / `hair_back` / `body` / `arm_L` / `arm_R` /
717
- * `forearm_pose_L` / `forearm_pose_R` only:
717
+ * `forearm_pose_L` / `forearm_pose_R` /
718
+ * `mouth_inner` / `lip_lower` / `lip_upper` only:
718
719
  * per crop row, its opaque (alpha ≥ 128) runs as a flat list of canvas
719
720
  * columns `[start0, end0, start1, end1, …]`, each end exclusive (`[]` for a
720
721
  * row with none). The actual pixels, so a gap in the hair is a gap here:
721
722
  * the turn and the nod read off it where back hair is painted behind the
722
723
  * front hair, and the crown's turn reads the face's so it never bares skin.
723
724
  * The body's place the hips (where it splits into legs), and an arm's place
724
- * its shoulder and elbow pivots, a pose forearm's its elbow-end pivot. */
725
+ * its shoulder and elbow pivots, a pose forearm's its elbow-end pivot, and
726
+ * a lip set's place the mouth's opening: the upper line's bottom, the
727
+ * interior's span, the skin's top. */
725
728
  rowRuns?: number[][];
726
729
  /** Nose only: the tight box of its alpha ≥ 128 pixels, canvas px. */
727
730
  denseCore?: {
@@ -768,9 +771,11 @@ declare class TurnTargetError extends Error {
768
771
  constructor(message: string);
769
772
  }
770
773
  /**
771
- * Art geometry the rig cannot build on — today a body whose hips leave no row
772
- * line under its pivots, or too little room for its motion (`body.ts`). A fact about the layers, not a bug, so a
773
- * host reports it as an input error.
774
+ * Art geometry the rig cannot build on — a body whose hips leave no row line
775
+ * under its pivots, or too little room for its motion (`body.ts`), an arm
776
+ * without room for its pivots, a lip set whose interior has no opaque pixel
777
+ * (`mouth.ts`). A fact about the layers, not a bug, so a host reports it as an
778
+ * input error.
774
779
  */
775
780
  declare class LayerGeometryError extends Error {
776
781
  constructor(message: string);
@@ -993,8 +998,9 @@ declare function forearmPoseGeometry(layer: LayerInput): ForearmPoseGeometry;
993
998
  declare function partIdsOfRole(role: string): readonly string[];
994
999
  /**
995
1000
  * Map file names to roles. Throws on an unknown role, a role named twice, a
996
- * required role (`face`, `eye_L`, `eye_R`, `mouth`) missing, an arm without a
997
- * body, or a pose forearm without its arm.
1001
+ * required role (`face`, `eye_L`, `eye_R`) missing, no mouth (`mouth`, or the
1002
+ * lip set) or a partial or mixed one, an arm without a body, or a pose forearm
1003
+ * without its arm.
998
1004
  */
999
1005
  declare function parseLayerRoles(fileNames: string[]): {
1000
1006
  role: string;
@@ -1018,7 +1024,9 @@ declare function parseLayerRoles(fileNames: string[]): {
1018
1024
  * and two ears that lag. Blink, gaze, brows, mouth, breath and
1019
1025
  * hair sway are part warps and bindings under those. The model also declares
1020
1026
  * the default expressions and the Nod, Shake and Tilt motions, and
1021
- * with a pose forearm the Wave (`animations.ts`).
1027
+ * with a pose forearm the Wave (`animations.ts`). The mouth has two paths,
1028
+ * chosen by the layers: `mouth` alone stretches, with `mouth_open` it
1029
+ * crossfades; the lip set folds open like the eyelid (`mouth.ts`).
1022
1030
  */
1023
1031
 
1024
1032
  declare function generateIkiFromLayerSet(layers: LayerInput[], canvas: {
@@ -1158,8 +1166,8 @@ interface LayerSetMeasurer {
1158
1166
  * of it and of the per-role edges), this layer's per-row opaque extent and
1159
1167
  * the `LayerInput` it returns outlive the call, so the host may drop `rgba`
1160
1168
  * as soon as it returns. Returns the layer's `LayerInput` — its crop
1161
- * box, the face's `rowHalfWidths`, the face's, hair layers', body's, arms'
1162
- * and pose forearms' `rowRuns`, the nose's
1169
+ * box, the face's `rowHalfWidths`, the face's, hair layers', body's, arms',
1170
+ * pose forearms' and lip set's `rowRuns`, the nose's
1163
1171
  * `denseCore` unless that is a speck of its crop (`isSpeckCore`) — or
1164
1172
  * `null` for an empty layer, one with no pixel at or above
1165
1173
  * `ALPHA_BBOX_THRESHOLD`, which it records nothing for: the host reports
package/dist/index.d.ts CHANGED
@@ -714,14 +714,17 @@ interface LayerInput {
714
714
  /** Face only: half the opaque span of each crop row, canvas px (0 = none). */
715
715
  rowHalfWidths?: number[];
716
716
  /** `face` / `hair_front` / `hair_back` / `body` / `arm_L` / `arm_R` /
717
- * `forearm_pose_L` / `forearm_pose_R` only:
717
+ * `forearm_pose_L` / `forearm_pose_R` /
718
+ * `mouth_inner` / `lip_lower` / `lip_upper` only:
718
719
  * per crop row, its opaque (alpha ≥ 128) runs as a flat list of canvas
719
720
  * columns `[start0, end0, start1, end1, …]`, each end exclusive (`[]` for a
720
721
  * row with none). The actual pixels, so a gap in the hair is a gap here:
721
722
  * the turn and the nod read off it where back hair is painted behind the
722
723
  * front hair, and the crown's turn reads the face's so it never bares skin.
723
724
  * The body's place the hips (where it splits into legs), and an arm's place
724
- * its shoulder and elbow pivots, a pose forearm's its elbow-end pivot. */
725
+ * its shoulder and elbow pivots, a pose forearm's its elbow-end pivot, and
726
+ * a lip set's place the mouth's opening: the upper line's bottom, the
727
+ * interior's span, the skin's top. */
725
728
  rowRuns?: number[][];
726
729
  /** Nose only: the tight box of its alpha ≥ 128 pixels, canvas px. */
727
730
  denseCore?: {
@@ -768,9 +771,11 @@ declare class TurnTargetError extends Error {
768
771
  constructor(message: string);
769
772
  }
770
773
  /**
771
- * Art geometry the rig cannot build on — today a body whose hips leave no row
772
- * line under its pivots, or too little room for its motion (`body.ts`). A fact about the layers, not a bug, so a
773
- * host reports it as an input error.
774
+ * Art geometry the rig cannot build on — a body whose hips leave no row line
775
+ * under its pivots, or too little room for its motion (`body.ts`), an arm
776
+ * without room for its pivots, a lip set whose interior has no opaque pixel
777
+ * (`mouth.ts`). A fact about the layers, not a bug, so a host reports it as an
778
+ * input error.
774
779
  */
775
780
  declare class LayerGeometryError extends Error {
776
781
  constructor(message: string);
@@ -993,8 +998,9 @@ declare function forearmPoseGeometry(layer: LayerInput): ForearmPoseGeometry;
993
998
  declare function partIdsOfRole(role: string): readonly string[];
994
999
  /**
995
1000
  * Map file names to roles. Throws on an unknown role, a role named twice, a
996
- * required role (`face`, `eye_L`, `eye_R`, `mouth`) missing, an arm without a
997
- * body, or a pose forearm without its arm.
1001
+ * required role (`face`, `eye_L`, `eye_R`) missing, no mouth (`mouth`, or the
1002
+ * lip set) or a partial or mixed one, an arm without a body, or a pose forearm
1003
+ * without its arm.
998
1004
  */
999
1005
  declare function parseLayerRoles(fileNames: string[]): {
1000
1006
  role: string;
@@ -1018,7 +1024,9 @@ declare function parseLayerRoles(fileNames: string[]): {
1018
1024
  * and two ears that lag. Blink, gaze, brows, mouth, breath and
1019
1025
  * hair sway are part warps and bindings under those. The model also declares
1020
1026
  * the default expressions and the Nod, Shake and Tilt motions, and
1021
- * with a pose forearm the Wave (`animations.ts`).
1027
+ * with a pose forearm the Wave (`animations.ts`). The mouth has two paths,
1028
+ * chosen by the layers: `mouth` alone stretches, with `mouth_open` it
1029
+ * crossfades; the lip set folds open like the eyelid (`mouth.ts`).
1022
1030
  */
1023
1031
 
1024
1032
  declare function generateIkiFromLayerSet(layers: LayerInput[], canvas: {
@@ -1158,8 +1166,8 @@ interface LayerSetMeasurer {
1158
1166
  * of it and of the per-role edges), this layer's per-row opaque extent and
1159
1167
  * the `LayerInput` it returns outlive the call, so the host may drop `rgba`
1160
1168
  * as soon as it returns. Returns the layer's `LayerInput` — its crop
1161
- * box, the face's `rowHalfWidths`, the face's, hair layers', body's, arms'
1162
- * and pose forearms' `rowRuns`, the nose's
1169
+ * box, the face's `rowHalfWidths`, the face's, hair layers', body's, arms',
1170
+ * pose forearms' and lip set's `rowRuns`, the nose's
1163
1171
  * `denseCore` unless that is a speck of its crop (`isSpeckCore`) — or
1164
1172
  * `null` for an empty layer, one with no pixel at or above
1165
1173
  * `ALPHA_BBOX_THRESHOLD`, which it records nothing for: the host reports