@ikijs/editor 0.12.1 → 0.13.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
@@ -62,16 +62,17 @@ leaves the document untouched.
62
62
  a torso that breathes, and emotes with its brows — including a
63
63
  hair-sway physics rig when a `hair_front` layer is present.
64
64
 
65
- The rig reproduces a Live2D default rig, measured on the Cubism sample models
66
- (the numbers are in `auto-rig/profile.ts`): the turn reads through parallax,
67
- not a reshaped face. The face plate translates, changing its width by a few
68
- percent, the chin leading it; the features lead the plate by their own amounts
69
- (the nose most, then the brows, eyes and mouth), the eyes foreshortening mildly
65
+ The rig turns the head by parallax, not a reshaped face, with values of our
66
+ own picked by eye (`auto-rig/profile.ts`, `AUTO-RIG.md`). The face plate
67
+ translates, the chin leading it; the features lead the plate by their depth
68
+ (the nose most, then the eyes, brows and mouth), the eyes foreshortening mildly
70
69
  about their own centres; the front hair rides the face where it lies over it and holds the head's
71
- outline where it draws it, and the back hair stays behind; the neck and the
70
+ outline where it draws it — though on its cap the turn never carries its outer
71
+ edge further outside the back hair painted behind it than the nod alone does —
72
+ and the back hair stays behind; the neck and the
72
73
  ears the face layer paints are cut off into islands of the plate's own mesh,
73
74
  drawn behind the head — the neck stays (only the chin's shade slides across
74
- it), the ears lag the face. AngleZ rolls the head 10° about the chin; the torso only
75
+ it), the ears lag the face, the far one narrowing. AngleZ rolls the head 14° about the chin; the torso only
75
76
  breathes.
76
77
 
77
78
  On a layer set with a `nose`, `options.turnTargets` — the cues a 30° reference
@@ -80,7 +81,7 @@ whether the silhouette holds) — are **fitted** each by the one knob it reads:
80
81
  the turn's amount, the eyes' foreshortening, the hair's width, a feature's own
