Browse Source

Skeleton: Avoid creating empty texture. See #6869.

Mr.doob 10 years ago
parent
commit
b9a8664f2c
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/objects/Skeleton.js

+ 2 - 0
src/objects/Skeleton.js

@@ -30,6 +30,8 @@ THREE.Skeleton = function ( bones, boneInverses, useVertexTexture ) {
 
 		var size = THREE.Math.nextPowerOfTwo( Math.sqrt( this.bones.length * 4 ) ); // 4 pixels needed for 1 matrix
 
+		if ( size === 0 ) size = 2; // Avoid creating empty texture
+
 		this.boneTextureWidth = size;
 		this.boneTextureHeight = size;