@needle-tools/three-animation-pointer 1.0.0-beta.1 → 1.0.0-beta.3
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 +8 -0
- package/package.json +7 -2
- package/src/GLTFLoaderAnimationPointer.js +8 -3
- package/src/index.js +5 -1
- package/types/index.d.ts +9 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
All notable changes to this package will be documented in this file.
|
|
3
|
+
|
|
4
|
+
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
5
|
+
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
6
|
+
|
|
7
|
+
## [1.0.0] - 2025-08-27
|
|
8
|
+
- Initial release
|
package/package.json
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@needle-tools/three-animation-pointer",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.3",
|
|
4
4
|
"description": "KHR_animation_pointer support for three.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
7
7
|
"types": "types/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./src/index.js"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
8
13
|
"files": [
|
|
9
14
|
"src",
|
|
10
15
|
"types",
|
|
@@ -19,7 +24,7 @@
|
|
|
19
24
|
"url": "https://needle.tools/"
|
|
20
25
|
},
|
|
21
26
|
"repository": {
|
|
22
|
-
"url": "https://github.com/needle-tools/three-
|
|
27
|
+
"url": "https://github.com/needle-tools/three-animation-pointer"
|
|
23
28
|
},
|
|
24
29
|
"license": "MIT",
|
|
25
30
|
"devDependencies": {
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from 'three';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* @typedef {import("
|
|
14
|
+
* @typedef {import("..").GLTFAnimationPointerExtension} PluginType
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
// DUPLICATED from GLTFLoader.js
|
|
@@ -41,7 +41,7 @@ const _animationPointerDebug = false;
|
|
|
41
41
|
*
|
|
42
42
|
* Draft Specification: https://github.com/ux3d/glTF/tree/extensions/KHR_animation_pointer/extensions/2.0/Khronos/KHR_animation_pointer
|
|
43
43
|
*
|
|
44
|
-
* @implements {
|
|
44
|
+
* @implements {PluginType}
|
|
45
45
|
*/
|
|
46
46
|
export class GLTFAnimationPointerExtension {
|
|
47
47
|
|
|
@@ -339,7 +339,7 @@ export class GLTFAnimationPointerExtension {
|
|
|
339
339
|
|
|
340
340
|
}
|
|
341
341
|
|
|
342
|
-
if ( targetId === null || isNaN( targetId ) ) {
|
|
342
|
+
if ( targetId === null || targetId === undefined || isNaN( targetId ) ) {
|
|
343
343
|
|
|
344
344
|
console.warn( 'Failed resolving animation node id: ' + targetId, target );
|
|
345
345
|
return;
|
|
@@ -442,6 +442,11 @@ export class GLTFAnimationPointerExtension {
|
|
|
442
442
|
|
|
443
443
|
}
|
|
444
444
|
|
|
445
|
+
if( !TypedKeyframeTrack ) {
|
|
446
|
+
console.warn( 'Unsupported output accessor format', outputAccessor );
|
|
447
|
+
return;
|
|
448
|
+
}
|
|
449
|
+
|
|
445
450
|
const interpolation = sampler.interpolation !== undefined ? INTERPOLATION[ sampler.interpolation ] : InterpolateLinear;
|
|
446
451
|
|
|
447
452
|
let outputArray = parser._getArrayFromAccessor( outputAccessor );
|
package/src/index.js
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
import { GLTFLoaderPlugin } from "three/examples/jsm/loaders/GLTFLoader.js";
|
|
2
2
|
|
|
3
3
|
export type AnimationPointerResolver = {
|
|
4
4
|
resolvePath(path: string): string | null;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export declare class GLTFAnimationPointerExtension implements GLTFLoaderPlugin {
|
|
8
|
+
name: string;
|
|
9
|
+
parser: any;
|
|
10
|
+
constructor(parser: any);
|
|
11
|
+
setAnimationPointerResolver(resolver: AnimationPointerResolver | null): GLTFAnimationPointerExtension;
|
|
12
|
+
loadAnimation(animationIndex: number): Promise<any>;
|
|
5
13
|
}
|