Browse Source

Merge pull request #17344 from bovesan/gltf-export-texture-names

GLTF export texture names
Mr.doob 6 years ago
parent
commit
9769ae4671
2 changed files with 12 additions and 0 deletions
  1. 6 0
      examples/js/exporters/GLTFExporter.js
  2. 6 0
      examples/jsm/exporters/GLTFExporter.js

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

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

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

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