File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -1852,12 +1852,12 @@ class GLTFWriter {
18521852 ! ( array instanceof Uint8Array ) ) {
18531853
18541854 console . warn ( 'GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.' ) ;
1855- modifiedAttribute = new BufferAttribute ( new Uint16Array ( array ) , attribute . itemSize , attribute . normalized ) ;
1855+ modifiedAttribute = GLTFExporter . Utils . toTypedBufferAttribute ( attribute , Uint16Array ) ;
18561856
18571857 } else if ( ( array instanceof Uint32Array || array instanceof Int32Array ) && ! attributeName . startsWith ( '_' ) ) {
18581858
18591859 console . warn ( `GLTFExporter: Attribute "${ attributeName } " converted to type FLOAT.` ) ;
1860- modifiedAttribute = GLTFExporter . Utils . toFloat32BufferAttribute ( attribute ) ;
1860+ modifiedAttribute = GLTFExporter . Utils . toTypedBufferAttribute ( attribute , Float32Array ) ;
18611861
18621862 }
18631863
@@ -3538,9 +3538,9 @@ GLTFExporter.Utils = {
35383538
35393539 } ,
35403540
3541- toFloat32BufferAttribute : function ( srcAttribute ) {
3541+ toTypedBufferAttribute : function ( srcAttribute , TypedArray ) {
35423542
3543- const dstAttribute = new BufferAttribute ( new Float32Array ( srcAttribute . count * srcAttribute . itemSize ) , srcAttribute . itemSize , false ) ;
3543+ const dstAttribute = new BufferAttribute ( new TypedArray ( srcAttribute . count * srcAttribute . itemSize ) , srcAttribute . itemSize , false ) ;
35443544
35453545 if ( ! srcAttribute . normalized && ! srcAttribute . isInterleavedBufferAttribute ) {
35463546
You can’t perform that action at this time.
0 commit comments