sebastien 6 年之前
父节点
当前提交
833409e8d9
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      loaders/src/glTF/2.0/glTFLoader.ts

+ 4 - 0
loaders/src/glTF/2.0/glTFLoader.ts

@@ -1037,6 +1037,10 @@ export class GLTFLoaderV2 implements IGLTFLoader {
     }
     }
 
 
     private _loadAnimationChannelAsync(context: string, animationContext: string, animation: IAnimationV2, channel: IAnimationChannelV2, babylonAnimationGroup: AnimationGroup): Promise<void> {
     private _loadAnimationChannelAsync(context: string, animationContext: string, animation: IAnimationV2, channel: IAnimationChannelV2, babylonAnimationGroup: AnimationGroup): Promise<void> {
+        if (channel.target.node == undefined) {
+            return Promise.resolve();
+        }
+
         const targetNode = ArrayItem.Get(`${context}/target/node`, this.gltf.nodes, channel.target.node);
         const targetNode = ArrayItem.Get(`${context}/target/node`, this.gltf.nodes, channel.target.node);
 
 
         // Ignore animations that have no animation targets.
         // Ignore animations that have no animation targets.