Skip to content

Commit

Permalink
Editor: Added 3DS file support.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed May 14, 2017
1 parent 4cd625f commit f9edcec
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions editor/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<script src="../examples/js/loaders/PLYLoader.js"></script>
<script src="../examples/js/loaders/STLLoader.js"></script>
<script src="../examples/js/loaders/TGALoader.js"></script>
<script src="../examples/js/loaders/TDSLoader.js"></script>
<script src="../examples/js/loaders/UTF8Loader.js"></script>
<script src="../examples/js/loaders/VRMLLoader.js"></script>
<script src="../examples/js/loaders/VTKLoader.js"></script>
Expand Down
14 changes: 14 additions & 0 deletions editor/js/Loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,20 @@ var Loader = function ( editor ) {

switch ( extension ) {

case '3ds':

reader.addEventListener( 'load', function ( event ) {

var loader = new THREE.TDSLoader();
var object = loader.parse( event.target.result );

editor.execute( new AddObjectCommand( object ) );

}, false );
reader.readAsArrayBuffer( file );

break;

case 'amf':

reader.addEventListener( 'load', function ( event ) {
Expand Down

0 comments on commit f9edcec

Please sign in to comment.