浏览代码

Add null check for skeleton while processing skinned mesh for export

tiptopanonymous 5 年之前
父节点
当前提交
d709d1580b
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      examples/js/exporters/GLTFExporter.js

+ 1 - 1
examples/js/exporters/GLTFExporter.js

@@ -1648,7 +1648,7 @@ THREE.GLTFExporter.prototype = {
 			var skeleton = object.skeleton;
 			var rootJoint = object.skeleton.bones[ 0 ];
 
-			if ( rootJoint === undefined ) return null;
+			if ( skeleton === undefined || rootJoint === undefined ) return null;
 
 			var joints = [];
 			var inverseBindMatrices = new Float32Array( skeleton.bones.length * 16 );