@lovelace_lol/embody 0.0.14 → 0.0.16
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 +436 -149
- package/dist/index.js +1383 -395
- package/dist/index.js.map +1 -1
- package/dist/three/annotations/modelObservation.d.ts +9 -7
- package/dist/three/annotations/morphGeometry.d.ts +19 -0
- package/dist/three/authoring.d.ts +22 -18
- package/dist/three/authoringTypes.d.ts +45 -4
- package/dist/three/character.d.ts +58 -14
- package/dist/three/editor/morphVertexPreview.d.ts +3 -2
- package/dist/three/index.d.ts +12 -11
- package/dist/three/model.d.ts +2 -0
- package/dist/three/nativePlayback.d.ts +6 -0
- package/dist/three/playbackRendering.d.ts +1 -1
- package/dist/three/scene.d.ts +2 -0
- package/dist/three/sceneBackground.d.ts +11 -0
- package/dist/three/scenery.d.ts +46 -0
- package/dist/three/vrm-animation.d.ts +70 -0
- package/dist/three.js +1383 -395
- package/dist/three.js.map +1 -1
- package/dist/wasm/README.md +436 -149
- package/dist/wasm/embody_wasm.d.ts +251 -105
- package/dist/wasm/embody_wasm.js +541 -31
- package/dist/wasm/embody_wasm_bg.wasm +0 -0
- package/dist/wasm/embody_wasm_bg.wasm.d.ts +123 -98
- package/dist/wasm/highlighting.d.ts +16 -0
- package/dist/wasm/index.d.ts +10 -0
- package/dist/wasm/savedAnimation.d.ts +4 -0
- package/dist/wasm.js +1123 -2
- package/dist/wasm.js.map +1 -1
- package/model-tools/index.d.ts +57 -0
- package/model-tools/index.mjs +354 -0
- package/model-tools/prepare-actor.mjs +79 -0
- package/package.json +19 -5
package/dist/wasm/embody_wasm.js
CHANGED
|
@@ -215,6 +215,39 @@ export class AnnotationRuntime {
|
|
|
215
215
|
throw takeFromExternrefTable0(ret[0]);
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
|
+
/**
|
|
219
|
+
* Packed world-space XYZ observations in the prepared vertex order. Stale,
|
|
220
|
+
* incomplete or nonfinite observations leave the last valid anchor intact.
|
|
221
|
+
* @param {number} generation
|
|
222
|
+
* @param {number} plan_id
|
|
223
|
+
* @param {Float32Array} positions
|
|
224
|
+
* @returns {boolean}
|
|
225
|
+
*/
|
|
226
|
+
observe_morph_anchor(generation, plan_id, positions) {
|
|
227
|
+
const ptr0 = passArrayF32ToWasm0(positions, wasm.__wbindgen_malloc);
|
|
228
|
+
const len0 = WASM_VECTOR_LEN;
|
|
229
|
+
const ret = wasm.annotationruntime_observe_morph_anchor(this.__wbg_ptr, generation, plan_id, ptr0, len0);
|
|
230
|
+
return ret !== 0;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Native geometry identities/versions advance this per-object revision.
|
|
234
|
+
* Returns true when new geometry must be supplied. Retires old plan IDs
|
|
235
|
+
* without changing the region generation, marker IDs or reveal state.
|
|
236
|
+
* @param {number} generation
|
|
237
|
+
* @param {number} object_id
|
|
238
|
+
* @param {number} revision
|
|
239
|
+
* @param {string} morph_names_json
|
|
240
|
+
* @returns {boolean}
|
|
241
|
+
*/
|
|
242
|
+
observe_morph_geometry(generation, object_id, revision, morph_names_json) {
|
|
243
|
+
const ptr0 = passStringToWasm0(morph_names_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
244
|
+
const len0 = WASM_VECTOR_LEN;
|
|
245
|
+
const ret = wasm.annotationruntime_observe_morph_geometry(this.__wbg_ptr, generation, object_id, revision, ptr0, len0);
|
|
246
|
+
if (ret[2]) {
|
|
247
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
248
|
+
}
|
|
249
|
+
return ret[0] !== 0;
|
|
250
|
+
}
|
|
218
251
|
/**
|
|
219
252
|
* Native hit observations are [marker id, nearest distance], with infinity for no hit.
|
|
220
253
|
* @param {Float32Array} hits
|
|
@@ -270,6 +303,30 @@ export class AnnotationRuntime {
|
|
|
270
303
|
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
271
304
|
}
|
|
272
305
|
}
|
|
306
|
+
/**
|
|
307
|
+
* Prepare an attachment for this generation from mesh-space geometry.
|
|
308
|
+
* Returns [plan id, vertex indices...] or an empty array for a fallback anchor.
|
|
309
|
+
* Report geometry changes with observe_morph_geometry before preparing replacements.
|
|
310
|
+
* @param {number} generation
|
|
311
|
+
* @param {number} object_id
|
|
312
|
+
* @param {string} region_name
|
|
313
|
+
* @param {Float32Array} base
|
|
314
|
+
* @param {Float32Array} morphs
|
|
315
|
+
* @param {boolean} relative
|
|
316
|
+
* @returns {Uint32Array}
|
|
317
|
+
*/
|
|
318
|
+
prepare_morph_anchor(generation, object_id, region_name, base, morphs, relative) {
|
|
319
|
+
const ptr0 = passStringToWasm0(region_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
320
|
+
const len0 = WASM_VECTOR_LEN;
|
|
321
|
+
const ptr1 = passArrayF32ToWasm0(base, wasm.__wbindgen_malloc);
|
|
322
|
+
const len1 = WASM_VECTOR_LEN;
|
|
323
|
+
const ptr2 = passArrayF32ToWasm0(morphs, wasm.__wbindgen_malloc);
|
|
324
|
+
const len2 = WASM_VECTOR_LEN;
|
|
325
|
+
const ret = wasm.annotationruntime_prepare_morph_anchor(this.__wbg_ptr, generation, object_id, ptr0, len0, ptr1, len1, ptr2, len2, relative);
|
|
326
|
+
var v4 = getArrayU32FromWasm0(ret[0], ret[1]).slice();
|
|
327
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
328
|
+
return v4;
|
|
329
|
+
}
|
|
273
330
|
/**
|
|
274
331
|
* @returns {number}
|
|
275
332
|
*/
|
|
@@ -719,6 +776,41 @@ export class RuntimeCore {
|
|
|
719
776
|
const ptr = this.__destroy_into_raw();
|
|
720
777
|
wasm.__wbg_runtimecore_free(ptr, 0);
|
|
721
778
|
}
|
|
779
|
+
/**
|
|
780
|
+
* Compatibility impulses enter the same continuous state; they do not
|
|
781
|
+
* start an independent clip, reset its phase or replace head history.
|
|
782
|
+
* @param {number} horizontal
|
|
783
|
+
* @param {number} vertical
|
|
784
|
+
*/
|
|
785
|
+
add_hair_response_impulse(horizontal, vertical) {
|
|
786
|
+
const ret = wasm.runtimecore_add_hair_response_impulse(this.__wbg_ptr, horizontal, vertical);
|
|
787
|
+
if (ret[1]) {
|
|
788
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
/**
|
|
792
|
+
* Host supplies elapsed seconds from its existing render clock, independent of clip speed.
|
|
793
|
+
* @param {number} delta_seconds
|
|
794
|
+
* @returns {string}
|
|
795
|
+
*/
|
|
796
|
+
advance_mesh_highlight(delta_seconds) {
|
|
797
|
+
let deferred2_0;
|
|
798
|
+
let deferred2_1;
|
|
799
|
+
try {
|
|
800
|
+
const ret = wasm.runtimecore_advance_mesh_highlight(this.__wbg_ptr, delta_seconds);
|
|
801
|
+
var ptr1 = ret[0];
|
|
802
|
+
var len1 = ret[1];
|
|
803
|
+
if (ret[3]) {
|
|
804
|
+
ptr1 = 0; len1 = 0;
|
|
805
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
806
|
+
}
|
|
807
|
+
deferred2_0 = ptr1;
|
|
808
|
+
deferred2_1 = len1;
|
|
809
|
+
return getStringFromWasm0(ptr1, len1);
|
|
810
|
+
} finally {
|
|
811
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
812
|
+
}
|
|
813
|
+
}
|
|
722
814
|
/**
|
|
723
815
|
* @returns {number}
|
|
724
816
|
*/
|
|
@@ -795,61 +887,68 @@ export class RuntimeCore {
|
|
|
795
887
|
}
|
|
796
888
|
}
|
|
797
889
|
/**
|
|
798
|
-
*
|
|
799
|
-
*
|
|
800
|
-
*
|
|
890
|
+
* Advance one character-owned simulation from the renderer's delta and
|
|
891
|
+
* actual blended local head quaternion. Constant additive morph samples
|
|
892
|
+
* are consumed by one persistent native action on its next mixer frame.
|
|
893
|
+
* This does not register a clip or change live AU/viseme/morph controls.
|
|
801
894
|
* @param {string} name
|
|
802
|
-
* @param {
|
|
895
|
+
* @param {string} head_quaternion_json
|
|
896
|
+
* @param {number} dt_seconds
|
|
897
|
+
* @param {string} options_json
|
|
803
898
|
* @returns {string}
|
|
804
899
|
*/
|
|
805
|
-
|
|
806
|
-
let
|
|
807
|
-
let
|
|
900
|
+
build_hair_response_clip(name, head_quaternion_json, dt_seconds, options_json) {
|
|
901
|
+
let deferred5_0;
|
|
902
|
+
let deferred5_1;
|
|
808
903
|
try {
|
|
809
904
|
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
810
905
|
const len0 = WASM_VECTOR_LEN;
|
|
811
|
-
const
|
|
812
|
-
|
|
813
|
-
|
|
906
|
+
const ptr1 = passStringToWasm0(head_quaternion_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
907
|
+
const len1 = WASM_VECTOR_LEN;
|
|
908
|
+
const ptr2 = passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
909
|
+
const len2 = WASM_VECTOR_LEN;
|
|
910
|
+
const ret = wasm.runtimecore_build_hair_response_clip(this.__wbg_ptr, ptr0, len0, ptr1, len1, dt_seconds, ptr2, len2);
|
|
911
|
+
var ptr4 = ret[0];
|
|
912
|
+
var len4 = ret[1];
|
|
814
913
|
if (ret[3]) {
|
|
815
|
-
|
|
914
|
+
ptr4 = 0; len4 = 0;
|
|
816
915
|
throw takeFromExternrefTable0(ret[2]);
|
|
817
916
|
}
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
return getStringFromWasm0(
|
|
917
|
+
deferred5_0 = ptr4;
|
|
918
|
+
deferred5_1 = len4;
|
|
919
|
+
return getStringFromWasm0(ptr4, len4);
|
|
821
920
|
} finally {
|
|
822
|
-
wasm.__wbindgen_free(
|
|
921
|
+
wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
|
|
823
922
|
}
|
|
824
923
|
}
|
|
825
924
|
/**
|
|
826
|
-
* Compile
|
|
827
|
-
*
|
|
925
|
+
* Compile the current live semantic controls into ordinary native tracks.
|
|
926
|
+
* `inherit_start` marks timed tracks as continuing from the current pose;
|
|
927
|
+
* the Three adapter resolves it from each live target's own outgoing
|
|
928
|
+
* action (not the mixed pose) at play time. Rust never ticks or
|
|
929
|
+
* interpolates these samples. Empty output relinquishes all live tracks.
|
|
828
930
|
* @param {string} name
|
|
829
|
-
* @param {string} previous_clip_json
|
|
830
931
|
* @param {number} duration_seconds
|
|
831
932
|
* @returns {string}
|
|
832
933
|
*/
|
|
833
|
-
|
|
834
|
-
let
|
|
835
|
-
let
|
|
934
|
+
build_live_clip(name, duration_seconds) {
|
|
935
|
+
let deferred3_0;
|
|
936
|
+
let deferred3_1;
|
|
836
937
|
try {
|
|
837
938
|
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
838
939
|
const len0 = WASM_VECTOR_LEN;
|
|
839
|
-
const
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
var ptr3 = ret[0];
|
|
843
|
-
var len3 = ret[1];
|
|
940
|
+
const ret = wasm.runtimecore_build_live_clip(this.__wbg_ptr, ptr0, len0, duration_seconds);
|
|
941
|
+
var ptr2 = ret[0];
|
|
942
|
+
var len2 = ret[1];
|
|
844
943
|
if (ret[3]) {
|
|
845
|
-
|
|
944
|
+
ptr2 = 0; len2 = 0;
|
|
846
945
|
throw takeFromExternrefTable0(ret[2]);
|
|
847
946
|
}
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
return getStringFromWasm0(
|
|
947
|
+
deferred3_0 = ptr2;
|
|
948
|
+
deferred3_1 = len2;
|
|
949
|
+
return getStringFromWasm0(ptr2, len2);
|
|
851
950
|
} finally {
|
|
852
|
-
wasm.__wbindgen_free(
|
|
951
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
853
952
|
}
|
|
854
953
|
}
|
|
855
954
|
/**
|
|
@@ -1001,6 +1100,28 @@ export class RuntimeCore {
|
|
|
1001
1100
|
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
1002
1101
|
return v1;
|
|
1003
1102
|
}
|
|
1103
|
+
/**
|
|
1104
|
+
* Complete versioned snapshot; omitted IDs must have previous preview resources removed.
|
|
1105
|
+
* @returns {string}
|
|
1106
|
+
*/
|
|
1107
|
+
evaluate_mesh_highlight_frame() {
|
|
1108
|
+
let deferred2_0;
|
|
1109
|
+
let deferred2_1;
|
|
1110
|
+
try {
|
|
1111
|
+
const ret = wasm.runtimecore_evaluate_mesh_highlight_frame(this.__wbg_ptr);
|
|
1112
|
+
var ptr1 = ret[0];
|
|
1113
|
+
var len1 = ret[1];
|
|
1114
|
+
if (ret[3]) {
|
|
1115
|
+
ptr1 = 0; len1 = 0;
|
|
1116
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1117
|
+
}
|
|
1118
|
+
deferred2_0 = ptr1;
|
|
1119
|
+
deferred2_1 = len1;
|
|
1120
|
+
return getStringFromWasm0(ptr1, len1);
|
|
1121
|
+
} finally {
|
|
1122
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1004
1125
|
/**
|
|
1005
1126
|
* Packed morph FrameDelta rows: `[mesh_id, morph_target_id, value, mode] * N`
|
|
1006
1127
|
* Live AU/viseme/direct morph state only — clip playback is host-owned.
|
|
@@ -1153,6 +1274,29 @@ export class RuntimeCore {
|
|
|
1153
1274
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1154
1275
|
}
|
|
1155
1276
|
}
|
|
1277
|
+
/**
|
|
1278
|
+
* Resolved head role and captured local reference; null leaves ambient
|
|
1279
|
+
* hair available without inventing a preset or renderer-side rig mapping.
|
|
1280
|
+
* @returns {string}
|
|
1281
|
+
*/
|
|
1282
|
+
get_hair_head_binding_json() {
|
|
1283
|
+
let deferred2_0;
|
|
1284
|
+
let deferred2_1;
|
|
1285
|
+
try {
|
|
1286
|
+
const ret = wasm.runtimecore_get_hair_head_binding_json(this.__wbg_ptr);
|
|
1287
|
+
var ptr1 = ret[0];
|
|
1288
|
+
var len1 = ret[1];
|
|
1289
|
+
if (ret[3]) {
|
|
1290
|
+
ptr1 = 0; len1 = 0;
|
|
1291
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1292
|
+
}
|
|
1293
|
+
deferred2_0 = ptr1;
|
|
1294
|
+
deferred2_1 = len1;
|
|
1295
|
+
return getStringFromWasm0(ptr1, len1);
|
|
1296
|
+
} finally {
|
|
1297
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1298
|
+
}
|
|
1299
|
+
}
|
|
1156
1300
|
/**
|
|
1157
1301
|
* @param {string} available_json
|
|
1158
1302
|
* @returns {string}
|
|
@@ -1204,6 +1348,13 @@ export class RuntimeCore {
|
|
|
1204
1348
|
const ret = wasm.runtimecore_has_left_right_bones(this.__wbg_ptr, au_id);
|
|
1205
1349
|
return ret !== 0;
|
|
1206
1350
|
}
|
|
1351
|
+
/**
|
|
1352
|
+
* @returns {boolean}
|
|
1353
|
+
*/
|
|
1354
|
+
is_hair_response_paused() {
|
|
1355
|
+
const ret = wasm.runtimecore_is_hair_response_paused(this.__wbg_ptr);
|
|
1356
|
+
return ret !== 0;
|
|
1357
|
+
}
|
|
1207
1358
|
/**
|
|
1208
1359
|
* @returns {string}
|
|
1209
1360
|
*/
|
|
@@ -1296,6 +1447,40 @@ export class RuntimeCore {
|
|
|
1296
1447
|
const len0 = WASM_VECTOR_LEN;
|
|
1297
1448
|
wasm.runtimecore_load_viseme_morph_bindings(this.__wbg_ptr, ptr0, len0);
|
|
1298
1449
|
}
|
|
1450
|
+
/**
|
|
1451
|
+
* Distance from a slot's current contribution to `destination_json`
|
|
1452
|
+
* (`{auId: value}`), measured along profile continuum pairs. Travel is
|
|
1453
|
+
* reversed only against an `unfinished` slot. A missing slot is at zero.
|
|
1454
|
+
* Returns `{distance, reversal, current}`.
|
|
1455
|
+
* @param {string} name
|
|
1456
|
+
* @param {number} time
|
|
1457
|
+
* @param {number} weight
|
|
1458
|
+
* @param {string} destination_json
|
|
1459
|
+
* @param {boolean} unfinished
|
|
1460
|
+
* @returns {string}
|
|
1461
|
+
*/
|
|
1462
|
+
measure_au_goal(name, time, weight, destination_json, unfinished) {
|
|
1463
|
+
let deferred4_0;
|
|
1464
|
+
let deferred4_1;
|
|
1465
|
+
try {
|
|
1466
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1467
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1468
|
+
const ptr1 = passStringToWasm0(destination_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1469
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1470
|
+
const ret = wasm.runtimecore_measure_au_goal(this.__wbg_ptr, ptr0, len0, time, weight, ptr1, len1, unfinished);
|
|
1471
|
+
var ptr3 = ret[0];
|
|
1472
|
+
var len3 = ret[1];
|
|
1473
|
+
if (ret[3]) {
|
|
1474
|
+
ptr3 = 0; len3 = 0;
|
|
1475
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1476
|
+
}
|
|
1477
|
+
deferred4_0 = ptr3;
|
|
1478
|
+
deferred4_1 = len3;
|
|
1479
|
+
return getStringFromWasm0(ptr3, len3);
|
|
1480
|
+
} finally {
|
|
1481
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
1482
|
+
}
|
|
1483
|
+
}
|
|
1299
1484
|
/**
|
|
1300
1485
|
* @param {number} viseme_slot_count
|
|
1301
1486
|
*/
|
|
@@ -1305,6 +1490,80 @@ export class RuntimeCore {
|
|
|
1305
1490
|
RuntimeCoreFinalization.register(this, this.__wbg_ptr, this);
|
|
1306
1491
|
return this;
|
|
1307
1492
|
}
|
|
1493
|
+
/**
|
|
1494
|
+
* One slot's own AU contribution, `{auId: value}`, at the host's native
|
|
1495
|
+
* action time and effective weight; `null` when the slot is not readable.
|
|
1496
|
+
* @param {string} name
|
|
1497
|
+
* @param {number} time
|
|
1498
|
+
* @param {number} weight
|
|
1499
|
+
* @returns {string}
|
|
1500
|
+
*/
|
|
1501
|
+
read_semantic_slot(name, time, weight) {
|
|
1502
|
+
let deferred2_0;
|
|
1503
|
+
let deferred2_1;
|
|
1504
|
+
try {
|
|
1505
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1506
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1507
|
+
const ret = wasm.runtimecore_read_semantic_slot(this.__wbg_ptr, ptr0, len0, time, weight);
|
|
1508
|
+
deferred2_0 = ret[0];
|
|
1509
|
+
deferred2_1 = ret[1];
|
|
1510
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1511
|
+
} finally {
|
|
1512
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1513
|
+
}
|
|
1514
|
+
}
|
|
1515
|
+
/**
|
|
1516
|
+
* Live AU state plus every listed slot's contribution. `slots_json` is
|
|
1517
|
+
* `[{name, time, weight}]` for the host's active actions. Returns
|
|
1518
|
+
* `{live, animated, total}`; unreadable names are the host's to report.
|
|
1519
|
+
* @param {string} slots_json
|
|
1520
|
+
* @returns {string}
|
|
1521
|
+
*/
|
|
1522
|
+
read_semantic_state(slots_json) {
|
|
1523
|
+
let deferred3_0;
|
|
1524
|
+
let deferred3_1;
|
|
1525
|
+
try {
|
|
1526
|
+
const ptr0 = passStringToWasm0(slots_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1527
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1528
|
+
const ret = wasm.runtimecore_read_semantic_state(this.__wbg_ptr, ptr0, len0);
|
|
1529
|
+
var ptr2 = ret[0];
|
|
1530
|
+
var len2 = ret[1];
|
|
1531
|
+
if (ret[3]) {
|
|
1532
|
+
ptr2 = 0; len2 = 0;
|
|
1533
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1534
|
+
}
|
|
1535
|
+
deferred3_0 = ptr2;
|
|
1536
|
+
deferred3_1 = len2;
|
|
1537
|
+
return getStringFromWasm0(ptr2, len2);
|
|
1538
|
+
} finally {
|
|
1539
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
1540
|
+
}
|
|
1541
|
+
}
|
|
1542
|
+
/**
|
|
1543
|
+
* Record the semantic AU keys of an admitted AU-curve clip slot. The
|
|
1544
|
+
* same-name slot recorded earlier is the predecessor: `predecessor_time`
|
|
1545
|
+
* is its native action time (NaN when absent) and `weight_ratio` its
|
|
1546
|
+
* effective weight divided by the incoming weight, as for physical
|
|
1547
|
+
* inheritance. Only numeric AU curves are kept.
|
|
1548
|
+
* @param {string} name
|
|
1549
|
+
* @param {string} curves_json
|
|
1550
|
+
* @param {number} intensity_scale
|
|
1551
|
+
* @param {string} easing
|
|
1552
|
+
* @param {number} predecessor_time
|
|
1553
|
+
* @param {number} weight_ratio
|
|
1554
|
+
*/
|
|
1555
|
+
record_semantic_slot(name, curves_json, intensity_scale, easing, predecessor_time, weight_ratio) {
|
|
1556
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1557
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1558
|
+
const ptr1 = passStringToWasm0(curves_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1559
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1560
|
+
const ptr2 = passStringToWasm0(easing, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1561
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1562
|
+
const ret = wasm.runtimecore_record_semantic_slot(this.__wbg_ptr, ptr0, len0, ptr1, len1, intensity_scale, ptr2, len2, predecessor_time, weight_ratio);
|
|
1563
|
+
if (ret[1]) {
|
|
1564
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1565
|
+
}
|
|
1566
|
+
}
|
|
1308
1567
|
/**
|
|
1309
1568
|
* @param {string} clip_json
|
|
1310
1569
|
* @param {string} source
|
|
@@ -1358,6 +1617,18 @@ export class RuntimeCore {
|
|
|
1358
1617
|
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
1359
1618
|
return v1;
|
|
1360
1619
|
}
|
|
1620
|
+
/**
|
|
1621
|
+
* Forget a slot once its native action is released or replaced by a
|
|
1622
|
+
* non-curve source. Returns whether a slot existed.
|
|
1623
|
+
* @param {string} name
|
|
1624
|
+
* @returns {boolean}
|
|
1625
|
+
*/
|
|
1626
|
+
release_semantic_slot(name) {
|
|
1627
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1628
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1629
|
+
const ret = wasm.runtimecore_release_semantic_slot(this.__wbg_ptr, ptr0, len0);
|
|
1630
|
+
return ret !== 0;
|
|
1631
|
+
}
|
|
1361
1632
|
/**
|
|
1362
1633
|
* @param {string} clip_name
|
|
1363
1634
|
* @returns {boolean}
|
|
@@ -1368,6 +1639,20 @@ export class RuntimeCore {
|
|
|
1368
1639
|
const ret = wasm.runtimecore_remove_animation_clip(this.__wbg_ptr, ptr0, len0);
|
|
1369
1640
|
return ret !== 0;
|
|
1370
1641
|
}
|
|
1642
|
+
/**
|
|
1643
|
+
* Transient preview request. Names resolve against the configured model in Rust.
|
|
1644
|
+
* @param {string | null} [name]
|
|
1645
|
+
* @param {number | null} [color]
|
|
1646
|
+
* @param {number | null} [intensity]
|
|
1647
|
+
*/
|
|
1648
|
+
request_mesh_highlight(name, color, intensity) {
|
|
1649
|
+
var ptr0 = isLikeNone(name) ? 0 : passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1650
|
+
var len0 = WASM_VECTOR_LEN;
|
|
1651
|
+
wasm.runtimecore_request_mesh_highlight(this.__wbg_ptr, ptr0, len0, isLikeNone(color) ? Number.MAX_SAFE_INTEGER : (color) >>> 0, isLikeNone(intensity) ? Number.MAX_SAFE_INTEGER : Math.fround(intensity));
|
|
1652
|
+
}
|
|
1653
|
+
reset_hair_response() {
|
|
1654
|
+
wasm.runtimecore_reset_hair_response(this.__wbg_ptr);
|
|
1655
|
+
}
|
|
1371
1656
|
/**
|
|
1372
1657
|
* Forget ownership when renderer bindings are discarded. Before replacing
|
|
1373
1658
|
* bindings, apply release_procedural_morph_frame through the old IDs.
|
|
@@ -1403,6 +1688,24 @@ export class RuntimeCore {
|
|
|
1403
1688
|
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
1404
1689
|
}
|
|
1405
1690
|
}
|
|
1691
|
+
/**
|
|
1692
|
+
* Apply an in-place strength/easing edit to a running slot.
|
|
1693
|
+
* @param {string} name
|
|
1694
|
+
* @param {number} intensity_scale
|
|
1695
|
+
* @param {string} easing
|
|
1696
|
+
* @returns {boolean}
|
|
1697
|
+
*/
|
|
1698
|
+
restyle_semantic_slot(name, intensity_scale, easing) {
|
|
1699
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1700
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1701
|
+
const ptr1 = passStringToWasm0(easing, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1702
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1703
|
+
const ret = wasm.runtimecore_restyle_semantic_slot(this.__wbg_ptr, ptr0, len0, intensity_scale, ptr1, len1);
|
|
1704
|
+
if (ret[2]) {
|
|
1705
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1706
|
+
}
|
|
1707
|
+
return ret[0] !== 0;
|
|
1708
|
+
}
|
|
1406
1709
|
/**
|
|
1407
1710
|
* @param {number} id
|
|
1408
1711
|
* @param {number} value
|
|
@@ -1462,6 +1765,14 @@ export class RuntimeCore {
|
|
|
1462
1765
|
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
1463
1766
|
}
|
|
1464
1767
|
}
|
|
1768
|
+
/**
|
|
1769
|
+
* Suspension intent survives empty mappings, enable changes and dynamics
|
|
1770
|
+
* resets. Profile replacement starts a new character configuration.
|
|
1771
|
+
* @param {boolean} paused
|
|
1772
|
+
*/
|
|
1773
|
+
set_hair_response_paused(paused) {
|
|
1774
|
+
wasm.runtimecore_set_hair_response_paused(this.__wbg_ptr, paused);
|
|
1775
|
+
}
|
|
1465
1776
|
/**
|
|
1466
1777
|
* @param {Uint32Array} ids
|
|
1467
1778
|
*/
|
|
@@ -1632,6 +1943,31 @@ export function annotation_marker_frame_stride() {
|
|
|
1632
1943
|
return ret >>> 0;
|
|
1633
1944
|
}
|
|
1634
1945
|
|
|
1946
|
+
/**
|
|
1947
|
+
* Final mesh-space attachment vertices as [index, influence] pairs. The same
|
|
1948
|
+
* selection is used by AnnotationRuntime; native adapters only evaluate poses.
|
|
1949
|
+
* @param {string} region_json
|
|
1950
|
+
* @param {Float32Array} base
|
|
1951
|
+
* @param {Float32Array} morphs
|
|
1952
|
+
* @param {boolean} relative
|
|
1953
|
+
* @returns {Float32Array}
|
|
1954
|
+
*/
|
|
1955
|
+
export function annotation_morph_anchor_candidates(region_json, base, morphs, relative) {
|
|
1956
|
+
const ptr0 = passStringToWasm0(region_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1957
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1958
|
+
const ptr1 = passArrayF32ToWasm0(base, wasm.__wbindgen_malloc);
|
|
1959
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1960
|
+
const ptr2 = passArrayF32ToWasm0(morphs, wasm.__wbindgen_malloc);
|
|
1961
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1962
|
+
const ret = wasm.annotation_morph_anchor_candidates(ptr0, len0, ptr1, len1, ptr2, len2, relative);
|
|
1963
|
+
if (ret[3]) {
|
|
1964
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1965
|
+
}
|
|
1966
|
+
var v4 = getArrayF32FromWasm0(ret[0], ret[1]).slice();
|
|
1967
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
1968
|
+
return v4;
|
|
1969
|
+
}
|
|
1970
|
+
|
|
1635
1971
|
/**
|
|
1636
1972
|
* @param {Float32Array} base
|
|
1637
1973
|
* @param {Float32Array} morphs
|
|
@@ -1709,6 +2045,21 @@ export function annotation_query(operation, payload_json) {
|
|
|
1709
2045
|
}
|
|
1710
2046
|
}
|
|
1711
2047
|
|
|
2048
|
+
/**
|
|
2049
|
+
* Reduce packed [world x, world y, world z, influence] observations without
|
|
2050
|
+
* selecting vertices again. Invalid/incomplete observations return no point.
|
|
2051
|
+
* @param {Float32Array} samples
|
|
2052
|
+
* @returns {Float32Array}
|
|
2053
|
+
*/
|
|
2054
|
+
export function annotation_weighted_anchor(samples) {
|
|
2055
|
+
const ptr0 = passArrayF32ToWasm0(samples, wasm.__wbindgen_malloc);
|
|
2056
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2057
|
+
const ret = wasm.annotation_weighted_anchor(ptr0, len0);
|
|
2058
|
+
var v2 = getArrayF32FromWasm0(ret[0], ret[1]).slice();
|
|
2059
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
2060
|
+
return v2;
|
|
2061
|
+
}
|
|
2062
|
+
|
|
1712
2063
|
/**
|
|
1713
2064
|
* Build head-pitch gravity hair morph curves.
|
|
1714
2065
|
* @param {string} config_json
|
|
@@ -1939,6 +2290,88 @@ export function create_validation_skeleton_json(template_json) {
|
|
|
1939
2290
|
}
|
|
1940
2291
|
}
|
|
1941
2292
|
|
|
2293
|
+
/**
|
|
2294
|
+
* @param {string} animation_json
|
|
2295
|
+
* @param {string} profile_json
|
|
2296
|
+
* @returns {string}
|
|
2297
|
+
*/
|
|
2298
|
+
export function decode_legacy_animation(animation_json, profile_json) {
|
|
2299
|
+
let deferred4_0;
|
|
2300
|
+
let deferred4_1;
|
|
2301
|
+
try {
|
|
2302
|
+
const ptr0 = passStringToWasm0(animation_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2303
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2304
|
+
const ptr1 = passStringToWasm0(profile_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2305
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2306
|
+
const ret = wasm.decode_legacy_animation(ptr0, len0, ptr1, len1);
|
|
2307
|
+
var ptr3 = ret[0];
|
|
2308
|
+
var len3 = ret[1];
|
|
2309
|
+
if (ret[3]) {
|
|
2310
|
+
ptr3 = 0; len3 = 0;
|
|
2311
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
2312
|
+
}
|
|
2313
|
+
deferred4_0 = ptr3;
|
|
2314
|
+
deferred4_1 = len3;
|
|
2315
|
+
return getStringFromWasm0(ptr3, len3);
|
|
2316
|
+
} finally {
|
|
2317
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
2318
|
+
}
|
|
2319
|
+
}
|
|
2320
|
+
|
|
2321
|
+
/**
|
|
2322
|
+
* @param {string} pose_json
|
|
2323
|
+
* @param {string} profile_json
|
|
2324
|
+
* @returns {string}
|
|
2325
|
+
*/
|
|
2326
|
+
export function decode_legacy_pose(pose_json, profile_json) {
|
|
2327
|
+
let deferred4_0;
|
|
2328
|
+
let deferred4_1;
|
|
2329
|
+
try {
|
|
2330
|
+
const ptr0 = passStringToWasm0(pose_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2331
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2332
|
+
const ptr1 = passStringToWasm0(profile_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2333
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2334
|
+
const ret = wasm.decode_legacy_pose(ptr0, len0, ptr1, len1);
|
|
2335
|
+
var ptr3 = ret[0];
|
|
2336
|
+
var len3 = ret[1];
|
|
2337
|
+
if (ret[3]) {
|
|
2338
|
+
ptr3 = 0; len3 = 0;
|
|
2339
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
2340
|
+
}
|
|
2341
|
+
deferred4_0 = ptr3;
|
|
2342
|
+
deferred4_1 = len3;
|
|
2343
|
+
return getStringFromWasm0(ptr3, len3);
|
|
2344
|
+
} finally {
|
|
2345
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
2346
|
+
}
|
|
2347
|
+
}
|
|
2348
|
+
|
|
2349
|
+
/**
|
|
2350
|
+
* Decode the supported body-only VRMA subset; rejects unsupported channels.
|
|
2351
|
+
* @param {Uint8Array} bytes
|
|
2352
|
+
* @returns {string}
|
|
2353
|
+
*/
|
|
2354
|
+
export function decode_vrma_animation(bytes) {
|
|
2355
|
+
let deferred3_0;
|
|
2356
|
+
let deferred3_1;
|
|
2357
|
+
try {
|
|
2358
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
2359
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2360
|
+
const ret = wasm.decode_vrma_animation(ptr0, len0);
|
|
2361
|
+
var ptr2 = ret[0];
|
|
2362
|
+
var len2 = ret[1];
|
|
2363
|
+
if (ret[3]) {
|
|
2364
|
+
ptr2 = 0; len2 = 0;
|
|
2365
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
2366
|
+
}
|
|
2367
|
+
deferred3_0 = ptr2;
|
|
2368
|
+
deferred3_1 = len2;
|
|
2369
|
+
return getStringFromWasm0(ptr2, len2);
|
|
2370
|
+
} finally {
|
|
2371
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
2372
|
+
}
|
|
2373
|
+
}
|
|
2374
|
+
|
|
1942
2375
|
/**
|
|
1943
2376
|
* @returns {string}
|
|
1944
2377
|
*/
|
|
@@ -1999,6 +2432,23 @@ export function embody_request(request_json) {
|
|
|
1999
2432
|
}
|
|
2000
2433
|
}
|
|
2001
2434
|
|
|
2435
|
+
/**
|
|
2436
|
+
* Write a standalone glTF 2 GLB with VRMC_vrm_animation 1.0, suitable for .vrma.
|
|
2437
|
+
* @param {string} animation_json
|
|
2438
|
+
* @returns {Uint8Array}
|
|
2439
|
+
*/
|
|
2440
|
+
export function encode_vrma_animation(animation_json) {
|
|
2441
|
+
const ptr0 = passStringToWasm0(animation_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2442
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2443
|
+
const ret = wasm.encode_vrma_animation(ptr0, len0);
|
|
2444
|
+
if (ret[3]) {
|
|
2445
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
2446
|
+
}
|
|
2447
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
2448
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
2449
|
+
return v2;
|
|
2450
|
+
}
|
|
2451
|
+
|
|
2002
2452
|
/**
|
|
2003
2453
|
* @param {string} model_json
|
|
2004
2454
|
* @param {string} options_json
|
|
@@ -2379,6 +2829,32 @@ export function normalize_hair_color_appearance_json(value_json, fallback_json)
|
|
|
2379
2829
|
}
|
|
2380
2830
|
}
|
|
2381
2831
|
|
|
2832
|
+
/**
|
|
2833
|
+
* Convert an explicitly referenced Mixamo rig to normalized VRM humanoid keys.
|
|
2834
|
+
* @param {string} input_json
|
|
2835
|
+
* @returns {string}
|
|
2836
|
+
*/
|
|
2837
|
+
export function normalize_mixamo_animation(input_json) {
|
|
2838
|
+
let deferred3_0;
|
|
2839
|
+
let deferred3_1;
|
|
2840
|
+
try {
|
|
2841
|
+
const ptr0 = passStringToWasm0(input_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2842
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2843
|
+
const ret = wasm.normalize_mixamo_animation(ptr0, len0);
|
|
2844
|
+
var ptr2 = ret[0];
|
|
2845
|
+
var len2 = ret[1];
|
|
2846
|
+
if (ret[3]) {
|
|
2847
|
+
ptr2 = 0; len2 = 0;
|
|
2848
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
2849
|
+
}
|
|
2850
|
+
deferred3_0 = ptr2;
|
|
2851
|
+
deferred3_1 = len2;
|
|
2852
|
+
return getStringFromWasm0(ptr2, len2);
|
|
2853
|
+
} finally {
|
|
2854
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
2855
|
+
}
|
|
2856
|
+
}
|
|
2857
|
+
|
|
2382
2858
|
/**
|
|
2383
2859
|
* @param {Uint32Array} mesh_ids
|
|
2384
2860
|
* @param {Uint32Array} morph_target_ids
|
|
@@ -2562,6 +3038,35 @@ export function resolve_viewport_safe_bounds(label_scale_x, label_scale_y, proje
|
|
|
2562
3038
|
return v1;
|
|
2563
3039
|
}
|
|
2564
3040
|
|
|
3041
|
+
/**
|
|
3042
|
+
* Convert portable keys to target local rotations/translations without sampling.
|
|
3043
|
+
* @param {string} animation_json
|
|
3044
|
+
* @param {string} target_rig_json
|
|
3045
|
+
* @returns {string}
|
|
3046
|
+
*/
|
|
3047
|
+
export function retarget_vrma_animation(animation_json, target_rig_json) {
|
|
3048
|
+
let deferred4_0;
|
|
3049
|
+
let deferred4_1;
|
|
3050
|
+
try {
|
|
3051
|
+
const ptr0 = passStringToWasm0(animation_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3052
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3053
|
+
const ptr1 = passStringToWasm0(target_rig_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3054
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3055
|
+
const ret = wasm.retarget_vrma_animation(ptr0, len0, ptr1, len1);
|
|
3056
|
+
var ptr3 = ret[0];
|
|
3057
|
+
var len3 = ret[1];
|
|
3058
|
+
if (ret[3]) {
|
|
3059
|
+
ptr3 = 0; len3 = 0;
|
|
3060
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
3061
|
+
}
|
|
3062
|
+
deferred4_0 = ptr3;
|
|
3063
|
+
deferred4_1 = len3;
|
|
3064
|
+
return getStringFromWasm0(ptr3, len3);
|
|
3065
|
+
} finally {
|
|
3066
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
3067
|
+
}
|
|
3068
|
+
}
|
|
3069
|
+
|
|
2565
3070
|
/**
|
|
2566
3071
|
* Sinusoidal arc leader line points between two world positions.
|
|
2567
3072
|
* Returns `(segments + 1) * 3` floats.
|
|
@@ -3000,6 +3505,11 @@ function getArrayU32FromWasm0(ptr, len) {
|
|
|
3000
3505
|
return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
|
|
3001
3506
|
}
|
|
3002
3507
|
|
|
3508
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
3509
|
+
ptr = ptr >>> 0;
|
|
3510
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
3511
|
+
}
|
|
3512
|
+
|
|
3003
3513
|
let cachedDataViewMemory0 = null;
|
|
3004
3514
|
function getDataViewMemory0() {
|
|
3005
3515
|
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|