@needle-tools/gltf-build-pipeline 1.2.4 → 1.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.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,10 @@ All notable changes to this package will be documented in this file.
4
4
  The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
5
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [1.3.0] - 2023-10-20
8
+ - fix: meshopt with khr_animation_2 extension was not correctly processed: animated node and target were not passed to gltf-transform which caused a wrong processing of meshopt. We now pass this information to the gltf-transform AnimationChannel object
9
+ - change: bump gltf-transform to 3.7.3
10
+
7
11
  ## [1.2.4] - 2023-09-30
8
12
  - fix: bug in progressive texture transform where extension wasnt added correctly (NE-3627)
9
13
 
@@ -33,12 +33,23 @@ export function createOpaqueExtension(name, types, opts) {
33
33
  case PropertyType.ANIMATION_CHANNEL:
34
34
  if (EXTENSION_NAME === "KHR_animation_pointer") {
35
35
  context.jsonDoc.json.animations?.forEach((animDef, animIndex) => {
36
+ const anim = context.animations[animIndex];
37
+ const channels = anim.listChannels();
36
38
  animDef.channels?.forEach((channel, channelIndex) => {
37
39
  const jsonTarget = channel.target;
38
40
  const khr_animation = jsonTarget.extensions && jsonTarget.extensions[EXTENSION_NAME];
39
41
  if (!khr_animation)
40
42
  return;
41
- const anim = context.animations[animIndex];
43
+ const pointer = khr_animation.pointer;
44
+ if (pointer) {
45
+ const sections = pointer.split("/");
46
+ const nodeIndex = parseInt(sections[2]);
47
+ const targetName = sections[3];
48
+ if (targetName === "scale" || targetName === "translation" || targetName === "rotation") {
49
+ channels[channelIndex].setTargetNode(context.nodes[nodeIndex]);
50
+ channels[channelIndex].setTargetPath(targetName);
51
+ }
52
+ }
42
53
  const existing = anim.getExtension(EXTENSION_NAME);
43
54
  if (debugLog)
44
55
  console.log(">>>", EXTENSION_NAME, "animation", animIndex, "channel", channelIndex, khr_animation);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@needle-tools/gltf-build-pipeline",
3
- "version": "1.2.4",
3
+ "version": "1.3.0",
4
4
  "description": "Pipeline and tools for optimizing gltf files using gltf-transform and compression settings within glTF extensions",
5
5
  "main": "index.mjs",
6
6
  "type": "module",
@@ -16,9 +16,9 @@
16
16
  "compile": "tsc || exit 1"
17
17
  },
18
18
  "dependencies": {
19
- "@gltf-transform/core": "^3.4.6",
20
- "@gltf-transform/extensions": "^3.4.6",
21
- "@gltf-transform/functions": "^3.4.6",
19
+ "@gltf-transform/core": "^3.7.3",
20
+ "@gltf-transform/extensions": "^3.7.3",
21
+ "@gltf-transform/functions": "^3.7.3",
22
22
  "command-exists": "^1.2.9",
23
23
  "command-line-args": "^5.2.1",
24
24
  "draco3dgltf": "^1.5.3",