Browse Source

OBJExporter: log material names

makc 8 năm trước cách đây
mục cha
commit
14c48aa3e5
1 tập tin đã thay đổi với 5 bổ sung0 xóa
  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 ) {