|
@@ -926,6 +926,17 @@ THREE.GLTFExporter.prototype = {
|
|
|
var attribute = geometry.attributes[ attributeName ];
|
|
|
attributeName = nameConversion[ attributeName ] || attributeName.toUpperCase();
|
|
|
|
|
|
+ // JOINTS_0 must be UNSIGNED_BYTE or UNSIGNED_SHORT.
|
|
|
+ var array = attribute.array;
|
|
|
+ if ( attributeName === 'JOINTS_0' &&
|
|
|
+ ! ( array instanceof Uint16Array ) &&
|
|
|
+ ! ( array instanceof Uint8Array ) ) {
|
|
|
+
|
|
|
+ console.warn( 'GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.' );
|
|
|
+ attribute = new THREE.BufferAttribute( new Uint16Array( array ), attribute.itemSize, attribute.normalized );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
if ( attributeName.substr( 0, 5 ) !== 'MORPH' ) {
|
|
|
|
|
|
attributes[ attributeName ] = processAccessor( attribute, geometry );
|