@aethervtt/shard-gltf 0.2.0 → 0.2.2
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/importer.js +3 -3
- package/package.json +11 -10
package/dist/importer.js
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
import { defineImporter } from "@aethervtt/shard-assets";
|
|
6
6
|
import { defineSchema, ShardError, t } from "@aethervtt/shard-core";
|
|
7
7
|
import { encodeMesh, Mesh } from "@aethervtt/shard-mesh";
|
|
8
|
+
import { nodeCodecs, requireCodec } from "@aethervtt/shard-platform-node/codecs";
|
|
8
9
|
import { MAX_JOINTS, StandardMaterial, skinArtifact } from "@aethervtt/shard-render";
|
|
9
10
|
import { importImageBytes } from "@aethervtt/shard-texture";
|
|
10
11
|
import { Accessors } from "./accessors.js";
|
|
@@ -322,14 +323,13 @@ function convertMaterial(m, settings, textures, warn, ptr) {
|
|
|
322
323
|
return { json: StandardMaterial.serialize(StandardMaterial.deserialize(value)), dependencies };
|
|
323
324
|
}
|
|
324
325
|
async function generateTangents(data) {
|
|
325
|
-
if (
|
|
326
|
+
if (!nodeCodecs) {
|
|
326
327
|
throw new ShardError(
|
|
327
328
|
"gltf/tangents-unavailable",
|
|
328
329
|
"Generating tangents needs a Node host (the CLI or shard dev)"
|
|
329
330
|
);
|
|
330
331
|
}
|
|
331
|
-
const
|
|
332
|
-
const mikk = createRequire(import.meta.url)("mikktspace");
|
|
332
|
+
const mikk = requireCodec("mikktspace", import.meta.url);
|
|
333
333
|
const tri = data.indices ?? Uint32Array.from({ length: data.positions.length / 3 }, (_, i) => i);
|
|
334
334
|
const expand = (arr, width) => {
|
|
335
335
|
if (!arr) return void 0;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aethervtt/shard-gltf",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -16,14 +16,15 @@
|
|
|
16
16
|
"README.md"
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@aethervtt/shard-animation": "0.2.
|
|
20
|
-
"@aethervtt/shard-assets": "0.2.
|
|
21
|
-
"@aethervtt/shard-core": "0.2.
|
|
22
|
-
"@aethervtt/shard-mesh": "0.2.
|
|
23
|
-
"@aethervtt/shard-render": "0.2.
|
|
24
|
-
"@aethervtt/shard-scene": "0.2.
|
|
25
|
-
"@aethervtt/shard-texture": "0.2.
|
|
26
|
-
"mikktspace": "^1.1.1"
|
|
19
|
+
"@aethervtt/shard-animation": "0.2.2",
|
|
20
|
+
"@aethervtt/shard-assets": "0.2.2",
|
|
21
|
+
"@aethervtt/shard-core": "0.2.2",
|
|
22
|
+
"@aethervtt/shard-mesh": "0.2.2",
|
|
23
|
+
"@aethervtt/shard-render": "0.2.2",
|
|
24
|
+
"@aethervtt/shard-scene": "0.2.2",
|
|
25
|
+
"@aethervtt/shard-texture": "0.2.2",
|
|
26
|
+
"mikktspace": "^1.1.1",
|
|
27
|
+
"@aethervtt/shard-platform-node": "0.2.2"
|
|
27
28
|
},
|
|
28
29
|
"repository": {
|
|
29
30
|
"type": "git",
|
|
@@ -35,6 +36,6 @@
|
|
|
35
36
|
"provenance": true
|
|
36
37
|
},
|
|
37
38
|
"shard": {
|
|
38
|
-
"buildSha": "
|
|
39
|
+
"buildSha": "c92ccf813334ab40ce73d5f4ad98680bf1dcf9e4"
|
|
39
40
|
}
|
|
40
41
|
}
|