Browse Source

GLTF export texture names

Bengt Ove Sannes 6 years ago
parent
commit
aecc925c38
2 changed files with 8 additions and 0 deletions
  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 );
 			outputJSON.textures.push( gltfTexture );
 
 
 			var index = outputJSON.textures.length - 1;
 			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 );
 			outputJSON.textures.push( gltfTexture );
 
 
 			var index = outputJSON.textures.length - 1;
 			var index = outputJSON.textures.length - 1;