File tree Expand file tree Collapse file tree 3 files changed +15
-4
lines changed
Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @needle-tools/three-animation-pointer" ,
3- "version" : " 1.0.0-beta.1 " ,
3+ "version" : " 1.0.0-beta.2 " ,
44 "description" : " KHR_animation_pointer support for three.js" ,
55 "type" : " module" ,
66 "main" : " src/index.js" ,
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import {
1111} from 'three' ;
1212
1313/**
14- * @typedef {import("three/examples/jsm/loaders/GLTFLoader ").GLTFLoaderPlugin } GLTFLoaderPlugin
14+ * @typedef {import(".. ").GLTFAnimationPointerExtension } PluginType
1515 */
1616
1717// DUPLICATED from GLTFLoader.js
@@ -41,7 +41,7 @@ const _animationPointerDebug = false;
4141 *
4242 * Draft Specification: https://github.com/ux3d/glTF/tree/extensions/KHR_animation_pointer/extensions/2.0/Khronos/KHR_animation_pointer
4343 *
44- * @implements {GLTFLoaderPlugin }
44+ * @implements {PluginType }
4545 */
4646export class GLTFAnimationPointerExtension {
4747
@@ -339,7 +339,7 @@ export class GLTFAnimationPointerExtension {
339339
340340 }
341341
342- if ( targetId === null || isNaN ( targetId ) ) {
342+ if ( targetId === null || targetId === undefined || isNaN ( targetId ) ) {
343343
344344 console . warn ( 'Failed resolving animation node id: ' + targetId , target ) ;
345345 return ;
@@ -442,6 +442,11 @@ export class GLTFAnimationPointerExtension {
442442
443443 }
444444
445+ if ( ! TypedKeyframeTrack ) {
446+ console . warn ( 'Unsupported output accessor format' , outputAccessor ) ;
447+ return ;
448+ }
449+
445450 const interpolation = sampler . interpolation !== undefined ? INTERPOLATION [ sampler . interpolation ] : InterpolateLinear ;
446451
447452 let outputArray = parser . _getArrayFromAccessor ( outputAccessor ) ;
Original file line number Diff line number Diff line change 1+ import { GLTFLoaderPlugin } from "three/examples/jsm/loaders/GLTFLoader" ;
2+ import { GLTFLoaderPlugin } from "../src/GLTFLoaderAnimationPointer" ;
13
24
35export type AnimationPointerResolver = {
46 resolvePath ( path : string ) : string | null ;
7+ }
8+
9+ export type GLTFAnimationPointerExtension = GLTFLoaderPlugin & {
10+ setAnimationPointerResolver ( resolver : AnimationPointerResolver | null ) : void ;
511}
You can’t perform that action at this time.
0 commit comments