浏览代码

GLTF export texture names

Bengt Ove Sannes 6 年之前
父节点
当前提交
aecc925c38
共有 2 个文件被更改,包括 8 次插入0 次删除
  1. 4 0
      examples/js/exporters/GLTFExporter.js
  2. 4 0
      examples/jsm/exporters/GLTFExporter.js

+ 4 - 0
examples/js/exporters/GLTFExporter.js

@@ -867,6 +867,10 @@ THREE.GLTFExporter.prototype = {
 
 			};
 
+			if ( map.name ) {
+				gltfTexture.name = map.name;
+			}
+
 			outputJSON.textures.push( gltfTexture );
 
 			var index = outputJSON.textures.length - 1;

+ 4 - 0
examples/jsm/exporters/GLTFExporter.js

@@ -891,6 +891,10 @@ GLTFExporter.prototype = {
 
 			};
 
+			if ( map.name ) {
+				gltfTexture.name = map.name;
+			}
+
 			outputJSON.textures.push( gltfTexture );
 
 			var index = outputJSON.textures.length - 1;