浏览代码

OBJExporter: log material names

makc 8 年之前
父节点
当前提交
14c48aa3e5
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      examples/js/exporters/OBJExporter.js

+ 5 - 0
examples/js/exporters/OBJExporter.js

@@ -49,6 +49,11 @@ THREE.OBJExporter.prototype = {
 				// name of the mesh object
 				output += 'o ' + mesh.name + '\n';
 
+				// name of the mesh material
+				if ( mesh.material && mesh.material.name ) {
+					output += 'usemtl ' + mesh.material.name + '\n';
+				}
+
 				// vertices
 
 				if( vertices !== undefined ) {