@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 +14 -11
- package/dist/index.d.mts +20 -21
- package/dist/index.d.ts +20 -21
- package/dist/index.js +355 -131
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +355 -131
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
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
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
99
|
-
|
|
100
|
-
|
|
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
|
|
661
|
-
*
|
|
662
|
-
*
|
|
663
|
-
*
|
|
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
|
|
668
|
-
*
|
|
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
|
|
669
|
+
/** How far the features lead the plate. */
|
|
672
670
|
featureLead?: number;
|
|
673
|
-
/** The front hair's share of the face's turn
|
|
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
|
|
683
|
+
/** How far the upper lid comes down, over the eye's height. */
|
|
684
684
|
blink?: number;
|
|
685
|
-
/** Hair sway amplitude
|
|
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
|
|
766
|
-
*
|
|
767
|
-
*
|
|
768
|
-
*
|
|
769
|
-
*
|
|
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
|
|
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
|
|
661
|
-
*
|
|
662
|
-
*
|
|
663
|
-
*
|
|
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
|
|
668
|
-
*
|
|
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
|
|
669
|
+
/** How far the features lead the plate. */
|
|
672
670
|
featureLead?: number;
|
|
673
|
-
/** The front hair's share of the face's turn
|
|
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
|
|
683
|
+
/** How far the upper lid comes down, over the eye's height. */
|
|
684
684
|
blink?: number;
|
|
685
|
-
/** Hair sway amplitude
|
|
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
|
|
766
|
-
*
|
|
767
|
-
*
|
|
768
|
-
*
|
|
769
|
-
*
|
|
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
|
|
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
|