未验证 提交 d1375d69 编写于 作者: M Mr.doob 提交者: GitHub

Merge pull request #18106 from Mugen87/dev29

Editor: Add PLYExporter.
......@@ -39,6 +39,7 @@
<script src="../examples/js/exporters/ColladaExporter.js"></script>
<script src="../examples/js/exporters/GLTFExporter.js"></script>
<script src="../examples/js/exporters/OBJExporter.js"></script>
<script src="../examples/js/exporters/PLYExporter.js"></script>
<script src="../examples/js/exporters/STLExporter.js"></script>
<script src="../examples/js/renderers/Projector.js"></script>
......
......@@ -266,6 +266,42 @@ Menubar.File = function ( editor ) {
} );
options.add( option );
// Export PLY (ASCII)
var option = new UI.Row();
option.setClass( 'option' );
option.setTextContent( strings.getKey( 'menubar/file/export/ply' ) );
option.onClick( function () {
var exporter = new THREE.PLYExporter();
exporter.parse( editor.scene, function ( result ) {
saveArrayBuffer( result, 'model.ply' );
} );
} );
options.add( option );
// Export PLY (Binary)
var option = new UI.Row();
option.setClass( 'option' );
option.setTextContent( strings.getKey( 'menubar/file/export/ply_binary' ) );
option.onClick( function () {
var exporter = new THREE.PLYExporter();
exporter.parse( editor.scene, function ( result ) {
saveArrayBuffer( result, 'model-binary.ply' );
}, { binary: true } );
} );
options.add( option );
// Export STL (ASCII)
var option = new UI.Row();
......
......@@ -20,6 +20,8 @@ var Strings = function ( config ) {
'menubar/file/export/glb': 'Export GLB',
'menubar/file/export/gltf': 'Export GLTF',
'menubar/file/export/obj': 'Export OBJ',
'menubar/file/export/ply': 'Export PLY',
'menubar/file/export/ply_binary': 'Export PLY (Binary)',
'menubar/file/export/stl': 'Export STL',
'menubar/file/export/stl_binary': 'Export STL (Binary)',
'menubar/file/publish': 'Publish',
......@@ -325,6 +327,8 @@ var Strings = function ( config ) {
'menubar/file/export/glb': '导出GLB',
'menubar/file/export/gltf': '导出GLTF',
'menubar/file/export/obj': '导出OBJ',
'menubar/file/export/ply': '导出PLY',
'menubar/file/export/ply_binary': '导出PLY(二进制)',
'menubar/file/export/stl': '导出STL',
'menubar/file/export/stl_binary': '导出STL(二进制)',
'menubar/file/publish': '发布',
......
......@@ -36,6 +36,7 @@ const assets = [
'../examples/js/exporters/ColladaExporter.js',
'../examples/js/exporters/GLTFExporter.js',
'../examples/js/exporters/OBJExporter.js',
'../examples/js/exporters/PLYExporter.js',
'../examples/js/exporters/STLExporter.js',
'../examples/js/renderers/Projector.js',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册