81
82
  shift. With none given the profile itself renders (`DEFAULT_TURN_TARGETS`
82
83
  expresses it in the cues' units). `options.style` tunes a character from the
83
- profile where the Live2D samples themselves disagree: the whole turn, the
84
+ profile: the whole turn, the
84
85
  features' lead, the front hair's follow and its outline's, the blink and the
85
86
  hair sway. The turn
86
87
  is bounded by the art: the far eye stays inside the plate's outline and, given
@@ -95,9 +96,11 @@ how much it covers at rest, and whether the bound held.
95
96
  An `eyeShift` you passed that runs past the room the art leaves the far eye —
96
97
  the face plate's edge, or the bangs' strand — is **clamped** and the rig is
97
98
  built, since that room is a fact about these layers, not about the reference;
98
- so is the profile's own turn where the art has less room than it needs. Every
99
- other target you passed that this layer set cannot reach **throws**, naming the
100
- field and the range it could have had: a `farEyeRatio` or `silhouetteRatio`
99
+ so is the profile's own turn where the art has less room than it needs, and
100
+ a `silhouetteRatio` that would narrow a plate drawn without hair too far for
101
+ its head to cover the far ear's slide (see AUTO-RIG.md). Every other target
102
+ you passed that this layer set cannot reach **throws**, naming the field and
103
+ the range it could have had: a `farEyeRatio` or `silhouetteRatio`
101
104
  out of the rig's reach, or a `noseShift` / `mouthShift` outside what that
102
105
  feature can reach. Pass `options.onTurnSolved` to see what the turn settled on
103
106
  and which targets were clamped.
package/dist/index.d.mts CHANGED
@@ -657,32 +657,32 @@ interface AlphaBbox {
657
657
  declare function detectAlphaBbox(rgba: ArrayLike<number>, width: number, height: number): AlphaBbox | null;
658
658
 
659
659
  /**
660
- * Per-character tuning, starting from the profile: only the quantities the
661
- * Live2D samples themselves disagree on by more than their own median
662
- * (style, not construction). `turn`, `featureLead` and `sway` multiply the
663
- * profile (1 = as measured); `hairFollow`, `outlineFollow` and `blink`
664
- * replace its value.
660
+ * Per-character tuning, starting from the profile. `turn`, `featureLead` and
661
+ * `sway` multiply the profile (1 = the profile); `hairFollow`,
662
+ * `outlineFollow` and `blink` replace its value. `AUTO-RIG.md` lists the
663
+ * ranges that read well.
665
664
  */
666
665
  interface RigStyle {
667
- /** The whole turn — plate, features and hair (the samples' face slides
668
- * 0.05–0.25 hh). Ignored when a `turnTargets.eyeShift` is given, which
669
- * fits it instead. */
666
+ /** The whole turn — plate, features and hair. Ignored when a
667
+ * `turnTargets.eyeShift` is given, which fits it instead. */
670
668
  turn?: number;
671
- /** How far the features lead the plate (the nose leads it 2.2–4.4×). */
669
+ /** How far the features lead the plate. */
672
670
  featureLead?: number;
673
- /** The front hair's share of the face's turn (the samples' 1.0–1.37;
674
- * profile 1.1). */
671
+ /** The front hair's share of the face's turn. */
675
672
  hairFollow?: number;
676
673
  /** Its outer edge's share, where the front hair draws the head's outline
677
674
  * and no back hair paints behind that edge (profile 0: the outline holds;
678
675
  * `hairFollow` rides it whole). Where back hair does, the edge rides
679
676
  * further, as far as that back hair stays behind it through the turn and
680
677
  * the nod, up to the front hair's follow there (`hairFollow`; over the
681
- * far eye's rows, as far as that eye's outer corner goes). */
678
+ * far eye's rows, as far as that eye's outer corner goes). On the cap
679
+ * (the rows above the eyes) the edge follows less where the turn would
680
+ * otherwise carry it further outside its back hair than the nod alone
681
+ * does. */
682
682
  outlineFollow?: number;
683
- /** How far the upper lid comes down, over the eye's height (0.30–0.67). */
683
+ /** How far the upper lid comes down, over the eye's height. */
684
684
  blink?: number;
685
- /** Hair sway amplitude (0.02–0.36 hh at the extremes). */
685
+ /** Hair sway amplitude. */
686
686
  sway?: number;
687
687
  }
688
688
 
@@ -762,12 +762,11 @@ declare class TurnTargetError extends Error {
762
762
  constructor(message: string);
763
763
  }
764
764
  /**
765
- * The Live2D profile's own turn (`profile.ts`), in the cues' units — what a
766
- * rig with no `turnTargets` renders on a head whose silhouette at the eye row
767
- * is back hair about 1 hh (eye row → chin) wide. eyeShift: the eye pair moves
768
- * 0.211 hh at ±30 and that silhouette's centre −0.009 hh, over a 1 hh head
769
- * half-width, 0.22. farEyeRatio: the far eye narrows to 0.85 and the near one
770
- * widens to 1.085, and the cue is their ratio, 0.78. silhouetteRatio: the
765
+ * The profile's own turn (`profile.ts`), in the cues' units — what a rig with
766
+ * no `turnTargets` renders on a head whose silhouette at the eye row is back
767
+ * hair about 1 hh (eye row → chin) wide. eyeShift: the eye pair's mean shift
768
+ * at ±30 less the back hair's drift, over a 1 hh head half-width.
769
+ * farEyeRatio: the far eye's width over the near one's. silhouetteRatio: the
771
770
  * silhouette holds its width.
772
771
  *
773
772
  * With no target given the rig renders the profile itself, whatever the cues
@@ -855,7 +854,7 @@ declare function parseLayerRoles(fileNames: string[]): {
855
854
  /**
856
855
  * `generateIkiFromLayerSet`: role layers in, a rigged `.iki` out.
857
856
  *
858
- * The rig's shape follows a Live2D default rig (`profile.ts`): a torso that
857
+ * The rig's shape is a 2D head rig's usual one (`profile.ts`): a torso that
859
858
  * only breathes; a head deformer that rolls about the chin and breathes; one
860
859
  * small warp grid per feature (each eye, each brow, the nose, the mouth),
861
860
  * translating and foreshortening it by its own lead over the plate; and the
package/dist/index.d.ts CHANGED
@@ -657,32 +657,32 @@ interface AlphaBbox {
657
657
  declare function detectAlphaBbox(rgba: ArrayLike<number>, width: number, height: number): AlphaBbox | null;
658
658
 
659
659
  /**
660
- * Per-character tuning, starting from the profile: only the quantities the
661
- * Live2D samples themselves disagree on by more than their own median
662
- * (style, not construction). `turn`, `featureLead` and `sway` multiply the
663
- * profile (1 = as measured); `hairFollow`, `outlineFollow` and `blink`
664
- * replace its value.
660
+ * Per-character tuning, starting from the profile. `turn`, `featureLead` and
661
+ * `sway` multiply the profile (1 = the profile); `hairFollow`,
662
+ * `outlineFollow` and `blink` replace its value. `AUTO-RIG.md` lists the
663
+ * ranges that read well.
665
664
  */
666
665
  interface RigStyle {
667
- /** The whole turn — plate, features and hair (the samples' face slides
668
- * 0.05–0.25 hh). Ignored when a `turnTargets.eyeShift` is given, which
669
- * fits it instead. */
666
+ /** The whole turn — plate, features and hair. Ignored when a
667
+ * `turnTargets.eyeShift` is given, which fits it instead. */
670
668
  turn?: number;
671
- /** How far the features lead the plate (the nose leads it 2.2–4.4×). */
669
+ /** How far the features lead the plate. */
672
670
  featureLead?: number;
673
- /** The front hair's share of the face's turn (the samples' 1.0–1.37;
674
- * profile 1.1). */
671
+ /** The front hair's share of the face's turn. */
675
672
  hairFollow?: number;
676
673
  /** Its outer edge's share, where the front hair draws the head's outline
677
674
  * and no back hair paints behind that edge (profile 0: the outline holds;
678
675
  * `hairFollow` rides it whole). Where back hair does, the edge rides
679
676
  * further, as far as that back hair stays behind it through the turn and
680
677
  * the nod, up to the front hair's follow there (`hairFollow`; over the
681
- * far eye's rows, as far as that eye's outer corner goes). */
678
+ * far eye's rows, as far as that eye's outer corner goes). On the cap
679
+ * (the rows above the eyes) the edge follows less where the turn would
680
+ * otherwise carry it further outside its back hair than the nod alone
681
+ * does. */
682
682
  outlineFollow?: number;
683
- /** How far the upper lid comes down, over the eye's height (0.30–0.67). */
683
+ /** How far the upper lid comes down, over the eye's height. */
684
684
  blink?: number;
685
- /** Hair sway amplitude (0.02–0.36 hh at the extremes). */
685
+ /** Hair sway amplitude. */
686
686
  sway?: number;
687
687
  }
