@splinetool/viewer 2.0.6 → 2.0.7
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 +25 -0
- package/build/hana-ui.js +44 -40
- package/build/hana-ui.wasm +0 -0
- package/build/spline-viewer.cjs +185 -185
- package/build/spline-viewer.d.ts +26 -1
- package/build/spline-viewer.js +182 -182
- package/build/spline-viewer.webgl.js +10157 -0
- package/build/spline-viewer.webgpu.js +5391 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -35,6 +35,25 @@ It can also be used directly from our free CDN (pin a version with
|
|
|
35
35
|
></script>
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
+
## Engine-specific builds
|
|
39
|
+
|
|
40
|
+
The default `spline-viewer.js` contains both rendering engines and
|
|
41
|
+
auto-selects per browser: WebGPU wherever the browser provides it, WebGL
|
|
42
|
+
everywhere else. If your scene was exported for a single engine (the
|
|
43
|
+
`Renderer` setting in the export panel), you can load a smaller build that
|
|
44
|
+
only contains that engine — the export panel's code snippet picks the right
|
|
45
|
+
file for you:
|
|
46
|
+
|
|
47
|
+
- `build/spline-viewer.js` — WebGPU + WebGL, auto-select (the default; use
|
|
48
|
+
it for scenes exported with `Renderer: Both`).
|
|
49
|
+
- `build/spline-viewer.webgl.js` — WebGL only (~34% smaller).
|
|
50
|
+
- `build/spline-viewer.webgpu.js` — WebGPU only (~20% smaller). Browsers
|
|
51
|
+
without WebGPU show a "requires WebGPU" notice, as there is no WebGL
|
|
52
|
+
fallback in this file.
|
|
53
|
+
|
|
54
|
+
On the single-engine builds the `renderer` attribute is ignored (with a
|
|
55
|
+
console warning when it asks for the engine the file doesn't contain).
|
|
56
|
+
|
|
38
57
|
## Options
|
|
39
58
|
|
|
40
59
|
### `url`
|
|
@@ -53,6 +72,12 @@ The desired height of the viewer in pixels. Ex: `height="400"`
|
|
|
53
72
|
|
|
54
73
|
A css like color that will override the background color of your scene as it was set in the editor. Ex: `background="#ff0000"`.
|
|
55
74
|
|
|
75
|
+
### `renderer` (optional)
|
|
76
|
+
|
|
77
|
+
The rendering engine used by the viewer. Possible values are `auto`, `webgpu` and `webgl` (`webgl2` is accepted as an alias of `webgl`). By default (`auto`) the runtime picks the engine per browser: WebGPU wherever the browser provides it — honoring the `Renderer` setting the scene was exported with — and WebGL everywhere else. Set `renderer="webgl"` to force the classic WebGL engine, or `renderer="webgpu"` to force the WebGPU one. Ex: `renderer="webgl"`.
|
|
78
|
+
|
|
79
|
+
Only meaningful on the default dual-engine `spline-viewer.js` build: the single-engine builds (see [Engine-specific builds](#engine-specific-builds)) contain one engine and ignore this attribute, logging a console warning when it asks for the other engine.
|
|
80
|
+
|
|
56
81
|
### `loading` (optional)
|
|
57
82
|
|
|
58
83
|
This option controls the agressiveness of the preload of your scene. Possible values are `auto`, `lazy` and `eager`. By default (`auto`) the behavior is to `lazy` load the scene and only start to preload when the tag enters the viewport. If you need to start loading immediately then you can set `loading="eager"` instead.
|
package/build/hana-ui.js
CHANGED
|
@@ -2002,6 +2002,10 @@ function __wbg_get_imports() {
|
|
|
2002
2002
|
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
2003
2003
|
return addHeapObject(ret);
|
|
2004
2004
|
}, arguments); },
|
|
2005
|
+
__wbg_get_index_ab123d64c89e3156: function(arg0, arg1) {
|
|
2006
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
2007
|
+
return ret;
|
|
2008
|
+
},
|
|
2005
2009
|
__wbg_get_unchecked_33f6e5c9e2f2d6b2: function(arg0, arg1) {
|
|
2006
2010
|
const ret = getObject(arg0)[arg1 >>> 0];
|
|
2007
2011
|
return addHeapObject(ret);
|
|
@@ -2406,7 +2410,7 @@ function __wbg_get_imports() {
|
|
|
2406
2410
|
const a = state0.a;
|
|
2407
2411
|
state0.a = 0;
|
|
2408
2412
|
try {
|
|
2409
|
-
return
|
|
2413
|
+
return __wasm_bindgen_func_elem_14112(a, state0.b, arg0, arg1);
|
|
2410
2414
|
} finally {
|
|
2411
2415
|
state0.a = a;
|
|
2412
2416
|
}
|
|
@@ -2452,7 +2456,7 @@ function __wbg_get_imports() {
|
|
|
2452
2456
|
const a = state0.a;
|
|
2453
2457
|
state0.a = 0;
|
|
2454
2458
|
try {
|
|
2455
|
-
return
|
|
2459
|
+
return __wasm_bindgen_func_elem_14112(a, state0.b, arg0, arg1);
|
|
2456
2460
|
} finally {
|
|
2457
2461
|
state0.a = a;
|
|
2458
2462
|
}
|
|
@@ -3552,48 +3556,48 @@ function __wbg_get_imports() {
|
|
|
3552
3556
|
getObject(arg0).writeTexture(getObject(arg1), getArrayU8FromWasm0(arg2, arg3), getObject(arg4), getObject(arg5));
|
|
3553
3557
|
}, arguments); },
|
|
3554
3558
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
3555
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
3556
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
3559
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 1052, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
3560
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_14110);
|
|
3557
3561
|
return addHeapObject(ret);
|
|
3558
3562
|
},
|
|
3559
3563
|
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
3560
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Event")], shim_idx:
|
|
3561
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
3564
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Event")], shim_idx: 32, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
3565
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_5086);
|
|
3562
3566
|
return addHeapObject(ret);
|
|
3563
3567
|
},
|
|
3564
3568
|
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
3565
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUComputePipeline")], shim_idx:
|
|
3566
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
3569
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUComputePipeline")], shim_idx: 927, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
3570
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_11070);
|
|
3567
3571
|
return addHeapObject(ret);
|
|
3568
3572
|
},
|
|
3569
3573
|
__wbindgen_cast_0000000000000004: function(arg0, arg1) {
|
|
3570
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUDevice")], shim_idx:
|
|
3571
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
3574
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUDevice")], shim_idx: 927, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
3575
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_11070_3);
|
|
3572
3576
|
return addHeapObject(ret);
|
|
3573
3577
|
},
|
|
3574
3578
|
__wbindgen_cast_0000000000000005: function(arg0, arg1) {
|
|
3575
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUDeviceLostInfo")], shim_idx:
|
|
3576
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
3579
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUDeviceLostInfo")], shim_idx: 928, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
3580
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_11071);
|
|
3577
3581
|
return addHeapObject(ret);
|
|
3578
3582
|
},
|
|
3579
3583
|
__wbindgen_cast_0000000000000006: function(arg0, arg1) {
|
|
3580
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPURenderPipeline")], shim_idx:
|
|
3581
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
3584
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPURenderPipeline")], shim_idx: 927, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
3585
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_11070_5);
|
|
3582
3586
|
return addHeapObject(ret);
|
|
3583
3587
|
},
|
|
3584
3588
|
__wbindgen_cast_0000000000000007: function(arg0, arg1) {
|
|
3585
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("any")], shim_idx:
|
|
3586
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
3589
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("any")], shim_idx: 927, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
3590
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_11070_6);
|
|
3587
3591
|
return addHeapObject(ret);
|
|
3588
3592
|
},
|
|
3589
3593
|
__wbindgen_cast_0000000000000008: function(arg0, arg1) {
|
|
3590
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("undefined")], shim_idx:
|
|
3591
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
3594
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("undefined")], shim_idx: 927, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
3595
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_11070_7);
|
|
3592
3596
|
return addHeapObject(ret);
|
|
3593
3597
|
},
|
|
3594
3598
|
__wbindgen_cast_0000000000000009: function(arg0, arg1) {
|
|
3595
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx:
|
|
3596
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
3599
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 1035, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
3600
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_12477);
|
|
3597
3601
|
return addHeapObject(ret);
|
|
3598
3602
|
},
|
|
3599
3603
|
__wbindgen_cast_000000000000000a: function(arg0) {
|
|
@@ -3667,22 +3671,22 @@ function __wbg_get_imports() {
|
|
|
3667
3671
|
};
|
|
3668
3672
|
}
|
|
3669
3673
|
|
|
3670
|
-
function
|
|
3671
|
-
wasm.
|
|
3674
|
+
function __wasm_bindgen_func_elem_12477(arg0, arg1) {
|
|
3675
|
+
wasm.__wasm_bindgen_func_elem_12477(arg0, arg1);
|
|
3672
3676
|
}
|
|
3673
3677
|
|
|
3674
|
-
function
|
|
3675
|
-
wasm.
|
|
3678
|
+
function __wasm_bindgen_func_elem_5086(arg0, arg1, arg2) {
|
|
3679
|
+
wasm.__wasm_bindgen_func_elem_5086(arg0, arg1, addHeapObject(arg2));
|
|
3676
3680
|
}
|
|
3677
3681
|
|
|
3678
|
-
function
|
|
3679
|
-
wasm.
|
|
3682
|
+
function __wasm_bindgen_func_elem_11071(arg0, arg1, arg2) {
|
|
3683
|
+
wasm.__wasm_bindgen_func_elem_11071(arg0, arg1, addHeapObject(arg2));
|
|
3680
3684
|
}
|
|
3681
3685
|
|
|
3682
|
-
function
|
|
3686
|
+
function __wasm_bindgen_func_elem_14110(arg0, arg1, arg2) {
|
|
3683
3687
|
try {
|
|
3684
3688
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3685
|
-
wasm.
|
|
3689
|
+
wasm.__wasm_bindgen_func_elem_14110(retptr, arg0, arg1, addHeapObject(arg2));
|
|
3686
3690
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3687
3691
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3688
3692
|
if (r1) {
|
|
@@ -3693,10 +3697,10 @@ function __wasm_bindgen_func_elem_12877(arg0, arg1, arg2) {
|
|
|
3693
3697
|
}
|
|
3694
3698
|
}
|
|
3695
3699
|
|
|
3696
|
-
function
|
|
3700
|
+
function __wasm_bindgen_func_elem_11070(arg0, arg1, arg2) {
|
|
3697
3701
|
try {
|
|
3698
3702
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3699
|
-
wasm.
|
|
3703
|
+
wasm.__wasm_bindgen_func_elem_11070(retptr, arg0, arg1, addHeapObject(arg2));
|
|
3700
3704
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3701
3705
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3702
3706
|
if (r1) {
|
|
@@ -3707,10 +3711,10 @@ function __wasm_bindgen_func_elem_9853(arg0, arg1, arg2) {
|
|
|
3707
3711
|
}
|
|
3708
3712
|
}
|
|
3709
3713
|
|
|
3710
|
-
function
|
|
3714
|
+
function __wasm_bindgen_func_elem_11070_3(arg0, arg1, arg2) {
|
|
3711
3715
|
try {
|
|
3712
3716
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3713
|
-
wasm.
|
|
3717
|
+
wasm.__wasm_bindgen_func_elem_11070_3(retptr, arg0, arg1, addHeapObject(arg2));
|
|
3714
3718
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3715
3719
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3716
3720
|
if (r1) {
|
|
@@ -3721,10 +3725,10 @@ function __wasm_bindgen_func_elem_9853_3(arg0, arg1, arg2) {
|
|
|
3721
3725
|
}
|
|
3722
3726
|
}
|
|
3723
3727
|
|
|
3724
|
-
function
|
|
3728
|
+
function __wasm_bindgen_func_elem_11070_5(arg0, arg1, arg2) {
|
|
3725
3729
|
try {
|
|
3726
3730
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3727
|
-
wasm.
|
|
3731
|
+
wasm.__wasm_bindgen_func_elem_11070_5(retptr, arg0, arg1, addHeapObject(arg2));
|
|
3728
3732
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3729
3733
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3730
3734
|
if (r1) {
|
|
@@ -3735,10 +3739,10 @@ function __wasm_bindgen_func_elem_9853_5(arg0, arg1, arg2) {
|
|
|
3735
3739
|
}
|
|
3736
3740
|
}
|
|
3737
3741
|
|
|
3738
|
-
function
|
|
3742
|
+
function __wasm_bindgen_func_elem_11070_6(arg0, arg1, arg2) {
|
|
3739
3743
|
try {
|
|
3740
3744
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3741
|
-
wasm.
|
|
3745
|
+
wasm.__wasm_bindgen_func_elem_11070_6(retptr, arg0, arg1, addHeapObject(arg2));
|
|
3742
3746
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3743
3747
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3744
3748
|
if (r1) {
|
|
@@ -3749,10 +3753,10 @@ function __wasm_bindgen_func_elem_9853_6(arg0, arg1, arg2) {
|
|
|
3749
3753
|
}
|
|
3750
3754
|
}
|
|
3751
3755
|
|
|
3752
|
-
function
|
|
3756
|
+
function __wasm_bindgen_func_elem_11070_7(arg0, arg1, arg2) {
|
|
3753
3757
|
try {
|
|
3754
3758
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3755
|
-
wasm.
|
|
3759
|
+
wasm.__wasm_bindgen_func_elem_11070_7(retptr, arg0, arg1, addHeapObject(arg2));
|
|
3756
3760
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3757
3761
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3758
3762
|
if (r1) {
|
|
@@ -3763,8 +3767,8 @@ function __wasm_bindgen_func_elem_9853_7(arg0, arg1, arg2) {
|
|
|
3763
3767
|
}
|
|
3764
3768
|
}
|
|
3765
3769
|
|
|
3766
|
-
function
|
|
3767
|
-
wasm.
|
|
3770
|
+
function __wasm_bindgen_func_elem_14112(arg0, arg1, arg2, arg3) {
|
|
3771
|
+
wasm.__wasm_bindgen_func_elem_14112(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
3768
3772
|
}
|
|
3769
3773
|
|
|
3770
3774
|
|
package/build/hana-ui.wasm
CHANGED
|
Binary file
|