three-vat 4.1.0 → 4.2.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 +37 -8
- package/dist/bin.d.ts +1 -0
- package/dist/bin.js +585 -0
- package/dist/carrier-DmKhB4QL.d.ts +13 -0
- package/dist/{chunk-OEKKEHRQ.js → chunk-4IKOXUSX.js} +85 -26
- package/dist/chunk-7TT7B5WS.js +263 -0
- package/dist/chunk-P6AFXEBT.js +1104 -0
- package/dist/index.d.ts +37 -5
- package/dist/index.js +142 -965
- package/dist/tsl.d.ts +2 -1
- package/dist/tsl.js +18 -15
- package/dist/{carrier-VLSJLgjX.d.ts → types-CDPXKe0_.d.ts} +99 -34
- package/dist/webgl.d.ts +2 -1
- package/dist/webgl.js +25 -14
- package/dist/write.d.ts +53 -0
- package/dist/write.js +3 -0
- package/package.json +88 -81
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { AnimationClip, AnimationAction, Object3D, DataTexture, FloatType, HalfFloatType } from 'three';
|
|
2
|
-
import { D as DeltaVAT, R as RigVAT,
|
|
3
|
-
export { E as EndMode, I as INFINITE_REPETITIONS, L as LoopMode,
|
|
1
|
+
import { AnimationClip, AnimationAction, Object3D, Material, DataTexture, FloatType, HalfFloatType } from 'three';
|
|
2
|
+
import { D as DeltaVAT, R as RigVAT, b as VAT } from './types-CDPXKe0_.js';
|
|
3
|
+
export { E as EndMode, I as INFINITE_REPETITIONS, L as LoopMode, e as VATBase, f as VATClip, g as VATClipDefaults, V as VATClock, d as VATCrowd, h as VATFrame, c as VATInstance, i as VATOutgoingFrame, j as VATPlaybackState, a as VATPlaybackTexture, k as VATPlaybackTextureOptions, l as createVATPlaybackTexture, m as endsAt, r as resolveVATFrame, s as setVATInstance, t as turnVATInstance } from './types-CDPXKe0_.js';
|
|
4
|
+
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js';
|
|
5
|
+
export { V as VATCarrier } from './carrier-DmKhB4QL.js';
|
|
4
6
|
|
|
5
7
|
/**
|
|
6
8
|
* What {@link bakeVAT} takes for each animation: the clip itself, or an
|
|
@@ -107,7 +109,8 @@ interface BakeOptions {
|
|
|
107
109
|
* a plain clip carries no configuration, so the simple case still needs no
|
|
108
110
|
* mixer at all and takes the library defaults ({@link VATClipDefaults}).
|
|
109
111
|
*
|
|
110
|
-
* `loop`, `repetitions` and `timeScale` are read
|
|
112
|
+
* `loop`, `repetitions` and `timeScale` are read, a negative `timeScale` as a
|
|
113
|
+
* clip that plays backwards by default (ADR-0033). **`clampWhenFinished` is
|
|
111
114
|
* not**: it is `false` on every untouched action, so a crowd reads it as the
|
|
112
115
|
* silence it usually is and clamps either way — an instance names
|
|
113
116
|
* `endMode: EndMode.Rewind` to get three's behaviour back.
|
|
@@ -154,6 +157,35 @@ declare function bakeVAT(root: Object3D, animations: BakeInput[], options: BakeO
|
|
|
154
157
|
}): RigVAT;
|
|
155
158
|
declare function bakeVAT(root: Object3D, animations: BakeInput[], options?: BakeOptions): VAT;
|
|
156
159
|
|
|
160
|
+
interface LoadVATOptions {
|
|
161
|
+
/**
|
|
162
|
+
* The loader to read the file with: yours, configured as your page already
|
|
163
|
+
* configures it. A plain `GLTFLoader` when none is passed. The plugin that
|
|
164
|
+
* reads the baked file is registered on it once, and leaves every other
|
|
165
|
+
* file it loads alone.
|
|
166
|
+
*/
|
|
167
|
+
loader?: GLTFLoader;
|
|
168
|
+
/**
|
|
169
|
+
* Your own materials, to use in place of the file's: one for each
|
|
170
|
+
* `materialIndex`, in that order, as `vat.materials` holds them. Replaces
|
|
171
|
+
* them wholesale, so a crowd is restyled without a re-bake. An array of
|
|
172
|
+
* another length is refused.
|
|
173
|
+
*/
|
|
174
|
+
materials?: Material[];
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Load a baked file, written by `npx three-vat bake <input> --out <file>`, as
|
|
178
|
+
* the VAT `bakeVAT` returned when the command baked it: every texel, the clip
|
|
179
|
+
* table with its defaults, the bounds and `fallback`. Hand it to
|
|
180
|
+
* `createVATMesh` exactly as a fresh one.
|
|
181
|
+
*
|
|
182
|
+
* Refuses, by name, a file of another format version, which is to be baked
|
|
183
|
+
* again, and a file whose geometry no longer matches the one its texels are
|
|
184
|
+
* addressed by, which an optimizer that reorders, welds or simplifies vertices
|
|
185
|
+
* is the likely cause of.
|
|
186
|
+
*/
|
|
187
|
+
declare function loadVAT(url: string, { loader, materials }?: LoadVATOptions): Promise<VAT>;
|
|
188
|
+
|
|
157
189
|
/**
|
|
158
190
|
* The WebGL2 *spec floor for high-end desktop*, which two things lean on.
|
|
159
191
|
*
|
|
@@ -318,4 +350,4 @@ declare function bakeVATInWorker(worker: VATBakeWorker, root: Object3D, animatio
|
|
|
318
350
|
*/
|
|
319
351
|
declare function serveVATBakes(scope?: VATBakeScope): () => void;
|
|
320
352
|
|
|
321
|
-
export { type BakeInput, type BakeOptions, DeltaVAT, MAX_TEXTURE_SIZE, RigVAT, VAT, type VATBakeScope, type VATBakeWorker, type Vec3Out, bakeVAT, bakeVATInWorker, decodeOctahedral, encodeOctahedral, makeVATNormalTexture, makeVATTexture, serveVATBakes };
|
|
353
|
+
export { type BakeInput, type BakeOptions, DeltaVAT, type LoadVATOptions, MAX_TEXTURE_SIZE, RigVAT, VAT, type VATBakeScope, type VATBakeWorker, type Vec3Out, bakeVAT, bakeVATInWorker, decodeOctahedral, encodeOctahedral, loadVAT, makeVATNormalTexture, makeVATTexture, serveVATBakes };
|