688
688
 
@@ -762,12 +762,11 @@ declare class TurnTargetError extends Error {
762
762
  constructor(message: string);
763
763
  }
764
764
  /**
765
- * The Live2D profile's own turn (`profile.ts`), in the cues' units — what a
766
- * rig with no `turnTargets` renders on a head whose silhouette at the eye row
767
- * is back hair about 1 hh (eye row → chin) wide. eyeShift: the eye pair moves
768
- * 0.211 hh at ±30 and that silhouette's centre −0.009 hh, over a 1 hh head
769
- * half-width, 0.22. farEyeRatio: the far eye narrows to 0.85 and the near one
770
- * widens to 1.085, and the cue is their ratio, 0.78. silhouetteRatio: the
765
+ * The profile's own turn (`profile.ts`), in the cues' units — what a rig with
766
+ * no `turnTargets` renders on a head whose silhouette at the eye row is back
767
+ * hair about 1 hh (eye row → chin) wide. eyeShift: the eye pair's mean shift
768
+ * at ±30 less the back hair's drift, over a 1 hh head half-width.
769
+ * farEyeRatio: the far eye's width over the near one's. silhouetteRatio: the
771
770
  * silhouette holds its width.
772
771
  *
773
772
  * With no target given the rig renders the profile itself, whatever the cues
@@ -855,7 +854,7 @@ declare function parseLayerRoles(fileNames: string[]): {
855
854
  /**
856
855
  * `generateIkiFromLayerSet`: role layers in, a rigged `.iki` out.
857
856
  *
858
- * The rig's shape follows a Live2D default rig (`profile.ts`): a torso that
857
+ * The rig's shape is a 2D head rig's usual one (`profile.ts`): a torso that
859
858
  * only breathes; a head deformer that rolls about the chin and breathes; one
860
859
  * small warp grid per feature (each eye, each brow, the nose, the mouth),
861
860
  * translating and foreshortening it by its own lead over the plate; and the