@forgeax/engine-fbx 0.1.3 → 0.1.6
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 +9 -17
- package/dist/.tsbuildinfo +1 -1
- package/dist/fbx-importer.d.ts +1 -2
- package/dist/fbx-importer.d.ts.map +1 -1
- package/dist/index.mjs +206 -8253
- package/dist/index.mjs.map +1 -1
- package/dist/parse-material.d.ts +1 -7
- package/dist/parse-material.d.ts.map +1 -1
- package/dist/parse-texture.d.ts +1 -5
- package/dist/parse-texture.d.ts.map +1 -1
- package/dist/to-asset-pack.d.ts +1 -8
- package/dist/to-asset-pack.d.ts.map +1 -1
- package/package.json +11 -12
- package/pkg/fbx-wasm.wasm +0 -0
- package/src/__tests__/blendshape-import.integration.test.ts +12 -18
- package/src/__tests__/fbx-importer.test.ts +1 -165
- package/src/__tests__/index.test.ts +1 -0
- package/src/fbx-importer.ts +10 -236
- package/src/native/bridge.c +0 -118
- package/src/parse-material.ts +1 -49
- package/src/parse-texture.ts +3 -17
- package/src/to-asset-pack.ts +20 -91
- package/dist/__tests__/asset-runtime-fixture.d.ts +0 -9
- package/dist/__tests__/asset-runtime-fixture.d.ts.map +0 -1
- package/src/__tests__/asset-runtime-fixture.ts +0 -251
package/README.md
CHANGED
|
@@ -19,21 +19,20 @@ FBX bytes -> ufbx (wasm) -> JSON POD -> parse-*.ts -> meta.json
|
|
|
19
19
|
## AI user consumption path
|
|
20
20
|
|
|
21
21
|
The importer key `'fbx'` is unchanged from the SDK era -- zero migration for
|
|
22
|
-
existing `.fbx.meta.json` sidecars. The
|
|
23
|
-
|
|
22
|
+
existing `.fbx.meta.json` sidecars. The engine resolves the importer
|
|
23
|
+
automatically via `loadByGuid`:
|
|
24
24
|
|
|
25
25
|
```ts
|
|
26
|
-
|
|
26
|
+
// 1) Point the asset registry at the pack index
|
|
27
|
+
assets.configurePackIndex('/pack-index.json');
|
|
27
28
|
|
|
28
|
-
//
|
|
29
|
-
const res = await assets.
|
|
29
|
+
// 2) loadByGuid dispatches on meta.importer: 'fbx' automatically
|
|
30
|
+
const res = await assets.loadByGuid<SceneAsset>(guid);
|
|
30
31
|
if (!res.ok) {
|
|
31
32
|
console.error(res.error.code, res.error.hint);
|
|
32
33
|
return;
|
|
33
34
|
}
|
|
34
|
-
|
|
35
|
-
const scene = world.internSharedRef('SceneAsset', res.value);
|
|
36
|
-
const root = world.instantiateScene(scene);
|
|
35
|
+
const scene = res.value; // SceneAsset -- ready for instantiate()
|
|
37
36
|
```
|
|
38
37
|
|
|
39
38
|
Under the hood, `vite-plugin-pack` calls `fbxImporter.import(ctx)` which
|
|
@@ -97,18 +96,11 @@ Do not copy-paste the member list; inspect the source for the current union.
|
|
|
97
96
|
|
|
98
97
|
## Contributor toolchain
|
|
99
98
|
|
|
100
|
-
> [!NOTE]
|
|
101
|
-
> A source tree containing `.forgeax-public-distribution` is the public SDK
|
|
102
|
-
> source mode. It already carries the checked `pkg/` closure, so ordinary SDK
|
|
103
|
-
> install/build work does not need `fetch-wasm`, emcc, or a network connection.
|
|
104
|
-
> Rebuild the bundle only when the FBX WASM source or toolchain changes. The
|
|
105
|
-
> fetch/build paths below describe a contributor checkout.
|
|
106
|
-
|
|
107
99
|
<details>
|
|
108
100
|
<summary>Getting pre-built WASM (fetch-wasm)</summary>
|
|
109
101
|
|
|
110
|
-
|
|
111
|
-
|
|
102
|
+
The `pkg/` directory is **not committed to git** (zero-binary invariant). A
|
|
103
|
+
workspace `pnpm install` or `bun install` runs a package-local, best-effort
|
|
112
104
|
postinstall hook that fetches the matching bundle when it is absent. The hook
|
|
113
105
|
is idempotent and non-fatal: it skips a complete `pkg/`, and an unavailable
|
|
114
106
|
release leaves installation successful with the explicit recovery command
|