@ikijs/editor 0.26.0 → 0.27.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/dist/index.js +31 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +31 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -2044,7 +2044,7 @@ var PROFILE_VALUES = {
|
|
|
2044
2044
|
mouthWiden: 1.2,
|
|
2045
2045
|
brow: 0.15,
|
|
2046
2046
|
breath: 0.03,
|
|
2047
|
-
sway: 0.
|
|
2047
|
+
sway: 0.24,
|
|
2048
2048
|
blushRest: 0.4,
|
|
2049
2049
|
bodySlide: 0.1,
|
|
2050
2050
|
bodyNarrow: 0.05,
|
|
@@ -6312,7 +6312,7 @@ function generateIkiFromLayerSet(layers, canvas, options = {}) {
|
|
|
6312
6312
|
parameters,
|
|
6313
6313
|
parts,
|
|
6314
6314
|
deformers: deformers(frame, grids, bodyWarp?.deformer, arms, byRole),
|
|
6315
|
-
...has("hair_front") ? { physics: hairPhysics() } : {},
|
|
6315
|
+
...has("hair_front") ? { physics: hairPhysics(has("hair_back")) } : {},
|
|
6316
6316
|
expressions: defaultExpressions(new Set(parameters.map((p) => p.id))),
|
|
6317
6317
|
motions: defaultMotions(new Set(parameters.map((p) => p.id)))
|
|
6318
6318
|
};
|
|
@@ -6519,10 +6519,14 @@ function buildPart(spec, b, order, frame, byRole, style, frontGrid, lips) {
|
|
|
6519
6519
|
case "hair_back":
|
|
6520
6520
|
if (byRole.has("hair_front")) {
|
|
6521
6521
|
const amp = style.sway * AMPLITUDE.sway * hh;
|
|
6522
|
-
|
|
6523
|
-
|
|
6524
|
-
|
|
6525
|
-
|
|
6522
|
+
if (spec.role === "hair_front") {
|
|
6523
|
+
warps.push(
|
|
6524
|
+
hairSway(import_format12.StandardParameter.HairSwayX, mesh, b, amp),
|
|
6525
|
+
hairSway(import_format12.StandardParameter.HairSwayZ, mesh, b, amp)
|
|
6526
|
+
);
|
|
6527
|
+
} else {
|
|
6528
|
+
warps.push(hairSway(import_format12.StandardParameter.HairBackSway, mesh, b, amp));
|
|
6529
|
+
}
|
|
6526
6530
|
}
|
|
6527
6531
|
warps.push(tiltHang(mesh, b, pivot, hairHangWeight(frame.chinY, b.y0)));
|
|
6528
6532
|
break;
|
|
@@ -6637,9 +6641,9 @@ function deformers(frame, grids, bodyWarp, arms, byRole) {
|
|
|
6637
6641
|
}
|
|
6638
6642
|
return out;
|
|
6639
6643
|
}
|
|
6640
|
-
function hairPhysics() {
|
|
6641
|
-
const spring = { mass: 1, stiffness: 77, damping:
|
|
6642
|
-
|
|
6644
|
+
function hairPhysics(hasBack) {
|
|
6645
|
+
const spring = { mass: 1, stiffness: 77, damping: 7 };
|
|
6646
|
+
const rigs = [
|
|
6643
6647
|
{
|
|
6644
6648
|
id: "hairSway",
|
|
6645
6649
|
inputs: [
|
|
@@ -6656,6 +6660,21 @@ function hairPhysics() {
|
|
|
6656
6660
|
...spring
|
|
6657
6661
|
}
|
|
6658
6662
|
];
|
|
6663
|
+
if (hasBack) {
|
|
6664
|
+
rigs.push({
|
|
6665
|
+
id: "hairBack",
|
|
6666
|
+
inputs: [
|
|
6667
|
+
{ parameter: import_format12.StandardParameter.AngleX, weight: 1, mode: "lag" },
|
|
6668
|
+
{ parameter: import_format12.StandardParameter.AngleZ, weight: 0.4, mode: "lag" },
|
|
6669
|
+
{ parameter: import_format12.StandardParameter.AmbientSway, weight: 1.73, mode: "lag" }
|
|
6670
|
+
],
|
|
6671
|
+
output: { parameter: import_format12.StandardParameter.HairBackSway, scale: 7 },
|
|
6672
|
+
mass: 1,
|
|
6673
|
+
stiffness: 32,
|
|
6674
|
+
damping: 4.5
|
|
6675
|
+
});
|
|
6676
|
+
}
|
|
6677
|
+
return rigs;
|
|
6659
6678
|
}
|
|
6660
6679
|
function declareParameters(roles) {
|
|
6661
6680
|
const out = [];
|
|
@@ -6709,6 +6728,9 @@ function declareParameters(roles) {
|
|
|
6709
6728
|
if (roles.has("hair_front")) {
|
|
6710
6729
|
add(import_format12.StandardParameter.HairSwayX, "Hair Sway X", -SWAY_RANGE, SWAY_RANGE, 0);
|
|
6711
6730
|
add(import_format12.StandardParameter.HairSwayZ, "Hair Sway Z", -SWAY_RANGE, SWAY_RANGE, 0);
|
|
6731
|
+
if (roles.has("hair_back")) {
|
|
6732
|
+
add(import_format12.StandardParameter.HairBackSway, "Hair Back Sway", -SWAY_RANGE, SWAY_RANGE, 0);
|
|
6733
|
+
}
|
|
6712
6734
|
add(import_format12.StandardParameter.AmbientSway, "Ambient Sway", -1, 1, 0);
|
|
6713
6735
|
}
|
|
6714
6736
|
return out;
|