@aethervtt/shard-gltf 0.2.1 → 0.3.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.
Files changed (2) hide show
  1. package/dist/importer.js +3 -3
  2. 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 (typeof process === "undefined" || !process.versions?.node) {
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 { createRequire } = await import("node:module");
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.1",
3
+ "version": "0.3.0",
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.1",
20
- "@aethervtt/shard-assets": "0.2.1",
21
- "@aethervtt/shard-core": "0.2.1",
22
- "@aethervtt/shard-mesh": "0.2.1",
23
- "@aethervtt/shard-render": "0.2.1",
24
- "@aethervtt/shard-scene": "0.2.1",
25
- "@aethervtt/shard-texture": "0.2.1",
26
- "mikktspace": "^1.1.1"
19
+ "@aethervtt/shard-animation": "0.3.0",
20
+ "@aethervtt/shard-assets": "0.3.0",
21
+ "@aethervtt/shard-core": "0.3.0",
22
+ "@aethervtt/shard-mesh": "0.3.0",
23
+ "@aethervtt/shard-render": "0.3.0",
24
+ "@aethervtt/shard-scene": "0.3.0",
25
+ "@aethervtt/shard-texture": "0.3.0",
26
+ "mikktspace": "^1.1.1",
27
+ "@aethervtt/shard-platform-node": "0.3.0"
27
28
  },
28
29
  "repository": {
29
30
  "type": "git",
@@ -35,6 +36,6 @@
35
36
  "provenance": true
36
37
  },
37
38
  "shard": {
38
- "buildSha": "772eb0d2b8a5fc499105708f4ae92c58788cc9ea"
39
+ "buildSha": "7c8c46fee30f86eff262af53b9249bdae6ce4927"
39
40
  }
40
41
  }