Преглед на файлове

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

GLTF export texture names
Mr.doob преди 6 години
родител
ревизия
9769ae4671
променени са 2 файла, в които са добавени 12 реда и са изтрити 0 реда
  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;