Skip to content

Commit 7049d79

Browse files
authored
Editor: Added vertex colors support to draco export (#22001)
1 parent 069e6c6 commit 7049d79

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

editor/js/Menubar.File.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,18 @@ function MenubarFile( editor ) {
228228

229229
var exporter = new DRACOExporter();
230230

231+
const options = {
232+
decodeSpeed: 5,
233+
encodeSpeed: 5,
234+
encoderMethod: DRACOExporter.MESH_EDGEBREAKER_ENCODING,
235+
quantization: [ 16, 8, 8, 8, 8 ],
236+
exportUvs: true,
237+
exportNormals: true,
238+
exportColor: object.geometry.hasAttribute( 'color' )
239+
};
240+
231241
// TODO: Change to DRACOExporter's parse( geometry, onParse )?
232-
var result = exporter.parse( object );
242+
var result = exporter.parse( object, options );
233243
saveArrayBuffer( result, 'model.drc' );
234244

235245
} );

0 commit comments

Comments
 (0)