@needle-tools/three-animation-pointer 1.0.0-beta → 1.0.0-beta.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@needle-tools/three-animation-pointer",
|
|
3
|
-
"version": "1.0.0-beta",
|
|
3
|
+
"version": "1.0.0-beta.2",
|
|
4
4
|
"description": "KHR_animation_pointer support for three.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"url": "https://needle.tools/"
|
|
20
20
|
},
|
|
21
21
|
"repository": {
|
|
22
|
-
"url": "https://github.com/needle-tools/three-
|
|
22
|
+
"url": "https://github.com/needle-tools/three-animation-pointer"
|
|
23
23
|
},
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"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/types/index.d.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
import { GLTFLoaderPlugin } from "three/examples/jsm/loaders/GLTFLoader";
|
|
2
|
+
import { GLTFLoaderPlugin } from "../src/GLTFLoaderAnimationPointer";
|
|
1
3
|
|
|
2
4
|
|
|
3
5
|
export type AnimationPointerResolver = {
|
|
4
6
|
resolvePath(path: string): string | null;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export type GLTFAnimationPointerExtension = GLTFLoaderPlugin & {
|
|
10
|
+
setAnimationPointerResolver(resolver: AnimationPointerResolver | null): void;
|
|
5
11
|
}
|